linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jsmart2021@gmail.com (James Smart)
Subject: [PATCH 6/7] nvme_fc: fix nulling of queue data on reconnect
Date: Mon,  7 May 2018 17:12:13 -0700	[thread overview]
Message-ID: <20180508001214.8951-7-jsmart2021@gmail.com> (raw)
In-Reply-To: <20180508001214.8951-1-jsmart2021@gmail.com>

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 at broadcom.com>
---
 drivers/nvme/host/fc.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index 7b9fb2e5afee..3cab280cf5f7 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)
 	 */
 
 	queue->connection_id = 0;
+	atomic_set(&queue->csn, 1);
 }
 
 static void
@@ -2472,7 +2473,7 @@ nvme_fc_create_io_queues(struct nvme_fc_ctrl *ctrl)
 }
 
 static int
-nvme_fc_reinit_io_queues(struct nvme_fc_ctrl *ctrl)
+nvme_fc_recreate_io_queues(struct nvme_fc_ctrl *ctrl)
 {
 	struct nvmf_ctrl_options *opts = ctrl->ctrl.opts;
 	unsigned int nr_io_queues, numq;
@@ -2493,8 +2494,6 @@ nvme_fc_reinit_io_queues(struct nvme_fc_ctrl *ctrl)
 	if (ctrl->ctrl.queue_count == 1)
 		return 0;
 
-	nvme_fc_init_io_queues(ctrl);
-
 	ret = nvme_fc_create_hw_io_queues(ctrl, ctrl->ctrl.sqsize + 1);
 	if (ret)
 		goto out_free_io_queues;
@@ -2592,8 +2591,6 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl)
 	 * Create the admin queue
 	 */
 
-	nvme_fc_init_queue(ctrl, 0);
-
 	ret = __nvme_fc_create_hw_queue(ctrl, &ctrl->queues[0], 0,
 				NVME_AQ_DEPTH);
 	if (ret)
@@ -2680,7 +2677,7 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl)
 		if (!ctrl->ioq_live)
 			ret = nvme_fc_create_io_queues(ctrl);
 		else
-			ret = nvme_fc_reinit_io_queues(ctrl);
+			ret = nvme_fc_recreate_io_queues(ctrl);
 		if (ret)
 			goto out_term_aen_ops;
 	}
@@ -3028,6 +3025,8 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts,
 	if (!ctrl->queues)
 		goto out_free_ida;
 
+	nvme_fc_init_queue(ctrl, 0);
+
 	memset(&ctrl->admin_tag_set, 0, sizeof(ctrl->admin_tag_set));
 	ctrl->admin_tag_set.ops = &nvme_fc_admin_mq_ops;
 	ctrl->admin_tag_set.queue_depth = NVME_AQ_MQ_TAG_DEPTH;
-- 
2.13.1

  parent reply	other threads:[~2018-05-08  0:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-08  0:12 [PATCH 0/7] nvme_fc: asynchronous controller create and simple discovery James Smart
2018-05-08  0:12 ` [PATCH 1/7] nvme: remove unnecessary controller subnqn validation James Smart
2018-05-08  5:57   ` Hannes Reinecke
2018-05-08  0:12 ` [PATCH 2/7] nvme_fc: remove setting DNR on exception conditions James Smart
2018-05-08  5:58   ` Hannes Reinecke
2018-05-08  0:12 ` [PATCH 3/7] nvme_fc: retry failures to set io queue count James Smart
2018-05-08  6:00   ` Hannes Reinecke
2018-05-11 20:19     ` James Smart
2018-05-08  0:12 ` [PATCH 4/7] nvme_fc: remove reinit_request routine James Smart
2018-05-08  6:01   ` Hannes Reinecke
2018-05-08  0:12 ` [PATCH 5/7] nvme_fc: change controllers first connect to use reconnect path James Smart
2018-05-08  6:03   ` Hannes Reinecke
2018-05-08  0:12 ` James Smart [this message]
2018-05-08  6:05   ` [PATCH 6/7] nvme_fc: fix nulling of queue data on reconnect Hannes Reinecke
2018-05-08 15:12     ` James Smart
2018-05-08 15:28       ` Hannes Reinecke
2018-05-08  0:12 ` [PATCH 7/7] nvme_fc: add 'nvme_discovery' sysfs attribute to fc transport device James Smart
2018-05-08  6:06   ` Hannes Reinecke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180508001214.8951-7-jsmart2021@gmail.com \
    --to=jsmart2021@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).