]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitea4c3863a12045c5763c32f7b550b5f086555811
tree48648bbdbfd9180e66ac26aa77a95d6004d1e21a
parent33d1ecd57fdf98449cf76912b36460c0c4bb6ba4
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: e5175746542a ("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