Re: [RFC 3/5] virtiofs: Move stack sg to fuse_req

2025-01-22 Thread Eugenio Perez Martin
On Thu, Jan 23, 2025 at 2:54 AM Jason Wang wrote: > > On Thu, Jan 23, 2025 at 12:32 AM Eugenio Pérez wrote: > > > > We need to move the map and unmap out of virtiofs queue lock. We need to > > store the unmap sgs to call virtqueue_unmap_sgs, so use the request > > itself. > > > > TODO: We need t

Re: [RFC 2/5] virtio_ring: introduce virtqueue_map/unmap_sgs()

2025-01-22 Thread Eugenio Perez Martin
On Thu, Jan 23, 2025 at 2:51 AM Jason Wang wrote: > > On Thu, Jan 23, 2025 at 12:32 AM Eugenio Pérez wrote: > > > > From: Jason Wang > > > > Introduce new virtqueue DMA operations which allows the drivers that > > want to make use of the premapping API but operate at the sg level. > > > > Note t

Re: [PATCH] vduse: add virtio_fs to allowed dev id

2025-01-22 Thread Eugenio Perez Martin
On Thu, Jan 23, 2025 at 2:50 AM Jason Wang wrote: > > On Wed, Jan 22, 2025 at 11:49 PM Stefan Hajnoczi wrote: > > > > On Tue, Jan 21, 2025 at 11:33:46AM +0100, Eugenio Pérez wrote: > > > A VDUSE device that implements virtiofs device works fine just by > > > adding the device id to the whitelist.

Re: [PATCH][next] virtio_vdpa: remove redundant check on desc

2024-11-07 Thread Eugenio Perez Martin
On Thu, Nov 7, 2024 at 2:21 PM Colin Ian King wrote: > > The boolean variable has_affinity is true when desc is non-null and > ops->set_vq_affinity is non-null. Hence the call to create_affinity_masks > does not need to check for desc being non-null is redundant when > has_affinity is true, so it

Re: [PATCH] vdpa/mlx5: Fix error path during device add

2024-11-06 Thread Eugenio Perez Martin
On Tue, Nov 5, 2024 at 7:52 PM Dragos Tatulea wrote: > > In the error recovery path of mlx5_vdpa_dev_add(), the cleanup is > executed and at the end put_device() is called which ends up calling > mlx5_vdpa_free(). This function will execute the same cleanup all over > again. Most resources support

Re: [PATCH vhost v2 0/7] vdpa/mlx5: Optimze MKEY operations

2024-09-11 Thread Eugenio Perez Martin
On Mon, Sep 9, 2024 at 11:30 AM Dragos Tatulea wrote: > > > > On 30.08.24 12:58, Dragos Tatulea wrote: > > This series improves the time of .set_map() operations by parallelizing > > the MKEY creation and deletion for direct MKEYs. Looking at the top > > level MKEY creation/deletion functions, the

Re: [PATCH mlx5-vhost v2 01/10] net/mlx5: Support throttled commands from async API

2024-09-11 Thread Eugenio Perez Martin
On Mon, Sep 9, 2024 at 11:33 AM Dragos Tatulea wrote: > > > > On 16.08.24 11:01, Dragos Tatulea wrote: > > Currently, commands that qualify as throttled can't be used via the > > async API. That's due to the fact that the throttle semaphore can sleep > > but the async API can't. > > > > This patch

Re: [PATCH vhost v2 00/10] vdpa/mlx5: Parallelize device suspend/resume

2024-09-03 Thread Eugenio Perez Martin
On Tue, Sep 3, 2024 at 9:48 AM Dragos Tatulea wrote: > > > > On 03.09.24 09:40, Lei Yang wrote: > > On Mon, Sep 2, 2024 at 7:05 PM Dragos Tatulea wrote: > >> > >> Hi Lei, > >> > >> On 02.09.24 12:03, Lei Yang wrote: > >>> Hi Dragos > >>> > >>> QE tested this series with mellanox nic, it failed wi

Re: [PATCH vhost 7/7] vdpa/mlx5: Postpone MR deletion

2024-08-29 Thread Eugenio Perez Martin
On Thu, Aug 29, 2024 at 5:23 PM Dragos Tatulea wrote: > > > > On 29.08.24 17:07, Eugenio Perez Martin wrote: > > On Wed, Aug 21, 2024 at 1:42 PM Dragos Tatulea wrote: > >> > >> Currently, when a new MR is set up, the old MR is deleted. MR deletion > >>

Re: [PATCH vhost 1/7] vdpa/mlx5: Create direct MKEYs in parallel

2024-08-29 Thread Eugenio Perez Martin
On Thu, Aug 29, 2024 at 3:54 PM Dragos Tatulea wrote: > > > > On 29.08.24 15:10, Eugenio Perez Martin wrote: > > On Wed, Aug 21, 2024 at 1:41 PM Dragos Tatulea wrote: > >> > >> Use the async interface to issue MTT MKEY creation. > >> Extra care is

Re: [PATCH vhost 7/7] vdpa/mlx5: Postpone MR deletion

2024-08-29 Thread Eugenio Perez Martin
On Wed, Aug 21, 2024 at 1:42 PM Dragos Tatulea wrote: > > Currently, when a new MR is set up, the old MR is deleted. MR deletion > is about 30-40% the time of MR creation. As deleting the old MR is not > important for the process of setting up the new MR, this operation > can be postponed. > > Thi

Re: [PATCH vhost 6/7] vdpa/mlx5: Introduce init/destroy for MR resources

2024-08-29 Thread Eugenio Perez Martin
On Wed, Aug 21, 2024 at 1:42 PM Dragos Tatulea wrote: > > There's currently not a lot of action happening during > the init/destroy of MR resources. But more will be added > in the upcoming patches. If the series doesn't receive new patches, it is just the next patch :). > > Signed-off-by: Drago

Re: [PATCH vhost 5/7] vdpa/mlx5: Rename mr_mtx -> lock

2024-08-29 Thread Eugenio Perez Martin
On Wed, Aug 21, 2024 at 1:42 PM Dragos Tatulea wrote: > > Now that the mr resources have their own namespace in the > struct, give the lock a clearer name. > > Signed-off-by: Dragos Tatulea > Reviewed-by: Cosmin Ratiu Acked-by: Eugenio Pérez > --- > drivers/vdpa/mlx5/core/mlx5_vdpa.h | 2 +-

Re: [PATCH vhost 4/7] vdpa/mlx5: Extract mr members in own resource struct

2024-08-29 Thread Eugenio Perez Martin
On Wed, Aug 21, 2024 at 1:42 PM Dragos Tatulea wrote: > > Group all mapping related resources into their own structure. > > Upcoming patches will add more members in this new structure. > > Signed-off-by: Dragos Tatulea > Reviewed-by: Cosmin Ratiu Acked-by: Eugenio Pérez > --- > drivers/vdpa

Re: [PATCH vhost 2/7] vdpa/mlx5: Delete direct MKEYs in parallel

2024-08-29 Thread Eugenio Perez Martin
On Wed, Aug 21, 2024 at 1:42 PM Dragos Tatulea wrote: > > Use the async interface to issue MTT MKEY deletion. > > This makes destroy_user_mr() on average 8x times faster. > This number is also dependent on the size of the MR being > deleted. > > Signed-off-by: Dragos Tatulea > Reviewed-by: Cosmin

Re: [PATCH vhost 1/7] vdpa/mlx5: Create direct MKEYs in parallel

2024-08-29 Thread Eugenio Perez Martin
On Wed, Aug 21, 2024 at 1:41 PM Dragos Tatulea wrote: > > Use the async interface to issue MTT MKEY creation. > Extra care is taken at the allocation of FW input commands > due to the MTT tables having variable sizes depending on > MR. > > The indirect MKEY is still created synchronously at the >

Re: [PATCH vhost v2 10/10] vdpa/mlx5: Parallelize VQ suspend/resume for CVQ MQ command

2024-08-28 Thread Eugenio Perez Martin
On Fri, Aug 16, 2024 at 11:03 AM Dragos Tatulea wrote: > > change_num_qps() is still suspending/resuming VQs one by one. > This change switches to parallel suspend/resume. > > When increasing the number of queues the flow has changed a bit for > simplicity: the setup_vq() function will always be c

Re: [PATCH vhost v2 09/10] vdpa/mlx5: Small improvement for change_num_qps()

2024-08-28 Thread Eugenio Perez Martin
On Fri, Aug 16, 2024 at 11:03 AM Dragos Tatulea wrote: > > change_num_qps() has a lot of multiplications by 2 to convert > the number of VQ pairs to number of VQs. This patch simplifies > the code by doing the VQP -> VQ count conversion at the beginning > in a variable. > > Signed-off-by: Dragos T

Re: [PATCH vhost v2 05/10] vdpa/mlx5: Use async API for vq modify commands

2024-08-28 Thread Eugenio Perez Martin
On Fri, Aug 16, 2024 at 11:02 AM Dragos Tatulea wrote: > > Switch firmware vq modify command to be issued via the async API to > allow future parallelization. The new refactored function applies the > modify on a range of vqs and waits for their execution to complete. > > For now the command is st

Re: [PATCH vhost v2 04/10] vdpa/mlx5: Use async API for vq query command

2024-08-28 Thread Eugenio Perez Martin
On Fri, Aug 16, 2024 at 11:02 AM Dragos Tatulea wrote: > > Switch firmware vq query command to be issued via the async API to > allow future parallelization. > > For now the command is still serial but the infrastructure is there > to issue commands in parallel, including ratelimiting the number >

Re: [PATCH vhost v2 03/10] vdpa/mlx5: Introduce async fw command wrapper

2024-08-28 Thread Eugenio Perez Martin
On Fri, Aug 16, 2024 at 11:02 AM Dragos Tatulea wrote: > > Introduce a new function mlx5_vdpa_exec_async_cmds() which > wraps the mlx5_core async firmware command API in a way > that will be used to parallelize certain operation in this > driver. > > The wrapper deals with the case when mlx5_cmd_e

Re: [PATCH vhost 0/7] vdpa/mlx5: Parallelize device suspend/resume

2024-08-07 Thread Eugenio Perez Martin
On Fri, Aug 2, 2024 at 9:24 AM Dragos Tatulea wrote: > > This series parallelizes the mlx5_vdpa device suspend and resume > operations through the firmware async API. The purpose is to reduce live > migration downtime. > > The series starts with changing the VQ suspend and resume commands > to the

Re: [PATCH vhost 4/7] vdpa/mlx5: Use async API for vq modify commands

2024-08-07 Thread Eugenio Perez Martin
On Fri, Aug 2, 2024 at 9:24 AM Dragos Tatulea wrote: > > Switch firmware vq modify command to be issued via the async API to > allow future parallelization. The new refactored function applies the > modify on a range of vqs and waits for their execution to complete. > > For now the command is stil

Re: [PATCH vhost 2/7] vdpa/mlx5: Introduce error logging function

2024-08-06 Thread Eugenio Perez Martin
On Fri, Aug 2, 2024 at 9:24 AM Dragos Tatulea wrote: > > mlx5_vdpa_err() was missing. This patch adds it and uses it in the > necessary places. > > Signed-off-by: Dragos Tatulea > Reviewed-by: Tariq Toukan Acked-by: Eugenio Pérez > --- > drivers/vdpa/mlx5/core/mlx5_vdpa.h | 5 + > drive

Re: [PATCH] tools/virtio:Fix the wrong format specifier

2024-07-24 Thread Eugenio Perez Martin
On Wed, Jul 24, 2024 at 9:44 AM Zhu Jun wrote: > > The unsigned int should use "%u" instead of "%d". > > Signed-off-by: Zhu Jun Reviewed-by: Eugenio Pérez Thanks! > --- > tools/virtio/ringtest/main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/virtio/ringte

Re: [PATCH vhost v2 19/24] vdpa/mlx5: Forward error in suspend/resume device

2024-07-03 Thread Eugenio Perez Martin
On Wed, Jun 26, 2024 at 12:28 PM Dragos Tatulea wrote: > > Start using the suspend/resume_vq() error return codes previously added. > > Reviewed-by: Cosmin Ratiu > Reviewed-by: Zhu Yanjun > Signed-off-by: Dragos Tatulea Reviewed-by: Eugenio Pérez > --- > drivers/vdpa/mlx5/net/mlx5_vnet.c |

Re: [PATCH vhost v2 16/24] vdpa/mlx5: Accept Init -> Ready VQ transition in resume_vq()

2024-07-03 Thread Eugenio Perez Martin
On Wed, Jun 26, 2024 at 12:28 PM Dragos Tatulea wrote: > > Until now resume_vq() was used only for the suspend/resume scenario. > This change also allows calling resume_vq() to bring it from Init to > Ready state (VQ initialization). > > Signed-off-by: Dragos Tatulea > Reviewed-by: Cosmin Ratiu

Re: [PATCH vhost v2 15/24] vdpa/mlx5: Allow creation of blank VQs

2024-07-03 Thread Eugenio Perez Martin
On Wed, Jun 26, 2024 at 12:28 PM Dragos Tatulea wrote: > > Based on the filled flag, create VQs that are filled or blank. > Blank VQs will be filled in later through VQ modify. > > Downstream patches will make use of this to pre-create blank VQs at > vdpa device creation. > s/Downstream/Later/ ?

Re: [PATCH vhost 20/23] vdpa/mlx5: Pre-create hardware VQs at vdpa .dev_add time

2024-07-03 Thread Eugenio Perez Martin
On Wed, Jun 26, 2024 at 11:27 AM Dragos Tatulea wrote: > > On Wed, 2024-06-19 at 17:54 +0200, Eugenio Perez Martin wrote: > > On Mon, Jun 17, 2024 at 5:09 PM Dragos Tatulea wrote: > > > > > > Currently, hardware VQs are created right when the vdpa device gets into

Re: [PATCH vhost v2 09/24] vdpa/mlx5: Rename init_mvqs

2024-07-03 Thread Eugenio Perez Martin
On Wed, Jun 26, 2024 at 12:27 PM Dragos Tatulea wrote: > > Function is used to set default values, so name it accordingly. > > Signed-off-by: Dragos Tatulea Reviewed-by: Eugenio Pérez > --- > drivers/vdpa/mlx5/net/mlx5_vnet.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-)

Re: [PATCH vhost v2 07/24] vdpa/mlx5: Initialize and reset device with one queue pair

2024-07-03 Thread Eugenio Perez Martin
On Wed, Jun 26, 2024 at 12:27 PM Dragos Tatulea wrote: > > The virtio spec says that a vdpa device should start off with one queue > pair. The driver is already compliant. > > This patch moves the initialization to device add and reset times. This > is done in preparation for the pre-creation of h

Re: [PATCH vhost 23/23] vdpa/mlx5: Don't enable non-active VQs in .set_vq_ready()

2024-06-19 Thread Eugenio Perez Martin
On Mon, Jun 17, 2024 at 5:09 PM Dragos Tatulea wrote: > > VQ indices in the range [cur_num_qps, max_vqs) represent queues that > have not yet been activated. .set_vq_ready should not activate these > VQs. > > Signed-off-by: Dragos Tatulea > Reviewed-by: Cosmin Ratiu Acked-by: Eugenio Pérez >

Re: [PATCH vhost 22/23] vdpa/mlx5: Don't reset VQs more than necessary

2024-06-19 Thread Eugenio Perez Martin
On Mon, Jun 17, 2024 at 5:09 PM Dragos Tatulea wrote: > > The vdpa device can be reset many times in sequence without any > significant state changes in between. Previously this was not a problem: > VQs were torn down only on first reset. But after VQ pre-creation was > introduced, each reset will

Re: [PATCH vhost 21/23] vdpa/mlx5: Re-create HW VQs under certain conditions

2024-06-19 Thread Eugenio Perez Martin
On Mon, Jun 17, 2024 at 5:09 PM Dragos Tatulea wrote: > > There are a few conditions under which the hardware VQs need a full > teardown and setup: > > - VQ size changed to something else than default value. Hardware VQ size > modification is not supported. > > - User turns off certain device fe

Re: [PATCH vhost 20/23] vdpa/mlx5: Pre-create hardware VQs at vdpa .dev_add time

2024-06-19 Thread Eugenio Perez Martin
On Mon, Jun 17, 2024 at 5:09 PM Dragos Tatulea wrote: > > Currently, hardware VQs are created right when the vdpa device gets into > DRIVER_OK state. That is easier because most of the VQ state is known by > then. > > This patch switches to creating all VQs and their associated resources > at devi

Re: [PATCH vhost 19/23] vdpa/mlx5: Use suspend/resume during VQP change

2024-06-19 Thread Eugenio Perez Martin
On Mon, Jun 17, 2024 at 5:09 PM Dragos Tatulea wrote: > > Resume a VQ if it is already created when the number of VQ pairs > increases. This is done in preparation for VQ pre-creation which is > coming in a later patch. It is necessary because calling setup_vq() on > an already created VQ will ret

Re: [PATCH vhost 17/23] vdpa/mlx5: Consolidate all VQ modify to Ready to use resume_vq()

2024-06-19 Thread Eugenio Perez Martin
On Mon, Jun 17, 2024 at 5:09 PM Dragos Tatulea wrote: > > There are a few more places modifying the VQ to Ready directly. Let's > consolidate them into resume_vq(). > > The redundant warnings for resume_vq() errors can also be dropped. > > There is one special case that needs to be handled for vir

Re: [PATCH vhost 16/23] vdpa/mlx5: Add error code for suspend/resume VQ

2024-06-19 Thread Eugenio Perez Martin
On Mon, Jun 17, 2024 at 5:09 PM Dragos Tatulea wrote: > > Instead of blindly calling suspend/resume_vqs(), make then return error > codes. > > To keep compatibility, keep suspending or resuming VQs on error and > return the last error code. The assumption here is that the error code > would be the

Re: [PATCH vhost 13/23] vdpa/mlx5: Set mkey modified flags on all VQs

2024-06-19 Thread Eugenio Perez Martin
On Mon, Jun 17, 2024 at 5:09 PM Dragos Tatulea wrote: > > Otherwise, when virtqueues are moved from INIT to READY the latest mkey > will not be set appropriately. > > Signed-off-by: Dragos Tatulea > Reviewed-by: Cosmin Ratiu Acked-by: Eugenio Pérez > --- > drivers/vdpa/mlx5/net/mlx5_vnet.c |

Re: [PATCH vhost 12/23] vdpa/mlx5: Start off rqt_size with max VQPs

2024-06-19 Thread Eugenio Perez Martin
On Mon, Jun 17, 2024 at 5:09 PM Dragos Tatulea wrote: > > Currently rqt_size is initialized during device flag configuration. > That's because it is the earliest moment when device knows if MQ > (multi queue) is on or off. > > Shift this configuration earlier to device creation time. This implies

Re: [PATCH vhost 11/23] vdpa/mlx5: Set an initial size on the VQ

2024-06-19 Thread Eugenio Perez Martin
On Mon, Jun 17, 2024 at 5:09 PM Dragos Tatulea wrote: > > The virtqueue size is a pre-requisite for setting up any virtqueue > resources. For the upcoming optimization of creating virtqueues at > device add, the virtqueue size has to be configured. > > Store the default queue size in struct mlx5_v

Re: [PATCH vhost 08/23] vdpa/mlx5: Clear and reinitialize software VQ data on reset

2024-06-19 Thread Eugenio Perez Martin
On Mon, Jun 17, 2024 at 5:08 PM Dragos Tatulea wrote: > > The hardware VQ configuration is mirrored by data in struct > mlx5_vdpa_virtqueue . Instead of clearing just a few fields at reset, > fully clear the struct and initialize with the appropriate default > values. > > As clear_vqs_ready() is u

Re: [PATCH vhost 05/23] vdpa/mlx5: Iterate over active VQs during suspend/resume

2024-06-19 Thread Eugenio Perez Martin
On Mon, Jun 17, 2024 at 5:08 PM Dragos Tatulea wrote: > > No need to iterate over max number of VQs. > > Signed-off-by: Dragos Tatulea > Reviewed-by: Cosmin Ratiu Acked-by: Eugenio Pérez > --- > drivers/vdpa/mlx5/net/mlx5_vnet.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >

Re: [PATCH vhost 06/23] vdpa/mlx5: Remove duplicate suspend code

2024-06-19 Thread Eugenio Perez Martin
On Mon, Jun 17, 2024 at 5:08 PM Dragos Tatulea wrote: > > Use the dedicated suspend_vqs() function instead. > > Signed-off-by: Dragos Tatulea > Reviewed-by: Cosmin Ratiu Reviewed-by: Eugenio Pérez > --- > drivers/vdpa/mlx5/net/mlx5_vnet.c | 7 +-- > 1 file changed, 1 insertion(+), 6 dele

Re: [PATCH vhost 04/23] vdpa/mlx5: Drop redundant check in teardown_virtqueues()

2024-06-19 Thread Eugenio Perez Martin
On Mon, Jun 17, 2024 at 5:08 PM Dragos Tatulea wrote: > > The check is done inside teardown_vq(). > > Signed-off-by: Dragos Tatulea > Reviewed-by: Cosmin Ratiu Reviewed-by: Eugenio Pérez > --- > drivers/vdpa/mlx5/net/mlx5_vnet.c | 10 ++ > 1 file changed, 2 insertions(+), 8 deletions

Re: [PATCH vhost 03/23] vdpa/mlx5: Drop redundant code

2024-06-19 Thread Eugenio Perez Martin
On Mon, Jun 17, 2024 at 5:08 PM Dragos Tatulea wrote: Patch message suggestion: Originally, the second loop initialized the CVQ. But (acde3929492b ("vdpa/mlx5: Use consistent RQT size") initialized all the queues in the first loop, so the second iteration in ... > > The second iteration in init_

Re: [PATCH vhost 02/23] vdpa/mlx5: Make setup/teardown_vq_resources() symmetrical

2024-06-19 Thread Eugenio Perez Martin
On Mon, Jun 17, 2024 at 5:08 PM Dragos Tatulea wrote: > > ... by changing the setup_vq_resources() parameter. s/parameter/parameter type/ ? Either way, Acked-by: Eugenio Pérez > > Signed-off-by: Dragos Tatulea > Reviewed-by: Cosmin Ratiu > --- > drivers/vdpa/mlx5/net/mlx5_vnet.c | 10 +

Re: [PATCH vhost 01/23] vdpa/mlx5: Clarify meaning thorough function rename

2024-06-19 Thread Eugenio Perez Martin
On Mon, Jun 17, 2024 at 5:08 PM Dragos Tatulea wrote: > > setup_driver()/teardown_driver() are a bit vague. These functions are > used for virtqueue resources. > > Same for alloc_resources()/teardown_resources(): they represent fixed > resources that are meant to exist during the device lifetime.

Re: [PATCH] vhost/vsock: always initialize seqpacket_allow

2024-05-16 Thread Eugenio Perez Martin
On Wed, May 15, 2024 at 5:05 PM Michael S. Tsirkin wrote: > > There are two issues around seqpacket_allow: > 1. seqpacket_allow is not initialized when socket is >created. Thus if features are never set, it will be >read uninitialized. > 2. if VIRTIO_VSOCK_F_SEQPACKET is set and then clear

Re: [PATCH] vhost-vdpa: change ioctl # for VDPA_GET_VRING_SIZE

2024-04-02 Thread Eugenio Perez Martin
On Tue, Apr 2, 2024 at 11:21 PM Michael S. Tsirkin wrote: > > VDPA_GET_VRING_SIZE by mistake uses the already occupied > ioctl # 0x80 and we never noticed - it happens to work > because the direction and size are different, but confuses > tools such as perf which like to look at just the number, >

Re: [PATCH v2] vdpa/mlx5: Allow CVQ size changes

2024-02-27 Thread Eugenio Perez Martin
On Mon, Feb 19, 2024 at 2:09 AM Lei Yang wrote: > > QE tested this patch's V2, qemu no longer print error messages > "qemu-system-x86_64: Insufficient written data (0)" after > enable/disable multi queues multi times inside guest. Both "x-svq=on > '' and without it are all test pass. > > Tested-by

Re: [PATCH V2 3/3] vdpa_sim: flush workers on suspend

2024-02-15 Thread Eugenio Perez Martin
On Wed, Feb 14, 2024 at 8:52 PM Steven Sistare wrote: > > On 2/14/2024 2:39 PM, Eugenio Perez Martin wrote: > > On Wed, Feb 14, 2024 at 6:50 PM Steven Sistare > > wrote: > >> > >> On 2/13/2024 11:10 AM, Eugenio Perez Martin wrote: > >>> On Mon, Feb

Re: [PATCH V2 3/3] vdpa_sim: flush workers on suspend

2024-02-14 Thread Eugenio Perez Martin
On Wed, Feb 14, 2024 at 6:50 PM Steven Sistare wrote: > > On 2/13/2024 11:10 AM, Eugenio Perez Martin wrote: > > On Mon, Feb 12, 2024 at 6:16 PM Steve Sistare > > wrote: > >> > >> Flush to guarantee no workers are running when suspend returns. &g

Re: [PATCH V2 3/3] vdpa_sim: flush workers on suspend

2024-02-13 Thread Eugenio Perez Martin
On Mon, Feb 12, 2024 at 6:16 PM Steve Sistare wrote: > > Flush to guarantee no workers are running when suspend returns. > > Signed-off-by: Steve Sistare > --- > drivers/vdpa/vdpa_sim/vdpa_sim.c | 13 + > 1 file changed, 13 insertions(+) > > diff --git a/drivers/vdpa/vdpa_sim/vdpa_si

Re: [PATCH V2 1/3] vhost-vdpa: flush workers on suspend

2024-02-13 Thread Eugenio Perez Martin
On Mon, Feb 12, 2024 at 6:16 PM Steve Sistare wrote: > > Flush to guarantee no workers are running when suspend returns. > > Signed-off-by: Steve Sistare Acked-by: Eugenio Pérez Should this have a Fixes tag? > --- > drivers/vhost/vdpa.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --g

Re: [PATCH V2] vdpa: skip suspend/resume ops if not DRIVER_OK

2024-02-13 Thread Eugenio Perez Martin
On Tue, Feb 13, 2024 at 3:26 PM Steve Sistare wrote: > > If a vdpa device is not in state DRIVER_OK, then there is no driver state > to preserve, so no need to call the suspend and resume driver ops. > > Suggested-by: Eugenio Perez Martin " > Signed-off-by: Steve Sistare

Re: [PATCH V1] vdpa: suspend and resume require DRIVER_OK

2024-02-13 Thread Eugenio Perez Martin
On Tue, Feb 13, 2024 at 8:49 AM Eugenio Perez Martin wrote: > > On Mon, Feb 12, 2024 at 9:20 AM Michael S. Tsirkin wrote: > > > > On Fri, Feb 09, 2024 at 02:29:59PM -0800, Steve Sistare wrote: > > > Calling suspend or resume requires VIRTIO_CONFIG_S_DRIVER_OK,

Re: [PATCH V1] vdpa: suspend and resume require DRIVER_OK

2024-02-12 Thread Eugenio Perez Martin
On Mon, Feb 12, 2024 at 9:20 AM Michael S. Tsirkin wrote: > > On Fri, Feb 09, 2024 at 02:29:59PM -0800, Steve Sistare wrote: > > Calling suspend or resume requires VIRTIO_CONFIG_S_DRIVER_OK, for all > > vdpa devices. > > > > Suggested-by: Eugenio Perez Martin &quo

Re: [PATCH] vhost-vdpa: fail enabling virtqueue in certain conditions

2024-02-06 Thread Eugenio Perez Martin
On Tue, Feb 6, 2024 at 3:52 PM Stefano Garzarella wrote: > > If VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK is not negotiated, we expect > the driver to enable virtqueue before setting DRIVER_OK. If the driver > tries anyway, better to fail right away as soon as we get the ioctl. > Let's also update th

Re: [PATCH V1] vdpa_sim: reset must not run

2024-01-22 Thread Eugenio Perez Martin
On Mon, Jan 22, 2024 at 11:22 AM Stefano Garzarella wrote: > > On Wed, Jan 17, 2024 at 11:23:23AM -0800, Steve Sistare wrote: > >vdpasim_do_reset sets running to true, which is wrong, as it allows > >vdpasim_kick_vq to post work requests before the device has been > >configured. To fix, do not se

Re: [RFC V1 10/13] vdpa_sim: flush workers on suspend

2024-01-16 Thread Eugenio Perez Martin
On Wed, Jan 10, 2024 at 9:40 PM Steve Sistare wrote: > > To pass ownership of a live vdpa device to a new process, the user > suspends the device, calls VHOST_NEW_OWNER to change the mm, and calls > VHOST_IOTLB_REMAP to change the user virtual addresses to match the new > mm. Flush workers in sus

Re: [RFC V1 09/13] vdpa_sim: reset must not run

2024-01-16 Thread Eugenio Perez Martin
On Wed, Jan 10, 2024 at 9:40 PM Steve Sistare wrote: > > vdpasim_do_reset sets running to true, which is wrong, as it allows > vdpasim_kick_vq to post work requests before the device has been > configured. To fix, do not set running until VIRTIO_CONFIG_S_FEATURES_OK > is set. > > Signed-off-by: S

Re: [RFC V1 05/13] vhost-vdpa: VHOST_IOTLB_REMAP

2024-01-16 Thread Eugenio Perez Martin
On Wed, Jan 10, 2024 at 9:40 PM Steve Sistare wrote: > > When device ownership is passed to a new process via VHOST_NEW_OWNER, > some devices need to know the new userland addresses of the dma mappings. > Define the new iotlb message type VHOST_IOTLB_REMAP to update the uaddr > of a mapping. The

Re: [PATCH v7 2/3] vduse: Temporarily fail if control queue feature requested

2024-01-09 Thread Eugenio Perez Martin
On Tue, Jan 9, 2024 at 12:11 PM Maxime Coquelin wrote: > > Virtio-net driver control queue implementation is not safe > when used with VDUSE. If the VDUSE application does not > reply to control queue messages, it currently ends up > hanging the kernel thread sending this command. > > Some work is

Re: [PATCH v6 3/3] vduse: enable Virtio-net device type

2024-01-05 Thread Eugenio Perez Martin
On Thu, Jan 4, 2024 at 4:39 PM Maxime Coquelin wrote: > > This patch adds Virtio-net device type to the supported > devices types. > > Initialization fails if the device does not support > VIRTIO_F_VERSION_1 feature, in order to guarantee the > configuration space is read-only. It also fails with

Re: [PATCH v6 2/3] vduse: Temporarily fail if control queue features requested

2024-01-05 Thread Eugenio Perez Martin
On Fri, Jan 5, 2024 at 9:12 AM Maxime Coquelin wrote: > > > > On 1/5/24 03:45, Jason Wang wrote: > > On Thu, Jan 4, 2024 at 11:38 PM Maxime Coquelin > > wrote: > >> > >> Virtio-net driver control queue implementation is not safe > >> when used with VDUSE. If the VDUSE application does not > >> re

Re: [PATCH v6 1/3] vduse: validate block features only with block devices

2024-01-05 Thread Eugenio Perez Martin
On Thu, Jan 4, 2024 at 4:38 PM Maxime Coquelin wrote: > > This patch is preliminary work to enable network device > type support to VDUSE. > > As VIRTIO_BLK_F_CONFIG_WCE shares the same value as > VIRTIO_NET_F_HOST_TSO4, we need to restrict its check > to Virtio-blk device type. > > Acked-by: Jaso

Re: [PATCH net-next 6/6] tools: virtio: introduce vhost_net_test

2024-01-04 Thread Eugenio Perez Martin
On Wed, Jan 3, 2024 at 11:00 AM Yunsheng Lin wrote: > > introduce vhost_net_test basing on virtio_test to test > vhost_net changing in the kernel. > > Signed-off-by: Yunsheng Lin > --- > tools/virtio/Makefile | 8 +- > tools/virtio/vhost_net_test.c | 574 +++

Re: [PATCH vhost v4 02/15] vdpa: Add VHOST_BACKEND_F_CHANGEABLE_VQ_ADDR_IN_SUSPEND flag

2023-12-21 Thread Eugenio Perez Martin
On Thu, Dec 21, 2023 at 4:07 PM Dragos Tatulea wrote: > > On Thu, 2023-12-21 at 15:55 +0100, Eugenio Perez Martin wrote: > > On Thu, Dec 21, 2023 at 3:38 PM Dragos Tatulea wrote: > > > > > > On Thu, 2023-12-21 at 13:08 +0100, Eugenio Perez Martin wrote: > >

Re: [PATCH vhost v4 02/15] vdpa: Add VHOST_BACKEND_F_CHANGEABLE_VQ_ADDR_IN_SUSPEND flag

2023-12-21 Thread Eugenio Perez Martin
On Thu, Dec 21, 2023 at 3:38 PM Dragos Tatulea wrote: > > On Thu, 2023-12-21 at 13:08 +0100, Eugenio Perez Martin wrote: > > On Thu, Dec 21, 2023 at 12:52 PM Dragos Tatulea wrote: > > > > > > On Thu, 2023-12-21 at 08:46 +0100, Eugenio Perez Martin wrote: > >

Re: [PATCH vhost v4 02/15] vdpa: Add VHOST_BACKEND_F_CHANGEABLE_VQ_ADDR_IN_SUSPEND flag

2023-12-21 Thread Eugenio Perez Martin
On Thu, Dec 21, 2023 at 12:52 PM Dragos Tatulea wrote: > > On Thu, 2023-12-21 at 08:46 +0100, Eugenio Perez Martin wrote: > > On Thu, Dec 21, 2023 at 3:03 AM Jason Wang wrote: > > > > > > On Wed, Dec 20, 2023 at 9:32 PM Eugenio Perez Martin > > > wrote: &g

Re: [PATCH vhost v4 02/15] vdpa: Add VHOST_BACKEND_F_CHANGEABLE_VQ_ADDR_IN_SUSPEND flag

2023-12-20 Thread Eugenio Perez Martin
On Thu, Dec 21, 2023 at 3:03 AM Jason Wang wrote: > > On Wed, Dec 20, 2023 at 9:32 PM Eugenio Perez Martin > wrote: > > > > On Wed, Dec 20, 2023 at 5:06 AM Jason Wang wrote: > > > > > > On Wed, Dec 20, 2023 at 11:46 AM Jason Wang wrote: > > >

Re: [PATCH vhost v4 08/15] vdpa: Block vq state change in DRIVER_OK unless device supports it

2023-12-20 Thread Eugenio Perez Martin
On Tue, Dec 19, 2023 at 7:10 PM Dragos Tatulea wrote: > > Virtqueue state change during DRIVE_OK is not supported by the virtio > standard. Allow this op in DRIVER_OK only for devices that support > changing the state during DRIVER_OK if the device is suspended. > > Signed-off-by: Dragos Tatulea

Re: [PATCH vhost v4 07/15] vdpa: Block vq address change in DRIVER_OK unless device supports it

2023-12-20 Thread Eugenio Perez Martin
On Tue, Dec 19, 2023 at 7:09 PM Dragos Tatulea wrote: > > Virtqueue address change during DRIVE_OK is not supported by the virtio > standard. Allow this op in DRIVER_OK only for devices that support > changing the address during DRIVER_OK if the device is suspended. > > Signed-off-by: Dragos Tatul

Re: [PATCH vhost v4 05/15] vdpa: Accept VHOST_BACKEND_F_CHANGEABLE_VQ_STATE_IN_SUSPEND backend feature

2023-12-20 Thread Eugenio Perez Martin
On Tue, Dec 19, 2023 at 7:09 PM Dragos Tatulea wrote: > > If userland sets this feature, allow it. > > Signed-off-by: Dragos Tatulea > Suggested-by: Eugenio Pérez Acked-by: Eugenio Pérez > --- > drivers/vhost/vdpa.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/vhost/vdpa.

Re: [PATCH vhost v4 04/15] vdpa: Accept VHOST_BACKEND_F_CHANGEABLE_VQ_ADDR_IN_SUSPEND backend feature

2023-12-20 Thread Eugenio Perez Martin
On Tue, Dec 19, 2023 at 7:09 PM Dragos Tatulea wrote: > > If userland sets this feature, allow it. > > Signed-off-by: Dragos Tatulea > Suggested-by: Eugenio Pérez Acked-by: Eugenio Pérez > --- > drivers/vhost/vdpa.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/vhost/vdpa.

Re: [PATCH vhost v4 03/15] vdpa: Add VHOST_BACKEND_F_CHANGEABLE_VQ_STATE_IN_SUSPEND flag

2023-12-20 Thread Eugenio Perez Martin
On Tue, Dec 19, 2023 at 7:09 PM Dragos Tatulea wrote: > > The virtio spec doesn't allow changing virtqueue state after > DRIVER_OK. Some devices do support this operation when the device is > suspended. The VHOST_BACKEND_F_CHANGEABLE_VQ_STATE_IN_SUSPEND flag > advertises this support as a backend

Re: [PATCH vhost v4 02/15] vdpa: Add VHOST_BACKEND_F_CHANGEABLE_VQ_ADDR_IN_SUSPEND flag

2023-12-20 Thread Eugenio Perez Martin
On Tue, Dec 19, 2023 at 7:09 PM Dragos Tatulea wrote: > > The virtio spec doesn't allow changing virtqueue addresses after > DRIVER_OK. Some devices do support this operation when the device is > suspended. The VHOST_BACKEND_F_CHANGEABLE_VQ_ADDR_IN_SUSPEND flag > advertises this support as a backe

Re: [PATCH vhost v4 02/15] vdpa: Add VHOST_BACKEND_F_CHANGEABLE_VQ_ADDR_IN_SUSPEND flag

2023-12-20 Thread Eugenio Perez Martin
On Wed, Dec 20, 2023 at 5:06 AM Jason Wang wrote: > > On Wed, Dec 20, 2023 at 11:46 AM Jason Wang wrote: > > > > On Wed, Dec 20, 2023 at 2:09 AM Dragos Tatulea wrote: > > > > > > The virtio spec doesn't allow changing virtqueue addresses after > > > DRIVER_OK. Some devices do support this operat

Re: [PATCH vhost v2 4/8] vdpa/mlx5: Mark vq addrs for modification in hw vq

2023-12-19 Thread Eugenio Perez Martin
On Tue, Dec 19, 2023 at 12:16 PM Dragos Tatulea wrote: > > On Tue, 2023-12-19 at 08:24 +0100, Eugenio Perez Martin wrote: > > On Mon, Dec 18, 2023 at 2:58 PM Dragos Tatulea wrote: > > > > > > On Mon, 2023-12-18 at 13:06 +0100, Eugenio Perez Martin wrote: > >

Re: [PATCH vhost v2 4/8] vdpa/mlx5: Mark vq addrs for modification in hw vq

2023-12-18 Thread Eugenio Perez Martin
On Mon, Dec 18, 2023 at 2:58 PM Dragos Tatulea wrote: > > On Mon, 2023-12-18 at 13:06 +0100, Eugenio Perez Martin wrote: > > On Mon, Dec 18, 2023 at 11:52 AM Dragos Tatulea wrote: > > > > > > On Mon, 2023-12-18 at 11:16 +0100, Eugenio Perez Martin wrote: > >

Re: [PATCH vhost v2 4/8] vdpa/mlx5: Mark vq addrs for modification in hw vq

2023-12-18 Thread Eugenio Perez Martin
On Mon, Dec 18, 2023 at 11:52 AM Dragos Tatulea wrote: > > On Mon, 2023-12-18 at 11:16 +0100, Eugenio Perez Martin wrote: > > On Sat, Dec 16, 2023 at 12:03 PM Dragos Tatulea wrote: > > > > > > On Fri, 2023-12-15 at 18:56 +0100, Eugenio Perez Martin wrote: > >

Re: [PATCH vhost v2 4/8] vdpa/mlx5: Mark vq addrs for modification in hw vq

2023-12-18 Thread Eugenio Perez Martin
On Sat, Dec 16, 2023 at 12:03 PM Dragos Tatulea wrote: > > On Fri, 2023-12-15 at 18:56 +0100, Eugenio Perez Martin wrote: > > On Fri, Dec 15, 2023 at 3:13 PM Dragos Tatulea wrote: > > > > > > On Fri, 2023-12-15 at 12:35 +, Dragos Tatulea wrote: > > &

Re: [PATCH vhost v2 4/8] vdpa/mlx5: Mark vq addrs for modification in hw vq

2023-12-15 Thread Eugenio Perez Martin
On Fri, Dec 15, 2023 at 3:13 PM Dragos Tatulea wrote: > > On Fri, 2023-12-15 at 12:35 +, Dragos Tatulea wrote: > > On Thu, 2023-12-14 at 19:30 +0100, Eugenio Perez Martin wrote: > > > On Thu, Dec 14, 2023 at 4:51 PM Dragos Tatulea > > > wrote: > > >

Re: [PATCH vhost v2 4/8] vdpa/mlx5: Mark vq addrs for modification in hw vq

2023-12-14 Thread Eugenio Perez Martin
gt; > > On 12/12/2023 11:21 AM, Eugenio Perez Martin wrote: > > > > > On Tue, Dec 5, 2023 at 11:46 AM Dragos Tatulea > > > > > wrote: > > > > > > Addresses get set by .set_vq_address. hw vq addresses will be > > > >

Re: [PATCH vhost v2 6/8] vdpa/mlx5: Use vq suspend/resume during .set_map

2023-12-12 Thread Eugenio Perez Martin
On Tue, Dec 5, 2023 at 11:47 AM Dragos Tatulea wrote: > > Instead of tearing down and setting up vq resources, use vq > suspend/resume during .set_map to speed things up a bit. > > The vq mr is updated with the new mapping while the vqs are suspended. > > If the device doesn't support resumable vq

Re: [PATCH vhost v2 4/8] vdpa/mlx5: Mark vq addrs for modification in hw vq

2023-12-12 Thread Eugenio Perez Martin
On Tue, Dec 5, 2023 at 11:46 AM Dragos Tatulea wrote: > > Addresses get set by .set_vq_address. hw vq addresses will be updated on > next modify_virtqueue. > > Signed-off-by: Dragos Tatulea > Reviewed-by: Gal Pressman > Acked-by: Eugenio Pérez I'm kind of ok with this patch and the next one ab

Re: [PATCH vhost v2 8/8] vdpa/mlx5: Add mkey leak detection

2023-12-12 Thread Eugenio Perez Martin
On Tue, Dec 5, 2023 at 11:47 AM Dragos Tatulea wrote: > > Track allocated mrs in a list and show warning when leaks are detected > on device free or reset. > > Signed-off-by: Dragos Tatulea > Reviewed-by: Gal Pressman Acked-by: Eugenio Pérez > --- > drivers/vdpa/mlx5/core/mlx5_vdpa.h | 2 ++

Re: [PATCH vhost v2 7/8] vdpa/mlx5: Introduce reference counting to mrs

2023-12-12 Thread Eugenio Perez Martin
On Tue, Dec 5, 2023 at 11:47 AM Dragos Tatulea wrote: > > Deleting the old mr during mr update (.set_map) and then modifying the > vqs with the new mr is not a good flow for firmware. The firmware > expects that mkeys are deleted after there are no more vqs referencing > them. > > Introduce refere

Re: [PATCH vhost 6/7] vdpa/mlx5: Mark vq state for modification in hw vq

2023-12-01 Thread Eugenio Perez Martin
On Fri, Dec 1, 2023 at 11:50 AM Dragos Tatulea wrote: > > .set_vq_state will set the indices and mark the fields to be modified in > the hw vq. > > Signed-off-by: Dragos Tatulea Acked-by: Eugenio Pérez > --- > drivers/vdpa/mlx5/net/mlx5_vnet.c | 8 > include/linux/mlx5/mlx5_ifc_vdpa

Re: [PATCH vhost 4/7] vdpa/mlx5: Introduce per vq and device resume

2023-12-01 Thread Eugenio Perez Martin
On Fri, Dec 1, 2023 at 11:50 AM Dragos Tatulea wrote: > > Implement vdpa vq and device resume if capability detected. Add support > for suspend -> ready state change. > > Signed-off-by: Dragos Tatulea Acked-by: Eugenio Pérez > --- > drivers/vdpa/mlx5/net/mlx5_vnet.c | 67 +

Re: [PATCH vhost 3/7] vdpa/mlx5: Allow modifying multiple vq fields in one modify command

2023-12-01 Thread Eugenio Perez Martin
On Fri, Dec 1, 2023 at 11:49 AM Dragos Tatulea wrote: > > Add a bitmask variable that tracks hw vq field changes that > are supposed to be modified on next hw vq change command. > > This will be useful to set multiple vq fields when resuming the vq. > > The state needs to remain as a parameter as

Re: [PATCH vhost 2/7] vdpa/mlx5: Split function into locked and unlocked variants

2023-12-01 Thread Eugenio Perez Martin
On Fri, Dec 1, 2023 at 11:49 AM Dragos Tatulea wrote: > > mlx5_vdpa_destroy_mr contains more logic than _mlx5_vdpa_destroy_mr. > There is no reason for this to be the case. All the logic can go into > the unlocked variant. > > Using the unlocked version is needed in a follow-up patch. And it also

Re: [PATCH 21/21] vdpasim: control virtqueue support

2021-01-22 Thread Eugenio Perez Martin
On Tue, Jan 12, 2021 at 4:12 AM Jason Wang wrote: > > > On 2021/1/11 下午8:26, Eli Cohen wrote: > > On Wed, Dec 16, 2020 at 02:48:18PM +0800, Jason Wang wrote: > >> This patch introduces the control virtqueue support for vDPA > >> simulator. This is a requirement for supporting advanced features lik

Re: [RFC PATCH 13/24] vhost-vdpa: introduce ASID based IOTLB

2020-09-29 Thread Eugenio Perez Martin
On Thu, Sep 24, 2020 at 5:24 AM Jason Wang wrote: > > This patch introduces the support of ASID based IOTLB by tagging IOTLB > with a unique ASID. This is a must for supporting ASID based vhost > IOTLB API by the following patches. > > IOTLB were stored in a hlist and new IOTLB will be allocated w

Re: [RFC PATCH 08/24] vdpa: introduce virtqueue groups

2020-09-28 Thread Eugenio Perez Martin
On Thu, Sep 24, 2020 at 5:23 AM Jason Wang wrote: > > This patch introduces virtqueue groups to vDPA device. The virtqueue > group is the minimal set of virtqueues that must share an address > space. And the adddress space identifier could only be attached to > a specific virtqueue group. > > A ne

Re: [RFC PATCH 18/24] vhost-vdpa: support ASID based IOTLB API

2020-09-28 Thread Eugenio Perez Martin
On Thu, Sep 24, 2020 at 5:25 AM Jason Wang wrote: > > This patch extends the vhost-vdpa to support ASID based IOTLB API. The > vhost-vdpa device will allocated multple IOTLBs for vDPA device that > supports multiple address spaces. The IOTLBs and vDPA device memory > mappings is determined and mai

Re: [PATCH RFC v8 02/11] vhost: use batched get_vq_desc version

2020-07-29 Thread Eugenio Perez Martin
On Tue, Jul 21, 2020 at 4:55 AM Jason Wang wrote: > > > On 2020/7/20 下午7:16, Eugenio Pérez wrote: > > On Mon, Jul 20, 2020 at 11:27 AM Michael S. Tsirkin wrote: > >> On Thu, Jul 16, 2020 at 07:16:27PM +0200, Eugenio Perez Martin wrote: > >>> On Fri, Jul 10

Re: [PATCH RFC v8 02/11] vhost: use batched get_vq_desc version

2020-07-20 Thread Eugenio Perez Martin
On Mon, Jul 20, 2020 at 10:55 AM Jason Wang wrote: > > > On 2020/7/17 上午1:16, Eugenio Perez Martin wrote: > > On Fri, Jul 10, 2020 at 7:58 AM Michael S. Tsirkin wrote: > >> On Fri, Jul 10, 2020 at 07:39:26AM +0200, Eugenio Perez Martin wrote: > >>>>> H

Re: [PATCH RFC v8 02/11] vhost: use batched get_vq_desc version

2020-07-16 Thread Eugenio Perez Martin
On Fri, Jul 10, 2020 at 7:58 AM Michael S. Tsirkin wrote: > > On Fri, Jul 10, 2020 at 07:39:26AM +0200, Eugenio Perez Martin wrote: > > > > How about playing with the batch size? Make it a mod parameter instead > > > > of the hard coded 64, and

  1   2   >