Closed sysoleg closed 8 years ago
Hello, Yes you are right, rte_eth/kni_rx/tx_burst() functions are not thread-safe.
For the kni part, we have one thread for the rx and a spinlock for the tx part. The spinlock is here because all our "forwarding" threads share the same kni device.
For the rteeth*_burst() part (the called in our "forwarding" threads), each thread has different queue, this configuration is stored in qconf. The queues related params of each qconf are set-up in init_port(), in this function we are setting a different rx and tx queue for each threads, so you shall not experience any threading issue.
Note that this part of the code is taken from DPDK's l3fwd example.
If it's not the case for you, I would be interested to know more about your setup.
closing it since no new input.
There is no any internal locking in DPDK library inside the rte_eth_tx_burst() call. Two or more threads going to send packets using the same queue of the given port can lead to race condition.
There are (at least) two posible solutions: