From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=YMCGekUM3geUqh4FPnJRnJV+U8jfpTsotZc6sxoBhCc=; b=LtQU2pf44/kvxZnA9/rhacd2trhSmptrAl718d2SsCm1O7rih0p7KpbCGusEkwqZUH RVvereEQJ8I6LA7kc5+gFYBGn/sxVGrUOCgPGIzJ2xtJBXnLCvvziPqM2VNthkzzqDtZ 3gVa+xPIYFjV1WAltV5wlnoImJPZ+E5ta+wszOicftMumbu6suB0IvuG7m0kSnHPEMqS osr99UcOF1cm0d+ch5J3wP6J47JJqGkUiMpERvYZqjJ7H2B4By38DpuvyEDuub5VEqwQ wCyvfe4rusfRPLDZ7EbpvW3jRmlQrtZW9LZupvfvFqzzBhAB997y9Y7AkuPfpUcQvrHJ 0bmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding; bh=YMCGekUM3geUqh4FPnJRnJV+U8jfpTsotZc6sxoBhCc=; b=YdJjWIUq3jFz5fT55kNCJgF98CnZfsjSIDm9ZuwZp8gIUNXjv5Dd8n7ea23I11Fdbt OB35uwIWpPZVIksKV7u+/3QBaDnY55Je5faie0+3VlxIzMIonP3Pfzr6olt6g9a1coYv a0ys6Rv4R4qVgQ9M8EvYC0m7AsoDmdRSuQ8DlVzTYVNU96Qj7l71s55eEw7eA4vPYGL2 xA3Nf+6YIVeCf1HUkaxbJjZoygpkqCrD3cUkfu2PNAI3Hc0ZiBQFl2N8sfHe6gvK9omy O5h8Hn4wf/onqqlxl4OIsHeJ8L31SQ+JB0tKnO6OL30xO0jnP8DMJeMrXW/V+3SapLTI MzzQ== X-Gm-Message-State: AD7BkJIDBJ1JGQO1OUBssOYe/Wj5VT2MDy7duhJZwjXc8qoLL4+fKygm5Uht9WltaoFTi9Or X-Received: by 10.28.156.146 with SMTP id f140mr19916143wme.99.1458665448992; Tue, 22 Mar 2016 09:50:48 -0700 (PDT) Received: from xps13.localnet (91.111.75.86.rev.sfr.net. [86.75.111.91]) by smtp.gmail.com with ESMTPSA id u4sm31116383wjz.4.2016.03.22.09.50.47 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Mar 2016 09:50:48 -0700 (PDT) From: Thomas Monjalon To: Lazaros Koromilas Cc: dev@dpdk.org, Olivier Matz Date: Tue, 22 Mar 2016 17:49:08 +0100 Message-ID: <1898119.pcWINWvhHk@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <56EFE7CE.9010804@6wind.com> References: <1458229783-15547-1-git-send-email-l@nofutznetworks.com> <56EFE7CE.9010804@6wind.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2] ring: check for zero objects mc dequeue / mp enqueue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 16:50:49 -0000 > > 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