From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id C1F998DA1 for ; Thu, 29 Oct 2015 11:18:57 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 29 Oct 2015 03:18:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,213,1444719600"; d="scan'208";a="838302519" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.208.63]) by fmsmga002.fm.intel.com with SMTP; 29 Oct 2015 03:18:55 -0700 Received: by (sSMTP sendmail emulation); Thu, 29 Oct 2015 10:18:54 +0025 Date: Thu, 29 Oct 2015 10:18:54 +0000 From: Bruce Richardson To: "nana.nn" Message-ID: <20151029101854.GC6160@bricha3-MOBL3> References: <1446003855-5947-1-git-send-email-jijiang.liu@intel.com> <20151028144048.GA2504@bricha3-MOBL3> <1E3F319B-C4DF-45E9-9FC4-4D93B176CC9C@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1E3F319B-C4DF-45E9-9FC4-4D93B176CC9C@alibaba-inc.com> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] lib/lpm:fix two issues 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: Thu, 29 Oct 2015 10:18:58 -0000 On Thu, Oct 29, 2015 at 10:41:45AM +0800, nana.nn wrote: > Hi Bruce: > Should I send the test unit as a DPDK patch, or just the program for you to demonstrate the bugs? > > > Thank you very much! > > > Regards > > Na Na > A patch to add a unit test for the bug would be best. /Bruce > > > > On Oct 28, 2015, at 10:40 PM, Bruce Richardson wrote: > > > On Wed, Oct 28, 2015 at 11:44:15AM +0800, Jijiang Liu wrote: > >> Fix two issues in the delete_depth_small() function. > >> > >> 1> The control is not strict in this function. > >> > >> In the following structure, > >> struct rte_lpm_tbl24_entry { > >> union { > >> uint8_t next_hop; > >> uint8_t tbl8_gindex; > >> }; > >> uint8_t ext_entry :1; > >> } > >> > >> When ext_entry = 0, use next_hop.only to process rte_lpm_tbl24_entry. > >> > >> When ext_entry = 1, use tbl8_gindex to process the rte_lpm_tbl8_entry. > >> > >> When using LPM24 + 8 algorithm, it will use ext_entry to decide to process rte_lpm_tbl24_entry structure or rte_lpm_tbl8_entry structure. > >> If a route is deleted, the prefix of previous route is used to override the deleted route. when (lpm->tbl24[i].ext_entry == 0 && lpm->tbl24[i].depth > depth) > >> it should be ignored, but due to the incorrect logic, the next_hop is used as tbl8_gindex and will process the rte_lpm_tbl8_entry. > >> > >> 2> Initialization of rte_lpm_tbl8_entry is incorrect in this 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 will 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_group, > >> and it will return the A to the add_depth_big function, so A's data is overridden. > >> > >> Signed-off-by: NaNa > >> > > > > Hi NaNa, Jijiang, > > > > since this patch contains two separate fixes, it would be better split into > > two separate patches, one for each fix. Also, please add a "Fixes" line to > > the commit log. > > > > Are there still plans for a unit test to demonstrate the bug(s) and make it easy > > for us to verify the fix? > > > > Regards, > > /Bruce >