提交 655aa31f 编写于 作者: R Rusty Russell

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.
Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
上级 5ef82752
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册