patch 'raw/ntb: fix queue leaks on setup' has been queued to stable release 25.11.5
Kevin Traynor
ktraynor at redhat.com
Thu Dec 3 14:06:05 CET 2026
Hi,
FYI, your patch has been queued to stable release 25.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 12/08/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/kevintraynor/dpdk-stable
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/a5f77a247ec9e9744c1667510dbebecfe15e4752
Thanks.
Kevin
---
>From a5f77a247ec9e9744c1667510dbebecfe15e4752 Mon Sep 17 00:00:00 2001
From: Raghavendra Ningoji <raghavendra.ningoji at amd.com>
Date: Wed, 11 Nov 2026 12:36:50 +0530
Subject: [PATCH] raw/ntb: fix queue leaks on setup
[ upstream commit 0f3f9e841d602db4faec00e7ae5b7e85faae9bb7 ]
The Tx queue was set up first and left in place when the Rx queue
setup failed. A new setup of the same queue pair, either a retry after
such a failure or a reconfiguration, then overwrote the previous queue
pointers without freeing them.
Check the shared configuration before setting up any queue, release
the queues of a previous setup, and release the Tx queue if the Rx
queue setup fails. As the previous queues are released, refuse the
setup while the device is started.
Fixes: c39d1e082a4b ("raw/ntb: setup queues")
Suggested-by: Stephen Hemminger <stephen at networkplumber.org>
Signed-off-by: Raghavendra Ningoji <raghavendra.ningoji at amd.com>
---
drivers/raw/ntb/ntb.c | 64 +++++++++++++++++++++++++------------------
1 file changed, 37 insertions(+), 27 deletions(-)
diff --git a/drivers/raw/ntb/ntb.c b/drivers/raw/ntb/ntb.c
index ee5f2ce2dc..607638f936 100644
--- a/drivers/raw/ntb/ntb.c
+++ b/drivers/raw/ntb/ntb.c
@@ -362,8 +362,6 @@ static void
ntb_rxq_release(struct ntb_rx_queue *rxq)
{
- if (!rxq) {
- NTB_LOG(ERR, "Pointer to rxq is NULL");
+ if (!rxq)
return;
- }
ntb_rxq_release_mbufs(rxq);
@@ -400,9 +398,4 @@ ntb_rxq_setup(struct rte_rawdev *dev,
return -EINVAL;
- if (rxq_conf->rx_mp == NULL) {
- NTB_LOG(ERR, "Invalid null mempool pointer.");
- return -EINVAL;
- }
-
if (ntb_queue_nb_desc_check(rxq_conf->nb_desc) < 0)
return -EINVAL;
@@ -465,8 +458,6 @@ static void
ntb_txq_release(struct ntb_tx_queue *txq)
{
- if (!txq) {
- NTB_LOG(ERR, "Pointer to txq is NULL");
+ if (!txq)
return;
- }
ntb_txq_release_mbufs(txq);
@@ -549,4 +540,20 @@ ntb_txq_setup(struct rte_rawdev *dev,
+static int
+ntb_queue_release(struct rte_rawdev *dev, uint16_t queue_id)
+{
+ struct ntb_hw *hw = dev->dev_private;
+
+ if (queue_id >= hw->queue_pairs)
+ return -EINVAL;
+
+ ntb_txq_release(hw->tx_queues[queue_id]);
+ hw->tx_queues[queue_id] = NULL;
+ ntb_rxq_release(hw->rx_queues[queue_id]);
+ hw->rx_queues[queue_id] = NULL;
+
+ return 0;
+}
+
static int
ntb_queue_setup(struct rte_rawdev *dev,
@@ -555,4 +562,5 @@ ntb_queue_setup(struct rte_rawdev *dev,
size_t conf_size)
{
+ struct ntb_queue_conf *conf = queue_conf;
struct ntb_hw *hw = dev->dev_private;
int ret;
@@ -561,4 +569,20 @@ ntb_queue_setup(struct rte_rawdev *dev,
return -EINVAL;
+ if (conf == NULL || conf_size != sizeof(*conf))
+ return -EINVAL;
+
+ if (conf->rx_mp == NULL) {
+ NTB_LOG(ERR, "Invalid null mempool pointer.");
+ return -EINVAL;
+ }
+
+ if (dev->started) {
+ NTB_LOG(ERR, "Cannot setup queue %u of a started device.", queue_id);
+ return -EBUSY;
+ }
+
+ /* Release the queues of a previous setup. */
+ ntb_queue_release(dev, queue_id);
+
ret = ntb_txq_setup(dev, queue_id, queue_conf, conf_size);
if (ret < 0)
@@ -566,24 +590,10 @@ ntb_queue_setup(struct rte_rawdev *dev,
ret = ntb_rxq_setup(dev, queue_id, queue_conf, conf_size);
+ if (ret < 0)
+ ntb_queue_release(dev, queue_id);
return ret;
}
-static int
-ntb_queue_release(struct rte_rawdev *dev, uint16_t queue_id)
-{
- struct ntb_hw *hw = dev->dev_private;
-
- if (queue_id >= hw->queue_pairs)
- return -EINVAL;
-
- ntb_txq_release(hw->tx_queues[queue_id]);
- hw->tx_queues[queue_id] = NULL;
- ntb_rxq_release(hw->rx_queues[queue_id]);
- hw->rx_queues[queue_id] = NULL;
-
- return 0;
-}
-
static uint16_t
ntb_queue_count(struct rte_rawdev *dev)
--
2.56.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-12-03 12:52:51.605194114 +0000
+++ 0439-raw-ntb-fix-queue-leaks-on-setup.patch 2026-12-03 12:52:39.336390849 +0000
@@ -1 +1 @@
-From 0f3f9e841d602db4faec00e7ae5b7e85faae9bb7 Mon Sep 17 00:00:00 2001
+From a5f77a247ec9e9744c1667510dbebecfe15e4752 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 0f3f9e841d602db4faec00e7ae5b7e85faae9bb7 ]
+
@@ -17 +18,0 @@
-Cc: stable at dpdk.org
@@ -26 +27 @@
-index 9fab22ee77..51ffa683c8 100644
+index ee5f2ce2dc..607638f936 100644
@@ -29 +30 @@
-@@ -236,8 +236,6 @@ static void
+@@ -362,8 +362,6 @@ static void
@@ -39 +40 @@
-@@ -274,9 +272,4 @@ ntb_rxq_setup(struct rte_rawdev *dev,
+@@ -400,9 +398,4 @@ ntb_rxq_setup(struct rte_rawdev *dev,
@@ -49 +50 @@
-@@ -339,8 +332,6 @@ static void
+@@ -465,8 +458,6 @@ static void
@@ -59 +60 @@
-@@ -423,4 +414,20 @@ ntb_txq_setup(struct rte_rawdev *dev,
+@@ -549,4 +540,20 @@ ntb_txq_setup(struct rte_rawdev *dev,
@@ -80 +81 @@
-@@ -429,4 +436,5 @@ ntb_queue_setup(struct rte_rawdev *dev,
+@@ -555,4 +562,5 @@ ntb_queue_setup(struct rte_rawdev *dev,
@@ -86 +87 @@
-@@ -435,4 +443,20 @@ ntb_queue_setup(struct rte_rawdev *dev,
+@@ -561,4 +569,20 @@ ntb_queue_setup(struct rte_rawdev *dev,
@@ -107 +108 @@
-@@ -440,24 +464,10 @@ ntb_queue_setup(struct rte_rawdev *dev,
+@@ -566,24 +590,10 @@ ntb_queue_setup(struct rte_rawdev *dev,
More information about the stable
mailing list