aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Smart <jsmart2021@gmail.com>2018-06-13 17:07:38 -0400
committerChristoph Hellwig <hch@lst.de>2018-06-14 11:01:01 -0400
commit3e493c00cedb457c0731399a835f7ba1c6df172b (patch)
tree361f4445613dc57ec439ff0347fcf69a91a664f0
parent587331f71e2748371526597cafc72e5732c67e88 (diff)
nvme-fc: fix nulling of queue data on reconnect
The reconnect path is calling the init routines to clear a queue structure. But the queue structure has state that perhaps needs to persist as long as the controller is live. Remove the nvme_fc_init_queue() calls on reconnect. The nvme_fc_free_queue() calls will clear state bits and reset any relevant queue state for a new connection. Signed-off-by: James Smart <james.smart@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--drivers/nvme/host/fc.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index 36e72e64f57d..318e827e74ec 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -1879,6 +1879,7 @@ nvme_fc_free_queue(struct nvme_fc_queue *queue)
1879 */ 1879 */
1880 1880
1881 queue->connection_id = 0; 1881 queue->connection_id = 0;
1882 atomic_set(&queue->csn, 1);
1882} 1883}
1883 1884
1884static void 1885static void
@@ -2468,7 +2469,7 @@ out_free_tag_set:
2468} 2469}
2469 2470
2470static int 2471static int
2471nvme_fc_reinit_io_queues(struct nvme_fc_ctrl *ctrl) 2472nvme_fc_recreate_io_queues(struct nvme_fc_ctrl *ctrl)
2472{ 2473{
2473 struct nvmf_ctrl_options *opts = ctrl->ctrl.opts; 2474 struct nvmf_ctrl_options *opts = ctrl->ctrl.opts;
2474 unsigned int nr_io_queues; 2475 unsigned int nr_io_queues;
@@ -2488,8 +2489,6 @@ nvme_fc_reinit_io_queues(struct nvme_fc_ctrl *ctrl)
2488 if (ctrl->ctrl.queue_count == 1) 2489 if (ctrl->ctrl.queue_count == 1)
2489 return 0; 2490 return 0;
2490 2491
2491 nvme_fc_init_io_queues(ctrl);
2492
2493 ret = nvme_fc_create_hw_io_queues(ctrl, ctrl->ctrl.sqsize + 1); 2492 ret = nvme_fc_create_hw_io_queues(ctrl, ctrl->ctrl.sqsize + 1);
2494 if (ret) 2493 if (ret)
2495 goto out_free_io_queues; 2494 goto out_free_io_queues;
@@ -2587,8 +2586,6 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl)
2587 * Create the admin queue 2586 * Create the admin queue
2588 */ 2587 */
2589 2588
2590 nvme_fc_init_queue(ctrl, 0);
2591
2592 ret = __nvme_fc_create_hw_queue(ctrl, &ctrl->queues[0], 0, 2589 ret = __nvme_fc_create_hw_queue(ctrl, &ctrl->queues[0], 0,
2593 NVME_AQ_DEPTH); 2590 NVME_AQ_DEPTH);
2594 if (ret) 2591 if (ret)
@@ -2675,7 +2672,7 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl)
2675 if (!ctrl->ioq_live) 2672 if (!ctrl->ioq_live)
2676 ret = nvme_fc_create_io_queues(ctrl); 2673 ret = nvme_fc_create_io_queues(ctrl);
2677 else 2674 else
2678 ret = nvme_fc_reinit_io_queues(ctrl); 2675 ret = nvme_fc_recreate_io_queues(ctrl);
2679 if (ret) 2676 if (ret)
2680 goto out_term_aen_ops; 2677 goto out_term_aen_ops;
2681 } 2678 }
@@ -3023,6 +3020,8 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts,
3023 if (!ctrl->queues) 3020 if (!ctrl->queues)
3024 goto out_free_ida; 3021 goto out_free_ida;
3025 3022
3023 nvme_fc_init_queue(ctrl, 0);
3024
3026 memset(&ctrl->admin_tag_set, 0, sizeof(ctrl->admin_tag_set)); 3025 memset(&ctrl->admin_tag_set, 0, sizeof(ctrl->admin_tag_set));
3027 ctrl->admin_tag_set.ops = &nvme_fc_admin_mq_ops; 3026 ctrl->admin_tag_set.ops = &nvme_fc_admin_mq_ops;
3028 ctrl->admin_tag_set.queue_depth = NVME_AQ_MQ_TAG_DEPTH; 3027 ctrl->admin_tag_set.queue_depth = NVME_AQ_MQ_TAG_DEPTH;