patch 'net/dpaa2: fix duplicate call of close' has been queued to stable release 24.11.4

Kevin Traynor ktraynor at redhat.com
Fri Nov 21 12:20:50 CET 2025


Hi,

FYI, your patch has been queued to stable release 24.11.4

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/26/25. 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/918721461c64ff52b9e6b2e1451fbaaa61650c27

Thanks.

Kevin

---
>From 918721461c64ff52b9e6b2e1451fbaaa61650c27 Mon Sep 17 00:00:00 2001
From: Hemant Agrawal <hemant.agrawal at nxp.com>
Date: Fri, 14 Nov 2025 11:54:51 +0530
Subject: [PATCH] net/dpaa2: fix duplicate call of close
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 3b8225353ea3b9eb03df5dee94a037582d0d6748 ]

When rte_eth_dev_close() is called, it performs the following actions:

Calls dev->dev_ops->dev_close(), which in this case is dpaa2_dev_close().
Then calls rte_eth_dev_release_port(), which releases all device data
and sets dev->data to NULL.

Later, when rte_dev_remove() is called, the FSLMC bus invokes
dev->remove() — that is, rte_dpaa2_remove().
However, rte_dpaa2_remove() calls dpaa2_dev_close() again. Since dev->data
was already set to NULL by the previous call, this second invocation
causes a crash.

Fixes: 5964d36a2904 ("net/dpaa2: release port upon close")

Signed-off-by: Hemant Agrawal <hemant.agrawal at nxp.com>
Tested-by: Maxime Leroy <maxime at leroys.fr>
---
 drivers/net/dpaa2/dpaa2_ethdev.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 722bb6fa8e..c9dc0fbdf0 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -3056,12 +3056,20 @@ rte_dpaa2_remove(struct rte_dpaa2_device *dpaa2_dev)
 {
 	struct rte_eth_dev *eth_dev;
-	int ret;
+	int ret = 0;
+
+	eth_dev = rte_eth_dev_allocated(dpaa2_dev->device.name);
+	if (eth_dev) {
+		ret = dpaa2_dev_close(eth_dev);
+		if (ret)
+			DPAA2_PMD_ERR("dpaa2_dev_close ret= %d", ret);
+
+		ret = rte_eth_dev_release_port(eth_dev);
+	}
 
-	eth_dev = dpaa2_dev->eth_dev;
-	dpaa2_dev_close(eth_dev);
 	dpaa2_valid_dev--;
-	if (!dpaa2_valid_dev)
+	if (!dpaa2_valid_dev) {
 		rte_mempool_free(dpaa2_tx_sg_pool);
-	ret = rte_eth_dev_release_port(eth_dev);
+		dpaa2_tx_sg_pool = NULL;
+	}
 
 	return ret;
-- 
2.51.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-11-21 11:05:11.645575378 +0000
+++ 0066-net-dpaa2-fix-duplicate-call-of-close.patch	2025-11-21 11:05:09.542201506 +0000
@@ -1 +1 @@
-From 3b8225353ea3b9eb03df5dee94a037582d0d6748 Mon Sep 17 00:00:00 2001
+From 918721461c64ff52b9e6b2e1451fbaaa61650c27 Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit 3b8225353ea3b9eb03df5dee94a037582d0d6748 ]
+
@@ -22 +23,0 @@
-Cc: stable at dpdk.org
@@ -31 +32 @@
-index 7da32ce856..fcda267e0b 100644
+index 722bb6fa8e..c9dc0fbdf0 100644
@@ -34 +35 @@
-@@ -3348,12 +3348,20 @@ rte_dpaa2_remove(struct rte_dpaa2_device *dpaa2_dev)
+@@ -3056,12 +3056,20 @@ rte_dpaa2_remove(struct rte_dpaa2_device *dpaa2_dev)



More information about the stable mailing list