From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <huawei.xie@intel.com>
Received: from mga03.intel.com (mga03.intel.com [134.134.136.65])
 by dpdk.org (Postfix) with ESMTP id 16A03C32E
 for <dev@dpdk.org>; Fri, 10 Jul 2015 16:05:50 +0200 (CEST)
Received: from orsmga001.jf.intel.com ([10.7.209.18])
 by orsmga103.jf.intel.com with ESMTP; 10 Jul 2015 07:05:49 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.15,446,1432623600"; d="scan'208";a="726456906"
Received: from pgsmsx104.gar.corp.intel.com ([10.221.44.91])
 by orsmga001.jf.intel.com with ESMTP; 10 Jul 2015 07:05:49 -0700
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
 PGSMSX104.gar.corp.intel.com (10.221.44.91) with Microsoft SMTP Server (TLS)
 id 14.3.224.2; Fri, 10 Jul 2015 22:05:48 +0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.246]) by
 shsmsx102.ccr.corp.intel.com ([169.254.2.165]) with mapi id 14.03.0224.002;
 Fri, 10 Jul 2015 22:05:46 +0800
From: "Xie, Huawei" <huawei.xie@intel.com>
To: "dev@dpdk.org" <dev@dpdk.org>, Thomas Monjalon <thomas.monjalon@6wind.com>
Thread-Topic: [dpdk-dev] [PATCH] virtio: fix the vq size issue
Thread-Index: AdC0FhKoXdj2uCB1RLi+8Fm6XGN5OA==
Date: Fri, 10 Jul 2015 14:05:45 +0000
Message-ID: <C37D651A908B024F974696C65296B57B0F56C2C7@SHSMSX101.ccr.corp.intel.com>
References: <1435736930-26737-1-git-send-email-changchun.ouyang@intel.com>
 <C37D651A908B024F974696C65296B57B0F5504FB@SHSMSX101.ccr.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Re: [dpdk-dev] [PATCH] virtio: fix the vq size issue
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 10 Jul 2015 14:05:51 -0000

Thomas:=0A=
Could we roll back that commit or apply Changchun's patch?=0A=
=0A=
/Huawei=0A=
=0A=
On 7/1/2015 11:53 PM, Xie, Huawei wrote:=0A=
> On 7/1/2015 3:49 PM, Ouyang Changchun wrote:=0A=
>> This commit breaks virtio basic packets rx functionality:=0A=
>>   d78deadae4dca240e85054bf2d604a801676becc=0A=
>>=0A=
>> The QEMU use 256 as default vring size, also use this default value to c=
alculate the virtio=0A=
>> avail ring base address and used ring base address, and vhost in the bac=
kend use the ring base=0A=
>> address to do packet IO.=0A=
>>=0A=
>> Virtio spec also says the queue size in PCI configuration is read-only, =
so virtio front end=0A=
>> can't change it. just need use the read-only value to allocate space for=
 vring and calculate the=0A=
>> avail and used ring base address. Otherwise, the avail and used ring bas=
e address will be different=0A=
>> between host and guest, accordingly, packet IO can't work normally.=0A=
> virtio driver could still use the vq_size to initialize avail ring and=0A=
> use ring so that they still have the same base address.=0A=
> The other issue is vhost use  index & (vq->size -1) to index the ring.=0A=
>=0A=
>=0A=
> Thomas:=0A=
> This fix works but introduces slight change with original code. Could we=
=0A=
> just rollback that commit?=0A=
>=0A=
> d78deadae4dca240e85054bf2d604a801676becc=0A=
>=0A=
>=0A=
>> Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>=0A=
>> ---=0A=
>>  drivers/net/virtio/virtio_ethdev.c | 14 +++-----------=0A=
>>  1 file changed, 3 insertions(+), 11 deletions(-)=0A=
>>=0A=
>>=0A=
>=0A=
>=0A=
=0A=