From 95bf70a4bf7982091bb59200bc2db2cb5cd840d7 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Tue, 18 Apr 2023 13:22:41 +0200 Subject: [PATCH] mlx5: Don't give zero number of pages to the firmware. Can happen when using virtual mlx5_core functions, VFs. MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c b/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c index d298da67057..730c7ee8bee 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c @@ -509,7 +509,10 @@ 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); - return give_pages(dev, func_id, npages, 0); + if (npages > 0) + return give_pages(dev, func_id, npages, 0); + else + return 0; } enum {