DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v5 0/4] Vhost: fix mq=on but VIRTIO_NET_F_MQ not negotiated
@ 2017-12-13  8:51 Maxime Coquelin
  2017-12-13  8:51 ` [dpdk-dev] [PATCH v5 1/4] vhost: prevent features to be changed while device is running Maxime Coquelin
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Maxime Coquelin @ 2017-12-13  8:51 UTC (permalink / raw)
  To: dev, yliu, tiwei.bie, jianfeng.tan, lprosek, lersek; +Cc: Maxime Coquelin

Hi,

This fifth revision fixes bug reported by Tiwei, dev->virtqueue[$idx]
wasn't reset to NULL at vq freeing time.

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. First patches
makes sure that VHOST_USER_SET_FEATURES request doesn't change
Virtio features while the device is running, which should never
happen as per the Virtio spec. This helps to make sure vitqueues
aren't destroyed while being processed, but also protect from
other illegal features changes (e.g. VIRTIO_NET_F_MRG_RXBUF).

Changes since v4:
=================
- Fix dev->virtqueue[$ixd] not reset to NULL at VQ free time (Tiwei)
Changes since v3:
=================
- Fix Virtio features = 0 case (Tiwei)
Changes since v2:
=================
- Patch 2: Rework & fix VQs destruction loop (Laszlo)
Changes since v1:
=================
- Patch 1: shift bits in the right direction (Ladi)

Maxime Coquelin (4):
  vhost: prevent features to be changed while device is running
  vhost: propagate VHOST_USER_SET_FEATURES handling error
  vhost: extract virtqueue cleaning and freeing functions
  vhost: destroy unused virtqueues when multiqueue not negotiated

 lib/librte_vhost/vhost.c      | 22 ++++++++++++----------
 lib/librte_vhost/vhost.h      |  3 +++
 lib/librte_vhost/vhost_user.c | 40 ++++++++++++++++++++++++++++++++++++++--
 3 files changed, 53 insertions(+), 12 deletions(-)

-- 
2.14.3

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-01-08 14:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-13  8:51 [dpdk-dev] [PATCH v5 0/4] Vhost: fix mq=on but VIRTIO_NET_F_MQ not negotiated Maxime Coquelin
2017-12-13  8:51 ` [dpdk-dev] [PATCH v5 1/4] vhost: prevent features to be changed while device is running Maxime Coquelin
2017-12-13  8:51 ` [dpdk-dev] [PATCH v5 2/4] vhost: propagate VHOST_USER_SET_FEATURES handling error Maxime Coquelin
2017-12-13  8:51 ` [dpdk-dev] [PATCH v5 3/4] vhost: extract virtqueue cleaning and freeing functions Maxime Coquelin
2017-12-13  8:51 ` [dpdk-dev] [PATCH v5 4/4] vhost: destroy unused virtqueues when multiqueue not negotiated Maxime Coquelin
2017-12-13  9:15 ` [dpdk-dev] [PATCH v5 0/4] Vhost: fix mq=on but VIRTIO_NET_F_MQ " Paolo Bonzini
2017-12-13 10:11   ` Maxime Coquelin
2017-12-13 10:24     ` Paolo Bonzini
2017-12-13 11:23       ` Laszlo Ersek
2018-01-08 14:36 ` Yuanhan Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).