Re: [PATCH v4 2/2] vhost-user: fix lost reconnect again

2024-05-15 Thread Raphael Norwitz
t even if vhost_dev_init initialization fails, the event > handler still needs to be reinstalled when s->connected is false. > > All vhost-user devices have this issue, including vhost-user-blk/scsi. > > Fixes: 71e076a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") &

Re: [PATCH v4 1/2] Revert "vhost-user: fix lost reconnect"

2024-05-15 Thread Raphael Norwitz
from the guest os, > s->connected has no chance to be set to false, resulting in > subsequent reconnection not being executed. > > The next patch will completely fix this issue with a better approach. > Reviewed-by: Raphael Norwitz > Signed-off-by: Li Feng >

Re: [PATCH v3 2/2] vhost-user: fix lost reconnect again

2024-05-15 Thread Raphael Norwitz
OK - I'm happy with this approach then. On Wed, May 15, 2024 at 10:48 PM Li Feng wrote: > > > > 2024年5月15日 23:47,Raphael Norwitz 写道: > > The case your describing makes sense but now I have some concerns on > the vhost_dev_cleanup bit. > > On Wed, May 15, 202

Re: [PATCH v3 2/2] vhost-user: fix lost reconnect again

2024-05-15 Thread Raphael Norwitz
The case your describing makes sense but now I have some concerns on the vhost_dev_cleanup bit. On Wed, May 15, 2024 at 1:47 AM Li Feng wrote: > > > > > 2024年5月14日 21:58,Raphael Norwitz 写道: > > > > Code looks good. Just a question on the error case you're trying to

Re: [PATCH v3 1/2] Revert "vhost-user: fix lost reconnect"

2024-05-15 Thread Raphael Norwitz
On Wed, May 15, 2024 at 1:47 AM Li Feng wrote: > > > > > 2024年5月14日 21:58,Raphael Norwitz 写道: > > > > The code for these two patches looks fine. Just some questions on the > > failure case you're trying to fix. > > > > > > On Tue, May 14, 202

Re: [PATCH v3 1/2] Revert "vhost-user: fix lost reconnect"

2024-05-14 Thread Raphael Norwitz
The code for these two patches looks fine. Just some questions on the failure case you're trying to fix. On Tue, May 14, 2024 at 2:12 AM Li Feng wrote: > > This reverts commit f02a4b8e6431598612466f76aac64ab492849abf. > > Since the current patch cannot completely fix the lost reconnect >

Re: [PATCH v3 2/2] vhost-user: fix lost reconnect again

2024-05-14 Thread Raphael Norwitz
Code looks good. Just a question on the error case you're trying to fix. On Tue, May 14, 2024 at 2:12 AM Li Feng wrote: > > When the vhost-user is reconnecting to the backend, and if the vhost-user > fails > at the get_features in vhost_dev_init(), then the reconnect will fail > and it will not

Re: [PATCH 1/2] libvhost-user: Fix pointer arithmetic in indirect read

2024-04-18 Thread Raphael Norwitz
The change looks right to me. As is, it looks like the code is skipping over descriptors when the intent should be to bounce data into a single descriptor. I agree the variable rename should go in as a separate change. On Thu, Apr 18, 2024 at 6:56 AM Daniel P. Berrangé wrote: > > On Sat, Jan

Re: [PATCH v1 11/15] libvhost-user: Speedup gpa_to_mem_region() and vu_gpa_to_va()

2024-02-04 Thread Raphael Norwitz
On Sun, Feb 4, 2024 at 9:51 AM David Hildenbrand wrote: > > On 04.02.24 03:10, Raphael Norwitz wrote: > > One comment on this one. > > > > On Fri, Feb 2, 2024 at 4:56 PM David Hildenbrand wrote: > >> > >> Let's speed up GPA to memory region / virtual add

Re: [PATCH v1 01/15] libvhost-user: Fix msg_region->userspace_addr computation

2024-02-04 Thread Raphael Norwitz
On Sun, Feb 4, 2024 at 9:36 AM David Hildenbrand wrote: > > On 04.02.24 02:35, Raphael Norwitz wrote: > > As a heads up, I've left Nutanix and updated it in MAINTAINERS. Will > > be updating it again shortly so tagging these with my new work email. > > > > Thanks

[PATCH] MAINTAINERS: Switch to my Enfabrica email

2024-02-03 Thread Raphael Norwitz
I'd prefer to use my new work email so this change updates MAINTAINERS with it. Signed-off-by: Raphael Norwitz --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 2f9741b898..a12b58abe2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS

Re: [PATCH v1 15/15] libvhost-user: Mark mmap'ed region memory as MADV_DONTDUMP

2024-02-03 Thread Raphael Norwitz
g > purposes. > > This change implies that the mmap'ed rings won't be included in a > coredump. If ever required for debugging purposes, we could mark only > the mapped rings MADV_DODUMP. > > Ignore errors during madvise() for now. > > Signed-off-by: David Hildenbrand Reviewed-by:

Re: [PATCH v1 14/15] libvhost-user: Dynamically remap rings after (temporarily?) removing memory regions

2024-02-03 Thread Raphael Norwitz
ugged memory, and as the VM reboots, we might unplug that memory, to > hotplug memory before resetting the ring addresses. > > So let's unmap affected rings as we remove a memory region, and try > dynamically mapping the ring again when required. > > Signed-off-by: David Hildenbr

Re: [PATCH v1 13/15] libvhost-user: Factor out vq usability check

2024-02-03 Thread Raphael Norwitz
On Fri, Feb 2, 2024 at 4:55 PM David Hildenbrand wrote: > > Let's factor it out to prepare for further changes. > > Signed-off-by: David Hildenbrand Reviewed-by: Raphael Norwitz > --- > subprojects/libvhost-user/libvhost-user.c | 24 +++ > 1 file c

Re: [PATCH v1 12/15] libvhost-user: Use most of mmap_offset as fd_offset

2024-02-03 Thread Raphael Norwitz
memory_size: 0x4000 > userspace_addr 0x7f552bffe000 > mmap_offset 0x000c4000 > fd_offset: 0x000c4000 > new mmap_offset: 0x0000 > mmap_addr: 0x7f7e8c00 > Successfully added new

Re: [PATCH v1 11/15] libvhost-user: Speedup gpa_to_mem_region() and vu_gpa_to_va()

2024-02-03 Thread Raphael Norwitz
One comment on this one. On Fri, Feb 2, 2024 at 4:56 PM David Hildenbrand wrote: > > Let's speed up GPA to memory region / virtual address lookup. Store the > memory regions ordered by guest physical addresses, and use binary > search for address translation, as well as when adding/removing

Re: [PATCH v1 10/15] libvhost-user: Factor out search for memory region by GPA and simplify

2024-02-03 Thread Raphael Norwitz
ning regions") added and clarified that > handling and how overlaps are impossible. > > Consequently, each GPA can belong to at most one memory region, and > everything else doesn't make sense. Let's factor out our search to prepare > for further changes. > > Signed-off-by: D

Re: [PATCH v1 09/15] libvhost-user: Don't search for duplicates when removing memory regions

2024-02-03 Thread Raphael Norwitz
Signed-off-by: David Hildenbrand Reviewed-by: Raphael Norwitz > --- > subprojects/libvhost-user/libvhost-user.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/subprojects/libvhost-user/libvhost-user.c > b/subprojects/libvhost-user/libvhost-user.

Re: [PATCH v1 08/15] libvhost-user: Don't zero out memory for memory regions

2024-02-03 Thread Raphael Norwitz
On Fri, Feb 2, 2024 at 4:56 PM David Hildenbrand wrote: > > dev->nregions always covers only valid entries. Stop zeroing out other > array elements that are unused. > > Signed-off-by: David Hildenbrand Reviewed-by: Raphael Norwitz > --- > subprojects/libvhost-

Re: [PATCH v1 07/15] libvhost-user: No need to check for NULL when unmapping

2024-02-03 Thread Raphael Norwitz
On Fri, Feb 2, 2024 at 4:55 PM David Hildenbrand wrote: > > We never add a memory region if mmap() failed. Therefore, no need to check > for NULL. > > Signed-off-by: David Hildenbrand Reviewed-by: Raphael Norwitz > --- > subprojects/libvhost-user/libvhost-user.c | 10

Re: [PATCH v1 06/15] libvhost-user: Factor out adding a memory region

2024-02-03 Thread Raphael Norwitz
ment dev->nregions as we are successfully > adding memory regions, and don't increment dev->nregions if anything went > wrong. > > Signed-off-by: David Hildenbrand Reviewed-by: Raphael Norwitz > --- > subprojects/libvhost-user/libvhost-user.c | 168 ---

Re: [PATCH v1 05/15] libvhost-user: Merge vu_set_mem_table_exec_postcopy() into vu_set_mem_table_exec()

2024-02-03 Thread Raphael Norwitz
On Fri, Feb 2, 2024 at 4:55 PM David Hildenbrand wrote: > > Let's reduce some code duplication and prepare for further changes. > > Signed-off-by: David Hildenbrand Reviewed-by: Raphael Norwitz > --- > subprojects/libvhost-user/libvhost-user.c | 119 +++---

Re: [PATCH v1 04/15] libvhost-user: Factor out removing all mem regions

2024-02-03 Thread Raphael Norwitz
On Fri, Feb 2, 2024 at 4:54 PM David Hildenbrand wrote: > > Let's factor it out. Note that the check for MAP_FAILED was wrong as > we never set mmap_addr if mmap() failed. We'll remove the NULL check > separately. > > Signed-off-by: David Hildenbrand Reviewed-b

Re: [PATCH v1 03/15] libvhost-user: Bump up VHOST_USER_MAX_RAM_SLOTS to 509

2024-02-03 Thread Raphael Norwitz
ty left for the application to consume. > > [1] https://github.com/rust-vmm/vhost/pull/224 > [2] https://lore.kernel.org/all/20230926185738.277351-1-da...@redhat.com/ > > Signed-off-by: David Hildenbrand Reviewed-by: Raphael Norwitz > --- > subprojects/libvhost-user/libvhos

Re: [PATCH v1 02/15] libvhost-user: Dynamically allocate memory for memory slots

2024-02-03 Thread Raphael Norwitz
out the memory, just as we used to do. > > Signed-off-by: David Hildenbrand Reviewed-by: Raphael Norwitz > --- > subprojects/libvhost-user/libvhost-user.c | 11 +++ > subprojects/libvhost-user/libvhost-user.h | 2 +- > 2 files changed, 12 insertions(+), 1 deletion(-

Re: [PATCH v1 01/15] libvhost-user: Fix msg_region->userspace_addr computation

2024-02-03 Thread Raphael Norwitz
ions in libvhost-user") > Fixes: 9bb38019942c ("vhost+postcopy: Send address back to qemu") > Cc: Raphael Norwitz > Signed-off-by: David Hildenbrand Reviewed-by: Raphael Norwitz > --- > subprojects/libvhost-user/libvhost-user.c | 8 > 1 file changed, 4 ins

[PATCH] MAINTAINERS: Update Raphael Norwitz email

2024-01-11 Thread Raphael Norwitz
I will be leaving Nutanix so updating my email in MAINTAINERS to my personal email for now. Signed-off-by: Raphael Norwitz --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 00ec1f7eca..d7bb52bfd1 100644 --- a/MAINTAINERS +++ b

Re: [PATCH 1/1] vhost-scsi: fix usage of error_reportf_err()

2023-12-14 Thread Raphael Norwitz
eportf_err() logs. > > Fixes: 7962e432b4e4 ("vhost-user-scsi: support reconnect to backend") > Signed-off-by: Dongli Zhang Reviewed-by: Raphael Norwitz > --- > hw/scsi/vhost-scsi.c | 4 ++-- > hw/scsi/vhost-user-scsi.c | 3 ++- > 2 files changed, 4 insertion

Re: [PATCH 1/2] vhost-user: fix the reconnect error

2023-11-27 Thread Raphael Norwitz
> On Nov 23, 2023, at 12:54 AM, Li Feng wrote: > > If the error occurs in vhost_dev_init, the value of s->connected is set to > true > in advance, and there is no chance to enter this function execution again > in the future. > > Signed-off-by: Li Feng R

Re: [PATCH 2/2] vhost-user-scsi: free the inflight area when reset

2023-11-27 Thread Raphael Norwitz
> On Nov 23, 2023, at 12:54 AM, Li Feng wrote: > > Keep it the same to vhost-user-blk. > At the same time, fix the vhost_reset_device. > > Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz > --- > hw/scsi/vhost-user-scsi.c | 16 > hw/virtio/

Re: [RFC PATCH 47/75] contrib/vhost-user-scsi: add fallthrough pseudo-keyword

2023-10-23 Thread Raphael Norwitz
> On Oct 13, 2023, at 3:48 AM, Emmanouil Pitsidianakis > wrote: > > Signed-off-by: Emmanouil Pitsidianakis Reviewed-by: Raphael Norwitz > --- > contrib/vhost-user-scsi/vhost-user-scsi.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --gi

Re: [RFC PATCH 48/78] contrib/vhost-user-scsi: add fallthrough pseudo-keyword

2023-10-23 Thread Raphael Norwitz
> On Oct 13, 2023, at 3:48 AM, Emmanouil Pitsidianakis > wrote: > > In preparation of raising -Wimplicit-fallthrough to 5, replace all > fall-through comments with the fallthrough attribute pseudo-keyword. > > Signed-off-by: Emmanouil Pitsidianakis Reviewe

Re: [PATCH 1/4] vhost-user-blk: simplify and fix vhost_user_blk_handle_config_change

2023-10-23 Thread Raphael Norwitz
I don’t understand the “valid for resize only” comment. Looks like this is zero day behavior and I can’t tell why it was added. Does anyone know? With that, reasoning and code looks good: Acked-by: Raphael Norwitz > On Oct 6, 2023, at 4:20 PM, Vladimir Sementsov-Ogievskiy >

Re: [PATCH v2 0/3] vhost: clean up device reset

2023-10-03 Thread Raphael Norwitz
ade during device reset. > > I have tested this series with vhost-net (kernel), vhost-user-blk, and > vhost-user-fs (both Rust and legacy C). > > Stefan Hajnoczi (3): > vhost-user: do not send RESET_OWNER on device reset > vhost-backend: remove vhost_kernel_reset_device()

Re: [PATCH v6 3/5] vhost-user-scsi: support reconnect to backend

2023-09-28 Thread Raphael Norwitz
One comment on the logging stuff in vhost-scsi. As far as I can tell the logging in vhost-user-scsi looks good. Markus - does this look better to you? Otherwise do you think we should also fix up the vhost-user-blk realize function? > On Sep 22, 2023, at 7:46 AM, Li Feng wrote: > > If the

Re: [PATCH v6 4/5] vhost-user-scsi: start vhost when guest kicks

2023-09-28 Thread Raphael Norwitz
> On Sep 22, 2023, at 7:46 AM, Li Feng wrote: > > Let's keep the same behavior as vhost-user-blk. > > Some old guests kick virtqueue before setting VIRTIO_CONFIG_S_DRIVER_OK. > Reviewed-by: Raphael Norwitz > Signed-off-by: Li Feng > --- > hw/

Re: [PATCH v6 5/5] vhost-user: fix lost reconnect

2023-09-28 Thread Raphael Norwitz
t; > All vhost-user devices have this issue, including vhost-user-blk/scsi. > > With this patch, if the vdev->vdev is null, the fd callback will still > be reinstalled. > > Fixes: 71e076a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") > Reviewed-by: Raphael Norwitz &

Re: [PATCH v6 5/5] vhost-user: fix lost reconnect

2023-09-28 Thread Raphael Norwitz
t; > All vhost-user devices have this issue, including vhost-user-blk/scsi. > > With this patch, if the vdev->vdev is null, the fd callback will still > be reinstalled. > > Fixes: 71e076a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") > Reviewed-by: Raphael Norwitz &

Re: [PATCH v6 1/5] vhost-user-common: send get_inflight_fd once

2023-09-28 Thread Raphael Norwitz
> On Sep 22, 2023, at 7:46 AM, Li Feng wrote: > > Currently the get_inflight_fd will be sent every time the device is started, > and > the backend will allocate shared memory to save the inflight state. If the > backend finds that it receives the second get_inflight_fd, it will release the >

Re: [PATCH 3/3] virtio: call ->vhost_reset_device() during reset

2023-09-27 Thread Raphael Norwitz
, libvhost-user, and the > vhost-user-backend crate do not negotiate > VHOST_USER_PROTOCOL_F_RESET_DEVICE automatically. > - vhost-vdpa: an extra SET_STATUS 0 call is made during device reset. Reviewed-by: Raphael Norwitz > > Signed-off-by: Stefan Hajnoczi > --- > include/h

Re: [PATCH 2/3] vhost-backend: remove vhost_kernel_reset_device()

2023-09-27 Thread Raphael Norwitz
vhost_dev_init(). > > vhost_kernel_reset_device() is never called so this latent bug never > appears. Get rid of vhost_kernel_reset_device() for now. If someone > needs it in the future they'll need to implement it correctly. > Reviewed-by: Raphael Norwitz > Signed-off-by: Stefan Hajnoczi >

Re: [PATCH 1/3] vhost-user: do not send RESET_OWNER on device reset

2023-09-27 Thread Raphael Norwitz
s->vhost_reset_device(dev); > } > } > > Therefore VHOST_USER_RESET_OWNER is actually never sent by > vhost_user_reset_device(). Remove the dead code. This effectively moves > the vhost-user protocol specific code from vhost-user-scsi.c into > vhost-user.c where it belongs. Revie

Re: [PATCH v3 2/2] vhost: Add Error parameter to vhost_scsi_common_start()

2023-08-30 Thread Raphael Norwitz
> On Aug 30, 2023, at 12:57 AM, Li Feng wrote: > > Add a Error parameter to report the real error, like vhost-user-blk. > Reviewed-by: Raphael Norwitz > Signed-off-by: Li Feng > --- > hw/scsi/vhost-scsi-common.c | 16 +--- > hw/scsi/vhost-scsi

Re: [PATCH v3 1/2] vhost-user: Fix lost reconnect

2023-08-30 Thread Raphael Norwitz
t; > All vhost-user devices have this issue, including vhost-user-blk/scsi. > > With this patch, if the vdev->vdev is null, the fd callback will still > be reinstalled. > > Fixes: 71e076a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") > Reviewed-by: Raphael Norwitz

Re: [PATCH v2 1/2] vhost-user: Fix lost reconnect

2023-08-29 Thread Raphael Norwitz
r devices have this issue, including vhost-user-blk/scsi. > > With this patch, if the vdev->vdev is null, the fd callback will still > be reinstalled. > > Fixes: 71e076a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") > A couple of NITs, otherwise LGTM Revi

Re: [PATCH v2 2/2] vhost: Add Error parameter to vhost_scsi_common_start()

2023-08-29 Thread Raphael Norwitz
> On Aug 24, 2023, at 3:41 AM, Li Feng wrote: > > Add a Error parameter to report the real error, like vhost-user-blk. > > Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz > --- > hw/scsi/vhost-scsi-common.c | 16 +--- > hw/scsi/vhost-scsi

Re: [PATCH 1/2] vhost-user: fix lost reconnect

2023-08-22 Thread Raphael Norwitz
> On Aug 22, 2023, at 12:49 AM, Li Feng wrote: > > > >> On 22 Aug 2023, at 8:38 AM, Raphael Norwitz >> wrote: >> >>> >>> On Aug 17, 2023, at 2:40 AM, Li Feng wrote: >>> >>> >>>> 2023年8月14日 下午8:11,Raphael Nor

Re: [PATCH 1/2] vhost-user: fix lost reconnect

2023-08-21 Thread Raphael Norwitz
> On Aug 17, 2023, at 2:40 AM, Li Feng wrote: > > >> 2023年8月14日 下午8:11,Raphael Norwitz 写道: >> >> Why can’t we rather fix this by adding a “event_cb” param to >> vhost_user_async_close and then call qemu_chr_fe_set_handlers in >> vhost_user_a

Re: [PATCH 1/2] vhost-user: fix lost reconnect

2023-08-14 Thread Raphael Norwitz
Why can’t we rather fix this by adding a “event_cb” param to vhost_user_async_close and then call qemu_chr_fe_set_handlers in vhost_user_async_close_bh()? Even if calling vhost_dev_cleanup() twice is safe today I worry future changes may easily stumble over the reconnect case and introduce

Re: [PATCH 2/2] vhost: Add Error parameter to vhost_scsi_common_start()

2023-08-14 Thread Raphael Norwitz
Thanks for the cleanup! A few comments. > On Aug 4, 2023, at 1:29 AM, Li Feng wrote: > > Add a Error parameter to report the real error, like vhost-user-blk. > > Signed-off-by: Li Feng > --- > hw/scsi/vhost-scsi-common.c | 17 ++--- > hw/scsi/vhost-scsi.c

Re: [PATCH v3 5/5] vhost-user-scsi: start vhost when guest kicks

2023-07-31 Thread Raphael Norwitz
> On Jul 31, 2023, at 8:10 AM, Li Feng wrote: > > Let's keep the same behavior as vhost-user-blk. > > Some old guests kick virtqueue before setting VIRTIO_CONFIG_S_DRIVER_OK. > > Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz > --- > hw/

Re: [PATCH v3 4/5] vhost-user-scsi: support reconnect to backend

2023-07-31 Thread Raphael Norwitz
> On Jul 31, 2023, at 8:10 AM, Li Feng wrote: > > If the backend crashes and restarts, the device is broken. > This patch adds reconnect for vhost-user-scsi. > > Tested with spdk backend. > > Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz > ---

Re: [PATCH v3 2/5] vhost-user-common: send get_inflight_fd once

2023-07-31 Thread Raphael Norwitz
d, it will release the > previous shared memory, which breaks inflight working logic. > > This patch is a preparation for the following patches. > > Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz > --- > hw/scsi/vhost-scsi-common.c | 37 ++---

Re: [PATCH v2 2/4] vhost-user-common: send get_inflight_fd once

2023-07-31 Thread Raphael Norwitz
> On Jul 31, 2023, at 7:38 AM, Li Feng wrote: > > > >> 2023年7月31日 06:13,Raphael Norwitz 写道: >> >>> >>> On Jul 28, 2023, at 3:49 AM, Li Feng wrote: >>> >>> >>> >>>> 2023年7月28日 下午2:04,Michael S

Re: [PATCH v2 4/4] vhost-user-scsi: support reconnect to backend

2023-07-30 Thread Raphael Norwitz
I don’t think we should be changing any vhost-scsi-common code here. I’d rather implement wrappers around vhost_user_scsi_start/stop() around vhost_user_scsi_common_start/stop() and check started_vu there. Otherwise I think this is looking good. Glad to see you caught the

Re: [PATCH v2 2/4] vhost-user-common: send get_inflight_fd once

2023-07-30 Thread Raphael Norwitz
> On Jul 28, 2023, at 3:49 AM, Li Feng wrote: > > > >> 2023年7月28日 下午2:04,Michael S. Tsirkin 写道: >> >> On Tue, Jul 25, 2023 at 06:42:45PM +0800, Li Feng wrote: >>> Get_inflight_fd is sent only once. When reconnecting to the backend, >>> qemu sent set_inflight_fd to the backend. >> >> I

Re: [PATCH v2 3/4] vhost: move and rename the conn retry times

2023-07-30 Thread Raphael Norwitz
> On Jul 25, 2023, at 6:42 AM, Li Feng wrote: > > Multile devices need this macro, move it to a common header. > > Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz > --- > hw/block/vhost-user-blk.c | 4 +--- > hw/virtio/vhost-user-gpio.c | 3 +-- > incl

Re: [PATCH v2 1/4] vhost: fix the fd leak

2023-07-30 Thread Raphael Norwitz
Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz > --- > hw/virtio/vhost.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c > index abf0d03c8d..e2f6ffb446 100644 > --- a/hw/virtio/vhost.c > +++ b/hw/virtio/vhost.c > @@

Re: [PATCH] vhost-user-scsi: support reconnect to backend

2023-07-30 Thread Raphael Norwitz
> On Jul 28, 2023, at 3:48 AM, Li Feng wrote: > > Thanks for your reply. > >> 2023年7月28日 上午5:21,Raphael Norwitz 写道: >> >> >> >>> On Jul 25, 2023, at 6:19 AM, Li Feng wrote: >>> >>> Thanks for your comments. >>> &g

Re: [PATCH] vhost-user-scsi: support reconnect to backend

2023-07-27 Thread Raphael Norwitz
> On Jul 25, 2023, at 6:19 AM, Li Feng wrote: > > Thanks for your comments. > >> 2023年7月25日 上午1:21,Raphael Norwitz 写道: >> >> Very excited to see this. High level looks good modulo a few small things. >> >> My major concern is around existing vhost-

Re: [PATCH] vhost-user-scsi: support reconnect to backend

2023-07-24 Thread Raphael Norwitz
Very excited to see this. High level looks good modulo a few small things. My major concern is around existing vhost-user-scsi backends which don’t support VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD. IMO we should hide the reconnect behavior behind a VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD check. We may

Re: [PATCH 2/2] vhost-user: Make RESET_DEVICE a per device message

2023-06-30 Thread Raphael Norwitz
, to per device > messages. > Reviewed-by: Raphael Norwitz > Signed-off-by: Tom Lonergan > --- > hw/virtio/vhost-user.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c > index 65d6299343..8dcf049d42 100644 > --- a/h

Re: [PATCH 1/2] vhost-user: Change one_time to per_device request

2023-06-30 Thread Raphael Norwitz
; https://lore.kernel.org/qemu-devel/20230127083027-mutt-send-email-...@kernel.org/ > Reviewed-by: Raphael Norwitz > Signed-off-by: Tom Lonergan > --- > hw/virtio/vhost-user.c | 18 -- > 1 file changed, 12 insertions(+), 6 deletions(-) > > diff --git

Re: [PATCH] block/vhost-user-blk: Fix hang on boot for some odd guests

2023-04-17 Thread Raphael Norwitz
Hey Andrey - apologies for the late reply here. It sounds like you are dealing with a buggy guest, rather than a QEMU issue. > On Apr 10, 2023, at 11:39 AM, Andrey Ryabinin wrote: > > > > On 4/10/23 10:35, Andrey Ryabinin wrote: >> Some guests hang on boot when using the vhost-user-blk-pci

Re: [PATCH 1/1] vhost-user: Skip unnecessary duplicated VHOST_USER_ADD/REM_MEM_REG requests

2023-01-17 Thread Raphael Norwitz
I’m confused by this “one time request” path. MST - why do we classify SET_MEM_TABLE as a one time request if we send it on every hot-add/hot-remove. In particular I’m tripping over the following in vhost_user_write: /* * For non-vring specific requests, like VHOST_USER_SET_MEM_TABLE, * we

Re: [PATCH v2] contrib/vhost-user-blk: Replace lseek64 with lseek

2022-12-18 Thread Raphael Norwitz
; when using glibc but not with musl. > > Signed-off-by: Khem Raj > Cc: Michael S. Tsirkin > CC: Raphael Norwitz > --- > v2: Fix typo must->musl > > contrib/vhost-user-blk/vhost-user-blk.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git

Re: [PATCH 1/2] contrib/vhost-user-blk: Replace lseek64 with lseek

2022-12-18 Thread Raphael Norwitz
CE > when using glibc but not with musl. > Other than the nit LGTM Reviewed-by: Raphael Norwitz > Signed-off-by: Khem Raj > Cc: Michael S. Tsirkin > CC: Raphael Norwitz > --- > contrib/vhost-user-blk/vhost-user-blk.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 delet

Re: [PATCH v3 7/7] hw/virtio: generalise CHR_EVENT_CLOSED handling

2022-11-29 Thread Raphael Norwitz
> On Nov 29, 2022, at 12:30 AM, Michael S. Tsirkin wrote: > > On Tue, Nov 29, 2022 at 05:18:58AM +, Raphael Norwitz wrote: >>> On Nov 28, 2022, at 11:41 AM, Alex Bennée wrote: >>> >>> ..and use for both virtio-user-blk and virtio-user-gpio. This avoids

Re: [PATCH v3 7/7] hw/virtio: generalise CHR_EVENT_CLOSED handling

2022-11-28 Thread Raphael Norwitz
> On Nov 28, 2022, at 11:41 AM, Alex Bennée wrote: > > ..and use for both virtio-user-blk and virtio-user-gpio. This avoids > the circular close by deferring shutdown due to disconnection until a > later point. virtio-user-blk already had this mechanism in place so The mechanism was originally

Re: [PATCH for-7.2] vhost: enable vrings in vhost_dev_start() for vhost-user devices

2022-11-24 Thread Raphael Norwitz
> On Nov 24, 2022, at 2:54 AM, Stefano Garzarella wrote: > > On Thu, Nov 24, 2022 at 01:50:19AM -0500, Michael S. Tsirkin wrote: >> On Thu, Nov 24, 2022 at 12:19:25AM +, Raphael Norwitz wrote: >>> >>> > On Nov 23, 2022, at 8:16 AM, Stefano Garzarel

Re: [PATCH for-7.2] vhost: enable vrings in vhost_dev_start() for vhost-user devices

2022-11-23 Thread Raphael Norwitz
https://gitlab.com/virtio-fs/virtiofsd > [2] > https://github.com/rust-vmm/vhost/blob/240fc2966/crates/vhost-user-backend/src/event_loop.rs#L217 > Fixes: 02b61f38d3 ("hw/virtio: incorporate backend features in features") > Reported-by: German Maglione > Tested-by:

Re: [PATCH] vhost: mask VIRTIO_F_RING_RESET for vhost and vhost-user devices

2022-11-21 Thread Raphael Norwitz
ce VIRTIO_F_RING_RESET is negotiated > by the guest (Linux >= v6.0), but not supported by the device. > > Fixes: 69e1c14aa2 ("virtio: core: vq reset feature negotation support") > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1318 > Signed-off-by: Stefano Garzarella Looks good. For vhost-user-blk and vhost-user-scsi: Acked-by: Raphael Norwitz

Re: [PATCH v2] hw/virtio/vhost-user: support obtain vdpa device's mac address automatically

2022-09-21 Thread Raphael Norwitz
If I read your response on the other thread correctly, this change is intended to prioritize the MAC address exposed by DPDK over the one provided by the QEMU command line? Sounds reasonable in principle, but I would get confirmation from vDPA/vhost-net maintainers. That said the way you’re

Re: [PATCH] hw/virtio/vhost-user: support obtain vdpa device's mac address automatically

2022-09-20 Thread Raphael Norwitz
I have some concerns from the vhost-user-blk side. >On Tue, Sep 13, 2022 at 5:13 PM Hao Chen wrote: >> >> When use dpdk-vdpa tests vdpa device. You need to specify the mac address to >> start the virtual machine through libvirt or qemu, but now, the libvirt or >> qemu can call dpdk vdpa

Re: [PATCH] vhost-user-blk: fix the resize crash

2022-09-20 Thread Raphael Norwitz
..@smartx.com<mailto:fen...@smartx.com> Reviewed-by: Raphael Norwitz >--- > hw/block/vhost-user-blk.c | 4 > 1 file changed, 4 insertions(+) > >diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c >index 9117222456..db30bb754f 100644 >--- a/hw

Re: [PATCH v3 0/5] vhost-user-blk: dynamically resize config space based on features

2022-09-12 Thread Raphael Norwitz
> Thanks for reviewing! Could you send a Pull request? Or do we need an > ack from someone else? mst typically includes the vhost-user-blk patches in his PRs. Usually a few other people review but I'm not sure it's required. A lot of folks have been busy prepping for KVM Forum the last few

Re: [PATCH v3 0/5] vhost-user-blk: dynamically resize config space based on features

2022-09-06 Thread Raphael Norwitz
Thanks for the changes. For the whole series: Reviewed-by: Raphael Norwitz On Tue, Sep 06, 2022 at 10:31:06AM +0300, Daniil Tatianin wrote: > This patch set attempts to align vhost-user-blk with virtio-blk in > terms of backward compatibility and flexibility. It also improves > the vi

Re: [PATCH v2 1/8] virtio: introduce VirtIOConfigSizeParams & virtio_get_config_size

2022-09-04 Thread Raphael Norwitz
> I can squash the first four if that would be better. I think so. Just may be easier for other reviewers :)

Re: [PATCH v2 5/8] virtio-blk: move config size params to virtio-blk-common

2022-09-02 Thread Raphael Norwitz
The vhost-user-blk bits in meson.build and Maintainers should probably be in patch 8? Otherwise LGTM. On Fri, Aug 26, 2022 at 05:32:45PM +0300, Daniil Tatianin wrote: > This way we can reuse it for other virtio-blk devices, e.g > vhost-user-blk, which currently does not control its config space

Re: [PATCH v2 3/8] virtio-net: utilize VirtIOConfigSizeParams & virtio_get_config_size

2022-09-02 Thread Raphael Norwitz
On Fri, Aug 26, 2022 at 05:32:43PM +0300, Daniil Tatianin wrote: > Use the new common helper. As an added bonus this also makes use of > config size sanity checking via the 'max_size' field. > > Signed-off-by: Daniil Tatianin > --- > hw/net/virtio-net.c | 8 ++-- > 1 file changed, 6

Re: [PATCH v2 8/8] vhost-user-blk: dynamically resize config space based on features

2022-09-02 Thread Raphael Norwitz
iled: Invalid argument > > This is caused by the newer (destination) VM requiring a bigger BAR0 > alignment because it has to cover a bigger configuration space, which > isn't actually needed since those additional config fields are not > active (write-zeroes/discard). > With the rele

Re: [PATCH v2 2/8] virtio-blk: utilize VirtIOConfigSizeParams & virtio_get_config_size

2022-09-02 Thread Raphael Norwitz
On Fri, Aug 26, 2022 at 05:32:42PM +0300, Daniil Tatianin wrote: > Use the common helper instead of duplicating the same logic. > > Signed-off-by: Daniil Tatianin Reviewed-by: Raphael Norwitz > --- > hw/block/virtio-blk.c | 16 +++- > 1 file changed, 7 insertio

Re: [PATCH v2 7/8] vhost-user-blk: make 'config_wce' part of 'host_features'

2022-09-02 Thread Raphael Norwitz
On Fri, Aug 26, 2022 at 05:32:47PM +0300, Daniil Tatianin wrote: > No reason to have this be a separate field. This also makes it more akin > to what the virtio-blk device does. > > Signed-off-by: Daniil Tatianin Reviewed-by: Raphael Norwitz > --- > hw/block/vhost-user-

Re: [PATCH v2 4/8] virtio: remove the virtio_feature_get_config_size helper

2022-09-02 Thread Raphael Norwitz
On Fri, Aug 26, 2022 at 05:32:44PM +0300, Daniil Tatianin wrote: > This has no more users and is superseded by virtio_get_config_size. > > Signed-off-by: Daniil Tatianin Reviewed-by: Raphael Norwitz > --- > hw/virtio/virtio.c | 15 --- > include/hw/vi

Re: [PATCH v2 6/8] vhost-user-blk: make it possible to disable write-zeroes/discard

2022-09-02 Thread Raphael Norwitz
On Fri, Aug 26, 2022 at 05:32:46PM +0300, Daniil Tatianin wrote: > It is useful to have the ability to disable these features for > compatibility with older VMs that don't have these implemented. > > Signed-off-by: Daniil Tatianin Reviewed-by: Raphael Norwitz > --- > h

Re: [PATCH v2 1/8] virtio: introduce VirtIOConfigSizeParams & virtio_get_config_size

2022-09-02 Thread Raphael Norwitz
I feel like it would be easier to review if the first 4 patches were squashed together, but that’s not a big deal. For this one: Reviewed-by: Raphael Norwitz On Fri, Aug 26, 2022 at 05:32:41PM +0300, Daniil Tatianin wrote: > This is the first step towards moving all device config s

Re: [PATCH v2 0/8] vhost-user-blk: dynamically resize config space based on features

2022-09-01 Thread Raphael Norwitz
> ping Apologies for the late review - busy week. First pass looks good but will review comprehensively tomorrow or over the weekend.

Re: [PATCH v4 11/22] hw/virtio: move vhd->started check into helper and add FIXME

2022-08-07 Thread Raphael Norwitz
the vhost level. I do agree we shouldn't re-use vdev->started. Maybe we should add another 'active' variable in vhost_dev? I'm happy to send a patch for that. Until we agree on a better solution I'm happy with the FIXME. Reviewed-by: Raphael Norwitz > > Signed-off-by: Alex Bennée &g

Re: [PATCH] contrib/vhost-user-blk: Clean up deallocation of VuVirtqElement

2022-07-27 Thread Raphael Norwitz
On Tue, Jul 26, 2022 at 03:57:42PM +0100, Peter Maydell wrote: > On Fri, 1 Jul 2022 at 06:41, Markus Armbruster wrote: > > Could we use a contrib/README with an explanation what "contrib" means, > > and how to build and use the stuff there? > > I would rather we got rid of contrib/ entirely. Our

Re: [PATCH] contrib/vhost-user-blk: Clean up deallocation of VuVirtqElement

2022-06-30 Thread Raphael Norwitz
quot; condition. Useless, > because it cannot be null (it's dereferenced right before), and even NIT: if it > it it could be, free() and g_free() do the right thing. Drop the > conditional. > Reviewed-by: Raphael Norwitz > Fixes: Coverity CID 1490290 > Signed-off-by: Markus

Re: [PATCH 2/2] hw/vhost-user-scsi|blk: set `supports_config` flag correctly

2022-05-30 Thread Raphael Norwitz
> > Signed-off-by: Changpeng Liu Reviewed-by: Raphael Norwitz > --- > hw/block/vhost-user-blk.c | 1 + > hw/scsi/vhost-user-scsi.c | 1 - > 2 files changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c > index 5

Re: [PATCH 1/2] hw/virtio/vhost-user: don't use uninitialized variable

2022-05-30 Thread Raphael Norwitz
supported") > > Signed-off-by: Changpeng Liu Reviewed-by: Raphael Norwitz > --- > hw/virtio/vhost-user.c | 8 +++- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c > index b040c1ad2b..0594178

Re: [PATCH v2 01/15] contrib/vhost-user-blk: fix 32 bit build and enable

2022-05-30 Thread Raphael Norwitz
r vhost-user daemons. > > Signed-off-by: Alex Bennée > Message-Id: <20220321153037.3622127-12-alex.ben...@linaro.org> Reviewed-by: Raphael Norwitz > --- > meson.build | 2 +- > contrib/vhost-user-blk/vhost-user-blk.c | 6 +++--- > contrib/vhost

Re: Accelerating non-standard disk types

2022-05-30 Thread Raphael Norwitz
On Wed, May 25, 2022 at 05:00:04PM +0100, Stefan Hajnoczi wrote: > On Thu, May 19, 2022 at 06:39:39PM +0000, Raphael Norwitz wrote: > > On Tue, May 17, 2022 at 03:53:52PM +0200, Paolo Bonzini wrote: > > > On 5/16/22 19:38, Raphael Norwitz wrote: > > > > [1] Keep usin

Re: Accelerating non-standard disk types

2022-05-19 Thread Raphael Norwitz
On Tue, May 17, 2022 at 03:53:52PM +0200, Paolo Bonzini wrote: > On 5/16/22 19:38, Raphael Norwitz wrote: > > [1] Keep using the SCSI translation in QEMU but back vDisks with a > > vhost-user-scsi or vhost-user-blk backend device. > > [2] Implement SATA and IDE emulation w

Re: Accelerating non-standard disk types

2022-05-19 Thread Raphael Norwitz
On Tue, May 17, 2022 at 04:29:17PM +0100, Stefan Hajnoczi wrote: > On Mon, May 16, 2022 at 05:38:31PM +0000, Raphael Norwitz wrote: > > Hey Stefan, > > > > We've been thinking about ways to accelerate other disk types such as > > SATA and IDE rather than translating to

Accelerating non-standard disk types

2022-05-16 Thread Raphael Norwitz
Hey Stefan, We've been thinking about ways to accelerate other disk types such as SATA and IDE rather than translating to SCSI and using QEMU's iSCSI driver, with existing and more performant backends such as SPDK. We think there are some options worth exploring: [1] Keep using the SCSI

Re: [PATCH v2] vhost-user-scsi: avoid unlink(NULL) with fd passing

2022-05-16 Thread Raphael Norwitz
> > Fixes: Coverity CID 1488353 > Fixes: 747421e949fc1eb3ba66b5fcccdb7ba051918241 ("Implements Backend Program > conventions for vhost-user-scsi") > Signed-off-by: Stefan Hajnoczi > --- Reviewed-by: Raphael Norwitz > contrib/vhost-user-scsi/vhost-user-scsi.c | 5 - >

Re: [PATCH] vhost-user: Use correct macro name TARGET_PPC64g

2022-05-04 Thread Raphael Norwitz
On Tue, May 03, 2022 at 03:01:08PM -0300, Murilo Opsfelder Araujo wrote: > The correct name of the macro is TARGET_PPC64. > > Fixes: 27598393a232 ("Lift max memory slots limit imposed by vhost-user") > Reported-by: Fabiano Rosas > Signed-off-by: Murilo Opsfelder Arau

Re: [PATCH] vhost-user-scsi: avoid unlink(NULL) with fd passing

2022-04-29 Thread Raphael Norwitz
tions. > > When fd passing is used the UNIX domain socket path is NULL and we must > not call unlink(2). > > Fixes: Coverity CID 1488353 > Fixes: 747421e949fc1eb3ba66b5fcccdb7ba051918241 ("Implements Backend Program > conventions for vhost-user-scsi") > Signed-o

  1   2   3   4   >