[PATCH 34/46] net/null: use rte stdatomic API
Tyler Retzlaff
roretzla at linux.microsoft.com
Wed Mar 20 21:51:20 CET 2024
Replace the use of gcc builtin __atomic_xxx intrinsics with
corresponding rte_atomic_xxx optional rte stdatomic API.
Signed-off-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
---
drivers/net/null/rte_eth_null.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index 7c46004..f4ed3b8 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -37,8 +37,8 @@ struct null_queue {
struct rte_mempool *mb_pool;
struct rte_mbuf *dummy_packet;
- uint64_t rx_pkts;
- uint64_t tx_pkts;
+ RTE_ATOMIC(uint64_t) rx_pkts;
+ RTE_ATOMIC(uint64_t) tx_pkts;
};
struct pmd_options {
@@ -102,7 +102,7 @@ struct pmd_internals {
}
/* NOTE: review for potential ordering optimization */
- __atomic_fetch_add(&h->rx_pkts, i, __ATOMIC_SEQ_CST);
+ rte_atomic_fetch_add_explicit(&h->rx_pkts, i, rte_memory_order_seq_cst);
return i;
}
@@ -130,7 +130,7 @@ struct pmd_internals {
}
/* NOTE: review for potential ordering optimization */
- __atomic_fetch_add(&h->rx_pkts, i, __ATOMIC_SEQ_CST);
+ rte_atomic_fetch_add_explicit(&h->rx_pkts, i, rte_memory_order_seq_cst);
return i;
}
@@ -155,7 +155,7 @@ struct pmd_internals {
rte_pktmbuf_free(bufs[i]);
/* NOTE: review for potential ordering optimization */
- __atomic_fetch_add(&h->tx_pkts, i, __ATOMIC_SEQ_CST);
+ rte_atomic_fetch_add_explicit(&h->tx_pkts, i, rte_memory_order_seq_cst);
return i;
}
@@ -178,7 +178,7 @@ struct pmd_internals {
}
/* NOTE: review for potential ordering optimization */
- __atomic_fetch_add(&h->tx_pkts, i, __ATOMIC_SEQ_CST);
+ rte_atomic_fetch_add_explicit(&h->tx_pkts, i, rte_memory_order_seq_cst);
return i;
}
--
1.8.3.1
More information about the dev
mailing list