aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Bloch <markb@mellanox.com>2018-01-23 06:19:12 -0500
committerSaeed Mahameed <saeedm@mellanox.com>2018-02-23 15:36:38 -0500
commitcd3d07e7db69456beaeb90529270a95c7692f4b3 (patch)
tree9dc83479a12527dc4935f53b7152e8af42545108
parent57cbd893c4c575a24594fa6c0835247506ce26e2 (diff)
net/mlx5: E-Switch, Increase number of FTEs in FDB in switchdev mode
The max FTE number should be the max number of SQs that can be opened. Ethernet representors open one SQ each. Once we add IB representor this will increase (depends on the user). For now lets start with 31 per IB representor and if needed increase in the future. This increase only affects the number of FTEs in the slow path FDB, offloaded rules (done via TC on the fast path portion of the FDB) aren't affected. Signed-off-by: Mark Bloch <markb@mellanox.com> Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 92fdb10dd29f..a5f5339a4e88 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -427,6 +427,7 @@ static void esw_destroy_offloads_fast_fdb_table(struct mlx5_eswitch *esw)
427} 427}
428 428
429#define MAX_PF_SQ 256 429#define MAX_PF_SQ 256
430#define MAX_SQ_NVPORTS 32
430 431
431static int esw_create_offloads_fdb_tables(struct mlx5_eswitch *esw, int nvports) 432static int esw_create_offloads_fdb_tables(struct mlx5_eswitch *esw, int nvports)
432{ 433{
@@ -456,7 +457,7 @@ static int esw_create_offloads_fdb_tables(struct mlx5_eswitch *esw, int nvports)
456 if (err) 457 if (err)
457 goto fast_fdb_err; 458 goto fast_fdb_err;
458 459
459 table_size = nvports + MAX_PF_SQ + 1; 460 table_size = nvports * MAX_SQ_NVPORTS + MAX_PF_SQ + 1;
460 461
461 ft_attr.max_fte = table_size; 462 ft_attr.max_fte = table_size;
462 ft_attr.prio = FDB_SLOW_PATH; 463 ft_attr.prio = FDB_SLOW_PATH;
@@ -479,7 +480,7 @@ static int esw_create_offloads_fdb_tables(struct mlx5_eswitch *esw, int nvports)
479 MLX5_SET_TO_ONES(fte_match_param, match_criteria, misc_parameters.source_sqn); 480 MLX5_SET_TO_ONES(fte_match_param, match_criteria, misc_parameters.source_sqn);
480 MLX5_SET_TO_ONES(fte_match_param, match_criteria, misc_parameters.source_port); 481 MLX5_SET_TO_ONES(fte_match_param, match_criteria, misc_parameters.source_port);
481 482
482 ix = nvports + MAX_PF_SQ; 483 ix = nvports * MAX_SQ_NVPORTS + MAX_PF_SQ;
483 MLX5_SET(create_flow_group_in, flow_group_in, start_flow_index, 0); 484 MLX5_SET(create_flow_group_in, flow_group_in, start_flow_index, 0);
484 MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index, ix - 1); 485 MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index, ix - 1);
485 486