linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Alistair Francis <alistair23@gmail.com>
To: Martin George <martinus.gpy@gmail.com>
Cc: kbusch@kernel.org, axboe@kernel.dk, hch@lst.de, sagi@grimberg.me,
	 linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
	 Alistair Francis <alistair.francis@wdc.com>
Subject: Re: [PATCH] nvme: Use non zero KATO for persistent discovery connections
Date: Wed, 3 Sep 2025 10:00:36 +1000	[thread overview]
Message-ID: <CAKmqyKNtx-eq-dSgcJqoXjajX--QyBvqwfgKyfTfxiTiF-cFBA@mail.gmail.com> (raw)
In-Reply-To: <2841bd1b7910bd0e1b263b393152f2cb13dd3ae3.camel@gmail.com>

On Tue, Sep 2, 2025 at 8:35 PM Martin George <martinus.gpy@gmail.com> wrote:
>
> On Tue, 2025-09-02 at 13:52 +1000, alistair23@gmail.com wrote:
> > From: Alistair Francis <alistair.francis@wdc.com>
> >
> > 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.
> >
> >
>
> When would this ever happen? Won't nvme-cli & nvme/host/fabrics.c in

It occurs if you perform a `nvme connect` to the discovery nqn of a
Linux target.

> the kernel ensure a PDC (persistent discovery controller) would always
> have the KATO either default set to NVMF_DEF_DISC_TMO (i.e. 30s) or any
> positive int value & not zero?

The kernel doesn't set a default for discovery controllers (hence this patch).

nvme-cli will only set NVMF_DEF_DISC_TMO if the `--persistent`
connection option is supplied to `nvme discover`. But it doesn't set a
KATO for `nvme connect`, even though it's a persistent connection.

Note, that I think that is a bug in nvme-cli and it should be setting
a non zero KATO. I plan on patching that. At the same time if the
kernel knows it's a persistent discovery connection it should also be
setting a default KATO. The kernel is already using a default non-zero
KATO for non discovery nqns (see nvmf_parse_options()). This just
extends the default to apply to persistent discovery controllers.

>
> Do you have a test log for the above scenario where the KATO ends up
> being zero for a PDC?

I do, it's just a lot of keep-alive timeout prints on the target

Alistair

>
> -Martin


      reply	other threads:[~2025-09-03  1:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-02  3:52 [PATCH] nvme: Use non zero KATO for persistent discovery connections alistair23
2025-09-02  8:56 ` Hannes Reinecke
2025-09-02 10:35 ` Martin George
2025-09-03  0:00   ` Alistair Francis [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKmqyKNtx-eq-dSgcJqoXjajX--QyBvqwfgKyfTfxiTiF-cFBA@mail.gmail.com \
    --to=alistair23@gmail.com \
    --cc=alistair.francis@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=martinus.gpy@gmail.com \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).