linux/drivers/net
Xuan Zhuo d888f04c09 virtio-net: support queue stat
To enhance functionality, we now support reporting statistics through
the netdev-generic netlink (netdev-genl) queue stats interface. However,
this does not extend to all statistics, so a new field, qstat_offset,
has been introduced. This field determines which statistics should be
reported via netdev-genl queue stats.

Given that queue stats are retrieved individually per queue, it's
necessary for the virtnet_get_hw_stats() function to be capable of
fetching statistics for a specific queue.

As the document https://docs.kernel.org/next/networking/statistics.html#notes-for-driver-authors

We should not duplicate the stats which get reported via the netlink API in
ethtool. If the stats are for queue stat, that will not be reported by
ethtool -S.

python3 ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/netdev.yaml
    --dump qstats-get --json '{"scope": "queue"}'
[{'ifindex': 2,
  'queue-id': 0,
  'queue-type': 'rx',
  'rx-bytes': 157844011,
  'rx-csum-bad': 0,
  'rx-csum-none': 0,
  'rx-csum-unnecessary': 2195386,
  'rx-hw-drop-overruns': 0,
  'rx-hw-drop-ratelimits': 0,
  'rx-hw-drops': 12964,
  'rx-packets': 598929},
 {'ifindex': 2,
  'queue-id': 0,
  'queue-type': 'tx',
  'tx-bytes': 1938511,
  'tx-csum-none': 0,
  'tx-hw-drop-errors': 0,
  'tx-hw-drop-ratelimits': 0,
  'tx-hw-drops': 0,
  'tx-needs-csum': 61263,
  'tx-packets': 15515}]

Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2024-04-30 10:51:33 +02:00
..
arcnet archnet: Convert from tasklet to BH workqueue 2024-04-08 19:44:09 -07:00
bonding bonding: no longer use RTNL in bonding_show_queue_id() 2024-04-09 17:31:45 -07:00
caif
can net: handle HAS_IOPORT dependencies 2024-04-08 11:56:56 +01:00
dsa net: dsa: ksz_common: use separate phylink_mac_ops for ksz8830 2024-04-29 19:02:36 -07:00
ethernet net: txgbe: use phylink_pcs_change() to report PCS link change events 2024-04-29 19:04:35 -07:00
fddi net: handle HAS_IOPORT dependencies 2024-04-08 11:56:56 +01:00
fjes
hamradio net: handle HAS_IOPORT dependencies 2024-04-08 11:56:56 +01:00
hippi
hyperv hv_netvsc: Don't free decrypted memory 2024-04-10 21:33:32 +00:00
ieee802154 spi: Updates for v6.9 2024-03-13 11:07:37 -07:00
ipa net: ipa: allocate dummy net_device dynamically 2024-04-24 12:00:16 +01:00
ipvlan ipvlan: handle NETDEV_DOWN event 2024-04-08 13:20:01 +01:00
mctp
mdio net: mdio-gpio: Use device_is_compatible() 2024-04-08 11:05:09 +01:00
netdevsim net: netdevsim: add some fake page pool use 2024-04-15 11:21:11 -07:00
pcs net: pcs: rzn1-miic: Init RX clock early if MAC requires it 2024-03-28 19:21:34 -07:00
phy net: phy: micrel: Add support for PTP_PF_EXTTS for lan8814 2024-04-29 13:37:19 +01:00
plip
ppp - Kuan-Wei Chiu has developed the well-named series "lib min_heap: Min 2024-03-14 18:03:09 -07:00
pse-pd net: pse-pd: Kconfig: Add missing Regulator API dependency 2024-04-24 20:14:16 -07:00
slip
team net: team: fix incorrect maxattr 2024-04-10 19:36:23 -07:00
thunderbolt
usb r8152: replace dev_info with dev_dbg for loading firmware 2024-04-25 19:01:02 -07:00
vmxnet3 vmxnet3: Fix missing reserved tailroom 2024-03-14 12:46:24 +01:00
vxlan ipv6: introduce dst_rt6_info() helper 2024-04-29 13:32:01 +01:00
wan net: wan: fsl_qmc_hdlc: Convert to platform remove callback returning void 2024-04-10 19:35:50 -07:00
wireguard genetlink: remove linux/genetlink.h 2024-04-01 21:44:34 -07:00
wireless Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-04-25 12:41:37 -07:00
wwan net: wwan: t7xx: Un-embed dummy device 2024-04-25 19:32:31 -07:00
xen-netback Merge branch 'for-uring-ubufops' into HEAD 2024-04-22 17:15:39 -07:00
Kconfig net: netdevsim: select PAGE_POOL in Kconfig 2024-04-17 18:25:30 -07:00
LICENSE.SRC
Makefile pfcp: add PFCP module 2024-04-01 10:49:28 +01:00
Space.c
amt.c net: amt: Remove generic .ndo_get_stats64 2024-03-11 15:16:13 -07:00
bareudp.c ip_tunnel: convert __be16 tunnel flags to bitmaps 2024-04-01 10:49:28 +01:00
dummy.c
eql.c
geneve.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-04-11 14:23:47 -07:00
gtp.c net: gtp: Fix Use-After-Free in gtp_dellink 2024-04-24 11:46:31 +01:00
ifb.c
loopback.c
macsec.c macsec: Detect if Rx skb is macsec-related for offloading devices that update md_dst 2024-04-25 08:20:54 -07:00
macvlan.c
macvtap.c
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c net: netconsole: Add continuation line prefix to userdata messages 2024-03-11 14:07:57 -07:00
netkit.c
nlmon.c
ntb_netdev.c
pfcp.c pfcp: avoid copy warning by simplifing code 2024-04-08 11:46:41 +01:00
rionet.c
sb1000.c
sungem_phy.c
tap.c net: extend ubuf_info callback to ops structure 2024-04-22 16:21:35 -07:00
tun.c Merge branch 'for-uring-ubufops' into HEAD 2024-04-22 17:15:39 -07:00
veth.c net: mirror skb frag ref/unref helpers 2024-04-11 19:29:23 -07:00
virtio_net.c virtio-net: support queue stat 2024-04-30 10:51:33 +02:00
vrf.c ipv6: introduce dst_rt6_info() helper 2024-04-29 13:32:01 +01:00
vsockmon.c
xen-netfront.c xen-netfront: Add missing skb_mark_for_recycle 2024-03-28 18:28:12 -07:00