Skip to content

Commit 555f66d

Browse files
igawChristoph Hellwig
authored andcommitted
nvme-fc: update hardware queues before using them
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 <[email protected]> Reviewed-by: Ming Lei <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: James Smart <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 858560b commit 555f66d

File tree

1 file changed

+8
-8
lines changed
  • drivers/nvme/host

1 file changed

+8
-8
lines changed

drivers/nvme/host/fc.c

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

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

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

29732973
out_delete_hw_queues:

0 commit comments

Comments
 (0)