On Wed, Aug 4, 2021 at 8:41 AM Stefano Garzarella <sgarz...@redhat.com> wrote: > > On Tue, Aug 03, 2021 at 11:58:27AM -0700, Jiang Wang . wrote: > >On Wed, Jul 7, 2021 at 10:27 AM Stefano Garzarella <sgarz...@redhat.com> > >wrote: > >> On Wed, Jul 07, 2021 at 09:52:46AM -0700, Jiang Wang . wrote: > >> >On Wed, Jul 7, 2021 at 1:33 AM Stefano Garzarella <sgarz...@redhat.com> > >> >wrote: > >> >> On Tue, Jul 06, 2021 at 10:26:07PM +0000, Jiang Wang wrote: > > [...] > > >> >> >+ > >> >> >+ if (nvqs < 0) > >> >> >+ nvqs = MAX_VQS_WITHOUT_DGRAM; > >> >> >+ > >> >> >+ if (nvqs == MAX_VQS_WITH_DGRAM) { > >> >> >+ vvc->dgram_recv_vq = virtio_add_queue(vdev, > >> >> >VHOST_VSOCK_QUEUE_SIZE, > >> >> >+ > >> >> >vhost_vsock_common_handle_output); > >> >> >+ vvc->dgram_trans_vq = virtio_add_queue(vdev, > >> >> >VHOST_VSOCK_QUEUE_SIZE, > >> >> >+ > >> >> >vhost_vsock_common_handle_output); > >> >> >+ } > >> >> >+ > >> >> > /* The event queue belongs to QEMU */ > >> >> > vvc->event_vq = virtio_add_queue(vdev, VHOST_VSOCK_QUEUE_SIZE, > >> >> > > >> >> > vhost_vsock_common_handle_output); > >> >> > >> >> Did you do a test with a guest that doesn't support datagram with QEMU > >> >> and hosts that do? > >> >> > >> >Yes, and it works. > >> > > >> >> I repost my thoughts that I had on v2: > >> >> > >> >> What happen if the guest doesn't support dgram? > >> >> > >> >> I think we should dynamically use the 3rd queue or the 5th queue > >> >> for > >> >> the events at runtime after the guest acked the features. > >> >> > >> >> Maybe better to switch to an array of VirtQueue. > >> >> > >> >I think in current V3, it already dynamically use 3rd or 5th queue > >> >depending > >> >on the feature bit. > >> > >> I'm not sure. IIUC when vhost_vsock_common_realize() is called, we don't > >> know the features acked by the guest, so how can it be dynamic? > >> > >> Here we should know only if the host kernel supports it. > >> > >> Maybe it works, because in QEMU we use the event queue only after a > >> migration to send a reset event, so you can try to migrate a guest to > >> check this path. > >> > >I tried VM migration and didn't see any problems. The migration looks fine > >and vsock dgram still works after migration. Is there any more specific test > >you want to run to check for this code path? > > > > I meant a migration of a guest from QEMU without this patch to a QEMU > with this patch. Of course in that case testing a socket stream. >
Sorry, I meant the opposite. You should try to migrate a guest that does not support dgrams starting from a QEMU with this patch (and kernel that supports dgram, so qemu uses the 5th queue for event), to a QEMU without this patch. I still think the event queue should remain the third and those dgrams the next 2. Thanks, Stefano