net/mlx5: DR, Fix the threshold that defines when pool sync is initiated
authorYevgeny Kliteynik <kliteyn@nvidia.com>
Wed, 29 Dec 2021 20:22:05 +0000 (22:22 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 24 Feb 2022 00:08:11 +0000 (16:08 -0800)
commitecd9c5cd46e013659e2fad433057bad1ba66888e
tree48648bbdbfd9180e66ac26aa77a95d6004d1e21a
parentffb0753b954763d94f52c901adfe58ed0d4005e6
net/mlx5: DR, Fix the threshold that defines when pool sync is initiated

When deciding whether to start syncing and actually free all the "hot"
ICM chunks, we need to consider the type of the ICM chunks that we're
dealing with. For instance, the amount of available ICM for MODIFY_ACTION
is significantly lower than the usual STE ICM, so the threshold should
account for that - otherwise we can deplete MODIFY_ACTION memory just by
creating and deleting the same modify header action in a continuous loop.

This patch replaces the hard-coded threshold with a dynamic value.

Fixes: 1c58651412bb ("net/mlx5: DR, ICM memory pools sync optimization")
Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c