Re: Reducing vdpa migration downtime because of memory pin / maps

2023-07-19 Thread Si-Wei Liu
On 7/19/2023 3:40 AM, Eugenio Perez Martin wrote: On Mon, Jul 17, 2023 at 9:57 PM Si-Wei Liu wrote: Hey, I am now back from the break. Sorry for the delayed response, please see in line. On 7/9/2023 11:04 PM, Eugenio Perez Martin wrote: On Sat, Jul 8, 2023 at 11:14 AM Si-Wei Liu wrote

Re: [PATCH 1/2] Reduce vdpa initialization / startup overhead

2023-07-21 Thread Si-Wei Liu
On 7/21/2023 3:39 AM, Eugenio Perez Martin wrote: On Tue, Jul 18, 2023 at 12:55 PM Michael S. Tsirkin wrote: On Thu, Apr 20, 2023 at 10:59:56AM +0200, Eugenio Perez Martin wrote: On Thu, Apr 20, 2023 at 7:25 AM Pei Li wrote: Hi all, My bad, I just submitted the kernel patch. If we are pa

Re: [RFC PATCH 07/12] vdpa: add vhost_vdpa_reset_queue

2023-07-21 Thread Si-Wei Liu
On 7/20/2023 11:14 AM, Eugenio Pérez wrote: Split out vq reset operation in its own function, as it may be called with ring reset. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 16 1 file changed, 16 insertions(+) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virt

Re: [RFC PATCH 11/12] vdpa: use SVQ to stall dataplane while NIC state is being restored

2023-07-21 Thread Si-Wei Liu
On 7/20/2023 11:14 AM, Eugenio Pérez wrote: Some dynamic state of a virtio-net vDPA devices is restored from CVQ in the event of a live migration. However, dataplane needs to be disabled so the NIC does not receive buffers in the invalid ring. As a default method to achieve it, let's offer a

[PATCH 00/12] Preparatory patches for live migration downtime improvement

2024-02-14 Thread Si-Wei Liu
://lore.kernel.org/qemu-devel/1701970793-6865-1-git-send-email-si-wei@oracle.com/ --- Si-Wei Liu (12): vdpa: add back vhost_vdpa_net_first_nc_vdpa vdpa: no repeat setting shadow_data vdpa: factor out vhost_vdpa_last_dev vdpa: factor out vhost_vdpa_net_get_nc_vdpa vdpa: add

[PATCH 02/12] vdpa: no repeat setting shadow_data

2024-02-14 Thread Si-Wei Liu
space. Reviewed-by: Eugenio Pérez Acked-by: Jason Wang Signed-off-by: Si-Wei Liu --- net/vhost-vdpa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 4479ffa..06c83b4 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -354,13

[PATCH 12/12] vdpa: fix network breakage after cancelling migration

2024-02-14 Thread Si-Wei Liu
oning period, the shadow_vqs_enabled hadn't been set back to false yet, causing the installation of call fd inadvertently bypassed. Fixes: a8ac88585da1 ("vhost: Add Shadow VirtQueue call forwarding capabilities") Cc: Eugenio Pérez Acked-by: Jason Wang Signed-off-by: Si-Wei Liu

[PATCH 11/12] vdpa: indicate transitional state for SVQ switching

2024-02-14 Thread Si-Wei Liu
svq_switching indicates the transitional state whether or not SVQ mode switching is in progress, and towards which direction. Add the neccessary state around where the switching would take place. Signed-off-by: Si-Wei Liu --- net/vhost-vdpa.c | 3 +++ 1 file changed, 3 insertions(+) diff --git

[PATCH 05/12] vdpa: add vhost_vdpa_set_address_space_id trace

2024-02-14 Thread Si-Wei Liu
For better debuggability and observability. Reviewed-by: Eugenio Pérez Signed-off-by: Si-Wei Liu --- net/trace-events | 3 +++ net/vhost-vdpa.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/net/trace-events b/net/trace-events index 823a071..aab666a 100644 --- a/net/trace-events +++ b

[PATCH 03/12] vdpa: factor out vhost_vdpa_last_dev

2024-02-14 Thread Si-Wei Liu
Generalize duplicated condition check for the last vq of vdpa device to a common function. Reviewed-by: Eugenio Pérez Acked-by: Jason Wang Signed-off-by: Si-Wei Liu --- hw/virtio/vhost-vdpa.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b

[PATCH 06/12] vdpa: add vhost_vdpa_get_vring_base trace for svq mode

2024-02-14 Thread Si-Wei Liu
For better debuggability and observability. Reviewed-by: Eugenio Pérez Acked-by: Jason Wang Signed-off-by: Si-Wei Liu --- hw/virtio/trace-events | 2 +- hw/virtio/vhost-vdpa.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/virtio/trace-events b/hw/virtio/trace

[PATCH 09/12] vdpa: add trace event for vhost_vdpa_net_load_mq

2024-02-14 Thread Si-Wei Liu
For better debuggability and observability. Reviewed-by: Eugenio Pérez Signed-off-by: Si-Wei Liu --- net/trace-events | 1 + net/vhost-vdpa.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/net/trace-events b/net/trace-events index 88f56f2..cda960f 100644 --- a/net/trace-events +++ b

[PATCH 01/12] vdpa: add back vhost_vdpa_net_first_nc_vdpa

2024-02-14 Thread Si-Wei Liu
Previous commits had it removed. Now adding it back because this function will be needed by future patches. Reviewed-by: Eugenio Pérez Signed-off-by: Si-Wei Liu --- net/vhost-vdpa.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/net/vhost-vdpa.c b/net

[PATCH 10/12] vdpa: define SVQ transitioning state for mode switching

2024-02-14 Thread Si-Wei Liu
Will be used in following patches. DISABLING(-1) means SVQ is being switched off to passthrough mode. ENABLING(1) means passthrough VQs are being switched to SVQ. DONE(0) means SVQ switching is completed. Signed-off-by: Si-Wei Liu --- include/hw/virtio/vhost-vdpa.h | 9 + 1 file

[PATCH 08/12] vdpa: add trace events for vhost_vdpa_net_load_cmd

2024-02-14 Thread Si-Wei Liu
For better debuggability and observability. Reviewed-by: Eugenio Pérez Signed-off-by: Si-Wei Liu --- net/trace-events | 2 ++ net/vhost-vdpa.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/net/trace-events b/net/trace-events index aab666a..88f56f2 100644 --- a/net/trace-events +++ b

[PATCH 04/12] vdpa: factor out vhost_vdpa_net_get_nc_vdpa

2024-02-14 Thread Si-Wei Liu
Introduce new API. No functional change on existing API. Acked-by: Jason Wang Signed-off-by: Si-Wei Liu --- net/vhost-vdpa.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 06c83b4..4168cad 100644 --- a/net/vhost

[PATCH 07/12] vdpa: add vhost_vdpa_set_dev_vring_base trace for svq mode

2024-02-14 Thread Si-Wei Liu
For better debuggability and observability. Reviewed-by: Eugenio Pérez Acked-by: Jason Wang Signed-off-by: Si-Wei Liu --- hw/virtio/trace-events | 2 +- hw/virtio/vhost-vdpa.c | 5 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/virtio/trace-events b/hw/virtio/trace

[PATCH v2 1/2] vhost: dirty log should be per backend type

2024-02-14 Thread Si-Wei Liu
: Si-Wei Liu --- hw/virtio/vhost.c | 49 + 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 2c9ac79..ef6d9b5 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -43,8 +43,8 @@ do

[PATCH v2 2/2] vhost: Perform memory section dirty scans once per iteration

2024-02-14 Thread Si-Wei Liu
ogger device goes away for some reason, the logger will be re-selected from the rest of vhost devices. Co-developed-by: Joao Martins Signed-off-by: Joao Martins Signed-off-by: Si-Wei Liu --- hw/virtio/vhost.c | 75 +++ include/hw/virtio/vhost

Re: [PATCH v2 6/7] vdpa: move iova_tree allocation to net_vhost_vdpa_init

2024-02-14 Thread Si-Wei Liu
Hi Michael, On 2/13/2024 2:22 AM, Michael S. Tsirkin wrote: On Mon, Feb 05, 2024 at 05:10:36PM -0800, Si-Wei Liu wrote: Hi Eugenio, I thought this new code looks good to me and the original issue I saw with x-svq=on should be gone. However, after rebase my tree on top of this, there's

Re: [PATCH v2 6/7] vdpa: move iova_tree allocation to net_vhost_vdpa_init

2024-02-14 Thread Si-Wei Liu
Siwei On 2/13/2024 8:26 AM, Eugenio Perez Martin wrote: On Tue, Feb 13, 2024 at 11:22 AM Michael S. Tsirkin wrote: On Mon, Feb 05, 2024 at 05:10:36PM -0800, Si-Wei Liu wrote: Hi Eugenio, I thought this new code looks good to me and the original issue I saw with x-svq=on should be gone. However,

Re: [PATCH v2 1/2] vhost: dirty log should be per backend type

2024-02-14 Thread Si-Wei Liu
Hi Michael, I'm taking off for 2+ weeks, but please feel free to provide comment and feedback while I'm off. I'll be checking emails still, and am about to address any opens as soon as I am back. Thanks, -Siwei On 2/14/2024 3:50 AM, Si-Wei Liu wrote: There could be a mix of

Re: [PATCH 04/12] vdpa: factor out vhost_vdpa_net_get_nc_vdpa

2024-02-14 Thread Si-Wei Liu
On 2/14/2024 10:54 AM, Eugenio Perez Martin wrote: On Wed, Feb 14, 2024 at 1:39 PM Si-Wei Liu wrote: Introduce new API. No functional change on existing API. Acked-by: Jason Wang Signed-off-by: Si-Wei Liu I'm ok with the new function, but doesn't the compiler complain becaus

Re: [PATCH 1/6] vdpa: check for iova tree initialized at net_client_start

2024-01-31 Thread Si-Wei Liu
Hi Eugenio, Maybe there's some patch missing, but I saw this core dump when x-svq=on is specified while waiting for the incoming migration on destination host: (gdb) bt #0  0x5643b24cc13c in vhost_iova_tree_map_alloc (tree=0x0, map=map@entry=0x7ffd58c54830) at ../hw/virtio/vhost-iova-tree

Re: [PATCH v2 6/7] vdpa: move iova_tree allocation to net_vhost_vdpa_init

2024-02-05 Thread Si-Wei Liu
o move all its dependencies to the initialization too. In particular devices with x-svq=on need a valid iova_tree from the beginning. Simplify the code also consolidating the two creation points: the first data vq in case of SVQ active and CVQ start in case only CVQ uses it. Suggested-by: Si-Wei L

Re: [PATCH v4 1/2] vhost: dirty log should be per backend type

2024-03-20 Thread Si-Wei Liu
On 3/19/2024 8:25 PM, Jason Wang wrote: On Tue, Mar 19, 2024 at 6:06 AM Si-Wei Liu wrote: On 3/17/2024 8:20 PM, Jason Wang wrote: On Sat, Mar 16, 2024 at 2:33 AM Si-Wei Liu wrote: On 3/14/2024 8:50 PM, Jason Wang wrote: On Fri, Mar 15, 2024 at 5:39 AM Si-Wei Liu wrote: There could

Re: [PATCH v4 2/2] vhost: Perform memory section dirty scans once per iteration

2024-03-20 Thread Si-Wei Liu
On 3/19/2024 8:27 PM, Jason Wang wrote: On Tue, Mar 19, 2024 at 6:16 AM Si-Wei Liu wrote: On 3/17/2024 8:22 PM, Jason Wang wrote: On Sat, Mar 16, 2024 at 2:45 AM Si-Wei Liu wrote: On 3/14/2024 9:03 PM, Jason Wang wrote: On Fri, Mar 15, 2024 at 5:39 AM Si-Wei Liu wrote: On setups

Re: [PATCH v4 2/2] vhost: Perform memory section dirty scans once per iteration

2024-03-21 Thread Si-Wei Liu
On 3/20/2024 8:56 PM, Jason Wang wrote: On Thu, Mar 21, 2024 at 5:03 AM Si-Wei Liu wrote: On 3/19/2024 8:27 PM, Jason Wang wrote: On Tue, Mar 19, 2024 at 6:16 AM Si-Wei Liu wrote: On 3/17/2024 8:22 PM, Jason Wang wrote: On Sat, Mar 16, 2024 at 2:45 AM Si-Wei Liu wrote: On 3/14/2024

Re: [PATCH v4 2/2] vhost: Perform memory section dirty scans once per iteration

2024-03-22 Thread Si-Wei Liu
On 3/21/2024 10:08 PM, Jason Wang wrote: On Fri, Mar 22, 2024 at 5:43 AM Si-Wei Liu wrote: On 3/20/2024 8:56 PM, Jason Wang wrote: On Thu, Mar 21, 2024 at 5:03 AM Si-Wei Liu wrote: On 3/19/2024 8:27 PM, Jason Wang wrote: On Tue, Mar 19, 2024 at 6:16 AM Si-Wei Liu wrote: On 3/17

Re: [External] : Re: [PATCH v4 2/2] vhost: Perform memory section dirty scans once per iteration

2024-03-25 Thread Si-Wei Liu
On 3/24/2024 11:13 PM, Jason Wang wrote: On Sat, Mar 23, 2024 at 5:14 AM Si-Wei Liu wrote: On 3/21/2024 10:08 PM, Jason Wang wrote: On Fri, Mar 22, 2024 at 5:43 AM Si-Wei Liu wrote: On 3/20/2024 8:56 PM, Jason Wang wrote: On Thu, Mar 21, 2024 at 5:03 AM Si-Wei Liu wrote: On 3/19

Re: [PATCH v2 6/7] vdpa: move iova_tree allocation to net_vhost_vdpa_init

2024-04-01 Thread Si-Wei Liu
On 2/14/2024 11:11 AM, Eugenio Perez Martin wrote: On Wed, Feb 14, 2024 at 7:29 PM Si-Wei Liu wrote: Hi Michael, On 2/13/2024 2:22 AM, Michael S. Tsirkin wrote: On Mon, Feb 05, 2024 at 05:10:36PM -0800, Si-Wei Liu wrote: Hi Eugenio, I thought this new code looks good to me and the

Re: [PATCH v2 6/7] vdpa: move iova_tree allocation to net_vhost_vdpa_init

2024-04-02 Thread Si-Wei Liu
On 4/2/2024 5:01 AM, Eugenio Perez Martin wrote: On Tue, Apr 2, 2024 at 8:19 AM Si-Wei Liu wrote: On 2/14/2024 11:11 AM, Eugenio Perez Martin wrote: On Wed, Feb 14, 2024 at 7:29 PM Si-Wei Liu wrote: Hi Michael, On 2/13/2024 2:22 AM, Michael S. Tsirkin wrote: On Mon, Feb 05, 2024 at 05

Re: [PATCH 12/12] vdpa: fix network breakage after cancelling migration

2024-03-13 Thread Si-Wei Liu
On 3/13/2024 11:12 AM, Michael Tokarev wrote: 14.02.2024 14:28, Si-Wei Liu wrote: Fix an issue where cancellation of ongoing migration ends up with no network connectivity. When canceling migration, SVQ will be switched back to the passthrough mode, but the right call fd is not programed to

Re: [PATCH v2 1/2] vhost: dirty log should be per backend type

2024-03-13 Thread Si-Wei Liu
On 3/12/2024 8:07 AM, Michael S. Tsirkin wrote: On Wed, Feb 14, 2024 at 10:42:29AM -0800, Si-Wei Liu wrote: Hi Michael, I'm taking off for 2+ weeks, but please feel free to provide comment and feedback while I'm off. I'll be checking emails still, and am about to address an

[PATCH v3 2/2] vhost: Perform memory section dirty scans once per iteration

2024-03-14 Thread Si-Wei Liu
eues -> 8.71%[.] vhost_dev_sync_region.isra.13 2 devices, 8 queues -> 7.97% [.] vhost_dev_sync_region.isra.14 Co-developed-by: Joao Martins Signed-off-by: Joao Martins Signed-off-by: Si-Wei Liu --- v2 -> v3: - add after-fix benchmark to commit log - rename vhost_log_dev_enabled to

[PATCH v3 1/2] vhost: dirty log should be per backend type

2024-03-14 Thread Si-Wei Liu
: Si-Wei Liu --- v2->v3: - remove non-effective assertion that never be reached - do not return NULL from vhost_log_get() - add neccessary assertions to vhost_log_get() --- hw/virtio/vhost.c | 50 ++ 1 file changed, 38 insertions(+),

Re: [PATCH v3 2/2] vhost: Perform memory section dirty scans once per iteration

2024-03-14 Thread Si-Wei Liu
On 3/14/2024 8:34 AM, Eugenio Perez Martin wrote: On Thu, Mar 14, 2024 at 9:38 AM Si-Wei Liu wrote: On setups with one or more virtio-net devices with vhost on, dirty tracking iteration increases cost the bigger the number amount of queues are set up e.g. on idle guests migration the

Re: [PATCH v3 1/2] vhost: dirty log should be per backend type

2024-03-14 Thread Si-Wei Liu
On 3/14/2024 8:25 AM, Eugenio Perez Martin wrote: On Thu, Mar 14, 2024 at 9:38 AM Si-Wei Liu wrote: There could be a mix of both vhost-user and vhost-kernel clients in the same QEMU process, where separate vhost loggers for the specific vhost type have to be used. Make the vhost logger per

[PATCH v4 1/2] vhost: dirty log should be per backend type

2024-03-14 Thread Si-Wei Liu
: Si-Wei Liu --- v3->v4: - remove checking NULL return value from vhost_log_get v2->v3: - remove non-effective assertion that never be reached - do not return NULL from vhost_log_get() - add neccessary assertions to vhost_log_get() --- hw/virtio/vhost.

[PATCH v4 2/2] vhost: Perform memory section dirty scans once per iteration

2024-03-14 Thread Si-Wei Liu
eues -> 8.71%[.] vhost_dev_sync_region.isra.13 2 devices, 8 queues -> 7.97% [.] vhost_dev_sync_region.isra.14 Co-developed-by: Joao Martins Signed-off-by: Joao Martins Signed-off-by: Si-Wei Liu --- v3 -> v4: - add comment to clarify effect on cache locality and performance v2

Re: [PATCH v4 1/2] vhost: dirty log should be per backend type

2024-03-15 Thread Si-Wei Liu
On 3/14/2024 8:50 PM, Jason Wang wrote: On Fri, Mar 15, 2024 at 5:39 AM Si-Wei Liu wrote: There could be a mix of both vhost-user and vhost-kernel clients in the same QEMU process, where separate vhost loggers for the specific vhost type have to be used. Make the vhost logger per backend

Re: [PATCH v4 2/2] vhost: Perform memory section dirty scans once per iteration

2024-03-15 Thread Si-Wei Liu
On 3/14/2024 9:03 PM, Jason Wang wrote: On Fri, Mar 15, 2024 at 5:39 AM Si-Wei Liu wrote: On setups with one or more virtio-net devices with vhost on, dirty tracking iteration increases cost the bigger the number amount of queues are set up e.g. on idle guests migration the following is

Re: [PATCH v4 1/2] vhost: dirty log should be per backend type

2024-03-18 Thread Si-Wei Liu
On 3/17/2024 8:20 PM, Jason Wang wrote: On Sat, Mar 16, 2024 at 2:33 AM Si-Wei Liu wrote: On 3/14/2024 8:50 PM, Jason Wang wrote: On Fri, Mar 15, 2024 at 5:39 AM Si-Wei Liu wrote: There could be a mix of both vhost-user and vhost-kernel clients in the same QEMU process, where separate

Re: [PATCH v4 2/2] vhost: Perform memory section dirty scans once per iteration

2024-03-18 Thread Si-Wei Liu
On 3/17/2024 8:22 PM, Jason Wang wrote: On Sat, Mar 16, 2024 at 2:45 AM Si-Wei Liu wrote: On 3/14/2024 9:03 PM, Jason Wang wrote: On Fri, Mar 15, 2024 at 5:39 AM Si-Wei Liu wrote: On setups with one or more virtio-net devices with vhost on, dirty tracking iteration increases cost the

Re: [RFC 1/2] iova_tree: add an id member to DMAMap

2024-04-18 Thread Si-Wei Liu
On 4/10/2024 3:03 AM, Eugenio Pérez wrote: IOVA tree is also used to track the mappings of virtio-net shadow virtqueue. This mappings may not match with the GPA->HVA ones. This causes a problem when overlapped regions (different GPA but same translated HVA) exists in the tree, as looking the

Re: [RFC 1/2] iova_tree: add an id member to DMAMap

2024-04-19 Thread Si-Wei Liu
On 4/19/2024 1:29 AM, Eugenio Perez Martin wrote: On Thu, Apr 18, 2024 at 10:46 PM Si-Wei Liu wrote: On 4/10/2024 3:03 AM, Eugenio Pérez wrote: IOVA tree is also used to track the mappings of virtio-net shadow virtqueue. This mappings may not match with the GPA->HVA ones. This cause

Re: [RFC 1/2] iova_tree: add an id member to DMAMap

2024-04-23 Thread Si-Wei Liu
On 4/22/2024 1:49 AM, Eugenio Perez Martin wrote: On Sat, Apr 20, 2024 at 1:50 AM Si-Wei Liu wrote: On 4/19/2024 1:29 AM, Eugenio Perez Martin wrote: On Thu, Apr 18, 2024 at 10:46 PM Si-Wei Liu wrote: On 4/10/2024 3:03 AM, Eugenio Pérez wrote: IOVA tree is also used to track the

Re: [RFC 1/2] iova_tree: add an id member to DMAMap

2024-04-25 Thread Si-Wei Liu
On 4/24/2024 12:33 AM, Eugenio Perez Martin wrote: On Wed, Apr 24, 2024 at 12:21 AM Si-Wei Liu wrote: On 4/22/2024 1:49 AM, Eugenio Perez Martin wrote: On Sat, Apr 20, 2024 at 1:50 AM Si-Wei Liu wrote: On 4/19/2024 1:29 AM, Eugenio Perez Martin wrote: On Thu, Apr 18, 2024 at 10:46 PM

Re: [RFC 1/2] iova_tree: add an id member to DMAMap

2024-04-29 Thread Si-Wei Liu
On 4/29/2024 1:14 AM, Eugenio Perez Martin wrote: On Thu, Apr 25, 2024 at 7:44 PM Si-Wei Liu wrote: On 4/24/2024 12:33 AM, Eugenio Perez Martin wrote: On Wed, Apr 24, 2024 at 12:21 AM Si-Wei Liu wrote: On 4/22/2024 1:49 AM, Eugenio Perez Martin wrote: On Sat, Apr 20, 2024 at 1:50 AM

Re: [RFC 1/2] iova_tree: add an id member to DMAMap

2024-05-01 Thread Si-Wei Liu
On 4/30/2024 11:11 AM, Eugenio Perez Martin wrote: On Mon, Apr 29, 2024 at 1:19 PM Jonah Palmer wrote: On 4/29/24 4:14 AM, Eugenio Perez Martin wrote: On Thu, Apr 25, 2024 at 7:44 PM Si-Wei Liu wrote: On 4/24/2024 12:33 AM, Eugenio Perez Martin wrote: On Wed, Apr 24, 2024 at 12

Re: [RFC 1/2] iova_tree: add an id member to DMAMap

2024-05-01 Thread Si-Wei Liu
On 4/30/2024 10:19 AM, Eugenio Perez Martin wrote: On Tue, Apr 30, 2024 at 7:55 AM Si-Wei Liu wrote: On 4/29/2024 1:14 AM, Eugenio Perez Martin wrote: On Thu, Apr 25, 2024 at 7:44 PM Si-Wei Liu wrote: On 4/24/2024 12:33 AM, Eugenio Perez Martin wrote: On Wed, Apr 24, 2024 at 12:21 AM

Re: [RFC 1/2] iova_tree: add an id member to DMAMap

2024-05-07 Thread Si-Wei Liu
On 5/1/2024 11:18 PM, Eugenio Perez Martin wrote: On Thu, May 2, 2024 at 12:09 AM Si-Wei Liu wrote: On 4/30/2024 11:11 AM, Eugenio Perez Martin wrote: On Mon, Apr 29, 2024 at 1:19 PM Jonah Palmer wrote: On 4/29/24 4:14 AM, Eugenio Perez Martin wrote: On Thu, Apr 25, 2024 at 7:44 PM

Re: [RFC 1/2] iova_tree: add an id member to DMAMap

2024-05-07 Thread Si-Wei Liu
On 5/1/2024 11:44 PM, Eugenio Perez Martin wrote: On Thu, May 2, 2024 at 1:16 AM Si-Wei Liu wrote: On 4/30/2024 10:19 AM, Eugenio Perez Martin wrote: On Tue, Apr 30, 2024 at 7:55 AM Si-Wei Liu wrote: On 4/29/2024 1:14 AM, Eugenio Perez Martin wrote: On Thu, Apr 25, 2024 at 7:44 PM Si

Re: [RFC v2 12/13] vdpa: preemptive kick at enable

2023-02-01 Thread Si-Wei Liu
On 1/13/2023 1:06 AM, Eugenio Perez Martin wrote: On Fri, Jan 13, 2023 at 4:39 AM Jason Wang wrote: On Fri, Jan 13, 2023 at 11:25 AM Zhu, Lingshan wrote: On 1/13/2023 10:31 AM, Jason Wang wrote: On Fri, Jan 13, 2023 at 1:27 AM Eugenio Pérez wrote: Spuriously kick the destination devic

Re: [RFC v2 00/13] Dinamycally switch to vhost shadow virtqueues at vdpa net migration

2023-02-01 Thread Si-Wei Liu
On 1/12/2023 9:24 AM, Eugenio Pérez wrote: It's possible to migrate vdpa net devices if they are shadowed from the start. But to always shadow the dataplane is effectively break its host passthrough, so its not convenient in vDPA scenarios. This series enables dynamically switching to sh

Re: [RFC v2 11/13] vdpa: add vdpa net migration state notifier

2023-02-01 Thread Si-Wei Liu
On 1/12/2023 9:24 AM, Eugenio Pérez wrote: This allows net to restart the device backend to configure SVQ on it. Ideally, these changes should not be net specific. However, the vdpa net backend is the one with enough knowledge to configure everything because of some reasons: * Queues might ne

Re: [PATCH v2 2/5] virtio-net: align ctrl_vq index for non-mq guest for vhost_vdpa

2022-04-29 Thread Si-Wei Liu
On 4/28/2022 7:23 PM, Jason Wang wrote: 在 2022/4/27 16:30, Si-Wei Liu 写道: With MQ enabled vdpa device and non-MQ supporting guest e.g. booting vdpa with mq=on over OVMF of single vqp, below assert failure is seen: ../hw/virtio/vhost-vdpa.c:560: vhost_vdpa_get_vq_index: Assertion `idx

Re: [PATCH v2 2/5] virtio-net: align ctrl_vq index for non-mq guest for vhost_vdpa

2022-04-29 Thread Si-Wei Liu
On 4/28/2022 7:24 PM, Jason Wang wrote: On Fri, Apr 29, 2022 at 10:24 AM Jason Wang wrote: 在 2022/4/27 16:30, Si-Wei Liu 写道: With MQ enabled vdpa device and non-MQ supporting guest e.g. booting vdpa with mq=on over OVMF of single vqp, below assert failure is seen: ../hw/virtio/vhost

Re: [PATCH 0/7] vhost-vdpa multiqueue fixes

2022-04-29 Thread Si-Wei Liu
On 4/28/2022 7:30 PM, Jason Wang wrote: On Wed, Apr 27, 2022 at 5:09 PM Si-Wei Liu wrote: On 4/27/2022 1:38 AM, Jason Wang wrote: On Wed, Apr 27, 2022 at 4:30 PM Si-Wei Liu wrote: On 4/26/2022 9:28 PM, Jason Wang wrote: 在 2022/3/30 14:33, Si-Wei Liu 写道: Hi, This patch series

[PATCH v3 5/6] vhost-vdpa: backend feature should set only once

2022-05-05 Thread Si-Wei Liu
t the beginning of operation. Document the requirement for it in place. Signed-off-by: Si-Wei Liu Acked-by: Jason Wang Acked-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/

[PATCH v3 3/6] vhost-vdpa: fix improper cleanup in net_init_vhost_vdpa

2022-05-05 Thread Si-Wei Liu
... such that no memory leaks on dangling net clients in case of error. Signed-off-by: Si-Wei Liu Acked-by: Jason Wang --- net/vhost-vdpa.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 1e9fe47..df1e69e 100644 --- a/net/vhost

[PATCH v3 2/6] virtio-net: align ctrl_vq index for non-mq guest for vhost_vdpa

2022-05-05 Thread Si-Wei Liu
for the control vq while MQ is not supported by guest. Fixes: 22288fe ("virtio-net: vhost control virtqueue support") Suggested-by: Jason Wang Signed-off-by: Si-Wei Liu --- hw/net/virtio-net.c | 33 +++-- 1 file changed, 31 insertions(+), 2 deletions(-

[PATCH v3 0/6] vhost-vdpa multiqueue fixes

2022-05-05 Thread Si-Wei Liu
band-aid fix for QEMU crash due to recursive call v2: - split off vhost_dev notifier patch from "align ctrl_vq index for non-mq guest for vhost_vdpa" - change assert to error message - rename vhost_vdpa_one_time_request to vhost_vdpa_first_dev for clarity Si-Wei Liu (6):

[PATCH v3 6/6] virtio-net: don't handle mq request in userspace handler for vhost-vdpa

2022-05-05 Thread Si-Wei Liu
handled in userspace is merged. Fixes: 402378407db ("vhost-vdpa: multiqueue support") Signed-off-by: Si-Wei Liu --- hw/net/virtio-net.c | 13 + 1 file changed, 13 insertions(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index f0bb29c..e263116 100644 --- a/hw/ne

[PATCH v3 1/6] virtio-net: setup vhost_dev and notifiers for cvq only when feature is negotiated

2022-05-05 Thread Si-Wei Liu
: 22288fe ("virtio-net: vhost control virtqueue support") Signed-off-by: Si-Wei Liu --- hw/net/virtio-net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 1067e72..ffb3475 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/vi

[PATCH v3 4/6] vhost-net: fix improper cleanup in vhost_net_start

2022-05-05 Thread Si-Wei Liu
vhost_net_start() missed a corresponding stop_one() upon error from vhost_set_vring_enable(). While at it, make the error handling for err_start more robust. No real issue was found due to this though. Signed-off-by: Si-Wei Liu Acked-by: Jason Wang --- hw/net/vhost_net.c | 4 +++- 1 file

[PATCH v4 1/7] virtio-net: setup vhost_dev and notifiers for cvq only when feature is negotiated

2022-05-06 Thread Si-Wei Liu
: 22288fe ("virtio-net: vhost control virtqueue support") Signed-off-by: Si-Wei Liu Acked-by: Jason Wang --- hw/net/virtio-net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 1067e72..ffb3475 100644 --- a/hw/net/virtio-n

[PATCH v4 6/7] vhost-vdpa: change name and polarity for vhost_vdpa_one_time_request()

2022-05-06 Thread Si-Wei Liu
etter readibility of code. That way it is able to reflect what the check is really about. This call is applicable to request which performs operation only once, before queues are set up, and usually at the beginning of the caller function. Document the requirement for it in place. Signed-off-by: S

[PATCH v4 0/7] vhost-vdpa multiqueue fixes

2022-05-06 Thread Si-Wei Liu
request to vhost_vdpa_first_dev for clarity --- Si-Wei Liu (7): virtio-net: setup vhost_dev and notifiers for cvq only when feature is negotiated virtio-net: align ctrl_vq index for non-mq guest for vhost_vdpa vhost-vdpa: fix improper cleanup in net_init_vhost_vdpa vhost-net: fix improper

[PATCH v4 3/7] vhost-vdpa: fix improper cleanup in net_init_vhost_vdpa

2022-05-06 Thread Si-Wei Liu
... such that no memory leaks on dangling net clients in case of error. Signed-off-by: Si-Wei Liu Acked-by: Jason Wang --- net/vhost-vdpa.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 1e9fe47..df1e69e 100644 --- a/net/vhost

[PATCH v4 2/7] virtio-net: align ctrl_vq index for non-mq guest for vhost_vdpa

2022-05-06 Thread Si-Wei Liu
for the control vq while MQ is not supported by guest. Fixes: 22288fe ("virtio-net: vhost control virtqueue support") Suggested-by: Jason Wang Signed-off-by: Si-Wei Liu Acked-by: Jason Wang --- hw/net/virtio-net.c | 33 +++-- 1 file changed, 31 insertion

[PATCH v4 4/7] vhost-net: fix improper cleanup in vhost_net_start

2022-05-06 Thread Si-Wei Liu
vhost_net_start() missed a corresponding stop_one() upon error from vhost_set_vring_enable(). While at it, make the error handling for err_start more robust. No real issue was found due to this though. Signed-off-by: Si-Wei Liu Acked-by: Jason Wang --- hw/net/vhost_net.c | 4 +++- 1 file

[PATCH v4 5/7] vhost-vdpa: backend feature should set only once

2022-05-06 Thread Si-Wei Liu
ix it, send down ioctl only once via the first vhost_dev with index 0. Toggle the polarity of the vhost_vdpa_one_time_request() test should do the trick. Fixes: 4d191cfdc7de ("vhost-vdpa: classify one time request") Signed-off-by: Si-Wei Liu Reviewed-by: Stefano Garzarella Acked-by: Jason

[PATCH v4 7/7] virtio-net: don't handle mq request in userspace handler for vhost-vdpa

2022-05-06 Thread Si-Wei Liu
handled in userspace is merged. Fixes: 402378407db ("vhost-vdpa: multiqueue support") Signed-off-by: Si-Wei Liu Acked-by: Jason Wang --- hw/net/virtio-net.c | 13 + 1 file changed, 13 insertions(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index f0bb29c..099e65

Re: [PATCH 4/5] virtio-net: Update virtio-net curr_queue_pairs in vdpa backends

2022-08-24 Thread Si-Wei Liu
On 8/23/2022 9:27 PM, Jason Wang wrote: 在 2022/8/20 01:13, Eugenio Pérez 写道: It was returned as error before. Instead of it, simply update the corresponding field so qemu can send it in the migration data. Signed-off-by: Eugenio Pérez --- Looks correct. Adding Si Wei for double check.

Re: [PATCH 4/5] virtio-net: Update virtio-net curr_queue_pairs in vdpa backends

2022-08-25 Thread Si-Wei Liu
Hi Jason, On 8/24/2022 7:53 PM, Jason Wang wrote: On Thu, Aug 25, 2022 at 8:38 AM Si-Wei Liu wrote: On 8/23/2022 9:27 PM, Jason Wang wrote: 在 2022/8/20 01:13, Eugenio Pérez 写道: It was returned as error before. Instead of it, simply update the corresponding field so qemu can send it in the

Re: [PATCH 4/5] virtio-net: Update virtio-net curr_queue_pairs in vdpa backends

2022-08-25 Thread Si-Wei Liu
On 8/24/2022 8:05 PM, Jason Wang wrote: On Thu, Aug 25, 2022 at 10:53 AM Jason Wang wrote: On Thu, Aug 25, 2022 at 8:38 AM Si-Wei Liu wrote: On 8/23/2022 9:27 PM, Jason Wang wrote: 在 2022/8/20 01:13, Eugenio Pérez 写道: It was returned as error before. Instead of it, simply update the

Re: [PATCH 4/5] virtio-net: Update virtio-net curr_queue_pairs in vdpa backends

2022-08-25 Thread Si-Wei Liu
On 8/24/2022 11:19 PM, Eugenio Perez Martin wrote: On Thu, Aug 25, 2022 at 2:38 AM Si-Wei Liu wrote: On 8/23/2022 9:27 PM, Jason Wang wrote: 在 2022/8/20 01:13, Eugenio Pérez 写道: It was returned as error before. Instead of it, simply update the corresponding field so qemu can send it in

Re: [RFC v2 11/13] vdpa: add vdpa net migration state notifier

2023-02-13 Thread Si-Wei Liu
On 2/13/2023 1:47 AM, Eugenio Perez Martin wrote: On Sat, Feb 4, 2023 at 3:04 AM Si-Wei Liu wrote: On 2/2/2023 7:28 AM, Eugenio Perez Martin wrote: On Thu, Feb 2, 2023 at 2:53 AM Si-Wei Liu wrote: On 1/12/2023 9:24 AM, Eugenio Pérez wrote: This allows net to restart the device

Re: [PATCH v2 01/13] vdpa net: move iova tree creation from init to start

2023-02-14 Thread Si-Wei Liu
On 2/13/2023 3:14 AM, Eugenio Perez Martin wrote: On Mon, Feb 13, 2023 at 7:51 AM Si-Wei Liu wrote: On 2/8/2023 1:42 AM, Eugenio Pérez wrote: Only create iova_tree if and when it is needed. The cleanup keeps being responsible of last VQ but this change allows it to merge both cleanup

Re: [PATCH v2 01/13] vdpa net: move iova tree creation from init to start

2023-02-15 Thread Si-Wei Liu
On 2/14/2023 11:07 AM, Eugenio Perez Martin wrote: On Tue, Feb 14, 2023 at 2:45 AM Si-Wei Liu wrote: On 2/13/2023 3:14 AM, Eugenio Perez Martin wrote: On Mon, Feb 13, 2023 at 7:51 AM Si-Wei Liu wrote: On 2/8/2023 1:42 AM, Eugenio Pérez wrote: Only create iova_tree if and when it is

Re: [PATCH v2 01/13] vdpa net: move iova tree creation from init to start

2023-02-16 Thread Si-Wei Liu
On 2/15/2023 11:35 PM, Eugenio Perez Martin wrote: On Thu, Feb 16, 2023 at 3:15 AM Si-Wei Liu wrote: On 2/14/2023 11:07 AM, Eugenio Perez Martin wrote: On Tue, Feb 14, 2023 at 2:45 AM Si-Wei Liu wrote: On 2/13/2023 3:14 AM, Eugenio Perez Martin wrote: On Mon, Feb 13, 2023 at 7:51 AM

[PATCH] vhost-vdpa: fix assert !virtio_net_get_subqueue(nc)->async_tx.elem in virtio_net_reset

2022-10-04 Thread Si-Wei Liu
qemu_sendv_packet_async() returns non-zero in virtio_net_flush_tx(). Fixes: 846a1e85da64 ("vdpa: Add dummy receive callback") Cc: Eugenio Perez Martin Signed-off-by: Si-Wei Liu --- net/vhost-vdpa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/vhost-vdpa.c b/net/vh

[PATCH] vhost-vdpa: allow passing opened vhostfd to vhost-vdpa

2022-10-04 Thread Si-Wei Liu
type=vhost-vdpa,vhostfd=61,id=vhost-vdpa1 Signed-off-by: Si-Wei Liu --- net/vhost-vdpa.c | 25 - qapi/net.json| 3 +++ qemu-options.hx | 6 -- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 182b3a1..36

[PATCH] vhost-vdpa: fix assert !virtio_net_get_subqueue(nc)->async_tx.elem in virtio_net_reset

2022-10-04 Thread Si-Wei Liu
qemu_sendv_packet_async() returns non-zero in virtio_net_flush_tx(). Fixes: 846a1e85da64 ("vdpa: Add dummy receive callback") Cc: Eugenio Perez Martin Signed-off-by: Si-Wei Liu --- net/vhost-vdpa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/vhost-vdpa.c b/net/vh

Re: [PATCH] vhost-vdpa: fix assert !virtio_net_get_subqueue(nc)->async_tx.elem in virtio_net_reset

2022-10-04 Thread Si-Wei Liu
12:58 PM, Si-Wei Liu wrote: The citing commit has incorrect code in vhost_vdpa_receive() that returns zero instead of full packet size to the caller. This renders pending packets unable to be freed so then get clogged in the tx queue forever. When device is being reset later on, below assertion f

Re: [PATCH 2/3] vdpa: load vlan configuration at NIC startup

2022-10-04 Thread Si-Wei Liu
On 9/29/2022 12:13 AM, Michael S. Tsirkin wrote: On Wed, Sep 21, 2022 at 04:00:58PM -0700, Si-Wei Liu wrote: The spec doesn't explicitly say anything about that as far as I see. Here the spec is totally ruled by the (software artifact of) implementation rather than what a real devi

Re: [PATCH v2] vhost-vdpa: allow passing opened vhostfd to vhost-vdpa

2022-10-27 Thread Si-Wei Liu
Hi Jason, Sorry for top posting, but are you going to queue this patch? It looks like the discussion has been settled and no further comment I got for 2 weeks for this patch. Thanks, -Siwei On 10/13/2022 4:12 PM, Si-Wei Liu wrote: Jason, On 10/12/2022 10:02 PM, Jason Wang wrote: 在 2022

Re: [PATCH v2] vhost-vdpa: allow passing opened vhostfd to vhost-vdpa

2022-10-28 Thread Si-Wei Liu
On 10/27/2022 6:50 PM, Jason Wang wrote: On Fri, Oct 28, 2022 at 5:56 AM Si-Wei Liu wrote: Hi Jason, Sorry for top posting, but are you going to queue this patch? It looks like the discussion has been settled and no further comment I got for 2 weeks for this patch. Yes, I've queued

Re: [PATCH] vhost-vdpa: fix assert !virtio_net_get_subqueue(nc)->async_tx.elem in virtio_net_reset

2022-10-28 Thread Si-Wei Liu
Hi Jason, This one is a one-line simple bug fix but seems to be missed from the pull request. If there's a v2 for the PULL, would appreciate if you can piggyback. Thanks in advance! Regards, -Siwei On 10/7/2022 8:42 AM, Eugenio Perez Martin wrote: On Tue, Oct 4, 2022 at 11:05 PM Si-We

Re: [RFC v2 00/13] Dinamycally switch to vhost shadow virtqueues at vdpa net migration

2023-02-02 Thread Si-Wei Liu
On 2/2/2023 3:27 AM, Eugenio Perez Martin wrote: On Thu, Feb 2, 2023 at 2:00 AM Si-Wei Liu wrote: On 1/12/2023 9:24 AM, Eugenio Pérez wrote: It's possible to migrate vdpa net devices if they are shadowed from the start. But to always shadow the dataplane is effectively break its

Re: [RFC v2 11/13] vdpa: add vdpa net migration state notifier

2023-02-03 Thread Si-Wei Liu
On 2/2/2023 7:28 AM, Eugenio Perez Martin wrote: On Thu, Feb 2, 2023 at 2:53 AM Si-Wei Liu wrote: On 1/12/2023 9:24 AM, Eugenio Pérez wrote: This allows net to restart the device backend to configure SVQ on it. Ideally, these changes should not be net specific. However, the vdpa net

Re: [RFC v2 12/13] vdpa: preemptive kick at enable

2023-02-04 Thread Si-Wei Liu
On 2/2/2023 8:53 AM, Eugenio Perez Martin wrote: On Thu, Feb 2, 2023 at 1:57 AM Si-Wei Liu wrote: On 1/13/2023 1:06 AM, Eugenio Perez Martin wrote: On Fri, Jan 13, 2023 at 4:39 AM Jason Wang wrote: On Fri, Jan 13, 2023 at 11:25 AM Zhu, Lingshan wrote: On 1/13/2023 10:31 AM, Jason

Re: [RFC v2 12/13] vdpa: preemptive kick at enable

2023-02-05 Thread Si-Wei Liu
On 2/5/2023 2:00 AM, Michael S. Tsirkin wrote: On Sat, Feb 04, 2023 at 03:04:02AM -0800, Si-Wei Liu wrote: For network hardware device, I thought suspend just needs to wait until the completion of ongoing Tx/Rx DMA transaction already in the flight, rather than to drain all the upcoming

Re: [PATCH v2 01/13] vdpa net: move iova tree creation from init to start

2023-02-12 Thread Si-Wei Liu
On 2/8/2023 1:42 AM, Eugenio Pérez wrote: Only create iova_tree if and when it is needed. The cleanup keeps being responsible of last VQ but this change allows it to merge both cleanup functions. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- net/vhost-vdpa.c | 99

Re: [PATCH v2 09/13] vdpa net: block migration if the device has CVQ

2023-02-12 Thread Si-Wei Liu
On 2/8/2023 1:42 AM, Eugenio Pérez wrote: Devices with CVQ needs to migrate state beyond vq state. Leaving this to future series. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index bca13f97

Re: [PATCH v2 07/13] vdpa: add vdpa net migration state notifier

2023-02-12 Thread Si-Wei Liu
On 2/8/2023 1:42 AM, Eugenio Pérez wrote: This allows net to restart the device backend to configure SVQ on it. Ideally, these changes should not be net specific. However, the vdpa net backend is the one with enough knowledge to configure everything because of some reasons: * Queues might need

Re: [PATCH v4 07/15] vdpa: add vhost_vdpa_suspend

2023-02-28 Thread Si-Wei Liu
On 2/24/2023 7:54 AM, Eugenio Pérez wrote: The function vhost.c:vhost_dev_stop fetches the vring base so the vq state can be migrated to other devices. However, this is unreliable in vdpa, since we didn't signal the device to suspend the queues, making the value fetched useless. Suspend the

Re: [RFC 1/2] vhost-vdpa: Decouple the IOVA allocator

2024-08-29 Thread Si-Wei Liu
On 8/29/2024 9:53 AM, Eugenio Perez Martin wrote: On Wed, Aug 21, 2024 at 2:56 PM Jonah Palmer wrote: Decouples the IOVA allocator from the IOVA->HVA tree and instead adds the allocated IOVA range to an IOVA-only tree (iova_map). This IOVA tree will hold all IOVA ranges that have been alloca

Re: [RFC 1/2] vhost-vdpa: Decouple the IOVA allocator

2024-08-30 Thread Si-Wei Liu
On 8/30/2024 1:05 AM, Eugenio Perez Martin wrote: On Fri, Aug 30, 2024 at 6:20 AM Si-Wei Liu wrote: On 8/29/2024 9:53 AM, Eugenio Perez Martin wrote: On Wed, Aug 21, 2024 at 2:56 PM Jonah Palmer wrote: Decouples the IOVA allocator from the IOVA->HVA tree and instead adds the alloca

  1   2   3   >