From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH v5 0/4] Vhost: fix mq=on but VIRTIO_NET_F_MQ not negotiated Date: Wed, 13 Dec 2017 10:15:22 +0100 Message-ID: References: <20171213085109.9891-1-maxime.coquelin@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit To: Maxime Coquelin , dev@dpdk.org, yliu@fridaylinux.org, tiwei.bie@intel.com, jianfeng.tan@intel.com, lprosek@redhat.com, lersek@redhat.com Return-path: Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id E094A1D90 for ; Wed, 13 Dec 2017 10:15:24 +0100 (CET) Received: by mail-wm0-f52.google.com with SMTP id f206so3545692wmf.5 for ; Wed, 13 Dec 2017 01:15:24 -0800 (PST) In-Reply-To: <20171213085109.9891-1-maxime.coquelin@redhat.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 13/12/2017 09:51, Maxime Coquelin wrote: > 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). Hi Maxime, I think this series is wrong from the virtio spec's point of view. If the driver requests VIRTIO_NET_F_MQ, that does not mean "the driver knows about multiqueue", it only means that "the driver wants to read max_virtqueue_pairs" from configuration space. Just like it's perfectly fine for a device to propose VIRTIO_NET_F_MQ and set max_virtqueue_pairs=1, a driver can negotiate VIRTIO_NET_F_MQ and then skip initialization of some virtqueues. In fact, for virtio-net there is an explicit way to say how many virtqueue pairs are available; the virtio spec's section 5.1.5 (Network device, Device Initialization) mentions that Even with VIRTIO_NET_F_MQ, only receiveq1, transmitq1 and controlq are used by default. The driver would send the VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET command specifying the number of the transmit and receive queues to use. Thanks, Paolo