lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 4 Aug 2023 14:40:27 +0800
From: Guangguan Wang <guangguan.wang@...ux.alibaba.com>
To: Simon Horman <horms@...nel.org>
Cc: 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, alibuda@...ux.alibaba.com,
 guwen@...ux.alibaba.com, linux-s390@...r.kernel.org, netdev@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH net-next 4/6] net/smc: support max connections per lgr
 negotiation

Got it.
I will remove the check in the next version.

Thanks,
Guangguan Wang

On 2023/8/4 01:55, Simon Horman wrote:
> On Thu, Aug 03, 2023 at 09:24:20PM +0800, Guangguan Wang wrote:
>> Support max connections per lgr negotiation for SMCR v2.1,
>> which is one of smc v2.1 features.
>>
>> Signed-off-by: Guangguan Wang <guangguan.wang@...ux.alibaba.com>
>> Reviewed-by: Tony Lu <tonylu@...ux.alibaba.com>
> 
> ...
> 
> Hi Guangguan Wang,
> 
>>  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_ver < SMC_RELEASE_1)
>>  		return 0;
>>  
>> +	if (!ini->is_smcd) {
>> +		if (fce_v2x->max_conns > SMC_CONN_PER_LGR_MAX)
> 
> The type of the max_cons field is u8.
> The value of SMC_CONN_PER_LGR_MAX is 255 (in another patch of this series),
> the maximum value that the max_cons field can be assigned.
> So it seems that this condition cannot ever be true.
> 
> As flagged by Smatch.
> 
>> +			return SMC_CLC_DECL_MAXCONNERR;
>> +		ini->max_conns = fce_v2x->max_conns;
>> +	}
>> +
>>  	return 0;
>>  }
> 
> ...
> 
>> diff --git a/net/smc/smc_clc.h b/net/smc/smc_clc.h
> 
> ...
> 
>> @@ -236,7 +238,8 @@ struct smc_clc_first_contact_ext {
>>  
>>  struct smc_clc_first_contact_ext_v2x {
>>  	struct smc_clc_first_contact_ext fce_v20;
>> -	u8 reserved3[4];
>> +	u8 max_conns; /* for SMC-R only */
>> +	u8 reserved3[3];
>>  	__be32 vendor_exp_options;
>>  	u8 reserved4[8];
>>  } __packed;		/* format defined in
> 
> ...
> 
>> diff --git a/net/smc/smc_core.h b/net/smc/smc_core.h
>> index 1a97fef39127..065369dc6584 100644
>> --- a/net/smc/smc_core.h
>> +++ b/net/smc/smc_core.h
>> @@ -22,6 +22,7 @@
>>  #include "smc_ib.h"
>>  
>>  #define SMC_RMBS_PER_LGR_MAX	255	/* max. # of RMBs per link group */
>> +#define SMC_CONN_PER_LGR_MAX	255	/* max. # of connections per link group */
>>  
>>  struct smc_lgr_list {			/* list of link group definition */
>>  	struct list_head	list;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ