Skip to content

Commit

Permalink
virtio: fix tx_ stats in virtio_net
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rusty Russell committed May 2, 2008
1 parent 5ef8275 commit 655aa31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ static void free_old_xmit_skbs(struct virtnet_info *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);
}
Expand Down

0 comments on commit 655aa31

Please sign in to comment.