[dpdk-dev] [PATCH] ring: fix sc dequeue performance issue

Jerin Jacob jerin.jacob at caviumnetworks.com
Sun Jul 24 19:07:40 CEST 2016


Use of rte_smb_wmb() instead of rte_smb_rmb() in sc dequeue
function creates the additional overhead of waiting for
all the STOREs to be completed to local buffer from ring buffer
memory. The sc dequeue function demands only LOAD-STORE barrier
where LOADs from ring buffer memory needs to be
completed before tail pointer update. Changing to rte_smb_rmb()
to enable the required LOAD-STORE barrier.

Fixes: ecc7d10e448e ("ring: guarantee dequeue ordering before tail update")

Signed-off-by: Jerin Jacob <jerin.jacob at caviumnetworks.com>
---
 lib/librte_ring/rte_ring.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h
index f928324..0e22e69 100644
--- a/lib/librte_ring/rte_ring.h
+++ b/lib/librte_ring/rte_ring.h
@@ -756,7 +756,7 @@ __rte_ring_sc_do_dequeue(struct rte_ring *r, void **obj_table,
 
 	/* copy in table */
 	DEQUEUE_PTRS();
-	rte_smp_wmb();
+	rte_smp_rmb();
 
 	__RING_STAT_ADD(r, deq_success, n);
 	r->cons.tail = cons_next;
-- 
2.5.5



More information about the dev mailing list