From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=e8CDFPtUMg/WhdLdVbGohsmzNg0Vl24eiJU5TYMctP0=; b=SK/q/2vO7sqks4HQhLkLtFLqMOnQVIr+w61Tg6BnJNVVW6lzLTcZVjJUhqTRZReqbf SOPQcJgAo/2ZOubFze1pTVx+j/10g1MuYETmugm7c71OAX+yT7s9HgGAiMUG7Kl96US8 npbcY8Nw3HFTntC8VEKOfzEHs0KfgmQWGsVOii9oCjLCsnwuPapuFT0Ihrj/vZBX7thk 3Bp+QAEOt9cc40f0/qg61J5b4lCQlLtIol4I9CRj1xF+ZTWqXJVLG+kwm1WBw5h8Soh6 iWf7rXa9I06oU351UWtMt5IVhxgGsGiBoWF/jR3eshYymM9/RvS068xfMd/ttFDJX6ih swXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=e8CDFPtUMg/WhdLdVbGohsmzNg0Vl24eiJU5TYMctP0=; b=jM5nA6ypngwZpUerVm+RBCRhNZ1G6nuJfgwjn7Vtd1wvgbkinBrtdePRHnjKNTMjot VrQdfoSGV+kAQG41NqN97NEeWszguCHaMx4PfrsrltAgGeP/BPmO92AyTd0Zn1QtjYOy Ox4mrF4t8acnPi1c3uOsy0+IbnUdRagIqOaEti93l9cKUc2b6BXHGtEljEE9UTJPS9AA HuyLLdxX0cYt0T3Wcd5JQMiUzyPPa99vlQZUaUCvukCAILK5OwMFZQgPkB89ftOUWAlE q/KSb11C9KOt0rplhe5k1SqlqEK/2wmm+bDI9lCbUdanmUF9S8bSvSeaTl4VdVRHkJPe RnyQ== X-Gm-Message-State: AKwxytdE4HYc49bzLIsIzUbEk6Csa3APtCJyvM3CxNQPly5qTe3QBbzX FnjcCBOkDvPYcBA0c3F+yVslqg== X-Google-Smtp-Source: AH8x226PI2IfwRtUiukLjry0gz+m66RjqJdQ+w76dZFSUuvi4zE8LVdHBISxDqalSCRkJjOimAYV7g== X-Received: by 2002:a17:902:6881:: with SMTP id i1-v6mr15675940plk.323.1517003666185; Fri, 26 Jan 2018 13:54:26 -0800 (PST) Received: from xeon-e3 (204-195-18-133.wavecable.com. [204.195.18.133]) by smtp.gmail.com with ESMTPSA id l88sm22086060pfb.149.2018.01.26.13.54.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Jan 2018 13:54:26 -0800 (PST) Date: Fri, 26 Jan 2018 13:54:23 -0800 From: Stephen Hemminger To: Bruce Richardson Cc: Thomas Monjalon , dev@dpdk.org, Chao Zhu , konstantin.ananyev@intel.com Message-ID: <20180126135423.29394092@xeon-e3> In-Reply-To: <20180126172440.GA17280@bricha3-MOBL3.ger.corp.intel.com> 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 Subject: Re: [dpdk-dev] [PATCH v8 01/15] eal: introduce atomic exchange operation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jan 2018 21:54:27 -0000 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.