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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <70dea024-dfbe-1679-854f-8477e65bc0f8@huawei.com>
Date: Thu, 1 Aug 2024 09:22:31 +0800
From: shaozhengchao <shaozhengchao@...wei.com>
To: Wenjia Zhang <wenjia@...ux.ibm.com>, <linux-s390@...r.kernel.org>,
	<netdev@...r.kernel.org>, <davem@...emloft.net>, <edumazet@...gle.com>,
	<kuba@...nel.org>, <pabeni@...hat.com>
CC: <jaka@...ux.ibm.com>, <alibuda@...ux.alibaba.com>,
	<tonylu@...ux.alibaba.com>, <guwen@...ux.alibaba.com>,
	<weiyongjun1@...wei.com>, <yuehaibing@...wei.com>
Subject: Re: [PATCH net-next 2/4] net/smc: remove the fallback in
 __smc_connect

Hi Wenjia Zhang:
    Looks like the logic you're saying is okay. Do I need another patch
to perfect it? As below:
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index 73a875573e7a..b23d15506afc 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -1523,7 +1523,7 @@ static int __smc_connect(struct smc_sock *smc)
                 ini->smcd_version &= ~SMC_V1;
                 ini->smcr_version = 0;
                 ini->smc_type_v1 = SMC_TYPE_N;
-               if (!ini->smcd_version) {
+               if (!smc_ism_is_v2_capable()) {
                         rc = SMC_CLC_DECL_GETVLANERR;
                         goto fallback;
                 }


Thank you

Zhengchao Shao

On 2024/7/31 23:15, Wenjia Zhang wrote:
> 
> 
> On 30.07.24 03:25, Zhengchao Shao wrote:
>> When the SMC client begins to connect to server, smcd_version is set
>> to SMC_V1 + SMC_V2. If fail to get VLAN ID, only SMC_V2 information
>> is left in smcd_version. And smcd_version will not be changed to 0.
>> Therefore, remove the fallback caused by the failure to get VLAN ID.
>>
>> Signed-off-by: Zhengchao Shao <shaozhengchao@...wei.com>
>> ---
>>   net/smc/af_smc.c | 4 ----
>>   1 file changed, 4 deletions(-)
>>
>> diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
>> index 73a875573e7a..83f5a1849971 100644
>> --- a/net/smc/af_smc.c
>> +++ b/net/smc/af_smc.c
>> @@ -1523,10 +1523,6 @@ static int __smc_connect(struct smc_sock *smc)
>>           ini->smcd_version &= ~SMC_V1;
>>           ini->smcr_version = 0;
>>           ini->smc_type_v1 = SMC_TYPE_N;
>> -        if (!ini->smcd_version) {
>> -            rc = SMC_CLC_DECL_GETVLANERR;
>> -            goto fallback;
>> -        }
>>       }
>>       rc = smc_find_proposal_devices(smc, ini);
> 
> Though you're right that here smcd_version never gets 0, it actually is 
> a bug from ("42042dbbc2eb net/smc: prepare for SMC-Rv2 connection"). The 
> purpose of the check here was to fallback at a early phase before 
> calling smc_find_proposal_devices(). However, this change is not wrong, 
> just I personally like adding a check for smc_ism_is_v2_capable() more.
> 
> Thanks,
> Wenjia

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ