summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorChris Mi <cmi@nvidia.com>2022-12-21 12:14:37 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-02-01 10:34:23 +0300
commitd0453c63d38e1468db579cd8be5cec4b62d6f4c8 (patch)
tree74f8e0db54035ba954f56497a7cc83b2ab82cf9b /drivers
parenta03b6ef0f6dbab7f4e63b6ffa4bb82bbcf59317d (diff)
downloadlinux-d0453c63d38e1468db579cd8be5cec4b62d6f4c8.tar.xz
net/mlx5: E-switch, Fix switchdev mode after devlink reload
[ Upstream commit 7c83d1f4c5adae9583e7fca1e3e830d6b061522d ] The cited commit removes eswitch mode none. So after devlink reload in switchdev mode, eswitch mode is not changed. But actually eswitch is disabled during devlink reload. Fix it by setting eswitch mode to legacy when disabling eswitch which is called by reload_down. Fixes: f019679ea5f2 ("net/mlx5: E-switch, Remove dependency between sriov and eswitch mode") Signed-off-by: Chris Mi <cmi@nvidia.com> Reviewed-by: Roi Dayan <roid@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/eswitch.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index 788a6ab5c463..43ba00d5e36e 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -1421,6 +1421,7 @@ void mlx5_eswitch_disable(struct mlx5_eswitch *esw)
mlx5_lag_disable_change(esw->dev);
down_write(&esw->mode_lock);
mlx5_eswitch_disable_locked(esw);
+ esw->mode = MLX5_ESWITCH_LEGACY;
up_write(&esw->mode_lock);
mlx5_lag_enable_change(esw->dev);
}