veth: Add ethtool statistics support for XDP
authorToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Thu, 11 Oct 2018 09:36:50 +0000 (18:36 +0900)
committerDavid S. Miller <davem@davemloft.net>
Tue, 16 Oct 2018 04:58:46 +0000 (21:58 -0700)
commitd397b9682c1c808344dd93b43de8750fa4d9f581
tree4a7739eb711b13d69f05886d149c29ca91081b22
parent4195e54aaf1c8d465666333f47662088c9e63672
veth: Add ethtool statistics support for XDP

Expose per-queue stats for ethtool -S.
As there are only rx queues, and rx queues are used only when XDP is
used, per-queue counters are only rx XDP ones.

Example:

$ ethtool -S veth0
NIC statistics:
     peer_ifindex: 11
     rx_queue_0_xdp_packets: 28601434
     rx_queue_0_xdp_bytes: 1716086040
     rx_queue_0_xdp_drops: 28601434
     rx_queue_1_xdp_packets: 17873050
     rx_queue_1_xdp_bytes: 1072383000
     rx_queue_1_xdp_drops: 17873050

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