Skip to content

Commit 3b70508

Browse files
mark-blochjgunthorpe
authored andcommitted
RDMA/mlx5: Create flow table with max size supported
Instead of failing the request, just use the supported number of flow entries. Signed-off-by: Mark Bloch <[email protected]> Reviewed-by: Maor Gottlieb <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 13a4376 commit 3b70508

File tree

1 file changed

+4
-6
lines changed
  • drivers/infiniband/hw/mlx5

1 file changed

+4
-6
lines changed

drivers/infiniband/hw/mlx5/main.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3233,12 +3233,11 @@ static struct mlx5_ib_flow_prio *get_flow_table(struct mlx5_ib_dev *dev,
32333233
if (!ns)
32343234
return ERR_PTR(-ENOTSUPP);
32353235

3236-
if (num_entries > max_table_size)
3237-
return ERR_PTR(-ENOMEM);
3236+
max_table_size = min_t(int, num_entries, max_table_size);
32383237

32393238
ft = prio->flow_table;
32403239
if (!ft)
3241-
return _get_prio(ns, prio, priority, num_entries, num_groups,
3240+
return _get_prio(ns, prio, priority, max_table_size, num_groups,
32423241
flags);
32433242

32443243
return prio;
@@ -3838,8 +3837,7 @@ _get_flow_table(struct mlx5_ib_dev *dev,
38383837
priority = FDB_BYPASS_PATH;
38393838
}
38403839

3841-
if (max_table_size < MLX5_FS_MAX_ENTRIES)
3842-
return ERR_PTR(-ENOMEM);
3840+
max_table_size = min_t(int, max_table_size, MLX5_FS_MAX_ENTRIES);
38433841

38443842
ns = mlx5_get_flow_namespace(dev->mdev, fs_matcher->ns_type);
38453843
if (!ns)
@@ -3858,7 +3856,7 @@ _get_flow_table(struct mlx5_ib_dev *dev,
38583856
if (prio->flow_table)
38593857
return prio;
38603858

3861-
return _get_prio(ns, prio, priority, MLX5_FS_MAX_ENTRIES,
3859+
return _get_prio(ns, prio, priority, max_table_size,
38623860
MLX5_FS_MAX_TYPES, flags);
38633861
}
38643862

0 commit comments

Comments
 (0)