netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Borislav Petkov <bp@alien8.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Saeed Mahameed <saeedm@nvidia.com>,
	linux-rdma@vger.kernel.org, netdev@vger.kernel.org,
	Jason Gunthorpe <jgg@nvidia.com>,
	Jakub Kicinski <kuba@kernel.org>
Subject: Re: [PATCH 10/11] IB/mlx5: Fix undefined behavior due to shift overflowing the constant
Date: Tue, 5 Apr 2022 21:31:16 +0300	[thread overview]
Message-ID: <YkyK9NfN57ldFuyY@unreal> (raw)
In-Reply-To: <20220405151517.29753-11-bp@alien8.de>

On Tue, Apr 05, 2022 at 05:15:16PM +0200, Borislav Petkov wrote:
> From: Borislav Petkov <bp@suse.de>
> 
> Fix:
> 
>   drivers/infiniband/hw/mlx5/main.c: In function ‘translate_eth_legacy_proto_oper’:
>   drivers/infiniband/hw/mlx5/main.c:370:2: error: case label does not reduce to an integer constant
>     case MLX5E_PROT_MASK(MLX5E_50GBASE_KR2):
>     ^~~~
> 
> See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory
> details as to why it triggers with older gccs only.
> 
> Signed-off-by: Borislav Petkov <bp@suse.de>
> Cc: Leon Romanovsky <leon@kernel.org>
> Cc: Saeed Mahameed <saeedm@nvidia.com>
> Cc: linux-rdma@vger.kernel.org
> Cc: netdev@vger.kernel.org
> ---
>  include/linux/mlx5/port.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

I would like to take this patch to mlx5-next, but it didn't show
nor in patchworks [1] nor in lore [2].

Thanks

[1] https://patchwork.kernel.org/project/linux-rdma/list/
[2] https://lore.kernel.org/linux-rdma/

> 
> diff --git a/include/linux/mlx5/port.h b/include/linux/mlx5/port.h
> index 28a928b0684b..e96ee1e348cb 100644
> --- a/include/linux/mlx5/port.h
> +++ b/include/linux/mlx5/port.h
> @@ -141,7 +141,7 @@ enum mlx5_ptys_width {
>  	MLX5_PTYS_WIDTH_12X	= 1 << 4,
>  };
>  
> -#define MLX5E_PROT_MASK(link_mode) (1 << link_mode)
> +#define MLX5E_PROT_MASK(link_mode) (1U << link_mode)
>  #define MLX5_GET_ETH_PROTO(reg, out, ext, field)	\
>  	(ext ? MLX5_GET(reg, out, ext_##field) :	\
>  	MLX5_GET(reg, out, field))
> -- 
> 2.35.1
> 

  reply	other threads:[~2022-04-05 20:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220405151517.29753-1-bp@alien8.de>
2022-04-05 15:15 ` [PATCH 03/11] bnx2x: Fix undefined behavior due to shift overflowing the constant Borislav Petkov
2022-04-05 19:53   ` Jakub Kicinski
2022-04-05 19:59     ` Borislav Petkov
2022-04-05 15:15 ` [PATCH 06/11] brcmfmac: sdio: " Borislav Petkov
2022-04-05 15:25   ` Kalle Valo
2022-04-05 16:06     ` Borislav Petkov
2022-04-05 16:37       ` Kalle Valo
2022-04-05 16:55         ` [RESEND PATCH " Borislav Petkov
2022-04-05 19:11           ` Arend van Spriel
2022-04-10 12:20           ` Kalle Valo
2022-04-05 15:15 ` [PATCH 08/11] mt76: " Borislav Petkov
2022-04-06  5:43   ` Kalle Valo
2022-04-10 12:20   ` Kalle Valo
2022-04-05 15:15 ` [PATCH 10/11] IB/mlx5: " Borislav Petkov
2022-04-05 18:31   ` Leon Romanovsky [this message]
2022-04-05 19:42     ` Borislav Petkov
2022-04-06  7:17   ` Leon Romanovsky

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=YkyK9NfN57ldFuyY@unreal \
    --to=leon@kernel.org \
    --cc=bp@alien8.de \
    --cc=jgg@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@nvidia.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;
as well as URLs for NNTP newsgroup(s).