Commit ce20f161 authored by Nithin Sujir's avatar Nithin Sujir Committed by David S. Miller

tg3: Add a warning during link settings change if mgmt enabled

When the user executes certain ethtool commands such as -s, -A, -G, -L,
-r a phy reset or autonegotiate is performed which results in management
traffic being interrupted.

Add a warning in these cases.
Signed-off-by: default avatarNithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f1315d20
...@@ -2531,6 +2531,13 @@ static void tg3_carrier_off(struct tg3 *tp) ...@@ -2531,6 +2531,13 @@ static void tg3_carrier_off(struct tg3 *tp)
tp->link_up = false; tp->link_up = false;
} }
static void tg3_warn_mgmt_link_flap(struct tg3 *tp)
{
if (tg3_flag(tp, ENABLE_ASF))
netdev_warn(tp->dev,
"Management side-band traffic will be interrupted during phy settings change\n");
}
/* This will reset the tigon3 PHY if there is no valid /* This will reset the tigon3 PHY if there is no valid
* link unless the FORCE argument is non-zero. * link unless the FORCE argument is non-zero.
*/ */
...@@ -11565,6 +11572,8 @@ static int tg3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) ...@@ -11565,6 +11572,8 @@ static int tg3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
tp->link_config.duplex = cmd->duplex; tp->link_config.duplex = cmd->duplex;
} }
tg3_warn_mgmt_link_flap(tp);
if (netif_running(dev)) if (netif_running(dev))
tg3_setup_phy(tp, 1); tg3_setup_phy(tp, 1);
...@@ -11643,6 +11652,8 @@ static int tg3_nway_reset(struct net_device *dev) ...@@ -11643,6 +11652,8 @@ static int tg3_nway_reset(struct net_device *dev)
if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES) if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES)
return -EINVAL; return -EINVAL;
tg3_warn_mgmt_link_flap(tp);
if (tg3_flag(tp, USE_PHYLIB)) { if (tg3_flag(tp, USE_PHYLIB)) {
if (!(tp->phy_flags & TG3_PHYFLG_IS_CONNECTED)) if (!(tp->phy_flags & TG3_PHYFLG_IS_CONNECTED))
return -EAGAIN; return -EAGAIN;
...@@ -11755,6 +11766,9 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam ...@@ -11755,6 +11766,9 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam
struct tg3 *tp = netdev_priv(dev); struct tg3 *tp = netdev_priv(dev);
int err = 0; int err = 0;
if (tp->link_config.autoneg == AUTONEG_ENABLE)
tg3_warn_mgmt_link_flap(tp);
if (tg3_flag(tp, USE_PHYLIB)) { if (tg3_flag(tp, USE_PHYLIB)) {
u32 newadv; u32 newadv;
struct phy_device *phydev; struct phy_device *phydev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment