From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id EC96E5952 for ; Tue, 21 Jun 2016 13:20:09 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 21 Jun 2016 04:20:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,503,1459839600"; d="scan'208";a="722785197" Received: from irsmsx110.ger.corp.intel.com ([163.33.3.25]) by FMSMGA003.fm.intel.com with ESMTP; 21 Jun 2016 04:20:09 -0700 Received: from irsmsx156.ger.corp.intel.com (10.108.20.68) by irsmsx110.ger.corp.intel.com (163.33.3.25) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 21 Jun 2016 12:20:06 +0100 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.183]) by IRSMSX156.ger.corp.intel.com ([10.108.20.68]) with mapi id 14.03.0248.002; Tue, 21 Jun 2016 12:20:06 +0100 From: "Dumitrescu, Cristian" To: "Jastrzebski, MichalX K" , "dev@dpdk.org" CC: "Kobylinski, MichalX" Thread-Topic: [dpdk-dev] [PATCH] lib/table: fix wrong type of nht field Thread-Index: AQHRytwY9foehcL8aEeRFiIhi1ix55/zxxqw Date: Tue, 21 Jun 2016 11:20:05 +0000 Message-ID: <3EB4FA525960D640B5BDFFD6A3D8912647A0A7EF@IRSMSX108.ger.corp.intel.com> References: <1466417424-3148-1-git-send-email-michalx.k.jastrzebski@intel.com> In-Reply-To: <1466417424-3148-1-git-send-email-michalx.k.jastrzebski@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjhhYjBmZWQtNzc4Yi00ZjE0LWJmOGUtZTE2MTI5Njg4YTU3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImN6cE1zQ0NHZlwvbklZS3Q4b080NURjUndhN0RySGwrOU9BZ3BpTDJtb2hRPSJ9 x-ctpclassification: CTP_IC 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:20:10 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Michal Jastrzebski > Sent: Monday, June 20, 2016 11:10 AM > To: dev@dpdk.org > Cc: Kobylinski, MichalX > Subject: [dpdk-dev] [PATCH] lib/table: fix wrong type of nht field >=20 > From: Michal Kobylinski >=20 > Change type of nht field from uint32_t to uint8_t and increase max of > next hops. >=20 > Fixes: dc81ebbacaeb ("lpm: extend IPv4 next hop field") >=20 > Signed-off-by: Michal Kobylinski > Acked-by: Cristian Dumitrescu > --- > examples/ip_pipeline/pipeline/pipeline_routing_be.h | 2 +- > lib/librte_table/rte_table_lpm.c | 8 ++++---- > 2 files changed, 5 insertions(+), 5 deletions(-) >=20 > diff --git a/examples/ip_pipeline/pipeline/pipeline_routing_be.h > b/examples/ip_pipeline/pipeline/pipeline_routing_be.h > index 1276342..ea50896 100644 > --- a/examples/ip_pipeline/pipeline/pipeline_routing_be.h > +++ b/examples/ip_pipeline/pipeline/pipeline_routing_be.h > @@ -42,7 +42,7 @@ > * Pipeline argument parsing > */ > #ifndef PIPELINE_ROUTING_N_ROUTES_DEFAULT > -#define PIPELINE_ROUTING_N_ROUTES_DEFAULT 4096 > +#define PIPELINE_ROUTING_N_ROUTES_DEFAULT 65536 > #endif >=20 Changing the PIPELINE_ROUTING_N_ROUTES_DEFAULT is actually not required, t= his is simply the default value which can be changed through the configurat= ion file. Please remove this. > enum pipeline_routing_encap { > diff --git a/lib/librte_table/rte_table_lpm.c > b/lib/librte_table/rte_table_lpm.c > index cdeb0f5..f2eaed5 100644 > --- a/lib/librte_table/rte_table_lpm.c > +++ b/lib/librte_table/rte_table_lpm.c > @@ -44,7 +44,7 @@ >=20 > #include "rte_table_lpm.h" >=20 > -#define RTE_TABLE_LPM_MAX_NEXT_HOPS 256 > +#define RTE_TABLE_LPM_MAX_NEXT_HOPS 65536 >=20 With the next hop size of 24 bits, we can now make this configurable, so pl= ease use: #ifndef RTE_TABLE_LPM_MAX_NEXT_HOPS #define RTE_TABLE_LPM_MAX_NEXT_HOPS 65536 #endif > #ifdef RTE_TABLE_STATS_COLLECT >=20 > @@ -74,7 +74,7 @@ struct rte_table_lpm { >=20 > /* Next Hop Table (NHT) */ > uint32_t nht_users[RTE_TABLE_LPM_MAX_NEXT_HOPS]; > - uint32_t nht[0] __rte_cache_aligned; > + uint8_t nht[0] __rte_cache_aligned; > }; >=20 > static void * > @@ -188,7 +188,7 @@ nht_find_existing(struct rte_table_lpm *lpm, void > *entry, uint32_t *pos) > uint32_t i; >=20 > for (i =3D 0; i < RTE_TABLE_LPM_MAX_NEXT_HOPS; i++) { > - uint32_t *nht_entry =3D &lpm->nht[i * lpm->entry_size]; > + uint8_t *nht_entry =3D &lpm->nht[i * lpm->entry_size]; >=20 > if ((lpm->nht_users[i] > 0) && (memcmp(nht_entry, entry, > lpm->entry_unique_size) =3D=3D 0)) { > @@ -242,7 +242,7 @@ rte_table_lpm_entry_add( >=20 > /* Find existing or free NHT entry */ > if (nht_find_existing(lpm, entry, &nht_pos) =3D=3D 0) { > - uint32_t *nht_entry; > + uint8_t *nht_entry; >=20 > if (nht_find_free(lpm, &nht_pos) =3D=3D 0) { > RTE_LOG(ERR, TABLE, "%s: NHT full\n", __func__); > -- > 1.9.1