[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e6847761-af77-6673-9e06-cc08eb4ba483@linux.alibaba.com>
Date: Thu, 17 Aug 2023 11:31:22 +0800
From: Guangguan Wang <guangguan.wang@...ux.alibaba.com>
To: Vadim Fedorenko <vadim.fedorenko@...ux.dev>, wenjia@...ux.ibm.com,
jaka@...ux.ibm.com, kgraul@...ux.ibm.com, tonylu@...ux.alibaba.com,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com
Cc: horms@...nel.org, alibuda@...ux.alibaba.com, guwen@...ux.alibaba.com,
linux-s390@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 3/6] net/smc: support smc v2.x features validate
On 2023/8/16 20:49, Vadim Fedorenko wrote:
> On 16/08/2023 09:33, Guangguan Wang wrote:
>> +
>> +int smc_clc_cli_v2x_features_validate(struct smc_clc_first_contact_ext *fce,
>> + struct smc_init_info *ini)
>> +{
>> + if (ini->release_nr < SMC_RELEASE_1)
>> + return 0;
>> +
>> + return 0;
>> +}
>
> This function always returns 0. Is it really what expected?
>
This patch is a frame code of v2x features validate.
Please read the next 2 patches, where will fill more code logic in this function.
[PATCH net-next 4/6] net/smc: support max connections per lgr negotiation
int smc_clc_cli_v2x_features_validate(struct smc_clc_first_contact_ext *fce,
struct smc_init_info *ini)
{
+ struct smc_clc_first_contact_ext_v2x *fce_v2x =
+ (struct smc_clc_first_contact_ext_v2x *)fce;
+
if (ini->release_nr < SMC_RELEASE_1)
return 0;
+ if (!ini->is_smcd) {
+ if (fce_v2x->max_conns < SMC_CONN_PER_LGR_MIN)
+ return SMC_CLC_DECL_MAXCONNERR;
+ ini->max_conns = fce_v2x->max_conns;
+ }
+
return 0;
}
[PATCH net-next 5/6] net/smc: support max links per lgr negotiation in clc handshake
@@ -1208,6 +1216,11 @@ int smc_clc_cli_v2x_features_validate(struct smc_clc_first_contact_ext *fce,
if (fce_v2x->max_conns < SMC_CONN_PER_LGR_MIN)
return SMC_CLC_DECL_MAXCONNERR;
ini->max_conns = fce_v2x->max_conns;
+
+ if (fce_v2x->max_links > SMC_LINKS_ADD_LNK_MAX ||
+ fce_v2x->max_links < SMC_LINKS_ADD_LNK_MIN)
+ return SMC_CLC_DECL_MAXLINKERR;
+ ini->max_links = fce_v2x->max_links;
}
return 0;
Thanks,
Guangguan Wang
Powered by blists - more mailing lists