Skip to content

Commit 07e1bc7

Browse files
Jianbo Liukuba-moo
authored andcommitted
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 <jianbol@nvidia.com> Reviewed-by: Parav Pandit <parav@nvidia.com> Reviewed-by: Moshe Shemesh <moshe@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://lore.kernel.org/r/20240402133043.56322-12-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent c788d79 commit 07e1bc7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,9 @@ int mlx5_satisfy_startup_pages(struct mlx5_core_dev *dev, int boot)
660660
mlx5_core_dbg(dev, "requested %d %s pages for func_id 0x%x\n",
661661
npages, boot ? "boot" : "init", func_id);
662662

663+
if (!npages)
664+
return 0;
665+
663666
return give_pages(dev, func_id, npages, 0, mlx5_core_is_ecpf(dev));
664667
}
665668

0 commit comments

Comments
 (0)