From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 826962BE2; Mon, 6 Aug 2018 11:19:25 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 12E3520D9E; Mon, 6 Aug 2018 05:19:25 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 06 Aug 2018 05:19:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=Ihtcx75zkfCxey8TFJvg7/vzvw mYlTA7fC+acxggdtY=; b=Lnqf/wHqDjVLytvw05ipTvvkuXUuHLxFkPMLUOn2BN oc8rriXIBa70w6plsBGor5CILq79b6mTBBvkivG68RnvIwQwylJlft+3poe/yND+ oS62Nnv5yA7EGdIrW5vnoeWkIbosdTC7dtKRmSpEU8XcZ0QSW1jedRog8CpOAGtv 0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=Ihtcx7 5zkfCxey8TFJvg7/vzvwmYlTA7fC+acxggdtY=; b=q9MSTZh2f4gWgajKl27LGB P90EEyJFDAIaVlSKcAmcycqWuHqIObjjLbhDfvGa8zPqhT3BSu4TrCXnsh78oBEl aVUVMW2TdXhCxUfPeT4o1Ih1xYfLd7M2C8YADn21buYolaaSzQfh/THXhsxJfWaP 5LJKonnE1IZyPPMd5YdoerSv5Uy7C9rBI5jLLdUHIr9IgV/bIZsZS7o7S5Q5BtyY +keJjua8nRTHSgAw0lO6SvL8nkS1rZ9dPy/E9k4se3MMk8YdE96oRthh+O8JghOz 1txdCzzBrG1f7Cp716cI/BHJ/ueg4Iqenj1fZ9Nxt7L8xIxM1KGa8rCMIeubYHIA == X-ME-Proxy: X-ME-Sender: Received: from xps.localnet (114.149.6.93.rev.sfr.net [93.6.149.114]) by mail.messagingengine.com (Postfix) with ESMTPA id 8DA09E455F; Mon, 6 Aug 2018 05:19:22 -0400 (EDT) From: Thomas Monjalon To: Gavin Hu Cc: dev@dpdk.org, Honnappa.Nagarahalli@arm.com, steve.capper@arm.com, Ola.Liljedahl@arm.com, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, jia.he@hxt-semitech.com, stable@dpdk.org Date: Mon, 06 Aug 2018 11:19:20 +0200 Message-ID: <1937068.bZVvs4nVfc@xps> In-Reply-To: <20180806011805.7857-1-gavin.hu@arm.com> References: <20180806011805.7857-1-gavin.hu@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] ring: fix c11 memory ordering issue X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 09:19:25 -0000 Hi, Please start your patch by explaining the issue you are solving. What is the consequence of the bug on the behaviour? What is the scope of the bug? only PPC? 06/08/2018 03:18, Gavin Hu: > 1) In update_tail, read ht->tail using __atomic_load. > 2) In __rte_ring_move_prod_head, move the __atomic_load_n up and out of > the do {} while loop as upon failure the old_head will be updated, > another load is not necessary. > 3) Synchronize the load-acquires of prod.tail and cons.tail with store- > releases of update_tail which releases all ring updates up to the > value of ht->tail. > 4) When calling __atomic_compare_exchange_n, relaxed ordering for both > success and failure, as multiple threads can work independently on > the same end of the ring (either enqueue or dequeue) without > synchronization, not as operating on tail, which has to be finished > in sequence. > > Fixes: 39368ebfc6 ("ring: introduce C11 memory model barrier option") > Cc: stable@dpdk.org > > Reviewed-by: Honnappa Nagarahalli > Reviewed-by: Steve Capper > Reviewed-by: Ola Liljedahl > Signed-off-by: Gavin Hu Your Signed-off-by should be first in the list. These tags are added in the chronological order.