[v2,25/31] event/cnxk: wait for CPT fc on wqe path

Message ID 20220905133228.818616-25-ndabilpuram@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers
Series [v2,01/31] cnxk/net: add fc check in vector event Tx path |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Nithin Dabilpuram Sept. 5, 2022, 1:32 p.m. UTC
  Wait for CPT flow control on WQE path. This is to
avoid CPT queue overflow and thereby a CPT misc
interrupt.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 drivers/net/cnxk/cn10k_tx.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
  

Patch

diff --git a/drivers/net/cnxk/cn10k_tx.h b/drivers/net/cnxk/cn10k_tx.h
index 07c88a974e..f5205da0e2 100644
--- a/drivers/net/cnxk/cn10k_tx.h
+++ b/drivers/net/cnxk/cn10k_tx.h
@@ -233,6 +233,16 @@  cn10k_nix_tx_skeleton(struct cn10k_eth_txq *txq, uint64_t *cmd,
 	}
 }
 
+static __rte_always_inline void
+cn10k_nix_sec_fc_wait_one(struct cn10k_eth_txq *txq)
+{
+	uint64_t nb_desc = txq->cpt_desc;
+	uint64_t *fc = txq->cpt_fc;
+
+	while (nb_desc <= __atomic_load_n(fc, __ATOMIC_RELAXED))
+		;
+}
+
 static __rte_always_inline void
 cn10k_nix_sec_fc_wait(struct cn10k_eth_txq *txq, uint16_t nb_pkts)
 {