[dpdk-dev] [PATCH 0/4] Vhost: fix mq=on but VIRTIO_NET_F_MQ not negotiated

Maxime Coquelin maxime.coquelin at redhat.com
Mon Dec 4 15:48:52 CET 2017



On 12/04/2017 03:27 PM, Ladi Prosek wrote:
> On Mon, Dec 4, 2017 at 3:08 PM, Maxime Coquelin
> <maxime.coquelin at redhat.com>  wrote:
>> Having QEMU started with mq=on but guest driver not negotiating
>> VIRTIO_NET_F_MQ feature ends up in the vhost device to never
>> start. Indeed, more queues are created in the vhost backend than
>> configured.
>>
>> Guest drivers known to not advertise the VIRTIO_NET_F_MQ feature are
>> iPXE and OVMF Virtio-net drivers.
>>
>> Queues are created because before starting the guest, QEMU sends
>> VHOST_USER_SET_VRING_CALL requests for all queues declared in QEMU
>> command line. Also, once Virtio features negotiated, QEMU sends
>> VHOST_USER_SET_VRING_ENABLE requests to disable all but the first
>> queue pair.
>>
>> This series fixes this by destroying all but first queue pair in
>> the backend if VIRTIO_NET_F_MQ isn't negotiated.
> The destroyed queue pairs will be re-created when an MQ-enabled driver
> takes over later on, though, is that correct?

Correct! When the new driver registers, QEMU sends
VHOST_USER_SET_VRING_ENABLE requests to all queues in order to enable
only the first queue pair, disabling all others queue pairs.

In QEMU, see virtio_net_set_queues() in hw/net/virtio-net.c

> iPXE and OVMF virtio-net drivers will typically not be the last ones
> driving the device. They will likely load an OS equipped with a driver
> that negotiates the MQ feature. Thanks!
Maxime


More information about the dev mailing list