From: Leon Romanovsky <leonro@nvidia.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Tariq Toukan <tariqt@nvidia.com>,
"David S. Miller" <davem@davemloft.net>,
Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>,
"Andrew Lunn" <andrew+netdev@lunn.ch>, <netdev@vger.kernel.org>,
Saeed Mahameed <saeedm@nvidia.com>, Gal Pressman <gal@nvidia.com>,
Mark Bloch <mbloch@nvidia.com>, Moshe Shemesh <moshe@nvidia.com>
Subject: Re: [PATCH net 6/8] net/mlx5e: Properly match IPsec subnet addresses
Date: Wed, 15 Jan 2025 10:39:55 +0200 [thread overview]
Message-ID: <20250115083955.GM3146852@unreal> (raw)
In-Reply-To: <20250114183735.15aea391@kernel.org>
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
next prev parent reply other threads:[~2025-01-15 8:40 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-13 15:40 [PATCH net 0/8] mlx5 misc fixes 2025-01-13 Tariq Toukan
2025-01-13 15:40 ` [PATCH net 1/8] net/mlx5: Fix RDMA TX steering prio Tariq Toukan
2025-01-13 18:58 ` Jacob Keller
2025-01-13 15:40 ` [PATCH net 2/8] net/mlx5: Fix a lockdep warning as part of the write combining test Tariq Toukan
2025-01-14 16:33 ` Larysa Zaremba
2025-01-13 15:40 ` [PATCH net 3/8] net/mlx5: SF, Fix add port error handling Tariq Toukan
2025-01-13 19:00 ` Jacob Keller
2025-01-13 15:40 ` [PATCH net 4/8] net/mlx5: Clear port select structure when fail to create Tariq Toukan
2025-01-13 19:00 ` Jacob Keller
2025-01-13 15:40 ` [PATCH net 5/8] net/mlx5e: Fix inversion dependency warning while enabling IPsec tunnel Tariq Toukan
2025-01-13 15:40 ` [PATCH net 6/8] net/mlx5e: Properly match IPsec subnet addresses Tariq Toukan
2025-01-13 19:07 ` Jacob Keller
2025-01-13 19:23 ` Leon Romanovsky
2025-01-13 19:48 ` Jacob Keller
2025-01-15 2:37 ` Jakub Kicinski
2025-01-15 8:39 ` Leon Romanovsky [this message]
2025-01-13 15:40 ` [PATCH net 7/8] net/mlx5e: Rely on reqid in IPsec tunnel mode Tariq Toukan
2025-01-13 19:08 ` Jacob Keller
2025-01-13 15:40 ` [PATCH net 8/8] net/mlx5e: Always start IPsec sequence number from 1 Tariq Toukan
2025-01-13 19:08 ` Jacob Keller
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=20250115083955.GM3146852@unreal \
--to=leonro@nvidia.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gal@nvidia.com \
--cc=kuba@kernel.org \
--cc=mbloch@nvidia.com \
--cc=moshe@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.com \
--cc=tariqt@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).