From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 1D4AF1B306 for ; Fri, 26 Jan 2018 18:24:44 +0100 (CET) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jan 2018 09:24:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,417,1511856000"; d="scan'208";a="169386661" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.221.77]) by orsmga004.jf.intel.com with SMTP; 26 Jan 2018 09:24:41 -0800 Received: by (sSMTP sendmail emulation); Fri, 26 Jan 2018 17:24:41 +0000 Date: Fri, 26 Jan 2018 17:24:40 +0000 From: Bruce Richardson To: Thomas Monjalon Cc: Stephen Hemminger , dev@dpdk.org, Chao Zhu , konstantin.ananyev@intel.com Message-ID: <20180126172440.GA17280@bricha3-MOBL3.ger.corp.intel.com> References: <20180126020151.979-1-stephen@networkplumber.org> <20180126020151.979-2-stephen@networkplumber.org> <3131860.My9xXdrCmY@xps> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3131860.My9xXdrCmY@xps> Organization: Intel Research and Development Ireland Ltd. User-Agent: Mutt/1.9.1 (2017-09-22) 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 17:24:45 -0000 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