Re: [PATCH vhost v4 00/10] virtio: drivers maintain dma info for premapped vq

2024-03-18 Thread Michael S. Tsirkin
On Tue, Mar 12, 2024 at 11:35:47AM +0800, Xuan Zhuo wrote: > As discussed: > > http://lore.kernel.org/all/cacgkmevq0no8qgc46u4mgsmtud44fd_cflcpavmj3rhyqrz...@mail.gmail.com > > If the virtio is premapped mode, the driver should manage the dma info by > self. > So the virtio core should not store

Re: [PATCH net-next v5 0/9] virtio-net: support device stats

2024-03-18 Thread Jiri Pirko
Mon, Mar 18, 2024 at 12:53:38PM CET, xuanz...@linux.alibaba.com wrote: >On Mon, 18 Mar 2024 12:52:18 +0100, Jiri Pirko wrote: >> Mon, Mar 18, 2024 at 12:05:53PM CET, xuanz...@linux.alibaba.com wrote: >> >As the spec: >> > >> >https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbb

Re: [PATCH net-next v5 0/9] virtio-net: support device stats

2024-03-18 Thread Xuan Zhuo
On Mon, 18 Mar 2024 12:52:18 +0100, Jiri Pirko wrote: > Mon, Mar 18, 2024 at 12:05:53PM CET, xuanz...@linux.alibaba.com wrote: > >As the spec: > > > >https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82 > > > >The virtio net supports to get device stats. > > > >

Re: [PATCH net-next v5 0/9] virtio-net: support device stats

2024-03-18 Thread Jiri Pirko
Mon, Mar 18, 2024 at 12:05:53PM CET, xuanz...@linux.alibaba.com wrote: >As the spec: > >https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82 > >The virtio net supports to get device stats. > >Please review. net-next is closed. Please resubmit next week.

[PATCH net-next v5 0/9] virtio-net: support device stats

2024-03-18 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. v5: 1. Fix some small problems in last version 2. Not report stats that will be reported by netlink 3. remove "_

[PATCH net-next v5 9/9] virtio-net: support queue stat

2024-03-18 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 v5 5/9] virtio_net: stats map include driver stats

2024-03-18 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 v5 6/9] virtio_net: add the total stats field

2024-03-18 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 v5 8/9] netdev: add queue stats

2024-03-18 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 v5 4/9] virtio_net: support device stats

2024-03-18 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 v5 3/9] virtio_net: remove "_queue" from ethtool -S

2024-03-18 Thread Xuan Zhuo
The key size of ethtool -S is controlled by this macro. ETH_GSTRING_LEN 32 That includes the \0 at the end. So the max length of the key name must is 31. But the length of the prefix "rx_queue_0_" is 11. If the queue num is larger than 10, the length of the prefix is 12. So the key name max is 19

[PATCH net-next v5 7/9] virtio_net: rename stat tx_timeout to timeout

2024-03-18 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 v5 2/9] virtio_net: virtnet_send_command supports command-specific-result

2024-03-18 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 v5 1/9] virtio_net: introduce device stats feature and structures

2024-03-18 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 | 143 1 file changed, 143