From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v8 01/15] eal: introduce atomic exchange operation Date: Fri, 26 Jan 2018 13:54:23 -0800 Message-ID: <20180126135423.29394092@xeon-e3> References: <20180126020151.979-1-stephen@networkplumber.org> <20180126020151.979-2-stephen@networkplumber.org> <3131860.My9xXdrCmY@xps> <20180126172440.GA17280@bricha3-MOBL3.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Thomas Monjalon , dev@dpdk.org, Chao Zhu , konstantin.ananyev@intel.com To: Bruce Richardson Return-path: Received: from mail-pf0-f194.google.com (mail-pf0-f194.google.com [209.85.192.194]) by dpdk.org (Postfix) with ESMTP id 1362C1B016 for ; Fri, 26 Jan 2018 22:54:27 +0100 (CET) Received: by mail-pf0-f194.google.com with SMTP id k19so1129783pfj.5 for ; Fri, 26 Jan 2018 13:54:26 -0800 (PST) In-Reply-To: <20180126172440.GA17280@bricha3-MOBL3.ger.corp.intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, 26 Jan 2018 17:24:40 +0000 Bruce Richardson wrote: > On Fri, Jan 26, 2018 at 06:14:01PM +0100, Thomas Monjalon wrote: > > 26/01/2018 03:01, Stephen Hemminger: > > > To handle atomic update of link status (64 bit), every driver was > > > doing its own version using cmpset. Atomic exchange is a useful > > > primitive in its own right; therefore make it a EAL routine. > > > > > > Signed-off-by: Stephen Hemminger --- > > > .../common/include/arch/ppc_64/rte_atomic.h | 21 +++++- > > > .../common/include/arch/x86/rte_atomic.h | 24 +++++++ > > > .../common/include/arch/x86/rte_atomic_32.h | 12 ++++ > > > .../common/include/arch/x86/rte_atomic_64.h | 12 ++++ > > > lib/librte_eal/common/include/generic/rte_atomic.h | 78 > > > ++++++++++++++++++++++ 5 files changed, 146 insertions(+), 1 > > > deletion(-) > > > > Looks good, thanks. > > > > It probably deserves a review by PPC experts. Adding Chao, maintainer > > of this part. + Bruce and Konstantin for x86 part. > > > Would it not be simpler to use __sync_bool_compare_and_swap compiler > built-in on all supported platforms? Do we really need the per-platform > optimization of this? > > /Bruce Exchange is different than compare and swap. The is nice atomic intrinsic in GCC. The x86 part is in Linux and BSD already.