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

Function in_pcbgroup_bytuple

freebsd/netinet/in_pcbgroup.c:270–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268}
269
270struct inpcbgroup *
271in_pcbgroup_bytuple(struct inpcbinfo *pcbinfo, struct in_addr laddr,
272 u_short lport, struct in_addr faddr, u_short fport)
273{
274 uint32_t hash;
275
276 /*
277 * RSS note: we pass foreign addr/port as source, and local addr/port
278 * as destination, as we want to align with what the hardware is
279 * doing.
280 */
281 switch (pcbinfo->ipi_hashfields) {
282 case IPI_HASHFIELDS_4TUPLE:
283#ifdef RSS
284 hash = rss_hash_ip4_4tuple(faddr, fport, laddr, lport);
285#else
286 hash = faddr.s_addr ^ fport;
287#endif
288 break;
289
290 case IPI_HASHFIELDS_2TUPLE:
291#ifdef RSS
292 hash = rss_hash_ip4_2tuple(faddr, laddr);
293#else
294 hash = faddr.s_addr ^ laddr.s_addr;
295#endif
296 break;
297
298 default:
299 hash = 0;
300 }
301 return (&pcbinfo->ipi_pcbgroups[in_pcbgroup_getbucket(pcbinfo,
302 hash)]);
303}
304
305struct inpcbgroup *
306in_pcbgroup_byinpcb(struct inpcb *inp)

Callers 3

in_pcblookupFunction · 0.85
in_pcblookup_mbufFunction · 0.85
in_pcbgroup_byinpcbFunction · 0.85

Calls 3

rss_hash_ip4_4tupleFunction · 0.85
rss_hash_ip4_2tupleFunction · 0.85
in_pcbgroup_getbucketFunction · 0.85

Tested by

no test coverage detected