From: Moshe Shemesh <moshe@nvidia.com>
To: Tariq Toukan <tariqt@nvidia.com>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>
Cc: Saeed Mahameed <saeedm@nvidia.com>,
Leon Romanovsky <leon@kernel.org>, Mark Bloch <mbloch@nvidia.com>,
Akiva Goldberger <agoldberger@nvidia.com>,
<netdev@vger.kernel.org>, <linux-rdma@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, Gal Pressman <gal@nvidia.com>,
Dragos Tatulea <dtatulea@nvidia.com>,
Simon Horman <horms@kernel.org>
Subject: Re: [PATCH net-next V2 3/8] net/mlx5: Use mlx5_eswitch_is_vf_vport() for IPsec VF checks
Date: Tue, 19 May 2026 18:54:41 +0300 [thread overview]
Message-ID: <224f77b0-245c-46ec-b4d2-67055337e819@nvidia.com> (raw)
In-Reply-To: <20260518071356.345723-4-tariqt@nvidia.com>
On 5/18/2026 10:13 AM, Tariq Toukan wrote:
> From: Moshe Shemesh <moshe@nvidia.com>
>
> IPsec eswitch offload operations and the enabled_ipsec_vf_count counter
> are intended for VF vports only. Replace the MLX5_VPORT_HOST_PF checks
> with mlx5_eswitch_is_vf_vport() to properly identify VF vports, as
> preparation for adding another type of PF vports.
>
> Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
> Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec.c | 2 +-
> drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec.c
> index 4811b60ea430..b830ccd91e62 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec.c
> @@ -209,7 +209,7 @@ static int esw_ipsec_vf_offload_set_bytype(struct mlx5_eswitch *esw, struct mlx5
> struct mlx5_core_dev *dev = esw->dev;
> int err;
>
> - if (vport->vport == MLX5_VPORT_HOST_PF)
> + if (!mlx5_eswitch_is_vf_vport(esw, vport->vport))
> return -EOPNOTSUPP;
>
> if (type == MLX5_ESW_VPORT_IPSEC_CRYPTO_OFFLOAD) {
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> index 8b62dde7eb70..9a7de7c9a667 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> @@ -958,7 +958,7 @@ int mlx5_esw_vport_enable(struct mlx5_eswitch *esw, struct mlx5_vport *vport,
> /* Sync with current vport context */
> vport->enabled_events = enabled_events;
> vport->enabled = true;
> - if (vport->vport != MLX5_VPORT_HOST_PF &&
> + if (mlx5_eswitch_is_vf_vport(esw, vport_num) &&
> (vport->info.ipsec_crypto_enabled || vport->info.ipsec_packet_enabled))
> esw->enabled_ipsec_vf_count++;
>
Sashiko.dev says:
" This isn't a regression introduced by this patch, but is it possible
for enabled_ipsec_vf_count to leak in the error path?"
As it says, pre-existing bug, not related to this patch change.
I will have a separate patch to fix that.
> @@ -1020,7 +1020,7 @@ void mlx5_esw_vport_disable(struct mlx5_eswitch *esw, struct mlx5_vport *vport)
> mlx5_esw_vport_vhca_id_unmap(esw, vport);
> }
>
> - if (vport->vport != MLX5_VPORT_HOST_PF &&
> + if (mlx5_eswitch_is_vf_vport(esw, vport_num) &&
> (vport->info.ipsec_crypto_enabled || vport->info.ipsec_packet_enabled))
> esw->enabled_ipsec_vf_count--;
>
Sashiko.dev says:
" This isn't a regression introduced by this patch, but does this logic
handle the case where both crypto and packet offloads are enabled on a
single VF via devlink? "
Same here.
next prev parent reply other threads:[~2026-05-19 15:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-18 7:13 [PATCH net-next V2 0/8] net/mlx5: Prepare eswitch infrastructure for satellite PF support Tariq Toukan
2026-05-18 7:13 ` [PATCH net-next V2 1/8] net/mlx5: Use helper to parse host PF info Tariq Toukan
2026-05-18 7:13 ` [PATCH net-next V2 2/8] net/mlx5: Use v1 response layout for query_esw_functions Tariq Toukan
2026-05-18 7:13 ` [PATCH net-next V2 3/8] net/mlx5: Use mlx5_eswitch_is_vf_vport() for IPsec VF checks Tariq Toukan
2026-05-19 15:54 ` Moshe Shemesh [this message]
2026-05-18 7:13 ` [PATCH net-next V2 4/8] net/mlx5: Switch vport HCA cap helpers to kvzalloc Tariq Toukan
2026-05-19 15:50 ` Moshe Shemesh
2026-05-18 7:13 ` [PATCH net-next V2 5/8] net/mlx5: Add mlx5_vport_set_other_func_general_cap macro Tariq Toukan
2026-05-18 7:13 ` [PATCH net-next V2 6/8] net/mlx5: Refactor mlx5_set_msix_vec_count() SET_HCA_CAP Tariq Toukan
2026-05-18 7:13 ` [PATCH net-next V2 7/8] net/mlx5: Use vport helper for IPsec eswitch set caps Tariq Toukan
2026-05-18 7:13 ` [PATCH net-next V2 8/8] net/mlx5: Generalize enable/disable HCA for any PF vport Tariq Toukan
2026-05-21 10:20 ` [PATCH net-next V2 0/8] net/mlx5: Prepare eswitch infrastructure for satellite PF support patchwork-bot+netdevbpf
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=224f77b0-245c-46ec-b4d2-67055337e819@nvidia.com \
--to=moshe@nvidia.com \
--cc=agoldberger@nvidia.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=dtatulea@nvidia.com \
--cc=edumazet@google.com \
--cc=gal@nvidia.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mbloch@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
all inboxes | Powered by JetHome®