Commit 745b5c65 authored by Edwin Peer's avatar Edwin Peer Committed by David S. Miller

bnxt_en: avoid link reset if speed is not changed

PORT_PHY_CONFIG is always sent with REQ_FLAGS_RESET_PHY set. This flag
must be set in order for the firmware to institute the requested PHY
change immediately, but it results in a link flap. This is unnecessary
and results in an improved user experience if the PHY reconfiguration
is avoided when the user requested speed does not constitute a change.
Signed-off-by: default avatarEdwin Peer <edwin.peer@broadcom.com>
Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3128e811
...@@ -1736,6 +1736,11 @@ static int bnxt_force_link_speed(struct net_device *dev, u32 ethtool_speed) ...@@ -1736,6 +1736,11 @@ static int bnxt_force_link_speed(struct net_device *dev, u32 ethtool_speed)
return -EINVAL; return -EINVAL;
} }
if (link_info->req_link_speed == fw_speed &&
link_info->req_signal_mode == sig_mode &&
link_info->autoneg == 0)
return -EALREADY;
link_info->req_link_speed = fw_speed; link_info->req_link_speed = fw_speed;
link_info->req_signal_mode = sig_mode; link_info->req_signal_mode = sig_mode;
link_info->req_duplex = BNXT_LINK_DUPLEX_FULL; link_info->req_duplex = BNXT_LINK_DUPLEX_FULL;
...@@ -1816,8 +1821,11 @@ static int bnxt_set_link_ksettings(struct net_device *dev, ...@@ -1816,8 +1821,11 @@ static int bnxt_set_link_ksettings(struct net_device *dev,
} }
speed = base->speed; speed = base->speed;
rc = bnxt_force_link_speed(dev, speed); rc = bnxt_force_link_speed(dev, speed);
if (rc) if (rc) {
if (rc == -EALREADY)
rc = 0;
goto set_setting_exit; goto set_setting_exit;
}
} }
if (netif_running(dev)) if (netif_running(dev))
......
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