Skip to content

Commit 18e31d4

Browse files
shayshyiSaeed Mahameed
authored andcommitted
net/mlx5: E-switch, enlarge peer miss group table
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]>
1 parent 9be6c21 commit 18e31d4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,6 +1573,7 @@ esw_create_peer_esw_miss_group(struct mlx5_eswitch *esw,
15731573
u32 *flow_group_in,
15741574
int *ix)
15751575
{
1576+
int max_peer_ports = (esw->total_vports - 1) * (MLX5_MAX_PORTS - 1);
15761577
int inlen = MLX5_ST_SZ_BYTES(create_flow_group_in);
15771578
struct mlx5_flow_group *g;
15781579
void *match_criteria;
@@ -1599,8 +1600,8 @@ esw_create_peer_esw_miss_group(struct mlx5_eswitch *esw,
15991600

16001601
MLX5_SET(create_flow_group_in, flow_group_in, start_flow_index, *ix);
16011602
MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index,
1602-
*ix + esw->total_vports - 1);
1603-
*ix += esw->total_vports;
1603+
*ix + max_peer_ports);
1604+
*ix += max_peer_ports + 1;
16041605

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

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

0 commit comments

Comments
 (0)