:p
atchew
Login
Currently, virtio-scsi doesn't support any control or event message, this patch add the basic initialization. Some backends need this feature, like dpdk. Signed-off-by: Li Feng <fengli@smartx.com> --- src/hw/virtio-scsi.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/hw/virtio-scsi.c b/src/hw/virtio-scsi.c index XXXXXXX..XXXXXXX 100644 --- a/src/hw/virtio-scsi.c +++ b/src/hw/virtio-scsi.c @@ -XXX,XX +XXX,XX @@ init_virtio_scsi(void *data) } } + if (vp_find_vq(vp, 0, &vq) < 0 ) { + dprintf(1, "fail to find ctrl vq for virtio-scsi %pP\n", pci); + goto fail; + } + + if (vp_find_vq(vp, 1, &vq) < 0 ) { + dprintf(1, "fail to find event vq for virtio-scsi %pP\n", pci); + goto fail; + } + if (vp_find_vq(vp, 2, &vq) < 0 ) { - dprintf(1, "fail to find vq for virtio-scsi %pP\n", pci); + dprintf(1, "fail to find req vq for virtio-scsi %pP\n", pci); goto fail; } -- 2.31.1 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org
Currently, virtio-scsi doesn't support any control or event message, this patch adds the basic initialization. Some backends need this feature, like dpdk/spdk vhost-user backend. Reproduce: 1. Start spdk vhost-user-scsi backend; 2. Create a vm with a SCSI vhost-user-scsi disk and start the vm; 3. Mount an iso to the vm without an OS; 3. Stop the vhost-user-scsi backend; 5. Vhost-user-scsi backend will crash before exiting when cleaning the resources. The reason is that the seabios virtio-scsi only initializes the req vq, then the spdk/dpdk treats it a not good session, it's hard to handle this tricky issue from dpdk architecture. Signed-off-by: Li Feng <fengli@smartx.com> --- src/hw/virtio-scsi.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/hw/virtio-scsi.c b/src/hw/virtio-scsi.c index XXXXXXX..XXXXXXX 100644 --- a/src/hw/virtio-scsi.c +++ b/src/hw/virtio-scsi.c @@ -XXX,XX +XXX,XX @@ init_virtio_scsi(void *data) } } + if (vp_find_vq(vp, 0, &vq) < 0 ) { + dprintf(1, "fail to find ctrl vq for virtio-scsi %pP\n", pci); + goto fail; + } + + if (vp_find_vq(vp, 1, &vq) < 0 ) { + dprintf(1, "fail to find event vq for virtio-scsi %pP\n", pci); + goto fail; + } + if (vp_find_vq(vp, 2, &vq) < 0 ) { - dprintf(1, "fail to find vq for virtio-scsi %pP\n", pci); + dprintf(1, "fail to find req vq for virtio-scsi %pP\n", pci); goto fail; } -- 2.31.1 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org