mlx5_core: fix "no space" error on sriov enablement

Change POOL_NEXT_SIZE define value from 0 to BIT(30), since this define
is used to request the available maximum sized flow table, and zero doesn't
make sense for it, whereas many places in the driver use zero explicitly
expecting the smallest table size possible but instead due to this
define they end up allocating the biggest table size unawarely.

Sponsored by:	NVidia networking
This commit is contained in:
Ariel Ehrenberg 2024-11-25 15:10:41 +02:00 committed by Konstantin Belousov
parent 29a9d7c6ce
commit 2fb2c03512
2 changed files with 3 additions and 2 deletions

View file

@ -9,7 +9,7 @@
#include <dev/mlx5/mlx5_core/fs_core.h>
#include <linux/compiler.h>
#define POOL_NEXT_SIZE 0
#define POOL_NEXT_SIZE BIT(30)
int mlx5_ft_pool_init(struct mlx5_core_dev *dev);
void mlx5_ft_pool_destroy(struct mlx5_core_dev *dev);

View file

@ -50,7 +50,8 @@ mlx5_ft_pool_get_avail_sz(struct mlx5_core_dev *dev, enum fs_flow_table_type tab
int i, found_i = -1;
for (i = ARRAY_SIZE(FT_POOLS) - 1; i >= 0; i--) {
if (dev->priv.ft_pool->ft_left[i] && FT_POOLS[i] >= desired_size &&
if (dev->priv.ft_pool->ft_left[i] &&
(FT_POOLS[i] >= desired_size || desired_size == POOL_NEXT_SIZE) &&
FT_POOLS[i] <= max_ft_size) {
found_i = i;
if (desired_size != POOL_NEXT_SIZE)