All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: linux-kernel@vger.kernel.org
Cc: virtualization@lists.linux-foundation.org, netdev@vger.kernel.org
Subject: [PATCH 2/6] virtio: fix tx_ stats in virtio_net
Date: Wed, 23 Apr 2008 23:56:07 -0500	[thread overview]
Message-ID: <200804241456.07551.rusty@rustcorp.com.au> (raw)


get_buf() gives the length written by the other side, which will be
zero.  We want to add the skb length.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
 drivers/net/virtio_net.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -r 51bdbdc4f199 drivers/net/virtio_net.c
--- a/drivers/net/virtio_net.c	Thu Apr 10 15:55:52 2008 +1000
+++ b/drivers/net/virtio_net.c	Mon Apr 14 11:13:45 2008 +1000
@@ -221,7 +221,7 @@ static void free_old_xmit_skbs(struct vi
 	while ((skb = vi->svq->vq_ops->get_buf(vi->svq, &len)) != NULL) {
 		pr_debug("Sent skb %p\n", skb);
 		__skb_unlink(skb, &vi->send);
-		vi->dev->stats.tx_bytes += len;
+		vi->dev->stats.tx_bytes += skb->len;
 		vi->dev->stats.tx_packets++;
 		kfree_skb(skb);
 	}


             reply	other threads:[~2008-04-24  4:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-24  4:56 Rusty Russell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-04-24  4:56 [PATCH 2/6] virtio: fix tx_ stats in virtio_net Rusty Russell

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=200804241456.07551.rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --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.