net/mlx5: E-switch, Fix switchdev mode after devlink reload
authorChris Mi <cmi@nvidia.com>
Wed, 21 Dec 2022 09:14:37 +0000 (11:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Feb 2023 07:34:23 +0000 (08:34 +0100)
commitd0453c63d38e1468db579cd8be5cec4b62d6f4c8
tree74f8e0db54035ba954f56497a7cc83b2ab82cf9b
parenta03b6ef0f6dbab7f4e63b6ffa4bb82bbcf59317d
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>
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c