All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Rick Jones <rick.jones2@hp.com>, netdev@vger.kernel.org
Cc: virtualization@lists.linux-foundation.org, mst@redhat.com
Subject: Re: [PATCH net-next] virtio_net: do not rate limit counter increments
Date: Wed, 28 Mar 2012 16:33:22 +1030	[thread overview]
Message-ID: <87r4wd9s9h.fsf@rustcorp.com.au> (raw)
In-Reply-To: <20120327172809.C52572900384@tardy>

On Tue, 27 Mar 2012 10:28:09 -0700 (PDT), raj@tardy.cup.hp.com (Rick Jones) wrote:
> From: Rick Jones <rick.jones2@hp.com>
> 
> While it is desirable to rate limit certain messages, it is not
> desirable to rate limit the incrementing of counters associated
> with those messages.
> 
> Signed-off-by: Rick Jones <rick.jones2@hp.com>

Acked-by: Rusty Russell <rusty@rustcorp.com.au>

Thanks!
Rusty.

> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 019da01..4de2760 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -625,12 +625,13 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev)
>  
>  	/* This can happen with OOM and indirect buffers. */
>  	if (unlikely(capacity < 0)) {
> -		if (net_ratelimit()) {
> -			if (likely(capacity == -ENOMEM)) {
> +		if (likely(capacity == -ENOMEM)) {
> +			if (net_ratelimit()) {
>  				dev_warn(&dev->dev,
>  					 "TX queue failure: out of memory\n");
>  			} else {
> -				dev->stats.tx_fifo_errors++;
> +			dev->stats.tx_fifo_errors++;
> +			if (net_ratelimit())
>  				dev_warn(&dev->dev,
>  					 "Unexpected TX queue failure: %d\n",
>  					 capacity);
> 

-- 
  How could I marry someone with more hair than me?  http://baldalex.org

  reply	other threads:[~2012-03-28  6:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-27 17:28 [PATCH net-next] virtio_net: do not rate limit counter increments Rick Jones
2012-03-28  6:03 ` Rusty Russell [this message]
2012-03-28  8:30 ` Michael S. Tsirkin
2012-03-28  8:41   ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2012-03-27 17:28 Rick Jones

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=87r4wd9s9h.fsf@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=rick.jones2@hp.com \
    --cc=virtualization@lists.linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.