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") Cc: sta...@dpdk.org Signed-off-by: Jiawen Wu <jiawe...@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 e027e71b24..9a594a1db7 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.27.0