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 D78992A5E for ; Mon, 13 Jul 2015 03:42:20 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 12 Jul 2015 18:42:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,459,1432623600"; d="scan'208";a="523145665" Received: from pgsmsx107.gar.corp.intel.com ([10.221.44.105]) by FMSMGA003.fm.intel.com with ESMTP; 12 Jul 2015 18:42:18 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.110.14) by PGSMSX107.gar.corp.intel.com (10.221.44.105) with Microsoft SMTP Server (TLS) id 14.3.224.2; Mon, 13 Jul 2015 09:40:30 +0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.165]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.46]) with mapi id 14.03.0224.002; Mon, 13 Jul 2015 09:40:28 +0800 From: "Ouyang, Changchun" To: Thomas Monjalon , "Xie, Huawei" Thread-Topic: [dpdk-dev] [PATCH] virtio: fix the vq size issue Thread-Index: AQHQs9JlQEOaxBUIeEyxKL7zRjwCJJ3URvsAgARqO+A= Date: Mon, 13 Jul 2015 01:40:27 +0000 Message-ID: References: <1435736930-26737-1-git-send-email-changchun.ouyang@intel.com> <2044421.GMCq5WsXf6@xps13> In-Reply-To: <2044421.GMCq5WsXf6@xps13> 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 Cc: "dev@dpdk.org" 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: Mon, 13 Jul 2015 01:42:21 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon > Sent: Friday, July 10, 2015 10:12 PM > To: Xie, Huawei > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] virtio: fix the vq size issue >=20 > 2015-07-10 14:05, Xie, Huawei: > > Thomas: > > Could we roll back that commit or apply Changchun's patch? >=20 > It is waiting an agreement with Changchun, symbolized by an Acked-by: I think applying this patch is better than rolling back the previous commit= , Besides fixing the issue, this patch also removes an unnecessary assigning = inside that function. >=20 >=20 > > On 7/1/2015 11:53 PM, Xie, Huawei wrote: > > > 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= . > > > > > > > > > Thomas: > > > This fix works but introduces slight change with original code. > > > Could we just rollback that commit? > > > > > > d78deadae4dca240e85054bf2d604a801676becc > > > > > > > > >> Signed-off-by: Changchun Ouyang > > >> --- > > >> drivers/net/virtio/virtio_ethdev.c | 14 +++----------- > > >> 1 file changed, 3 insertions(+), 11 deletions(-)