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 1F75F8D96 for ; Mon, 2 Nov 2015 09:05:21 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 02 Nov 2015 00:05:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,233,1444719600"; d="scan'208";a="840429428" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga002.jf.intel.com with ESMTP; 02 Nov 2015 00:05:14 -0800 Received: from fmsmsx156.amr.corp.intel.com (10.18.116.74) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 2 Nov 2015 00:05:13 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx156.amr.corp.intel.com (10.18.116.74) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 2 Nov 2015 00:05:13 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.96]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.106]) with mapi id 14.03.0248.002; Mon, 2 Nov 2015 16:05:11 +0800 From: "Liu, Jijiang" To: "Richardson, Bruce" Thread-Topic: [dpdk-dev] [PATCH v2 2/2] lib/lpm:fix an initialization issue of valid_group in the delete_depth_small() Thread-Index: AQHREx5vofgFSLbxpE+VcBbQU5ZH956IY8vg Date: Mon, 2 Nov 2015 08:05:11 +0000 Message-ID: <1ED644BD7E0A5F4091CF203DAFB8E4CC22BC738D@SHSMSX101.ccr.corp.intel.com> References: <1446210879-14242-1-git-send-email-jijiang.liu@intel.com> <1446210879-14242-3-git-send-email-jijiang.liu@intel.com> <20151030142227.GB10520@bricha3-MOBL3> In-Reply-To: <20151030142227.GB10520@bricha3-MOBL3> 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 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v2 2/2] lib/lpm:fix an initialization issue of valid_group in the delete_depth_small() 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: Mon, 02 Nov 2015 08:05:22 -0000 > -----Original Message----- > From: Richardson, Bruce > Sent: Friday, October 30, 2015 10:22 PM > To: Liu, Jijiang > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v2 2/2] lib/lpm:fix an initialization issu= e of > valid_group in the delete_depth_small() >=20 > On Fri, Oct 30, 2015 at 09:14:39PM +0800, Jijiang Liu wrote: >=20 > Title can be shortened to: "lpm: fix initialization of valid_group field" Ok > > Fixes an initialization issue of 'valid_group' in the delete_depth_smal= l > function. > > > > In this function, use new rte_lpm_tbl8_entry we call A to replace the > > old rte_lpm_tbl8_entry. But the valid_group do not set VALID, so it wil= l be > INVALID. > > > > Then when adding a new route which depth is > 24,the tbl8_alloc() > > function will search the rte_lpm_tbl8_entrys to find INVALID valid_grou= p, > and it will return the A to the add_depth_big function, so A's data is > overridden. > > >=20 > Not sure this message is entirely clear. > How about: > When adding an entry to a tbl8, the .valid_group field should always be= set, > so that future adds do not accidently find and use this table, thinking= it is > currently invalid, i.e. unused, and thereby overwrite existing entries. It is ok for me.=20 Nana, what do you think? > > Signed-off-by: NaNa > > > > --- > > lib/librte_lpm/rte_lpm.c | 1 + > > 1 files changed, 1 insertions(+), 0 deletions(-) > > > > diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c index > > 57ec2f0..3981452 100644 > > --- a/lib/librte_lpm/rte_lpm.c > > +++ b/lib/librte_lpm/rte_lpm.c > > @@ -769,6 +769,7 @@ delete_depth_small(struct rte_lpm *lpm, uint32_t > > ip_masked, > > > > struct rte_lpm_tbl8_entry new_tbl8_entry =3D { > > .valid =3D VALID, > > + .valid_group =3D VALID, > > .depth =3D sub_rule_depth, > > .next_hop =3D lpm->rules_tbl > > [sub_rule_index].next_hop, > > -- > > 1.7.7.6 > >