patch 'net/cnxk: fix mbuf fields in multi-segment Tx' has been queued to stable release 22.11.5
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Thu Mar 14 01:09:30 CET 2024
Hi,
FYI, your patch has been queued to stable release 22.11.5
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/16/24. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/ba9eb97868d388f29899a6a612ff4cfd393c6a37
Thanks.
Luca Boccassi
---
>From ba9eb97868d388f29899a6a612ff4cfd393c6a37 Mon Sep 17 00:00:00 2001
From: Rahul Bhansali <rbhansali at marvell.com>
Date: Mon, 26 Feb 2024 19:05:36 +0530
Subject: [PATCH] net/cnxk: fix mbuf fields in multi-segment Tx
[ upstream commit 8ed5ca4dda858c991b27ad6ce5a5525e26a960c0 ]
Currently in debug mode when a buffer is allocated in SW,
nb_segs will have invalid values as it didn't come from driver
Rx path. Hence reset mbuf next and nb_segs fields in multi-seg Tx path.
Fixes: 3626d5195d49 ("net/cnxk: add multi-segment Tx for CN10K")
Signed-off-by: Rahul Bhansali <rbhansali at marvell.com>
---
drivers/net/cnxk/cn10k_tx.h | 2 ++
drivers/net/cnxk/cn9k_tx.h | 20 ++++++++++++++++++++
2 files changed, 22 insertions(+)
diff --git a/drivers/net/cnxk/cn10k_tx.h b/drivers/net/cnxk/cn10k_tx.h
index 0e7280bd56..254ddf0536 100644
--- a/drivers/net/cnxk/cn10k_tx.h
+++ b/drivers/net/cnxk/cn10k_tx.h
@@ -943,6 +943,7 @@ cn10k_nix_prepare_mseg(struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags)
len -= sg_u & 0xFFFF;
nb_segs = m->nb_segs - 1;
m_next = m->next;
+ m->nb_segs = 1;
slist = &cmd[3 + off + 1];
/* Set invert df if buffer is not to be freed by H/W */
@@ -1404,6 +1405,7 @@ cn10k_nix_prepare_mseg_vec_list(struct rte_mbuf *m, uint64_t *cmd,
#endif
m->next = NULL;
+ m->nb_segs = 1;
m = m_next;
/* Fill mbuf segments */
do {
diff --git a/drivers/net/cnxk/cn9k_tx.h b/drivers/net/cnxk/cn9k_tx.h
index 7362025a34..257f1ce1aa 100644
--- a/drivers/net/cnxk/cn9k_tx.h
+++ b/drivers/net/cnxk/cn9k_tx.h
@@ -448,6 +448,10 @@ cn9k_nix_prepare_mseg(struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags)
if (!(sg_u & (1ULL << 55)))
RTE_MEMPOOL_CHECK_COOKIES(m->pool, (void **)&m, 1, 0);
rte_io_wmb();
+#endif
+#ifdef RTE_ENABLE_ASSERT
+ m->next = NULL;
+ m->nb_segs = 1;
#endif
m = m_next;
if (!m)
@@ -483,6 +487,9 @@ cn9k_nix_prepare_mseg(struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags)
sg_u = sg->u;
slist++;
}
+#ifdef RTE_ENABLE_ASSERT
+ m->next = NULL;
+#endif
m = m_next;
} while (nb_segs);
@@ -496,6 +503,9 @@ done:
segdw += (off >> 1) + 1 + !!(flags & NIX_TX_OFFLOAD_TSTAMP_F);
send_hdr->w0.sizem1 = segdw - 1;
+#ifdef RTE_ENABLE_ASSERT
+ rte_io_wmb();
+#endif
return segdw;
}
@@ -699,6 +709,10 @@ cn9k_nix_prepare_mseg_vec_list(struct rte_mbuf *m, uint64_t *cmd,
rte_io_wmb();
#endif
+#ifdef RTE_ENABLE_ASSERT
+ m->next = NULL;
+ m->nb_segs = 1;
+#endif
m = m_next;
/* Fill mbuf segments */
do {
@@ -728,6 +742,9 @@ cn9k_nix_prepare_mseg_vec_list(struct rte_mbuf *m, uint64_t *cmd,
sg_u = sg->u;
slist++;
}
+#ifdef RTE_ENABLE_ASSERT
+ m->next = NULL;
+#endif
m = m_next;
} while (nb_segs);
@@ -743,6 +760,9 @@ cn9k_nix_prepare_mseg_vec_list(struct rte_mbuf *m, uint64_t *cmd,
!!(flags & NIX_TX_OFFLOAD_TSTAMP_F);
sh->sizem1 = segdw - 1;
+#ifdef RTE_ENABLE_ASSERT
+ rte_io_wmb();
+#endif
return segdw;
}
--
2.39.2
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-03-14 00:09:22.269809144 +0000
+++ 0034-net-cnxk-fix-mbuf-fields-in-multi-segment-Tx.patch 2024-03-14 00:09:20.621615380 +0000
@@ -1 +1 @@
-From 8ed5ca4dda858c991b27ad6ce5a5525e26a960c0 Mon Sep 17 00:00:00 2001
+From ba9eb97868d388f29899a6a612ff4cfd393c6a37 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8ed5ca4dda858c991b27ad6ce5a5525e26a960c0 ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index 91b7f15c02..266c899a05 100644
+index 0e7280bd56..254ddf0536 100644
@@ -23 +24,2 @@
-@@ -1277,6 +1277,7 @@ cn10k_nix_prepare_mseg(struct cn10k_eth_txq *txq,
+@@ -943,6 +943,7 @@ cn10k_nix_prepare_mseg(struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags)
+ len -= sg_u & 0xFFFF;
@@ -26 +27,0 @@
- m->next = NULL;
@@ -30,4 +31,4 @@
- cookie = RTE_MBUF_DIRECT(m) ? m : rte_mbuf_from_indirect(m);
-@@ -1822,6 +1823,7 @@ cn10k_nix_prepare_mseg_vec_list(struct rte_mbuf *m, uint64_t *cmd,
- nb_segs = m->nb_segs - 1;
- m_next = m->next;
+ /* Set invert df if buffer is not to be freed by H/W */
+@@ -1404,6 +1405,7 @@ cn10k_nix_prepare_mseg_vec_list(struct rte_mbuf *m, uint64_t *cmd,
+ #endif
+
@@ -40 +41 @@
-index 3596651cc2..94acbe64fa 100644
+index 7362025a34..257f1ce1aa 100644
@@ -43 +44,3 @@
-@@ -647,6 +647,10 @@ cn9k_nix_prepare_mseg(struct cn9k_eth_txq *txq,
+@@ -448,6 +448,10 @@ cn9k_nix_prepare_mseg(struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags)
+ if (!(sg_u & (1ULL << 55)))
+ RTE_MEMPOOL_CHECK_COOKIES(m->pool, (void **)&m, 1, 0);
@@ -45,2 +47,0 @@
- #else
- RTE_SET_USED(cookie);
@@ -54 +55 @@
-@@ -683,6 +687,9 @@ cn9k_nix_prepare_mseg(struct cn9k_eth_txq *txq,
+@@ -483,6 +487,9 @@ cn9k_nix_prepare_mseg(struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags)
@@ -64 +65 @@
-@@ -696,6 +703,9 @@ done:
+@@ -496,6 +503,9 @@ done:
@@ -74,2 +75,2 @@
-@@ -912,6 +922,10 @@ cn9k_nix_prepare_mseg_vec_list(struct cn9k_eth_txq *txq,
- RTE_SET_USED(cookie);
+@@ -699,6 +709,10 @@ cn9k_nix_prepare_mseg_vec_list(struct rte_mbuf *m, uint64_t *cmd,
+ rte_io_wmb();
@@ -85 +86 @@
-@@ -942,6 +956,9 @@ cn9k_nix_prepare_mseg_vec_list(struct cn9k_eth_txq *txq,
+@@ -728,6 +742,9 @@ cn9k_nix_prepare_mseg_vec_list(struct rte_mbuf *m, uint64_t *cmd,
@@ -95 +96 @@
-@@ -957,6 +974,9 @@ cn9k_nix_prepare_mseg_vec_list(struct cn9k_eth_txq *txq,
+@@ -743,6 +760,9 @@ cn9k_nix_prepare_mseg_vec_list(struct rte_mbuf *m, uint64_t *cmd,
@@ -97 +98 @@
- send_hdr->w0.sizem1 = segdw - 1;
+ sh->sizem1 = segdw - 1;
More information about the stable
mailing list