Re: [PATCH 1/1] virtio_net: Add timeout handler to avoid kernel hang

2024-01-21 Thread Jason Wang
On Mon, Jan 22, 2024 at 2:55 PM Jason Wang wrote: > > On Mon, Jan 22, 2024 at 2:20 PM Xuan Zhuo wrote: > > > > On Mon, 22 Jan 2024 12:16:27 +0800, Jason Wang wrote: > > > On Mon, Jan 22, 2024 at 12:00 PM Xuan Zhuo > > > wrote: > > > > > &

Re: [PATCH 1/1] virtio_net: Add timeout handler to avoid kernel hang

2024-01-21 Thread Jason Wang
On Mon, Jan 22, 2024 at 3:07 PM Xuan Zhuo wrote: > > On Mon, 22 Jan 2024 14:58:09 +0800, Jason Wang wrote: > > On Mon, Jan 22, 2024 at 2:55 PM Jason Wang wrote: > > > > > > On Mon, Jan 22, 2024 at 2:20 PM Xuan Zhuo > > > wrote: > > > > >

Re: [PATCH 1/1] virtio_net: Add timeout handler to avoid kernel hang

2024-01-21 Thread Jason Wang
On Mon, Jan 22, 2024 at 3:36 PM Xuan Zhuo wrote: > > On Mon, 22 Jan 2024 15:19:12 +0800, Jason Wang wrote: > > On Mon, Jan 22, 2024 at 3:07 PM Xuan Zhuo > > wrote: > > > > > > On Mon, 22 Jan 2024 14:58:09 +0800, Jason Wang > > > wrote: >

Re: [PATCH 1/1] virtio_net: Add timeout handler to avoid kernel hang

2024-01-22 Thread Jason Wang
On Mon, Jan 22, 2024 at 4:04 PM Xuan Zhuo wrote: > > On Mon, 22 Jan 2024 15:57:08 +0800, Jason Wang wrote: > > On Mon, Jan 22, 2024 at 3:36 PM Xuan Zhuo > > wrote: > > > > > > On Mon, 22 Jan 2024 15:19:12 +0800, Jason Wang > > > wrote: >

Re: [PATCH net-next 1/5] virtio_ring: introduce virtqueue_get_buf_ctx_dma()

2024-01-23 Thread Jason Wang
On Tue, Jan 16, 2024 at 3:59 PM Xuan Zhuo wrote: > > introduce virtqueue_get_buf_ctx_dma() to collect the dma info when > get buf from virtio core for premapped mode. > > If the virtio queue is premapped mode, the virtio-net send buf may > have many desc. This feature is not specific to virtio-ne

Re: [PATCH net-next 4/5] virtio_ring: introduce virtqueue_get_dma_premapped()

2024-01-24 Thread Jason Wang
On Tue, Jan 16, 2024 at 3:59 PM Xuan Zhuo wrote: > > Introduce helper virtqueue_get_dma_premapped(), then the driver > can know whether dma unmap is needed. > > Signed-off-by: Xuan Zhuo > --- > drivers/net/virtio/main.c | 22 +- > drivers/net/virtio/virtio_net.h | 3 --

Re: [PATCH net-next 5/5] virtio_net: sq support premapped mode

2024-01-24 Thread Jason Wang
On Tue, Jan 16, 2024 at 3:59 PM Xuan Zhuo wrote: > > If the xsk is enabling, the xsk tx will share the send queue. Any reason for this? Technically, virtio-net can work as other NIC like 256 queues. There could be some work like optimizing the interrupt allocations etc. > But the xsk requires th

Re: [PATCH net-next 0/5] virtio-net: sq support premapped mode

2024-01-24 Thread Jason Wang
On Tue, Jan 16, 2024 at 3:59 PM Xuan Zhuo wrote: > > This is the second part of virtio-net support AF_XDP zero copy. > > The whole patch set > http://lore.kernel.org/all/20231229073108.57778-1-xuanz...@linux.alibaba.com > > ## About the branch > > This patch set is pushed to the net-next branch, b

Re: [PATCH net-next 0/5] virtio-net: sq support premapped mode

2024-01-24 Thread Jason Wang
On Thu, Jan 25, 2024 at 1:52 PM Xuan Zhuo wrote: > > On Thu, 25 Jan 2024 13:42:05 +0800, Xuan Zhuo > wrote: > > On Thu, 25 Jan 2024 11:39:28 +0800, Jason Wang wrote: > > > On Tue, Jan 16, 2024 at 3:59 PM Xuan Zhuo > > > wrote: > > > > > >

Re: [PATCH net-next 5/5] virtio_net: sq support premapped mode

2024-01-28 Thread Jason Wang
On Thu, Jan 25, 2024 at 2:24 PM Xuan Zhuo wrote: > > On Thu, 25 Jan 2024 11:39:20 +0800, Jason Wang wrote: > > On Tue, Jan 16, 2024 at 3:59 PM Xuan Zhuo > > wrote: > > > > > > If the xsk is enabling, the xsk tx will share the send queue. > > > >

Re: [PATCH net-next 4/5] virtio_ring: introduce virtqueue_get_dma_premapped()

2024-01-28 Thread Jason Wang
On Thu, Jan 25, 2024 at 1:58 PM Xuan Zhuo wrote: > > On Thu, 25 Jan 2024 11:39:03 +0800, Jason Wang wrote: > > On Tue, Jan 16, 2024 at 3:59 PM Xuan Zhuo > > wrote: > > > > > > Introduce helper virtqueue_get_dma_premapped(), then the driver > &

Re: [PATCH net-next 0/5] virtio-net: sq support premapped mode

2024-01-28 Thread Jason Wang
On Thu, Jan 25, 2024 at 2:33 PM Xuan Zhuo wrote: > > On Thu, 25 Jan 2024 14:14:58 +0800, Jason Wang wrote: > > On Thu, Jan 25, 2024 at 1:52 PM Xuan Zhuo > > wrote: > > > > > > On Thu, 25 Jan 2024 13:42:05 +0800, Xuan Zhuo > > > wrote: > >

Re: [PATCH net-next 0/5] virtio-net: sq support premapped mode

2024-01-29 Thread Jason Wang
On Mon, Jan 29, 2024 at 2:28 PM Xuan Zhuo wrote: > > On Mon, 29 Jan 2024 11:37:56 +0800, Xuan Zhuo > wrote: > > On Mon, 29 Jan 2024 11:14:43 +0800, Jason Wang wrote: > > > On Thu, Jan 25, 2024 at 2:33 PM Xuan Zhuo > > > wrote: > > > > > >

Re: [PATCH net-next 4/5] virtio_ring: introduce virtqueue_get_dma_premapped()

2024-01-29 Thread Jason Wang
On Mon, Jan 29, 2024 at 11:33 AM Xuan Zhuo wrote: > > On Mon, 29 Jan 2024 11:07:50 +0800, Jason Wang wrote: > > On Thu, Jan 25, 2024 at 1:58 PM Xuan Zhuo > > wrote: > > > > > > On Thu, 25 Jan 2024 11:39:03 +0800, Jason Wang > > > wrote: >

Re: [PATCH net-next 5/5] virtio_net: sq support premapped mode

2024-01-29 Thread Jason Wang
On Mon, Jan 29, 2024 at 11:28 AM Xuan Zhuo wrote: > > On Mon, 29 Jan 2024 11:06:35 +0800, Jason Wang wrote: > > On Thu, Jan 25, 2024 at 2:24 PM Xuan Zhuo > > wrote: > > > > > > On Thu, 25 Jan 2024 11:39:20 +0800, Jason Wang > > > wrote: >

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

2024-01-29 Thread Jason Wang
On Tue, Jan 16, 2024 at 1:56 PM Xuan Zhuo wrote: > > On Tue, 26 Dec 2023 15:30:57 +0800, Xuan Zhuo > wrote: > > As the spec: > > > > https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82 > > > > The virtio net supports to get device stats. > > Hi Jason, > > Any

Re: [PATCH net-next] virtio_net: Add TX stop and wake counters

2024-02-03 Thread Jason Wang
On Sat, Feb 3, 2024 at 12:01 AM Jakub Kicinski wrote: > > On Fri, 2 Feb 2024 14:52:59 +0800 Jason Xing wrote: > > > Can you say more? I'm curious what's your use case. > > > > I'm not working at Nvidia, so my point of view may differ from theirs. > > From what I can tell is that those two counters

Re: [PATCH net-next] virtio_net: Add TX stop and wake counters

2024-02-04 Thread Jason Wang
On Sun, Feb 4, 2024 at 8:39 PM Michael S. Tsirkin wrote: > > On Sun, Feb 04, 2024 at 09:20:18AM +0800, Jason Wang wrote: > > On Sat, Feb 3, 2024 at 12:01 AM Jakub Kicinski wrote: > > > > > > On Fri, 2 Feb 2024 14:52:59 +0800 Jason Xing wrote: > > > > &

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

2024-03-20 Thread Jason Wang
On Tue, Mar 19, 2024 at 2:56 PM Michael S. Tsirkin wrote: > > 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 shoul

Re: REGRESSION: RIP: 0010:skb_release_data+0xb8/0x1e0 in vhost/tun

2024-03-20 Thread Jason Wang
t; We do not have a consistent reproducer but when we put some bigger > > > network load on a VM, the hypervisor's kernel crashes. > > > > > > Help is much appreciated! We are happy to test any patches. > > > > CCing Michael Tsirkin and Jason Wang for vh

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

2024-03-20 Thread Jason Wang
On Tue, Mar 12, 2024 at 11:36 AM 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 the dma

Re: [PATCH vhost v4 03/10] virtio_ring: packed: structure the indirect desc table

2024-03-20 Thread Jason Wang
On Tue, Mar 12, 2024 at 11:36 AM Xuan Zhuo wrote: > > This commit structure the indirect desc table. > Then we can get the desc num directly when doing unmap. > > And save the dma info to the struct, then the indirect > will not use the dma fields of the desc_extra. The subsequent > commits will m

Re: [PATCH vhost v4 02/10] virtio_ring: packed: remove double check of the unmap ops

2024-03-20 Thread Jason Wang
On Tue, Mar 12, 2024 at 11:36 AM Xuan Zhuo wrote: > > In the functions vring_unmap_extra_packed and vring_unmap_desc_packed, > multiple checks are made whether unmap is performed and whether it is > INDIRECT. > > These two functions are usually called in a loop, and we should put the > check outsi

Re: [PATCH vhost v4 10/10] virtio_ring: virtqueue_set_dma_premapped support disable

2024-03-20 Thread Jason Wang
On Tue, Mar 12, 2024 at 11:36 AM Xuan Zhuo wrote: > > Now, the API virtqueue_set_dma_premapped just support to > enable premapped mode. > > If we allow enabling the premapped dynamically, we should > make this API to support disable the premapped mode. > > Signed-off-by: Xuan Zhuo > --- > driver

Re: [PATCH vhost v4 10/10] virtio_ring: virtqueue_set_dma_premapped support disable

2024-03-21 Thread Jason Wang
On Thu, Mar 21, 2024 at 4:22 PM Xuan Zhuo wrote: > > On Thu, 21 Mar 2024 14:02:14 +0800, Jason Wang wrote: > > On Tue, Mar 12, 2024 at 11:36 AM Xuan Zhuo > > wrote: > > > > > > Now, the API virtqueue_set_dma_premapped just support to > > > e

Re: [PATCH vhost v4 02/10] virtio_ring: packed: remove double check of the unmap ops

2024-03-21 Thread Jason Wang
On Thu, Mar 21, 2024 at 4:21 PM Xuan Zhuo wrote: > > On Thu, 21 Mar 2024 13:57:06 +0800, Jason Wang wrote: > > On Tue, Mar 12, 2024 at 11:36 AM Xuan Zhuo > > wrote: > > > > > > In the functions vring_unmap_extra_packed and vring_unmap_desc_packed, > >

Re: [PATCH 1/2] virtio-net: fix possible dim status unrecoverable

2024-03-21 Thread Jason Wang
On Thu, Mar 21, 2024 at 7:46 PM Heng Qi wrote: > > When the dim worker is scheduled, if it fails to acquire the lock, > dim may not be able to return to the working state later. > > For example, the following single queue scenario: > 1. The dim worker of rxq0 is scheduled, and the dim status is

Re: [PATCH 2/2] virtio-net: reduce the CPU consumption of dim worker

2024-03-21 Thread Jason Wang
On Thu, Mar 21, 2024 at 7:46 PM Heng Qi wrote: > > Currently, ctrlq processes commands in a synchronous manner, > which increases the delay of dim commands when configuring > multi-queue VMs, which in turn causes the CPU utilization to > increase and interferes with the performance of dim. > > The

Re: [PATCH vhost v4 03/10] virtio_ring: packed: structure the indirect desc table

2024-03-21 Thread Jason Wang
On Thu, Mar 21, 2024 at 4:29 PM Xuan Zhuo wrote: > > On Thu, 21 Mar 2024 12:47:18 +0800, Jason Wang wrote: > > On Tue, Mar 12, 2024 at 11:36 AM Xuan Zhuo > > wrote: > > > > > > This commit structure the indirect desc table. > > > Then we c

Re: REGRESSION: RIP: 0010:skb_release_data+0xb8/0x1e0 in vhost/tun

2024-03-21 Thread Jason Wang
On Thu, Mar 21, 2024 at 5:44 PM Igor Raits wrote: > > Hello Jason & others, > > On Wed, Mar 20, 2024 at 10:33 AM Jason Wang wrote: > > > > On Tue, Mar 19, 2024 at 9:15 PM Igor Raits wrote: > > > > > > Hello Stefan, > > > > > &g

Re: [PATCH vhost v4 10/10] virtio_ring: virtqueue_set_dma_premapped support disable

2024-03-25 Thread Jason Wang
On Fri, Mar 22, 2024 at 2:04 PM Xuan Zhuo wrote: > > On Fri, 22 Mar 2024 13:13:36 +0800, Jason Wang wrote: > > On Thu, Mar 21, 2024 at 4:22 PM Xuan Zhuo > > wrote: > > > > > > On Thu, 21 Mar 2024 14:02:14 +0800, Jason Wang > > > wrote: >

Re: [PATCH 1/2] virtio-net: fix possible dim status unrecoverable

2024-03-25 Thread Jason Wang
On Mon, Mar 25, 2024 at 2:58 PM Heng Qi wrote: > > > > 在 2024/3/25 下午2:29, Jason Wang 写道: > > On Mon, Mar 25, 2024 at 10:11 AM Heng Qi wrote: > >> > >> > >> 在 2024/3/22 下午1:17, Jason Wang 写道: > >>> On Thu, Mar 21, 2024 at 7:46 PM Heng

Re: [PATCH vhost v4 03/10] virtio_ring: packed: structure the indirect desc table

2024-03-25 Thread Jason Wang
On Fri, Mar 22, 2024 at 3:58 PM Xuan Zhuo wrote: > > On Fri, 22 Mar 2024 13:15:10 +0800, Jason Wang wrote: > > On Thu, Mar 21, 2024 at 4:29 PM Xuan Zhuo > > wrote: > > > > > > On Thu, 21 Mar 2024 12:47:18 +0800, Jason Wang > > > wrote: >

Re: [PATCH 2/2] virtio-net: reduce the CPU consumption of dim worker

2024-03-25 Thread Jason Wang
On Mon, Mar 25, 2024 at 3:18 PM Heng Qi wrote: > > > > 在 2024/3/25 下午1:57, Jason Wang 写道: > > On Mon, Mar 25, 2024 at 10:21 AM Heng Qi wrote: > >> > >> > >> 在 2024/3/22 下午1:19, Jason Wang 写道: > >>> On Thu, Mar 21, 2024 at 7:46 PM Heng Q

Re: [PATCH 2/2] virtio-net: reduce the CPU consumption of dim worker

2024-03-25 Thread Jason Wang
On Mon, Mar 25, 2024 at 4:22 PM Heng Qi wrote: > > > > 在 2024/3/25 下午3:56, Jason Wang 写道: > > On Mon, Mar 25, 2024 at 3:18 PM Heng Qi wrote: > >> > >> > >> 在 2024/3/25 下午1:57, Jason Wang 写道: > >>> On Mon, Mar 25, 2024 at 10:21 AM Heng Q

Re: [PATCH 2/2] virtio-net: reduce the CPU consumption of dim worker

2024-03-25 Thread Jason Wang
On Mon, Mar 25, 2024 at 10:21 AM Heng Qi wrote: > > > > 在 2024/3/22 下午1:19, Jason Wang 写道: > > On Thu, Mar 21, 2024 at 7:46 PM Heng Qi wrote: > >> Currently, ctrlq processes commands in a synchronous manner, > >> which increases the delay of dim commands w

Re: [PATCH 1/2] virtio-net: fix possible dim status unrecoverable

2024-03-25 Thread Jason Wang
On Mon, Mar 25, 2024 at 10:11 AM Heng Qi wrote: > > > > 在 2024/3/22 下午1:17, Jason Wang 写道: > > On Thu, Mar 21, 2024 at 7:46 PM Heng Qi wrote: > >> When the dim worker is scheduled, if it fails to acquire the lock, > >> dim may not be able to return to th

Re: [PATCH 2/2] virtio-net: reduce the CPU consumption of dim worker

2024-03-25 Thread Jason Wang
On Tue, Mar 26, 2024 at 10:46 AM Heng Qi wrote: > > > > 在 2024/3/25 下午4:42, Jason Wang 写道: > > On Mon, Mar 25, 2024 at 4:22 PM Heng Qi wrote: > >> > >> > >> 在 2024/3/25 下午3:56, Jason Wang 写道: > >>> On Mon, Mar 25, 2024 at 3:18 PM Heng Q

Re: REGRESSION: RIP: 0010:skb_release_data+0xb8/0x1e0 in vhost/tun

2024-03-25 Thread Jason Wang
On Mon, Mar 25, 2024 at 4:44 PM Igor Raits wrote: > > Hello, > > On Fri, Mar 22, 2024 at 12:19 PM Igor Raits wrote: > > > > Hi Jason, > > > > On Fri, Mar 22, 2024 at 9:39 AM Igor Raits wrote: > > > > > > Hi Jason, > > > > > &g

Re: [PATCH 2/2] virtio-net: reduce the CPU consumption of dim worker

2024-03-25 Thread Jason Wang
On Tue, Mar 26, 2024 at 1:57 PM Heng Qi wrote: > > > > 在 2024/3/26 下午12:08, Jason Wang 写道: > > On Tue, Mar 26, 2024 at 10:46 AM Heng Qi wrote: > >> > >> > >> 在 2024/3/25 下午4:42, Jason Wang 写道: > >>> On Mon, Mar 25, 2024 at 4:22 PM Heng Q

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

2024-03-25 Thread Jason Wang
On Mon, Mar 25, 2024 at 4:54 PM 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 the dma

Re: REGRESSION: RIP: 0010:skb_release_data+0xb8/0x1e0 in vhost/tun

2024-03-26 Thread Jason Wang
Hi Jason, > > > > > > > > On Fri, Mar 22, 2024 at 9:39 AM Igor Raits wrote: > > > > > > > > > > Hi Jason, > > > > > > > > > > On Fri, Mar 22, 2024 at 6:31 AM Jason Wang > > > > > wrote: > > >

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

2024-03-27 Thread Jason Wang
On Wed, Mar 27, 2024 at 3:16 PM Xuan Zhuo wrote: > > On Tue, 26 Mar 2024 14:35:21 +0800, Jason Wang wrote: > > On Mon, Mar 25, 2024 at 4:54 PM Xuan Zhuo > > wrote: > > > > > > As discussed: > > > > > > http://lore.kernel.or

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

2024-03-27 Thread Jason Wang
On Wed, Mar 27, 2024 at 4:07 PM Xuan Zhuo wrote: > > On Wed, 27 Mar 2024 15:50:17 +0800, Jason Wang wrote: > > On Wed, Mar 27, 2024 at 3:16 PM Xuan Zhuo > > wrote: > > > > > > On Tue, 26 Mar 2024 14:35:21 +0800, Jason Wang > > > wrote: >

Re: [PATCH vhost v6 02/10] virtio_ring: packed: remove double check of the unmap ops

2024-03-27 Thread Jason Wang
On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo wrote: > > In the functions vring_unmap_extra_packed and vring_unmap_desc_packed, > multiple checks are made whether unmap is performed and whether it is > INDIRECT. > > These two functions are usually called in a loop, and we should put the > check outsid

Re: [PATCH vhost v6 03/10] virtio_ring: packed: structure the indirect desc table

2024-03-27 Thread Jason Wang
On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo wrote: > > This commit structure the indirect desc table. > Then we can get the desc num directly when doing unmap. > > And save the dma info to the struct, then the indirect > will not use the dma fields of the desc_extra. The subsequent > commits will ma

Re: [PATCH vhost v6 05/10] virtio_ring: split: structure the indirect desc table

2024-03-28 Thread Jason Wang
On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo wrote: > > This commit structure the indirect desc table. > Then we can get the desc num directly when doing unmap. > > And save the dma info to the struct, then the indirect > will not use the dma fields of the desc_extra. The subsequent > commits will ma

Re: [PATCH vhost v6 06/10] virtio_ring: no store dma info when unmap is not needed

2024-03-28 Thread Jason Wang
On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo wrote: > > As discussed: > http://lore.kernel.org/all/CACGkMEug-=C+VQhkMYSgUKMC==04m7-uem_yc21bggkkzh8...@mail.gmail.com > > When the vq is premapped mode, the driver manages the dma > info is a good way. > > So this commit make the virtio core not to stor

Re: [PATCH vhost v6 07/10] virtio: find_vqs: add new parameter premapped

2024-03-28 Thread Jason Wang
immediately by virtqueue_set_dma_premapped(). This patch introduces a > new parameter to find_vqs(). Then we can judge should we allocate the > dma array(struct vring_desc_dma) or not inside find_vqs(). > > The driver must check the premapped mode of every vq after find_vqs(). > > Signed-of

Re: [PATCH vhost v6 08/10] virtio_ring: export premapped to driver by struct virtqueue

2024-03-28 Thread Jason Wang
On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo wrote: > > Export the premapped to drivers, then drivers can check > the vq premapped mode after the find_vqs(). > Because the find_vqs() just try to enable the vq premapped mode, > the driver must check that after find_vqs(). What's the reason for this?

Re: [PATCH vhost v6 09/10] virtio_net: set premapped mode by find_vqs()

2024-03-28 Thread Jason Wang
On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo wrote: > > Now, the virtio core can set the premapped mode by find_vqs(). > If the premapped can be enabled, the dma array will not be > allocated. So virtio-net use the api of find_vqs to enable the > premapped. > > Judge the premapped mode by the vq->pre

Re: [PATCH vhost v6 03/10] virtio_ring: packed: structure the indirect desc table

2024-03-28 Thread Jason Wang
On Thu, Mar 28, 2024 at 3:38 PM Xuan Zhuo wrote: > > On Thu, 28 Mar 2024 14:56:55 +0800, Jason Wang wrote: > > On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo > > wrote: > > > > > > This commit structure the indirect desc table. > > > Then we c

Re: [PATCH vhost v6 02/10] virtio_ring: packed: remove double check of the unmap ops

2024-03-28 Thread Jason Wang
On Thu, Mar 28, 2024 at 3:32 PM Xuan Zhuo wrote: > > On Thu, 28 Mar 2024 14:56:47 +0800, Jason Wang wrote: > > On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo > > wrote: > > > > > > In the functions vring_unmap_extra_packed and vring_unmap_desc_packed, > > &

Re: [PATCH vhost v6 06/10] virtio_ring: no store dma info when unmap is not needed

2024-03-28 Thread Jason Wang
On Thu, Mar 28, 2024 at 3:42 PM Xuan Zhuo wrote: > > On Thu, 28 Mar 2024 15:06:33 +0800, Jason Wang wrote: > > On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo > > wrote: > > > > > > As discussed: > > > http://lore.kernel.org/all/CACGkMEug-=C+VQhkMYSg

Re: [PATCH vhost v6 09/10] virtio_net: set premapped mode by find_vqs()

2024-03-28 Thread Jason Wang
On Thu, Mar 28, 2024 at 4:27 PM Xuan Zhuo wrote: > > On Thu, 28 Mar 2024 16:05:02 +0800, Jason Wang wrote: > > On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo > > wrote: > > > > > > Now, the virtio core can set the premapped mode by find_vqs(). > > > I

Re: [PATCH vhost v6 02/10] virtio_ring: packed: remove double check of the unmap ops

2024-03-28 Thread Jason Wang
On Thu, Mar 28, 2024 at 4:16 PM Xuan Zhuo wrote: > > On Thu, 28 Mar 2024 16:07:14 +0800, Jason Wang wrote: > > On Thu, Mar 28, 2024 at 3:32 PM Xuan Zhuo > > wrote: > > > > > > On Thu, 28 Mar 2024 14:56:47 +0800, Jason Wang > > > wrote: >

Re: [PATCH vhost v6 09/10] virtio_net: set premapped mode by find_vqs()

2024-04-06 Thread Jason Wang
On Mon, Apr 1, 2024 at 11:10 AM Xuan Zhuo wrote: > > On Mon, 1 Apr 2024 09:40:07 +0800, Xuan Zhuo > wrote: > > On Fri, 29 Mar 2024 11:20:08 +0800, Jason Wang wrote: > > > On Thu, Mar 28, 2024 at 4:27 PM Xuan Zhuo > > > wrote: > > > > > >

Re: [PATCH vhost v6 09/10] virtio_net: set premapped mode by find_vqs()

2024-04-07 Thread Jason Wang
On Sun, Apr 7, 2024 at 2:03 PM Xuan Zhuo wrote: > > On Sun, 7 Apr 2024 12:24:00 +0800, Jason Wang wrote: > > On Mon, Apr 1, 2024 at 11:10 AM Xuan Zhuo > > wrote: > > > > > > On Mon, 1 Apr 2024 09:40:07 +0800, Xuan Zhuo > > > wrote: > >

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

2024-04-09 Thread Jason Wang
On Mon, Mar 18, 2024 at 7:06 PM Xuan Zhuo wrote: > > 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 Thanks

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

2024-04-09 Thread Jason Wang
On Mon, Mar 18, 2024 at 7:06 PM Xuan Zhuo wrote: > > 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

Re: [PATCH net-next v5 3/9] virtio_net: remove "_queue" from ethtool -S

2024-04-09 Thread Jason Wang
1. If the queue > num is larger than 10, the length of the prefix is 12. So the > key name max is 19. That is too short. We will introduce some keys > such as "gso_packets_coalesced". So we should change the prefix > to "rx0_". > > Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Thanks

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

2024-04-09 Thread Jason Wang
On Mon, Mar 18, 2024 at 7:06 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 v5 4/9] virtio_net: support device stats

2024-04-09 Thread Jason Wang
On Mon, Mar 18, 2024 at 7:06 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 > . > > Due to the numerous descriptors stats, an organization me

Re: [PATCH net-next v5 4/9] virtio_net: support device stats

2024-04-10 Thread Jason Wang
On Wed, Apr 10, 2024 at 6:55 PM Xuan Zhuo wrote: > > On Wed, 10 Apr 2024 14:09:23 +0800, Jason Wang wrote: > > On Mon, Mar 18, 2024 at 7:06 PM Xuan Zhuo > > wrote: > > > > > > As the spec > > > https://github.com/oasis-tcs/virtio-spec/co

Re: [PATCH vhost 3/6] virtio_net: replace private by pp struct inside page

2024-04-11 Thread Jason Wang
On Thu, Apr 11, 2024 at 10:51 AM Xuan Zhuo wrote: > > Now, we chain the pages of big mode by the page's private variable. > But a subsequent patch aims to make the big mode to support > premapped mode. This requires additional space to store the dma addr. > > Within the sub-struct that contains th

Re: [PATCH vhost 3/6] virtio_net: replace private by pp struct inside page

2024-04-11 Thread Jason Wang
On Fri, Apr 12, 2024 at 1:39 PM Xuan Zhuo wrote: > > On Fri, 12 Apr 2024 12:47:55 +0800, Jason Wang wrote: > > On Thu, Apr 11, 2024 at 10:51 AM Xuan Zhuo > > wrote: > > > > > > Now, we chain the pages of big mode by the page's private variable. > >

Re: [PATCH vhost 3/6] virtio_net: replace private by pp struct inside page

2024-04-14 Thread Jason Wang
On Mon, Apr 15, 2024 at 10:35 AM Xuan Zhuo wrote: > > On Fri, 12 Apr 2024 13:49:12 +0800, Jason Wang wrote: > > On Fri, Apr 12, 2024 at 1:39 PM Xuan Zhuo > > wrote: > > > > > > On Fri, 12 Apr 2024 12:47:55 +0800, Jason Wang > > > wrote: >

Re: [PATCH net-next v5 4/9] virtio_net: support device stats

2024-04-14 Thread Jason Wang
On Mon, Apr 15, 2024 at 10:51 AM Xuan Zhuo wrote: > > On Thu, 11 Apr 2024 14:09:24 +0800, Jason Wang wrote: > > On Wed, Apr 10, 2024 at 6:55 PM Xuan Zhuo > > wrote: > > > > > > On Wed, 10 Apr 2024 14:09:23 +0800, Jason Wang > > > wrote: >

Re: [PATCH net-next v5 4/9] virtio_net: support device stats

2024-04-15 Thread Jason Wang
On Mon, Apr 15, 2024 at 4:15 PM Xuan Zhuo wrote: > > On Mon, 15 Apr 2024 14:45:36 +0800, Jason Wang wrote: > > On Mon, Apr 15, 2024 at 10:51 AM Xuan Zhuo > > wrote: > > > > > > On Thu, 11 Apr 2024 14:09:24 +0800, Jason Wang > > > wrote: >

Re: [PATCH vhost 3/6] virtio_net: replace private by pp struct inside page

2024-04-15 Thread Jason Wang
On Mon, Apr 15, 2024 at 4:50 PM Xuan Zhuo wrote: > > On Mon, 15 Apr 2024 14:43:24 +0800, Jason Wang wrote: > > On Mon, Apr 15, 2024 at 10:35 AM Xuan Zhuo > > wrote: > > > > > > On Fri, 12 Apr 2024 13:49:12 +0800, Jason Wang > > > wrote: >

Re: [PATCH vhost 3/6] virtio_net: replace private by pp struct inside page

2024-04-15 Thread Jason Wang
On Mon, Apr 15, 2024 at 5:04 PM Xuan Zhuo wrote: > > On Mon, 15 Apr 2024 16:56:45 +0800, Jason Wang wrote: > > On Mon, Apr 15, 2024 at 4:50 PM Xuan Zhuo > > wrote: > > > > > > On Mon, 15 Apr 2024 14:43:24 +0800, Jason Wang > > > wrote: >

Re: [patch net-next v2 1/6] virtio: add debugfs infrastructure to allow to debug virtio features

2024-04-15 Thread Jason Wang
--- Note that this can be done already with vp_vdpa feature provisioning: commit c1ca352d371f724f7fb40f016abdb563aa85fe55 Author: Jason Wang Date: Tue Sep 27 15:48:10 2022 +0800 vp_vdpa: support feature provisioning For example: vdpa dev add name dev1 mgmtdev pci/:02:00.0 device_features 0x30002 Thanks

Re: [PATCH vhost 3/6] virtio_net: replace private by pp struct inside page

2024-04-16 Thread Jason Wang
On Wed, Apr 17, 2024 at 9:38 AM Xuan Zhuo wrote: > > On Tue, 16 Apr 2024 11:24:53 +0800, Jason Wang wrote: > > On Mon, Apr 15, 2024 at 5:04 PM Xuan Zhuo > > wrote: > > > > > > On Mon, 15 Apr 2024 16:56:45 +0800, Jason Wang > > > wrote: >

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

2024-04-16 Thread Jason Wang
On Tue, Apr 16, 2024 at 9:03 PM Jiri Pirko wrote: > > Tue, Apr 16, 2024 at 11:53:35AM CEST, j...@resnulli.us wrote: > >Mon, Apr 15, 2024 at 07:26:59PM CEST, k...@kernel.org wrote: > >>On Sat, 13 Apr 2024 15:23:53 +0200 Jiri Pirko wrote: > >>> That is a goal. Currently I do it with: > >>> vng --qem

Re: [patch net-next v2 1/6] virtio: add debugfs infrastructure to allow to debug virtio features

2024-04-16 Thread Jason Wang
ys/bus/virtio/drivers/virtio_net/bind > >> $ cat /sys/bus/virtio/devices/virtio0/features > >> 11110101110010001000 > >> > >> Note that sysfs "features" know already exists, this patch does not > >> tou

Re: [patch net-next v2 1/6] virtio: add debugfs infrastructure to allow to debug virtio features

2024-04-17 Thread Jason Wang
> >> >> $ echo "virtio0" > /sys/bus/virtio/drivers/virtio_net/bind > >> >> $ cat /sys/bus/virtio/devices/virtio0/features > >> >> 11110101110010001000 > >> >> > >> >> Note that sysfs "featur

Re: [PATCH vhost 3/6] virtio_net: replace private by pp struct inside page

2024-04-17 Thread Jason Wang
On Wed, Apr 17, 2024 at 4:45 PM Xuan Zhuo wrote: > > On Wed, 17 Apr 2024 12:08:10 +0800, Jason Wang wrote: > > On Wed, Apr 17, 2024 at 9:38 AM Xuan Zhuo > > wrote: > > > > > > On Tue, 16 Apr 2024 11:24:53 +0800, Jason Wang > > > wrote: >

Re: [PATCH vhost 3/6] virtio_net: replace private by pp struct inside page

2024-04-17 Thread Jason Wang
On Thu, Apr 18, 2024 at 12:15 PM Jason Wang wrote: > > On Wed, Apr 17, 2024 at 4:45 PM Xuan Zhuo wrote: > > > > On Wed, 17 Apr 2024 12:08:10 +0800, Jason Wang wrote: > > > On Wed, Apr 17, 2024 at 9:38 AM Xuan Zhuo > > > wrote: > > > > > &

Re: [PATCH vhost 1/6] virtio_ring: introduce dma map api for page

2024-04-17 Thread Jason Wang
e, enum dma_data_direction dir, >unsigned long attrs); > > Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Thanks

Re: [PATCH vhost 2/6] virtio_ring: enable premapped mode whatever use_dma_api

2024-04-17 Thread Jason Wang
by: Xuan Zhuo Acked-by: Jason Wang Thanks

Re: [PATCH vhost 3/6] virtio_net: replace private by pp struct inside page

2024-04-17 Thread Jason Wang
/* Average packet length for mergeable receive buffers. */ > @@ -432,16 +435,16 @@ skb_vnet_common_hdr(struct sk_buff *skb) > } > > /* > - * private is used to chain pages for big packets, put the whole > - * most recent used list in the beginning for reuse > + * put the whole most recent used list in the beginning for reuse > */ While at this, let's explain the pp is used to chain pages or we can do it on the definition of page_chain_add(). Others look good. Acked-by: Jason Wang Thanks

Re: [PATCH vhost 2/6] virtio_ring: enable premapped mode whatever use_dma_api

2024-04-17 Thread Jason Wang
On Thu, Apr 11, 2024 at 10:51 AM Xuan Zhuo wrote: > > Now, we have virtio DMA APIs, the driver can be the premapped > mode whatever the virtio core uses dma api or not. > > So remove the limit of checking use_dma_api from > virtqueue_set_dma_premapped(). > > Signed-off-by: Xuan Zhuo > --- > driv

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

2024-04-17 Thread Jason Wang
On Thu, Apr 11, 2024 at 10:51 AM 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 address. I use the page.dma_addr to > store the DMA address from the pp

Re: [PATCH vhost 5/6] virtio_net: enable premapped by default

2024-04-17 Thread Jason Wang
On Thu, Apr 11, 2024 at 10:51 AM Xuan Zhuo wrote: > > Currently, big, merge, and small modes all support the premapped mode. > We can now enable premapped mode by default. Furthermore, > virtqueue_set_dma_premapped() must succeed when called immediately after > find_vqs(). Consequently, we can ass

Re: [PATCH vhost 6/6] virtio_net: rx remove premapped failover code

2024-04-17 Thread Jason Wang
On Thu, Apr 11, 2024 at 10:51 AM Xuan Zhuo wrote: > > Now, for the merge and small, the premapped mode can be enabled > unconditionally. I guess it's not only merge and small but big mode as well? > > So we can remove the failover code. > > Signed-off-by: Xuan Z

Re: [PATCH net-next v4 3/6] virtio_net: Add a lock for the command VQ.

2024-04-17 Thread Jason Wang
On Wed, Apr 17, 2024 at 3:31 AM Daniel Jurgens wrote: > > The command VQ will no longer be protected by the RTNL lock. Use a > spinlock to protect the control buffer header and the VQ. > > Signed-off-by: Daniel Jurgens > Reviewed-by: Jiri Pirko > --- > drivers/net/virtio_net.c | 6 +- > 1 f

Re: [PATCH net-next v4 3/6] virtio_net: Add a lock for the command VQ.

2024-04-18 Thread Jason Wang
18 at 15:36 +0800, Heng Qi wrote: > >>>> 在 2024/4/18 下午2:42, Jason Wang 写道: > >>>>> On Wed, Apr 17, 2024 at 3:31 AM Daniel Jurgens > >>> wrote: > >>>>>> The command VQ will no longer be protected by the RTNL lock. Use a > >>

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

2024-04-18 Thread Jason Wang
On Thu, Apr 18, 2024 at 4:35 PM Xuan Zhuo wrote: > > On Thu, 18 Apr 2024 14:25:06 +0800, Jason Wang wrote: > > On Thu, Apr 11, 2024 at 10:51 AM Xuan Zhuo > > wrote: > > > > > > In big mode, pre-mapping DMA is beneficial because if the pages are not > >

Re: [PATCH vhost 5/6] virtio_net: enable premapped by default

2024-04-18 Thread Jason Wang
On Thu, Apr 18, 2024 at 4:37 PM Xuan Zhuo wrote: > > On Thu, 18 Apr 2024 14:26:33 +0800, Jason Wang wrote: > > On Thu, Apr 11, 2024 at 10:51 AM Xuan Zhuo > > wrote: > > > > > > Currently, big, merge, and small modes all support the premapped mode. >

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

2024-04-18 Thread Jason Wang
On Fri, Apr 19, 2024 at 12:23 PM Xuan Zhuo wrote: > > On Fri, 19 Apr 2024 08:43:43 +0800, Jason Wang wrote: > > On Thu, Apr 18, 2024 at 4:35 PM Xuan Zhuo > > wrote: > > > > > > On Thu, 18 Apr 2024 14:25:06 +0800, Jason Wang > > > wrote: >

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

2024-04-19 Thread Jason Wang
On Fri, Apr 19, 2024 at 3:07 PM Xuan Zhuo wrote: > > On Fri, 19 Apr 2024 13:46:25 +0800, Jason Wang wrote: > > On Fri, Apr 19, 2024 at 12:23 PM Xuan Zhuo > > wrote: > > > > > > On Fri, 19 Apr 2024 08:43:43 +0800, Jason Wang > > > wrote: >

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

2024-04-19 Thread Jason Wang
On Fri, Apr 19, 2024 at 3:28 PM Xuan Zhuo wrote: > > On Fri, 19 Apr 2024 15:24:25 +0800, Jason Wang wrote: > > On Fri, Apr 19, 2024 at 3:07 PM Xuan Zhuo > > wrote: > > > > > > On Fri, 19 Apr 2024 13:46:25 +0800, Jason Wang > > > wrote: >

Re: [PATCH vhost v2 7/7] virtio_net: remove the misleading comment

2024-04-22 Thread Jason Wang
On Mon, Apr 22, 2024 at 3:24 PM Xuan Zhuo wrote: > > We call the build_skb() actually without copying data. > The comment is misleading. So remove it. > > Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Thanks > --- > drivers/net/virtio_net.c | 1 - > 1 file changed

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

2024-04-22 Thread Jason Wang
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 address. I use the page.dma_addr to > store the DMA address from the pp s

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 > >

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: >

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: >

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

2024-04-23 Thread Jason Wang
rtnet_get_hw_stats_string(struct virtnet_info *vi, int type, > int qid, u8 **data) > +{ > + const struct virtnet_stat_desc *desc; > + const char *fmt, *noq_fmt; > + u8 *p = *data; > + u32 num = 0; > + > + if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_DEVICE_STATS)) > + return; > + > + if (type == VIRTNET_Q_TYPE_CQ) { > + noq_fmt = "cq_hw_%s"; > + > + if (VIRTIO_NET_STATS_TYPE_CVQ & vi->device_stats_cap) { Nit: I think we'd better to have a consistent style: If we do type == VIRTNET_Q_TYPE_CQ then we'd better use vi->device_stats_cap & VIRTIO_NET_STATS_TYPE_CVQ Other than this, Acked-by: Jason Wang Thanks

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: >

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

2024-04-23 Thread Jason Wang
nd driver stats. > > Signed-off-by: Xuan Zhuo > --- Acked-by: Jason Wang Thanks

<    1   2   3   4   5   6   7   8   9   10   >