net/mlx5: Enhance debug print in page allocation failure
authorJack Morgenstein <jackm@nvidia.com>
Wed, 18 Jan 2023 17:57:04 +0000 (19:57 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:32:59 +0000 (09:32 +0100)
[ Upstream commit 7eef93003e5d20e1a6a6e59e12d914b5431cbda2 ]

Provide more details to aid debugging.

Fixes: bf0bf77f6519 ("mlx5: Support communicating arbitrary host page size to firmware")
Signed-off-by: Eran Ben Elisha <eranbe@nvidia.com>
Signed-off-by: Majd Dibbiny <majd@nvidia.com>
Signed-off-by: Jack Morgenstein <jackm@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c

index 0eb50be..64d4e71 100644 (file)
@@ -219,7 +219,8 @@ static int alloc_4k(struct mlx5_core_dev *dev, u64 *addr, u32 function)
 
        n = find_first_bit(&fp->bitmask, 8 * sizeof(fp->bitmask));
        if (n >= MLX5_NUM_4K_IN_PAGE) {
-               mlx5_core_warn(dev, "alloc 4k bug\n");
+               mlx5_core_warn(dev, "alloc 4k bug: fw page = 0x%llx, n = %u, bitmask: %lu, max num of 4K pages: %d\n",
+                              fp->addr, n, fp->bitmask,  MLX5_NUM_4K_IN_PAGE);
                return -ENOENT;
        }
        clear_bit(n, &fp->bitmask);