patch 'raw/ntb: fix queue leaks on setup' has been queued to stable release 24.11.9
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Mon Nov 16 23:52:28 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/18/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/c18d9e4675cf374dc249bdd91ca8bac160b98ade
Thanks.
Luca Boccassi
---
>From c18d9e4675cf374dc249bdd91ca8bac160b98ade 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 bb3b5d3269..1de934c064 100644
--- a/drivers/raw/ntb/ntb.c
+++ b/drivers/raw/ntb/ntb.c
@@ -361,10 +361,8 @@ ntb_rxq_release_mbufs(struct ntb_rx_queue *q)
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);
@@ -399,11 +397,6 @@ ntb_rxq_setup(struct rte_rawdev *dev,
if (conf_size != sizeof(*rxq_conf))
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;
@@ -464,10 +457,8 @@ ntb_txq_release_mbufs(struct ntb_tx_queue *q)
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);
@@ -548,43 +539,62 @@ 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,
uint16_t queue_id,
rte_rawdev_obj_t queue_conf,
size_t conf_size)
{
+ struct ntb_queue_conf *conf = queue_conf;
struct ntb_hw *hw = dev->dev_private;
int ret;
if (queue_id >= hw->queue_pairs)
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)
return ret;
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.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-11-16 22:52:19.420021559 +0000
+++ 0074-raw-ntb-fix-queue-leaks-on-setup.patch 2026-11-16 22:52:16.536234756 +0000
@@ -1 +1 @@
-From 0f3f9e841d602db4faec00e7ae5b7e85faae9bb7 Mon Sep 17 00:00:00 2001
+From c18d9e4675cf374dc249bdd91ca8bac160b98ade 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 bb3b5d3269..1de934c064 100644
@@ -29 +30 @@
-@@ -235,10 +235,8 @@ ntb_rxq_release_mbufs(struct ntb_rx_queue *q)
+@@ -361,10 +361,8 @@ ntb_rxq_release_mbufs(struct ntb_rx_queue *q)
@@ -41 +42 @@
-@@ -273,11 +271,6 @@ ntb_rxq_setup(struct rte_rawdev *dev,
+@@ -399,11 +397,6 @@ ntb_rxq_setup(struct rte_rawdev *dev,
@@ -53 +54 @@
-@@ -338,10 +331,8 @@ ntb_txq_release_mbufs(struct ntb_tx_queue *q)
+@@ -464,10 +457,8 @@ ntb_txq_release_mbufs(struct ntb_tx_queue *q)
@@ -65 +66 @@
-@@ -422,43 +413,62 @@ ntb_txq_setup(struct rte_rawdev *dev,
+@@ -548,43 +539,62 @@ ntb_txq_setup(struct rte_rawdev *dev,
More information about the stable
mailing list