On 2020/10/22 上午8:34, Mike Christie wrote:
Each vhost-scsi device will need a evt and ctl queue, but the number
of IO queues depends on whatever the user has configured in userspace.
This patch has vhost-scsi create the evt, ctl and one IO vq at device
open time. We then create the other IO vqs when userspace starts to
set them up. We still waste some mem on the vq and scsi vq structs,
but we don't waste mem on iovec related arrays and for later patches
we know which queues are used by the dev->nvqs value.
Signed-off-by: Mike Christie <michael.christie@xxxxxxxxxx>
---
drivers/vhost/scsi.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
Not familiar with SCSI. But I wonder if it could behave like vhost-net.
E.g userspace should known the number of virtqueues so it can just open
and close multiple vhost-scsi file descriptors.
Thanks