Commit 11ac4e66 authored by Heiner Kallweit's avatar Heiner Kallweit Committed by David S. Miller
Browse files

r8169: keep pause settings on interface down/up cycle



Currently, if the user changes the pause settings, the default settings
will be restored after an interface down/up cycle, and also when
resuming from suspend. This doesn't seem to provide the best user
experience. Change this to keep user settings, and just ensure that in
jumbo mode pause is disabled.
Small drawback: When switching back mtu from jumbo to non-jumbo then
pause remains disabled (but user can enable it using ethtool).
I think that's a not too common scenario and acceptable.

Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8203c7ce
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -2388,12 +2388,14 @@ static void rtl_jumbo_config(struct rtl8169_private *tp)
		pcie_set_readrq(tp->pci_dev, readrq);

	/* Chip doesn't support pause in jumbo mode */
	linkmode_mod_bit(ETHTOOL_LINK_MODE_Pause_BIT,
			 tp->phydev->advertising, !jumbo);
	linkmode_mod_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
			 tp->phydev->advertising, !jumbo);
	if (jumbo) {
		linkmode_clear_bit(ETHTOOL_LINK_MODE_Pause_BIT,
				   tp->phydev->advertising);
		linkmode_clear_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
				   tp->phydev->advertising);
		phy_start_aneg(tp->phydev);
	}
}

DECLARE_RTL_COND(rtl_chipcmd_cond)
{
@@ -5121,6 +5123,8 @@ static int r8169_mdio_register(struct rtl8169_private *tp)

	tp->phydev->mac_managed_pm = 1;

	phy_support_asym_pause(tp->phydev);

	/* PHY will be woken up in rtl_open() */
	phy_suspend(tp->phydev);