Skip to contentSkip to conversation

fabrics: ensure zero kato for non-persistent controllers

PATCH Superseded Martin George 3 participants 4 messages Feb 18, 2021 – Feb 23, 2021 NVMe

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fabrics: ensure zero kato for non-persistent controllers

Along with ensuring a non-zero kato is passed to a persistent discovery controller, also ensure a zero kato is passed to a non-persistent discovery controller.

---
 fabrics.c | 4 ++++
 1 file changed, 4 insertions(+)
fabrics.c +4 -0
index 1880a5d..ed15e08 100644
@@ -1399,6 +1399,8 @@ static int discover_from_conf_file(const char *desc, char *argstr,
 
 		if (cfg.persistent && !cfg.keep_alive_tmo)
 			cfg.keep_alive_tmo = NVMF_DEF_DISC_TMO;
+		else if (!cfg.persistent && (cfg.keep_alive_tmo > 0))
+			cfg.keep_alive_tmo = 0;
 
 		if (traddr_is_hostname(&cfg)) {
 			ret = hostname2traddr(&cfg);
@@ -1474,6 +1476,8 @@ int fabrics_discover(const char *desc, int argc, char **argv, bool connect)
 	} else {
 		if (cfg.persistent && !cfg.keep_alive_tmo)
 			cfg.keep_alive_tmo = NVMF_DEF_DISC_TMO;
+		else if (!cfg.persistent && (cfg.keep_alive_tmo > 0))
+			cfg.keep_alive_tmo = 0;
 
 		if (traddr_is_hostname(&cfg)) {
 			ret = hostname2traddr(&cfg);
Signature · 7 lines
2.30.0


_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
#1 lore raw

Ping?

Quoted 33 lines · Martin George

Along with ensuring a non-zero kato is passed to a persistent discovery controller, also ensure a zero kato is passed to a non-persistent discovery controller.

---
 fabrics.c | 4 ++++
 1 file changed, 4 insertions(+)
fabrics.c +2 -0
index 1880a5d..ed15e08 100644
@@ -1399,6 +1399,8 @@ static int discover_from_conf_file(const char
 *desc, char *argstr,
 
                if (cfg.persistent && !cfg.keep_alive_tmo)
                        cfg.keep_alive_tmo = NVMF_DEF_DISC_TMO;
+               else if (!cfg.persistent && (cfg.keep_alive_tmo > 0))
+                       cfg.keep_alive_tmo = 0;
 
                if (traddr_is_hostname(&cfg)) {
                        ret = hostname2traddr(&cfg);
fabrics.c +2 -0
@@ -1474,6 +1476,8 @@ int fabrics_discover(const char *desc, int
 argc, char **argv, bool connect)
        } else {
                if (cfg.persistent && !cfg.keep_alive_tmo)
                        cfg.keep_alive_tmo = NVMF_DEF_DISC_TMO;
+               else if (!cfg.persistent && (cfg.keep_alive_tmo > 0))
+                       cfg.keep_alive_tmo = 0;
 
                if (traddr_is_hostname(&cfg)) {
                        ret = hostname2traddr(&cfg);
Quoted 3 lines

--
2.30.0

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

#2 lore raw
Quoted 34 lines · Martin

Ping?

Quoted 31 lines · Martin George

Along with ensuring a non-zero kato is passed to a persistent discovery controller, also ensure a zero kato is passed to a non-persistent discovery controller.

---
 fabrics.c | 4 ++++
 1 file changed, 4 insertions(+)
fabrics.c +2 -0
index 1880a5d..ed15e08 100644
@@ -1399,6 +1399,8 @@ static int discover_from_conf_file(const char
 *desc, char *argstr,
 
                if (cfg.persistent && !cfg.keep_alive_tmo)
                        cfg.keep_alive_tmo = NVMF_DEF_DISC_TMO;
+               else if (!cfg.persistent && (cfg.keep_alive_tmo > 0))
+                       cfg.keep_alive_tmo = 0;
 
                if (traddr_is_hostname(&cfg)) {
                        ret = hostname2traddr(&cfg);
fabrics.c +2 -0
@@ -1474,6 +1476,8 @@ int fabrics_discover(const char *desc, int
 argc, char **argv, bool connect)
        } else {
                if (cfg.persistent && !cfg.keep_alive_tmo)
                        cfg.keep_alive_tmo = NVMF_DEF_DISC_TMO;
+               else if (!cfg.persistent && (cfg.keep_alive_tmo > 0))
+                       cfg.keep_alive_tmo = 0;
 
Quoted 2 lines
Quoted 2 lines
fabrics.c +0 -0
                if (traddr_is_hostname(&cfg)) {
                        ret = hostname2traddr(&cfg);

Is that if else if ladder code is repeated ? if so can you please add a helper ?
unless there is a reason for keeping the duplicate code. Also can we remove () for (cfg.keep_alive_tmo > 0) condition ?

Quoted 8 lines
Quoted 3 lines

--
2.30.0

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

#3 lore raw
Quoted 38 lines · Chaitanya Kulkarni
Quoted 37 lines · Martin

Ping?

Quoted 34 lines · Martin George

Along with ensuring a non-zero kato is passed to a persistent discovery controller, also ensure a zero kato is passed to a non-persistent discovery controller.

---
 fabrics.c | 4 ++++
 1 file changed, 4 insertions(+)
fabrics.c +0 -0
index 1880a5d..ed15e08 100644
@@ -1399,6 +1399,8 @@ static int discover_from_conf_file(const

char
*desc, char *argstr,

                if (cfg.persistent && !cfg.keep_alive_tmo)
                        cfg.keep_alive_tmo = NVMF_DEF_DISC_TMO;

+ else if (!cfg.persistent && (cfg.keep_alive_tmo >
0))

fabrics.c +3 -0
+                       cfg.keep_alive_tmo = 0;
 
                if (traddr_is_hostname(&cfg)) {
                        ret = hostname2traddr(&cfg);
@@ -1474,6 +1476,8 @@ int fabrics_discover(const char *desc, int
 argc, char **argv, bool connect)
        } else {
                if (cfg.persistent && !cfg.keep_alive_tmo)
                        cfg.keep_alive_tmo = NVMF_DEF_DISC_TMO;
+               else if (!cfg.persistent && (cfg.keep_alive_tmo >
 0))
+                       cfg.keep_alive_tmo = 0;
 
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
                if (traddr_is_hostname(&cfg)) {
                        ret = hostname2traddr(&cfg);

Is that if else if ladder code is repeated ? if so can you please add a
helper ?
unless there is a reason for keeping the duplicate code.

Ok. Will write a helper function for this and resend the patch.

Quoted 1 line

Also can we remove () for (cfg.keep_alive_tmo > 0) condition ?

I'd prefer keeping the parentheses here to be on the safer side, unless there is a strong argument against it.

-Martin
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme