From: sagi@grimberg.me (Sagi Grimberg)
Subject: [PATCH v2 1/3] nvme-fabrics: allow discovery subsystems accept a kato
Date: Fri, 12 Jul 2019 11:02:09 -0700 [thread overview]
Message-ID: <20190712180211.26333-2-sagi@grimberg.me> (raw)
In-Reply-To: <20190712180211.26333-1-sagi@grimberg.me>
This modifies the behavior of discovery subsystems to accept
a kato as a preparation to support discovery log change
events. This also means that now every discovery controller
will have a default kato value, and for non-persistent connections
the host needs to pass in a zero kato value (keep_alive_tmo=0).
Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
---
drivers/nvme/host/fabrics.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index 1994d5b42f94..d0d066307bb4 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -381,8 +381,8 @@ int nvmf_connect_admin_queue(struct nvme_ctrl *ctrl)
* Set keep-alive timeout in seconds granularity (ms * 1000)
* and add a grace period for controller kato enforcement
*/
- cmd.connect.kato = ctrl->opts->discovery_nqn ? 0 :
- cpu_to_le32((ctrl->kato + NVME_KATO_GRACE) * 1000);
+ cmd.connect.kato = ctrl->kato ?
+ cpu_to_le32((ctrl->kato + NVME_KATO_GRACE) * 1000) : 0;
if (ctrl->opts->disable_sqflow)
cmd.connect.cattr |= NVME_CONNECT_DISABLE_SQFLOW;
@@ -738,13 +738,6 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
pr_warn("keep_alive_tmo 0 won't execute keep alives!!!\n");
}
opts->kato = token;
-
- if (opts->discovery_nqn && opts->kato) {
- pr_err("Discovery controllers cannot accept KATO != 0\n");
- ret = -EINVAL;
- goto out;
- }
-
break;
case NVMF_OPT_CTRL_LOSS_TMO:
if (match_int(args, &token)) {
@@ -865,7 +858,6 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
}
if (opts->discovery_nqn) {
- opts->kato = 0;
opts->nr_io_queues = 0;
opts->nr_write_queues = 0;
opts->nr_poll_queues = 0;
--
2.17.1
next prev parent reply other threads:[~2019-07-12 18:02 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-12 18:02 [PATCH v2 0/3] Support discovery log change events Sagi Grimberg
2019-07-12 18:02 ` Sagi Grimberg [this message]
2019-07-14 8:08 ` [PATCH v2 1/3] nvme-fabrics: allow discovery subsystems accept a kato Minwoo Im
2019-07-14 15:00 ` James Smart
2019-07-19 13:48 ` Hannes Reinecke
2019-07-12 18:02 ` [PATCH v2 2/3] nvme: enable aen also for discovery controllers Sagi Grimberg
2019-07-14 8:09 ` Minwoo Im
2019-07-14 15:04 ` James Smart
2019-07-19 13:49 ` Hannes Reinecke
2019-07-12 18:02 ` [PATCH v2 3/3] nvme: fire discovery log page change events to userspace Sagi Grimberg
2019-07-14 8:14 ` Minwoo Im
2019-07-14 15:13 ` James Smart
2019-07-19 13:49 ` Hannes Reinecke
[not found] ` <20190822002328.GP9511@lst.de>
[not found] ` <205d06ab-fedc-739d-323f-b358aff2cbfe@grimberg.me>
[not found] ` <e4603511-6dae-e26d-12a9-e9fa727a8d03@grimberg.me>
[not found] ` <20190826065639.GA11036@lst.de>
[not found] ` <20190826075916.GA30396@kroah.com>
[not found] ` <ac168168-fed2-2b57-493e-e88261ead73b@grimberg.me>
[not found] ` <20190830055514.GC8492@lst.de>
2019-08-30 18:08 ` Sagi Grimberg
2019-08-30 18:36 ` James Smart
2019-08-30 21:07 ` Sagi Grimberg
2019-08-30 22:24 ` James Smart
2019-09-09 15:10 ` Hannes Reinecke
[not found] ` <20190830062036.GA15257@kroah.com>
2019-08-30 18:14 ` Sagi Grimberg
2019-09-02 19:33 ` Greg Kroah-Hartman
2019-09-04 1:35 ` Sagi Grimberg
2019-09-04 5:25 ` Greg Kroah-Hartman
2019-08-01 1:32 ` [PATCH v2 0/3] Support discovery log change events Sagi Grimberg
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=20190712180211.26333-2-sagi@grimberg.me \
--to=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).