Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2601290rwo; Thu, 3 Aug 2023 11:50:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlHnQL0Un3Ckt7ZD3Z2dWjQVmP2N0Oby9SBFMje7S9yhpy0+g2tJoVntp1+0pM1vrJJU3Wvr X-Received: by 2002:a05:6102:9cf:b0:444:bb6c:1188 with SMTP id g15-20020a05610209cf00b00444bb6c1188mr7410374vsi.1.1691088613783; Thu, 03 Aug 2023 11:50:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691088613; cv=none; d=google.com; s=arc-20160816; b=zkkA1DQGFMZXWemju+MxTgn6RjFg6QfhYvbt/15mHBRskS2SLwKf4qcfi4pTcrv8wr zDDB9f5Fp3JvFconopYCTXCA+A3K50yGSG24k+rblfgw9VBi8M+pGDuSWE5mi3LOLh+o aspEhxiHnVNNHxm5ciWoW2UA7i7QlCrOW5IqR05zfm6mBD62ceYFZrIkwvwNal33ksUn Yh7FyvoR8Ce/3I7hHRnEFTefoEOnqCPv6b76I1MqkTU70VoXNrzKq23h0sI+iFwOE9Wb pWR+M6gi0T4vjBMQGm1hV1gstPENtSCykXzULoL6Cf1tONbfmxu/byxFn5chV6w7wqxz BxSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=O39u/X0Va9d7OUvP5KSXVJGoMdtxFCLmU3KrwhMNPf4=; fh=Hy2FJTcW6jS241wy3YFtpY6l9iOLxY7KM+SfYMAuaIc=; b=oTfICKzpUisPdGMANaRFKd/ru0geT6xI/E5dZa1P2U5YC33se4AV7CDM7W5dp9TsVa xXS6qd51UnFNLzzaP/kos7dO2gEK/tqcF9ldC/9vP6MOyaKkzunnfYZ7rTabpSSBQa7V FhDWvN1pWq1qlm9jo3wxoWExwKo767Vn2PDZFIRWgfRPDAOjfaB7yeh6PxFbvSgiZrgx k6lR1zm4PqJ/FiL6Xpdc/79PuqjaMTnePcMrrBF0FRm63/X3SEUytqvSEFB09uUApsKF mjYZ0ypZPabz5UR1++dqbkwNZi6inmrNfPHWjp+g6UKFInzvl/aEKcMO2yviHW9Q4VLN gsFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jcEqo1tt; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h27-20020a63121b000000b005641697e83asi378194pgl.131.2023.08.03.11.50.01; Thu, 03 Aug 2023 11:50:13 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jcEqo1tt; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233956AbjHCRz7 (ORCPT + 99 others); Thu, 3 Aug 2023 13:55:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230460AbjHCRz6 (ORCPT ); Thu, 3 Aug 2023 13:55:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81E711704; Thu, 3 Aug 2023 10:55:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 168CF61E4E; Thu, 3 Aug 2023 17:55:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA11BC433C7; Thu, 3 Aug 2023 17:55:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691085356; bh=4Ld8BAA+kCjrI9UjzRHJmebdxcphDEau9AAkrxrmt0Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jcEqo1ttrHtdrmdbxjI4EIrA4Rp4zLKc4mTyg0RFpWsDA49uQ2wTILEfw2qBtW9A1 c6itAceQ7mGduut5TpowbfaNjCnBFQIRzg4EaDcdowIu4YqjpYipidJIhm7v31xk8g ELd2Y7l0nN3yVnQ+0gpmrAm+KdnG30Bbej04iRusdm/jqDaPDzQVQp6yC5MfZ0dkks GadS93Lcjq1wZ3Bm6aiwsqtKvMTJTNPGYFPltsgI75Y+9vt0W/vAfG/gPIZnKHjVLv LQE5ewkZ//zE8gctYXVuQetXo+5a/hJsTRWzJm1f+qoZXMIKdbdaS5btzwua7/ovlB FKARp59C2gjPw== Date: Thu, 3 Aug 2023 19:55:51 +0200 From: Simon Horman To: Guangguan Wang Cc: wenjia@linux.ibm.com, jaka@linux.ibm.com, kgraul@linux.ibm.com, tonylu@linux.alibaba.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, alibuda@linux.alibaba.com, guwen@linux.alibaba.com, linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH net-next 4/6] net/smc: support max connections per lgr negotiation Message-ID: References: <20230803132422.6280-1-guangguan.wang@linux.alibaba.com> <20230803132422.6280-5-guangguan.wang@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230803132422.6280-5-guangguan.wang@linux.alibaba.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 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 > Reviewed-by: Tony Lu ... 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;