Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet6/in6_rss.c
Show First 20 Lines • Show All 166 Lines • ▼ Show 20 Lines | |||||
* This function doesn't modify the mbuf. It's up to the caller to | * This function doesn't modify the mbuf. It's up to the caller to | ||||
* assign flowid/flowtype as appropriate. | * assign flowid/flowtype as appropriate. | ||||
*/ | */ | ||||
int | int | ||||
rss_mbuf_software_hash_v6(const struct mbuf *m, int dir, uint32_t *hashval, | rss_mbuf_software_hash_v6(const struct mbuf *m, int dir, uint32_t *hashval, | ||||
uint32_t *hashtype) | uint32_t *hashtype) | ||||
{ | { | ||||
const struct ip6_hdr *ip6; | const struct ip6_hdr *ip6; | ||||
const struct ip6_frag *ip6f; | |||||
const struct tcphdr *th; | const struct tcphdr *th; | ||||
const struct udphdr *uh; | const struct udphdr *uh; | ||||
uint32_t flowtype; | uint32_t flowtype; | ||||
uint8_t proto; | uint8_t proto; | ||||
int off, newoff; | int off, newoff; | ||||
int nxt; | int nxt; | ||||
/* | /* | ||||
Show All 31 Lines | rss_mbuf_software_hash_v6(const struct mbuf *m, int dir, uint32_t *hashval, | ||||
* frame it should be re-hashed. | * frame it should be re-hashed. | ||||
*/ | */ | ||||
while (proto != IPPROTO_FRAGMENT) { | while (proto != IPPROTO_FRAGMENT) { | ||||
newoff = ip6_nexthdr(m, off, proto, &nxt); | newoff = ip6_nexthdr(m, off, proto, &nxt); | ||||
if (newoff < 0) | if (newoff < 0) | ||||
break; | break; | ||||
off = newoff; | off = newoff; | ||||
proto = nxt; | proto = nxt; | ||||
} | |||||
/* | |||||
* Ignore the fragment header if this is an "atomic" fragment | |||||
* (offset and m bit set to 0) | |||||
*/ | |||||
if (proto == IPPROTO_FRAGMENT) { | |||||
if (m->m_len < off + sizeof(struct ip6_frag)) { | |||||
RSS_DEBUG("short fragment frame?\n"); | |||||
return (-1); | |||||
} | |||||
ip6f = (const struct ip6_frag *)((c_caddr_t)ip6 + off); | |||||
if ((ip6f->ip6f_offlg & ~IP6F_RESERVED_MASK) == 0) { | |||||
off = ip6_lasthdr(m, off, proto, &nxt); | |||||
if (off < 0) { | |||||
RSS_DEBUG("invalid extension header\n"); | |||||
return (-1); | |||||
} | |||||
proto = nxt; | |||||
} | |||||
} | } | ||||
/* | /* | ||||
* If the mbuf flowid/flowtype matches the packet type, | * If the mbuf flowid/flowtype matches the packet type, | ||||
* and we don't support the 4-tuple version of the given protocol, | * and we don't support the 4-tuple version of the given protocol, | ||||
* then signal to the owner that it can trust the flowid/flowtype | * then signal to the owner that it can trust the flowid/flowtype | ||||
* details. | * details. | ||||
* | * | ||||
▲ Show 20 Lines • Show All 128 Lines • Show Last 20 Lines |