Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1963654ima; Thu, 25 Oct 2018 07:39:08 -0700 (PDT) X-Google-Smtp-Source: AJdET5dfThSPevewZ829LzumKfNHNbA0jTWktZhsehxtPxNFxeO2BrK/xiq4JRA3O4P+JxXTTe10 X-Received: by 2002:a62:b286:: with SMTP id z6-v6mr1842629pfl.79.1540478348284; Thu, 25 Oct 2018 07:39:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540478348; cv=none; d=google.com; s=arc-20160816; b=DT9FwOLhz3PUY9twZlv1BYCcm6Q3xi2NMzS1KDM60cbZBHCM5mKKlgnVz2fcmNeGf6 uvJ7Iq+llKnalwU/2PsJUFyItgDxhB22uaeo9M0BdPGDPzmhcrlbcf7vyw1Iydpy3vAY a0wQ0ztPzYYLYLK8zmL25BTPelpWKQWPwDnqEASrmj3boHCL90SyYu8XnCJ3h6vurd2x 4gl4hwEcdhk5RjT/FyTxw9bq5UW9of9PEkQOvzMAXPB3BF+NU5Je9K/FODDQGoURbOj4 tGkb3tlrxmaMf5+46n+1JITYZdvyZIlQVXJ0go2GBVSqf6vAzCVRDz1XW7oZkGHlMu8d UGPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=5E11Sbh/nJijE0I6Ih0r3Kc5W3OJHQ9adbfM7+k7q1U=; b=qA7XHTBvbo7kjZfXTc812swDERUDwjusrkv4MmALHXIAHGkfAR2wVgdg08hQpfBYHk YTnWEzfJOYW5odHX+ijEOaRWj1dj+L10ET2Bpu7CQ0n74yMPBWGLAlTvCuJ3w6S0tmVY dB0q/nCvTJdm5QdNI6W7t7Da2cj8n9+M8aUh07KgOmDBm/LPB4WtjuwBhAKEr6c4fj20 JKqDQSOleoI53qldFFH/l6UU7K1/sB7oQOxE8WzjCfGSCo6cfg2axu8nk6RbB3QI8GyZ eq9f4YfqqS9DyqVL5hGL9achkgHKB6AI1esZnTI3cEjGUlu+B+O1if4HUxTWV/qtZeKw 6UVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SpgojnzA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f88-v6si8294734pfe.243.2018.10.25.07.38.29; Thu, 25 Oct 2018 07:39:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SpgojnzA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729439AbeJYWte (ORCPT + 99 others); Thu, 25 Oct 2018 18:49:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:58710 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729416AbeJYWtc (ORCPT ); Thu, 25 Oct 2018 18:49:32 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8798420854; Thu, 25 Oct 2018 14:16:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540476995; bh=Gielzr20pzkfPyCSvakDaXM0j9ztGC/Jw7ftXf4Rcxk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SpgojnzAqXlXf3IRytBfk69d+csTkLk9iH2UOQj+eUEThmXVP4bbiwPnbcwqGObNJ c3gI1NA8IHFllXtfxvpn7sU7KwKnvFppAxdYI/4G1/XVWhPu0xN9u7Vbs4Rrsq7z7W HN3YR7/YOqHi/q5ocZUMHWllg8ZSkUMFni0QUY3E= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andreas Born , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL 4.9 90/98] bonding: ratelimit failed speed/duplex update warning Date: Thu, 25 Oct 2018 10:14:15 -0400 Message-Id: <20181025141423.213774-90-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025141423.213774-1-sashal@kernel.org> References: <20181025141423.213774-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andreas Born [ Upstream commit 11e9d7829dd08dbafb24517fe922f11c3a8a9dc2 ] 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 Signed-off-by: Sasha Levin --- 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 b1ea29d8ad1a..389d1db69a32 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -2132,9 +2132,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.17.1