Commit da8252d5 authored by Mark Bloch's avatar Mark Bloch Committed by Saeed Mahameed

net/mlx5: Lag, don't update lag if lag isn't supported

In NICs that don't support LAG, the LAG control structure won't be
allocated. If it wasn't allocated it means LAG doesn't exists and can be
skipped.

Fixes: cac1eb2c ("net/mlx5: Lag, properly lock eswitch if needed")
Signed-off-by: default avatarMark Bloch <mbloch@nvidia.com>
Reviewed-by: default avatarMaor Gottlieb <maorg@nvidia.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent 897ae4b4
...@@ -927,9 +927,12 @@ void mlx5_lag_disable_change(struct mlx5_core_dev *dev) ...@@ -927,9 +927,12 @@ void mlx5_lag_disable_change(struct mlx5_core_dev *dev)
struct mlx5_core_dev *dev1; struct mlx5_core_dev *dev1;
struct mlx5_lag *ldev; struct mlx5_lag *ldev;
ldev = mlx5_lag_dev(dev);
if (!ldev)
return;
mlx5_dev_list_lock(); mlx5_dev_list_lock();
ldev = mlx5_lag_dev(dev);
dev0 = ldev->pf[MLX5_LAG_P1].dev; dev0 = ldev->pf[MLX5_LAG_P1].dev;
dev1 = ldev->pf[MLX5_LAG_P2].dev; dev1 = ldev->pf[MLX5_LAG_P2].dev;
...@@ -946,8 +949,11 @@ void mlx5_lag_enable_change(struct mlx5_core_dev *dev) ...@@ -946,8 +949,11 @@ void mlx5_lag_enable_change(struct mlx5_core_dev *dev)
{ {
struct mlx5_lag *ldev; struct mlx5_lag *ldev;
mlx5_dev_list_lock();
ldev = mlx5_lag_dev(dev); ldev = mlx5_lag_dev(dev);
if (!ldev)
return;
mlx5_dev_list_lock();
ldev->mode_changes_in_progress--; ldev->mode_changes_in_progress--;
mlx5_dev_list_unlock(); mlx5_dev_list_unlock();
mlx5_queue_bond_work(ldev, 0); mlx5_queue_bond_work(ldev, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment