aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJianbo Liu <[email protected]>2024-04-02 16:30:43 +0300
committerJakub Kicinski <[email protected]>2024-04-03 19:47:59 -0700
commit07e1bc785a91e1cb621ac6a098acb222fb0811cf (patch)
treeb3a108f7e7fd3f642be03eb271d01cb61dbf120b
parentc788d79cfa6b68b1068b25e9cdff25d6035ed191 (diff)
net/mlx5: Don't call give_pages() if request 0 page
Firmware will return 0 on query BOOT/INIT PAGES for non-page supplier functions (external host PF/VF/SF), so no page is needed to be allocated for them. Signed-off-by: Jianbo Liu <[email protected]> Reviewed-by: Parav Pandit <[email protected]> Reviewed-by: Moshe Shemesh <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c
index dcf58efac159..d894a88fa9f2 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c
@@ -660,6 +660,9 @@ int mlx5_satisfy_startup_pages(struct mlx5_core_dev *dev, int boot)
mlx5_core_dbg(dev, "requested %d %s pages for func_id 0x%x\n",
npages, boot ? "boot" : "init", func_id);
+ if (!npages)
+ return 0;
+
return give_pages(dev, func_id, npages, 0, mlx5_core_is_ecpf(dev));
}