summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorCosmin Ratiu <cratiu@nvidia.com>2024-10-01 13:37:08 +0300
committerJakub Kicinski <kuba@kernel.org>2024-10-04 21:33:46 +0300
commit4a67ebf85f384853970c56099bfc3096f66c20ed (patch)
tree5c0d702a58c6fe4520e24953aff02de72876363b /include/linux
parentd95f77f1196a9458f61a08faa0eb569cf6f03a84 (diff)
downloadlinux-4a67ebf85f384853970c56099bfc3096f66c20ed.tar.xz
net/mlx5: hw counters: Don't maintain a counter count
num_counters is only used for deciding whether to grow the bulk query buffer, which is done once more counters than a small initial threshold are present. After that, maintaining num_counters serves no purpose. This commit replaces that with an actual xarray traversal to count the counters. This appears expensive at first sight, but is only done when the number of counters is less than the initial threshold (8) and only once every sampling interval. Once the number of counters goes above the threshold, the bulk query buffer is grown to max size and the xarray traversal is never done again. Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20241001103709.58127-6-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions