Commit 2d352df5 authored by Sagi Grimberg's avatar Sagi Grimberg

nvme-fabrics: allow discovery subsystems accept a kato

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).
Reviewed-by: default avatarMinwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: default avatarJames Smart <james.smart@broadcom.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: default avatarSagi Grimberg <sagi@grimberg.me>
parent 1179d337
...@@ -381,8 +381,8 @@ int nvmf_connect_admin_queue(struct nvme_ctrl *ctrl) ...@@ -381,8 +381,8 @@ int nvmf_connect_admin_queue(struct nvme_ctrl *ctrl)
* Set keep-alive timeout in seconds granularity (ms * 1000) * Set keep-alive timeout in seconds granularity (ms * 1000)
* and add a grace period for controller kato enforcement * and add a grace period for controller kato enforcement
*/ */
cmd.connect.kato = ctrl->opts->discovery_nqn ? 0 : cmd.connect.kato = ctrl->kato ?
cpu_to_le32((ctrl->kato + NVME_KATO_GRACE) * 1000); cpu_to_le32((ctrl->kato + NVME_KATO_GRACE) * 1000) : 0;
if (ctrl->opts->disable_sqflow) if (ctrl->opts->disable_sqflow)
cmd.connect.cattr |= NVME_CONNECT_DISABLE_SQFLOW; cmd.connect.cattr |= NVME_CONNECT_DISABLE_SQFLOW;
...@@ -740,13 +740,6 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts, ...@@ -740,13 +740,6 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
pr_warn("keep_alive_tmo 0 won't execute keep alives!!!\n"); pr_warn("keep_alive_tmo 0 won't execute keep alives!!!\n");
} }
opts->kato = token; opts->kato = token;
if (opts->discovery_nqn && opts->kato) {
pr_err("Discovery controllers cannot accept KATO != 0\n");
ret = -EINVAL;
goto out;
}
break; break;
case NVMF_OPT_CTRL_LOSS_TMO: case NVMF_OPT_CTRL_LOSS_TMO:
if (match_int(args, &token)) { if (match_int(args, &token)) {
...@@ -883,7 +876,6 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts, ...@@ -883,7 +876,6 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
} }
if (opts->discovery_nqn) { if (opts->discovery_nqn) {
opts->kato = 0;
opts->nr_io_queues = 0; opts->nr_io_queues = 0;
opts->nr_write_queues = 0; opts->nr_write_queues = 0;
opts->nr_poll_queues = 0; opts->nr_poll_queues = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment