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 D4C1542421; Thu, 19 Jan 2023 22:50:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B92AB40223; Thu, 19 Jan 2023 22:50:55 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 36835400D5 for ; Thu, 19 Jan 2023 22:50:54 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 7AA2320E09FD; Thu, 19 Jan 2023 13:50:53 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7AA2320E09FD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1674165053; bh=vRCJgZwbZFW/P05VlwSzV3HA1uto31KIbW6k6XGRGwM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=E4qJULntZvQvD0IqO3Z1Ay6cl3mlM6eentkvcV7JxEWNDjegUrlmmS2WXoNm8l9cG NPKfDgMS+rKDsvrq/0i2rtcS0eRMi1pJYuxt/cfBFSrpOt250QzdhuLuLanU9Q7xec pAEk2+yqxn1U01BonUGCI+p3Y5sHneqSV5E8/kSc= Date: Thu, 19 Jan 2023 13:50:53 -0800 From: Tyler Retzlaff To: David Marchand Cc: Stephen Hemminger , dev@dpdk.org, maxime.coquelin@redhat.com, chenbo.xia@intel.com, jiayu.hu@intel.com, yuanx.wang@intel.com, xuan.ding@intel.com, Anatoly Burakov , Mattias =?iso-8859-1?Q?R=F6nnblom?= , David Christensen , Bruce Richardson , Konstantin Ananyev Subject: Re: [PATCH v4 1/9] eal: annotate spinlock, rwlock and seqlock Message-ID: <20230119215053.GB32536@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20220328121758.26632-1-david.marchand@redhat.com> <20230119184620.3195267-1-david.marchand@redhat.com> <20230119184620.3195267-2-david.marchand@redhat.com> <20230119114202.27f7da80@hermes.local> <20230119203923.GA32536@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Thu, Jan 19, 2023 at 10:16:35PM +0100, David Marchand wrote: > On Thu, Jan 19, 2023 at 9:39 PM Tyler Retzlaff > wrote: > > > > On Thu, Jan 19, 2023 at 11:42:02AM -0800, Stephen Hemminger wrote: > > > On Thu, 19 Jan 2023 19:46:12 +0100 > > > David Marchand wrote: > > > > > > > +#ifndef __DOXYGEN__ > > > > + __rte_exclusive_lock_function(&seqlock->lock) > > > > +#endif > > > > { > > > > > > Would be cleaner any required ifdefs was in rte_lock_annotations > > > rather than sprinkling the code > > > > we briefly touched on abstracting annotations in another thread. it > > would be favorable if annotations were stashed behind macros that could > > be expanded for more than just clang/internal/under doxygen to make > > available opportunities to use other annotation dialects that may be > > compatible. > > I am open to abstractions. > Do you have pointers for an equivalent functionnality in other > compilers/tooling? aye, reference documentation for SALv2 is here. https://learn.microsoft.com/en-us/cpp/code-quality/using-sal-annotations-to-reduce-c-cpp-code-defects?view=msvc-170 locking annotations are here. https://learn.microsoft.com/en-us/cpp/code-quality/annotating-locking-behavior?view=msvc-170 but just to reiterate i'm not pushing any particular implementation, or saying that SAL will ever be used. i think pragmatically all that would be nice for now is not creating a direct dependency on any tool that allow space for others in the future. if the burden to do that is too much though let's just do what we can to get the benefits. > > > -- > David Marchand