patch 'ethdev: fix PCI device release in secondary process' has been queued to stable release 19.11.11

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Tue Nov 30 17:34:58 CET 2021


Hi,

FYI, your patch has been queued to stable release 19.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 December 10th 2021. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/77153554589c77b9926fa85fcff37c5232a8e8ec

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From 77153554589c77b9926fa85fcff37c5232a8e8ec Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong at huawei.com>
Date: Thu, 21 Oct 2021 10:24:21 +0800
Subject: [PATCH] ethdev: fix PCI device release in secondary process

[ upstream commit 17faaed85449b58b209150906d2ad2cbfd853150 ]

In secondary process, rte_eth_dev_close() doesn't clear eth_dev->data.
If calling rte_dev_remove() after rte_eth_dev_close(), in
rte_eth_dev_pci_generic_remove() function, the released eth device still
can be found by its name in shared memory. As a result, the eth device
will be released repeatedly. The state of the eth device is modified to
RTE_ETH_DEV_UNUSED after rte_eth_dev_close(). So this state can be used
to avoid this problem.

Fixes: dcd5c8112bc3 ("ethdev: add PCI driver helpers")

Signed-off-by: Huisong Li <lihuisong at huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
 lib/librte_ethdev/rte_ethdev_pci.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/librte_ethdev/rte_ethdev_pci.h b/lib/librte_ethdev/rte_ethdev_pci.h
index d44a8e2a39..7dae0d5a44 100644
--- a/lib/librte_ethdev/rte_ethdev_pci.h
+++ b/lib/librte_ethdev/rte_ethdev_pci.h
@@ -164,6 +164,16 @@ rte_eth_dev_pci_generic_remove(struct rte_pci_device *pci_dev,
 	if (!eth_dev)
 		return 0;
 
+	/*
+	 * In secondary process, a released eth device can be found by its name
+	 * in shared memory.
+	 * If the state of the eth device is RTE_ETH_DEV_UNUSED, it means the
+	 * eth device has been released.
+	 */
+	if (rte_eal_process_type() == RTE_PROC_SECONDARY &&
+	    eth_dev->state == RTE_ETH_DEV_UNUSED)
+		return 0;
+
 	if (dev_uninit) {
 		ret = dev_uninit(eth_dev);
 		if (ret)
-- 
2.34.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-30 16:50:11.358642521 +0100
+++ 0094-ethdev-fix-PCI-device-release-in-secondary-process.patch	2021-11-30 16:50:05.890874264 +0100
@@ -1 +1 @@
-From 17faaed85449b58b209150906d2ad2cbfd853150 Mon Sep 17 00:00:00 2001
+From 77153554589c77b9926fa85fcff37c5232a8e8ec Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 17faaed85449b58b209150906d2ad2cbfd853150 ]
+
@@ -15 +16,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
- lib/ethdev/ethdev_pci.h | 10 ++++++++++
+ lib/librte_ethdev/rte_ethdev_pci.h | 10 ++++++++++
@@ -23,5 +24,5 @@
-diff --git a/lib/ethdev/ethdev_pci.h b/lib/ethdev/ethdev_pci.h
-index 12015b6b87..59c5d7b40f 100644
---- a/lib/ethdev/ethdev_pci.h
-+++ b/lib/ethdev/ethdev_pci.h
-@@ -151,6 +151,16 @@ rte_eth_dev_pci_generic_remove(struct rte_pci_device *pci_dev,
+diff --git a/lib/librte_ethdev/rte_ethdev_pci.h b/lib/librte_ethdev/rte_ethdev_pci.h
+index d44a8e2a39..7dae0d5a44 100644
+--- a/lib/librte_ethdev/rte_ethdev_pci.h
++++ b/lib/librte_ethdev/rte_ethdev_pci.h
+@@ -164,6 +164,16 @@ rte_eth_dev_pci_generic_remove(struct rte_pci_device *pci_dev,


More information about the stable mailing list