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 BEA0E2716 for ; Wed, 1 Jul 2015 17:53:34 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 01 Jul 2015 08:53:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,386,1432623600"; d="scan'208";a="738587321" Received: from kmsmsx153.gar.corp.intel.com ([172.21.73.88]) by fmsmga001.fm.intel.com with ESMTP; 01 Jul 2015 08:53:32 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by KMSMSX153.gar.corp.intel.com (172.21.73.88) with Microsoft SMTP Server (TLS) id 14.3.224.2; Wed, 1 Jul 2015 23:53:31 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.246]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.168]) with mapi id 14.03.0224.002; Wed, 1 Jul 2015 23:53:30 +0800 From: "Xie, Huawei" To: "dev@dpdk.org" , Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH] virtio: fix the vq size issue Thread-Index: AdC0FhKoXdj2uCB1RLi+8Fm6XGN5OA== Date: Wed, 1 Jul 2015 15:53:29 +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: Wed, 01 Jul 2015 15:53:35 -0000 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 ca= lculate the virtio=0A= > avail ring base address and used ring base address, and vhost in the back= end 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, s= o 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 base= 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= >=0A= > Signed-off-by: Changchun Ouyang =0A= > ---=0A= > drivers/net/virtio/virtio_ethdev.c | 14 +++-----------=0A= > 1 file changed, 3 insertions(+), 11 deletions(-)=0A= >=0A= >=0A= =0A=