This month, has been engaged in Ixgbe RSS, hoping to make the package balanced, the results are unsuccessful, but the network card to understand the principle of more depth.
1, the network card hardware through the network cable or fiber packet.
2, the network card RSS function According to the net five to calculate the 32bit hash value,
The mapping relationship between the low 7 bits (0-127) and the NIC queue based on the hash value,
Put the received packets on a queue.
3, do the CPU affinity binding, a queue of packets on a corresponding core to deal with.
The Reta register is responsible for establishing a mapping relationship between the low 7 bits of the hash value and the NIC queue, and the Ixge driver's default mapping relationship is fairly balanced.
Take 12 queues For example, mapping relationships such as:
Now the problem with the online machine is: Because of the large amount of data exchanged between the Haproxy in the LAN machine, some
Five-tuple comparison concentration, resulting in a low 7-bit comparison of hash values, resulting in queue comparison, the corresponding core load is also large
As shown in.
I think of two ways to avoid a high core usage rate.
Method One, adopt Round-robin strategy, periodically modify the Reta register, the first time is [0-11], the second time is [1-11,0],
The third time is [2-11,0,1] and so on, so that each queue packet looks more balanced, but does not change the core usage.
Method Two, generate random values, according to how much to determine the weight, and finally based on the weight to generate the queue number,
In this way, fewer queues are received, and fewer queues are received.
However, the actual test of both methods have no effect, can not get through.
Ixgbe RSS Principle Analysis