netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/6] virtio: fix tx_ stats in virtio_net
@ 2008-04-24  4:56 Rusty Russell
  0 siblings, 0 replies; only message in thread
From: Rusty Russell @ 2008-04-24  4:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: virtualization, netdev


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);
 	}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-04-24  4:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-24  4:56 [PATCH 2/6] virtio: fix tx_ stats in virtio_net Rusty Russell

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).