Re: [PATCH net] net/mlx5: Attach late uplink netdev to loaded representors

From: Jianbo Liu

Date: Wed Oct 14 2026 - 03:28:36 EST




On 10/13/2026 7:23 PM, Paolo Abeni wrote:
On 10/6/26 13:02, Tariq Toukan wrote:
From: Jianbo Liu <jianbol@xxxxxxxxxx>

mlx5e_vport_uplink_rep_load() returns success when the uplink netdev is
missing, so the ETH rep is marked loaded with a NULL netdev, the IB rep
copies that NULL association, and nothing repairs it later. Unbind
mlx5_core.eth.<N> in legacy mode, enter switchdev, bind it again, and
rdma link show still reports no netdev on the uplink port. The netdev
also keeps the NIC profile instead of the uplink rep profile.

Add an attach_uplink_netdev rep op, run from the existing reload-reps
work once mlx5_core_uplink_netdev_set() reports a netdev. ETH re-runs
the uplink load, switching profile and setting rpriv->netdev; IB redoes
ib_device_set_netdev(). Deferring to the work keeps the devlink lock
out of probe context.

Fixes: 6b4be64fd9fe ("net/mlx5e: Harden uplink netdev access against device unbind")
Signed-off-by: Jianbo Liu <jianbol@xxxxxxxxxx>
Reviewed-by: Shay Drori <shayd@xxxxxxxxxx>
Signed-off-by: Tariq Toukan <tariqt@xxxxxxxxxx>
The AI feedback looks relevant, also this looks quite too big/dangerous
for net at this point of the cycle.

Agreed. The missing uplink netdev is a corner case rather than a recent
regression, so I will retarget v2 to net-next. It also relies on
mlx5_esw_add_work(), added this cycle in 2a110ee54e89 ("net/mlx5:
E-Switch, introduce generic work queue dispatch helper"), which is newer
than the Fixes commit, so it would not backport to stable as is.

I will address the Sashiko bot comments in v2.

Thanks,
Jianbo