ring: guarantee dequeue ordering before tail update
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> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
This commit is contained in:
parent
a0bfd57a81
commit
ecc7d10e44
@ -756,7 +756,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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user