From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id D5DDE8E6A for ; Wed, 9 Sep 2015 05:20:27 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP; 08 Sep 2015 20:20:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,494,1437462000"; d="scan'208";a="558007272" Received: from pgsmsx102.gar.corp.intel.com ([10.221.44.80]) by FMSMGA003.fm.intel.com with ESMTP; 08 Sep 2015 20:20:19 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by PGSMSX102.gar.corp.intel.com (10.221.44.80) with Microsoft SMTP Server (TLS) id 14.3.224.2; Wed, 9 Sep 2015 11:20:17 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.171]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.101]) with mapi id 14.03.0224.002; Wed, 9 Sep 2015 11:20:16 +0800 From: "Xie, Huawei" To: "Ouyang, Changchun" , "dev@dpdk.org" Thread-Topic: vring_init bug Thread-Index: AdDqq6agTxroGwYsRweNipIXZei6RwAAdm/QAAA1KWA= Date: Wed, 9 Sep 2015 03:20:16 +0000 Message-ID: References: In-Reply-To: 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] vring_init bug 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, 09 Sep 2015 03:20:28 -0000 > -----Original Message----- > From: Ouyang, Changchun > Sent: Wednesday, September 09, 2015 11:18 AM > To: Xie, Huawei; dev@dpdk.org > Cc: Ouyang, Changchun > Subject: RE: vring_init bug >=20 >=20 > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xie, Huawei > > Sent: Wednesday, September 9, 2015 11:00 AM > > To: dev@dpdk.org > > Subject: [dpdk-dev] vring_init bug > > > > static inline void > > vring_init(struct vring *vr, unsigned int num, uint8_t *p, > > unsigned long align) > > { > > vr->num =3D num; > > vr->desc =3D (struct vring_desc *) p; > > vr->avail =3D (struct vring_avail *) (p + > > num * sizeof(struct vring_desc)); > > vr->used =3D (void *) > > RTE_ALIGN_CEIL((uintptr_t)(&vr->avail->ring[num]), align); } > > > > There is a bug in vr->used calculation. 2 bytes of used_event_idx isn't > > considered. Would submit a fix. > > __u16 available[num]; > > __u16 used_event_idx; >=20 > For vring_used ring, it also misses avail_event. >=20 > struct vring_used { > u16 flags ; > u16 idx ; > struct vring_used_elem r ing [qsz] ; > u16 avail_event ; // this one missed in dpdk > } ; >=20 > It doesn't affect the offset calculation, but it will be great if you can= add it > together. No need to add this field for use vring and you couldn't because previous a= rray is variable length.=20