Lines Matching refs:fsp
86 struct ethtool_rx_flow_spec *fsp = in txgbe_get_ethtool_fdir_entry() local
97 if (fsp->location <= rule->sw_idx) in txgbe_get_ethtool_fdir_entry()
101 if (!rule || fsp->location != rule->sw_idx) in txgbe_get_ethtool_fdir_entry()
107 fsp->flow_type = TCP_V4_FLOW; in txgbe_get_ethtool_fdir_entry()
110 fsp->flow_type = UDP_V4_FLOW; in txgbe_get_ethtool_fdir_entry()
113 fsp->flow_type = SCTP_V4_FLOW; in txgbe_get_ethtool_fdir_entry()
116 fsp->flow_type = IP_USER_FLOW; in txgbe_get_ethtool_fdir_entry()
117 fsp->h_u.usr_ip4_spec.ip_ver = ETH_RX_NFC_IP4; in txgbe_get_ethtool_fdir_entry()
118 fsp->h_u.usr_ip4_spec.proto = 0; in txgbe_get_ethtool_fdir_entry()
119 fsp->m_u.usr_ip4_spec.proto = 0; in txgbe_get_ethtool_fdir_entry()
125 fsp->h_u.tcp_ip4_spec.psrc = rule->filter.formatted.src_port; in txgbe_get_ethtool_fdir_entry()
126 fsp->m_u.tcp_ip4_spec.psrc = mask->formatted.src_port; in txgbe_get_ethtool_fdir_entry()
127 fsp->h_u.tcp_ip4_spec.pdst = rule->filter.formatted.dst_port; in txgbe_get_ethtool_fdir_entry()
128 fsp->m_u.tcp_ip4_spec.pdst = mask->formatted.dst_port; in txgbe_get_ethtool_fdir_entry()
129 fsp->h_u.tcp_ip4_spec.ip4src = rule->filter.formatted.src_ip[0]; in txgbe_get_ethtool_fdir_entry()
130 fsp->m_u.tcp_ip4_spec.ip4src = mask->formatted.src_ip[0]; in txgbe_get_ethtool_fdir_entry()
131 fsp->h_u.tcp_ip4_spec.ip4dst = rule->filter.formatted.dst_ip[0]; in txgbe_get_ethtool_fdir_entry()
132 fsp->m_u.tcp_ip4_spec.ip4dst = mask->formatted.dst_ip[0]; in txgbe_get_ethtool_fdir_entry()
133 fsp->h_ext.vlan_etype = rule->filter.formatted.flex_bytes; in txgbe_get_ethtool_fdir_entry()
134 fsp->m_ext.vlan_etype = mask->formatted.flex_bytes; in txgbe_get_ethtool_fdir_entry()
135 fsp->h_ext.data[1] = htonl(rule->filter.formatted.vm_pool); in txgbe_get_ethtool_fdir_entry()
136 fsp->m_ext.data[1] = htonl(mask->formatted.vm_pool); in txgbe_get_ethtool_fdir_entry()
137 fsp->flow_type |= FLOW_EXT; in txgbe_get_ethtool_fdir_entry()
141 fsp->ring_cookie = RX_CLS_FLOW_DISC; in txgbe_get_ethtool_fdir_entry()
143 fsp->ring_cookie = rule->action; in txgbe_get_ethtool_fdir_entry()
201 static int txgbe_flowspec_to_flow_type(struct ethtool_rx_flow_spec *fsp, in txgbe_flowspec_to_flow_type() argument
204 switch (fsp->flow_type & ~FLOW_EXT) { in txgbe_flowspec_to_flow_type()
215 switch (fsp->h_u.usr_ip4_spec.proto) { in txgbe_flowspec_to_flow_type()
226 if (!fsp->m_u.usr_ip4_spec.proto) { in txgbe_flowspec_to_flow_type()
326 struct ethtool_rx_flow_spec *fsp = in txgbe_add_ethtool_fdir_entry() local
341 if (fsp->ring_cookie == RX_CLS_FLOW_DISC) { in txgbe_add_ethtool_fdir_entry()
344 u32 ring = ethtool_get_flow_spec_ring(fsp->ring_cookie); in txgbe_add_ethtool_fdir_entry()
354 if (fsp->location >= ((1024 << TXGBE_FDIR_PBALLOC_64K) - 2)) { in txgbe_add_ethtool_fdir_entry()
366 input->sw_idx = fsp->location; in txgbe_add_ethtool_fdir_entry()
369 if (txgbe_flowspec_to_flow_type(fsp, in txgbe_add_ethtool_fdir_entry()
382 input->filter.formatted.src_ip[0] = fsp->h_u.tcp_ip4_spec.ip4src; in txgbe_add_ethtool_fdir_entry()
383 mask.formatted.src_ip[0] = fsp->m_u.tcp_ip4_spec.ip4src; in txgbe_add_ethtool_fdir_entry()
384 input->filter.formatted.dst_ip[0] = fsp->h_u.tcp_ip4_spec.ip4dst; in txgbe_add_ethtool_fdir_entry()
385 mask.formatted.dst_ip[0] = fsp->m_u.tcp_ip4_spec.ip4dst; in txgbe_add_ethtool_fdir_entry()
386 input->filter.formatted.src_port = fsp->h_u.tcp_ip4_spec.psrc; in txgbe_add_ethtool_fdir_entry()
387 mask.formatted.src_port = fsp->m_u.tcp_ip4_spec.psrc; in txgbe_add_ethtool_fdir_entry()
388 input->filter.formatted.dst_port = fsp->h_u.tcp_ip4_spec.pdst; in txgbe_add_ethtool_fdir_entry()
389 mask.formatted.dst_port = fsp->m_u.tcp_ip4_spec.pdst; in txgbe_add_ethtool_fdir_entry()
391 if (fsp->flow_type & FLOW_EXT) { in txgbe_add_ethtool_fdir_entry()
393 (unsigned char)ntohl(fsp->h_ext.data[1]); in txgbe_add_ethtool_fdir_entry()
395 (unsigned char)ntohl(fsp->m_ext.data[1]); in txgbe_add_ethtool_fdir_entry()
397 fsp->h_ext.vlan_etype; in txgbe_add_ethtool_fdir_entry()
398 mask.formatted.flex_bytes = fsp->m_ext.vlan_etype; in txgbe_add_ethtool_fdir_entry()
425 if (fsp->ring_cookie == RX_CLS_FLOW_DISC) in txgbe_add_ethtool_fdir_entry()
428 input->action = fsp->ring_cookie; in txgbe_add_ethtool_fdir_entry()
476 struct ethtool_rx_flow_spec *fsp = in txgbe_del_ethtool_fdir_entry() local
481 err = txgbe_update_ethtool_fdir_entry(txgbe, NULL, fsp->location); in txgbe_del_ethtool_fdir_entry()