[v2,6/6] devtools: forbid new direct use of GCC atomic builtins

Message ID 1691775136-6460-7-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series RFC optional rte optional stdatomics API |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-compile-amd64-testing success Testing PASS

Commit Message

Tyler Retzlaff Aug. 11, 2023, 5:32 p.m. UTC
  Refrain from using compiler __atomic_xxx builtins DPDK now requires
the use of rte_atomic_<op>_explicit macros when operating on DPDK
atomic variables.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Suggested-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 devtools/checkpatches.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Morten Brørup Aug. 14, 2023, 8:12 a.m. UTC | #1
> From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com]
> Sent: Friday, 11 August 2023 19.32
> 
> Refrain from using compiler __atomic_xxx builtins DPDK now requires
> the use of rte_atomic_<op>_explicit macros when operating on DPDK
> atomic variables.
> 
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> Suggested-by: Morten Brørup <mb@smartsharesystems.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> ---

Acked-by: Morten Brørup <mb@smartsharesystems.com>
  

Patch

diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index 43f5e36..b15c3f7 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -111,11 +111,11 @@  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()
+	# refrain from using compiler __atomic_xxx builtins
 	awk -v FOLDERS="lib drivers app examples" \
-		-v EXPRESSIONS="__atomic_(add|and|nand|or|sub|xor)_fetch\\\(" \
+		-v EXPRESSIONS="__atomic_.*\\\(" \
 		-v RET_ON_FAIL=1 \
-		-v MESSAGE='Using __atomic_op_fetch, prefer __atomic_fetch_op' \
+		-v MESSAGE='Using __atomic_xxx builtins' \
 		-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
 		"$1" || res=1