From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <jfreimann@redhat.com>
Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28])
 by dpdk.org (Postfix) with ESMTP id BF7AF6904
 for <dev@dpdk.org>; Fri,  2 Nov 2018 09:58:26 +0100 (CET)
Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com
 [10.5.11.22])
 (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.redhat.com (Postfix) with ESMTPS id E3BBA3082E56;
 Fri,  2 Nov 2018 08:58:25 +0000 (UTC)
Received: from localhost (ovpn-116-180.ams2.redhat.com [10.36.116.180])
 by smtp.corp.redhat.com (Postfix) with ESMTPS id 0921E1001943;
 Fri,  2 Nov 2018 08:58:22 +0000 (UTC)
Date: Fri, 2 Nov 2018 09:58:21 +0100
From: Jens Freimann <jfreimann@redhat.com>
To: Tiwei Bie <tiwei.bie@intel.com>
Cc: dev@dpdk.org, maxime.coquelin@redhat.com, zhihong.wang@intel.com
Message-ID: <20181102085821.dzwgljvbkgzcax22@jenstp.localdomain>
References: <20181024143236.21271-1-jfreimann@redhat.com>
 <20181024143236.21271-9-jfreimann@redhat.com>
 <20181026060624.GC31861@debian>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Disposition: inline
In-Reply-To: <20181026060624.GC31861@debian>
User-Agent: NeoMutt/20180716
X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
 (mx1.redhat.com [10.5.110.46]); Fri, 02 Nov 2018 08:58:25 +0000 (UTC)
Subject: Re: [dpdk-dev] [PATCH v9 8/8] net/virtio: enable packed virtqueues
	by default
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 02 Nov 2018 08:58:27 -0000

On Fri, Oct 26, 2018 at 02:06:24PM +0800, Tiwei Bie wrote:
>On Wed, Oct 24, 2018 at 04:32:36PM +0200, Jens Freimann wrote:
>> Signed-off-by: Jens Freimann <jfreimann@redhat.com>
>> ---
>>  drivers/net/virtio/virtio_ethdev.h | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/net/virtio/virtio_ethdev.h b/drivers/net/virtio/virtio_ethdev.h
>> index 6c9247639..d9b4feee2 100644
>> --- a/drivers/net/virtio/virtio_ethdev.h
>> +++ b/drivers/net/virtio/virtio_ethdev.h
>> @@ -34,6 +34,7 @@
>>  	 1u << VIRTIO_RING_F_INDIRECT_DESC |    \
>>  	 1ULL << VIRTIO_F_VERSION_1       |	\
>>  	 1ULL << VIRTIO_F_IN_ORDER        |	\
>> +	 1ULL << VIRTIO_F_RING_PACKED	  |	\
>
>Virtio-user will be broken when packed ring and CQ
>are negotiated. We need to fix this.

How would you fix this? Is it acceptable to disable packed virtqueues
for now in virtio-user when both RING_PACKED and CQ is requested? 

Like this:

diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user
index 20816c9..3105bef 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -474,6 +474,7 @@ int virtio_user_stop_device(struct virtio_user_dev *dev)
                 * so if necessary, we just claim to support CQ
                 */
                dev->frontend_features |= (1ull << VIRTIO_NET_F_CTRL_VQ);
+               dev->unsupported_features |= (1ULL << VIRTIO_F_RING_PACKED);
        } else {
                dev->unsupported_features |= (1ull << VIRTIO_NET_F_CTRL_VQ);
                /* Also disable features that depend on VIRTIO_NET_F_CTRL_VQ */


regards,
Jens