diff options
author | Luca Boccassi <luca.boccassi@gmail.com> | 2017-12-08 17:17:23 +0000 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2017-12-08 17:17:27 +0000 |
commit | 1754d8e45ba3f8b13484dee3c2b8ac4d845f2b74 (patch) | |
tree | db372b59e29883bab5802c65b462c38a01b7b33a /lib/librte_ring/rte_ring.h | |
parent | fc42933813b2ba541bed9ef6b3e616dbf4b762ec (diff) | |
parent | 47d9763a1dd3103d732da9eec350cfc1cd784717 (diff) |
Merge branch 'upstream-16.11-stable' into 16.11.x
Change-Id: Ida57d6d5aedcd4fe3a504a9ced733e73deee76c5
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.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h index 32b8c8d2..c1b311a8 100644 --- a/lib/librte_ring/rte_ring.h +++ b/lib/librte_ring/rte_ring.h @@ -450,6 +450,12 @@ __rte_ring_mp_do_enqueue(struct rte_ring *r, void * const *obj_table, n = max; prod_head = r->prod.head; + + /* add rmb barrier to avoid load/load reorder in weak + * memory model. It is noop on x86 + */ + rte_smp_rmb(); + cons_tail = r->cons.tail; /* The subtraction is done between two unsigned 32bits value * (the result is always modulo 32 bits even if we have @@ -642,6 +648,12 @@ __rte_ring_mc_do_dequeue(struct rte_ring *r, void **obj_table, n = max; cons_head = r->cons.head; + + /* add rmb barrier to avoid load/load reorder in weak + * memory model. It is noop on x86 + */ + rte_smp_rmb(); + 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 |