问题
My NIC is Intel I210 and driver is e1000. DPDK version is latest 19.11.5. I'm trying to do following work:
- compute RSS hash by software (it should be save with mbuf->hash.rss);
- infer the queue id based on the computed hash(it should be save with the real received queue id)
My question is how to infer the queue id based on the hash.
回答1:
For any physical NIC in DPDK the RSS value is calculated by ASIC before injecting the packets into final queue destination. This information is available once the Poll Mode Driver extract from NIC descriptors
and puts in mbuf->hash
. Each NIC and vendor will have their custom gate logic implementing the same, which can be found in the data sheet.
In case of intel i210, one can find in the datasheet v3.6
figure 7-6
while the hash logic pseudo-code is explained as
ComputeHash(input[], N)
For hash-input input[] of length N bytes (8N bits) and a random secret key K of 320 bits
Result = 0;
For each bit b in input[] {
if (b == 1) then Result ^= (left-most 32 bits of K);
shift K left 1 bit position;
}
return Result;
Hence it is not the DPDK PMD which determines the end RSS but the ASIC logic
回答2:
In I210 datasheet 7.1.2.10 chapter, It answers how to compute the queue id based on the hash.
https://www.intel.com/content/www/us/en/design/products-and-solutions/networking-and-io/ethernet-controller-i210-i211/technical-library.html?grouping=EMT_Content%20Type&sort=title:asc
来源:https://stackoverflow.com/questions/64925261/how-to-compute-the-queue-id-if-i-can-compute-the-rss-hash-with-software-implemen