From: Pavan Nikhilesh <pbhagavatula@marvell.com>
Date: Tue, 20 Jul 2021 07:04:32 +0000 (+0530)
Subject: event/cnxk: fix reading stale Tx queue depth
X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=ac56433de535ac188bd84eab9112df546334e91c;p=dpdk.git

event/cnxk: fix reading stale Tx queue depth

Reads to Tx queue FC memory need to be atomic to avoid cores using
same Tx queue spinning on stale values.

Fixes: 313e884a22fd ("event/cnxk: support Tx adapter fast path")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---

diff --git a/drivers/event/cnxk/cn9k_worker.h b/drivers/event/cnxk/cn9k_worker.h
index cc1e141957..9b2a0bf882 100644
--- a/drivers/event/cnxk/cn9k_worker.h
+++ b/drivers/event/cnxk/cn9k_worker.h
@@ -420,7 +420,8 @@ NIX_RX_FASTPATH_MODES
 static __rte_always_inline void
 cn9k_sso_txq_fc_wait(const struct cn9k_eth_txq *txq)
 {
-	while (!(((txq)->nb_sqb_bufs_adj - *(txq)->fc_mem)
+	while (!((txq->nb_sqb_bufs_adj -
+		  __atomic_load_n(txq->fc_mem, __ATOMIC_RELAXED))
 		 << (txq)->sqes_per_sqb_log2))
 		;
 }