net/mlx5: allow limiting the indexed pool maximum index
authorSuanming Mou <suanmingm@nvidia.com>
Tue, 13 Jul 2021 08:44:35 +0000 (11:44 +0300)
committerRaslan Darawsheh <rasland@nvidia.com>
Thu, 15 Jul 2021 13:19:01 +0000 (15:19 +0200)
commit58ecd3ad0bc8e509b915c48d6047f4da7ff2c298
tree5e7e4cc7d049422ee2375bf50610520831409c49
parent1db288f941ad4a0ddabd15f4ed65eee9d56b38e9
net/mlx5: allow limiting the indexed pool maximum index

Some ipool instances in the driver are used as ID\index allocator and
added other logic in order to work with limited index values.

Add a new configuration for ipool specify the maximum index value.
The ipool will ensure that no index bigger than the maximum value is
provided.

Use this configuration in ID allocator cases instead of the current
logics. This patch add the maximum ID configurable for the index pool.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
drivers/net/mlx5/mlx5_utils.c
drivers/net/mlx5/mlx5_utils.h