[v4,17/45] net/hinic: use rte stdatomic API

Message ID 1713568003-30453-18-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State Superseded
Delegated to: Thomas Monjalon
Headers
Series use stdatomic API |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Tyler Retzlaff April 19, 2024, 11:06 p.m. UTC
  Replace the use of gcc builtin __atomic_xxx intrinsics with
corresponding rte_atomic_xxx optional rte stdatomic API.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/hinic/hinic_pmd_rx.c | 2 +-
 drivers/net/hinic/hinic_pmd_rx.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/drivers/net/hinic/hinic_pmd_rx.c b/drivers/net/hinic/hinic_pmd_rx.c
index 7adb6e3..c2cd295 100644
--- a/drivers/net/hinic/hinic_pmd_rx.c
+++ b/drivers/net/hinic/hinic_pmd_rx.c
@@ -1004,7 +1004,7 @@  u16 hinic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, u16 nb_pkts)
 	while (pkts < nb_pkts) {
 		 /* 2. current ci is done */
 		rx_cqe = &rxq->rx_cqe[sw_ci];
-		status = __atomic_load_n(&rx_cqe->status, __ATOMIC_ACQUIRE);
+		status = rte_atomic_load_explicit(&rx_cqe->status, rte_memory_order_acquire);
 		if (!HINIC_GET_RX_DONE_BE(status))
 			break;
 
diff --git a/drivers/net/hinic/hinic_pmd_rx.h b/drivers/net/hinic/hinic_pmd_rx.h
index 2dde3ec..43c236b 100644
--- a/drivers/net/hinic/hinic_pmd_rx.h
+++ b/drivers/net/hinic/hinic_pmd_rx.h
@@ -33,7 +33,7 @@  struct __rte_cache_aligned hinic_rq_cqe {
 #else
 struct hinic_rq_cqe {
 #endif
-	u32 status;
+	RTE_ATOMIC(u32) status;
 	u32 vlan_len;
 	u32 offload_type;
 	u32 rss_hash;