* [PATCH] fabrics: ensure zero kato for non-persistent controllers
@ 2021-02-18 9:54 Martin George
2021-02-23 5:41 ` George, Martin
0 siblings, 1 reply; 4+ messages in thread
From: Martin George @ 2021-02-18 9:54 UTC (permalink / raw)
To: linux-nvme; +Cc: 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.
Signed-off-by: Martin George <marting@netapp.com>
---
fabrics.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fabrics.c b/fabrics.c
index 1880a5d..ed15e08 100644
--- a/fabrics.c
+++ b/fabrics.c
@@ -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);
--
2.30.0
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] fabrics: ensure zero kato for non-persistent controllers
2021-02-18 9:54 [PATCH] fabrics: ensure zero kato for non-persistent controllers Martin George
@ 2021-02-23 5:41 ` George, Martin
2021-02-23 6:06 ` Chaitanya Kulkarni
0 siblings, 1 reply; 4+ messages in thread
From: George, Martin @ 2021-02-23 5:41 UTC (permalink / raw)
To: linux-nvme
Ping?
On Thu, 2021-02-18 at 15:24 +0530, Martin George wrote:
> 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.
>
> Signed-off-by: Martin George <marting@netapp.com>
> ---
> fabrics.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/fabrics.c b/fabrics.c
> index 1880a5d..ed15e08 100644
> --- a/fabrics.c
> +++ b/fabrics.c
> @@ -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);
> --
> 2.30.0
>
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] fabrics: ensure zero kato for non-persistent controllers
2021-02-23 5:41 ` George, Martin
@ 2021-02-23 6:06 ` Chaitanya Kulkarni
2021-02-23 9:56 ` George, Martin
0 siblings, 1 reply; 4+ messages in thread
From: Chaitanya Kulkarni @ 2021-02-23 6:06 UTC (permalink / raw)
To: George, Martin; +Cc: linux-nvme
On 2/22/21 21:47, George, Martin wrote:
> Ping?
>
> On Thu, 2021-02-18 at 15:24 +0530, Martin George wrote:
>> 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.
>>
>> Signed-off-by: Martin George <marting@netapp.com>
>> ---
>> fabrics.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/fabrics.c b/fabrics.c
>> index 1880a5d..ed15e08 100644
>> --- a/fabrics.c
>> +++ b/fabrics.c
>> @@ -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);
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 ?
>> --
>> 2.30.0
>>
> _______________________________________________
> Linux-nvme mailing list
> Linux-nvme@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-nvme
>
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] fabrics: ensure zero kato for non-persistent controllers
2021-02-23 6:06 ` Chaitanya Kulkarni
@ 2021-02-23 9:56 ` George, Martin
0 siblings, 0 replies; 4+ messages in thread
From: George, Martin @ 2021-02-23 9:56 UTC (permalink / raw)
To: Chaitanya.Kulkarni; +Cc: linux-nvme
On Tue, 2021-02-23 at 06:06 +0000, Chaitanya Kulkarni wrote:
> On 2/22/21 21:47, George, Martin wrote:
> > Ping?
> >
> > On Thu, 2021-02-18 at 15:24 +0530, Martin George wrote:
> > > 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.
> > >
> > > Signed-off-by: Martin George <marting@netapp.com>
> > > ---
> > > fabrics.c | 4 ++++
> > > 1 file changed, 4 insertions(+)
> > >
> > > diff --git a/fabrics.c b/fabrics.c
> > > index 1880a5d..ed15e08 100644
> > > --- a/fabrics.c
> > > +++ b/fabrics.c
> > > @@ -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);
> 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.
> 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
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-02-23 9:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-18 9:54 [PATCH] fabrics: ensure zero kato for non-persistent controllers Martin George
2021-02-23 5:41 ` George, Martin
2021-02-23 6:06 ` Chaitanya Kulkarni
2021-02-23 9:56 ` George, Martin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).