All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Guangguan Wang <guangguan.wang@linux.alibaba.com>
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
Date: Thu, 3 Aug 2023 19:55:51 +0200	[thread overview]
Message-ID: <ZMvqJ6FYR6gWS+ZK@kernel.org> (raw)
In-Reply-To: <20230803132422.6280-5-guangguan.wang@linux.alibaba.com>

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@linux.alibaba.com>
> Reviewed-by: Tony Lu <tonylu@linux.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;

  reply	other threads:[~2023-08-03 17:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-03 13:24 [RFC PATCH net-next 0/6] net/smc: serveral features's implementation for smc v2.1 Guangguan Wang
2023-08-03 13:24 ` [RFC PATCH net-next 1/6] net/smc: support smc release version negotiation in clc handshake Guangguan Wang
2023-08-03 17:42   ` Simon Horman
2023-08-04  3:59     ` Guangguan Wang
2023-08-03 13:24 ` [RFC PATCH net-next 2/6] net/smc: add vendor unique experimental options area " Guangguan Wang
2023-08-03 17:45   ` Simon Horman
2023-08-04  4:02     ` Guangguan Wang
2023-08-03 13:24 ` [RFC PATCH net-next 3/6] net/smc: support smc v2.x features validate Guangguan Wang
2023-08-03 13:24 ` [RFC PATCH net-next 4/6] net/smc: support max connections per lgr negotiation Guangguan Wang
2023-08-03 17:55   ` Simon Horman [this message]
2023-08-04  6:40     ` Guangguan Wang
2023-08-03 13:24 ` [RFC PATCH net-next 5/6] net/smc: support max links per lgr negotiation in clc handshake Guangguan Wang
2023-08-03 13:24 ` [RFC PATCH net-next 6/6] net/smc: Extend SMCR v2 linkgroup netlink attribute Guangguan Wang

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=ZMvqJ6FYR6gWS+ZK@kernel.org \
    --to=horms@kernel.org \
    --cc=alibuda@linux.alibaba.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=guangguan.wang@linux.alibaba.com \
    --cc=guwen@linux.alibaba.com \
    --cc=jaka@linux.ibm.com \
    --cc=kgraul@linux.ibm.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tonylu@linux.alibaba.com \
    --cc=wenjia@linux.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.