numam-dpdk/lib/librte_ring
Lazaros Koromilas d097964616 ring: fix deadlock in zero object multi enqueue or dequeue
Issuing a zero objects dequeue with a single consumer has no effect.
Doing so with multiple consumers, can get more than one thread to succeed
the compare-and-set operation and observe starvation or even deadlock in
the while loop that checks for preceding dequeues.  The problematic piece
of code when n = 0:

    cons_next = cons_head + n;
    success = rte_atomic32_cmpset(&r->cons.head, cons_head, cons_next);

The same is possible on the enqueue path.

Fixes: af75078fec ("first public release")

Signed-off-by: Lazaros Koromilas <l@nofutznetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2016-03-22 17:55:16 +01:00
..
Makefile mem: move librte_malloc to eal/common 2015-07-16 13:44:48 +02:00
rte_ring_version.map ring: support freeing 2015-11-04 00:49:59 +01:00
rte_ring.c ring: support freeing 2015-11-04 00:49:59 +01:00
rte_ring.h ring: fix deadlock in zero object multi enqueue or dequeue 2016-03-22 17:55:16 +01:00