diff options
author | Rick Jones <rick.jones2@hp.com> | 2012-03-27 09:28:09 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-03-28 10:40:45 +0200 |
commit | 2e57b79ccef1ff1422fdf45a9b28fe60f8f084f7 (patch) | |
tree | d9975ef7900db6d707519cae98e98cf20aee3342 /drivers/net/virtio_net.c | |
parent | Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsh... (diff) | |
download | linux-2e57b79ccef1ff1422fdf45a9b28fe60f8f084f7.tar.xz linux-2e57b79ccef1ff1422fdf45a9b28fe60f8f084f7.zip |
virtio_net: do not rate limit counter increments
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>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r-- | drivers/net/virtio_net.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 019da012669f..4de2760c5937 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); |