From f1d9b81edddc9292b64af09db8269bbb77017ba0 Mon Sep 17 00:00:00 2001 From: fauno Date: Wed, 30 Aug 2017 10:07:40 -0300 Subject: linux-libre: 4.12.9 --- ...elimit-failed-speed-duplex-update-warning.patch | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 libre/linux-libre/bonding-ratelimit-failed-speed-duplex-update-warning.patch (limited to 'libre/linux-libre/bonding-ratelimit-failed-speed-duplex-update-warning.patch') diff --git a/libre/linux-libre/bonding-ratelimit-failed-speed-duplex-update-warning.patch b/libre/linux-libre/bonding-ratelimit-failed-speed-duplex-update-warning.patch new file mode 100644 index 000000000..c1a8bc5b4 --- /dev/null +++ b/libre/linux-libre/bonding-ratelimit-failed-speed-duplex-update-warning.patch @@ -0,0 +1,47 @@ +From 11e9d7829dd08dbafb24517fe922f11c3a8a9dc2 Mon Sep 17 00:00:00 2001 +From: Andreas Born +Date: Sat, 12 Aug 2017 00:36:55 +0200 +Subject: [PATCH] bonding: ratelimit failed speed/duplex update warning + +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: b5bf0f5b16b9c (bonding: correctly update link status during mii-commit phase) +Signed-off-by: Andreas Born +Signed-off-by: David S. Miller +--- + drivers/net/bonding/bond_main.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c +index 85bb272d2a34..fc63992ab0e0 100644 +--- a/drivers/net/bonding/bond_main.c ++++ b/drivers/net/bonding/bond_main.c +@@ -2144,9 +2144,10 @@ static void bond_miimon_commit(struct bonding *bond) + if (bond_update_speed_duplex(slave) && + bond_needs_speed_duplex(bond)) { + slave->link = BOND_LINK_DOWN; +- netdev_warn(bond->dev, +- "failed to get link speed/duplex for %s\n", +- slave->dev->name); ++ if (net_ratelimit()) ++ netdev_warn(bond->dev, ++ "failed to get link speed/duplex for %s\n", ++ slave->dev->name); + continue; + } + bond_set_slave_link_state(slave, BOND_LINK_UP, +-- +2.14.1 + -- cgit v1.2.3