Skip to content

Conversation

@alistair23
Copy link
Contributor

Currently a user can use the nvme discover to connect to a discovery controller. This then allows the user to use a --persistent argument to maintain a persistent or not. This correctly sets a KATO and works as expected.

A user can also perform nvme connect to connect to a discovery controller. In this case a KATO is not specified to the kernel (KATO of 0) yet we are actually creating a persistent connection. This results in the nvme target constantly generating keep-alive timeouts as a Linux target sets a KATO of 120 seconds (as allowed by the spec) yet we have no keep-alive timer running for the persistent connection.

This patch checks if we are connecting to a discovery controller and if we are sets the persistent option to true. We know it's a persistent connection because we are using nvme connect so we want to stay connected.

This fixes an issue where performing a
nvme connect -n nqn.2014-08.org.nvmexpress.discovery ... to a Linux NVMe target would result in constant keep-alive timeouts from the target.

Currently a user can use the `nvme discover` to connect to a discovery
controller. This then allows the user to use a --persistent argument to
maintain a persistent or not. This correctly sets a KATO and works as
expected.

A user can also perform `nvme connect` to connect to a discovery
controller. In this case a KATO is not specified to the kernel (KATO of
0) yet we are actually creating a persistent connection. This results in
the nvme target constantly generating keep-alive timeouts as a Linux
target sets a KATO of 120 seconds (as allowed by the spec) yet we have
no keep-alive timer running for the persistent connection.

This patch checks if we are connecting to a discovery controller and if
we are sets the persistent option to true. We know it's a persistent
connection because we are using `nvme connect` so we want to stay
connected.

This fixes an issue where performing a
`nvme connect -n nqn.2014-08.org.nvmexpress.discovery ... ` to a Linux
NVMe target would result in constant keep-alive timeouts from the
target.

Signed-off-by: Alistair Francis <[email protected]>
@igaw
Copy link
Collaborator

igaw commented Sep 4, 2025

Oh the never ending joy with persistent discovery controllers.

Anyway, makes sense. Thanks!

@igaw igaw merged commit 07e1e53 into linux-nvme:master Sep 4, 2025
14 checks passed
@alistair23 alistair23 deleted the alistair/discover-kato branch September 4, 2025 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants