summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJuhamatti Kuusisaari <juhamatti.kuusisaari@coriant.com>2016-07-15 07:39:51 +0300
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-07-21 23:28:30 +0200
commitecc7d10e448e91d01b821499baa755ca6a92115b (patch)
treeeef07d24a73061b4552b9906ef1e3e0b89c22a17 /lib
parenta0bfd57a813f66fcd13c45b91d2fa2d6156a31b4 (diff)
downloaddpdk-ecc7d10e448e91d01b821499baa755ca6a92115b.zip
dpdk-ecc7d10e448e91d01b821499baa755ca6a92115b.tar.gz
dpdk-ecc7d10e448e91d01b821499baa755ca6a92115b.tar.xz
ring: guarantee dequeue ordering before tail update
Consumer queue dequeuing must be guaranteed to be done fully before the tail is updated. This is not guaranteed with a read barrier, changed to a write barrier just before tail update which in practice guarantees correct order of reads and writes. Signed-off-by: Juhamatti Kuusisaari <juhamatti.kuusisaari@coriant.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Diffstat (limited to 'lib')
-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 0e22e69..f928324 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_rmb();
+ rte_smp_wmb();
__RING_STAT_ADD(r, deq_success, n);
r->cons.tail = cons_next;