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 2AF285A32 for ; Thu, 24 Sep 2015 09:30:49 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP; 24 Sep 2015 00:30:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,579,1437462000"; d="scan'208";a="811847757" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 24 Sep 2015 00:30:45 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 24 Sep 2015 00:30:45 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 24 Sep 2015 00:30:45 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.75]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.12]) with mapi id 14.03.0248.002; Thu, 24 Sep 2015 15:30:42 +0800 From: "Xie, Huawei" To: "dev@dpdk.org" , "Tan, Jianfeng" Thread-Topic: [PATCH] virtio: fix used ring address calculation Thread-Index: AdD2muprNE0MPM/rRbSxj2BYBglYmg== Date: Thu, 24 Sep 2015 07:30:41 +0000 Message-ID: References: <1442806742-32547-1-git-send-email-huawei.xie@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 used ring address calculation 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, 24 Sep 2015 07:30:49 -0000 On 9/21/2015 11:39 AM, Xie, Huawei wrote:=0A= vring_size calculation should consider both used_event_idx at the tail=0A= of avail ring and avail_event_idx at the tail of used ring.=0A= Will merge those two fixes and send a new patch.=0A= > used event idx is put at the end of available ring. It isn't taken into a= ccount=0A= > when we calculate the address of used ring. Fortunately, it doesn't intro= duce=0A= > the bug with fixed queue number 256 and 4KB alignment.=0A= >=0A= > Signed-off-by: hxie5 =0A= > ---=0A= > drivers/net/virtio/virtio_ring.h | 2 +-=0A= > 1 file changed, 1 insertion(+), 1 deletion(-)=0A= >=0A= > diff --git a/drivers/net/virtio/virtio_ring.h b/drivers/net/virtio/virtio= _ring.h=0A= > index a16c499..92e430d 100644=0A= > --- a/drivers/net/virtio/virtio_ring.h=0A= > +++ b/drivers/net/virtio/virtio_ring.h=0A= > @@ -145,7 +145,7 @@ vring_init(struct vring *vr, unsigned int num, uint8_= t *p,=0A= > vr->avail =3D (struct vring_avail *) (p +=0A= > num * sizeof(struct vring_desc));=0A= > vr->used =3D (void *)=0A= > - RTE_ALIGN_CEIL((uintptr_t)(&vr->avail->ring[num]), align);=0A= > + RTE_ALIGN_CEIL((uintptr_t)(&vr->avail->ring[num + 1]), align);=0A= > }=0A= > =0A= > /*=0A= =0A=