summaryrefslogtreecommitdiff
path: root/devtools
diff options
context:
space:
mode:
authorTyler Retzlaff <[email protected]>2023-08-22 14:00:45 -0700
committerDavid Marchand <[email protected]>2023-09-29 15:15:55 +0200
commitba7616786beb3e8c0bba94d24e38313d9bb5c1af (patch)
tree1eba8d556cb282144a489f3872d81ffbd8d80016 /devtools
parent5c381a3587d12608e8ba348a4d81b2e229d2ec27 (diff)
devtools: forbid use of GCC builtin atomics
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 <[email protected]> Suggested-by: Morten Brørup <[email protected]> Acked-by: Bruce Richardson <[email protected]> Acked-by: Morten Brørup <[email protected]> Acked-by: Konstantin Ananyev <[email protected]>
Diffstat (limited to 'devtools')
-rwxr-xr-xdevtools/checkpatches.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index b3ef5ed0cf..95b806e07d 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -102,20 +102,20 @@ check_forbidden_additions() { # <patch>
-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
"$1" || res=1
- # refrain from using compiler __atomic_thread_fence()
+ # refrain from using compiler __rte_atomic_thread_fence()
# It should be avoided on x86 for SMP case.
awk -v FOLDERS="lib drivers app examples" \
- -v EXPRESSIONS="__atomic_thread_fence\\\(" \
+ -v EXPRESSIONS="__rte_atomic_thread_fence\\\(" \
-v RET_ON_FAIL=1 \
- -v MESSAGE='Using __atomic_thread_fence' \
+ -v MESSAGE='Using __rte_atomic_thread_fence, prefer rte_atomic_thread_fence' \
-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 built-ins, prefer rte_atomic_xxx' \
-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
"$1" || res=1