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 52EEC1B1A5 for ; Fri, 26 Jan 2018 00:24:04 +0100 (CET) Received: by mail-pf0-f194.google.com with SMTP id y26so6936539pfi.10 for ; Thu, 25 Jan 2018 15:24:04 -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=aOn3c2DFHipQnVEcbKCYCcZA0BwArSoUxbVAUT+jMFs=; b=ft4mBlFiUCM3bUdBwLdwcViX7e7CdgiDq7Hiib3E6bf/ggXC0a1bCELqIw5JNgY4IO /iirokVQFdYj1mU8GZQj0nvhDcDO7j7PVJGgECNHd9eef9QkJQ/Wa8uUEHD98nmG7126 STb9InYzeJHNiDGS7y2S2CPJhIC3uGFIPdGmZPTxXr60Bu6wMkGG6a8gCB3VEwGinYd6 5hqehJuEOJHb8CAAs4kAW/D5VyfIAaYm3CrjcDBUYsdniutMCBNEkpB3DUg36OTHYmLz lYK540Y9Vd4apNNXpP6Qi57eGbgL/oyUWj8OkziETwPCYSwG3T1gsxhm59cmbUvKWsWa S14A== 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=aOn3c2DFHipQnVEcbKCYCcZA0BwArSoUxbVAUT+jMFs=; b=O78x/OxV1SX7ko8dHf1TVkiS67S7mjZs6VgUuYxWT2APlliM6crBgzba7ZtdiXonXR UBVpv+hWLz4GfjNplD5XY5daAateJFdEnePJCUIRCjC2+Qh8xmQQZKVkAFd3k172ytLg 7Jy2BaVPtTG4pQNbh4xTlOFuZo3U0ARutzIco6dk4vk2UPSigrmZxDCXbJ9VB3PEFGGE CDwjR+5C40hkmpZPfpGuko1cgsJ3c/ZAUc/8MTL1djm0z7IYWBWz3gTvIUcTLq61wOT3 7aAV7o9/epLK2+N83ylR4ZZKAKZ61jYUKtVcwhAerRVVA1bXeoiYAYpX6HssEOoz63Vs fu2g== X-Gm-Message-State: AKwxytcJTj+ZW6mi83H9Vxmm0WYylpNs95piJC06H99L0Cv9oaY8SZ7S kPeUrTqcDMZMEjH17NytjMIYiCGhDeI= X-Google-Smtp-Source: AH8x225bJFmdadPdKjsa+lJdPvXON0UiY/+KgmpOMDWp9OV0Og34uXc2DLi7znYPOiDQ1d8Jq9bN0g== X-Received: by 10.99.110.205 with SMTP id j196mr14045787pgc.54.1516922643342; Thu, 25 Jan 2018 15:24:03 -0800 (PST) Received: from xeon-e3 (204-195-18-133.wavecable.com. [204.195.18.133]) by smtp.gmail.com with ESMTPSA id p69sm16416737pfk.7.2018.01.25.15.24.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Jan 2018 15:24:03 -0800 (PST) Date: Thu, 25 Jan 2018 15:24:01 -0800 From: Stephen Hemminger To: Ferruh Yigit Cc: dev@dpdk.org Message-ID: <20180125152401.6372db47@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, 25 Jan 2018 23:24:04 -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) > > > + > > + return old; > > +} > > <...> > Addressed in followup patch, needed to build on 32bit. Will fold into next version.