From: Emil Tantilov Date: Thu, 3 Dec 2015 23:20:06 +0000 (-0800) Subject: ixgbe: do not call check_link for ethtool in ixgbe_get_settings() X-Git-Tag: v4.1.12-92~126^2~160 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=96ea19c4d10cfaf0ea9b5de3f98d4a33acd114ff;p=users%2Fjedix%2Flinux-maple.git ixgbe: do not call check_link for ethtool in ixgbe_get_settings() Orabug: 23177316 In ixgbe_get_settings() the link status and speed of the interface are determined based on a read from the LINKS register via the call to mac.ops.check.link(). This can cause issues where external drivers may end up with unknown speed when calling ethtool_get_setings(). Instead of calling the mac.ops.check_link() we can report the speed from the adapter structure which is populated by the driver. Signed-off-by: Emil Tantilov Tested-by: Phil Schmitt Signed-off-by: Jeff Kirsher (cherry picked from commit 0e4d422f5f7249324ac8d1b8e12772e530787a66) Signed-off-by: Brian Maly --- diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c index f317f399da105..b9eec25cbe4b6 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c @@ -185,9 +185,7 @@ static int ixgbe_get_settings(struct net_device *netdev, struct ixgbe_adapter *adapter = netdev_priv(netdev); struct ixgbe_hw *hw = &adapter->hw; ixgbe_link_speed supported_link; - u32 link_speed = 0; bool autoneg = false; - bool link_up; hw->mac.ops.get_link_capabilities(hw, &supported_link, &autoneg); @@ -313,9 +311,8 @@ static int ixgbe_get_settings(struct net_device *netdev, break; } - hw->mac.ops.check_link(hw, &link_speed, &link_up, false); - if (link_up) { - switch (link_speed) { + if (netif_carrier_ok(netdev)) { + switch (adapter->link_speed) { case IXGBE_LINK_SPEED_10GB_FULL: ethtool_cmd_speed_set(ecmd, SPEED_10000); break;