From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] virtio: fix the vq size issue Date: Fri, 10 Jul 2015 16:11:52 +0200 Message-ID: <2044421.GMCq5WsXf6@xps13> References: <1435736930-26737-1-git-send-email-changchun.ouyang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: "Xie, Huawei" Return-path: Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by dpdk.org (Postfix) with ESMTP id DBDC6C35E for ; Fri, 10 Jul 2015 16:13:00 +0200 (CEST) Received: by wicmz13 with SMTP id mz13so14867408wic.0 for ; Fri, 10 Jul 2015 07:13:00 -0700 (PDT) In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2015-07-10 14:05, Xie, Huawei: > Thomas: > Could we roll back that commit or apply Changchun's patch? It is waiting an agreement with Changchun, symbolized by an Acked-by: > 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(-)