Commit 967d691e authored by Alexander Duyck's avatar Alexander Duyck Committed by Sultan Alsawaf

ixgbevf: Use cached link state instead of re-reading the value for ethtool

BugLink: https://bugs.launchpad.net/bugs/1836760

Change the ethtool link settings call to just read the cached state out of
the adapter structure instead of trying to recheck the value from the PF.
Doing this should prevent excessive reading of the mailbox.
Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@linux.intel.com>
Reviewed-by: default avatar"Guilherme G. Piccoli" <gpiccoli@canonical.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
(backported from commit 1e1b0c65)
[gpiccoli:
* Context adjustment for v4.4.
* Changed the patch to use the old ethtool API for get link settings
(get_link_ksettings -> get_settings); the new API was introduced in
v4.6 by commit 3f1ac7a7.]
Signed-off-by: default avatarGuilherme G. Piccoli <gpiccoli@canonical.com>
Acked-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Acked-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent d6d4784b
...@@ -95,22 +95,16 @@ static int ixgbevf_get_settings(struct net_device *netdev, ...@@ -95,22 +95,16 @@ static int ixgbevf_get_settings(struct net_device *netdev,
struct ethtool_cmd *ecmd) struct ethtool_cmd *ecmd)
{ {
struct ixgbevf_adapter *adapter = netdev_priv(netdev); struct ixgbevf_adapter *adapter = netdev_priv(netdev);
struct ixgbe_hw *hw = &adapter->hw;
u32 link_speed = 0;
bool link_up;
ecmd->supported = SUPPORTED_10000baseT_Full; ecmd->supported = SUPPORTED_10000baseT_Full;
ecmd->autoneg = AUTONEG_DISABLE; ecmd->autoneg = AUTONEG_DISABLE;
ecmd->transceiver = XCVR_DUMMY1; ecmd->transceiver = XCVR_DUMMY1;
ecmd->port = -1; ecmd->port = -1;
hw->mac.get_link_status = 1; if (adapter->link_up) {
hw->mac.ops.check_link(hw, &link_speed, &link_up, false);
if (link_up) {
__u32 speed = SPEED_10000; __u32 speed = SPEED_10000;
switch (link_speed) { switch (adapter->link_speed) {
case IXGBE_LINK_SPEED_10GB_FULL: case IXGBE_LINK_SPEED_10GB_FULL:
speed = SPEED_10000; speed = SPEED_10000;
break; break;
......
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