Re: [PATCH 2/3] vdpa/mlx5: Increase the maximum virtqueue size

From: Eugenio Perez Martin

Date: Mon Nov 23 2026 - 10:39:26 EST


On Mon, Nov 23, 2026 at 2:59 PM Dragos Tatulea <dtatulea@xxxxxxxxxx> wrote:
>
> mlx5_vdpa has always advertised a maximum virtqueue size of 256 through
> .get_vq_num_max(), while accepting any queue size in .set_vq_num(). The
> hardware handles larger rings just fine and users have been running with
> 1024-entry queues (e.g. QEMU's virtio-net rx_queue_size/tx_queue_size)
> since the driver was introduced.
>
> The commit in the fixes tag vhost-vdpa enforces the advertised maximum
> on VHOST_SET_VRING_NUM, so configuring a 1024-entry queue fails with
> -EINVAL.
>
> Advertise 1024 which is the max that qemu uses today. The device itself
> supports more but doesn't advertise it in any way.
>
> The Fixes tag points at the vhost-vdpa commit rather than at the driver
> because that is where the mismatch became user visible. It also keeps
> this change out of trees without the vhost enforcement, where virtio-vdpa
> would otherwise start creating 1024-entry rings instead of 256.
>
> Fixes: ccb1dc7c527f ("vhost/vdpa: reject VRING_NUM larger than device max")

Is it worth backporting this change? Nothing should break (or be
broken because of the 256 vq size), it sounds like an improvement to
me.

Either way,

Acked-by: Eugenio Pérez <eperezma@xxxxxxxxxx>

Thanks!

> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Dragos Tatulea <dtatulea@xxxxxxxxxx>
> ---
> drivers/vdpa/mlx5/net/mlx5_vnet.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
> index 7a39b0bbbee3..f1c5f72032a3 100644
> --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
> +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
> @@ -2965,7 +2965,7 @@ static void mlx5_vdpa_set_config_cb(struct vdpa_device *vdev, struct vdpa_callba
> ndev->config_cb = *cb;
> }
>
> -#define MLX5_VDPA_MAX_VQ_ENTRIES 256
> +#define MLX5_VDPA_MAX_VQ_ENTRIES 1024
> static u16 mlx5_vdpa_get_vq_num_max(struct vdpa_device *vdev)
> {
> return MLX5_VDPA_MAX_VQ_ENTRIES;
> --
> 2.54.0
>