patch 'net/ngbe: keep link down after device close' has been queued to stable release 22.11.4

Xueming Li xuemingl at nvidia.com
Sun Oct 22 16:21:01 CEST 2023


Hi,

FYI, your patch has been queued to stable release 22.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/15/23. 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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=d9b0b9b3e264330161f39631d663cdddbe9571c3

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From d9b0b9b3e264330161f39631d663cdddbe9571c3 Mon Sep 17 00:00:00 2001
From: Jiawen Wu <jiawenwu at trustnetic.com>
Date: Thu, 28 Sep 2023 17:47:55 +0800
Subject: [PATCH] net/ngbe: keep link down after device close
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 3dd64cf80ed5142eeb0a8e3051a583fb38761221 ]

When the port is closed, hardware is reset to power on. And
ngbe_dev_stop() is just returned 0 to avoid secondary calls,
so that the link led remains on. Fix this bug by adding to turn
off the PHY power.

Fixes: 3518df5774c7 ("net/ngbe: support device start/stop")
Fixes: 708ebe7d0399 ("net/ngbe: fix external PHY power down")

Signed-off-by: Jiawen Wu <jiawenwu at trustnetic.com>
---
 drivers/net/ngbe/ngbe_ethdev.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ngbe/ngbe_ethdev.c b/drivers/net/ngbe/ngbe_ethdev.c
index f3f10d63e5..0445f3626b 100644
--- a/drivers/net/ngbe/ngbe_ethdev.c
+++ b/drivers/net/ngbe/ngbe_ethdev.c
@@ -1167,7 +1167,7 @@ ngbe_dev_stop(struct rte_eth_dev *dev)
 	int vf;

 	if (hw->adapter_stopped)
-		return 0;
+		goto out;

 	PMD_INIT_FUNC_TRACE();

@@ -1189,8 +1189,6 @@ ngbe_dev_stop(struct rte_eth_dev *dev)
 	for (vf = 0; vfinfo != NULL && vf < pci_dev->max_vfs; vf++)
 		vfinfo[vf].clear_to_send = false;

-	hw->phy.set_phy_power(hw, false);
-
 	ngbe_dev_clear_queues(dev);

 	/* Clear stored conf */
@@ -1217,6 +1215,10 @@ ngbe_dev_stop(struct rte_eth_dev *dev)
 	hw->adapter_stopped = true;
 	dev->data->dev_started = 0;

+out:
+	/* close phy to prevent reset in dev_close from restarting physical link */
+	hw->phy.set_phy_power(hw, false);
+
 	return 0;
 }

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-10-22 22:17:35.613884800 +0800
+++ 0032-net-ngbe-keep-link-down-after-device-close.patch	2023-10-22 22:17:34.196723700 +0800
@@ -1 +1 @@
-From 3dd64cf80ed5142eeb0a8e3051a583fb38761221 Mon Sep 17 00:00:00 2001
+From d9b0b9b3e264330161f39631d663cdddbe9571c3 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 3dd64cf80ed5142eeb0a8e3051a583fb38761221 ]
@@ -13 +15,0 @@
-Cc: stable at dpdk.org
@@ -21 +23 @@
-index dd387779ab..1cdd56497e 100644
+index f3f10d63e5..0445f3626b 100644


More information about the stable mailing list