[PATCH v2 0/1] vhost: Fix last queue index of devices with no cvq

Eugenio Pérez posted 1 patch 2 years, 6 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20211102114059.1917341-1-eperezma@redhat.com
There is a newer version of this series
hw/net/vhost_net.c | 4 ----
1 file changed, 4 deletions(-)
[PATCH v2 0/1] vhost: Fix last queue index of devices with no cvq
Posted by Eugenio Pérez 2 years, 6 months ago
The -1 assumes that all devices with no cvq have an spare vq allocated
for them, but with no offer of VIRTIO_NET_F_CTRL_VQ. This is an invalid
device by the standard, so just stick to the right number of device
models.

This is not a problem to vhost-net, but it is to vhost-vdpa, which
device model trust to reach the last index to finish starting the
device.

Tested with vp_vdpa with host's vhost=on and vhost=off.

v2:
* Delete all the conditional code instead of ROUND_DOWN in a
  deinitely too-bit-tricky way.

Eugenio Pérez (1):
  vhost: Fix last queue index of devices with no cvq

 hw/net/vhost_net.c | 4 ----
 1 file changed, 4 deletions(-)

-- 
2.27.0