Commit 72942014 authored by Andreas Born's avatar Andreas Born Committed by Greg Kroah-Hartman

bonding: ratelimit failed speed/duplex update warning


[ Upstream commit 11e9d782 ]

bond_miimon_commit() handles the UP transition for each slave of a bond
in the case of MII. It is triggered 10 times per second for the default
MII Polling interval of 100ms. For device drivers that do not implement
__ethtool_get_link_ksettings() the call to bond_update_speed_duplex()
fails persistently while the MII status could remain UP. That is, in
this and other cases where the speed/duplex update keeps failing over a
longer period of time while the MII state is UP, a warning is printed
every MII polling interval.

To address these excessive warnings net_ratelimit() should be used.
Printing a warning once would not be sufficient since the call to
bond_update_speed_duplex() could recover to succeed and fail again
later. In that case there would be no new indication what went wrong.

Fixes: b5bf0f5b (bonding: correctly update link status during mii-commit phase)
Signed-off-by: default avatarAndreas Born <futur.andy@googlemail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b39ae1c8
...@@ -2141,9 +2141,10 @@ static void bond_miimon_commit(struct bonding *bond) ...@@ -2141,9 +2141,10 @@ static void bond_miimon_commit(struct bonding *bond)
if (bond_update_speed_duplex(slave) && if (bond_update_speed_duplex(slave) &&
bond_needs_speed_duplex(bond)) { bond_needs_speed_duplex(bond)) {
slave->link = BOND_LINK_DOWN; slave->link = BOND_LINK_DOWN;
netdev_warn(bond->dev, if (net_ratelimit())
"failed to get link speed/duplex for %s\n", netdev_warn(bond->dev,
slave->dev->name); "failed to get link speed/duplex for %s\n",
slave->dev->name);
continue; continue;
} }
bond_set_slave_link_state(slave, BOND_LINK_UP, bond_set_slave_link_state(slave, BOND_LINK_UP,
......
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