Kamiar
Kamiar

Reputation: 174

How to direct packets belonging to a TCP connection to a specific lcore in DPDK?

We want a specific lcore to receive packets belonging to the both sides of a TCP connection. I.e. packets going from client to Server (CtoS) and those which going from Server to Client (StoC), both be directed to a single lcore. It seems that the RSS guarantees the packets belonging to a stream (one way data flow) to be directed to the same lcore. To direct both side of a direction to the same lcore we need a symmetric RSS.

Upvotes: 1

Views: 1568

Answers (1)

mshohayeb
mshohayeb

Reputation: 473

Symmetrical hashing is not directly supported yet by DPDK (as of 16.07). However, there are workarounds discussed in the mailing list here. You might also find this helpful.

Another option is to do the load balancing yourself. For example, you'd have an lcore that pulls on the NIC queues, parse the packet, extract the source/destination ips and ports and calculate a symmetric value (an easy approach would be (src_port + dst_port + src_ip + dst_ip) % NUM_OF_SOFTWARE_RINGS

For each lcore worker you'd need to have an rte_ring to connect the load balancing lcore with it. Note that this approach is not nearly as performant as direct RSS.

Upvotes: 3

Related Questions