From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f67.google.com (mail-pg0-f67.google.com [74.125.83.67]) by dpdk.org (Postfix) with ESMTP id 53A702BCD for ; Thu, 8 Mar 2018 23:12:48 +0100 (CET) Received: by mail-pg0-f67.google.com with SMTP id i14so2787808pgv.3 for ; Thu, 08 Mar 2018 14:12:48 -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=MKFUc4KkZwEXcZVf5URAvMO+eDrAJoG/ZnIJO3glNlg=; b=mYuWJ9LC0d4sgsQ24hRxYkYl8T9JST/zzHEtTRLNw1Ogy2jUeBCqE3vuhKYW1n8dZT SiGWy0tIpqA/gtM/KiZ/luQwRpPDNP9jpH5ZgRqMo3mgqqN21z8kP4gGdyS09RHo2Xdt xDHa/0nIfb05NPSGo+k9NOux4pz70IV1mALUOXE58EZSMlY+J4vGtl+fBY4dGusFNnZx FouS6cpMtda6IbzDOFdgfxUA/83CgbwNGhruS5eo12yiE5Y18DUG0EQkDhqrphlr+wXJ IXnIi39uPaxPZiecZR91LdiQDp2aebxOCBImUxQZcRNmiufLnJmMNCGqUqG+IPiqmHxM 0gkA== 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=MKFUc4KkZwEXcZVf5URAvMO+eDrAJoG/ZnIJO3glNlg=; b=HM9YQ3gsGKwAFmOIj6p/UrZpjuNXaSgT/FrUpCgpoWUwBmt+imwU5h7Bxot9CPs57L XB/sc+JR8q1PECHR3Pd4OiLJ4BiIkB24nMQRjeiiy48ezHQxHgCxgMd7h6/u4cJWGs+1 rKnAVVDLjYovZ+DtnPhivBximADKCU1qMJl0Se5fDPHitFb0aYDVyCPSM84ru41cgybm ACttw/GovWbh/c6H81u+hc1WtdPxPNWEvrxMHcqL4u9SKjSU9DWaSBr/e0hCMg7fAQuc DiAkrRywy2b1C24L/ihq7SdmyTj4/kOpFct2198Fv9OzHpJrb3GBwWjrfFBJg7biUBU4 bG4g== X-Gm-Message-State: APf1xPCug3LyVe7wgwbM35Nxsa7WydnTWOLJ3UARhS/CKlI1K3GOuj49 efD9vAcJaDWVIGTKas2fV6p+1Q== X-Google-Smtp-Source: AG47ELtcxuvFFU4eg1mupk6ySmhrXGbP1OEdSC83I+9++n/rb2McQUYHgmSh0Yguw6m70sscQG+Vow== X-Received: by 10.101.70.203 with SMTP id n11mr21525464pgr.377.1520547167486; Thu, 08 Mar 2018 14:12:47 -0800 (PST) Received: from xeon-e3 (204-195-71-95.wavecable.com. [204.195.71.95]) by smtp.gmail.com with ESMTPSA id n7sm34965804pgd.87.2018.03.08.14.12.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Mar 2018 14:12:47 -0800 (PST) Date: Thu, 8 Mar 2018 14:12:40 -0800 From: Stephen Hemminger To: Ferruh Yigit Cc: dev@dpdk.org Message-ID: <20180308141240.523cd1ff@xeon-e3> In-Reply-To: References: <20180108174514.14688-1-stephen@networkplumber.org> <20180108174514.14688-2-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v3 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: Thu, 08 Mar 2018 22:12:48 -0000 On Thu, 11 Jan 2018 17:01:10 +0000 Ferruh Yigit wrote: > On 1/8/2018 5:45 PM, Stephen Hemminger wrote: > > 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 > > <...> > > > @@ -98,6 +98,18 @@ rte_atomic64_cmpset(volatile uint64_t *dst, uint64_t exp, uint64_t src) > > return res; > > } > > > > +static inline uint64_t > > +rte_atomic64_exchange(volatile uint64_t *dest, uint64_t val) > > +{ > > + uint64_t old; > > + > > + do { > > + old = *dest; > > + } while (rte_atomic64_t_cmpset(dest, old, val)); > > rte_atomic64_cmpset ? (without _t) Wasn't that fixed in later version?