Skip to contentSkip to conversation

eal: remove atomic flag operations

PATCH In review Stephen Hemminger 2 participants 2 messages Sep 17 – Nov 14

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eal: remove atomic flag operations

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.

---
 doc/guides/rel_notes/release_26_11.rst | 10 ++++++++++
 lib/eal/include/rte_stdatomic.h        | 12 ------------
 2 files changed, 10 insertions(+), 12 deletions(-)
doc/guides/rel_notes/release_26_11.rst +10 -0
index 4b3e5d995c..72f9dd92bd 100644
@@ -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
 -----------
lib/eal/include/rte_stdatomic.h +0 -12
index 7258b393f1..2fd69ec780 100644
@@ -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.
  */
Signature · 1 line
2.53.0
Acked-by on v1 1/1
#1 lore raw
Quoted 20 lines

From: Stephen Hemminger [mailto:[email protected]]
Sent: Thursday, 17 September 2026 13.41

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.

Quoted 5 lines

Removed without a deprecation notice as the API cannot be used as specified. 26.11 is an ABI break release.

---