From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua0-f194.google.com (mail-ua0-f194.google.com [209.85.217.194]) by dpdk.org (Postfix) with ESMTP id 1BBDA201 for ; Mon, 4 Dec 2017 15:27:22 +0100 (CET) Received: by mail-ua0-f194.google.com with SMTP id e10so12529915uah.10 for ; Mon, 04 Dec 2017 06:27:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=bbDVWqDhW+FVIO4gTIq+lf0n2s+zgNrH5xnIMsLoa6E=; b=VisxSh/OveGu9Cd+lATTLD/M3qMdumbn0UlZLvOiVIFZbx719OYatrNsfXUJqGBrt1 6cFwPKr0Y1gwfY/ZVzDrsoNjBywRp8bx5oPdt2UO/PvA2QRsm16yxgD/gMjOfN/Cybbl ELZ40Iosbb8GoOfcCUKLOBOtREwq7mhvCcw/T7b7bH4RZNHr96E7/4onLYqiLgVMUbVe diTpv0ZvFTMzkX6QK5UyKymi7omSxD64QWZ6Fvd5pB13YvFezHLXKmwNbKVZARaUw8X0 wuM66p2cmq1dsXj2PR3SpKGzBIBa+c9UUaXv/HDkABl5KC2A0jx113dKkA4+pn1kbavR GvaA== X-Gm-Message-State: AKGB3mIxxygEgtdonH6FQm8UqbXSo7XLx9nem32W50GhH3XEQM0d4CBG 3eNjuElQWRrlMQrcOmf0VKEaESgcShHKJCzZMgtl2g== X-Google-Smtp-Source: AGs4zMYyC2MbjcVMGVdl+38YaLibdKIC03mH2uTuxKAQSIc0FJDsRIbNXSaI8vMh6swtBYv/y8T3nbiH6kRJmQvjgkU= X-Received: by 10.176.75.10 with SMTP id h10mr11655033uaf.104.1512397642121; Mon, 04 Dec 2017 06:27:22 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.52.199 with HTTP; Mon, 4 Dec 2017 06:27:21 -0800 (PST) In-Reply-To: <20171204140900.7906-1-maxime.coquelin@redhat.com> References: <20171204140900.7906-1-maxime.coquelin@redhat.com> From: Ladi Prosek Date: Mon, 4 Dec 2017 15:27:21 +0100 Message-ID: To: Maxime Coquelin Cc: dev@dpdk.org, yliu@fridaylinux.org, tiwei.bie@intel.com, jianfeng.tan@intel.com, Laszlo Ersek Content-Type: text/plain; charset="UTF-8" Subject: Re: [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:27:23 -0000 On Mon, Dec 4, 2017 at 3:08 PM, Maxime Coquelin 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? 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! > 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 >