]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx5: hw counters: Use kvmalloc for bulk query buffer
authorCosmin Ratiu <cratiu@nvidia.com>
Tue, 1 Oct 2024 10:37:05 +0000 (13:37 +0300)
committerJakub Kicinski <kuba@kernel.org>
Fri, 4 Oct 2024 18:33:46 +0000 (11:33 -0700)
commit10cd92df833c3f6c35dc5e923651146d41332538
tree79a9a5ed54218024e55d1c2203ec8741af1f6d77
parent5acd957a986c167d357e617a887630203be29ea4
net/mlx5: hw counters: Use kvmalloc for bulk query buffer

The bulk query buffer starts out small (see [1]) and as soon as the
number of counters goes past the initial threshold grows to max
size (32K entries, 512KB) with a retry scheme.

This commit switches to using kvmalloc for the buffer, which has a near
zero likelihood of failing, and thus the explicit retry scheme becomes
superfluous and is taken out. On the low chance the allocation fails, it
will still be retried every sampling_interval, when the wq task runs.

[1] commit b247f32aecad ("net/mlx5: Dynamically resize flow counters
query buffer")

Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20241001103709.58127-3-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c