Skip to content

Commit d04c81a

Browse files
PatrisiousHaddadkuba-moo
authored andcommitted
net/mlx5: E-Switch, Fix switching to switchdev mode in MPV
Fix the mentioned commit change for MPV mode, since in MPV mode the IB device is shared between different core devices, so under this change when moving both devices simultaneously to switchdev mode the IB device removal and re-addition can race with itself causing unexpected behavior. In such case do rescan_drivers() only once in order to add the ethernet representor auxiliary device, and skip adding and removing IB devices. Fixes: ab85ebf ("net/mlx5: E-switch, refactor eswitch mode change") Signed-off-by: Patrisious Haddad <[email protected]> Reviewed-by: Mark Bloch <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 5f9b2bf commit d04c81a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2335,8 +2335,8 @@ static int esw_create_restore_table(struct mlx5_eswitch *esw)
23352335
static void esw_mode_change(struct mlx5_eswitch *esw, u16 mode)
23362336
{
23372337
mlx5_devcom_comp_lock(esw->dev->priv.hca_devcom_comp);
2338-
2339-
if (esw->dev->priv.flags & MLX5_PRIV_FLAGS_DISABLE_IB_ADEV) {
2338+
if (esw->dev->priv.flags & MLX5_PRIV_FLAGS_DISABLE_IB_ADEV ||
2339+
mlx5_core_mp_enabled(esw->dev)) {
23402340
esw->mode = mode;
23412341
mlx5_rescan_drivers_locked(esw->dev);
23422342
mlx5_devcom_comp_unlock(esw->dev->priv.hca_devcom_comp);

0 commit comments

Comments
 (0)