[PATCH v5 5/6] bpf: adapt for EAL optional atomics API changes

Tyler Retzlaff roretzla at linux.microsoft.com
Thu Aug 17 23:42:16 CEST 2023


Adapt bpf for EAL optional atomics API changes

Signed-off-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
Reviewed-by: Morten Brørup <mb at smartsharesystems.com>
---
 lib/bpf/bpf_pkt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/bpf/bpf_pkt.c b/lib/bpf/bpf_pkt.c
index ffd2db7..7a8e4a6 100644
--- a/lib/bpf/bpf_pkt.c
+++ b/lib/bpf/bpf_pkt.c
@@ -25,7 +25,7 @@
 
 struct bpf_eth_cbi {
 	/* used by both data & control path */
-	uint32_t use;    /*usage counter */
+	RTE_ATOMIC(uint32_t) use;    /*usage counter */
 	const struct rte_eth_rxtx_callback *cb;  /* callback handle */
 	struct rte_bpf *bpf;
 	struct rte_bpf_jit jit;
@@ -110,8 +110,8 @@ struct bpf_eth_cbh {
 
 	/* in use, busy wait till current RX/TX iteration is finished */
 	if ((puse & BPF_ETH_CBI_INUSE) != 0) {
-		RTE_WAIT_UNTIL_MASKED((uint32_t *)(uintptr_t)&cbi->use,
-			UINT32_MAX, !=, puse, __ATOMIC_RELAXED);
+		RTE_WAIT_UNTIL_MASKED((__rte_atomic uint32_t *)(uintptr_t)&cbi->use,
+			UINT32_MAX, !=, puse, rte_memory_order_relaxed);
 	}
 }
 
-- 
1.8.3.1



More information about the dev mailing list