]> git.itanic.dy.fi Git - linux-stable/commit
vdpa/mlx5: Allow CVQ size changes
authorJonah Palmer <jonah.palmer@oracle.com>
Fri, 16 Feb 2024 14:25:02 +0000 (09:25 -0500)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:21:00 +0000 (18:21 -0400)
commit07b6891ca62ebd532f4d4d4d0eed76ab607c2334
tree4e52a4222f9d3770a3e67fd99b04e71a8c8231d4
parent80fc9b9c626b7be00b5fb9b0aa025901e1488ea7
vdpa/mlx5: Allow CVQ size changes

[ Upstream commit 749a4016839270163efc36ecddddd01de491a16b ]

The MLX driver was not updating its control virtqueue size at set_vq_num
and instead always initialized to MLX5_CVQ_MAX_ENT (16) at
setup_cvq_vring.

Qemu would try to set the size to 64 by default, however, because the
CVQ size always was initialized to 16, an error would be thrown when
sending >16 control messages (as used-ring entry 17 is initialized to 0).
For example, starting a guest with x-svq=on and then executing the
following command would produce the error below:

 # for i in {1..20}; do ifconfig eth0 hw ether XX:xx:XX:xx:XX:XX; done

 qemu-system-x86_64: Insufficient written data (0)
 [  435.331223] virtio_net virtio0: Failed to set mac address by vq command.
 SIOCSIFHWADDR: Invalid argument

Acked-by: Dragos Tatulea <dtatulea@nvidia.com>
Acked-by: Eugenio PĂ©rez <eperezma@redhat.com>
Signed-off-by: Jonah Palmer <jonah.palmer@oracle.com>
Message-Id: <20240216142502.78095-1-jonah.palmer@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Lei Yang <leiyang@redhat.com>
Fixes: 5262912ef3cf ("vdpa/mlx5: Add support for control VQ and MAC setting")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/vdpa/mlx5/net/mlx5_vnet.c