Lines Matching refs:fsp

122 	struct ethtool_rx_flow_spec *fsp;  in ice_get_ethtool_fdir_entry()  local
127 fsp = (struct ethtool_rx_flow_spec *)&cmd->fs; in ice_get_ethtool_fdir_entry()
131 rule = ice_fdir_find_fltr_by_idx(hw, fsp->location); in ice_get_ethtool_fdir_entry()
133 if (!rule || fsp->location != rule->fltr_id) { in ice_get_ethtool_fdir_entry()
138 fsp->flow_type = ice_fltr_to_ethtool_flow(rule->flow_type); in ice_get_ethtool_fdir_entry()
140 memset(&fsp->m_u, 0, sizeof(fsp->m_u)); in ice_get_ethtool_fdir_entry()
141 memset(&fsp->m_ext, 0, sizeof(fsp->m_ext)); in ice_get_ethtool_fdir_entry()
143 switch (fsp->flow_type) { in ice_get_ethtool_fdir_entry()
145 fsp->h_u.ether_spec = rule->eth; in ice_get_ethtool_fdir_entry()
146 fsp->m_u.ether_spec = rule->eth_mask; in ice_get_ethtool_fdir_entry()
149 fsp->h_u.usr_ip4_spec.ip_ver = ETH_RX_NFC_IP4; in ice_get_ethtool_fdir_entry()
150 fsp->h_u.usr_ip4_spec.proto = 0; in ice_get_ethtool_fdir_entry()
151 fsp->h_u.usr_ip4_spec.l4_4_bytes = rule->ip.v4.l4_header; in ice_get_ethtool_fdir_entry()
152 fsp->h_u.usr_ip4_spec.tos = rule->ip.v4.tos; in ice_get_ethtool_fdir_entry()
153 fsp->h_u.usr_ip4_spec.ip4src = rule->ip.v4.src_ip; in ice_get_ethtool_fdir_entry()
154 fsp->h_u.usr_ip4_spec.ip4dst = rule->ip.v4.dst_ip; in ice_get_ethtool_fdir_entry()
155 fsp->m_u.usr_ip4_spec.ip4src = rule->mask.v4.src_ip; in ice_get_ethtool_fdir_entry()
156 fsp->m_u.usr_ip4_spec.ip4dst = rule->mask.v4.dst_ip; in ice_get_ethtool_fdir_entry()
157 fsp->m_u.usr_ip4_spec.ip_ver = 0xFF; in ice_get_ethtool_fdir_entry()
158 fsp->m_u.usr_ip4_spec.proto = 0; in ice_get_ethtool_fdir_entry()
159 fsp->m_u.usr_ip4_spec.l4_4_bytes = rule->mask.v4.l4_header; in ice_get_ethtool_fdir_entry()
160 fsp->m_u.usr_ip4_spec.tos = rule->mask.v4.tos; in ice_get_ethtool_fdir_entry()
165 fsp->h_u.tcp_ip4_spec.psrc = rule->ip.v4.src_port; in ice_get_ethtool_fdir_entry()
166 fsp->h_u.tcp_ip4_spec.pdst = rule->ip.v4.dst_port; in ice_get_ethtool_fdir_entry()
167 fsp->h_u.tcp_ip4_spec.ip4src = rule->ip.v4.src_ip; in ice_get_ethtool_fdir_entry()
168 fsp->h_u.tcp_ip4_spec.ip4dst = rule->ip.v4.dst_ip; in ice_get_ethtool_fdir_entry()
169 fsp->m_u.tcp_ip4_spec.psrc = rule->mask.v4.src_port; in ice_get_ethtool_fdir_entry()
170 fsp->m_u.tcp_ip4_spec.pdst = rule->mask.v4.dst_port; in ice_get_ethtool_fdir_entry()
171 fsp->m_u.tcp_ip4_spec.ip4src = rule->mask.v4.src_ip; in ice_get_ethtool_fdir_entry()
172 fsp->m_u.tcp_ip4_spec.ip4dst = rule->mask.v4.dst_ip; in ice_get_ethtool_fdir_entry()
175 fsp->h_u.usr_ip6_spec.l4_4_bytes = rule->ip.v6.l4_header; in ice_get_ethtool_fdir_entry()
176 fsp->h_u.usr_ip6_spec.tclass = rule->ip.v6.tc; in ice_get_ethtool_fdir_entry()
177 fsp->h_u.usr_ip6_spec.l4_proto = rule->ip.v6.proto; in ice_get_ethtool_fdir_entry()
178 memcpy(fsp->h_u.tcp_ip6_spec.ip6src, rule->ip.v6.src_ip, in ice_get_ethtool_fdir_entry()
180 memcpy(fsp->h_u.tcp_ip6_spec.ip6dst, rule->ip.v6.dst_ip, in ice_get_ethtool_fdir_entry()
182 memcpy(fsp->m_u.tcp_ip6_spec.ip6src, rule->mask.v6.src_ip, in ice_get_ethtool_fdir_entry()
184 memcpy(fsp->m_u.tcp_ip6_spec.ip6dst, rule->mask.v6.dst_ip, in ice_get_ethtool_fdir_entry()
186 fsp->m_u.usr_ip6_spec.l4_4_bytes = rule->mask.v6.l4_header; in ice_get_ethtool_fdir_entry()
187 fsp->m_u.usr_ip6_spec.tclass = rule->mask.v6.tc; in ice_get_ethtool_fdir_entry()
188 fsp->m_u.usr_ip6_spec.l4_proto = rule->mask.v6.proto; in ice_get_ethtool_fdir_entry()
193 memcpy(fsp->h_u.tcp_ip6_spec.ip6src, rule->ip.v6.src_ip, in ice_get_ethtool_fdir_entry()
195 memcpy(fsp->h_u.tcp_ip6_spec.ip6dst, rule->ip.v6.dst_ip, in ice_get_ethtool_fdir_entry()
197 fsp->h_u.tcp_ip6_spec.psrc = rule->ip.v6.src_port; in ice_get_ethtool_fdir_entry()
198 fsp->h_u.tcp_ip6_spec.pdst = rule->ip.v6.dst_port; in ice_get_ethtool_fdir_entry()
199 memcpy(fsp->m_u.tcp_ip6_spec.ip6src, in ice_get_ethtool_fdir_entry()
202 memcpy(fsp->m_u.tcp_ip6_spec.ip6dst, in ice_get_ethtool_fdir_entry()
205 fsp->m_u.tcp_ip6_spec.psrc = rule->mask.v6.src_port; in ice_get_ethtool_fdir_entry()
206 fsp->m_u.tcp_ip6_spec.pdst = rule->mask.v6.dst_port; in ice_get_ethtool_fdir_entry()
207 fsp->h_u.tcp_ip6_spec.tclass = rule->ip.v6.tc; in ice_get_ethtool_fdir_entry()
208 fsp->m_u.tcp_ip6_spec.tclass = rule->mask.v6.tc; in ice_get_ethtool_fdir_entry()
215 fsp->ring_cookie = RX_CLS_FLOW_DISC; in ice_get_ethtool_fdir_entry()
217 fsp->ring_cookie = rule->orig_q_index; in ice_get_ethtool_fdir_entry()
219 idx = ice_ethtool_flow_to_fltr(fsp->flow_type); in ice_get_ethtool_fdir_entry()
485 ice_parse_rx_flow_user_data(struct ethtool_rx_flow_spec *fsp, in ice_parse_rx_flow_user_data() argument
491 if (!(fsp->flow_type & FLOW_EXT)) in ice_parse_rx_flow_user_data()
494 value = be64_to_cpu(*((__force __be64 *)fsp->h_ext.data)); in ice_parse_rx_flow_user_data()
495 mask = be64_to_cpu(*((__force __be64 *)fsp->m_ext.data)); in ice_parse_rx_flow_user_data()
1212 struct ethtool_rx_flow_spec *fsp) in ice_fdir_vlan_valid() argument
1214 if (fsp->m_ext.vlan_etype && !eth_type_vlan(fsp->h_ext.vlan_etype)) in ice_fdir_vlan_valid()
1217 if (fsp->m_ext.vlan_tci && ntohs(fsp->h_ext.vlan_tci) >= VLAN_N_VID) in ice_fdir_vlan_valid()
1221 if (fsp->m_u.ether_spec.h_proto && fsp->m_ext.vlan_tci && in ice_fdir_vlan_valid()
1222 !fsp->m_ext.vlan_etype) { in ice_fdir_vlan_valid()
1329 ice_cfg_fdir_xtrct_seq(struct ice_pf *pf, struct ethtool_rx_flow_spec *fsp, in ice_cfg_fdir_xtrct_seq() argument
1350 switch (fsp->flow_type & ~FLOW_EXT) { in ice_cfg_fdir_xtrct_seq()
1352 ret = ice_set_fdir_ip4_seg(seg, &fsp->m_u.tcp_ip4_spec, in ice_cfg_fdir_xtrct_seq()
1357 ret = ice_set_fdir_ip4_seg(seg, &fsp->m_u.tcp_ip4_spec, in ice_cfg_fdir_xtrct_seq()
1362 ret = ice_set_fdir_ip4_seg(seg, &fsp->m_u.tcp_ip4_spec, in ice_cfg_fdir_xtrct_seq()
1367 ret = ice_set_fdir_ip4_usr_seg(seg, &fsp->m_u.usr_ip4_spec, in ice_cfg_fdir_xtrct_seq()
1371 ret = ice_set_fdir_ip6_seg(seg, &fsp->m_u.tcp_ip6_spec, in ice_cfg_fdir_xtrct_seq()
1376 ret = ice_set_fdir_ip6_seg(seg, &fsp->m_u.tcp_ip6_spec, in ice_cfg_fdir_xtrct_seq()
1381 ret = ice_set_fdir_ip6_seg(seg, &fsp->m_u.tcp_ip6_spec, in ice_cfg_fdir_xtrct_seq()
1386 ret = ice_set_fdir_ip6_usr_seg(seg, &fsp->m_u.usr_ip6_spec, in ice_cfg_fdir_xtrct_seq()
1390 ret = ice_set_ether_flow_seg(dev, seg, &fsp->m_u.ether_spec); in ice_cfg_fdir_xtrct_seq()
1391 if (!ret && (fsp->m_ext.vlan_etype || fsp->m_ext.vlan_tci)) { in ice_cfg_fdir_xtrct_seq()
1392 if (!ice_fdir_vlan_valid(dev, fsp)) { in ice_cfg_fdir_xtrct_seq()
1396 ret = ice_set_fdir_vlan_seg(seg, &fsp->m_ext); in ice_cfg_fdir_xtrct_seq()
1420 fltr_idx = ice_ethtool_flow_to_fltr(fsp->flow_type & ~FLOW_EXT); in ice_cfg_fdir_xtrct_seq()
1765 struct ethtool_rx_flow_spec *fsp = in ice_del_fdir_ethtool() local
1784 val = ice_fdir_update_list_entry(pf, NULL, fsp->location); in ice_del_fdir_ethtool()
1830 ice_set_fdir_input_set(struct ice_vsi *vsi, struct ethtool_rx_flow_spec *fsp, in ice_set_fdir_input_set() argument
1841 if (!vsi || !fsp || !input) in ice_set_fdir_input_set()
1848 if (fsp->ring_cookie == RX_CLS_FLOW_DISC) { in ice_set_fdir_input_set()
1851 u32 ring = ethtool_get_flow_spec_ring(fsp->ring_cookie); in ice_set_fdir_input_set()
1852 u8 vf = ethtool_get_flow_spec_ring_vf(fsp->ring_cookie); in ice_set_fdir_input_set()
1868 input->fltr_id = fsp->location; in ice_set_fdir_input_set()
1870 flow_type = fsp->flow_type & ~FLOW_EXT; in ice_set_fdir_input_set()
1883 if (fsp->flow_type & FLOW_EXT) { in ice_set_fdir_input_set()
1884 memcpy(input->ext_data.usr_def, fsp->h_ext.data, in ice_set_fdir_input_set()
1886 input->ext_data.vlan_type = fsp->h_ext.vlan_etype; in ice_set_fdir_input_set()
1887 input->ext_data.vlan_tag = fsp->h_ext.vlan_tci; in ice_set_fdir_input_set()
1888 memcpy(input->ext_mask.usr_def, fsp->m_ext.data, in ice_set_fdir_input_set()
1890 input->ext_mask.vlan_type = fsp->m_ext.vlan_etype; in ice_set_fdir_input_set()
1891 input->ext_mask.vlan_tag = fsp->m_ext.vlan_tci; in ice_set_fdir_input_set()
1898 input->ip.v4.dst_port = fsp->h_u.tcp_ip4_spec.pdst; in ice_set_fdir_input_set()
1899 input->ip.v4.src_port = fsp->h_u.tcp_ip4_spec.psrc; in ice_set_fdir_input_set()
1900 input->ip.v4.dst_ip = fsp->h_u.tcp_ip4_spec.ip4dst; in ice_set_fdir_input_set()
1901 input->ip.v4.src_ip = fsp->h_u.tcp_ip4_spec.ip4src; in ice_set_fdir_input_set()
1902 input->mask.v4.dst_port = fsp->m_u.tcp_ip4_spec.pdst; in ice_set_fdir_input_set()
1903 input->mask.v4.src_port = fsp->m_u.tcp_ip4_spec.psrc; in ice_set_fdir_input_set()
1904 input->mask.v4.dst_ip = fsp->m_u.tcp_ip4_spec.ip4dst; in ice_set_fdir_input_set()
1905 input->mask.v4.src_ip = fsp->m_u.tcp_ip4_spec.ip4src; in ice_set_fdir_input_set()
1908 input->ip.v4.dst_ip = fsp->h_u.usr_ip4_spec.ip4dst; in ice_set_fdir_input_set()
1909 input->ip.v4.src_ip = fsp->h_u.usr_ip4_spec.ip4src; in ice_set_fdir_input_set()
1910 input->ip.v4.l4_header = fsp->h_u.usr_ip4_spec.l4_4_bytes; in ice_set_fdir_input_set()
1911 input->ip.v4.proto = fsp->h_u.usr_ip4_spec.proto; in ice_set_fdir_input_set()
1912 input->ip.v4.ip_ver = fsp->h_u.usr_ip4_spec.ip_ver; in ice_set_fdir_input_set()
1913 input->ip.v4.tos = fsp->h_u.usr_ip4_spec.tos; in ice_set_fdir_input_set()
1914 input->mask.v4.dst_ip = fsp->m_u.usr_ip4_spec.ip4dst; in ice_set_fdir_input_set()
1915 input->mask.v4.src_ip = fsp->m_u.usr_ip4_spec.ip4src; in ice_set_fdir_input_set()
1916 input->mask.v4.l4_header = fsp->m_u.usr_ip4_spec.l4_4_bytes; in ice_set_fdir_input_set()
1917 input->mask.v4.proto = fsp->m_u.usr_ip4_spec.proto; in ice_set_fdir_input_set()
1918 input->mask.v4.ip_ver = fsp->m_u.usr_ip4_spec.ip_ver; in ice_set_fdir_input_set()
1919 input->mask.v4.tos = fsp->m_u.usr_ip4_spec.tos; in ice_set_fdir_input_set()
1924 memcpy(input->ip.v6.dst_ip, fsp->h_u.usr_ip6_spec.ip6dst, in ice_set_fdir_input_set()
1926 memcpy(input->ip.v6.src_ip, fsp->h_u.usr_ip6_spec.ip6src, in ice_set_fdir_input_set()
1928 input->ip.v6.dst_port = fsp->h_u.tcp_ip6_spec.pdst; in ice_set_fdir_input_set()
1929 input->ip.v6.src_port = fsp->h_u.tcp_ip6_spec.psrc; in ice_set_fdir_input_set()
1930 input->ip.v6.tc = fsp->h_u.tcp_ip6_spec.tclass; in ice_set_fdir_input_set()
1931 memcpy(input->mask.v6.dst_ip, fsp->m_u.tcp_ip6_spec.ip6dst, in ice_set_fdir_input_set()
1933 memcpy(input->mask.v6.src_ip, fsp->m_u.tcp_ip6_spec.ip6src, in ice_set_fdir_input_set()
1935 input->mask.v6.dst_port = fsp->m_u.tcp_ip6_spec.pdst; in ice_set_fdir_input_set()
1936 input->mask.v6.src_port = fsp->m_u.tcp_ip6_spec.psrc; in ice_set_fdir_input_set()
1937 input->mask.v6.tc = fsp->m_u.tcp_ip6_spec.tclass; in ice_set_fdir_input_set()
1940 memcpy(input->ip.v6.dst_ip, fsp->h_u.usr_ip6_spec.ip6dst, in ice_set_fdir_input_set()
1942 memcpy(input->ip.v6.src_ip, fsp->h_u.usr_ip6_spec.ip6src, in ice_set_fdir_input_set()
1944 input->ip.v6.l4_header = fsp->h_u.usr_ip6_spec.l4_4_bytes; in ice_set_fdir_input_set()
1945 input->ip.v6.tc = fsp->h_u.usr_ip6_spec.tclass; in ice_set_fdir_input_set()
1948 if (!fsp->m_u.usr_ip6_spec.l4_proto) in ice_set_fdir_input_set()
1951 input->ip.v6.proto = fsp->h_u.usr_ip6_spec.l4_proto; in ice_set_fdir_input_set()
1953 memcpy(input->mask.v6.dst_ip, fsp->m_u.usr_ip6_spec.ip6dst, in ice_set_fdir_input_set()
1955 memcpy(input->mask.v6.src_ip, fsp->m_u.usr_ip6_spec.ip6src, in ice_set_fdir_input_set()
1957 input->mask.v6.l4_header = fsp->m_u.usr_ip6_spec.l4_4_bytes; in ice_set_fdir_input_set()
1958 input->mask.v6.tc = fsp->m_u.usr_ip6_spec.tclass; in ice_set_fdir_input_set()
1959 input->mask.v6.proto = fsp->m_u.usr_ip6_spec.l4_proto; in ice_set_fdir_input_set()
1962 input->eth = fsp->h_u.ether_spec; in ice_set_fdir_input_set()
1963 input->eth_mask = fsp->m_u.ether_spec; in ice_set_fdir_input_set()
1983 struct ethtool_rx_flow_spec *fsp; in ice_add_fdir_ethtool() local
2009 fsp = (struct ethtool_rx_flow_spec *)&cmd->fs; in ice_add_fdir_ethtool()
2011 if (ice_parse_rx_flow_user_data(fsp, &userdata)) in ice_add_fdir_ethtool()
2014 if (fsp->flow_type & FLOW_MAC_EXT) in ice_add_fdir_ethtool()
2017 ret = ice_cfg_fdir_xtrct_seq(pf, fsp, &userdata); in ice_add_fdir_ethtool()
2022 if (fsp->location >= max_location) { in ice_add_fdir_ethtool()
2030 if (!ice_fdir_find_fltr_by_idx(hw, fsp->location) && in ice_add_fdir_ethtool()
2040 ret = ice_set_fdir_input_set(vsi, fsp, input); in ice_add_fdir_ethtool()
2061 ret = ice_fdir_update_list_entry(pf, input, fsp->location); in ice_add_fdir_ethtool()