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

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Nov 20 13:44:34 CET 2025


Hi,

FYI, your patch has been queued to stable release 22.11.11

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/22/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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/883e6017cbc409d696b63aad17a6e972b01785ad

Thanks.

Luca Boccassi

---
>From 883e6017cbc409d696b63aad17a6e972b01785ad 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 1f3277ba34..63505feb38 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -2945,14 +2945,22 @@ static int
 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.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-11-20 12:44:12.873098998 +0000
+++ 0002-net-dpaa2-fix-duplicate-call-of-close.patch	2025-11-20 12:44:12.766087696 +0000
@@ -1 +1 @@
-From 3b8225353ea3b9eb03df5dee94a037582d0d6748 Mon Sep 17 00:00:00 2001
+From 883e6017cbc409d696b63aad17a6e972b01785ad 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 1f3277ba34..63505feb38 100644
@@ -34 +35 @@
-@@ -3347,14 +3347,22 @@ static int
+@@ -2945,14 +2945,22 @@ static int


More information about the stable mailing list