net/mlx5: Store page counters in a single array
authorMaher Sanalla <msanalla@nvidia.com>
Sun, 22 Jan 2023 19:09:40 +0000 (21:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Feb 2023 18:11:47 +0000 (19:11 +0100)
commitbbdfebb08ff5eb67ae65539c8cbb728c8f246552
treeb1fe9c7d93d1efe5b700af0a437d1887fad97f5c
parent5ccc3707e97527d815e0fe1129b7f659828754b9
net/mlx5: Store page counters in a single array

[ Upstream commit c3bdbaea654d8df39112de33037106134a520dc7 ]

Currently, an independent page counter is used for tracking memory usage
for each function type such as VF, PF and host PF (DPU).

For better code-readibilty, use a single array that stores
the number of allocated memory pages for each function type.

Signed-off-by: Maher Sanalla <msanalla@nvidia.com>
Reviewed-by: Shay Drory <shayd@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Stable-dep-of: 9965bbebae59 ("net/mlx5: Expose SF firmware pages counter")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/debugfs.c
drivers/net/ethernet/mellanox/mlx5/core/ecpf.c
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c
drivers/net/ethernet/mellanox/mlx5/core/sriov.c
include/linux/mlx5/driver.h