git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ring/c11: keep deterministic order allowing retry to work
[dpdk.git]
/
lib
/
librte_ring
/
rte_ring_c11_mem.h
diff --git
a/lib/librte_ring/rte_ring_c11_mem.h
b/lib/librte_ring/rte_ring_c11_mem.h
index
7bc74a4
..
dc49a99
100644
(file)
--- a/
lib/librte_ring/rte_ring_c11_mem.h
+++ b/
lib/librte_ring/rte_ring_c11_mem.h
@@
-66,6
+66,9
@@
__rte_ring_move_prod_head(struct rte_ring *r, unsigned int is_sp,
/* Reset n to the initial burst count */
n = max;
/* Reset n to the initial burst count */
n = max;
+ /* Ensure the head is read before tail */
+ __atomic_thread_fence(__ATOMIC_ACQUIRE);
+
/* load-acquire synchronize with store-release of ht->tail
* in update_tail.
*/
/* load-acquire synchronize with store-release of ht->tail
* in update_tail.
*/
@@
-139,6
+142,9
@@
__rte_ring_move_cons_head(struct rte_ring *r, int is_sc,
/* Restore n as it may change every loop */
n = max;
/* Restore n as it may change every loop */
n = max;
+ /* Ensure the head is read before tail */
+ __atomic_thread_fence(__ATOMIC_ACQUIRE);
+
/* this load-acquire synchronize with store-release of ht->tail
* in update_tail.
*/
/* this load-acquire synchronize with store-release of ht->tail
* in update_tail.
*/