Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Tariq Toukan" <tariqt@nvidia.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH net] net/mlx5e: TC, use the owner eswitch for encap neigh updates
Date: Thu, 26 Nov 2026 21:07:37 +0000	[thread overview]
Message-ID: <sashiko-outbox-236193@kernel.org> (raw)
In-Reply-To: <20261125210629.239095-1-tariqt@nvidia.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] net/mlx5e: wrong owner eswitch in mlx5e_attach_encap() on SD
  secondary
--

commit 96c6db1d17691b26e167336b35cba55741af989b
Author: Shay Drory <shayd@nvidia.com>

net/mlx5e: TC, use the owner eswitch for encap neigh updates

This commit stores the owner eswitch uplink priv in struct
mlx5e_encap_entry and uses it for encap neighbour flow updates and entry
release instead of deriving priv from e->out_dev.

> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c
> index 4f9f8beffbc8d..d23cf60613ea7 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c
[ ... ]
> @@ -871,6 +871,7 @@ int mlx5e_attach_encap(struct mlx5e_priv *priv,
>  	init_completion(&e->res_ready);
>  	entry_created = true;
>  	INIT_LIST_HEAD(&e->route_list);
> +	e->priv = netdev_priv(mlx5_eswitch_uplink_get_proto_dev(esw, REP_ETH));
>  
>  	tun_info = mlx5e_dup_tun_info(tun_info);
>  	if (!tun_info) {

[Severity: High]
Does mlx5_eswitch_uplink_get_proto_dev() set e->priv to the primary
eswitch when mlx5e_attach_encap() is called on a Socket Direct secondary
eswitch?

drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c:mlx5_eswitch_uplink_get_proto_dev() {
	struct mlx5_core_dev *primary = mlx5_sd_get_primary(esw->dev);

	if (primary)
		esw = primary->priv.eswitch;

	return mlx5_eswitch_get_proto_dev(esw, MLX5_VPORT_UPLINK, rep_type);
}

When a tunnel encap flow is offloaded on an SD secondary representor,
mlx5e_attach_encap() inserts e into the secondary esw->offloads.encap_tbl,
allocates e->pkt_reformat on the secondary mdev, and installs the origin
flow on the secondary eswitch, while e->priv points to the primary uplink
priv.  A subsequent neighbour update or encap release via e->priv will
lock the primary encap_tbl_lock, update slow-path FDB rules on the primary
eswitch (colliding with the peer flow and unbalancing fs_chains), and
allocate or free e->pkt_reformat on the primary mdev.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261125210629.239095-1-tariqt@nvidia.com?part=1

      reply	other threads:[~2026-11-26 21:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 21:06 [PATCH net] net/mlx5e: TC, use the owner eswitch for encap neigh updates Tariq Toukan
2026-11-26 21:07 ` sashiko-bot [this message]

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=sashiko-outbox-236193@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --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