* 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! */
| 397 | * XXX TODO: definitely want statistics here! |
| 398 | */ |
| 399 | struct mbuf * |
| 400 | rss_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 | } |
nothing calls this directly
no test coverage detected