From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 7E0361DB1 for ; Thu, 2 Jul 2015 04:17:00 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 01 Jul 2015 19:16:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,389,1432623600"; d="scan'208";a="754450137" Received: from pgsmsx102.gar.corp.intel.com ([10.221.44.80]) by fmsmga002.fm.intel.com with ESMTP; 01 Jul 2015 19:16:54 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by PGSMSX102.gar.corp.intel.com (10.221.44.80) with Microsoft SMTP Server (TLS) id 14.3.224.2; Thu, 2 Jul 2015 10:16:53 +0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.165]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.168]) with mapi id 14.03.0224.002; Thu, 2 Jul 2015 10:16:52 +0800 From: "Ouyang, Changchun" To: "Xie, Huawei" , "dev@dpdk.org" , Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH] virtio: fix the vq size issue Thread-Index: AQHQs9JlQEOaxBUIeEyxKL7zRjwCJJ3HceNA Date: Thu, 2 Jul 2015 02:16:51 +0000 Message-ID: References: <1435736930-26737-1-git-send-email-changchun.ouyang@intel.com> In-Reply-To: Accept-Language: zh-CN, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 02:17:05 -0000 > -----Original Message----- > From: Xie, Huawei > Sent: Thursday, July 2, 2015 10:02 AM > To: Ouyang, Changchun; dev@dpdk.org; Thomas Monjalon > Subject: Re: [dpdk-dev] [PATCH] virtio: fix the vq size issue >=20 > On 7/2/2015 8:29 AM, Ouyang, Changchun wrote: > > Hi huawei, > > > >> -----Original Message----- > >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xie, Huawei > >> Sent: Wednesday, July 1, 2015 11:53 PM > >> To: dev@dpdk.org; Thomas Monjalon > >> Subject: Re: [dpdk-dev] [PATCH] virtio: fix the vq size issue > >> > >> On 7/1/2015 3:49 PM, Ouyang Changchun wrote: > >>> This commit breaks virtio basic packets rx functionality: > >>> d78deadae4dca240e85054bf2d604a801676becc > >>> > >>> The QEMU use 256 as default vring size, also use this default value > >>> to calculate the virtio avail ring base address and used ring base > >>> address, and vhost in the backend use the ring base address to do > >>> packet > >> IO. > >>> Virtio spec also says the queue size in PCI configuration is > >>> read-only, so virtio front end can't change it. just need use the > >>> read-only value to allocate space for vring and calculate the avail > >>> and used ring base address. Otherwise, the avail and used ring base > >> address will be different between host and guest, accordingly, packet > >> IO can't work normally. > >> virtio driver could still use the vq_size to initialize avail ring > >> and use ring so that they still have the same base address. > >> The other issue is vhost use index & (vq->size -1) to index the ring. > > I am not sure what is your clear message here, Vhost has no choice but > > use vq->size -1 to index the ring, It is qemu that always use 256 as > > the vq size, and set the avail and used ring base address, It also > > tells vhost the vq size is 256. >=20 > I mean "the same base address issue" could be resolved, but we still coul= dn't > stop vhost using idx & vq->size -1 to index the ring. >=20 Then this patch will resolve this avail ring base address issue. > >> > >> Thomas: > >> This fix works but introduces slight change with original code. Could > >> we just rollback that commit? > > What's your major concern for the slight change here? > > just removing the unnecessary check for nb_desc itself. > > So I think no issue for the slight change. >=20 > No major concern. It is better if this patch just rollbacks that commit w= ithout > introduce extra change if not necessary. > The original code set nb_desc to vq_size, though it isn't used later. >=20 I prefer to have the slight change to remove unnecessary setting. > > > > Thanks > > Changchun > > > > > > > >