aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDon Skidmore <donald.c.skidmore@intel.com>2009-01-26 23:57:17 -0500
committerDavid S. Miller <davem@davemloft.net>2009-01-26 23:57:17 -0500
commit5b9c3cdd55ba57a25ae586373aaff723d8150085 (patch)
tree3a86f89b30ab67738a06f0a61549f445ed076e1e /drivers/net
parentafcf12422ec8236dc8b9238fef7a475876eea8da (diff)
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>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index f7b592eff68e..18d4353afa65 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -3901,16 +3901,27 @@ static void ixgbe_netpoll(struct net_device *netdev)
3901 **/ 3901 **/
3902static int ixgbe_link_config(struct ixgbe_hw *hw) 3902static int ixgbe_link_config(struct ixgbe_hw *hw)
3903{ 3903{
3904 u32 autoneg = IXGBE_LINK_SPEED_10GB_FULL; 3904 u32 autoneg;
3905 bool link_up = false;
3906 u32 ret = IXGBE_ERR_LINK_SETUP;
3905 3907
3906 /* must always autoneg for both 1G and 10G link */ 3908 if (hw->mac.ops.check_link)
3907 hw->mac.autoneg = true; 3909 ret = hw->mac.ops.check_link(hw, &autoneg, &link_up, false);
3908 3910
3909 if ((hw->mac.type == ixgbe_mac_82598EB) && 3911 if (ret || !link_up)
3910 (hw->phy.media_type == ixgbe_media_type_copper)) 3912 goto link_cfg_out;
3911 autoneg = IXGBE_LINK_SPEED_82598_AUTONEG;
3912 3913
3913 return hw->mac.ops.setup_link_speed(hw, autoneg, true, true); 3914 if (hw->mac.ops.get_link_capabilities)
3915 ret = hw->mac.ops.get_link_capabilities(hw, &autoneg,
3916 &hw->mac.autoneg);
3917 if (ret)
3918 goto link_cfg_out;
3919
3920 if (hw->mac.ops.setup_link_speed)
3921 ret = hw->mac.ops.setup_link_speed(hw, autoneg, true, true);
3922
3923link_cfg_out:
3924 return ret;
3914} 3925}
3915 3926
3916static const struct net_device_ops ixgbe_netdev_ops = { 3927static const struct net_device_ops ixgbe_netdev_ops = {