Skip to content

Commit 32feb6d

Browse files
martin-gpyChristoph Hellwig
authored andcommitted
nvme-fabrics: fix kato initialization
Currently kato is initialized to NVME_DEFAULT_KATO for both discovery & i/o controllers. This is a problem specifically for non-persistent discovery controllers since it always ends up with a non-zero kato value. Fix this by initializing kato to zero instead, and ensuring various controllers are assigned appropriate kato values as follows: non-persistent controllers - kato set to zero persistent controllers - kato set to NVMF_DEV_DISC_TMO (or any positive int via nvme-cli) i/o controllers - kato set to NVME_DEFAULT_KATO (or any positive int via nvme-cli) Signed-off-by: Martin George <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 78570f8 commit 32feb6d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/nvme/host/fabrics.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
630630
opts->queue_size = NVMF_DEF_QUEUE_SIZE;
631631
opts->nr_io_queues = num_online_cpus();
632632
opts->reconnect_delay = NVMF_DEF_RECONNECT_DELAY;
633-
opts->kato = NVME_DEFAULT_KATO;
633+
opts->kato = 0;
634634
opts->duplicate_connect = false;
635635
opts->fast_io_fail_tmo = NVMF_DEF_FAIL_FAST_TMO;
636636
opts->hdr_digest = false;
@@ -893,6 +893,9 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
893893
opts->nr_write_queues = 0;
894894
opts->nr_poll_queues = 0;
895895
opts->duplicate_connect = true;
896+
} else {
897+
if (!opts->kato)
898+
opts->kato = NVME_DEFAULT_KATO;
896899
}
897900
if (ctrl_loss_tmo < 0) {
898901
opts->max_reconnects = -1;

0 commit comments

Comments
 (0)