[PATCH] fabrics: ensure zero kato for non-persistent controllers

Chaitanya Kulkarni Chaitanya.Kulkarni at wdc.com
Tue Feb 23 01:06:57 EST 2021


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 at 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 at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-nvme
>




More information about the Linux-nvme mailing list