Commit 3b70508a authored by Mark Bloch's avatar Mark Bloch Committed by Jason Gunthorpe

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: default avatarMark Bloch <markb@mellanox.com>
Reviewed-by: default avatarMaor Gottlieb <maorg@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 13a43765
...@@ -3233,12 +3233,11 @@ static struct mlx5_ib_flow_prio *get_flow_table(struct mlx5_ib_dev *dev, ...@@ -3233,12 +3233,11 @@ static struct mlx5_ib_flow_prio *get_flow_table(struct mlx5_ib_dev *dev,
if (!ns) if (!ns)
return ERR_PTR(-ENOTSUPP); return ERR_PTR(-ENOTSUPP);
if (num_entries > max_table_size) max_table_size = min_t(int, num_entries, max_table_size);
return ERR_PTR(-ENOMEM);
ft = prio->flow_table; ft = prio->flow_table;
if (!ft) if (!ft)
return _get_prio(ns, prio, priority, num_entries, num_groups, return _get_prio(ns, prio, priority, max_table_size, num_groups,
flags); flags);
return prio; return prio;
...@@ -3838,8 +3837,7 @@ _get_flow_table(struct mlx5_ib_dev *dev, ...@@ -3838,8 +3837,7 @@ _get_flow_table(struct mlx5_ib_dev *dev,
priority = FDB_BYPASS_PATH; priority = FDB_BYPASS_PATH;
} }
if (max_table_size < MLX5_FS_MAX_ENTRIES) max_table_size = min_t(int, max_table_size, MLX5_FS_MAX_ENTRIES);
return ERR_PTR(-ENOMEM);
ns = mlx5_get_flow_namespace(dev->mdev, fs_matcher->ns_type); ns = mlx5_get_flow_namespace(dev->mdev, fs_matcher->ns_type);
if (!ns) if (!ns)
...@@ -3858,7 +3856,7 @@ _get_flow_table(struct mlx5_ib_dev *dev, ...@@ -3858,7 +3856,7 @@ _get_flow_table(struct mlx5_ib_dev *dev,
if (prio->flow_table) if (prio->flow_table)
return prio; return prio;
return _get_prio(ns, prio, priority, MLX5_FS_MAX_ENTRIES, return _get_prio(ns, prio, priority, max_table_size,
MLX5_FS_MAX_TYPES, flags); MLX5_FS_MAX_TYPES, flags);
} }
......
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