Skip to content

Commit 2e48265

Browse files
alistair23keithbusch
authored andcommitted
nvme: Use non zero KATO for persistent discovery connections
The NVMe Base Specification 2.1 states that: """ A host requests an explicit persistent connection ... by specifying a non-zero Keep Alive Timer value in the Connect command. """ As such if we are starting a persistent connection to a discovery controller and the KATO is currently 0 we need to update KATO to a non zero value to avoid continuous timeouts on the target. Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <kbusch@kernel.org>
1 parent 2001541 commit 2e48265

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/nvme/host/core.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4991,8 +4991,14 @@ void nvme_start_ctrl(struct nvme_ctrl *ctrl)
49914991
* checking that they started once before, hence are reconnecting back.
49924992
*/
49934993
if (test_bit(NVME_CTRL_STARTED_ONCE, &ctrl->flags) &&
4994-
nvme_discovery_ctrl(ctrl))
4994+
nvme_discovery_ctrl(ctrl)) {
4995+
if (!ctrl->kato) {
4996+
nvme_stop_keep_alive(ctrl);
4997+
ctrl->kato = NVME_DEFAULT_KATO;
4998+
nvme_start_keep_alive(ctrl);
4999+
}
49955000
nvme_change_uevent(ctrl, "NVME_EVENT=rediscover");
5001+
}
49965002

49975003
if (ctrl->queue_count > 1) {
49985004
nvme_queue_scan(ctrl);

0 commit comments

Comments
 (0)