netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Andreas Born <futur.andy@googlemail.com>, netdev@vger.kernel.org
Subject: Re: [PATCH] bonding: ratelimit failed speed/duplex update warning
Date: Fri, 11 Aug 2017 03:59:06 -0700	[thread overview]
Message-ID: <1502449146.3099.10.camel@perches.com> (raw)
In-Reply-To: <20170811100413.16234-1-futur.andy@googlemail.com>

On Fri, 2017-08-11 at 12:04 +0200, Andreas Born wrote:
> 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 pr_warn_ratelimited() should be used
> instead. pr_warn_once() would not be sufficient since the call to
> bond_update_speed_duplex() could recover to meanwhile succeed and fail
> again later.
[]
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
[]
> @@ -2144,9 +2144,9 @@ 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);
> +				pr_warn_ratelimited("%s: failed to get link speed/duplex for %s\n",
> +						    bond->dev->name,
> +						    slave->dev->name);

This is more commonly done using

		if (net_ratelimit())
			netdev_warn(etc...)

      reply	other threads:[~2017-08-11 10:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-11 10:04 [PATCH] bonding: ratelimit failed speed/duplex update warning Andreas Born
2017-08-11 10:59 ` Joe Perches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1502449146.3099.10.camel@perches.com \
    --to=joe@perches.com \
    --cc=futur.andy@googlemail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).