From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH] eal: remove atomic flag operations
Date: Thu, 17 Sep 2026 13:41:00 -0700 [thread overview]
Message-ID: <20260917204100.2289205-1-stephen@networkplumber.org> (raw)
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@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
reply other threads:[~2026-09-17 20:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260917204100.2289205-1-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox