Skip to contentSkip to conversation

nvme-fc: flush err and connect work in .stop_ctrl

PATCH New Sagi Grimberg 2 participants 3 messages Dec 20, 2018 – Dec 21, 2018

Subsystems (2)
lore
Share & tools
lore

Sagi Grimberg

author maintainer
#0 lore raw

PATCH 1/1 nvme-fc: flush err and connect work in .stop_ctrl

Controller op .stop_ctrl was designed to let the driver quiesce any pending works that may be active before starting the controller teardown (delete_ctrl).

Signed-off-by Sagi Grimberg <sagi at grimberg.me>
---
 drivers/nvme/host/fc.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/nvme/host/fc.c +9 -1
index 89accc76d71c..bf2ddc6850af 100644
@@ -2802,12 +2802,19 @@ nvme_fc_delete_association(struct nvme_fc_ctrl *ctrl)
 }
 
 static void
-nvme_fc_delete_ctrl(struct nvme_ctrl *nctrl)
+nvme_fc_stop_ctrl(struct nvme_ctrl *nctrl)
 {
 	struct nvme_fc_ctrl *ctrl = to_fc_ctrl(nctrl);
 
 	cancel_work_sync(&ctrl->err_work);
 	cancel_delayed_work_sync(&ctrl->connect_work);
+}
+
+static void
+nvme_fc_delete_ctrl(struct nvme_ctrl *nctrl)
+{
+	struct nvme_fc_ctrl *ctrl = to_fc_ctrl(nctrl);
+
 	/*
 	 * kill the association on the link side.  this will block
 	 * waiting for io to terminate
@@ -2925,6 +2932,7 @@ static const struct nvme_ctrl_ops nvme_fc_ctrl_ops = {
 	.free_ctrl		= nvme_fc_nvme_ctrl_freed,
 	.submit_async_event	= nvme_fc_submit_async_event,
 	.delete_ctrl		= nvme_fc_delete_ctrl,
+	.stop_ctrl		= nvme_fc_stop_ctrl,
 	.get_address		= nvmf_get_address,
 };
 
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 nvme-fc: flush err and connect work in .stop_ctrl

Quoted 35 lines · Sagi Grimberg

Controller op .stop_ctrl was designed to let the driver quiesce any pending works that may be active before starting the controller teardown (delete_ctrl).

Signed-off-by Sagi Grimberg <sagi at grimberg.me>
---
  drivers/nvme/host/fc.c | 10 +++++++++-
  1 file changed, 9 insertions(+), 1 deletion(-)
drivers/nvme/host/fc.c +8 -1
index 89accc76d71c..bf2ddc6850af 100644
@@ -2802,12 +2802,19 @@ nvme_fc_delete_association(struct nvme_fc_ctrl *ctrl)
  }
 
  static void
-nvme_fc_delete_ctrl(struct nvme_ctrl *nctrl)
+nvme_fc_stop_ctrl(struct nvme_ctrl *nctrl)
  {
  	struct nvme_fc_ctrl *ctrl = to_fc_ctrl(nctrl);
 
  	cancel_work_sync(&ctrl->err_work);
  	cancel_delayed_work_sync(&ctrl->connect_work);
+}
+
+static void
+nvme_fc_delete_ctrl(struct nvme_ctrl *nctrl)
+{
+	struct nvme_fc_ctrl *ctrl = to_fc_ctrl(nctrl);
+
  	/*
  	 * kill the association on the link side.  this will block
  	 * waiting for io to terminate

drivers/nvme/host/fc.c static const struct nvme_ctrl_ops nvme_fc_ctrl_ops = { · line 2938

Quoted 7 lines
drivers/nvme/host/fc.c +1 -0
@@ -2925,6 +2932,7 @@ static const struct nvme_ctrl_ops nvme_fc_ctrl_ops = {
  	.free_ctrl		= nvme_fc_nvme_ctrl_freed,
  	.submit_async_event	= nvme_fc_submit_async_event,
  	.delete_ctrl		= nvme_fc_delete_ctrl,
+	.stop_ctrl		= nvme_fc_stop_ctrl,
  	.get_address		= nvmf_get_address,
  };
 

Hmm... I don't remember it being described that way when it was added and when I looked at it then, I had no need for the entrypoint. if all it does is cancel err_work and connect_work, I'm still wondering what it really does/achieves. Killing them off seems weird.

I'll take a closer look at where things sit now.

-- james

author maintainer
#2 lore raw

PATCH 1/1 nvme-fc: flush err and connect work in .stop_ctrl

Quoted 7 lines

Hmm... I don't remember it being described that way when it was added and when I looked at it then, I had no need for the entrypoint. if all it does is cancel err_work and connect_work, I'm still wondering what it really does/achieves. Killing them off seems weird.

I'll take a closer look at where things sit now.

I'm fine with killing those as well.

In fact, if we move err_work and connect_work to nvme_ctrl we can simply have nvme_stop_ctrl flush them... However Christoph asked for a more generic use of these members/routines for that to happen...