Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp912526rdb; Tue, 15 Aug 2023 16:31:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHpfVjfK/Uuz9fLCs6NhIwlKfiHqvBNGi2it4W15eFcJA3ZSkoDxHUktCnE0FXFI63m9eO6 X-Received: by 2002:a05:6a00:1908:b0:680:d00c:b164 with SMTP id y8-20020a056a00190800b00680d00cb164mr249519pfi.34.1692142287869; Tue, 15 Aug 2023 16:31:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692142287; cv=none; d=google.com; s=arc-20160816; b=0Z4nERaCaVaX0eL/xpDFDWslQBSdoUyRDvwIX2z2k41gVzsVORr3h6MyfZ7wIdWa2m +cypU0pnKEp7uOtTtxCRNlK8gRetOIqTRcIjUfqfRzbLm6ocBvRZrR03ZZy9VuCh5GHl sV/L6i2QjoGH15ylgGs+9HIr3FxgsqYaJ68gfaG+EsfOTNu5qbrj8tIbTD+lD3WXfXnX qFkuiqhTnPtd65lSwyCj6rGQIqnHd3XrsDfuj6HnpfU/SN08SunylxKPKceZpbOTXOq/ TWYd26uRNN+aOSHxfsNW0sh4QsiaxBNtv9Lrru8OoFNelO6Gxklg1fiWFn/9qqAyLCP2 mAcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=jA+Z/QVwRMqtv269nO5JRrGiev/TzpvbzmIpcZh4+Uk=; fh=kdHpamQj21Nrqskv7P//9hYK7PbNJA88xhZ7ld74nA4=; b=OFqUz3/JqIAw/L2aHFFGin7PWoIHWD8SBX8bXX0CM6Cf1gFqKbOCWh9ufsO/7pvWx/ SeEPVcI4hkD2EcSbNDFqilP9BpuVxC+1XP1/C1pHcSnUKxPr+JH3MfpoKnBZeNPAHzEJ NPfDxviPkn2+l2TcCnDU0whFou+fuSPzY1LhmeCFpZACYavEbLPLW7hzOlQ/Yqu4j2tb EEIuo+iEbHWf3owqffO7ZCRI2zWNsWR4p5F5ORFxLAeFSXu4AJuXCxunRFQxeFU6hwPv 3jc32XMa2cZ0pVDlXR91zD3t7zlP4KWmK395KMnnU9pXzKnzwOA2IJkIz8EnHEqWYT9u REVg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f3-20020a056a00238300b00687008e7931si10466963pfc.211.2023.08.15.16.31.15; Tue, 15 Aug 2023 16:31:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234506AbjHOEMI (ORCPT + 99 others); Tue, 15 Aug 2023 00:12:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234648AbjHOEKK (ORCPT ); Tue, 15 Aug 2023 00:10:10 -0400 Received: from out30-110.freemail.mail.aliyun.com (out30-110.freemail.mail.aliyun.com [115.124.30.110]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6306D4483; Mon, 14 Aug 2023 20:57:36 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046059;MF=guangguan.wang@linux.alibaba.com;NM=1;PH=DS;RN=14;SR=0;TI=SMTPD_---0Vpq6ttl_1692071851; Received: from 30.221.106.14(mailfrom:guangguan.wang@linux.alibaba.com fp:SMTPD_---0Vpq6ttl_1692071851) by smtp.aliyun-inc.com; Tue, 15 Aug 2023 11:57:33 +0800 Message-ID: <8c5d1a90-6965-f507-a54d-5c420c972306@linux.alibaba.com> Date: Tue, 15 Aug 2023 11:57:25 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [RFC PATCH v2 net-next 1/6] net/smc: support smc release version negotiation in clc handshake To: Wenjia Zhang , jaka@linux.ibm.com, kgraul@linux.ibm.com, tonylu@linux.alibaba.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: horms@kernel.org, alibuda@linux.alibaba.com, guwen@linux.alibaba.com, linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230807062720.20555-1-guangguan.wang@linux.alibaba.com> <20230807062720.20555-2-guangguan.wang@linux.alibaba.com> Content-Language: en-US From: Guangguan Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/8/10 00:03, Wenjia Zhang wrote: > > > On 07.08.23 08:27, Guangguan Wang wrote: >> Support smc release version negotiation in clc handshake. And set >> the latest smc release version to 2.1. >> > > Could you elaborate the changes? Without reading code, it is really difficult to know what you did, and why you did it. Sure, one can read the code and the support document, but the commit message should always be the quick reference. The following information I missed especially: > - This implementation is based on SMCv2 where no negotiation process for different releases, but for different versions. > - The Server makes the decision for which release will be used. Sorry for the lack of descriptions, more descriptions will be added in the next version. >> >> diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c >> index a7f887d91d89..bac73eb0542d 100644 >> --- a/net/smc/af_smc.c >> +++ b/net/smc/af_smc.c >> @@ -1187,6 +1187,11 @@ static int smc_connect_rdma_v2_prepare(struct smc_sock *smc, >>               return SMC_CLC_DECL_NOINDIRECT; >>           } >>       } >> + >> +    if (fce->release > SMC_RELEASE) >> +        return SMC_CLC_DECL_VERSMISMAT; > I'm wondering if this check is necessary, how it could happen? You are right, I will remove the check. >>   -static void smc_clc_fill_fce(struct smc_clc_first_contact_ext *fce, int *len) >> +static void smc_clc_fill_fce(struct smc_clc_first_contact_ext *fce, int *len, int release_ver) >>   { >>       memset(fce, 0, sizeof(*fce)); >>       fce->os_type = SMC_CLC_OS_LINUX; >> -    fce->release = SMC_RELEASE; >> +    fce->release = release_ver; >>       memcpy(fce->hostname, smc_hostname, sizeof(smc_hostname)); >>       (*len) += sizeof(*fce); >>   } > > Personally I'd like release_nr instead of release_ver. >>   @@ -382,7 +403,7 @@ int smc_clc_send_proposal(struct smc_sock *smc, struct smc_init_info *ini); >>   int smc_clc_send_confirm(struct smc_sock *smc, bool clnt_first_contact, >>                u8 version, u8 *eid, struct smc_init_info *ini); >>   int smc_clc_send_accept(struct smc_sock *smc, bool srv_first_contact, >> -            u8 version, u8 *negotiated_eid); >> +            u8 version, u8 *negotiated_eid, struct smc_init_info *ini); >>   void smc_clc_init(void) __init; >>   void smc_clc_exit(void); >>   void smc_clc_get_hostname(u8 **host); >> diff --git a/net/smc/smc_core.h b/net/smc/smc_core.h >> index 3c1b31bfa1cf..1a97fef39127 100644 >> --- a/net/smc/smc_core.h >> +++ b/net/smc/smc_core.h >> @@ -374,6 +374,7 @@ struct smc_init_info { >>       u8            is_smcd; >>       u8            smc_type_v1; >>       u8            smc_type_v2; >> +    u8            release_ver; > > Also here, I'd like release_nr more. OK, I will modify it in the next version.