How to compute the queue id if I can compute the RSS hash with Software implementation(rte_softrss)?

陌路散爱 提交于 2021-01-05 08:54:55

问题


My NIC is Intel I210 and driver is e1000. DPDK version is latest 19.11.5. I'm trying to do following work:

  1. compute RSS hash by software (it should be save with mbuf->hash.rss);
  2. 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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!