From: Nithin Dabilpuram <ndabilpuram@marvell.com>
To: Nithin Dabilpuram <ndabilpuram@marvell.com>,
Kiran Kumar K <kirankumark@marvell.com>,
Sunil Kumar Kori <skori@marvell.com>,
Satha Rao <skoteshwar@marvell.com>
Cc: <jerinj@marvell.com>, <dev@dpdk.org>
Subject: [PATCH 1/3] net/cnxk: fix incorrect check cookies with security offload
Date: Thu, 15 Jun 2023 18:39:22 +0530 [thread overview]
Message-ID: <20230615130924.828208-1-ndabilpuram@marvell.com> (raw)
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
next reply other threads:[~2023-06-15 13:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-15 13:09 Nithin Dabilpuram [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230615130924.828208-1-ndabilpuram@marvell.com \
--to=ndabilpuram@marvell.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=kirankumark@marvell.com \
--cc=skori@marvell.com \
--cc=skoteshwar@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).