DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] lib: change rte_ring dequeue to guarantee ordering before tail update
@ 2016-07-15  4:39 Juhamatti Kuusisaari
  2016-07-15 12:22 ` Ananyev, Konstantin
  0 siblings, 1 reply; 12+ messages in thread
From: Juhamatti Kuusisaari @ 2016-07-15  4:39 UTC (permalink / raw)
  To: dev

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>
---
 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 eb45e41..14920af 100644
--- a/lib/librte_ring/rte_ring.h
+++ b/lib/librte_ring/rte_ring.h
@@ -748,7 +748,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;
--
2.9.0


============================================================
The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader
of this message is not the intended recipient, or an employee
or agent responsible for delivering this message to the
intended recipient, you are hereby notified that any reproduction,
dissemination or distribution of this communication is strictly
prohibited. If you have received this communication in error,
please notify us immediately by replying to the message and
deleting it from your computer. Thank you. Coriant-Tellabs
============================================================

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-07-23 12:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-15  4:39 [dpdk-dev] [PATCH] lib: change rte_ring dequeue to guarantee ordering before tail update Juhamatti Kuusisaari
2016-07-15 12:22 ` Ananyev, Konstantin
2016-07-21 21:26   ` Thomas Monjalon
2016-07-23  6:05     ` Jerin Jacob
2016-07-23  9:02       ` Thomas Monjalon
2016-07-23  9:36         ` Jerin Jacob
2016-07-23 10:14           ` Ananyev, Konstantin
2016-07-23 10:38             ` Jerin Jacob
2016-07-23 11:15               ` Ananyev, Konstantin
2016-07-23 11:49                 ` Jerin Jacob
2016-07-23 12:32                   ` Ananyev, Konstantin
2016-07-23 12:35                     ` Jerin Jacob

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).