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

Function rss_soft_m2cpuid_v6

freebsd/netinet6/in6_rss.c:399–422  ·  view source on GitHub ↗

* Similar to rss_m2cpuid, but designed to be used by the IPv6 NETISR * on incoming frames. * * If an existing RSS hash exists and it matches what the configured * hashing is, then use it. * * If there's an existing RSS hash but the desired hash is different, * or if there's no useful RSS hash, then calculate it via * the software path. * * XXX TODO: definitely want statistics here! */

Source from the content-addressed store, hash-verified

397 * XXX TODO: definitely want statistics here!
398 */
399struct mbuf *
400rss_soft_m2cpuid_v6(struct mbuf *m, uintptr_t source, u_int *cpuid)
401{
402 uint32_t hash_val, hash_type;
403 int ret;
404
405 M_ASSERTPKTHDR(m);
406
407 ret = rss_mbuf_software_hash_v6(m, RSS_HASH_PKT_INGRESS,
408 &hash_val, &hash_type);
409 if (ret > 0) {
410 /* mbuf has a valid hash already; don't need to modify it */
411 *cpuid = rss_hash2cpuid(m->m_pkthdr.flowid, M_HASHTYPE_GET(m));
412 } else if (ret == 0) {
413 /* hash was done; update */
414 m->m_pkthdr.flowid = hash_val;
415 M_HASHTYPE_SET(m, hash_type);
416 *cpuid = rss_hash2cpuid(m->m_pkthdr.flowid, M_HASHTYPE_GET(m));
417 } else { /* ret < 0 */
418 /* no hash was done */
419 *cpuid = NETISR_CPUID_NONE;
420 }
421 return (m);
422}

Callers

nothing calls this directly

Calls 2

rss_hash2cpuidFunction · 0.85

Tested by

no test coverage detected