* [dpdk-users] Is rte_ring_dequeue_burst/rte_ring_enqueue_burst just memory address copy from enqueue side to dequeue side?
@ 2019-06-06 3:31 Huai-En Tseng
0 siblings, 0 replies; only message in thread
From: Huai-En Tseng @ 2019-06-06 3:31 UTC (permalink / raw)
To: users
Hi,
I am curious about rte_ring_dequeue and rte_ring_enqueue.
I notice in rte_ring.h, the dequeue and enqueue mechanism, DEQUEUE_PTRS and ENQUEUE_PTRS marcos, both are just memory address assignment.
At the same time, I get a strange bug in my project.
Thread 1 continually enqueue 1 packet every time.
Thread 2 also continually dequeue dequeue packets whatever it can and does some logic operation.
However, when thread 2 does some operation taking too long time such as printf and file io or thread 1 enqueue enqueue packet twice in very short time interval.
The packet thread 2 dequeue will be the next packet content which thread 1 enqueue.
I assume that despite thread 2 dequeue 1 packet, but it actually dequeue the memory address.
Then the cons and prod pointer do dequeue operation and thread 1 is ready to enqueue next packet to the memory address which thread 2 just dequeue.
However, at the same time, thread 2 is using this memory address and it is the root cause.
Is my assumption correct or something I miss?
If my assumption is correct, is there any method can avoid this except using memcpy?
Thanks all.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-06-06 3:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-06 3:31 [dpdk-users] Is rte_ring_dequeue_burst/rte_ring_enqueue_burst just memory address copy from enqueue side to dequeue side? Huai-En Tseng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).