DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] devtools: extend check on compiler builtin atomics
@ 2023-10-17 11:31 David Marchand
  2023-10-17 11:34 ` Tyler Retzlaff
  0 siblings, 1 reply; 3+ messages in thread
From: David Marchand @ 2023-10-17 11:31 UTC (permalink / raw)
  To: dev; +Cc: thomas, roretzla

rte_memory_order_* should be used when calling the new stdatomic API.
Add a check on __ATOMIC_* tokens.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 devtools/checkpatches.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index 2635923e14..7740152643 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -113,9 +113,9 @@ check_forbidden_additions() { # <patch>
 
 	# refrain from using compiler __atomic_xxx builtins
 	awk -v FOLDERS="lib drivers app examples" \
-		-v EXPRESSIONS="__atomic_.*\\\(" \
+		-v EXPRESSIONS="__atomic_.*\\\( __ATOMIC_(RELAXED|CONSUME|ACQUIRE|RELEASE|ACQ_REL|SEQ_CST)" \
 		-v RET_ON_FAIL=1 \
-		-v MESSAGE='Using __atomic_xxx built-ins, prefer rte_atomic_xxx' \
+		-v MESSAGE='Using __atomic_xxx/__ATOMIC_XXX built-ins, prefer rte_atomic_xxx' \
 		-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
 		"$1" || res=1
 
-- 
2.41.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] devtools: extend check on compiler builtin atomics
  2023-10-17 11:31 [PATCH] devtools: extend check on compiler builtin atomics David Marchand
@ 2023-10-17 11:34 ` Tyler Retzlaff
  2023-10-19  7:08   ` David Marchand
  0 siblings, 1 reply; 3+ messages in thread
From: Tyler Retzlaff @ 2023-10-17 11:34 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, thomas

On Tue, Oct 17, 2023 at 01:31:25PM +0200, David Marchand wrote:
> rte_memory_order_* should be used when calling the new stdatomic API.
> Add a check on __ATOMIC_* tokens.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---

Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>

>  devtools/checkpatches.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
> index 2635923e14..7740152643 100755
> --- a/devtools/checkpatches.sh
> +++ b/devtools/checkpatches.sh
> @@ -113,9 +113,9 @@ check_forbidden_additions() { # <patch>
>  
>  	# refrain from using compiler __atomic_xxx builtins
>  	awk -v FOLDERS="lib drivers app examples" \
> -		-v EXPRESSIONS="__atomic_.*\\\(" \
> +		-v EXPRESSIONS="__atomic_.*\\\( __ATOMIC_(RELAXED|CONSUME|ACQUIRE|RELEASE|ACQ_REL|SEQ_CST)" \
>  		-v RET_ON_FAIL=1 \
> -		-v MESSAGE='Using __atomic_xxx built-ins, prefer rte_atomic_xxx' \
> +		-v MESSAGE='Using __atomic_xxx/__ATOMIC_XXX built-ins, prefer rte_atomic_xxx' \

Not sure if it should say prefer rte_atomic_xxx/rte_memory_order_xxx ?

Either way it catches the problem.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] devtools: extend check on compiler builtin atomics
  2023-10-17 11:34 ` Tyler Retzlaff
@ 2023-10-19  7:08   ` David Marchand
  0 siblings, 0 replies; 3+ messages in thread
From: David Marchand @ 2023-10-19  7:08 UTC (permalink / raw)
  To: David Marchand; +Cc: Tyler Retzlaff, dev, thomas

On Tue, Oct 17, 2023 at 1:34 PM Tyler Retzlaff
<roretzla@linux.microsoft.com> wrote:
>
> On Tue, Oct 17, 2023 at 01:31:25PM +0200, David Marchand wrote:
> > rte_memory_order_* should be used when calling the new stdatomic API.
> > Add a check on __ATOMIC_* tokens.
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
>

[snip]

> >               -v RET_ON_FAIL=1 \
> > -             -v MESSAGE='Using __atomic_xxx built-ins, prefer rte_atomic_xxx' \
> > +             -v MESSAGE='Using __atomic_xxx/__ATOMIC_XXX built-ins, prefer rte_atomic_xxx' \
>
> Not sure if it should say prefer rte_atomic_xxx/rte_memory_order_xxx ?

Looks ok to me, I did this small change while applying.

Applied, thanks.

-- 
David Marchand


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-19  7:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-17 11:31 [PATCH] devtools: extend check on compiler builtin atomics David Marchand
2023-10-17 11:34 ` Tyler Retzlaff
2023-10-19  7:08   ` David Marchand

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).