[PATCH] eal: remove atomic flag operations
Stephen Hemminger
stephen at networkplumber.org
Thu Sep 17 22:41:00 CEST 2026
The rte_atomic_flag_test_and_set_explicit and
rte_atomic_flag_clear_explicit macros were added in 23.11 with the rest
of the stdatomic API and never had an in-tree user.
They cannot be used portably:
* Only test-and-set and clear were wrapped.
C11 makes atomic_flag opaque with no load operation.
* The operand type differs between the two implementations, and no type
works in all builds: across stdatomic and gcc vs clang.
No portable application can be using these, so removal cannot break
correct code. Use rte_atomic_exchange_explicit, rte_atomic_load_explicit
and rte_atomic_store_explicit on an RTE_ATOMIC(bool) instead.
Removed without a deprecation notice as the API cannot be used as
specified. 26.11 is an ABI break release.
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
doc/guides/rel_notes/release_26_11.rst | 10 ++++++++++
lib/eal/include/rte_stdatomic.h | 12 ------------
2 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/doc/guides/rel_notes/release_26_11.rst b/doc/guides/rel_notes/release_26_11.rst
index 4b3e5d995c..72f9dd92bd 100644
--- a/doc/guides/rel_notes/release_26_11.rst
+++ b/doc/guides/rel_notes/release_26_11.rst
@@ -79,6 +79,16 @@ Removed Items
``rte_rib6_is_equal``
* table: ``RTE_LPM_IPV6_ADDR_SIZE``
+* eal: Removed the atomic flag macros ``rte_atomic_flag_test_and_set_explicit``
+ and ``rte_atomic_flag_clear_explicit``.
+ They had no in-tree users and could not be used portably:
+ only test-and-set and clear were wrapped,
+ so there was no portable way to read or initialize the flag.
+ The operand type also differed between the C11 and compiler builtin
+ implementations, with no single type accepted by both.
+ Use ``rte_atomic_exchange_explicit``, ``rte_atomic_load_explicit``
+ and ``rte_atomic_store_explicit`` on an ``RTE_ATOMIC(bool)`` instead.
+
API Changes
-----------
diff --git a/lib/eal/include/rte_stdatomic.h b/lib/eal/include/rte_stdatomic.h
index 7258b393f1..2fd69ec780 100644
--- a/lib/eal/include/rte_stdatomic.h
+++ b/lib/eal/include/rte_stdatomic.h
@@ -102,12 +102,6 @@ static_assert(rte_memory_order_seq_cst == __ATOMIC_SEQ_CST,
#define rte_atomic_fetch_nand_explicit(ptr, val, memorder) \
atomic_fetch_nand_explicit(ptr, val, memorder)
-#define rte_atomic_flag_test_and_set_explicit(ptr, memorder) \
- atomic_flag_test_and_set_explicit(ptr, memorder)
-
-#define rte_atomic_flag_clear_explicit(ptr, memorder) \
- atomic_flag_clear_explicit(ptr, memorder)
-
/* We provide internal macro here to allow conditional expansion
* in the body of the per-arch rte_atomic_thread_fence inline functions.
*/
@@ -169,12 +163,6 @@ typedef int rte_memory_order;
#define rte_atomic_fetch_nand_explicit(ptr, val, memorder) \
__atomic_fetch_nand(ptr, val, memorder)
-#define rte_atomic_flag_test_and_set_explicit(ptr, memorder) \
- __atomic_test_and_set(ptr, memorder)
-
-#define rte_atomic_flag_clear_explicit(ptr, memorder) \
- __atomic_clear(ptr, memorder)
-
/* We provide internal macro here to allow conditional expansion
* in the body of the per-arch rte_atomic_thread_fence inline functions.
*/
--
2.53.0
More information about the dev
mailing list