Skip to content

Commit

Permalink
net/mlx5: E-switch, enlarge peer miss group table
Browse files Browse the repository at this point in the history
There is an implicit assumption that peer miss group table
require to handle only a single peer.
Also, there is an assumption that total_vports of the master
is greater or equal to the total_vports of each peer.
Change the code to support peer miss group for more than one peer.

Signed-off-by: Shay Drory <[email protected]>
Reviewed-by: Mark Bloch <[email protected]>
Reviewed-by: Roi Dayan <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
  • Loading branch information
shayshyi authored and Saeed Mahameed committed Jun 2, 2023
1 parent 9be6c21 commit 18e31d4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
Original file line number Diff line number Diff line change
Expand Up @@ -1573,6 +1573,7 @@ esw_create_peer_esw_miss_group(struct mlx5_eswitch *esw,
u32 *flow_group_in,
int *ix)
{
int max_peer_ports = (esw->total_vports - 1) * (MLX5_MAX_PORTS - 1);
int inlen = MLX5_ST_SZ_BYTES(create_flow_group_in);
struct mlx5_flow_group *g;
void *match_criteria;
Expand All @@ -1599,8 +1600,8 @@ esw_create_peer_esw_miss_group(struct mlx5_eswitch *esw,

MLX5_SET(create_flow_group_in, flow_group_in, start_flow_index, *ix);
MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index,
*ix + esw->total_vports - 1);
*ix += esw->total_vports;
*ix + max_peer_ports);
*ix += max_peer_ports + 1;

g = mlx5_create_flow_group(fdb, flow_group_in);
if (IS_ERR(g)) {
Expand Down Expand Up @@ -1702,7 +1703,7 @@ static int esw_create_offloads_fdb_tables(struct mlx5_eswitch *esw)
* total vports of the peer (currently is also uses esw->total_vports).
*/
table_size = MLX5_MAX_PORTS * (esw->total_vports * MAX_SQ_NVPORTS + MAX_PF_SQ) +
esw->total_vports * 2 + MLX5_ESW_MISS_FLOWS;
esw->total_vports * MLX5_MAX_PORTS + MLX5_ESW_MISS_FLOWS;

/* create the slow path fdb with encap set, so further table instances
* can be created at run time while VFs are probed if the FW allows that.
Expand Down

0 comments on commit 18e31d4

Please sign in to comment.