net/mlx5: E-Switch, Fix switching to switchdev mode with IB device disabled
authorPatrisious Haddad <phaddad@nvidia.com>
Tue, 3 Dec 2024 20:49:17 +0000 (22:49 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 5 Dec 2024 03:43:46 +0000 (19:43 -0800)
In case that IB device is already disabled when moving to switchdev mode,
which can happen when working with LAG, need to do rescan_drivers()
before leaving in order to add ethernet representor auxiliary device.

Fixes: ab85ebf43723 ("net/mlx5: E-switch, refactor eswitch mode change")
Signed-off-by: Patrisious Haddad <phaddad@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20241203204920.232744-4-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c

index d6ff2dc4c19e9df18992de2eab07fc68a5f63dcb..5213d5b2cad58dd12719e1faaa4528c81cc8addc 100644 (file)
@@ -2338,6 +2338,7 @@ static void esw_mode_change(struct mlx5_eswitch *esw, u16 mode)
 
        if (esw->dev->priv.flags & MLX5_PRIV_FLAGS_DISABLE_IB_ADEV) {
                esw->mode = mode;
+               mlx5_rescan_drivers_locked(esw->dev);
                mlx5_devcom_comp_unlock(esw->dev->priv.hca_devcom_comp);
                return;
        }