summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerin Jacob <jerin.jacob@caviumnetworks.com>2016-07-24 22:37:40 +0530
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-07-25 17:55:12 +0200
commitc3acd92746c3cf5521e583d3a7a6c63d7980db3a (patch)
tree9186f08ed837f1ff3a38a095a236e5f1c9490da4
parentaaf6065be5fe68fcfbb195caeccdd4cbcdfb56e1 (diff)
downloaddpdk-c3acd92746c3cf5521e583d3a7a6c63d7980db3a.zip
dpdk-c3acd92746c3cf5521e583d3a7a6c63d7980db3a.tar.gz
dpdk-c3acd92746c3cf5521e583d3a7a6c63d7980db3a.tar.xz
ring: fix single consumer dequeue performance
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@caviumnetworks.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
-rw-r--r--lib/librte_ring/rte_ring.h2
1 files changed, 1 insertions, 1 deletions
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;