Skip to content

Commit c251d02

Browse files
dwsusegregkh
authored andcommitted
nvme-fc: update hardware queues before using them
[ Upstream commit 555f66d ] In case the number of hardware queues changes, we need to update the tagset and the mapping of ctx to hctx first. If we try to create and connect the I/O queues first, this operation will fail (target will reject the connect call due to the wrong number of queues) and hence we bail out of the recreate function. Then we will to try the very same operation again, thus we don't make any progress. Signed-off-by: Daniel Wagner <dwagner@suse.de> Reviewed-by: Ming Lei <ming.lei@redhat.com> Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent c450640 commit c251d02

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

  • drivers/nvme/host

‎drivers/nvme/host/fc.c‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2952,14 +2952,6 @@ nvme_fc_recreate_io_queues(struct nvme_fc_ctrl *ctrl)
29522952
if (ctrl->ctrl.queue_count == 1)
29532953
return 0;
29542954

2955-
ret = nvme_fc_create_hw_io_queues(ctrl, ctrl->ctrl.sqsize + 1);
2956-
if (ret)
2957-
goto out_free_io_queues;
2958-
2959-
ret = nvme_fc_connect_io_queues(ctrl, ctrl->ctrl.sqsize + 1);
2960-
if (ret)
2961-
goto out_delete_hw_queues;
2962-
29632955
if (prior_ioq_cnt != nr_io_queues) {
29642956
dev_info(ctrl->ctrl.device,
29652957
"reconnect: revising io queue count from %d to %d\n",
@@ -2969,6 +2961,14 @@ nvme_fc_recreate_io_queues(struct nvme_fc_ctrl *ctrl)
29692961
nvme_unfreeze(&ctrl->ctrl);
29702962
}
29712963

2964+
ret = nvme_fc_create_hw_io_queues(ctrl, ctrl->ctrl.sqsize + 1);
2965+
if (ret)
2966+
goto out_free_io_queues;
2967+
2968+
ret = nvme_fc_connect_io_queues(ctrl, ctrl->ctrl.sqsize + 1);
2969+
if (ret)
2970+
goto out_delete_hw_queues;
2971+
29722972
return 0;
29732973

29742974
out_delete_hw_queues:

0 commit comments

Comments
 (0)