From: shaozhengchao <shaozhengchao@huawei.com>
To: Wenjia Zhang <wenjia@linux.ibm.com>, <linux-s390@vger.kernel.org>,
<netdev@vger.kernel.org>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>
Cc: <jaka@linux.ibm.com>, <alibuda@linux.alibaba.com>,
<tonylu@linux.alibaba.com>, <guwen@linux.alibaba.com>,
<weiyongjun1@huawei.com>, <yuehaibing@huawei.com>
Subject: Re: [PATCH net-next 2/4] net/smc: remove the fallback in __smc_connect
Date: Thu, 1 Aug 2024 09:22:31 +0800 [thread overview]
Message-ID: <70dea024-dfbe-1679-854f-8477e65bc0f8@huawei.com> (raw)
In-Reply-To: <4232f3fb-4088-41e0-91f7-7813d3bb99e5@linux.ibm.com>
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@huawei.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
next prev parent reply other threads:[~2024-08-01 1:22 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-30 1:25 [PATCH net-next 0/4] net/smc: do some cleanups in smc module Zhengchao Shao
2024-07-30 1:25 ` [PATCH net-next 1/4] net/smc: remove unreferenced header in smc_loopback.h file Zhengchao Shao
2024-07-30 18:55 ` Simon Horman
2024-07-31 3:18 ` D. Wythe
2024-07-31 11:59 ` Wen Gu
2024-07-30 1:25 ` [PATCH net-next 2/4] net/smc: remove the fallback in __smc_connect Zhengchao Shao
2024-07-30 18:57 ` Simon Horman
2024-07-31 15:15 ` Wenjia Zhang
2024-08-01 1:22 ` shaozhengchao [this message]
2024-08-01 7:23 ` Wenjia Zhang
2024-08-01 11:35 ` shaozhengchao
2024-07-30 1:25 ` [PATCH net-next 3/4] net/smc: remove redundant code in smc_connect_check_aclc Zhengchao Shao
2024-07-30 18:58 ` Simon Horman
2024-07-30 1:25 ` [PATCH net-next 4/4] net/smc: remove unused input parameters in smcr_new_buf_create Zhengchao Shao
2024-07-30 18:59 ` Simon Horman
2024-07-31 10:50 ` [PATCH net-next 0/4] net/smc: do some cleanups in smc module patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=70dea024-dfbe-1679-854f-8477e65bc0f8@huawei.com \
--to=shaozhengchao@huawei.com \
--cc=alibuda@linux.alibaba.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=guwen@linux.alibaba.com \
--cc=jaka@linux.ibm.com \
--cc=kuba@kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tonylu@linux.alibaba.com \
--cc=weiyongjun1@huawei.com \
--cc=wenjia@linux.ibm.com \
--cc=yuehaibing@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox