Re: [PATCH net-next v4 7/8] netdev: add queue stats

2024-03-14 Thread Jakub Kicinski
On Thu, 14 Mar 2024 16:54:58 +0800 Xuan Zhuo wrote: > + - > +name: rx-hw-drops > +doc: | > + Number of packets that arrived at the device but never left it, > + encompassing packets dropped for reasons such as insufficient > buffer s/encompassing/including/

Re: [PATCH net-next v4 8/8] virtio-net: support queue stat

2024-03-14 Thread Jakub Kicinski
On Thu, 14 Mar 2024 16:54:59 +0800 Xuan Zhuo wrote: > +static void virtnet_get_base_stats(struct net_device *dev, > +struct netdev_queue_stats_rx *rx, > +struct netdev_queue_stats_tx *tx) > +{ > + /* The queue stats of the virtio-n

Re: [PATCH net-next v4 3/8] virtio_net: support device stats

2024-03-14 Thread Jakub Kicinski
On Thu, 14 Mar 2024 16:54:54 +0800 Xuan Zhuo wrote: > make virtio-net support getting the stats from the device by ethtool -S > . > > Due to the numerous descriptors stats, an organization method is > required. For this purpose, I have introduced the "virtnet_stats_map". > Utilizing this array sim

Re: [PATCH net-next v4 0/8] virtio-net: support device stats

2024-03-14 Thread Paolo Abeni
On Thu, 2024-03-14 at 16:54 +0800, Xuan Zhuo wrote: > As the spec: > > https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82 > > The virtio net supports to get device stats. > > Please review. > > Thanks. > > > v4: > 1. Support per-queue statistics API >

[PATCH net-next v4 8/8] virtio-net: support queue stat

2024-03-14 Thread Xuan Zhuo
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 net

[PATCH net-next v4 7/8] netdev: add queue stats

2024-03-14 Thread Xuan Zhuo
These stats are commonly. Support reporting those via netdev-genl queue stats. name: rx-hw-drops name: rx-hw-drop-overruns name: rx-csum-unnecessary name: rx-csum-none name: rx-csum-bad name: rx-hw-gro-packets name: rx-hw-gro-bytes name: rx-hw-gro-wire-packets name: rx-hw-gro-wire-bytes name: rx-h

[PATCH net-next v4 6/8] virtio_net: rename stat tx_timeout to timeout

2024-03-14 Thread Xuan Zhuo
Now, we have this: tx_queue_0_tx_timeouts This is used to record the tx schedule timeout. But this has two "tx". I think the below is enough. tx_queue_0_timeouts So I rename this field. Signed-off-by: Xuan Zhuo Reviewed-by: Jiri Pirko --- drivers/net/virtio_net.c | 8 1 fil

[PATCH net-next v4 3/8] virtio_net: support device stats

2024-03-14 Thread Xuan Zhuo
As the spec https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82 make virtio-net support getting the stats from the device by ethtool -S . Due to the numerous descriptors stats, an organization method is required. For this purpose, I have introduced the "virtn

[PATCH net-next v4 2/8] virtio_net: virtnet_send_command supports command-specific-result

2024-03-14 Thread Xuan Zhuo
As the spec https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82 The virtnet cvq supports to get result from the device. Signed-off-by: Xuan Zhuo --- drivers/net/virtio_net.c | 47 +++- 1 file changed, 27 insertions(+), 20

[PATCH net-next v4 5/8] virtio_net: add the total stats field

2024-03-14 Thread Xuan Zhuo
Now, we just show the stats of every queue. But for the user, the total values of every stat may are valuable. NIC statistics: rx_packets: 373522 rx_bytes: 85919736 rx_drops: 0 rx_xdp_packets: 0 rx_xdp_tx: 0 rx_xdp_redirects: 0 rx_xdp_drops: 0 rx_kicks: 111

[PATCH net-next v4 4/8] virtio_net: stats map include driver stats

2024-03-14 Thread Xuan Zhuo
In the last commit, we use the stats map to manage the device stats. Managing driver statistics separately can be inconvenient. To streamline the process, I propose integrating driver stats into the existing stats map. This integration will allow us to uniformly handle all statistics through a sin

[PATCH net-next v4 0/8] virtio-net: support device stats

2024-03-14 Thread Xuan Zhuo
As the spec: https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82 The virtio net supports to get device stats. Please review. Thanks. v4: 1. Support per-queue statistics API 2. Fix some small problems in last version v3: 1. rebase net-next v2:

[PATCH net-next v4 1/8] virtio_net: introduce device stats feature and structures

2024-03-14 Thread Xuan Zhuo
The virtio-net device stats spec: https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82 We introduce the relative feature and structures. Signed-off-by: Xuan Zhuo --- include/uapi/linux/virtio_net.h | 137 1 file changed, 137