I am using Mellanox Technologies MT27800 Family [ConnectX-5], using dpdk multi rx queue with rss "ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCP"
I analyzer traffic and need all packet of same session to arrive to the same process ( session for now can be ip+port)
So Packet that have the same ip + port arrive to the same queue.
But If some packet are ip fragmented, packet arrive to different process. It is a problem!
How can i calculate the hash value in the c++ code, like it is done in the card, so i can reassemble packets and send them to the same process like the non fragmented packets
Instead of
ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCPyou can only useETH_RSS_IPto calculate the RSS hash only from the IP addresses of the packet. This way even if the packet is fragmented, segments of the packet will arrive to the same the CPU core.RSS value of the packets can be calculated in the software with using the following library https://doc.dpdk.org/api/rte__thash_8h.html While this option is possible, I would still recommend you to check out the proposed setting of
ETH_RSS_IPonly.When
ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCPis enabled, the RSS function takes IP addresses and src + dst ports to calculate the RSS hash value. As you don't have ports present in the IP fragmented packets, you are unable to compute the same value as non-fragmented IP packets.You either can:
rte_thashlibrary compute the RSS value,ETH_RSS_IPsetting only).As you are only doing load-balancing on CPU cores I think the latter option suits your use-case well enough.