[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250115083955.GM3146852@unreal>
Date: Wed, 15 Jan 2025 10:39:55 +0200
From: Leon Romanovsky <leonro@...dia.com>
To: Jakub Kicinski <kuba@...nel.org>
CC: Tariq Toukan <tariqt@...dia.com>, "David S. Miller" <davem@...emloft.net>,
Paolo Abeni <pabeni@...hat.com>, Eric Dumazet <edumazet@...gle.com>, "Andrew
Lunn" <andrew+netdev@...n.ch>, <netdev@...r.kernel.org>, Saeed Mahameed
<saeedm@...dia.com>, Gal Pressman <gal@...dia.com>, Mark Bloch
<mbloch@...dia.com>, Moshe Shemesh <moshe@...dia.com>
Subject: Re: [PATCH net 6/8] net/mlx5e: Properly match IPsec subnet addresses
On Tue, Jan 14, 2025 at 06:37:35PM -0800, Jakub Kicinski wrote:
> On Mon, 13 Jan 2025 17:40:52 +0200 Tariq Toukan wrote:
> > +static void addr4_to_mask(__be32 *addr, __be32 *mask)
> > +{
> > + int i;
> > +
> > + *mask = 0;
> > + for (i = 0; i < 4; i++)
> > + *mask |= ((*addr >> 8 * i) & 0xFF) ? (0xFF << 8 * i) : 0;
>
> sparse is unimpressed with the lack of byteswaps here.
>
> drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c:1159:28: warning: restricted __be32 degrades to integer
> drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c:1159:23: warning: invalid assignment: |=
> drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c:1159:23: left side has type restricted __be32
> drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c:1159:23: right side has type int
Strange that I didn't get such errors from kbuild, I kept this patch in
my tree for approximately month, before we sent it.
>
>
> Maybe just force cast to u32 inside the helper, and add a comment why?
> Or just byte swap.
Thanks, will try.
>
> Also from the word mask and subnet in the commit message it sounds like
> you are shooting for a prefix. But this does "byte enable" kind of
> thing :S Think 10.0.55.0/24. Maybe mention if this is intentional in
> a comment, too.
It is not essential, I need to take into account subnet too.
Tariq, please drop this patch for now.
Thanks
Powered by blists - more mailing lists