OSDN Git Service

virtio_net: Make drop counter per-queue
authorToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Mon, 23 Jul 2018 14:36:06 +0000 (23:36 +0900)
committerDavid S. Miller <davem@davemloft.net>
Wed, 25 Jul 2018 19:53:37 +0000 (12:53 -0700)
commit2c4a2f7d826329966e8ab86f842a95d3234c64da
tree73371e30771a5f615cd9cd8744f937b83894beaf
parenta0929a44c2065da33c17b1b8015a88401d71ca7b
virtio_net: Make drop counter per-queue

Since when XDP was introduced, drop counter has been able to be updated
much more frequently than before, as XDP_DROP increments the counter.
Thus for performance analysis per-queue drop counter would be useful.

Also this avoids cache contention and race on updating the counter. It
is currently racy because napi handlers read-modify-write it without any
locks.

There are more counters in dev->stats that are racy, but I left them
per-device, because they are rarely updated and does not worth being
per-queue counters IMHO. To fix them we need atomic ops or some kind of
locks.

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