From: Juhamatti Kuusisaari Date: Fri, 15 Jul 2016 04:39:51 +0000 (+0300) Subject: ring: guarantee dequeue ordering before tail update X-Git-Tag: spdx-start~6130 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=ecc7d10e448e;p=dpdk.git 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 Acked-by: Konstantin Ananyev --- diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h index 0e22e6946f..f928324d95 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;