]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net/mlx5: E-switch, Destroy TSAR after reload interface
authorParav Pandit <parav@mellanox.com>
Sat, 27 Jun 2020 10:11:56 +0000 (13:11 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Aug 2020 07:58:42 +0000 (09:58 +0200)
[ Upstream commit 0c2600c619578f759cf3d5192b01bd14e281f24c ]

When eswitch offloads is enabled, TSAR is created before reloading
the interfaces.
However when eswitch offloads mode is disabled, TSAR is disabled before
reloading the interfaces.

To keep the eswitch enable/disable sequence as mirror, destroy TSAR
after reloading the interfaces.

Fixes: 1bd27b11c1df ("net/mlx5: Introduce E-switch QoS management")
Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c

index 459cd668b9e2fe36d9a30c92450152eb7cba0f3a..3bb4f72b76da2f449f6ec92656b41cb27e2e41bb 100644 (file)
@@ -2206,8 +2206,6 @@ void mlx5_eswitch_disable_locked(struct mlx5_eswitch *esw, bool clear_vf)
        else if (esw->mode == MLX5_ESWITCH_OFFLOADS)
                esw_offloads_disable(esw);
 
-       esw_destroy_tsar(esw);
-
        old_mode = esw->mode;
        esw->mode = MLX5_ESWITCH_NONE;
 
@@ -2217,6 +2215,8 @@ void mlx5_eswitch_disable_locked(struct mlx5_eswitch *esw, bool clear_vf)
                mlx5_reload_interface(esw->dev, MLX5_INTERFACE_PROTOCOL_IB);
                mlx5_reload_interface(esw->dev, MLX5_INTERFACE_PROTOCOL_ETH);
        }
+       esw_destroy_tsar(esw);
+
        if (clear_vf)
                mlx5_eswitch_clear_vf_vports_info(esw);
 }