From: Jiri Pirko Date: Wed, 13 Sep 2023 07:12:33 +0000 (+0200) Subject: net/mlx5: Disable eswitch as the first thing in mlx5_unload() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=85b47dc40bbc72ad68ff9d43bf750290b3c40c2b;p=linux.git net/mlx5: Disable eswitch as the first thing in mlx5_unload() The eswitch disable call does removal of all representors. Do that before clearing the SF device table and maintain the same flow as during SF devlink port removal, where the representor is removed before the actual SF is removed. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index 15561965d2afa..d17c9c31b165d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c @@ -1405,9 +1405,9 @@ err_irq_table: static void mlx5_unload(struct mlx5_core_dev *dev) { + mlx5_eswitch_disable(dev->priv.eswitch); mlx5_devlink_traps_unregister(priv_to_devlink(dev)); mlx5_sf_dev_table_destroy(dev); - mlx5_eswitch_disable(dev->priv.eswitch); mlx5_sriov_detach(dev); mlx5_lag_remove_mdev(dev); mlx5_ec_cleanup(dev);