Re: [PATCH] vdpa/mlx5: Bound the KLM count of the user MR

From: Vladimir Petrzhikovskii

Date: Fri Nov 20 2026 - 08:20:48 EST


Thank you for the comments!

On 19.11.26 19:12, Dragos Tatulea wrote:
> Please make this paragraph more human friendly. Enough to say that
> the type doesn't fit the value or something like that.

> No need to say what the code does. Focus on the why.

Shortened both in v2.

> Yes The limit is right.

Thanks.

> Comment not needed.

Dropped.

> Unrelated change for fix. Drop please.

Dropped. The command then keeps today's limit: kzalloc() caps it at
KMALLOC_MAX_SIZE, 4 MiB with 4K pages, which holds fewer than 2^18
KLMs. On a device with log_max_klm_list_size above 18, a guest map
that needs more KLMs than that fails with -ENOMEM and a one-time
warning from the page allocator. Do devices report more than 18? If
so, I will send kvzalloc() as a separate patch.

> Why not DIV_ROUND_UP_POW2(map->start - pe, MAX_KLM_SIZE)?

I missed that it exists. v2 uses it.

> Use mlx5_vdpa_warn(). Rate limiting here won't help: the other prints
> will trigger.

Done.

Vladimir