[PATCH net-next v1 3/6] virtio_net: support device stats

2023-12-25 Thread Xuan Zhuo
As the spec https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82 Virtio-net supports to get the stats from the device by ethtool -S . Signed-off-by: Xuan Zhuo --- drivers/net/virtio_net.c | 354 ++- 1 file changed, 350 ins

[PATCH net-next v1 4/6] virtio_net: stats map include driver stats

2023-12-25 Thread Xuan Zhuo
In the last commit, we use the stats map to manage the device stats. For the consistency, we let the stats map includes the driver stats. Signed-off-by: Xuan Zhuo --- drivers/net/virtio_net.c | 194 --- 1 file changed, 102 insertions(+), 92 deletions(-) diff

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

2023-12-25 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 --- drivers/net/virtio_net.c | 8 1 file changed, 4 insertions(+

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

2023-12-25 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. This commit implement this. Signed-off-by: Xuan Zhuo --- drivers/net/virtio_net.c | 47 +++- 1 file c

[PATCH net-next v1 5/6] virtio_net: add the total stats field

2023-12-25 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. Signed-off-by: Xuan Zhuo --- drivers/net/virtio_net.c | 72 ++-- 1 file changed, 61 insertions(+), 11 deletions(-) diff --git a/drivers/net/virtio_

[PATCH net-next v1 0/6] virtio-net: support device stats

2023-12-25 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. v1: 1. fix some definitions of the marco and the struct Xuan Zhuo (6): virtio_net: introduce device stats feature an

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

2023-12-25 Thread Xuan Zhuo
The virtio-net device stats spec: https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82 This commit introduces the relative feature and structures. Signed-off-by: Xuan Zhuo --- include/uapi/linux/virtio_net.h | 137 1 file cha

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

2023-12-25 Thread Xuan Zhuo
On Mon, 25 Dec 2023 16:01:39 +0800, Zhu Yanjun wrote: > 在 2023/12/22 11:30, Xuan Zhuo 写道: > > The virtio-net device stats spec: > > > > https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82 > > > > This commit introduces the relative feature and structures. > > H

Re: [PATCH v1] virtio_net: fix missing dma unmap for resize

2023-12-25 Thread Xuan Zhuo
On Tue, 12 Dec 2023 03:26:41 -0500, "Michael S. Tsirkin" wrote: > On Tue, Dec 12, 2023 at 04:11:41PM +0800, Xuan Zhuo wrote: > > For rq, we have three cases getting buffers from virtio core: > > > > 1. virtqueue_get_buf{,_ctx} > > 2. virtqueue_detach_unused_buf > > 3. callback for virtqueue_resiz

Re: [PATCH net-next] virtio-net: switch napi_tx without downing nic

2023-12-25 Thread Jason Wang
On Mon, Dec 25, 2023 at 4:03 PM Michael S. Tsirkin wrote: > > On Mon, Dec 25, 2023 at 12:12:48PM +0800, Jason Wang wrote: > > On Fri, Dec 22, 2023 at 4:14 PM Michael S. Tsirkin wrote: > > > > > > On Fri, Dec 22, 2023 at 10:35:07AM +0800, Jason Wang wrote: > > > > On Thu, Dec 21, 2023 at 11:06 PM

Re: [PATCH net-next] virtio-net: switch napi_tx without downing nic

2023-12-25 Thread Michael S. Tsirkin
On Mon, Dec 25, 2023 at 12:12:48PM +0800, Jason Wang wrote: > On Fri, Dec 22, 2023 at 4:14 PM Michael S. Tsirkin wrote: > > > > On Fri, Dec 22, 2023 at 10:35:07AM +0800, Jason Wang wrote: > > > On Thu, Dec 21, 2023 at 11:06 PM Willem de Bruijn > > > wrote: > > > > > > > > Heng Qi wrote: > > > > >

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

2023-12-25 Thread Zhu Yanjun
在 2023/12/22 11:30, Xuan Zhuo 写道: The virtio-net device stats spec: https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82 This commit introduces the relative feature and structures. Hi, Xuan After applying this patch series, withe ethtool version 6.5, I got