virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Rick Jones <rick.jones2@hp.com>
Cc: netdev@vger.kernel.org, virtualization@lists.linux-foundation.org
Subject: Re: [PATCH net-next] virtio_net: do not rate limit counter increments
Date: Wed, 28 Mar 2012 10:30:46 +0200	[thread overview]
Message-ID: <20120328083046.GA5873@redhat.com> (raw)
In-Reply-To: <20120327172809.C52572900384@tardy>

On Tue, Mar 27, 2012 at 10:28:09AM -0700, 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: Michael S. Tsirkin <mst@redhat.com>

Dave, can you apply pls? Thanks!

> ---
> 
> Compiled, and run briefly in a 1 vCPU guest under a netperf workload.
> 
> 
> 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);

  parent reply	other threads:[~2012-03-28  8:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20120327172809.C52572900384@tardy>
2012-03-28  6:03 ` [PATCH net-next] virtio_net: do not rate limit counter increments Rusty Russell
2012-03-28  8:30 ` Michael S. Tsirkin [this message]
2012-03-28  8:41   ` David Miller
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=20120328083046.GA5873@redhat.com \
    --to=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 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).