From 976be7358289d46cd5ed8131bbf2e2c5a6838d3c Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Mon, 13 Nov 2017 10:38:04 +0000 Subject: New upstream version 17.11~rc4 Change-Id: I5cc288310eaa28cb8c2e475afce5e19f8c08ba1e Signed-off-by: Luca Boccassi --- lib/librte_ring/rte_ring.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/librte_ring/rte_ring.h') diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h index 5e9b3b7b..e9244381 100644 --- a/lib/librte_ring/rte_ring.h +++ b/lib/librte_ring/rte_ring.h @@ -409,6 +409,12 @@ __rte_ring_move_prod_head(struct rte_ring *r, int is_sp, n = max; *old_head = r->prod.head; + + /* add rmb barrier to avoid load/load reorder in weak + * memory model. It is noop on x86 + */ + rte_smp_rmb(); + const uint32_t cons_tail = r->cons.tail; /* * The subtraction is done between two unsigned 32bits value @@ -517,6 +523,12 @@ __rte_ring_move_cons_head(struct rte_ring *r, int is_sc, n = max; *old_head = r->cons.head; + + /* add rmb barrier to avoid load/load reorder in weak + * memory model. It is noop on x86 + */ + rte_smp_rmb(); + const uint32_t prod_tail = r->prod.tail; /* The subtraction is done between two unsigned 32bits value * (the result is always modulo 32 bits even if we have -- cgit 1.2.3-korg