From: sashiko-bot@kernel.org
To: "Edward Srouji" <edwards@nvidia.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH rdma-next v2] RDMA/mlx5: Add missing error flow in mlx5_ib_set_vport_rep
Date: Mon, 09 Nov 2026 12:36:59 +0000 [thread overview]
Message-ID: <sashiko-outbox-204962@kernel.org> (raw)
In-Reply-To: <20261109-rep-netdev-leak-v2-1-9a6d164142e5@nvidia.com>
> From: Shay Drory <shayd@nvidia.com>
>
> mlx5_ib_set_vport_rep() attaches the representor netdev to the IB
> device, which takes a netdev reference, and then adds the LAG demux
> rule. If mlx5_lag_demux_rule_add() fails, the error is returned
> without detaching the netdev. The eswitch does not call unload() for a
> representor whose load() failed, so the reference is never dropped and
> a later unregister_netdevice() of the representor waits forever while
> holding the eswitch representors lock.
>
> Add the demux rule before publishing the rep and attaching its netdev,
> so a failure there leaves nothing to undo. The rep pointers are still
> set before ib_device_set_netdev() sends the netdev attach event, so a
> listener never sees the attached port without its rep.
>
> If ib_device_set_netdev() fails, delete the demux rule and clear the
> rep pointers. ib_device_set_netdev() cannot fail here, as the port
> index is always valid and the port data was allocated when the uplink
> rep was loaded, so clearing the pointers does not race with lockless
> readers.
>
> Fixes: d6c9b4de8109 ("{net/RDMA}/mlx5: Add LAG demux table API and vport demux rules")
> Signed-off-by: Shay Drory <shayd@nvidia.com>
> Reviewed-by: Chiara Meiohas <cmeiohas@nvidia.com>
> Reviewed-by: Mark Bloch <mbloch@nvidia.com>
> Signed-off-by: Edward Srouji <edwards@nvidia.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261109-rep-netdev-leak-v2-1-9a6d164142e5@nvidia.com?part=1
next prev parent reply other threads:[~2026-11-09 12:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 12:28 [PATCH rdma-next v2] RDMA/mlx5: Add missing error flow in mlx5_ib_set_vport_rep Edward Srouji
2026-11-09 12:36 ` sashiko-bot [this message]
2026-11-11 13:59 ` Leon Romanovsky
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-204962@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=edwards@nvidia.com \
--cc=linux-rdma@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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