From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 79454A10 for ; Thu, 2 Jul 2015 04:02:02 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 01 Jul 2015 19:01:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,389,1432623600"; d="scan'208";a="517533934" Received: from pgsmsx106.gar.corp.intel.com ([10.221.44.98]) by FMSMGA003.fm.intel.com with ESMTP; 01 Jul 2015 19:01:50 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by PGSMSX106.gar.corp.intel.com (10.221.44.98) with Microsoft SMTP Server (TLS) id 14.3.224.2; Thu, 2 Jul 2015 10:01:49 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.246]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.146]) with mapi id 14.03.0224.002; Thu, 2 Jul 2015 10:01:48 +0800 From: "Xie, Huawei" To: "Ouyang, Changchun" , "dev@dpdk.org" , Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH] virtio: fix the vq size issue Thread-Index: AdC0FhKoXdj2uCB1RLi+8Fm6XGN5OA== Date: Thu, 2 Jul 2015 02:01:47 +0000 Message-ID: References: <1435736930-26737-1-git-send-email-changchun.ouyang@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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 02:02:03 -0000 On 7/2/2015 8:29 AM, Ouyang, Changchun wrote:=0A= > Hi huawei,=0A= >=0A= >> -----Original Message-----=0A= >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xie, Huawei=0A= >> Sent: Wednesday, July 1, 2015 11:53 PM=0A= >> To: dev@dpdk.org; Thomas Monjalon=0A= >> Subject: Re: [dpdk-dev] [PATCH] virtio: fix the vq size issue=0A= >>=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= =0A= >>> calculate the virtio avail ring base address and used ring base=0A= >>> address, and vhost in the backend use the ring base address to do packe= t=0A= >> IO.=0A= >>> Virtio spec also says the queue size in PCI configuration is=0A= >>> read-only, so virtio front end can't change it. just need use the=0A= >>> read-only value to allocate space for vring and calculate the avail=0A= >>> and used ring base address. Otherwise, the avail and used ring base=0A= >> address will be different between host and guest, accordingly, packet IO= =0A= >> can't work normally.=0A= >> virtio driver could still use the vq_size to initialize avail ring and u= se ring so=0A= >> that they still have the same base address.=0A= >> The other issue is vhost use index & (vq->size -1) to index the ring.= =0A= > I am not sure what is your clear message here,=0A= > Vhost has no choice but use vq->size -1 to index the ring, =0A= > It is qemu that always use 256 as the vq size, and set the avail and used= ring base address,=0A= > It also tells vhost the vq size is 256.=0A= =0A= I mean "the same base address issue" could be resolved, but we still=0A= couldn't stop vhost using idx & vq->size -1 to index the ring.=0A= =0A= >>=0A= >> Thomas:=0A= >> This fix works but introduces slight change with original code. Could we= just=0A= >> rollback that commit?=0A= > What's your major concern for the slight change here?=0A= > just removing the unnecessary check for nb_desc itself.=0A= > So I think no issue for the slight change. =0A= =0A= No major concern. It is better if this patch just rollbacks that commit=0A= without introduce extra change if not necessary.=0A= The original code set nb_desc to vq_size, though it isn't used later.=0A= =0A= >=0A= > Thanks=0A= > Changchun=0A= >=0A= >=0A= >=0A= >=0A= =0A=