From: Harman Kalra <hkalra@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>,
Harman Kalra <hkalra@marvell.com>
Cc: <dev@dpdk.org>
Subject: [PATCH 4/8] net/cnxk: fix eswitch multiseg
Date: Wed, 23 Oct 2024 20:31:38 +0530 [thread overview]
Message-ID: <20241023150143.113877-4-hkalra@marvell.com> (raw)
In-Reply-To: <20241023150143.113877-1-hkalra@marvell.com>
Data corruption is observed in case of VxLAN packets as the segment
data was not handled properly
Fixes: 6ad061cd74ad ("net/cnxk: support multi-segment in eswitch")
Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
drivers/net/cnxk/cnxk_eswitch_rxtx.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/net/cnxk/cnxk_eswitch_rxtx.c b/drivers/net/cnxk/cnxk_eswitch_rxtx.c
index 6df4ecd762..832c4e5d5c 100644
--- a/drivers/net/cnxk/cnxk_eswitch_rxtx.c
+++ b/drivers/net/cnxk/cnxk_eswitch_rxtx.c
@@ -120,6 +120,7 @@ cnxk_eswitch_dev_tx_burst(struct cnxk_eswitch_dev *eswitch_dev, uint16_t qid,
{
struct roc_nix_sq *sq = &eswitch_dev->txq[qid].sqs;
struct roc_nix_rq *rq = &eswitch_dev->rxq[qid].rqs;
+ uint64_t cmd[6 + CNXK_NIX_TX_MSEG_SG_DWORDS - 2];
uint16_t lmt_id, pkt = 0, nb_tx = 0;
struct nix_send_ext_s *send_hdr_ext;
struct nix_send_hdr_s *send_hdr;
@@ -128,11 +129,9 @@ cnxk_eswitch_dev_tx_burst(struct cnxk_eswitch_dev *eswitch_dev, uint16_t qid,
union nix_send_sg_s *sg;
uintptr_t lmt_base, pa;
int64_t fc_pkts, dw_m1;
- uint64_t cmd_cn9k[16];
struct rte_mbuf *m;
rte_iova_t io_addr;
uint16_t segdw;
- uint64_t *cmd;
uint64_t len;
uint8_t off;
@@ -149,12 +148,7 @@ cnxk_eswitch_dev_tx_burst(struct cnxk_eswitch_dev *eswitch_dev, uint16_t qid,
/* 2(HDR) + 2(EXT_HDR) + 1(SG) + 1(IOVA) = 6/2 - 1 = 2 */
dw_m1 = cn10k_nix_tx_ext_subs(flags) + 1;
- if (roc_model_is_cn9k()) {
- memset(cmd_cn9k, 0, sizeof(cmd_cn9k));
- cmd = &cmd_cn9k[0];
- } else {
- cmd = (uint64_t *)lmt_base;
- }
+ memset(cmd, 0, sizeof(cmd));
send_hdr = (struct nix_send_hdr_s *)&cmd[0];
send_hdr->w0.sq = sq->qid;
@@ -204,6 +198,7 @@ cnxk_eswitch_dev_tx_burst(struct cnxk_eswitch_dev *eswitch_dev, uint16_t qid,
if (roc_model_is_cn9k()) {
nix_cn9k_xmit_one(cmd, sq->lmt_addr, sq->io_addr, segdw);
} else {
+ cn10k_nix_xmit_mv_lmt_base(lmt_base, cmd, flags);
/* PA<6:4> = LMTST size-1 in units of 128 bits. Size of the first LMTST in
* burst.
*/
--
2.46.0.469.g4590f2e941
next prev parent reply other threads:[~2024-10-23 15:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-23 15:01 [PATCH 1/8] common/cnxk: common mbox for representor events Harman Kalra
2024-10-23 15:01 ` [PATCH 2/8] net/cnxk: " Harman Kalra
2024-10-23 15:01 ` [PATCH 3/8] common/cnxk: fix double free of flow aging resources Harman Kalra
2024-10-23 15:01 ` Harman Kalra [this message]
2024-10-23 15:01 ` [PATCH 5/8] net/cnxk: append mark ID action Harman Kalra
2024-10-23 15:01 ` [PATCH 6/8] net/cnxk: support single flow dump Harman Kalra
2024-10-23 15:01 ` [PATCH 7/8] common/cnxk: update representee RSS rule via PF Harman Kalra
2024-10-23 15:01 ` [PATCH 8/8] net/cnxk: handle RSS action for representees Harman Kalra
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=20241023150143.113877-4-hkalra@marvell.com \
--to=hkalra@marvell.com \
--cc=dev@dpdk.org \
--cc=kirankumark@marvell.com \
--cc=ndabilpuram@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).