DPDK usage discussions
 help / color / Atom feed
* [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, back to index

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

DPDK usage discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/users/0 users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 users users/ http://inbox.dpdk.org/users \
		users@dpdk.org
	public-inbox-index users


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.users


AGPL code for this site: git clone https://public-inbox.org/ public-inbox