nvme: move nvme_stop_keep_alive() back to original position
Subsystems (2)
PATCH 1/1 nvme: move nvme_stop_keep_alive() back to original position
Stopping keep-alive not only stops the keep-alive workqueue, but also needs to be synchronized with I/O termination as we must not send a keep-alive command after all I/O had been terminated.
So to avoid any regressions move the call to stop_keep_alive() back to its original position and ensure that keep-alive is correctly stopped failing to setup the admin queue.
--- drivers/nvme/host/core.c | 2 +- drivers/nvme/host/fc.c | 19 ++++++++----------- drivers/nvme/host/rdma.c | 1 + drivers/nvme/host/tcp.c | 1 + 4 files changed, 11 insertions(+), 12 deletions(-)
drivers/nvme/host/core.c +1 -1
@@ -482,7 +482,6 @@ EXPORT_SYMBOL_GPL(nvme_cancel_tagset);void nvme_cancel_admin_tagset (struct nvme_ctrl *ctrl) { -nvme_stop_keep_alive (ctrl);if (ctrl->admin_tagset) {blk_mq_tagset_busy_iter (ctrl->admin_tagset, nvme_cancel_request, ctrl);
@@ -4355,6 +4354,7 @@ void nvme_stop_ctrl(struct nvme_ctrl *ctrl) {nvme_mpath_stop (ctrl);nvme_auth_stop (ctrl); +nvme_stop_keep_alive (ctrl);nvme_stop_failfast_work (ctrl);flush_work (&ctrl->async_event_work);cancel_work_sync (&ctrl->fw_act_work);
drivers/nvme/host/fc.c +8 -11
@@ -2530,12 +2530,6 @@ __nvme_fc_abort_outstanding_ios(struct nvme_fc_ctrl *ctrl, bool start_queues)* clean up the admin queue. Same thing as above. */ nvme_quiesce_admin_queue (&ctrl->ctrl); - -/* -* Open-coding nvme_cancel_admin_tagset() as fc -* is not using nvme_cancel_request(). -*/ -nvme_stop_keep_alive (&ctrl->ctrl);blk_sync_queue (ctrl->ctrl.admin_q);blk_mq_tagset_busy_iter (&ctrl->admin_tag_set, nvme_fc_terminate_exchange, &ctrl->ctrl);
@@ -3138,11 +3132,12 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl)nvme_unquiesce_admin_queue (&ctrl->ctrl); ret =nvme_init_ctrl_finish (&ctrl->ctrl, false); -if (!ret &&test_bit (ASSOC_FAILED , &ctrl->flags)) - ret = -EIO ;if (ret) goto out_disconnect_admin_queue; - +if (test_bit (ASSOC_FAILED , &ctrl->flags)) { + ret = -EIO ; + goto out_stop_keep_alive; + }/* sanity checks */ /* FC-NVME does not have other data in the capsule */
@@ -3150,7 +3145,7 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl)dev_err (ctrl->ctrl.device,"icdoff %d is not supported!\n" , ctrl->ctrl.icdoff); ret =NVME_SC_INVALID_FIELD |NVME_SC_DNR ; - goto out_disconnect_admin_queue; + goto out_stop_keep_alive; }/* FC-NVME supports normal SGL Data Block Descriptors */
@@ -3158,7 +3153,7 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl)dev_err (ctrl->ctrl.device,"Mandatory sgls are not supported!\n" ); ret =NVME_SC_INVALID_FIELD |NVME_SC_DNR ; - goto out_disconnect_admin_queue; + goto out_stop_keep_alive; }if (opts->queue_size > ctrl->ctrl.maxcmd) {
@@ -3205,6 +3200,8 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl) out_term_aen_ops:nvme_fc_term_aen_ops (ctrl); +out_stop_keep_alive: +nvme_stop_keep_alive (&ctrl->ctrl); out_disconnect_admin_queue: dev_warn(ctrl->ctrl.device, "NVME-FC{%d}: create_assoc failed, assoc_id %llx ret %d\n",
drivers/nvme/host/rdma.c +1 -0
@@ -1080,6 +1080,7 @@ static int nvme_rdma_setup_ctrl(struct nvme_rdma_ctrl *ctrl, bool new)nvme_rdma_free_io_queues (ctrl); } destroy_admin: +nvme_stop_keep_alive (&ctrl->ctrl);nvme_quiesce_admin_queue (&ctrl->ctrl);blk_sync_queue (ctrl->ctrl.admin_q);nvme_rdma_stop_queue (&ctrl->queues[0 ]);
drivers/nvme/host/tcp.c +1 -0
@@ -2237,6 +2237,7 @@ static int nvme_tcp_setup_ctrl(struct nvme_ctrl *ctrl, bool new)nvme_tcp_destroy_io_queues (ctrl, new); } destroy_admin: +nvme_stop_keep_alive (ctrl);nvme_tcp_teardown_admin_queue (ctrl, false);return ret; }
Signature · 1 line
2.35.3
Sagi Grimberg
maintainerQuoted 10 lines
Stopping keep-alive not only stops the keep-alive workqueue, but also needs to be synchronized with I/O termination as we must not send a keep-alive command after all I/O had been terminated.
So to avoid any regressions move the call tostop_keep_alive()back to its original position and ensure that keep-alive is correctly stopped failing to setup the admin queue.Fixes 4733b65d82bd ("nvme: start keep-alive after admin queue setup")
It should be folded in I guess. I suggest to either suggest an alternative phrasing of the patch or resend an alternative patch set.
Quoted 113 lines
Suggested-by Sagi Grimberg <[email protected]>Signed-off-by Hannes Reinecke <[email protected]>--- drivers/nvme/host/core.c | 2 +- drivers/nvme/host/fc.c | 19 ++++++++----------- drivers/nvme/host/rdma.c | 1 + drivers/nvme/host/tcp.c | 1 + 4 files changed, 11 insertions(+), 12 deletions(-)drivers/nvme/host/core.c +1
-1@@ -482,7 +482,6 @@ EXPORT_SYMBOL_GPL(nvme_cancel_tagset);void nvme_cancel_admin_tagset (struct nvme_ctrl *ctrl) { -nvme_stop_keep_alive (ctrl);if (ctrl->admin_tagset) {blk_mq_tagset_busy_iter (ctrl->admin_tagset, nvme_cancel_request, ctrl);@@ -4355,6 +4354,7 @@ void nvme_stop_ctrl(struct nvme_ctrl *ctrl) {nvme_mpath_stop (ctrl);nvme_auth_stop (ctrl); +nvme_stop_keep_alive (ctrl);nvme_stop_failfast_work (ctrl);flush_work (&ctrl->async_event_work);cancel_work_sync (&ctrl->fw_act_work);drivers/nvme/host/fc.c +8
-11@@ -2530,12 +2530,6 @@ __nvme_fc_abort_outstanding_ios(struct nvme_fc_ctrl *ctrl, bool start_queues)* clean up the admin queue. Same thing as above. */ nvme_quiesce_admin_queue (&ctrl->ctrl); - -/* -* Open-coding nvme_cancel_admin_tagset() as fc -* is not using nvme_cancel_request(). -*/ -nvme_stop_keep_alive (&ctrl->ctrl);blk_sync_queue (ctrl->ctrl.admin_q);blk_mq_tagset_busy_iter (&ctrl->admin_tag_set, nvme_fc_terminate_exchange, &ctrl->ctrl);@@ -3138,11 +3132,12 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl)nvme_unquiesce_admin_queue (&ctrl->ctrl); ret =nvme_init_ctrl_finish (&ctrl->ctrl, false); -if (!ret &&test_bit (ASSOC_FAILED , &ctrl->flags)) - ret = -EIO ;if (ret) goto out_disconnect_admin_queue; - +if (test_bit (ASSOC_FAILED , &ctrl->flags)) { + ret = -EIO ; + goto out_stop_keep_alive; + }/* sanity checks */ /* FC-NVME does not have other data in the capsule */ @@ -3150,7 +3145,7 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl)dev_err (ctrl->ctrl.device,"icdoff %d is not supported!\n" , ctrl->ctrl.icdoff); ret =NVME_SC_INVALID_FIELD |NVME_SC_DNR ; - goto out_disconnect_admin_queue; + goto out_stop_keep_alive; }/* FC-NVME supports normal SGL Data Block Descriptors */ @@ -3158,7 +3153,7 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl)dev_err (ctrl->ctrl.device,"Mandatory sgls are not supported!\n" ); ret =NVME_SC_INVALID_FIELD |NVME_SC_DNR ; - goto out_disconnect_admin_queue; + goto out_stop_keep_alive; }if (opts->queue_size > ctrl->ctrl.maxcmd) {@@ -3205,6 +3200,8 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl) out_term_aen_ops:nvme_fc_term_aen_ops (ctrl); +out_stop_keep_alive: +nvme_stop_keep_alive (&ctrl->ctrl); out_disconnect_admin_queue: dev_warn(ctrl->ctrl.device, "NVME-FC{%d}: create_assoc failed, assoc_id %llx ret %d\n",drivers/nvme/host/rdma.c +1
-0@@ -1080,6 +1080,7 @@ static int nvme_rdma_setup_ctrl(struct nvme_rdma_ctrl *ctrl, bool new)nvme_rdma_free_io_queues (ctrl); } destroy_admin: +nvme_stop_keep_alive (&ctrl->ctrl);nvme_quiesce_admin_queue (&ctrl->ctrl);blk_sync_queue (ctrl->ctrl.admin_q);nvme_rdma_stop_queue (&ctrl->queues[0 ]);drivers/nvme/host/tcp.c +1
-0@@ -2237,6 +2237,7 @@ static int nvme_tcp_setup_ctrl(struct nvme_ctrl *ctrl, bool new)nvme_tcp_destroy_io_queues (ctrl, new); } destroy_admin: +nvme_stop_keep_alive (ctrl);nvme_tcp_teardown_admin_queue (ctrl, false);return ret; }
Quoted 9 lines · Sagi Grimberg
Quoted 9 lines
Stopping keep-alive not only stops the keep-alive workqueue, but also needs to be synchronized with I/O termination as we must not send a keep-alive command after all I/O had been terminated.
So to avoid any regressions move the call tostop_keep_alive()back to its original position and ensure that keep-alive is correctly stopped failing to setup the admin queue.
Quoted 6 lines
Quoted 1 line
Fixes 4733b65d82bd ("nvme: start keep-alive after admin queue setup")It should be folded in I guess. I suggest to either suggest an alternative phrasing of the patch or resend an alternative patch set.
Well, the original patch has already been merged to the nvme-6.7 tree, so I've attached the 'Fixes' tag.
But let me know how you'd like to play it.
Cheers,
Hannes
Signature · 5 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), GF: Ivo Totev, Andrew McDonald, Werner Knoblich
Keith Busch
maintainerQuoted 12 lines · Hannes Reinecke
Quoted 11 lines · Sagi Grimberg
Quoted 10 lines
Stopping keep-alive not only stops the keep-alive workqueue, but also needs to be synchronized with I/O termination as we must not send a keep-alive command after all I/O had been terminated.
So to avoid any regressions move the call tostop_keep_alive()back to its original position and ensure that keep-alive is correctly stopped failing to setup the admin queue.Fixes 4733b65d82bd ("nvme: start keep-alive after admin queue setup")
Quoted 7 lines
Quoted 4 lines
It should be folded in I guess. I suggest to either suggest an alternative phrasing of the patch or resend an alternative patch set.
Well, the original patch has already been merged to the nvme-6.7 tree, so I've attached the 'Fixes' tag.
But let me know how you'd like to play it.
It's not just in nvme-6.7; it's merged upstream too. We can't squash it now, so is it okay to apply this update as-is for the next pull request? I'm going to send the next one out tomorrow before US holiday.
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 10 lines
Stopping keep-alive not only stops the keep-alive workqueue, but also needs to be synchronized with I/O termination as we must not send a keep-alive command after all I/O had been terminated.
So to avoid any regressions move the call tostop_keep_alive()back to its original position and ensure that keep-alive is correctly stopped failing to setup the admin queue.Fixes 4733b65d82bd ("nvme: start keep-alive after admin queue setup")It should be folded in I guess. I suggest to either suggest an alternative phrasing of the patch or resend an alternative patch set.
Quoted 7 lines
Quoted 3 lines
Well, the original patch has already been merged to the nvme-6.7 tree, so I've attached the 'Fixes' tag.
But let me know how you'd like to play it.It's not just in nvme-6.7; it's merged upstream too. We can't squash it now, so is it okay to apply this update as-is for the next pull request? I'm going to send the next one out tomorrow before US holiday.
Right, I didn't reach the PR email that was sent. Lets send the patch as is. You can add my:
Keith Busch
maintainerQuoted 19 lines · Sagi Grimberg
Quoted 19 lines
Quoted 18 lines
Quoted 9 lines
Quoted 9 lines
Stopping keep-alive not only stops the keep-alive workqueue, but also needs to be synchronized with I/O termination as we must not send a keep-alive command after all I/O had been terminated.
So to avoid any regressions move the call tostop_keep_alive()back to its original position and ensure that keep-alive is correctly stopped failing to setup the admin queue.Quoted 6 lines
Quoted 1 line
Fixes 4733b65d82bd ("nvme: start keep-alive after admin queue setup")It should be folded in I guess. I suggest to either suggest an alternative phrasing of the patch or resend an alternative patch set.
Well, the original patch has already been merged to the nvme-6.7 tree, so I've attached the 'Fixes' tag.
But let me know how you'd like to play it.
Quoted 7 lines
Quoted 3 lines
It's not just in nvme-6.7; it's merged upstream too. We can't squash it now, so is it okay to apply this update as-is for the next pull request? I'm going to send the next one out tomorrow before US holiday.
Right, I didn't reach the PR email that was sent. Lets send the patch as is. You can add my:
Reviewed-by Sagi Grimberg <[email protected]>
Thanks, queued up now for nvme-6.7.