MCPcopy Create free account
hub / github.com/F-Stack/f-stack / in6_pcbgroup_bytuple

Function in6_pcbgroup_bytuple

freebsd/netinet6/in6_pcbgroup.c:99–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99struct inpcbgroup *
100in6_pcbgroup_bytuple(struct inpcbinfo *pcbinfo, const struct in6_addr *laddrp,
101 u_short lport, const struct in6_addr *faddrp, u_short fport)
102{
103 uint32_t hash;
104
105 /*
106 * RSS note: we pass foreign addr/port as source, and local addr/port
107 * as destination, as we want to align with what the hardware is
108 * doing.
109 */
110 switch (pcbinfo->ipi_hashfields) {
111 case IPI_HASHFIELDS_4TUPLE:
112#ifdef RSS
113 hash = rss_hash_ip6_4tuple(faddrp, fport, laddrp, lport);
114#else
115 hash = faddrp->s6_addr32[3] ^ fport;
116#endif
117 break;
118
119 case IPI_HASHFIELDS_2TUPLE:
120#ifdef RSS
121 hash = rss_hash_ip6_2tuple(faddrp, laddrp);
122#else
123 hash = faddrp->s6_addr32[3] ^ laddrp->s6_addr32[3];
124#endif
125 break;
126
127 default:
128 hash = 0;
129 }
130 return (&pcbinfo->ipi_pcbgroups[in6_pcbgroup_getbucket(pcbinfo,
131 hash)]);
132}
133
134struct inpcbgroup *
135in6_pcbgroup_byinpcb(struct inpcb *inp)

Callers 3

in6_pcblookupFunction · 0.85
in6_pcblookup_mbufFunction · 0.85
in6_pcbgroup_byinpcbFunction · 0.85

Calls 3

rss_hash_ip6_4tupleFunction · 0.85
rss_hash_ip6_2tupleFunction · 0.85
in6_pcbgroup_getbucketFunction · 0.85

Tested by

no test coverage detected