Skip to contentSkip to conversation

Sending and receiving on the same port at the same time, from different threads

DISCUSSION Zoltan Kiss 3 participants 3 messages Jan 15, 2016

lore
Share & tools
lore
#0 lore raw

Hi,

I've been asked this question, and I realized I'm not sure about the answer. In other words: can you call rte_eth_tx_burst() and rte_eth_tx_burst() on the same port at the same time from different threads? In theory it seems possible, as you still access different queues (an RX and a TX one), and at least taking a glance at ixgbe vector functions, they don't seem to use common resources while doing RX or TX. But I'm not sure that it's generally true, although I always assumed that it should be true. Have anyone seen a device where it wasn't true?

Regards,

Zoltan

#1 lore raw
Quoted 2 lines · Zoltan Kiss

Can you call rte_eth_tx_burst() and rte_eth_tx_burst() on the same port at the same time from different threads?

In general, yes you can. I did this before in an L4-L7 performance tester, so cores could concentrate on RX or TX to keep the speeds high.

Quoted 1 line

Have anyone seen a device where it wasn't true?

Not specifically. But I didn't go looking for one either.

Matthew.

#2 lore raw
Quoted 4 lines · On Fri, 15 Jan 2016 12:33:14 -0500 Matthew Hall <[email protected]> wrote:
Quoted 2 lines · Zoltan Kiss

Can you call rte_eth_tx_burst() and rte_eth_tx_burst() on the same port at the same time from different threads?

Quoted 8 lines

In general, yes you can. I did this before in an L4-L7 performance tester, so cores could concentrate on RX or TX to keep the speeds high.

Quoted 1 line

Have anyone seen a device where it wasn't true?

Not specifically. But I didn't go looking for one either.

Matthew.

Same port is OK, as long as each thread uses different queues. The device queues are not thread safe; ie two threads can't be pulling/pushing to the same queue.