From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 16A03C32E for ; 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" To: "dev@dpdk.org" , Thomas Monjalon 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: 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: 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 =0A= >> ---=0A= >> drivers/net/virtio/virtio_ethdev.c | 14 +++-----------=0A= >> 1 file changed, 3 insertions(+), 11 deletions(-)=0A= >>=0A= >>=0A= >=0A= >=0A= =0A=