DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/3] net/cnxk: fix incorrect check cookies with security offload
@ 2023-06-15 13:09 Nithin Dabilpuram
  2023-06-15 13:09 ` [PATCH 2/3] net/cnxk: support backpressure on SPB pool Nithin Dabilpuram
  2023-06-15 13:09 ` [PATCH 3/3] common/cnxk: update minimum size of packet Nithin Dabilpuram
  0 siblings, 2 replies; 4+ messages in thread
From: Nithin Dabilpuram @ 2023-06-15 13:09 UTC (permalink / raw)
  To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao; +Cc: jerinj, dev

Fix missing/incorrect check cookies call's with security offload
enabled on Rx and Tx.

Fixes: 55bfac717c72 ("net/cnxk: support Tx security offload on cn10k")
Fixes: 0ed7107373b4 ("net/cnxk: remove duplicate mempool debug checks")

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 drivers/net/cnxk/cn10k_rx.h | 12 ++++++------
 drivers/net/cnxk/cn10k_tx.h |  2 ++
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/net/cnxk/cn10k_rx.h b/drivers/net/cnxk/cn10k_rx.h
index b7074906a6..8148866e44 100644
--- a/drivers/net/cnxk/cn10k_rx.h
+++ b/drivers/net/cnxk/cn10k_rx.h
@@ -1241,6 +1241,12 @@ cn10k_nix_recv_pkts_vector(void *args, struct rte_mbuf **mbufs, uint16_t pkts,
 		mbuf2 = (struct rte_mbuf *)vgetq_lane_u64(mbuf23, 0);
 		mbuf3 = (struct rte_mbuf *)vgetq_lane_u64(mbuf23, 1);
 
+		/* Mark mempool obj as "get" as it is alloc'ed by NIX */
+		RTE_MEMPOOL_CHECK_COOKIES(mbuf0->pool, (void **)&mbuf0, 1, 1);
+		RTE_MEMPOOL_CHECK_COOKIES(mbuf1->pool, (void **)&mbuf1, 1, 1);
+		RTE_MEMPOOL_CHECK_COOKIES(mbuf2->pool, (void **)&mbuf2, 1, 1);
+		RTE_MEMPOOL_CHECK_COOKIES(mbuf3->pool, (void **)&mbuf3, 1, 1);
+
 		if (!(flags & NIX_RX_VWQE_F)) {
 			/* Mask to get packet len from NIX_RX_SG_S */
 			const uint8x16_t shuf_msk = {
@@ -1753,12 +1759,6 @@ cn10k_nix_recv_pkts_vector(void *args, struct rte_mbuf **mbufs, uint16_t pkts,
 		vst1q_u64((uint64_t *)&mbufs[packets], mbuf01);
 		vst1q_u64((uint64_t *)&mbufs[packets + 2], mbuf23);
 
-		/* Mark mempool obj as "get" as it is alloc'ed by NIX */
-		RTE_MEMPOOL_CHECK_COOKIES(mbuf0->pool, (void **)&mbuf0, 1, 1);
-		RTE_MEMPOOL_CHECK_COOKIES(mbuf1->pool, (void **)&mbuf1, 1, 1);
-		RTE_MEMPOOL_CHECK_COOKIES(mbuf2->pool, (void **)&mbuf2, 1, 1);
-		RTE_MEMPOOL_CHECK_COOKIES(mbuf3->pool, (void **)&mbuf3, 1, 1);
-
 		nix_mbuf_validate_next(mbuf0);
 		nix_mbuf_validate_next(mbuf1);
 		nix_mbuf_validate_next(mbuf2);
diff --git a/drivers/net/cnxk/cn10k_tx.h b/drivers/net/cnxk/cn10k_tx.h
index 17793493cc..17e27aff40 100644
--- a/drivers/net/cnxk/cn10k_tx.h
+++ b/drivers/net/cnxk/cn10k_tx.h
@@ -1866,10 +1866,12 @@ cn10k_nix_xmit_store(struct cn10k_eth_txq *txq,
 			vst1q_u64(LMT_OFF(laddr, 0, 16), cmd2);
 			vst1q_u64(LMT_OFF(laddr, 0, 32), cmd1);
 		}
+		RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 0);
 	} else {
 		/* Store the prepared send desc to LMT lines */
 		vst1q_u64(LMT_OFF(laddr, 0, 0), cmd0);
 		vst1q_u64(LMT_OFF(laddr, 0, 16), cmd1);
+		RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 0);
 	}
 }
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-16  1:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-15 13:09 [PATCH 1/3] net/cnxk: fix incorrect check cookies with security offload Nithin Dabilpuram
2023-06-15 13:09 ` [PATCH 2/3] net/cnxk: support backpressure on SPB pool Nithin Dabilpuram
2023-06-15 13:09 ` [PATCH 3/3] common/cnxk: update minimum size of packet Nithin Dabilpuram
2023-06-16  1:24   ` Jerin Jacob

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).