Skip to content

Commit

Permalink
net/mlx5: Fix function calculation for page trees
Browse files Browse the repository at this point in the history
[ Upstream commit ed5e83a ]

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: 0aa1284 ("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>
  • Loading branch information
Daniel Jurgens authored and gregkh committed Feb 10, 2021
1 parent b5802b7 commit ada3420
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c
Expand Up @@ -76,7 +76,7 @@ enum {

static u32 get_function(u16 func_id, bool ec_function)
{
return func_id & (ec_function << 16);
return (u32)func_id | (ec_function << 16);
}

static struct rb_root *page_root_per_function(struct mlx5_core_dev *dev, u32 function)
Expand Down

0 comments on commit ada3420

Please sign in to comment.