Skip to contentSkip to conversation

virtio: fix tx_ stats in virtio_net

PATCH New Rusty Russell 1 participant 1 message Apr 24, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/6 virtio: fix tx_ stats in virtio_net

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

---
 drivers/net/virtio_net.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/virtio_net.c +1 -1
diff -r 51bdbdc4f199 drivers/net/virtio_net.c
@@ -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);
 	}