patch 'net/mana: fix Tx burst error handling' has been queued to stable release 24.11.9
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Thu Nov 5 17:43:16 CET 2026
Hi,
FYI, your patch has been queued to stable release 24.11.9
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/07/26. 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/4365e4034b3d72c4be7b789aea2c4373a712b5de
Thanks.
Luca Boccassi
---
>From 4365e4034b3d72c4be7b789aea2c4373a712b5de Mon Sep 17 00:00:00 2001
From: Tathagat Priyadarshi <tathagat.dpdk at gmail.com>
Date: Tue, 27 Oct 2026 18:21:14 +0000
Subject: [PATCH] net/mana: fix Tx burst error handling
[ upstream commit 1a7aea32761480ed88e7e7eb1d05bb6119e20b17 ]
mana_tx_burst() skipped, using continue, a packet that exceeded the
segment limit or whose SGL could not be populated. rte_eth_tx_burst()
callers treat the return value as a contiguous prefix of consumed
packets, so later packets were posted while the caller considered them
unsent and freed them, and their completions then freed them again.
Drop such a packet instead: count it in stats.errors, free it and
include it in the returned count. Return early only when the ring is
full, since a packet that fails validation would fail again on every
retry and stall applications that loop until all packets are sent.
sgl.gdma_sgl[] holds MAX_SGL_ENTRIES_FOR_TRANSMIT entries, but
max_send_sge comes from the device and was not limited, so a packet with
more segments could write past the array. Reject such packets and limit
the advertised nb_seg_max and nb_mtu_seg_max to the same value.
Fixes: 7f322844f427 ("net/mana: send packets")
Fixes: d878cb09501d ("net/mana: report device info")
Signed-off-by: Tathagat Priyadarshi <tathagat.dpdk at gmail.com>
---
drivers/net/mana/mana.c | 4 ++--
drivers/net/mana/tx.c | 18 ++++++++++++++----
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/drivers/net/mana/mana.c b/drivers/net/mana/mana.c
index 605b8bfa2f4..2e240548486 100644
--- a/drivers/net/mana/mana.c
+++ b/drivers/net/mana/mana.c
@@ -371,9 +371,9 @@ mana_dev_info_get(struct rte_eth_dev *dev,
dev_info->tx_desc_lim.nb_max = RTE_MIN(priv->max_tx_desc, UINT16_MAX);
dev_info->tx_desc_lim.nb_align = MIN_BUFFERS_PER_QUEUE;
dev_info->tx_desc_lim.nb_seg_max =
- RTE_MIN(priv->max_send_sge, UINT16_MAX);
+ RTE_MIN(priv->max_send_sge, MAX_SGL_ENTRIES_FOR_TRANSMIT);
dev_info->tx_desc_lim.nb_mtu_seg_max =
- RTE_MIN(priv->max_send_sge, UINT16_MAX);
+ RTE_MIN(priv->max_send_sge, MAX_SGL_ENTRIES_FOR_TRANSMIT);
/* Speed */
dev_info->speed_capa = RTE_ETH_LINK_SPEED_100G;
diff --git a/drivers/net/mana/tx.c b/drivers/net/mana/tx.c
index 57dbbc36511..16a2230a225 100644
--- a/drivers/net/mana/tx.c
+++ b/drivers/net/mana/tx.c
@@ -189,6 +189,7 @@ mana_tx_burst(void *dpdk_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
int ret;
void *db_page;
uint16_t pkt_sent = 0;
+ uint16_t nb_done = 0;
uint32_t num_comp, i;
#ifdef RTE_ARCH_32
uint32_t wqe_count = 0;
@@ -250,10 +251,11 @@ mana_tx_burst(void *dpdk_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
break;
/* Drop the packet if it exceeds max segments */
- if (m_pkt->nb_segs > priv->max_send_sge) {
+ if (unlikely(m_pkt->nb_segs > priv->max_send_sge ||
+ m_pkt->nb_segs > MAX_SGL_ENTRIES_FOR_TRANSMIT)) {
DP_LOG(ERR, "send packet segments %d exceeding max",
m_pkt->nb_segs);
- continue;
+ goto drop;
}
/* Fill in the oob */
@@ -404,7 +406,7 @@ mana_tx_burst(void *dpdk_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
/* Skip this packet if we can't populate all segments */
if (seg_idx != m_pkt->nb_segs)
- continue;
+ goto drop;
/* If we can at least queue post two WQEs and there are at
* least two packets to send, use TX CQE suppression for the
@@ -449,6 +451,7 @@ mana_tx_burst(void *dpdk_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
txq->desc_ring_len++;
pkt_sent++;
+ nb_done++;
DP_LOG(DEBUG, "nb_pkts %u pkt[%d] sent",
nb_pkts, pkt_idx);
@@ -471,6 +474,13 @@ mana_tx_burst(void *dpdk_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
pkt_idx, ret);
break;
}
+
+ continue;
+
+drop:
+ txq->stats.errors++;
+ rte_pktmbuf_free(m_pkt);
+ nb_done++;
}
/* Ring hardware door bell */
@@ -501,5 +511,5 @@ mana_tx_burst(void *dpdk_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
DP_LOG(ERR, "mana_ring_doorbell failed ret %d", ret);
}
- return pkt_sent;
+ return nb_done;
}
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-11-05 16:42:49.100599682 +0000
+++ 0109-net-mana-fix-Tx-burst-error-handling.patch 2026-11-05 16:42:45.065065089 +0000
@@ -1 +1 @@
-From 1a7aea32761480ed88e7e7eb1d05bb6119e20b17 Mon Sep 17 00:00:00 2001
+From 4365e4034b3d72c4be7b789aea2c4373a712b5de Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 1a7aea32761480ed88e7e7eb1d05bb6119e20b17 ]
+
@@ -24 +25,0 @@
-Cc: stable at dpdk.org
@@ -33 +34 @@
-index 0ea6d9a54a8..d0c79a34efe 100644
+index 605b8bfa2f4..2e240548486 100644
@@ -36 +37 @@
-@@ -410,9 +410,9 @@ mana_dev_info_get(struct rte_eth_dev *dev,
+@@ -371,9 +371,9 @@ mana_dev_info_get(struct rte_eth_dev *dev,
@@ -49 +50 @@
-index 10f2212b5d2..16e63e89c91 100644
+index 57dbbc36511..16a2230a225 100644
@@ -52 +53 @@
-@@ -192,6 +192,7 @@ mana_tx_burst(void *dpdk_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+@@ -189,6 +189,7 @@ mana_tx_burst(void *dpdk_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
@@ -58 +58,0 @@
- uint32_t expected = 0;
@@ -60 +60,2 @@
-@@ -278,10 +279,11 @@ mana_tx_burst(void *dpdk_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+ uint32_t wqe_count = 0;
+@@ -250,10 +251,11 @@ mana_tx_burst(void *dpdk_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
@@ -74 +75 @@
-@@ -432,7 +434,7 @@ mana_tx_burst(void *dpdk_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+@@ -404,7 +406,7 @@ mana_tx_burst(void *dpdk_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
@@ -83 +84 @@
-@@ -477,6 +479,7 @@ mana_tx_burst(void *dpdk_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+@@ -449,6 +451,7 @@ mana_tx_burst(void *dpdk_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
@@ -91 +92 @@
-@@ -499,6 +502,13 @@ mana_tx_burst(void *dpdk_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+@@ -471,6 +474,13 @@ mana_tx_burst(void *dpdk_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
@@ -105,3 +106,3 @@
-@@ -523,5 +533,5 @@ mana_tx_burst(void *dpdk_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
- rte_atomic_fetch_and_explicit(&txq->burst_state, ~(uint32_t)1,
- rte_memory_order_release);
+@@ -501,5 +511,5 @@ mana_tx_burst(void *dpdk_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+ DP_LOG(ERR, "mana_ring_doorbell failed ret %d", ret);
+ }
More information about the stable
mailing list