From: "George, Martin" <Martin.George@netapp.com>
To: "kbusch@kernel.org" <kbusch@kernel.org>,
"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Subject: Re: [PATCH v2] fabrics: ensure zero kato for non-persistent controllers
Date: Mon, 1 Mar 2021 15:48:08 +0000 [thread overview]
Message-ID: <f021a3737cd48447633042ab9c4f078529a917c0.camel@netapp.com> (raw)
In-Reply-To: <20210224105123.7050-2-marting@netapp.com>
Ping?
> Add a helper function that sets the default kato value for the
> controllers. Along with ensuring a non-zero kato value (i.e.
> NVMF_DEF_DISC_TMO) is passed to a persistent discovery controller,
> it also ensures a zero kato is passed to a non-persistent discovery
> controller.
>
> Signed-off-by: Martin George <marting@netapp.com>
> ---
> fabrics.c | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/fabrics.c b/fabrics.c
> index e38657e..c780040 100644
> --- a/fabrics.c
> +++ b/fabrics.c
> @@ -918,6 +918,16 @@ static int build_options(char *argstr, int
> max_len, bool discover)
> return 0;
> }
>
> +static void set_kato(struct config *cfg)
> +{
> + /* Set kato to NVMF_DEF_DISC_TMO for persistent discovery
> controllers */
> + if (cfg->persistent && !cfg->keep_alive_tmo)
> + cfg->keep_alive_tmo = NVMF_DEF_DISC_TMO;
> + /* Set kato to zero for non-persistent discovery controllers
> */
> + else if (!cfg->persistent && (cfg->keep_alive_tmo > 0))
> + cfg->keep_alive_tmo = 0;
> +}
> +
> static void discovery_trsvcid(struct config *cfg)
> {
> if (!strcmp(cfg->transport, "tcp")) {
> @@ -1401,8 +1411,7 @@ static int discover_from_conf_file(const char
> *desc, char *argstr,
> if (err)
> goto free_and_continue;
>
> - if (cfg.persistent && !cfg.keep_alive_tmo)
> - cfg.keep_alive_tmo = NVMF_DEF_DISC_TMO;
> + set_kato(&cfg);
>
> if (traddr_is_hostname(&cfg)) {
> ret = hostname2traddr(&cfg);
> @@ -1476,8 +1485,7 @@ int fabrics_discover(const char *desc, int
> argc, char **argv, bool connect)
> if (!cfg.transport && !cfg.traddr) {
> ret = discover_from_conf_file(desc, argstr, opts,
> connect);
> } else {
> - if (cfg.persistent && !cfg.keep_alive_tmo)
> - cfg.keep_alive_tmo = NVMF_DEF_DISC_TMO;
> + set_kato(&cfg);
>
> if (traddr_is_hostname(&cfg)) {
> ret = hostname2traddr(&cfg);
> --
> 2.30.0
>
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
prev parent reply other threads:[~2021-03-01 15:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-24 10:51 [PATCH v2] fabrics: ensure zero kato for non-persistent controllers Martin George
2021-03-01 15:48 ` George, Martin [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=f021a3737cd48447633042ab9c4f078529a917c0.camel@netapp.com \
--to=martin.george@netapp.com \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
/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