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 8158CCE7 for ; Wed, 3 Aug 2016 09:17:52 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 03 Aug 2016 00:17:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,465,1464678000"; d="scan'208";a="743500293" Received: from kmsmsx154.gar.corp.intel.com ([172.21.73.14]) by FMSMGA003.fm.intel.com with ESMTP; 03 Aug 2016 00:17:45 -0700 Received: from pgsmsx106.gar.corp.intel.com ([169.254.9.132]) by KMSMSX154.gar.corp.intel.com ([169.254.12.138]) with mapi id 14.03.0248.002; Wed, 3 Aug 2016 15:17:42 +0800 From: "Dai, Wei" To: "dev@dpdk.org" , "Richardson, Bruce" Thread-Topic: [PATCH v3 3/3] lpm: remove redundant check when adding lpm rule Thread-Index: AQHR7VWHaKy76m6eHUKXFb34dYoJfqA20qHg Date: Wed, 3 Aug 2016 07:17:42 +0000 Message-ID: <49759EB36A64CF4892C1AFEC9231E8D63A2688A4@PGSMSX106.gar.corp.intel.com> References: <1470103765-18226-1-git-send-email-wei.dai@intel.com> <1470207858-21149-1-git-send-email-wei.dai@intel.com> In-Reply-To: <1470207858-21149-1-git-send-email-wei.dai@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiN2VjYjViMTYtZTUwMS00MTA4LTgwOTgtYTQ0MDVhOWQwNmMyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlFob1NvbTVPQVFmcm5uNWZxWnRtVFIwVGdnZm85bmI3bURtb24xNGlCXC9NPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [172.30.20.205] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3 3/3] lpm: remove redundant check when adding lpm rule 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, 03 Aug 2016 07:17:53 -0000 This patch is same as patch 15064 which has been acked by Bruce Richardson. Resending it as 2/3 of a series of patches for same rte_lpm.c . > -----Original Message----- > From: Dai, Wei > Sent: Wednesday, August 3, 2016 3:04 PM > To: dev@dpdk.org > Cc: Dai, Wei > Subject: [PATCH v3 3/3] lpm: remove redundant check when adding lpm rule >=20 > When a rule with depth > 24 is added into an existing rule with depth <= =3D24, a > new tbl8 is allocated, the existing rule first fulfill whole new tbl8, so= the filed > valid of each entry in this tbl8 is always true and depth of each entry i= s always > <=3D 24 before adding the new rule with depth > 24. >=20 > Signed-off-by: Wei Dai > --- > lib/librte_lpm/rte_lpm.c | 22 ++++++---------------- > 1 file changed, 6 insertions(+), 16 deletions(-) >=20 > diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c index > 24fec4b..ec67765 100644 > --- a/lib/librte_lpm/rte_lpm.c > +++ b/lib/librte_lpm/rte_lpm.c > @@ -940,14 +940,9 @@ add_depth_big_v20(struct rte_lpm_v20 *lpm, > uint32_t ip_masked, uint8_t depth, >=20 > /* Insert new rule into the tbl8 entry. */ > for (i =3D tbl8_index; i < tbl8_index + tbl8_range; i++) { > - if (!lpm->tbl8[i].valid || > - lpm->tbl8[i].depth <=3D depth) { > - lpm->tbl8[i].valid =3D VALID; > - lpm->tbl8[i].depth =3D depth; > - lpm->tbl8[i].next_hop =3D next_hop; > - > - continue; > - } > + lpm->tbl8[i].valid =3D VALID; > + lpm->tbl8[i].depth =3D depth; > + lpm->tbl8[i].next_hop =3D next_hop; > } >=20 > /* > @@ -1071,14 +1066,9 @@ add_depth_big_v1604(struct rte_lpm *lpm, > uint32_t ip_masked, uint8_t depth, >=20 > /* Insert new rule into the tbl8 entry. */ > for (i =3D tbl8_index; i < tbl8_index + tbl8_range; i++) { > - if (!lpm->tbl8[i].valid || > - lpm->tbl8[i].depth <=3D depth) { > - lpm->tbl8[i].valid =3D VALID; > - lpm->tbl8[i].depth =3D depth; > - lpm->tbl8[i].next_hop =3D next_hop; > - > - continue; > - } > + lpm->tbl8[i].valid =3D VALID; > + lpm->tbl8[i].depth =3D depth; > + lpm->tbl8[i].next_hop =3D next_hop; > } >=20 > /* > -- > 2.5.5