Re: [PATCH vhost 01/17] virtio_ring: introduce vring_need_unmap_buffer

2024-01-31 Thread Jason Wang
ue > 3. truetrue false > > Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Thanks

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

2024-01-31 Thread Jason Wang
On Tue, Jan 30, 2024 at 7:42 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 06/17] virtio_ring: no store dma info when unmap is not needed

2024-01-31 Thread Jason Wang
On Tue, Jan 30, 2024 at 7:42 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 04/17] virtio_ring: split: remove double check of the unmap ops

2024-01-31 Thread Jason Wang
On Tue, Jan 30, 2024 at 7:42 PM Xuan Zhuo wrote: > > In the functions vring_unmap_one_split and > vring_unmap_one_split_indirect, > 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

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

2024-01-31 Thread Jason Wang
On Tue, Jan 30, 2024 at 7:42 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 08/17] virtio: vring_new_virtqueue(): pass struct instead of multi parameters

2024-01-31 Thread Jason Wang
On Tue, Jan 30, 2024 at 7:42 PM Xuan Zhuo wrote: > > Just like find_vqs(), it is time to refactor the > vring_new_virtqueue(). We pass the similar struct to > vring_new_virtqueue. > Well, the vring_create_virtqueue() is converted with a structure. We need to be consistent. And it seems better to

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

2024-01-31 Thread Jason Wang
On Tue, Jan 30, 2024 at 7:42 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 07/17] virtio: find_vqs: pass struct instead of multi parameters

2024-01-31 Thread Jason Wang
On Tue, Jan 30, 2024 at 7:42 PM Xuan Zhuo wrote: > > Now, we pass multi parameters to find_vqs. These parameters > may work for transport or work for vring. > > And find_vqs has multi implements in many places: > > But every time, > arch/um/drivers/virtio_uml.c > drivers/platform/mellanox/mlxbf-

Re: [PATCH vhost 17/17] virtio_net: sq support premapped mode

2024-01-31 Thread Jason Wang
On Tue, Jan 30, 2024 at 7:43 PM Xuan Zhuo wrote: > > If the xsk is enabling, the xsk tx will share the send queue. > But the xsk requires that the send queue use the premapped mode. > So the send queue must support premapped mode. > > Signed-off-by: Xuan Zhuo > --- > drivers/net/virtio_net.c | 1

Re: [PATCH vhost 11/17] virtio_ring: export premapped to driver by struct virtqueue

2024-01-31 Thread Jason Wang
On Tue, Jan 30, 2024 at 7:43 PM Xuan Zhuo wrote: > > Export the premapped to drivers, then drivers can check > the vq premapped mode after the find_vqs(). This looks odd, it's the charge of the driver to set premapped, so it should know it? Thanks

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

2024-01-31 Thread Jason Wang
On Wed, Jan 31, 2024 at 6:01 PM Xuan Zhuo wrote: > > On Wed, 31 Jan 2024 17:12:10 +0800, Jason Wang wrote: > > On Tue, Jan 30, 2024 at 7:42 PM Xuan Zhuo > > wrote: > > > > > > This commit structure the indirect desc table. > > > Then we c

Re: [PATCH vhost 17/17] virtio_net: sq support premapped mode

2024-01-31 Thread Jason Wang
On Thu, Feb 1, 2024 at 11:28 AM Xuan Zhuo wrote: > > On Wed, 31 Jan 2024 17:12:47 +0800, Jason Wang wrote: > > On Tue, Jan 30, 2024 at 7:43 PM Xuan Zhuo > > wrote: > > > > > > If the xsk is enabling, the xsk tx will share the send queue. > > > But

Re: [PATCH vhost 04/17] virtio_ring: split: remove double check of the unmap ops

2024-01-31 Thread Jason Wang
On Wed, Jan 31, 2024 at 5:43 PM Michael S. Tsirkin wrote: > > On Wed, Jan 31, 2024 at 05:12:22PM +0800, Jason Wang wrote: > > I post a patch to store flags unconditionally at: > > > > https://lore.kernel.org/all/20220224122655-mutt-send-email-...@kernel.org/ > > wha

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

2024-02-01 Thread Jason Wang
On Thu, Feb 1, 2024 at 2:05 PM Xuan Zhuo wrote: > > On Wed, 31 Jan 2024 17:12:29 +0800, Jason Wang wrote: > > On Tue, Jan 30, 2024 at 7:42 PM Xuan Zhuo > > wrote: > > > > > > As discussed: > > > http://lore.kernel.org/all/CACGkMEug-=C+VQhkMYSg

Re: [PATCH vhost 17/17] virtio_net: sq support premapped mode

2024-02-01 Thread Jason Wang
On Thu, Feb 1, 2024 at 2:01 PM Xuan Zhuo wrote: > > On Thu, 1 Feb 2024 13:36:46 +0800, Jason Wang wrote: > > On Thu, Feb 1, 2024 at 11:28 AM Xuan Zhuo > > wrote: > > > > > > On Wed, 31 Jan 2024 17:12:47 +0800, Jason Wang > > > wrote: >

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

2024-03-06 Thread Jason Wang
On Wed, Mar 6, 2024 at 6:01 PM Xuan Zhuo wrote: > > On Thu, 29 Feb 2024 04:34:20 -0500, "Michael S. Tsirkin" > wrote: > > On Thu, Feb 29, 2024 at 05:02:37PM +0800, Xuan Zhuo wrote: > > > On Thu, 29 Feb 2024 03:21:14 -0500, "Michael S. Tsirkin" > > > wrote: > > > > On Thu, Feb 29, 2024 at 03:20

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

2024-03-07 Thread Jason Wang
On Thu, Mar 7, 2024 at 4:15 PM Xuan Zhuo wrote: > > On Thu, 7 Mar 2024 13:28:27 +0800, Jason Wang wrote: > > On Wed, Mar 6, 2024 at 6:01 PM Xuan Zhuo wrote: > > > > > > On Thu, 29 Feb 2024 04:34:20 -0500, "Michael S. Tsirkin" > > > wrote: >

Re: [PATCH vhost v3 1/4] virtio: find_vqs: pass struct instead of multi parameters

2024-03-13 Thread Jason Wang
On Tue, Mar 12, 2024 at 10:10 AM Xuan Zhuo wrote: > > Now, we pass multi parameters to find_vqs. These parameters > may work for transport or work for vring. > > And find_vqs has multi implements in many places: > > arch/um/drivers/virtio_uml.c > drivers/platform/mellanox/mlxbf-tmfifo.c > drive

Re: [PATCH vhost v3 1/4] virtio: find_vqs: pass struct instead of multi parameters

2024-03-14 Thread Jason Wang
On Thu, Mar 14, 2024 at 2:00 PM Xuan Zhuo wrote: > > On Thu, 14 Mar 2024 11:12:24 +0800, Jason Wang wrote: > > On Tue, Mar 12, 2024 at 10:10 AM Xuan Zhuo > > wrote: > > > > > > Now, we pass multi parameters to find_vqs. These parameters > >

Re: [PATCH vhost v3 1/4] virtio: find_vqs: pass struct instead of multi parameters

2024-03-17 Thread Jason Wang
On Fri, Mar 15, 2024 at 3:26 PM Xuan Zhuo wrote: > > On Fri, 15 Mar 2024 11:51:48 +0800, Jason Wang wrote: > > On Thu, Mar 14, 2024 at 2:00 PM Xuan Zhuo > > wrote: > > > > > > On Thu, 14 Mar 2024 11:12:24 +0800, Jason Wang > > > wrote: >

Re: [PATCH vhost v3 1/4] virtio: find_vqs: pass struct instead of multi parameters

2024-03-20 Thread Jason Wang
On Tue, Mar 19, 2024 at 2:58 PM Michael S. Tsirkin wrote: > > On Mon, Mar 18, 2024 at 01:59:52PM +0800, Xuan Zhuo wrote: > > On Mon, 18 Mar 2024 12:18:23 +0800, Jason Wang wrote: > > > On Fri, Mar 15, 2024 at 3:26 PM Xuan Zhuo > > > wrote: > > > >

Re: [PATCH vhost v3 1/4] virtio: find_vqs: pass struct instead of multi parameters

2024-03-20 Thread Jason Wang
On Wed, Mar 20, 2024 at 5:22 PM Jason Wang wrote: > > On Tue, Mar 19, 2024 at 2:58 PM Michael S. Tsirkin wrote: > > > > On Mon, Mar 18, 2024 at 01:59:52PM +0800, Xuan Zhuo wrote: > > > On Mon, 18 Mar 2024 12:18:23 +0800, Jason Wang > > > wrote: > > >

Re: [PATCH vhost v3 1/4] virtio: find_vqs: pass struct instead of multi parameters

2024-03-20 Thread Jason Wang
On Wed, Mar 20, 2024 at 6:07 PM Xuan Zhuo wrote: > > On Wed, 20 Mar 2024 17:39:29 +0800, Xuan Zhuo > wrote: > > On Wed, 20 Mar 2024 17:22:50 +0800, Jason Wang wrote: > > > On Tue, Mar 19, 2024 at 2:58 PM Michael S. Tsirkin > > > wrote: > > > > >

Re: [PATCH vhost v3 1/4] virtio: find_vqs: pass struct instead of multi parameters

2024-03-20 Thread Jason Wang
On Wed, Mar 20, 2024 at 5:41 PM Xuan Zhuo wrote: > > On Wed, 20 Mar 2024 17:22:50 +0800, Jason Wang wrote: > > On Tue, Mar 19, 2024 at 2:58 PM Michael S. Tsirkin wrote: > > > > > > On Mon, Mar 18, 2024 at 01:59:52PM +0800, Xuan Zhuo wrote: > > > > On M

Re: [PATCH vhost v4 1/6] virtio_balloon: remove the dependence where names[] is null

2024-03-25 Thread Jason Wang
On Mon, Mar 25, 2024 at 5:44 PM Cornelia Huck wrote: > > On Mon, Mar 25 2024, Xuan Zhuo wrote: > > > On Fri, 22 Mar 2024 22:02:27 +0100, David Hildenbrand > > wrote: > >> On 22.03.24 20:16, Daniel Verkamp wrote: > >> > On Thu, Mar 21, 2024 at 3:16 AM Xuan Zhuo > >> > wrote: > >> >> > >> >> Cu

Re: [PATCH vhost v5 1/6] virtio_balloon: remove the dependence where names[] is null

2024-03-25 Thread Jason Wang
part of the codebase. In an upcoming commit, we plan to > eliminate this dependency by removing the function entirely. Therefore, > with this change, we are ensuring that the virtio_balloon no longer > depends on the aforementioned function. > > Signed-off-by: Xuan Zhuo With the above tweak. Acked-by: Jason Wang Thanks

Re: [PATCH vhost v4 1/6] virtio_balloon: remove the dependence where names[] is null

2024-03-25 Thread Jason Wang
On Tue, Mar 26, 2024 at 12:11 PM Jason Wang wrote: > > On Mon, Mar 25, 2024 at 5:44 PM Cornelia Huck wrote: > > > > On Mon, Mar 25 2024, Xuan Zhuo wrote: > > > > > On Fri, 22 Mar 2024 22:02:27 +0100, David Hildenbrand > > > wrote: > > >>

Re: [PATCH vhost v5 2/6] virtio: remove support for names array entries being null.

2024-03-25 Thread Jason Wang
On Mon, Mar 25, 2024 at 5:04 PM Xuan Zhuo wrote: > > commit 6457f126c888 ("virtio: support reserved vqs") introduced this > support. Multiqueue virtio-net use 2N as ctrl vq finally, so the logic > doesn't apply. And not one uses this. > > On the other side, that makes some trouble for us to refact

Re: [PATCH vhost v6 2/6] virtio: remove support for names array entries being null.

2024-03-27 Thread Jason Wang
d int nvqs, > struct cpumask *masks; > struct vdpa_callback cb; > bool has_affinity = desc && ops->set_vq_affinity; > - int i, err, queue_idx = 0; > + int i, err; > > if (has_affinity) { > masks = create_af

Re: [PATCH vhost v6 4/6] virtio: vring_create_virtqueue: pass struct instead of multi parameters

2024-03-27 Thread Jason Wang
f-by: Xuan Zhuo > Acked-by: Johannes Berg > Reviewed-by: Ilpo Järvinen Acked-by: Jason Wang Thanks

Re: [PATCH vhost v6 5/6] virtio: vring_new_virtqueue(): pass struct instead of multi parameters

2024-03-27 Thread Jason Wang
On Wed, Mar 27, 2024 at 5:58 PM Xuan Zhuo wrote: > > Now, we pass multi parameters to vring_new_virtqueue. These parameters > may from transport or from driver. > > vring_new_virtqueue is called by many places. > Every time, we try to add a new parameter, that is difficult. > > If parameters from

Re: [PATCH vhost v6 6/6] virtio_ring: simplify the parameters of the funcs related to vring_create/new_virtqueue()

2024-03-27 Thread Jason Wang
Signed-off-by: Xuan Zhuo > Reviewed-by: Ilpo Järvinen > --- Acked-by: Jason Wang Thanks

Re: [PATCH vhost v6 3/6] virtio: find_vqs: pass struct instead of multi parameters

2024-03-27 Thread Jason Wang
ccw); > + vqs[i] = virtio_ccw_setup_vq(vdev, i, ccw, cfg); > if (IS_ERR(vqs[i])) { > ret = PTR_ERR(vqs[i]); > vqs[i] = NULL; > diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c > index 82ee4a288728..7f0fdc3f51cb 100644 > --- a/drivers/virtio/virtio_mmio.c > +++ b/drivers/virtio/virtio_mmio.c > @@ -370,8 +370,7 @@ static void vm_synchronize_cbs(struct virtio_device *vdev) > } > > static struct virtqueue *vm_setup_vq(struct virtio_device *vdev, unsigned > int index, > - void (*callback)(struct virtqueue *vq), > - const char *name, bool ctx) > +struct virtio_vq_config *cfg) > { > struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); > bool (*notify)(struct virtqueue *vq); > @@ -386,9 +385,6 @@ static struct virtqueue *vm_setup_vq(struct virtio_device > *vdev, unsigned int in > else > notify = vm_notify; > > - if (!name) > - return NULL; Nit: This seems to belong to patch 2. Acked-by: Jason Wang Thanks

Re: [PATCH vhost v7 5/6] virtio: vring_new_virtqueue(): pass struct instead of multi parameters

2024-03-28 Thread Jason Wang
y: Xuan Zhuo > Reviewed-by: Ilpo Järvinen Acked-by: Jason Wang Thanks

Re: [PATCH vhost v9 1/6] virtio_balloon: remove the dependence where names[] is null

2024-06-20 Thread Jason Wang
lement functionality > > to allow vq indexes to be discontinuous. So the current behavior of the > > virtio-balloon device is different for the spec. But this commit has no > > functional changes. > > > > Signed-off-by: Xuan Zhuo > > Acked-by: David Hildenbrand

Re: [PATCH 2/2] virtio: fix vq # when vq skipped

2024-07-09 Thread Jason Wang
ult is that driver is out of spec. > > Implement what the API was supposed to do > in the 1st place. Compatibility with buggy hypervisors > is handled inside virtio-balloon, which is the only driver > making use of this facility, so far. > > Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Thanks

Re: [PATCH v6 06/26] virtio_ring: packed: extrace the logic of creating vring

2022-03-07 Thread Jason Wang
在 2022/3/8 下午3:01, Xuan Zhuo 写道: On Mon, 7 Mar 2022 17:17:51 -0500, "Michael S. Tsirkin" wrote: On Thu, Feb 24, 2022 at 04:10:42PM +0800, Xuan Zhuo wrote: Separate the logic of packed to create vring queue. For the convenience of passing parameters, add a structure vring_packed. This featur

Re: [PATCH v7 00/26] virtio pci support VIRTIO_F_RING_RESET

2022-03-08 Thread Jason Wang
在 2022/3/8 下午8:34, Xuan Zhuo 写道: The virtio spec already supports the virtio queue reset function. This patch set is to add this function to the kernel. The relevant virtio spec information is here: https://github.com/oasis-tcs/virtio-spec/issues/124 Also regarding MMIO support for queue

Re: [PATCH v7 01/26] virtio_pci: struct virtio_pci_common_cfg add queue_notify_data

2022-03-08 Thread Jason Wang
submitted this patch first. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- include/uapi/linux/virtio_pci.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h index 3a86f36d7e3d..22bec9bd0dfc 100644 --- a/include/uapi

Re: [PATCH v7 02/26] virtio: queue_reset: add VIRTIO_F_RING_RESET

2022-03-08 Thread Jason Wang
在 2022/3/8 下午8:34, Xuan Zhuo 写道: Added VIRTIO_F_RING_RESET, it came from here https://github.com/oasis-tcs/virtio-spec/issues/124 Nit: it's better to explain VIRTIO_F_RING_RESET a little bit here. Other than this. Acked-by: Jason Wang Signed-off-by: Xuan Zhuo --- include/uapi/

Re: [PATCH v7 03/26] virtio: add helper virtqueue_get_vring_max_size()

2022-03-08 Thread Jason Wang
based on this. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_mmio.c | 2 ++ drivers/virtio/virtio_pci_legacy.c | 2 ++ drivers/virtio/virtio_pci_modern.c | 2 ++ drivers/virtio/virtio_ring.c | 14 ++ include/linux/virtio.h

Re: [PATCH v7 04/26] virtio_ring: split: extract the logic of creating vring

2022-03-08 Thread Jason Wang
在 2022/3/8 下午8:34, Xuan Zhuo 写道: Separate the logic of split to create vring queue. For the convenience of passing parameters, add a structure vring_split. This feature is required for subsequent virtuqueue reset vring. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 74 +++

Re: [PATCH v7 05/26] virtio_ring: split: extract the logic of init vq and attach vring

2022-03-08 Thread Jason Wang
在 2022/3/8 下午8:34, Xuan Zhuo 写道: Split the logic of split assignment vq into three parts. 1. The assignment passed from the function parameter 2. The part that attaches vring to vq. -- __vring_virtqueue_attach_split() 3. The part that initializes vq to a fixed value -- __vring_virtqueue_ini

Re: [PATCH v7 08/26] virtio_ring: extract the logic of freeing vring

2022-03-08 Thread Jason Wang
在 2022/3/8 下午8:35, Xuan Zhuo 写道: Introduce vring_free() to free the vring of vq. Prevent double free by setting vq->reset. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 25 - include/linux/virtio.h | 8 2 files changed, 28 insertions(+

Re: [PATCH v7 09/26] virtio_ring: split: implement virtqueue_reset_vring_split()

2022-03-08 Thread Jason Wang
在 2022/3/8 下午8:35, Xuan Zhuo 写道: virtio ring supports reset. Queue reset is divided into several stages. 1. notify device queue reset 2. vring release 3. attach new vring 4. notify device queue re-enable After the first step is completed, the vring reset operation can be performed. If the new

Re: [PATCH v7 13/26] virtio: queue_reset: struct virtio_config_ops add callbacks for queue_reset

2022-03-09 Thread Jason Wang
在 2022/3/8 下午8:35, Xuan Zhuo 写道: Performing reset on a queue is divided into four steps: 1. reset_vq() - notify the device to reset the queue 2. virtqueue_detach_unused_buf() - recycle the buffer submitted 3. virtqueue_reset_vring()- reset the vring (may re-al

Re: [PATCH v7 14/26] virtio: add helper for queue reset

2022-03-09 Thread Jason Wang
在 2022/3/8 下午8:35, Xuan Zhuo 写道: Add helper for virtio queue reset. * virtio_reset_vq(): reset a queue individually * virtio_enable_resetq(): enable a reset queue Signed-off-by: Xuan Zhuo --- include/linux/virtio_config.h | 40 +++ 1 file changed, 40 inserti

Re: [PATCH v7 17/26] virtio_pci: queue_reset: support VIRTIO_F_RING_RESET

2022-03-09 Thread Jason Wang
在 2022/3/8 下午8:35, Xuan Zhuo 写道: This patch implements virtio pci support for QUEUE RESET. Performing reset on a queue is divided into these steps: 1. virtio_reset_vq() - notify the device to reset the queue 2. virtqueue_detach_unused_buf() - recycle the buffer submitted 3.

Re: [PATCH v7 18/26] virtio: find_vqs() add arg sizes

2022-03-09 Thread Jason Wang
在 2022/3/8 下午8:35, Xuan Zhuo 写道: find_vqs() adds a new parameter sizes to specify the size of each vq vring. 0 means use the maximum size supported by the backend. In the split scenario, the meaning of size is the largest size, because it may be limited by memory, the virtio core will try a sm

Re: [PATCH v7 21/26] virtio: add helper virtio_find_vqs_ctx_size()

2022-03-09 Thread Jason Wang
在 2022/3/8 下午8:35, Xuan Zhuo 写道: Introduce helper virtio_find_vqs_ctx_size() to call find_vqs and specify the maximum size of each vq ring. Signed-off-by: Xuan Zhuo --- include/linux/virtio_config.h | 12 1 file changed, 12 insertions(+) diff --git a/include/linux/virtio_confi

Re: [PATCH v7 23/26] virtio_net: split free_unused_bufs()

2022-03-09 Thread Jason Wang
: Jason Wang --- drivers/net/virtio_net.c | 53 +++- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 59b1ea82f5f0..409a8e180918 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net

Re: [PATCH v7 24/26] virtio_net: support rx/tx queue reset

2022-03-09 Thread Jason Wang
在 2022/3/8 下午8:35, Xuan Zhuo 写道: This patch implements the reset function of the rx, tx queues. Based on this function, it is possible to modify the ring num of the queue. And quickly recycle the buffer in the queue. In the process of the queue disable, in theory, as long as virtio supports qu

Re: [PATCH v7 25/26] virtio_net: set the default max ring size by find_vqs()

2022-03-09 Thread Jason Wang
在 2022/3/8 下午8:35, Xuan Zhuo 写道: Use virtio_find_vqs_ctx_size() to specify the maximum ring size of tx, rx at the same time. | rx/tx ring size --- speed == UNKNOWN or < 10G| 1024 speed < 40G | 4096 speed >= 40G

Re: [PATCH v7 26/26] virtio_net: support set_ringparam

2022-03-09 Thread Jason Wang
在 2022/3/8 下午8:35, Xuan Zhuo 写道: Support set_ringparam based on virtio queue reset. The rx,tx_pending required to be passed must be power of 2. Signed-off-by: Xuan Zhuo --- drivers/net/virtio_net.c | 47 1 file changed, 47 insertions(+) diff --git

Re: [PATCH v7 17/26] virtio_pci: queue_reset: support VIRTIO_F_RING_RESET

2022-03-10 Thread Jason Wang
在 2022/3/9 下午5:32, Xuan Zhuo 写道: On Wed, 9 Mar 2022 16:54:10 +0800, Jason Wang wrote: 在 2022/3/8 下午8:35, Xuan Zhuo 写道: This patch implements virtio pci support for QUEUE RESET. Performing reset on a queue is divided into these steps: 1. virtio_reset_vq() - notify the device

Re: [PATCH v7 09/26] virtio_ring: split: implement virtqueue_reset_vring_split()

2022-03-10 Thread Jason Wang
在 2022/3/10 下午12:46, Xuan Zhuo 写道: On Wed, 9 Mar 2022 15:55:44 +0800, Jason Wang wrote: 在 2022/3/8 下午8:35, Xuan Zhuo 写道: virtio ring supports reset. Queue reset is divided into several stages. 1. notify device queue reset 2. vring release 3. attach new vring 4. notify device queue re

Re: [PATCH v7 17/26] virtio_pci: queue_reset: support VIRTIO_F_RING_RESET

2022-03-10 Thread Jason Wang
在 2022/3/10 下午4:20, Xuan Zhuo 写道: On Wed, 9 Mar 2022 16:54:10 +0800, Jason Wang wrote: 在 2022/3/8 下午8:35, Xuan Zhuo 写道: This patch implements virtio pci support for QUEUE RESET. Performing reset on a queue is divided into these steps: 1. virtio_reset_vq() - notify the

Re: [PATCH v9 01/32] virtio: add helper virtqueue_get_vring_max_size()

2022-04-11 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: Record the maximum queue num supported by the device. virtio-net can display the maximum (supported by hardware) ring size in ethtool -g eth0. When the subsequent patch implements vring reset, it can judge whether the ring size passed by the driver is legal ba

Re: [PATCH v9 02/32] virtio: struct virtio_config_ops add callbacks for queue_reset

2022-04-11 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: Performing reset on a queue is divided into four steps: 1. transport: notify the device to reset the queue 2. vring: recycle the buffer submitted 3. vring: reset/resize the vring (may re-alloc) 4. transport: mmap vring to device, and enable the

Re: [PATCH v9 02/32] virtio: struct virtio_config_ops add callbacks for queue_reset

2022-04-11 Thread Jason Wang
On Tue, Apr 12, 2022 at 10:47 AM Jason Wang wrote: > > > 在 2022/4/6 上午11:43, Xuan Zhuo 写道: > > Performing reset on a queue is divided into four steps: > > > > 1. transport: notify the device to reset the queue > > 2. vring: recycle the buffer submitted >

Re: [PATCH v9 03/32] virtio_ring: update the document of the virtqueue_detach_unused_buf for queue reset

2022-04-11 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: Added documentation for virtqueue_detach_unused_buf, allowing it to be called on queue reset. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_ring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a

Re: [PATCH v9 04/32] virtio_ring: remove the arg vq of vring_alloc_desc_extra()

2022-04-11 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: The parameter vq of vring_alloc_desc_extra() is useless. This patch removes this parameter. Subsequent patches will call this function to avoid passing useless arguments. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_ring.c

Re: [PATCH v9 05/32] virtio_ring: extract the logic of freeing vring

2022-04-11 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: Introduce vring_free() to free the vring of vq. Subsequent patches will use vring_free() alone. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_ring.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions

Re: [PATCH v9 06/32] virtio_ring: split: extract the logic of alloc queue

2022-04-11 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: Separate the logic of split to create vring queue. This feature is required for subsequent virtuqueue reset vring. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 53 1 file changed, 36 insertions(+), 17 del

Re: [PATCH v9 07/32] virtio_ring: split: extract the logic of alloc state and extra

2022-04-11 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: Separate the logic of creating desc_state, desc_extra, and subsequent patches will call it independently. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 53 ++-- 1 file changed, 38 insertions(+), 15 deletions(-)

Re: [PATCH v9 08/32] virtio_ring: split: extract the logic of attach vring

2022-04-11 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: Separate the logic of attach vring, subsequent patches will call it separately. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/virtio/virtio_ring.c

Re: [PATCH v9 09/32] virtio_ring: split: extract the logic of vq init

2022-04-11 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: Separate the logic of initializing vq, and subsequent patches will call it separately. The feature of this part is that it does not depend on the information passed by the upper layer and can be called repeatedly. Signed-off-by: Xuan Zhuo --- drivers/virtio

Re: [PATCH v9 10/32] virtio_ring: split: introduce virtqueue_reinit_split()

2022-04-11 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: Introduce a function to initialize vq without allocating new ring, desc_state, desc_extra. Subsequent patches will call this function after reset vq to reinitialize vq. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_ring.c

Re: [PATCH v9 11/32] virtio_ring: split: introduce virtqueue_resize_split()

2022-04-11 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: virtio ring split supports resize. Only after the new vring is successfully allocated based on the new num, we will release the old vring. In any case, an error is returned, indicating that the vring still points to the old vring. In the case of an error, the

Re: [PATCH v9 12/32] virtio_ring: packed: extract the logic of alloc queue

2022-04-11 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: Separate the logic of packed to create vring queue. For the convenience of passing parameters, add a structure vring_packed. This feature is required for subsequent virtuqueue reset vring. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 70

Re: [PATCH v9 18/32] virtio_ring: introduce virtqueue_resize()

2022-04-11 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: Introduce virtqueue_resize() to implement the resize of vring. Based on these, the driver can dynamically adjust the size of the vring. For example: ethtool -G. virtqueue_resize() implements resize based on the vq reset function. In case of failure to allocate

Re: [PATCH v9 21/32] virtio_pci: queue_reset: update struct virtio_pci_common_cfg and option functions

2022-04-11 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: Add queue_reset in virtio_pci_common_cfg, and add related operation functions. For not breaks uABI, add a new struct virtio_pci_common_cfg_reset. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_pci_modern_dev.c | 36 ++ include/l

Re: [PATCH v9 22/32] virtio_pci: queue_reset: extract the logic of active vq for modern pci

2022-04-11 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: Introduce vp_active_vq() to configure vring to backend after vq attach vring. And configure vq vector if necessary. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_pci_modern.c | 46 ++ 1 file changed, 28 insertions(+), 18 del

Re: [PATCH v9 23/32] virtio_pci: queue_reset: support VIRTIO_F_RING_RESET

2022-04-12 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: This patch implements virtio pci support for QUEUE RESET. Performing reset on a queue is divided into these steps: 1. notify the device to reset the queue 2. recycle the buffer submitted 3. reset the vring (may re-alloc) 4. mmap vring to device, and en

Re: [PATCH v9 24/32] virtio: find_vqs() add arg sizes

2022-04-12 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: find_vqs() adds a new parameter sizes to specify the size of each vq vring. 0 means use the maximum size supported by the backend. Does this mean driver still need to prepare a array of 0 or it can simply pass NULL to find_vqs()? Thanks In the split s

Re: [PATCH v9 25/32] virtio_pci: support the arg sizes of find_vqs()

2022-04-12 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: Virtio PCI supports new parameter sizes of find_vqs(). Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_pci_common.c | 18 ++ drivers/virtio/virtio_pci_common.h | 1 + drivers/virtio/virtio_pci_legacy.c | 6

Re: [PATCH v9 26/32] virtio_mmio: support the arg sizes of find_vqs()

2022-04-12 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: Virtio MMIO support the new parameter sizes of find_vqs(). Signed-off-by: Xuan Zhuo --- Acked-by: Jason Wang drivers/virtio/virtio_mmio.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/virtio/virtio_mmio.c b

Re: [PATCH v9 27/32] virtio: add helper virtio_find_vqs_ctx_size()

2022-04-12 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: Introduce helper virtio_find_vqs_ctx_size() to call find_vqs and specify the maximum size of each vq ring. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- include/linux/virtio_config.h | 12 1 file changed, 12 insertions(+) diff

Re: [PATCH v9 28/32] virtio_net: set the default max ring size by find_vqs()

2022-04-12 Thread Jason Wang
>= 40G | 8192 Call virtnet_update_settings() once before calling init_vqs() to update speed. Signed-off-by: Xuan Zhuo --- Acked-by: Jason Wang drivers/net/virtio_net.c | 42 1 file changed, 38 insertions(+), 4 deletions(-) diff --git

Re: [PATCH v9 29/32] virtio_net: get ringparam by virtqueue_get_vring_max_size()

2022-04-12 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: Use virtqueue_get_vring_max_size() in virtnet_get_ringparam() to set tx,rx_max_pending. Signed-off-by: Xuan Zhuo --- Acked-by: Jason Wang drivers/net/virtio_net.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers

Re: [PATCH v9 31/32] virtio_net: support rx/tx queue resize

2022-04-13 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: This patch implements the resize function of the rx, tx queues. Based on this function, it is possible to modify the ring num of the queue. There may be an exception during the resize process, the resize may fail, or the vq can no longer be used. Either way, we

Re: [PATCH v9 32/32] virtio_net: support set_ringparam

2022-04-13 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: Support set_ringparam based on virtio queue reset. Users can use ethtool -G eth0 to modify the ring size of virtio-net. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang (One thing that I see is that, when resize fails, the param reported via

Re: [PATCH v9 01/32] virtio: add helper virtqueue_get_vring_max_size()

2022-04-14 Thread Jason Wang
On Wed, Apr 13, 2022 at 10:30 AM Xuan Zhuo wrote: > > On Tue, 12 Apr 2022 10:41:03 +0800, Jason Wang wrote: > > > > 在 2022/4/6 上午11:43, Xuan Zhuo 写道: > > > Record the maximum queue num supported by the device. > > > > > > virtio-net can display the

Re: [PATCH v9 23/32] virtio_pci: queue_reset: support VIRTIO_F_RING_RESET

2022-04-14 Thread Jason Wang
On Wed, Apr 13, 2022 at 11:23 AM Xuan Zhuo wrote: > > On Tue, 12 Apr 2022 15:07:58 +0800, Jason Wang wrote: > > > > 在 2022/4/6 上午11:43, Xuan Zhuo 写道: > > > This patch implements virtio pci support for QUEUE RESET. > > > > > > Performing

Re: [PATCH v9 12/32] virtio_ring: packed: extract the logic of alloc queue

2022-04-14 Thread Jason Wang
On Wed, Apr 13, 2022 at 11:26 AM Xuan Zhuo wrote: > > On Tue, 12 Apr 2022 14:28:24 +0800, Jason Wang wrote: > > > > 在 2022/4/6 上午11:43, Xuan Zhuo 写道: > > > Separate the logic of packed to create vring queue. > > > > > > For the conve

Re: [PATCH v9 31/32] virtio_net: support rx/tx queue resize

2022-04-14 Thread Jason Wang
On Wed, Apr 13, 2022 at 4:47 PM Xuan Zhuo wrote: > > On Wed, 13 Apr 2022 16:00:18 +0800, Jason Wang wrote: > > > > 在 2022/4/6 上午11:43, Xuan Zhuo 写道: > > > This patch implements the resize function of the rx, tx queues. > > > Based on this function, it is po

Re: [PATCH v9 22/32] virtio_pci: queue_reset: extract the logic of active vq for modern pci

2022-04-14 Thread Jason Wang
On Thu, Apr 14, 2022 at 2:25 PM Xuan Zhuo wrote: > > On Tue, 12 Apr 2022 14:58:19 +0800, Jason Wang wrote: > > > > 在 2022/4/6 上午11:43, Xuan Zhuo 写道: > > > Introduce vp_active_vq() to configure vring to backend after vq attach > > > vring. And configure vq vec

Re: [PATCH v9 31/32] virtio_net: support rx/tx queue resize

2022-04-14 Thread Jason Wang
On Fri, Apr 15, 2022 at 10:23 AM Xuan Zhuo wrote: > > On Thu, 14 Apr 2022 17:30:02 +0800, Jason Wang wrote: > > On Wed, Apr 13, 2022 at 4:47 PM Xuan Zhuo > > wrote: > > > > > > On Wed, 13 Apr 2022 16:00:18 +0800, Jason Wang > > > wrote: >

Re: [PATCH v9 31/32] virtio_net: support rx/tx queue resize

2022-04-18 Thread Jason Wang
On Mon, Apr 18, 2022 at 11:24 AM Xuan Zhuo wrote: > > On Wed, 13 Apr 2022 16:00:18 +0800, Jason Wang wrote: > > > > 在 2022/4/6 上午11:43, Xuan Zhuo 写道: > > > This patch implements the resize function of the rx, tx queues. > > > Based on this function, it is po

Re: [PATCH v9 31/32] virtio_net: support rx/tx queue resize

2022-04-18 Thread Jason Wang
在 2022/4/15 17:17, Xuan Zhuo 写道: On Fri, 15 Apr 2022 13:53:54 +0800, Jason Wang wrote: On Fri, Apr 15, 2022 at 10:23 AM Xuan Zhuo wrote: On Thu, 14 Apr 2022 17:30:02 +0800, Jason Wang wrote: On Wed, Apr 13, 2022 at 4:47 PM Xuan Zhuo wrote: On Wed, 13 Apr 2022 16:00:18 +0800, Jason Wang

Re: [PATCH] um: virt-pci: set device ready in probe()

2022-06-12 Thread Jason Wang
On Fri, Jun 10, 2022 at 11:12 PM Vincent Whitchurch wrote: > > Call virtio_device_ready() to make this driver work after commit > b4ec69d7e09 ("virtio: harden vring IRQ"), since the driver uses the > virtqueues in the probe function. (The virtio core sets the device > ready when probe returns.) >

Re: [PATCH v10 25/41] virtio_pci: struct virtio_pci_common_cfg add queue_notify_data

2022-06-26 Thread Jason Wang
queue_notify_data, I submitted > > this patch first. > > > > Signed-off-by: Xuan Zhuo > > Acked-by: Jason Wang > > --- > > include/uapi/linux/virtio_pci.h | 7 +++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/include/uapi/linux/virtio_p

Re: [PATCH v10 25/41] virtio_pci: struct virtio_pci_common_cfg add queue_notify_data

2022-06-27 Thread Jason Wang
On Mon, Jun 27, 2022 at 2:39 PM Michael S. Tsirkin wrote: > > On Mon, Jun 27, 2022 at 10:30:42AM +0800, Jason Wang wrote: > > On Fri, Jun 24, 2022 at 2:59 PM Michael S. Tsirkin wrote: > > > > > > On Fri, Jun 24, 2022 at 10:56:05AM +0800, Xuan Zhuo wrote: > >

Re: [PATCH v10 25/41] virtio_pci: struct virtio_pci_common_cfg add queue_notify_data

2022-06-27 Thread Jason Wang
On Mon, Jun 27, 2022 at 3:58 PM Michael S. Tsirkin wrote: > > On Mon, Jun 27, 2022 at 03:45:30PM +0800, Jason Wang wrote: > > On Mon, Jun 27, 2022 at 2:39 PM Michael S. Tsirkin wrote: > > > > > > On Mon, Jun 27, 2022 at 10:30:42AM +0800, Jason Wang wrote: > >

Re: [PATCH v10 25/41] virtio_pci: struct virtio_pci_common_cfg add queue_notify_data

2022-06-27 Thread Jason Wang
On Mon, Jun 27, 2022 at 7:53 PM Michael S. Tsirkin wrote: > > On Mon, Jun 27, 2022 at 04:14:20PM +0800, Jason Wang wrote: > > On Mon, Jun 27, 2022 at 3:58 PM Michael S. Tsirkin wrote: > > > > > > On Mon, Jun 27, 2022 at 03:45:30PM +0800, Jason Wang wrote: > >

Re: [PATCH v10 25/41] virtio_pci: struct virtio_pci_common_cfg add queue_notify_data

2022-06-27 Thread Jason Wang
On Tue, Jun 28, 2022 at 1:46 PM Michael S. Tsirkin wrote: > > On Tue, Jun 28, 2022 at 11:50:37AM +0800, Jason Wang wrote: > > On Mon, Jun 27, 2022 at 7:53 PM Michael S. Tsirkin wrote: > > > > > > On Mon, Jun 27, 2022 at 04:14:20PM +0800, Jason Wang wrote: > >

Re: [PATCH v10 25/41] virtio_pci: struct virtio_pci_common_cfg add queue_notify_data

2022-06-27 Thread Jason Wang
On Tue, Jun 28, 2022 at 2:10 PM Michael S. Tsirkin wrote: > > On Tue, Jun 28, 2022 at 02:07:28PM +0800, Jason Wang wrote: > > On Tue, Jun 28, 2022 at 1:46 PM Michael S. Tsirkin wrote: > > > > > > On Tue, Jun 28, 2022 at 11:50:37AM +0800, Jason Wang wrote: > >

Re: [PATCH v11 01/40] virtio: add helper virtqueue_get_vring_max_size()

2022-06-29 Thread Jason Wang
On Wed, Jun 29, 2022 at 2:57 PM Xuan Zhuo wrote: > > Record the maximum queue num supported by the device. > > virtio-net can display the maximum (supported by hardware) ring size in > ethtool -g eth0. > > When the subsequent patch implements vring reset, it can judge whether > the ring size passe

Re: [PATCH v11 02/40] virtio: struct virtio_config_ops add callbacks for queue_reset

2022-06-29 Thread Jason Wang
On Wed, Jun 29, 2022 at 2:57 PM Xuan Zhuo wrote: > > reset can be divided into the following four steps (example): > 1. transport: notify the device to reset the queue > 2. vring: recycle the buffer submitted > 3. vring: reset/resize the vring (may re-alloc) > 4. transport: mmap vring

Re: [PATCH v11 05/40] virtio_ring: split vring_virtqueue

2022-06-29 Thread Jason Wang
by: Xuan Zhuo Acked-by: Jason Wang > --- > drivers/virtio/virtio_ring.c | 116 ++- > 1 file changed, 60 insertions(+), 56 deletions(-) > > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > index bb4e8ae09c9b..2806e033a651 1

  1   2   >