* [PATCH net-next] virtio_net: do not rate limit counter increments
@ 2012-03-27 17:28 Rick Jones
0 siblings, 0 replies; 4+ messages in thread
From: Rick Jones @ 2012-03-27 17:28 UTC (permalink / raw)
To: netdev; +Cc: virtualization, mst
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>
---
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);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] virtio_net: do not rate limit counter increments
[not found] <20120327172809.C52572900384@tardy>
@ 2012-03-28 6:03 ` Rusty Russell
2012-03-28 8:30 ` Michael S. Tsirkin
1 sibling, 0 replies; 4+ messages in thread
From: Rusty Russell @ 2012-03-28 6:03 UTC (permalink / raw)
To: Rick Jones, netdev; +Cc: virtualization, mst
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] virtio_net: do not rate limit counter increments
[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
2012-03-28 8:41 ` David Miller
1 sibling, 1 reply; 4+ messages in thread
From: Michael S. Tsirkin @ 2012-03-28 8:30 UTC (permalink / raw)
To: Rick Jones; +Cc: netdev, virtualization
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);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] virtio_net: do not rate limit counter increments
2012-03-28 8:30 ` Michael S. Tsirkin
@ 2012-03-28 8:41 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2012-03-28 8:41 UTC (permalink / raw)
To: mst; +Cc: netdev, rick.jones2, virtualization
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Wed, 28 Mar 2012 10:30:46 +0200
> 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!
Done.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-03-28 8:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[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
2012-03-28 8:41 ` David Miller
2012-03-27 17:28 Rick Jones
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).