From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id B772D201 for ; Mon, 4 Dec 2017 15:09:12 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 183624DD49; Mon, 4 Dec 2017 14:09:12 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-49.ams2.redhat.com [10.36.112.49]) by smtp.corp.redhat.com (Postfix) with ESMTP id 382FF65E8B; Mon, 4 Dec 2017 14:09:04 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, yliu@fridaylinux.org, tiwei.bie@intel.com, jianfeng.tan@intel.com Cc: lprosek@redhat.com, lersek@redhat.com, Maxime Coquelin Date: Mon, 4 Dec 2017 15:08:56 +0100 Message-Id: <20171204140900.7906-1-maxime.coquelin@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 04 Dec 2017 14:09:12 +0000 (UTC) Subject: [dpdk-dev] [PATCH 0/4] Vhost: fix mq=on but VIRTIO_NET_F_MQ not negotiated X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Dec 2017 14:09:13 -0000 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). 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