]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net/mlx5: hw counters: Make fc_stats & fc_pool private
authorCosmin Ratiu <cratiu@nvidia.com>
Tue, 1 Oct 2024 10:37:04 +0000 (13:37 +0300)
committerJakub Kicinski <kuba@kernel.org>
Fri, 4 Oct 2024 18:33:46 +0000 (11:33 -0700)
commit5acd957a986c167d357e617a887630203be29ea4
treebf911addbe0ccbcba88f8b9bed6d2c743fe4ce03
parentc55ff46aeebed1704a9a6861777b799f15ce594d
net/mlx5: hw counters: Make fc_stats & fc_pool private

The mlx5_fc_stats and mlx5_fc_pool structs are only used from
fs_counters.c. As such, make them private there.

mlx5_fc_pool is not used or referenced at all outside fs_counters.

mlx5_fc_stats is referenced from mlx5_core_dev, so instead of having it
as a direct member (which requires exporting it from fs_counters), store
a pointer to it, allocate it on init and clear it on destroy.
One caveat is that a simple container_of to get from a 'work' struct to
the outermost mlx5_core_dev struct directly no longer works, so an extra
pointer had to be added to mlx5_fc_stats back to the parent dev.

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