From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id AF1971B010 for ; Mon, 8 Jan 2018 15:36:20 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4AC2220CB2; Mon, 8 Jan 2018 09:36:20 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Mon, 08 Jan 2018 09:36:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=ENkyUFeVBbk9YOoQ1grWXvpKTTccVNVtVDPsHagjmBE=; b=sjoUWVWV LAQPle94VCXoVSxGO/aEyTkvqzMQ505eYBpTM7gHBdyKyP/L2Cm8QfQDL/BcTMds YM8NR+qyAwKXmrVotoa9xt7TUq0AJdj3NTVdGHC/zFKUy/+UMkRt4pBb3kSuUI9x uMKvKbjtTXDgToXxgOISFWoP8MUpdqIjQarEYN96vjuna3mIaTxVw/Lf2anmlBI7 b0/c+PVPg453spWGf7xZ2NiZXINguWd+tdbryjpc2Qf6i/OAQrwBo6AS6OsA31SF 5T4Qh2Z7SPKGYFfV2YyJ5wTt13Rsoci1vFlWmJpMGATaiEAvqQGhZOOL+CVW0qAa EMpoANWg1IsPSQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=ENkyUFeVBbk9YOoQ1grWXvpKTTccV NVtVDPsHagjmBE=; b=fRTMtkeWuRtvCud8z9Rx0+EHbin633GH2UlgRxI56YPpM 5tkhmm5Zyn6NAzRAmLRnzjxgkMizIFvBQf7uB+4Cfej36Zlm1gVpO0A+T1Jffkom pFRxa0DZRaEP5g1KBAv/LZJ+mvg2hGdwbh3TelYqGPgW3ibedAASNJH/rxDiJXzE vQC6P/GyGaHYUdOYx+yGer0cwOmIN6/QpDMg53Ns6/sUXk8z+IvKjekpm8+x/Fpx U9yUOYjvjUGSNdO499b8dWk/tPiiLB2WNhq35OcOn2LOgCQVFl/J2TQfjMFpM8S4 n9khVp+Kn47jLZdSCcK3ElIIrR9nNlwMYAUHCsZtg== X-ME-Sender: Received: from yliu-mob (unknown [115.150.10.63]) by mail.messagingengine.com (Postfix) with ESMTPA id 012D524600; Mon, 8 Jan 2018 09:36:18 -0500 (EST) Date: Mon, 8 Jan 2018 22:36:11 +0800 From: Yuanhan Liu To: Maxime Coquelin Cc: dev@dpdk.org, tiwei.bie@intel.com, jianfeng.tan@intel.com, lprosek@redhat.com, lersek@redhat.com Message-ID: <20180108143611.GD29540@yliu-mob> References: <20171213085109.9891-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171213085109.9891-1-maxime.coquelin@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Subject: Re: [dpdk-dev] [PATCH v5 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, 08 Jan 2018 14:36:21 -0000 On Wed, Dec 13, 2017 at 09:51:05AM +0100, Maxime Coquelin wrote: > Hi, > > This fifth revision fixes bug reported by Tiwei, dev->virtqueue[$idx] > wasn't reset to NULL at vq freeing time. Applied to dpdk-next-virtio. Thanks. --yliu > > 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