DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tyler Retzlaff <roretzla@linux.microsoft.com>
To: "Morten Brørup" <mb@smartsharesystems.com>
Cc: dev@dpdk.org, thomas@monjalon.net, Honnappa.Nagarahalli@arm.com,
	david.marchand@redhat.com
Subject: Re: [PATCH] devtools: stop compiler atomics with no C11 equivalent
Date: Wed, 22 Mar 2023 14:00:15 -0700	[thread overview]
Message-ID: <20230322210015.GA4644@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> (raw)
In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D877EA@smartserver.smartshare.dk>

On Wed, Mar 22, 2023 at 07:25:09PM +0100, Morten Brørup wrote:
> > From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com]
> > Sent: Wednesday, 22 March 2023 19.08
> > 
> > adding a few more people to cc for attention
> > 
> > On Mon, Mar 20, 2023 at 09:22:01AM -0700, Tyler Retzlaff wrote:
> > > Refrain from using compiler __atomic_{add,and,nand,or,sub,xor}_fetch()
> > > to ease future adoption of C11 standard atomics.
> > >
> > > Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> > > ---
> > >  devtools/checkpatches.sh | 8 ++++++++
> > >  1 file changed, 8 insertions(+)
> > >
> > > diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
> > > index 1dee094..1ed6d51 100755
> > > --- a/devtools/checkpatches.sh
> > > +++ b/devtools/checkpatches.sh
> > > @@ -119,6 +119,14 @@ check_forbidden_additions() { # <patch>
> > >  		-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk
> > \
> > >  		"$1" || res=1
> > >
> > > +	# refrain from using compiler
> > __atomic_{add,and,nand,or,sub,xor}_fetch()
> > > +	awk -v FOLDERS="lib drivers app examples" \
> > > +		-v
> > EXPRESSIONS="__atomic_(add|and|nand|or|sub|xor)_fetch\\\(" \
> > > +		-v RET_ON_FAIL=1 \
> > > +		-v MESSAGE='Using __atomic_{add,and,nand,or,sub,xor}_fetch'
> > \
> 
> Suggest that you expand the error message with a solution for the developer: "... use __atomic_fetch_op() instead of __atomic_op_fetch()"

if awk could expand captures i would do that but it can't.

or do you mean literally use 'op' instead of {add,and,nand,or,sub,xor}
in the message?

> 
> > > +		-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk
> > \
> > > +		"$1" || res=1
> > > +
> > >  	# forbid use of __reserved which is a reserved keyword in Windows
> > system headers
> > >  	awk -v FOLDERS="lib drivers app examples" \
> > >  		-v EXPRESSIONS='\\<__reserved\\>' \
> > > --
> > > 1.8.3.1

  reply	other threads:[~2023-03-22 21:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-20 16:22 Tyler Retzlaff
2023-03-22 18:08 ` Tyler Retzlaff
2023-03-22 18:25   ` Morten Brørup
2023-03-22 21:00     ` Tyler Retzlaff [this message]
2023-03-22 21:48       ` Morten Brørup
2023-04-04  0:21 ` [PATCH v2] " Tyler Retzlaff
2023-04-04  7:38   ` Morten Brørup
2023-04-25  9:10   ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230322210015.GA4644@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net \
    --to=roretzla@linux.microsoft.com \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=mb@smartsharesystems.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).