From: Jakub Kicinski <kuba@kernel.org>
To: Tariq Toukan <tariqt@nvidia.com>
Cc: "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>,
Leon Romanovsky <leonro@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: Tue, 14 Jan 2025 18:37:35 -0800 [thread overview]
Message-ID: <20250114183735.15aea391@kernel.org> (raw)
In-Reply-To: <20250113154055.1927008-7-tariqt@nvidia.com>
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
Maybe just force cast to u32 inside the helper, and add a comment why?
Or just byte swap.
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.
next prev parent reply other threads:[~2025-01-15 2:37 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 [this message]
2025-01-15 8:39 ` Leon Romanovsky
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=20250114183735.15aea391@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gal@nvidia.com \
--cc=leonro@nvidia.com \
--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).