[dpdk-stable] patch 'ethdev: forbid closing started device' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Wed Nov 10 07:30:51 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.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/12/21. 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/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/dabe1ce96409c54a646583310ab3c79bab07744f

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From dabe1ce96409c54a646583310ab3c79bab07744f Mon Sep 17 00:00:00 2001
From: Andrew Rybchenko <andrew.rybchenko at oktetlabs.ru>
Date: Wed, 20 Oct 2021 16:15:40 +0300
Subject: [PATCH] ethdev: forbid closing started device
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit febc855b358e3579f0eb44c76c329b623f87a376 ]

Ethernet device must be stopped first before close in accordance
with the documentation.

Fixes: 980995f8cc56 ("ethdev: improve API comments of close and detach functions")

Signed-off-by: Andrew Rybchenko <andrew.rybchenko at oktetlabs.ru>
Acked-by: Thomas Monjalon <thomas at monjalon.net>
Acked-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
---
 lib/librte_ethdev/rte_ethdev.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 22fb0b96d7..9b695e1e1b 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -1814,6 +1814,12 @@ rte_eth_dev_close(uint16_t port_id)
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	dev = &rte_eth_devices[port_id];
 
+	if (dev->data->dev_started) {
+		RTE_ETHDEV_LOG(ERR, "Cannot close started device (port %u)\n",
+			       port_id);
+		return -EINVAL;
+	}
+
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_close, -ENOTSUP);
 	*lasterr = (*dev->dev_ops->dev_close)(dev);
 	if (*lasterr != 0)
-- 
2.33.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-10 14:17:09.356791824 +0800
+++ 0167-ethdev-forbid-closing-started-device.patch	2021-11-10 14:17:01.980745191 +0800
@@ -1 +1 @@
-From febc855b358e3579f0eb44c76c329b623f87a376 Mon Sep 17 00:00:00 2001
+From dabe1ce96409c54a646583310ab3c79bab07744f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit febc855b358e3579f0eb44c76c329b623f87a376 ]
@@ -10 +12,0 @@
-Cc: stable at dpdk.org
@@ -16 +18 @@
- lib/ethdev/rte_ethdev.c | 6 ++++++
+ lib/librte_ethdev/rte_ethdev.c | 6 ++++++
@@ -19,5 +21,5 @@
-diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
-index 3b8ef9ef22..f981e0226a 100644
---- a/lib/ethdev/rte_ethdev.c
-+++ b/lib/ethdev/rte_ethdev.c
-@@ -1893,6 +1893,12 @@ rte_eth_dev_close(uint16_t port_id)
+diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
+index 22fb0b96d7..9b695e1e1b 100644
+--- a/lib/librte_ethdev/rte_ethdev.c
++++ b/lib/librte_ethdev/rte_ethdev.c
+@@ -1814,6 +1814,12 @@ rte_eth_dev_close(uint16_t port_id)


More information about the stable mailing list