Skip to contentSkip to conversation

Does the rte_eth_tx_burst() function is multi-threaded safe when sending pkt in same port and same queue ?

DISCUSSION chen_lp 3 participants 3 messages Jan 9, 2014 1 message not in the archive

lore
Share & tools
lore

chen_lp

author
#0 lore raw

---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you.
---------------------------------------------------------------------------------------------------

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

The rx and tx functions are safe only if a queue is not shared by multiple threads (or the threads synchronize through some other mechanism). The safest design is to only use a queue on a single core. You will see different architectures in the examples. Some use one queue per core, and others use separate receive and transmit cores.

Quoted 10 lines · chen_lp

---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you.
---------------------------------------------------------------------------------------------------

#3 lore raw

But when I read the code of l2fwd (v1.5.1 examples), I found that two cores share only one queue of a port.

And it doesn't use any lock or other mechanism to ensure the safety.

How is it OK?

----- Original Message -----
From: "Stephen Hemminger" <[email protected]>
To: "chen_lp" <[email protected]>
Cc: <[email protected]>
Sent: Thursday, January 09, 2014 2:28 PM
Subject: Re: [dpdk-dev] Does the rte_eth_tx_burst() function is multi-threaded safe when sending pkt in same port and same queue ?

Quoted 6 lines

The rx and tx functions are safe only if a queue is not shared by multiple threads (or the threads synchronize through some other mechanism). The safest design is to only use a queue on a single core. You will see different architectures in the examples. Some use one queue per core, and others use separate receive and transmit cores.

Quoted 11 lines
Quoted 10 lines · chen_lp

---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you.
---------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you.
---------------------------------------------------------------------------------------------------