Skip to content

Commit ed5e83a

Browse files
danielj-mellanoxSaeed Mahameed
authored andcommitted
net/mlx5: Fix function calculation for page trees
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>
1 parent 188fa10 commit ed5e83a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ enum {
7676

7777
static u32 get_function(u16 func_id, bool ec_function)
7878
{
79-
return func_id & (ec_function << 16);
79+
return (u32)func_id | (ec_function << 16);
8080
}
8181

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

0 commit comments

Comments
 (0)