All of lore.kernel.org
 help / color / mirror / Atom feed
From: sagi@grimberg.me (Sagi Grimberg)
Subject: [PATCH rfc 1/3] nvme-fabrics: allow discovery subsystems accept a kato
Date: Thu,  4 Oct 2018 14:23:24 -0700	[thread overview]
Message-ID: <20181004212328.30205-2-sagi@grimberg.me> (raw)
In-Reply-To: <20181004212328.30205-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 | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index 40f7e6feeadc..863f83052c95 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -389,8 +389,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;
@@ -743,13 +743,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)) {
@@ -845,11 +838,8 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
 		}
 	}
 
-	if (opts->discovery_nqn) {
-		opts->kato = 0;
+	if (opts->discovery_nqn)
 		opts->nr_io_queues = 0;
-		opts->duplicate_connect = true;
-	}
 	if (ctrl_loss_tmo < 0)
 		opts->max_reconnects = -1;
 	else
-- 
2.17.1

  reply	other threads:[~2018-10-04 21:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-04 21:23 [PATCH rfc 0/3] add support to discovery async event notifications Sagi Grimberg
2018-10-04 21:23 ` Sagi Grimberg [this message]
2018-10-05  5:50   ` [PATCH rfc 1/3] nvme-fabrics: allow discovery subsystems accept a kato Hannes Reinecke
2018-10-04 21:23 ` [PATCH rfc 2/3] nvme: enable aen also for discovery controllers Sagi Grimberg
2018-10-05  5:51   ` Hannes Reinecke
2018-10-04 21:23 ` [PATCH rfc 3/3] nvme: fire discovery log page change events to userspace Sagi Grimberg
2018-10-05  5:51   ` Hannes Reinecke
2018-10-04 21:23 ` [PATCH 4/3 rfc nvme-cli] fabrics: support persistent connections to a discovery controller Sagi Grimberg
2018-10-04 21:23 ` [PATCH 5/3 rfc nvme-cli] fabrics: allow user to retrieve discovery log from existing " Sagi Grimberg
2018-10-05  5:50 ` [PATCH rfc 0/3] add support to discovery async event notifications Hannes Reinecke
2018-10-05  7:08   ` Sagi Grimberg
2018-10-05  7:36     ` Hannes Reinecke
2018-10-05 19:34       ` Sagi Grimberg
2018-10-16  1:11         ` Sagi Grimberg
2018-10-16  5:59           ` Hannes Reinecke
2018-10-16 17:59             ` James Smart
2018-10-17 15:29               ` Hannes Reinecke
2018-10-19  0:44                 ` Sagi Grimberg
2018-10-19 16:09                 ` James Smart
2018-10-17  0:38             ` 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=20181004212328.30205-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.