Skip to content

Commit

Permalink
net/ngbe: keep link down after device close
Browse files Browse the repository at this point in the history
[ 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: 3518df5 ("net/ngbe: support device start/stop")
Fixes: 708ebe7 ("net/ngbe: fix external PHY power down")

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
  • Loading branch information
Jiawen Wu authored and kevintraynor committed Oct 31, 2023
1 parent a3d1c5e commit 5658f2d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/net/ngbe/ngbe_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ ngbe_dev_stop(struct rte_eth_dev *dev)
int vf;

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

PMD_INIT_FUNC_TRACE();

Expand Down Expand Up @@ -1196,6 +1196,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;
}

Expand Down

0 comments on commit 5658f2d

Please sign in to comment.