[PATCH 01/13] nvme: add common helpers to allocate and free tagsets

Christoph Hellwig hch at lst.de
Wed Sep 21 22:48:37 PDT 2022


On Wed, Sep 21, 2022 at 11:25:11AM +0300, Sagi Grimberg wrote:
>> +	if (ops->map_queues)
>> +		set->nr_maps = ctrl->opts->nr_poll_queues ? HCTX_MAX_TYPES : 2;
>> +	ret = blk_mq_alloc_tag_set(set);
>> +	if (ret)
>> +		return ret;
>> +
>
> if (ctrl->ops->flags & NVME_F_FABRICS) {

Incremental fixup:

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index f8d9f32adc87c..91c2cb59c4eb6 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -4877,10 +4877,12 @@ int nvme_alloc_io_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set,
 	if (ret)
 		return ret;
 
-	ctrl->connect_q = blk_mq_init_queue(set);
-        if (IS_ERR(ctrl->connect_q)) {
-		ret = PTR_ERR(ctrl->connect_q);
-		goto out_free_tag_set;
+	if (ctrl->ops->flags & NVME_F_FABRICS) {
+		ctrl->connect_q = blk_mq_init_queue(set);
+        	if (IS_ERR(ctrl->connect_q)) {
+			ret = PTR_ERR(ctrl->connect_q);
+			goto out_free_tag_set;
+		}
 	}
 
 	ctrl->tagset = set;



More information about the Linux-nvme mailing list