[dpdk-dev] [PATCH v2] ring: check for zero objects mc dequeue / mp enqueue

Olivier Matz olivier.matz at 6wind.com
Mon Mar 21 13:23:42 CET 2016


Hi,

On 03/17/2016 04:49 PM, Lazaros Koromilas wrote:
> 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.
> 
> Signed-off-by: Lazaros Koromilas <l at nofutznetworks.com>

Acked-by: Olivier Matz <olivier.matz at 6wind.com>



More information about the dev mailing list