Commit 6ec0b55e authored by Shay Drory's avatar Shay Drory Committed by Saeed Mahameed

net/mlx5: Enable 4 ports VF LAG

Now, after all preparation are done, enable 4 ports VF LAG
Signed-off-by: default avatarShay Drory <shayd@nvidia.com>
Reviewed-by: default avatarMark Bloch <mbloch@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent 7718c1c8
...@@ -711,7 +711,7 @@ int mlx5_deactivate_lag(struct mlx5_lag *ldev) ...@@ -711,7 +711,7 @@ int mlx5_deactivate_lag(struct mlx5_lag *ldev)
return 0; return 0;
} }
#define MLX5_LAG_OFFLOADS_SUPPORTED_PORTS 2 #define MLX5_LAG_OFFLOADS_SUPPORTED_PORTS 4
bool mlx5_lag_check_prereq(struct mlx5_lag *ldev) bool mlx5_lag_check_prereq(struct mlx5_lag *ldev)
{ {
#ifdef CONFIG_MLX5_ESWITCH #ifdef CONFIG_MLX5_ESWITCH
...@@ -737,7 +737,7 @@ bool mlx5_lag_check_prereq(struct mlx5_lag *ldev) ...@@ -737,7 +737,7 @@ bool mlx5_lag_check_prereq(struct mlx5_lag *ldev)
if (mlx5_eswitch_mode(ldev->pf[i].dev) != mode) if (mlx5_eswitch_mode(ldev->pf[i].dev) != mode)
return false; return false;
if (mode == MLX5_ESWITCH_OFFLOADS && ldev->ports != MLX5_LAG_OFFLOADS_SUPPORTED_PORTS) if (mode == MLX5_ESWITCH_OFFLOADS && ldev->ports > MLX5_LAG_OFFLOADS_SUPPORTED_PORTS)
return false; return false;
#else #else
for (i = 0; i < ldev->ports; i++) for (i = 0; i < ldev->ports; i++)
......
...@@ -75,13 +75,14 @@ struct mlx5_devcom *mlx5_devcom_register_device(struct mlx5_core_dev *dev) ...@@ -75,13 +75,14 @@ struct mlx5_devcom *mlx5_devcom_register_device(struct mlx5_core_dev *dev)
if (!mlx5_core_is_pf(dev)) if (!mlx5_core_is_pf(dev))
return NULL; return NULL;
if (MLX5_CAP_GEN(dev, num_lag_ports) != MLX5_DEVCOM_PORTS_SUPPORTED) if (MLX5_CAP_GEN(dev, num_lag_ports) > MLX5_DEVCOM_PORTS_SUPPORTED)
return NULL; return NULL;
mlx5_dev_list_lock(); mlx5_dev_list_lock();
sguid0 = mlx5_query_nic_system_image_guid(dev); sguid0 = mlx5_query_nic_system_image_guid(dev);
list_for_each_entry(iter, &devcom_list, list) { list_for_each_entry(iter, &devcom_list, list) {
struct mlx5_core_dev *tmp_dev = NULL; /* There is at least one device in iter */
struct mlx5_core_dev *tmp_dev;
idx = -1; idx = -1;
for (i = 0; i < MLX5_DEVCOM_PORTS_SUPPORTED; i++) { for (i = 0; i < MLX5_DEVCOM_PORTS_SUPPORTED; i++) {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include <linux/mlx5/driver.h> #include <linux/mlx5/driver.h>
#define MLX5_DEVCOM_PORTS_SUPPORTED 2 #define MLX5_DEVCOM_PORTS_SUPPORTED 4
enum mlx5_devcom_components { enum mlx5_devcom_components {
MLX5_DEVCOM_ESW_OFFLOADS, MLX5_DEVCOM_ESW_OFFLOADS,
......
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