diff mbox series

[net,1/4] net/mlx5: Fix function calculation for page trees

Message ID 20210202070703.617251-2-saeed@kernel.org
State New
Headers show
Series mlx5 fixes 2021-02-01 | expand

Commit Message

Saeed Mahameed Feb. 2, 2021, 7:07 a.m. UTC
From: Daniel Jurgens <danielj@nvidia.com>

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>
---
 drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

patchwork-bot+netdevbpf@kernel.org Feb. 2, 2021, 5 p.m. UTC | #1
Hello:

This series was applied to netdev/net.git (refs/heads/master):

On Mon,  1 Feb 2021 23:07:00 -0800 you wrote:
> From: Daniel Jurgens <danielj@nvidia.com>
> 
> 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>
> 
> [...]

Here is the summary with links:
  - [net,1/4] net/mlx5: Fix function calculation for page trees
    https://git.kernel.org/netdev/net/c/ed5e83a3c029
  - [net,2/4] net/mlx5: Fix leak upon failure of rule creation
    https://git.kernel.org/netdev/net/c/a5bfe6b4675e
  - [net,3/4] net/mlx5e: Update max_opened_tc also when channels are closed
    https://git.kernel.org/netdev/net/c/5a2ba25a55c4
  - [net,4/4] net/mlx5e: Release skb in case of failure in tc update skb
    https://git.kernel.org/netdev/net/c/a34ffec8af8f

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c
index eaa8958e24d7..c0656d4782e1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c
@@ -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)