From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2] ring: check for zero objects mc dequeue / mp enqueue Date: Tue, 22 Mar 2016 17:49:08 +0100 Message-ID: <1898119.pcWINWvhHk@xps13> References: <1458229783-15547-1-git-send-email-l@nofutznetworks.com> <56EFE7CE.9010804@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, Olivier Matz To: Lazaros Koromilas Return-path: Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by dpdk.org (Postfix) with ESMTP id 263FA2BF8 for ; Tue, 22 Mar 2016 17:50:49 +0100 (CET) Received: by mail-wm0-f42.google.com with SMTP id p65so201026907wmp.1 for ; Tue, 22 Mar 2016 09:50:49 -0700 (PDT) In-Reply-To: <56EFE7CE.9010804@6wind.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > > 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 > > Acked-by: Olivier Matz Applied, thanks