From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 48EF1A0509; Wed, 30 Mar 2022 13:24:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ED57540685; Wed, 30 Mar 2022 13:24:57 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id EC7F44013F for ; Wed, 30 Mar 2022 13:24:55 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 29F2B20DEE2D; Wed, 30 Mar 2022 04:24:55 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 29F2B20DEE2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1648639495; bh=c4CWxnNyHNhLF/MFIunC0yqXMiDrmvwfj3BmLlaz3Wc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MeBNJa8IKNBUphce/MDlue0D1itZJzH43v/1xmzOkI3vtEos9D3lWLJzn1p7nFBoU aEt2NLInYahgFrz/S+aqYHK95CKFOD10xFGtu05fRG9a+c6tny4izBnklMiAj6A4+W 1AB4zCn0UCtYZnf/kEhEdkvWKQ6iTRU7JDfQ3YBM= Date: Wed, 30 Mar 2022 04:24:55 -0700 From: Tyler Retzlaff To: Morten =?iso-8859-1?Q?Br=F8rup?= Cc: Mattias =?iso-8859-1?Q?R=F6nnblom?= , dev@dpdk.org, Thomas Monjalon , David Marchand , onar.olsen@ericsson.com, Honnappa.Nagarahalli@arm.com, nd@arm.com, konstantin.ananyev@intel.com, stephen@networkplumber.org, Ola Liljedahl Subject: Re: [PATCH] eal: add seqlock Message-ID: <20220330112455.GA4438@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20220330100710.107650-1-mattias.ronnblom@ericsson.com> <98CBD80474FA8B44BF855DF32C47DC35D86F84@smartserver.smartshare.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D86F84@smartserver.smartshare.dk> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Wed, Mar 30, 2022 at 12:50:42PM +0200, Morten Brørup wrote: > > From: Mattias Rönnblom [mailto:mattias.ronnblom@ericsson.com] > > Sent: Wednesday, 30 March 2022 12.07 > > > + > > +/** > > + * The RTE seqlock type. > > + */ > > +typedef struct { > > + uint32_t sn; /**< A generation number for the protected data. */ > > + rte_spinlock_t lock; /**< Spinlock used to serialize writers. */ > > +} rte_seqlock_t; > > + > > You refer to 'sn' as the sequence number everywhere else, so please document is as such: > "/**< Sequence number for the protected data. */" > > Also, consider making 'sn' volatile, although it is only accessed through the __atomic_load_n() function. I don't know if it makes any difference, so I'm just bringing this to the attention of the experts! i don't think there is value added by cv-volatile qualification. if we want correct/portable behavior for all targets then we should just access with appropriate atomics builtins/intrinsics they will be qualifying volatile and generating correct barriers when necessary. > > Acked-by: Morten Brørup >