devtools: prevent use of legacy atomic API
authorPhil Yang <phil.yang@arm.com>
Fri, 17 Jul 2020 10:14:37 +0000 (18:14 +0800)
committerDavid Marchand <david.marchand@redhat.com>
Fri, 17 Jul 2020 14:00:30 +0000 (16:00 +0200)
commitf1602b4a86e8c0622326fad4f12a23e6ae0d435c
tree5ba6828f74487f7414afaf555aa26b0077cf0406
parent672a15056380d97415eca8ca0b13580639ba7a6b
devtools: prevent use of legacy atomic API

In order to deprecate the rte_atomic and rte_smp barrier APIs [1], prevent
the patches from using these APIs and __sync builtins in new code.
Please use __atomic builtins instead of __sync builtins, rte_atomicNN_xxx
and rte_smp_[r/w]mb APIs.

On x86 the __atomic_thread_fence(__ATOMIC_SEQ_CST) is quite expensive for
SMP case. Flag the new code which use __atomic_thread_fence API.
Please use rte_thread_fence API instead of __atomic_thread_fence builtins.

1: Refer to the locks-and-atomic-operations section in
https://doc.dpdk.org/guides/prog_guide/writing_efficient_code.html

Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
devtools/checkpatches.sh