aboutsummaryrefslogtreecommitdiffstats
path: root/lib/librte_ring/rte_ring.h
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2017-11-13 10:38:04 +0000
committerLuca Boccassi <luca.boccassi@gmail.com>2017-11-13 10:38:39 +0000
commit976be7358289d46cd5ed8131bbf2e2c5a6838d3c (patch)
tree5e6f873dd1658446539f9d4621e2d16f559c867d /lib/librte_ring/rte_ring.h
parent055c52583a2794da8ba1e85a48cce3832372b12f (diff)
New upstream version 17.11~rc4
Change-Id: I5cc288310eaa28cb8c2e475afce5e19f8c08ba1e Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'lib/librte_ring/rte_ring.h')
-rw-r--r--lib/librte_ring/rte_ring.h12
1 files changed, 12 insertions, 0 deletions
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