Skip to contentSkip to conversation

event/cnxk: add wmb after steorl for event mode

PATCH New Srujana Challa 3 participants 4 messages May 30, 2023 – May 31, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 event/cnxk: add wmb after steorl for event mode

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.

---
 drivers/event/cnxk/cn10k_tx_worker.h | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/event/cnxk/cn10k_tx_worker.h +3 -5
index c18786a14c..81fe31c4b9 100644
@@ -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;
 }
 
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 1/1 event/cnxk: fix LMTST write for single event mode

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.

Fixes 313e884a22fd ("event/cnxk: support Tx adapter fast path")
---
 drivers/event/cnxk/cn10k_tx_worker.h | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/event/cnxk/cn10k_tx_worker.h +3 -5
index c18786a14c..81fe31c4b9 100644
@@ -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;
 }
 
Signature · 1 line
2.25.1
Acked-by on v2 1/1
#2 lore raw

RE: [PATCH v2] event/cnxk: fix LMTST write for single event mode

Quoted 12 lines

-----Original Message-----
From: Srujana Challa <[email protected]>
Sent: Wednesday, May 31, 2023 4:03 PM
To: Pavan Nikhilesh Bhagavatula <[email protected]>; Shijith Thotton <[email protected]>; Rahul Bhansali <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>
Cc: [email protected]; Srujana Challa <[email protected]>; Nithin Kumar Dabilpuram <[email protected]>
Subject: [PATCH v2] event/cnxk: fix LMTST write for single event mode

Quoted 8 lines

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.

Fixes 313e884a22fd ("event/cnxk: support Tx adapter fast path")
Quoted 35 lines
---
 drivers/event/cnxk/cn10k_tx_worker.h | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/event/cnxk/cn10k_tx_worker.h +0 -1
index c18786a14c..81fe31c4b9 100644
@@ -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;
drivers/event/cnxk/cn10k_tx_worker.h +3 -5
 	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;
 }
 
--

2.25.1

Applied
#3 lore raw

Re: [PATCH v2] event/cnxk: fix LMTST write for single event mode

Quoted 17 lines · Pavan Nikhilesh Bhagavatula
Quoted 17 lines

-----Original Message-----
From: Srujana Challa <[email protected]>
Sent: Wednesday, May 31, 2023 4:03 PM
To: Pavan Nikhilesh Bhagavatula <[email protected]>; Shijith Thotton <[email protected]>; Rahul Bhansali <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>
Cc: [email protected]; Srujana Challa <[email protected]>; Nithin Kumar Dabilpuram <[email protected]>
Subject: [PATCH v2] event/cnxk: fix LMTST write for single event mode

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.

Quoted 6 lines
Quoted 4 lines
Fixes 313e884a22fd ("event/cnxk: support Tx adapter fast path")

Applied to dpdk-next-net-mrvl/for-next-net. Thanks

Quoted 37 lines
Quoted 36 lines
---
 drivers/event/cnxk/cn10k_tx_worker.h | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/event/cnxk/cn10k_tx_worker.h +0 -1
index c18786a14c..81fe31c4b9 100644
@@ -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;
drivers/event/cnxk/cn10k_tx_worker.h +3 -5
@@ -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;
 }
 
--

2.25.1