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

net/mlx5: Lag, support single FDB only on 2 ports

E-Switch currently doesn't support more than 2 E-Switch managers
being aggregated under a single hardware lag. Have specific checks
to disallow creating lag when the code doesn't support it.
Signed-off-by: default avatarMark Bloch <mbloch@nvidia.com>
Reviewed-by: default avatarMaor Gottlieb <maorg@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent e9d5bb51
...@@ -458,6 +458,7 @@ static int mlx5_deactivate_lag(struct mlx5_lag *ldev) ...@@ -458,6 +458,7 @@ static int mlx5_deactivate_lag(struct mlx5_lag *ldev)
return 0; return 0;
} }
#define MLX5_LAG_OFFLOADS_SUPPORTED_PORTS 2
static bool mlx5_lag_check_prereq(struct mlx5_lag *ldev) static bool mlx5_lag_check_prereq(struct mlx5_lag *ldev)
{ {
#ifdef CONFIG_MLX5_ESWITCH #ifdef CONFIG_MLX5_ESWITCH
...@@ -470,6 +471,9 @@ static bool mlx5_lag_check_prereq(struct mlx5_lag *ldev) ...@@ -470,6 +471,9 @@ static bool mlx5_lag_check_prereq(struct mlx5_lag *ldev)
#ifdef CONFIG_MLX5_ESWITCH #ifdef CONFIG_MLX5_ESWITCH
mode = mlx5_eswitch_mode(ldev->pf[MLX5_LAG_P1].dev); mode = mlx5_eswitch_mode(ldev->pf[MLX5_LAG_P1].dev);
if (mode == MLX5_ESWITCH_OFFLOADS && ldev->ports != MLX5_LAG_OFFLOADS_SUPPORTED_PORTS)
return false;
return (mode == MLX5_ESWITCH_NONE || mode == MLX5_ESWITCH_OFFLOADS) && return (mode == MLX5_ESWITCH_NONE || mode == MLX5_ESWITCH_OFFLOADS) &&
(mlx5_eswitch_mode(ldev->pf[MLX5_LAG_P1].dev) == (mlx5_eswitch_mode(ldev->pf[MLX5_LAG_P1].dev) ==
mlx5_eswitch_mode(ldev->pf[MLX5_LAG_P2].dev)); mlx5_eswitch_mode(ldev->pf[MLX5_LAG_P2].dev));
......
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