From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 333CCB3BC for ; Tue, 21 Jun 2016 13:16:51 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 21 Jun 2016 04:16:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,503,1459839600"; d="scan'208";a="832361714" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by orsmga003.jf.intel.com with ESMTP; 21 Jun 2016 04:16:48 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.183]) by IRSMSX103.ger.corp.intel.com ([169.254.3.240]) with mapi id 14.03.0248.002; Tue, 21 Jun 2016 12:16:47 +0100 From: "Dumitrescu, Cristian" To: Thomas Monjalon , "Jastrzebski, MichalX K" , "Kobylinski, MichalX" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] lib/table: fix wrong type of nht field Thread-Index: AQHRytwY9foehcL8aEeRFiIhi1ix55/yEmoAgAGyIKA= Date: Tue, 21 Jun 2016 11:16:46 +0000 Message-ID: <3EB4FA525960D640B5BDFFD6A3D8912647A0A7CA@IRSMSX108.ger.corp.intel.com> References: <1466417424-3148-1-git-send-email-michalx.k.jastrzebski@intel.com> <4861300.L4XUoLVI0K@xps13> In-Reply-To: <4861300.L4XUoLVI0K@xps13> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzNhMTcxMjYtNmVmNi00Yjk3LWJhYTItNWQ2NzIzZDYwNDZmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX1BVQkxJQyJ9XX1dfSwiU3ViamVjdExhYmVscyI6W10sIlRNQ1ZlcnNpb24iOiIxNS45LjYuNiIsIlRydXN0ZWRMYWJlbEhhc2giOiJEanNPMGRcL1puVTFORVhyWU9TU1RVeW03YWdoaCtmNVZHYjI5UlhTRjE1VT0ifQ== x-ctpclassification: CTP_PUBLIC x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] lib/table: fix wrong type of nht field 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: Tue, 21 Jun 2016 11:16:51 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon > Sent: Monday, June 20, 2016 11:14 AM > To: Jastrzebski, MichalX K ; Kobylinski, > MichalX > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] lib/table: fix wrong type of nht field >=20 > 2016-06-20 12:10, Michal Jastrzebski: > > From: Michal Kobylinski > > > > Change type of nht field from uint32_t to uint8_t and increase max of > > next hops. > > > > Fixes: dc81ebbacaeb ("lpm: extend IPv4 next hop field") >=20 > Why the type is wrong? The lpm->nht is simply some raw memory allocated at the end of the table co= ntext using the usual pattern: struct rte_table_lpm { ...=20 uint8_t nht[0] __rte_cache_aligned; } Therefore, when we do:=20 nht_entry =3D &lpm->nht[i * lpm->entry_size]; in several places, it makes big difference whether nht_entry is declared as= uin8_t * (correct) or uint32_t * (incorrect), as the position computed by = the latter is 4 times the position computed by the former ;( Michal K and Michal J, I just realized we still need to do a small change to this patch, I will r= eply to the original mail now. So Thomas, sorry, there is one small change,= we'll send new version soon. Thanks, Cristian