From 8f290936602532468de70c21a166a3e2efaebbb4 Mon Sep 17 00:00:00 2001 From: Dariusz Stojaczyk Date: Fri, 9 Feb 2018 13:02:20 +0100 Subject: [PATCH] vhost/blk: set blkcfg->num_queues to the max available queues number QEMU overrides this value anyway, but other virtio implementation may not. Setting blkcfg->num_queues to its target value won't break anything, and will help out SPDK virtio-blk driver implementation. For equivalent field in virtio-scsi, the Virtio 1.0 spec says: ``` num_queues is the total number of request virtqueues exposed by the device. The driver MAY use only one request queue, or it can use more to achieve better performance. ``` Multiqueue for virtio-blk is oficially still unsupported, so the blkcfg->num_queues remains undocumented. Let's implement it adequately to the virtio-scsi spec. Change-Id: Ief520385997bb7e745ed17501a972c55955346d2 Signed-off-by: Dariusz Stojaczyk Reviewed-on: https://review.gerrithub.io/399121 Reviewed-by: Pawel Wodkowski Reviewed-by: Daniel Verkamp Reviewed-by: Jim Harris Tested-by: SPDK Automated Test System --- lib/vhost/vhost_blk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vhost/vhost_blk.c b/lib/vhost/vhost_blk.c index 1d06690ca..1cef98ccf 100644 --- a/lib/vhost/vhost_blk.c +++ b/lib/vhost/vhost_blk.c @@ -649,7 +649,7 @@ spdk_vhost_blk_get_config(struct spdk_vhost_dev *vdev, uint8_t *config, /* -2 for REQ and RESP and -1 for region boundary splitting */ blkcfg->seg_max = SPDK_VHOST_IOVS_MAX - 2 - 1; /* QEMU can overwrite this value when started */ - blkcfg->num_queues = 1; + blkcfg->num_queues = SPDK_VHOST_MAX_VQUEUES; return 0; }