Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/ixl/ixl_txrx.c
Show First 20 Lines • Show All 1,440 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
** i40e_ptype_to_hash: parse the packet type | ** i40e_ptype_to_hash: parse the packet type | ||||
** to determine the appropriate hash. | ** to determine the appropriate hash. | ||||
*/ | */ | ||||
static inline int | static inline int | ||||
ixl_ptype_to_hash(u8 ptype) | ixl_ptype_to_hash(u8 ptype) | ||||
{ | { | ||||
struct i40e_rx_ptype_decoded decoded; | struct i40e_rx_ptype_decoded decoded; | ||||
u8 ex = 0; | |||||
decoded = decode_rx_desc_ptype(ptype); | decoded = decode_rx_desc_ptype(ptype); | ||||
ex = decoded.outer_frag; | |||||
if (!decoded.known) | if (!decoded.known) | ||||
return M_HASHTYPE_OPAQUE_HASH; | return M_HASHTYPE_OPAQUE_HASH; | ||||
if (decoded.outer_ip == I40E_RX_PTYPE_OUTER_L2) | if (decoded.outer_ip == I40E_RX_PTYPE_OUTER_L2) | ||||
return M_HASHTYPE_OPAQUE_HASH; | return M_HASHTYPE_OPAQUE_HASH; | ||||
/* Note: anything that gets to this point is IP */ | /* Note: anything that gets to this point is IP */ | ||||
if (decoded.outer_ip_ver == I40E_RX_PTYPE_OUTER_IPV6) { | if (decoded.outer_ip_ver == I40E_RX_PTYPE_OUTER_IPV6) { | ||||
switch (decoded.inner_prot) { | switch (decoded.inner_prot) { | ||||
case I40E_RX_PTYPE_INNER_PROT_TCP: | case I40E_RX_PTYPE_INNER_PROT_TCP: | ||||
if (ex) | |||||
return M_HASHTYPE_RSS_TCP_IPV6_EX; | |||||
else | |||||
return M_HASHTYPE_RSS_TCP_IPV6; | return M_HASHTYPE_RSS_TCP_IPV6; | ||||
case I40E_RX_PTYPE_INNER_PROT_UDP: | case I40E_RX_PTYPE_INNER_PROT_UDP: | ||||
if (ex) | |||||
return M_HASHTYPE_RSS_UDP_IPV6_EX; | |||||
else | |||||
return M_HASHTYPE_RSS_UDP_IPV6; | return M_HASHTYPE_RSS_UDP_IPV6; | ||||
default: | default: | ||||
if (ex) | |||||
return M_HASHTYPE_RSS_IPV6_EX; | |||||
else | |||||
return M_HASHTYPE_RSS_IPV6; | return M_HASHTYPE_RSS_IPV6; | ||||
} | } | ||||
} | } | ||||
if (decoded.outer_ip_ver == I40E_RX_PTYPE_OUTER_IPV4) { | if (decoded.outer_ip_ver == I40E_RX_PTYPE_OUTER_IPV4) { | ||||
switch (decoded.inner_prot) { | switch (decoded.inner_prot) { | ||||
case I40E_RX_PTYPE_INNER_PROT_TCP: | case I40E_RX_PTYPE_INNER_PROT_TCP: | ||||
return M_HASHTYPE_RSS_TCP_IPV4; | return M_HASHTYPE_RSS_TCP_IPV4; | ||||
case I40E_RX_PTYPE_INNER_PROT_UDP: | case I40E_RX_PTYPE_INNER_PROT_UDP: | ||||
if (ex) | |||||
return M_HASHTYPE_RSS_UDP_IPV4_EX; | |||||
else | |||||
return M_HASHTYPE_RSS_UDP_IPV4; | return M_HASHTYPE_RSS_UDP_IPV4; | ||||
default: | default: | ||||
return M_HASHTYPE_RSS_IPV4; | return M_HASHTYPE_RSS_IPV4; | ||||
} | } | ||||
} | } | ||||
/* We should never get here!! */ | /* We should never get here!! */ | ||||
return M_HASHTYPE_OPAQUE_HASH; | return M_HASHTYPE_OPAQUE_HASH; | ||||
} | } | ||||
#endif /* RSS */ | #endif /* RSS */ | ||||
/********************************************************************* | /********************************************************************* | ||||
▲ Show 20 Lines • Show All 355 Lines • Show Last 20 Lines |