event/cnxk: add wmb after steorl for event mode

Message ID 20230530093957.3438848-1-schalla@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers
Series event/cnxk: add wmb after steorl for event mode |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

Srujana Challa May 30, 2023, 9:39 a.m. UTC
  From: Author Srujana Challa <schalla@marvell.com>

LMTST area can be overwritten before read by HW between to consecutive
steorl operations. Hence, add wmb() after steorl op to make sure
the lmtst operation is complete.

Signed-off-by: Srujana Challa <schalla@marvell.com>
Change-Id: Ib16d7cd88cff79e9ca78eff8c47b7ddad2d234dd
Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/dataplane/dpdk/+/103549
Base-Builds: sa_ip-toolkits-Jenkins <sa_ip-toolkits-jenkins@marvell.com>
Tested-by: sa_ip-toolkits-Jenkins <sa_ip-toolkits-jenkins@marvell.com>
Reviewed-by: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
---
 drivers/event/cnxk/cn10k_tx_worker.h | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
  

Patch

diff --git a/drivers/event/cnxk/cn10k_tx_worker.h b/drivers/event/cnxk/cn10k_tx_worker.h
index c18786a14c..81fe31c4b9 100644
--- a/drivers/event/cnxk/cn10k_tx_worker.h
+++ b/drivers/event/cnxk/cn10k_tx_worker.h
@@ -43,7 +43,6 @@  cn10k_sso_tx_one(struct cn10k_sso_hws *ws, struct rte_mbuf *m, uint64_t *cmd,
 		 const uint64_t *txq_data, const uint32_t flags)
 {
 	uint8_t lnum = 0, loff = 0, shft = 0;
-	uint16_t ref_cnt = m->refcnt;
 	struct cn10k_eth_txq *txq;
 	uintptr_t laddr;
 	uint16_t segdw;
@@ -98,10 +97,9 @@  cn10k_sso_tx_one(struct cn10k_sso_hws *ws, struct rte_mbuf *m, uint64_t *cmd,
 
 	roc_lmt_submit_steorl(lmt_id, pa);
 
-	if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) {
-		if (ref_cnt > 1)
-			rte_io_wmb();
-	}
+	/* Memory barrier to make sure lmtst store completes */
+	rte_io_wmb();
+
 	return 1;
 }