eventdev: use C11 atomics for lcore timer armed flag
authorPhil Yang <phil.yang@arm.com>
Tue, 7 Jul 2020 15:54:51 +0000 (23:54 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 8 Jul 2020 16:16:41 +0000 (18:16 +0200)
commit1028d63eb214c5961b2df9d4b5662dab082b839e
tree0105fe3b8b9f27d1c30cebef58246cc9d3f1c746
parentaceb737d6f3210556a139514d304bf8f315a043f
eventdev: use C11 atomics for lcore timer armed flag

The in_use flag is a per core variable which is not shared between
lcores in the normal case and the access of this variable should be
ordered on the same core. However, if non-EAL thread pick the highest
lcore to insert timers into, there is the possibility of conflicts
on this flag between threads. Then the atomic compare-and-swap
operation is needed.

Use the C11 atomics instead of the generic rte_atomic operations to
avoid the unnecessary barrier on aarch64.

Cc: stable@dpdk.org
Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
lib/librte_eventdev/rte_event_timer_adapter.c