ixgbe: fix slow load times on 82598 nics
Load times for NICs that use i2c to communicate with the phy were taking ~4.5 sec per port. This fix first checks to see if the link is already up before calling get_link_capabilities, since if it is we don't need query the phy for link state. Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
afcf12422e
commit
5b9c3cdd55
|
@ -3901,16 +3901,27 @@ static void ixgbe_netpoll(struct net_device *netdev)
|
||||||
**/
|
**/
|
||||||
static int ixgbe_link_config(struct ixgbe_hw *hw)
|
static int ixgbe_link_config(struct ixgbe_hw *hw)
|
||||||
{
|
{
|
||||||
u32 autoneg = IXGBE_LINK_SPEED_10GB_FULL;
|
u32 autoneg;
|
||||||
|
bool link_up = false;
|
||||||
|
u32 ret = IXGBE_ERR_LINK_SETUP;
|
||||||
|
|
||||||
/* must always autoneg for both 1G and 10G link */
|
if (hw->mac.ops.check_link)
|
||||||
hw->mac.autoneg = true;
|
ret = hw->mac.ops.check_link(hw, &autoneg, &link_up, false);
|
||||||
|
|
||||||
if ((hw->mac.type == ixgbe_mac_82598EB) &&
|
if (ret || !link_up)
|
||||||
(hw->phy.media_type == ixgbe_media_type_copper))
|
goto link_cfg_out;
|
||||||
autoneg = IXGBE_LINK_SPEED_82598_AUTONEG;
|
|
||||||
|
|
||||||
return hw->mac.ops.setup_link_speed(hw, autoneg, true, true);
|
if (hw->mac.ops.get_link_capabilities)
|
||||||
|
ret = hw->mac.ops.get_link_capabilities(hw, &autoneg,
|
||||||
|
&hw->mac.autoneg);
|
||||||
|
if (ret)
|
||||||
|
goto link_cfg_out;
|
||||||
|
|
||||||
|
if (hw->mac.ops.setup_link_speed)
|
||||||
|
ret = hw->mac.ops.setup_link_speed(hw, autoneg, true, true);
|
||||||
|
|
||||||
|
link_cfg_out:
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct net_device_ops ixgbe_netdev_ops = {
|
static const struct net_device_ops ixgbe_netdev_ops = {
|
||||||
|
|
Reference in New Issue