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

Function rss_soft_m2cpuid_v4

freebsd/netinet/in_rss.c:376–399  ·  view source on GitHub ↗

* Similar to rss_m2cpuid, but designed to be used by the IP 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

374 * XXX TODO: definitely want statistics here!
375 */
376struct mbuf *
377rss_soft_m2cpuid_v4(struct mbuf *m, uintptr_t source, u_int *cpuid)
378{
379 uint32_t hash_val, hash_type;
380 int ret;
381
382 M_ASSERTPKTHDR(m);
383
384 ret = rss_mbuf_software_hash_v4(m, RSS_HASH_PKT_INGRESS,
385 &hash_val, &hash_type);
386 if (ret > 0) {
387 /* mbuf has a valid hash already; don't need to modify it */
388 *cpuid = rss_hash2cpuid(m->m_pkthdr.flowid, M_HASHTYPE_GET(m));
389 } else if (ret == 0) {
390 /* hash was done; update */
391 m->m_pkthdr.flowid = hash_val;
392 M_HASHTYPE_SET(m, hash_type);
393 *cpuid = rss_hash2cpuid(m->m_pkthdr.flowid, M_HASHTYPE_GET(m));
394 } else { /* ret < 0 */
395 /* no hash was done */
396 *cpuid = NETISR_CPUID_NONE;
397 }
398 return (m);
399}

Callers

nothing calls this directly

Calls 2

rss_hash2cpuidFunction · 0.85

Tested by

no test coverage detected