net/mlx5: Fix function calculation for page trees
authorDaniel Jurgens <danielj@nvidia.com>
Mon, 1 Feb 2021 16:11:10 +0000 (18:11 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Feb 2021 08:29:14 +0000 (09:29 +0100)
commitada342012b2d703d3e409103f11f817b47ab56e5
tree7685493b0d7d1d69dd4b784dc911c29b74d62aba
parentb5802b747596d22fe438055ba4e249b1f08b5703
net/mlx5: Fix function calculation for page trees

[ Upstream commit ed5e83a3c02948dad9dc4e68fb4e535baa5da630 ]

The function calculation always results in a value of 0. This works
generally, but when the release all pages feature is enabled it will
result in crashes.

Fixes: 0aa128475d33 ("net/mlx5: Maintain separate page trees for ECPF and PF functions")
Signed-off-by: Daniel Jurgens <danielj@nvidia.com>
Reported-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c