From: Maxime Coquelin Subject: Re: [RFC 23/24] WORKAROUND revert virtio-net mq vring deletion Date: Tue, 30 Jan 2018 18:52:42 +0100 Message-ID: References: <20180119134444.24927-1-stefanha@redhat.com> <20180119134444.24927-24-stefanha@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Yuanhan Liu , wei.w.wang@intel.com, mst@redhat.com, zhiyong.yang@intel.com, jasowang@redhat.com To: Stefan Hajnoczi , dev@dpdk.org Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 699AA1B6CC for ; Tue, 30 Jan 2018 18:52:53 +0100 (CET) In-Reply-To: <20180119134444.24927-24-stefanha@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" Hi Stefan, On 01/19/2018 02:44 PM, Stefan Hajnoczi wrote: > The virtio-net mq vring deletion code should be in virtio_net.c, not in > the generic vhost_user.c code where it breaks non-virtio-net devices. > > Signed-off-by: Stefan Hajnoczi > --- > drivers/librte_vhost/vhost_user.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/librte_vhost/vhost_user.c b/drivers/librte_vhost/vhost_user.c > index a819684b4..08fab933b 100644 > --- a/drivers/librte_vhost/vhost_user.c > +++ b/drivers/librte_vhost/vhost_user.c > @@ -163,6 +163,7 @@ vhost_user_set_features(struct virtio_net *dev, uint64_t features) > (dev->features & (1 << VIRTIO_NET_F_MRG_RXBUF)) ? "on" : "off", > (dev->features & (1ULL << VIRTIO_F_VERSION_1)) ? "on" : "off"); > > +#if 0 > if (!(dev->features & (1ULL << VIRTIO_NET_F_MQ))) { > /* > * Remove all but first queue pair if MQ hasn't been > @@ -181,6 +182,7 @@ vhost_user_set_features(struct virtio_net *dev, uint64_t features) > free_vq(vq); > } > } > +#endif > > return 0; > } > Thanks for reporting the issue. It seems difficult to move this check in virtio-net.c without a deep rework. But I think we can workaround by ensuring the backend supports VIRTIO_NET_F_MQ, but it has not been negotiated. Something like: if ((vhost_features & (1ULL << VIRTIO_NET_F_MQ)) && !(dev->features & (1ULL << VIRTIO_NET_F_MQ)) { ... } Any thoughts? Thanks, Maxime