net/mlx5: Maintain separate page trees for ECPF and PF functions
authorDaniel Jurgens <danielj@nvidia.com>
Fri, 22 Jan 2021 21:13:53 +0000 (23:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Feb 2021 22:28:49 +0000 (23:28 +0100)
commit1a06120d6ff292e2ed09bc1867737fd566fbc3d9
treeed91295cc0f8ff148bb79a915f5842a5751980e6
parent034bd75f619f28f727f6555933bef7e0910b1ca8
net/mlx5: Maintain separate page trees for ECPF and PF functions

[ Upstream commit 0aa128475d33d2d0095947eeab6b3e4d22dbd578 ]

Pages for the host PF and ECPF were stored in the same tree, so the ECPF
pages were being freed along with the host PF's when the host driver
unloaded.

Combine the function ID and ECPF flag to use as an index into the
x-array containing the trees to get a different tree for the host PF and
ECPF.

Fixes: c6168161f693 ("net/mlx5: Add support for release all pages event")
Signed-off-by: Daniel Jurgens <danielj@nvidia.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