Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e1b0c65 authored by Alexander Duyck's avatar Alexander Duyck Committed by Jeff Kirsher
Browse files

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



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>
parent 9fe06a51
Loading
Loading
Loading
Loading
+2 −8
Original line number Original line Diff line number Diff line
@@ -85,22 +85,16 @@ static int ixgbevf_get_link_ksettings(struct net_device *netdev,
				      struct ethtool_link_ksettings *cmd)
				      struct ethtool_link_ksettings *cmd)
{
{
	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;


	ethtool_link_ksettings_zero_link_mode(cmd, supported);
	ethtool_link_ksettings_zero_link_mode(cmd, supported);
	ethtool_link_ksettings_add_link_mode(cmd, supported, 10000baseT_Full);
	ethtool_link_ksettings_add_link_mode(cmd, supported, 10000baseT_Full);
	cmd->base.autoneg = AUTONEG_DISABLE;
	cmd->base.autoneg = AUTONEG_DISABLE;
	cmd->base.port = -1;
	cmd->base.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;