Skip to content

Commit 63d4a9a

Browse files
mark-blochSaeed Mahameed
authored andcommitted
net/mlx5: Lag, move lag destruction to a workqueue
If a netdev is removed from the lag the lag should be destroyed. With downstream patches this might trigger a reconfiguration of representors on a different eswitch and such we don't have the proper locking to so from this path. Move the destruction to be done by the workqueue. As the destruction won't affect the netdev side it okay to do so. The RDMA side will be reconfigured and it already coded to handle such reconfiguration. Signed-off-by: Mark Bloch <mbloch@nvidia.com> Reviewed-by: Mark Zhang <markzhang@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
1 parent cac1eb2 commit 63d4a9a

File tree

1 file changed

+9
-8
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+9
-8
lines changed

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -371,12 +371,13 @@ static void mlx5_do_bond(struct mlx5_lag *ldev)
371371
bool do_bond, roce_lag;
372372
int err;
373373

374-
if (!mlx5_lag_is_ready(ldev))
375-
return;
376-
377-
tracker = ldev->tracker;
374+
if (!mlx5_lag_is_ready(ldev)) {
375+
do_bond = false;
376+
} else {
377+
tracker = ldev->tracker;
378378

379-
do_bond = tracker.is_bonded && mlx5_lag_check_prereq(ldev);
379+
do_bond = tracker.is_bonded && mlx5_lag_check_prereq(ldev);
380+
}
380381

381382
if (do_bond && !__mlx5_lag_is_active(ldev)) {
382383
roce_lag = !mlx5_sriov_is_enabled(dev0) &&
@@ -733,11 +734,11 @@ void mlx5_lag_remove_netdev(struct mlx5_core_dev *dev,
733734
if (!ldev)
734735
return;
735736

736-
if (__mlx5_lag_is_active(ldev))
737-
mlx5_disable_lag(ldev);
738-
739737
mlx5_ldev_remove_netdev(ldev, netdev);
740738
ldev->flags &= ~MLX5_LAG_FLAG_READY;
739+
740+
if (__mlx5_lag_is_active(ldev))
741+
mlx5_queue_bond_work(ldev, 0);
741742
}
742743

743744
/* Must be called with intf_mutex held */

0 commit comments

Comments
 (0)