Skip to contentSkip to conversation

nvmet: Disable keep-alive timer when kato is cleared to 0h

PATCH New [email protected] 1 participant 1 message Aug 19, 2020

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

PATCH 1/1 nvmet: Disable keep-alive timer when kato is cleared to 0h

From: Amit Engel <[email protected]>

Based on nvme spec, when keep alive timeout is set to zero the keep-alive timer should be disabled.

---
 drivers/nvme/target/core.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/nvme/target/core.c +6 -0
index b92f45f5cd5b..c052c922853a 100644
@@ -397,6 +397,9 @@ static void nvmet_keep_alive_timer(struct work_struct *work)
 
 static void nvmet_start_keep_alive_timer(struct nvmet_ctrl *ctrl)
 {
+	if (unlikely(ctrl->kato == 0))
+		return;
+
 	pr_debug("ctrl %d start keep-alive timer for %d secs\n",
 		ctrl->cntlid, ctrl->kato);
 
@@ -406,6 +409,9 @@ static void nvmet_start_keep_alive_timer(struct nvmet_ctrl *ctrl)
 
 static void nvmet_stop_keep_alive_timer(struct nvmet_ctrl *ctrl)
 {
+	if (unlikely(ctrl->kato == 0))
+		return;
+
 	pr_debug("ctrl %d stop keep-alive\n", ctrl->cntlid);
 
 	cancel_delayed_work_sync(&ctrl->ka_work);
Signature · 7 lines
2.16.5


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