Skip to contentSkip to conversation

nvme-fabrics: Prevent KATO to be set as 0

PATCH Superseded Guilherme G. Piccoli 2 participants 6 messages Aug 29, 2017 – Sep 14, 2017 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 nvme-fabrics: Prevent KATO to be set as 0

Since the debug feature of setting KATO to 0 is not working anymore, remove it from code. If user sets it to 0, default value will be explicitly used.

Signed-off-by Guilherme G. Piccoli <gpiccoli at linux.vnet.ibm.com>
---
 drivers/nvme/host/fabrics.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/nvme/host/fabrics.c +4 -4
index 5f5cd306f76d..5055a61e3a34 100644
@@ -565,6 +565,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
 	opts->queue_size = NVMF_DEF_QUEUE_SIZE;
 	opts->nr_io_queues = num_online_cpus();
 	opts->reconnect_delay = NVMF_DEF_RECONNECT_DELAY;
+	opts->kato = NVME_DEFAULT_KATO;
 
 	options = o = kstrdup(buf, GFP_KERNEL);
 	if (!options)
@@ -666,9 +667,10 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
 				ret = -EINVAL;
 				goto out;
 			} else if (token == 0) {
-				/* Allowed for debug */
-				pr_warn("keep_alive_tmo 0 won't execute keep alives!!!\n");
+				pr_info("Default value used for keep_alive_tmo\n");
+				break;
 			}
+
 			opts->kato = token;
 			break;
 		case NVMF_OPT_CTRL_LOSS_TMO:
@@ -761,8 +763,6 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
 	uuid_copy(&opts->host->id, &hostid);
 
 out:
-	if (!opts->discovery_nqn && !opts->kato)
-		opts->kato = NVME_DEFAULT_KATO;
 	kfree(options);
 	return ret;
 }
Signature · 1 line
2.14.1
maintainer
#1 lore raw

PATCH v2 1/1 nvme-fabrics: Prevent KATO to be set as 0

Quoted 4 lines

Since the debug feature of setting KATO to 0 is not working anymore, remove it from code. If user sets it to 0, default value will be explicitly used.

Why not allowing it? its pretty useful for testing.

#2 lore raw

PATCH v2 1/1 nvme-fabrics: Prevent KATO to be set as 0

Quoted 7 lines · Sagi Grimberg
Quoted 4 lines

Since the debug feature of setting KATO to 0 is not working anymore, remove it from code. If user sets it to 0, default value will be explicitly used.

Why not allowing it? its pretty useful for testing.

Okay, so I misinterpreted your last message.

My understanding was that since the condition was added in some point of time, the possibility of KATO being set to 0 was "indirectly" dropped and your suggestion was to _drop it officially_.

My bad...

So, please clarify it to me: do we want to allow a 0 value for KATO? If yes, no piece of code is needed in the target to stop sending keep alives? The way it "works" today (aka my 1st patch), if we set KATO as 0, we get timeout right after connection. When I first set KATO to 0 in my debug, I was expecting to disable keep alives, not getting timeouts heheh

So, the purpose of KATO == 0 is to:

(a) Get timeouts right after the connection is complete and keep getting them forever? Or...

(b) Disable keep alives at all? (and in this case, we need to inform the target to not send keep alives in case of a 0 valued kato).

Thanks in advance,

Guilherme

#3 lore raw

PATCH v2 1/1 nvme-fabrics: Prevent KATO to be set as 0

Ping?

Sorry to bother BTW Sagi!

Thanks,

Guilherme

Quoted 43 lines · Guilherme G. Piccoli
Quoted 7 lines · Sagi Grimberg
Quoted 4 lines

Since the debug feature of setting KATO to 0 is not working anymore, remove it from code. If user sets it to 0, default value will be explicitly used.

Why not allowing it? its pretty useful for testing.

Okay, so I misinterpreted your last message.

My understanding was that since the condition was added in some point of time, the possibility of KATO being set to 0 was "indirectly" dropped and your suggestion was to _drop it officially_.

My bad...

So, please clarify it to me: do we want to allow a 0 value for KATO? If yes, no piece of code is needed in the target to stop sending keep alives? The way it "works" today (aka my 1st patch), if we set KATO as 0, we get timeout right after connection. When I first set KATO to 0 in my debug, I was expecting to disable keep alives, not getting timeouts heheh

So, the purpose of KATO == 0 is to:

(a) Get timeouts right after the connection is complete and keep getting them forever? Or...

(b) Disable keep alives at all? (and in this case, we need to inform the target to not send keep alives in case of a 0 valued kato).

Thanks in advance,

Guilherme

_______________________________________________
Linux-nvme mailing list
Linux-nvme at lists.infradead.org
https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.infradead.org_mailman_listinfo_linux-2Dnvme&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=JNsEpjN-AKdNDGXVjcVd1PT1_7ZCB_y_oCbTTJnWaYY&m=nEcjZMh5qfdije9oLG9947mjYG382gLZUZ3Pt6otzoc&s=XNrF6NkOC2uJSNRcC1LESJT2hNYUG6NFJrNFIbseEAk&e=

maintainer
#4 lore raw

PATCH v2 1/1 nvme-fabrics: Prevent KATO to be set as 0

Quoted 10 lines
Quoted 10 lines

My bad...

So, please clarify it to me: do we want to allow a 0 value for KATO? If yes, no piece of code is needed in the target to stop sending keep alives? The way it "works" today (aka my 1st patch), if we set KATO as 0, we get timeout right after connection. When I first set KATO to 0 in my debug, I was expecting to disable keep alives, not getting timeouts heheh

Quoted 7 lines
Quoted 7 lines

So, the purpose of KATO == 0 is to:

(a) Get timeouts right after the connection is complete and keep getting them forever? Or...

(b) Disable keep alives at all? (and in this case, we need to inform the target to not send keep alives in case of a 0 valued kato).

Its just a simple way to test that the target does comply to the kato by not sending it a keep-alive and wait for it to teardown the controller, seems useful to keep to have a sanity check that it doesn't break.

So lets go with (a)

#5 lore raw

PATCH v2 1/1 nvme-fabrics: Prevent KATO to be set as 0

Quoted 7 lines · Sagi Grimberg

Its just a simple way to test that the target does comply to the kato by not sending it a keep-alive and wait for it to teardown the controller, seems useful to keep to have a sanity check that it doesn't break.

So lets go with (a)

Thanks a lot Sagi for the good explanation.
Just sent a V3.

Cheers,

Guilherme