]> git.baikalelectronics.ru Git - kernel.git/commit
virtio_net: Fix incosistent received bytes counter
authorToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Mon, 23 Jul 2018 14:36:04 +0000 (23:36 +0900)
committerDavid S. Miller <davem@davemloft.net>
Wed, 25 Jul 2018 19:58:25 +0000 (12:58 -0700)
commitdd783f038a83226e94799ebf86fc34a72fe89e2d
treeaf0f25dffd1f64acc88cf1cb65321a60458b0672
parent84d31afaee431fe2f27ef062070e6f77d4904a2f
virtio_net: Fix incosistent received bytes counter

When received packets are dropped in virtio_net driver, received packets
counter is incremented but bytes counter is not.
As a result, for instance if we drop all packets by XDP, only received
is counted and bytes stays 0, which looks inconsistent.
IMHO received packets/bytes should be counted if packets are produced by
the hypervisor, like what common NICs on physical machines are doing.
So fix the bytes counter.

Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/virtio_net.c