Re: [PATCH vhost v2 4/7] virtio_net: big mode support premapped

2024-04-23 Thread Xuan Zhuo
On Wed, 24 Apr 2024 11:50:44 +0800, Jason Wang wrote: > On Wed, Apr 24, 2024 at 10:58 AM Xuan Zhuo wrote: > > > > On Wed, 24 Apr 2024 10:45:49 +0800, Jason Wang wrote: > > > On Wed, Apr 24, 2024 at 10:42 AM Xuan Zhuo > > > wrote: > > > > > > > > On Wed, 24 Apr 2024 10:34:56 +0800, Jason Wang

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

2024-04-23 Thread Jason Wang
On Tue, Apr 23, 2024 at 7:32 PM Xuan Zhuo wrote: > > 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 > R

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

2024-04-23 Thread Jason Wang
On Tue, Apr 23, 2024 at 7:32 PM Xuan Zhuo wrote: > > 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_

Re: [PATCH net-next v6 4/8] virtio_net: device stats helpers support driver stats

2024-04-23 Thread Jason Wang
On Tue, Apr 23, 2024 at 7:32 PM Xuan Zhuo wrote: > > In the last commit, we introduced some helpers for device stats. > And the drivers stats are realized by the open code. > This commit make the helpers to support driver stats. > Then we can have the unify helper for device and driver stats. > >

Re: [PATCH vhost v2 4/7] virtio_net: big mode support premapped

2024-04-23 Thread Jason Wang
On Wed, Apr 24, 2024 at 10:58 AM Xuan Zhuo wrote: > > On Wed, 24 Apr 2024 10:45:49 +0800, Jason Wang wrote: > > On Wed, Apr 24, 2024 at 10:42 AM Xuan Zhuo > > wrote: > > > > > > On Wed, 24 Apr 2024 10:34:56 +0800, Jason Wang > > > wrote: > > > > On Wed, Apr 24, 2024 at 9:10 AM Xuan Zhuo > >

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

2024-04-23 Thread Jason Wang
On Tue, Apr 23, 2024 at 7:31 PM Xuan Zhuo wrote: > > 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 > . > > NIC statistics: > rx0_packets: 582951 > rx0_byt

Re: [PATCH vhost v2 4/7] virtio_net: big mode support premapped

2024-04-23 Thread Xuan Zhuo
On Wed, 24 Apr 2024 10:45:49 +0800, Jason Wang wrote: > On Wed, Apr 24, 2024 at 10:42 AM Xuan Zhuo wrote: > > > > On Wed, 24 Apr 2024 10:34:56 +0800, Jason Wang wrote: > > > On Wed, Apr 24, 2024 at 9:10 AM Xuan Zhuo > > > wrote: > > > > > > > > On Wed, 24 Apr 2024 08:43:21 +0800, Jason Wang

Re: [PATCH vhost v2 4/7] virtio_net: big mode support premapped

2024-04-23 Thread Jason Wang
On Wed, Apr 24, 2024 at 10:42 AM Xuan Zhuo wrote: > > On Wed, 24 Apr 2024 10:34:56 +0800, Jason Wang wrote: > > On Wed, Apr 24, 2024 at 9:10 AM Xuan Zhuo > > wrote: > > > > > > On Wed, 24 Apr 2024 08:43:21 +0800, Jason Wang > > > wrote: > > > > On Tue, Apr 23, 2024 at 8:38 PM Xuan Zhuo > >

Re: [PATCH vhost v2 4/7] virtio_net: big mode support premapped

2024-04-23 Thread Xuan Zhuo
On Wed, 24 Apr 2024 10:34:56 +0800, Jason Wang wrote: > On Wed, Apr 24, 2024 at 9:10 AM Xuan Zhuo wrote: > > > > On Wed, 24 Apr 2024 08:43:21 +0800, Jason Wang wrote: > > > On Tue, Apr 23, 2024 at 8:38 PM Xuan Zhuo > > > wrote: > > > > > > > > On Tue, 23 Apr 2024 12:36:42 +0800, Jason Wang >

Re: [PATCH vhost v2 4/7] virtio_net: big mode support premapped

2024-04-23 Thread Jason Wang
On Wed, Apr 24, 2024 at 9:10 AM Xuan Zhuo wrote: > > On Wed, 24 Apr 2024 08:43:21 +0800, Jason Wang wrote: > > On Tue, Apr 23, 2024 at 8:38 PM Xuan Zhuo > > wrote: > > > > > > On Tue, 23 Apr 2024 12:36:42 +0800, Jason Wang > > > wrote: > > > > On Mon, Apr 22, 2024 at 3:24 PM Xuan Zhuo > > >

Re: [PATCH vhost v2 4/7] virtio_net: big mode support premapped

2024-04-23 Thread Xuan Zhuo
On Wed, 24 Apr 2024 08:43:21 +0800, Jason Wang wrote: > On Tue, Apr 23, 2024 at 8:38 PM Xuan Zhuo wrote: > > > > On Tue, 23 Apr 2024 12:36:42 +0800, Jason Wang wrote: > > > On Mon, Apr 22, 2024 at 3:24 PM Xuan Zhuo > > > wrote: > > > > > > > > In big mode, pre-mapping DMA is beneficial because

Re: [PATCH vhost v2 4/7] virtio_net: big mode support premapped

2024-04-23 Thread Jason Wang
On Tue, Apr 23, 2024 at 8:38 PM Xuan Zhuo wrote: > > On Tue, 23 Apr 2024 12:36:42 +0800, Jason Wang wrote: > > On Mon, Apr 22, 2024 at 3:24 PM Xuan Zhuo > > wrote: > > > > > > In big mode, pre-mapping DMA is beneficial because if the pages are not > > > used, we can reuse them without needing t

Re: [PATCH vhost v2 4/7] virtio_net: big mode support premapped

2024-04-23 Thread Xuan Zhuo
On Tue, 23 Apr 2024 12:36:42 +0800, Jason Wang wrote: > On Mon, Apr 22, 2024 at 3:24 PM Xuan Zhuo wrote: > > > > In big mode, pre-mapping DMA is beneficial because if the pages are not > > used, we can reuse them without needing to unmap and remap. > > > > We require space to store the DMA addres

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

2024-04-23 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 v6 5/8] virtio_net: add the total stats field

2024-04-23 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 v6 8/8] virtio-net: support queue stat

2024-04-23 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 v6 6/8] virtio_net: rename stat tx_timeout to timeout

2024-04-23 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 v6 2/8] virtio_net: remove "_queue" from ethtool -S

2024-04-23 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 v6 4/8] virtio_net: device stats helpers support driver stats

2024-04-23 Thread Xuan Zhuo
In the last commit, we introduced some helpers for device stats. And the drivers stats are realized by the open code. This commit make the helpers to support driver stats. Then we can have the unify helper for device and driver stats. Signed-off-by: Xuan Zhuo --- drivers/net/virtio_net.c | 157 +

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

2024-04-23 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 Acked-by: Jason Wang --- include/uapi/linux/virtio_net.h | 143

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

2024-04-23 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 . NIC statistics: rx0_packets: 582951 rx0_bytes: 155307077 rx0_drops: 0 rx0_xdp_packets: 0 rx0_xdp

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

2024-04-23 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. v6: 1. remove 'maps'. check stats by if-else. v5: 1. Fix some small problems in last version 2. Not report stat

Re: [patch net-next v5 repost 0/5] selftests: virtio_net: introduce initial testing infrastructure

2024-04-23 Thread Jiri Pirko
Please ignore, I messed-up. Will send v6 tomorrow. Sigh.

Re: [PATCH net-next 1/2] virtio_net: virtnet_send_command supports command-specific-result

2024-04-23 Thread Heng Qi
在 2024/4/23 下午6:17, Jiri Pirko 写道: Tue, Apr 23, 2024 at 10:42:25AM CEST, hen...@linux.alibaba.com wrote: From: Xuan Zhuo As the spec https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82 The virtnet cvq supports to get result from the device. Is this a

Re: [patch net-next v5 3/5] selftests: forwarding: add check_driver() helper

2024-04-23 Thread Jiri Pirko
Mon, Apr 22, 2024 at 08:47:39PM CEST, benjamin.poir...@gmail.com wrote: >On 2024-04-22 17:32 +0200, Jiri Pirko wrote: >> From: Jiri Pirko >> >> Add a helper to be used to check if the netdevice is backed by specified >> driver. >> >> Signed-off-by: Jiri Pirko >> Reviewed-by: Petr Machata >> --

[patch net-next v5 repost 5/5] selftests: virtio_net: add initial tests

2024-04-23 Thread Jiri Pirko
From: Jiri Pirko Introduce initial tests for virtio_net driver. Focus on feature testing leveraging previously introduced debugfs feature filtering infrastructure. Add very basic ping and F_MAC feature tests. To run this, do: $ make -C tools/testing/selftests/ TARGETS=drivers/net/virtio_net/ run

[patch net-next v5 repost 4/5] selftests: forwarding: add wait_for_dev() helper

2024-04-23 Thread Jiri Pirko
From: Jiri Pirko The existing setup_wait*() helper family check the status of the interface to be up. Introduce wait_for_dev() to wait for the netdevice to appear, for example after test script does manual device bind. Signed-off-by: Jiri Pirko Reviewed-by: Petr Machata --- v3->v4: - removed "

[patch net-next v5 repost 3/5] selftests: forwarding: add check_driver() helper

2024-04-23 Thread Jiri Pirko
From: Jiri Pirko Add a helper to be used to check if the netdevice is backed by specified driver. Signed-off-by: Jiri Pirko Reviewed-by: Petr Machata --- tools/testing/selftests/net/forwarding/lib.sh | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/te

[patch net-next v5 repost 2/5] selftests: forwarding: add ability to assemble NETIFS array by driver name

2024-04-23 Thread Jiri Pirko
From: Jiri Pirko Allow driver tests to work without specifying the netdevice names. Introduce a possibility to search for available netdevices according to set driver name. Allow test to specify the name by setting NETIF_FIND_DRIVER variable. Note that user overrides this either by passing netde

[patch net-next v5 repost 1/5] virtio: add debugfs infrastructure to allow to debug virtio features

2024-04-23 Thread Jiri Pirko
From: Jiri Pirko Currently there is no way for user to set what features the driver should obey or not, it is hard wired in the code. In order to be able to debug the device behavior in case some feature is disabled, introduce a debugfs infrastructure with couple of files allowing user to see wh

[patch net-next v5 repost 0/5] selftests: virtio_net: introduce initial testing infrastructure

2024-04-23 Thread Jiri Pirko
From: Jiri Pirko This patchset aims at introducing very basic initial infrastructure for virtio_net testing, namely it focuses on virtio feature testing. The first patch adds support for debugfs for virtio devices, allowing user to filter features to pretend to be driver that is not capable of t

Re: [PATCH net-next 1/2] virtio_net: virtnet_send_command supports command-specific-result

2024-04-23 Thread Jiri Pirko
Tue, Apr 23, 2024 at 10:42:25AM CEST, hen...@linux.alibaba.com wrote: >From: Xuan Zhuo > >As the spec >https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82 > >The virtnet cvq supports to get result from the device. Is this a statement about current status, cau

[PATCH net-next 2/2] virtio_net: get init coalesce value when probe

2024-04-23 Thread Heng Qi
Currently, virtio-net lacks a way to obtain the default coalesce values of the device during the probe phase. That is, the device may have default experience values, but the user uses "ethtool -c" to query that the values are still 0. Therefore, we reuse VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET to complet

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

2024-04-23 Thread Heng Qi
From: 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 | 24 +--- 1 file changed, 17 insertions(+),

[PATCH net-next 0/2] virtio_net: support getting initial value of irq coalesce

2024-04-23 Thread Heng Qi
Patch 1 from Xuan: the virtnet cvq supports to get result from the device. Patch 2 reuses the VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET cmd to get init coalesce value. Heng Qi (1): virtio_net: get init coalesce value when probe Xuan Zhuo (1): virtio_net: virtnet_send_command supports command-specific