[PATCH] nvme-rdma: unquiesce queue after reconnection failure clean up
Ruozhu Li
liruozhu at huawei.com
Thu Jul 22 05:32:12 PDT 2021
In the cleaning up procedure caused by reconnection failure, request queues
was quiesced. Until network recover, request queues will always quiesced
and subsequent IOs remain hanged there.Reference count of request queues
cannot be released, and connection cannot be deleted when needed.(Delete
procedure will hang in nvme_ns_remove.)
After cleaning up finished, unquiesce queues for fast io failover.
Signed-off-by: Ruozhu Li <liruozhu at huawei.com>
---
drivers/nvme/host/rdma.c | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index 7f6b3a991501..caa3cd499e0f 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -932,6 +932,7 @@ static int nvme_rdma_configure_admin_queue(struct nvme_rdma_ctrl *ctrl,
out_stop_queue:
nvme_rdma_stop_queue(&ctrl->queues[0]);
nvme_cancel_admin_tagset(&ctrl->ctrl);
+ blk_mq_unquiesce_queue(ctrl->ctrl.admin_q);
out_cleanup_queue:
if (new)
blk_cleanup_queue(ctrl->ctrl.admin_q);
@@ -1012,6 +1013,7 @@ static int nvme_rdma_configure_io_queues(struct nvme_rdma_ctrl *ctrl, bool new)
nvme_rdma_stop_io_queues(ctrl);
out_cleanup_connect_q:
nvme_cancel_tagset(&ctrl->ctrl);
+ nvme_start_queues(&ctrl->ctrl);
if (new)
blk_cleanup_queue(ctrl->ctrl.connect_q);
out_free_tag_set:
@@ -1145,19 +1147,13 @@ static int nvme_rdma_setup_ctrl(struct nvme_rdma_ctrl *ctrl, bool new)
return 0;
destroy_io:
- if (ctrl->ctrl.queue_count > 1) {
- nvme_stop_queues(&ctrl->ctrl);
- nvme_sync_io_queues(&ctrl->ctrl);
- nvme_rdma_stop_io_queues(ctrl);
- nvme_cancel_tagset(&ctrl->ctrl);
- nvme_rdma_destroy_io_queues(ctrl, new);
- }
+ nvme_rdma_teardown_io_queues(ctrl, new);
+ if (!new)
+ nvme_start_queues(&ctrl->ctrl);
destroy_admin:
- blk_mq_quiesce_queue(ctrl->ctrl.admin_q);
- blk_sync_queue(ctrl->ctrl.admin_q);
- nvme_rdma_stop_queue(&ctrl->queues[0]);
- nvme_cancel_admin_tagset(&ctrl->ctrl);
- nvme_rdma_destroy_admin_queue(ctrl, new);
+ nvme_rdma_teardown_admin_queue(ctrl, new);
+ if (!new)
+ blk_mq_unquiesce_queue(ctrl->ctrl.admin_q);
return ret;
}
--
2.16.4
More information about the Linux-nvme
mailing list