Skip to contentSkip to conversation

nvme-fc: wait for queues to freeze before calling update_hr_hw_queues

PATCH Applied James Smart 4 participants 4 messages Oct 16, 2020 – Oct 22, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme-fc: wait for queues to freeze before calling update_hr_hw_queues

On reconnect, the code currently does not freeze the controller before possibly updating the number hw queues for the controller.

Add the freeze before updating the number of hw queues. Note: the queues are already started and remain started through the reconnect.

---
 drivers/nvme/host/fc.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/nvme/host/fc.c +5 -2
index c81ebe94d8fe..7067aaf50bf7 100644
@@ -2885,11 +2885,14 @@ nvme_fc_recreate_io_queues(struct nvme_fc_ctrl *ctrl)
 	if (ret)
 		goto out_delete_hw_queues;
 
-	if (prior_ioq_cnt != nr_io_queues)
+	if (prior_ioq_cnt != nr_io_queues) {
 		dev_info(ctrl->ctrl.device,
 			"reconnect: revising io queue count from %d to %d\n",
 			prior_ioq_cnt, nr_io_queues);
-	blk_mq_update_nr_hw_queues(&ctrl->tag_set, nr_io_queues);
+		nvme_wait_freeze(&ctrl->ctrl);
+		blk_mq_update_nr_hw_queues(&ctrl->tag_set, nr_io_queues);
+		nvme_unfreeze(&ctrl->ctrl);
+	}
 
 	return 0;
 
Signature · 1 line
2.26.2

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

#1 lore raw
Quoted 11 lines · James Smart

On reconnect, the code currently does not freeze the controller before possibly updating the number hw queues for the controller.

Add the freeze before updating the number of hw queues. Note: the queues are already started and remain started through the reconnect.

---
  drivers/nvme/host/fc.c | 7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)

Cheers,

Hannes

Signature · 9 lines
Dr. Hannes Reinecke                Kernel Storage Architect
[email protected]                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Reviewed-by on v1 1/1
#2 lore raw
In reply to James Smart
Quoted 43 lines · James Smart

On reconnect, the code currently does not freeze the controller before possibly updating the number hw queues for the controller.

Add the freeze before updating the number of hw queues. Note: the queues are already started and remain started through the reconnect.

---
drivers/nvme/host/fc.c | 7 +++++--

1 file changed, 5 insertions(+), 2 deletions(-)
drivers/nvme/host/fc.c +5 -2
index c81ebe94d8fe..7067aaf50bf7 100644
@@ -2885,11 +2885,14 @@ nvme_fc_recreate_io_queues(struct nvme_fc_ctrl *ctrl)
 	if (ret)
 		goto out_delete_hw_queues;
 
-	if (prior_ioq_cnt != nr_io_queues)
+	if (prior_ioq_cnt != nr_io_queues) {
 		dev_info(ctrl->ctrl.device,
 			"reconnect: revising io queue count from %d to %d\n",
 			prior_ioq_cnt, nr_io_queues);
-	blk_mq_update_nr_hw_queues(&ctrl->tag_set, nr_io_queues);
+		nvme_wait_freeze(&ctrl->ctrl);
+		blk_mq_update_nr_hw_queues(&ctrl->tag_set, nr_io_queues);
+		nvme_unfreeze(&ctrl->ctrl);
+	}
 
 	return 0;
 
Signature · 6 lines
2.26.2

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

Looks Good.

--
Himanshu Madhani Oracle Linux Engineering

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme