From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 4AEEA9428 for ; Wed, 21 Oct 2015 13:07:53 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 21 Oct 2015 04:07:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,711,1437462000"; d="scan'208";a="831639246" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.208.65]) by orsmga002.jf.intel.com with SMTP; 21 Oct 2015 04:07:51 -0700 Received: by (sSMTP sendmail emulation); Wed, 21 Oct 2015 12:07:49 +0025 Date: Wed, 21 Oct 2015 12:07:49 +0100 From: Bruce Richardson To: mablexidana Message-ID: <20151021110749.GD16140@bricha3-MOBL3> References: <5e5d9466.100a4.15089d2018f.Coremail.mablexidana@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5e5d9466.100a4.15089d2018f.Coremail.mablexidana@163.com> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] fix lpm bugs 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, 21 Oct 2015 11:07:53 -0000 On Wed, Oct 21, 2015 at 05:54:13PM +0800, mablexidana wrote: > hi: > We test some lpm cases and find some bugs, below is how to fix it. thanks :) Hi, thanks for the patch. Could you perhaps provide a description of how to reproduce the bug (or bugs you are fixing), so that we can reproduce them and verify the fix. (A unit test added to the existing lpm unit tests for this would be the best solution.) For the patch itself, the commit message should also describe the bug, and how the patch fixes it. It's also good to include a one-line "Fixes:" line in the comment - generated by using the git alias "fixline" added as: fixline = log -1 --abbrev=12 --format='Fixes: %h (\"%s\")' Regards, /Bruce > --- > lib/librte_lpm/rte_lpm.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > > diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c > index 163ba3c..b5199ff 100644 > --- a/lib/librte_lpm/rte_lpm.c > +++ b/lib/librte_lpm/rte_lpm.c > @@ -735,7 +735,7 @@ delete_depth_small(struct rte_lpm *lpm, uint32_t ip_masked, > lpm->tbl24[i].depth <= depth ) { > lpm->tbl24[i].valid = INVALID; > } > - else { > + else if (lpm->tbl24[i].ext_entry == 1){ > /* > * If TBL24 entry is extended, then there has > * to be a rule with depth >= 25 in the > @@ -770,6 +770,7 @@ delete_depth_small(struct rte_lpm *lpm, uint32_t ip_masked, > > > struct rte_lpm_tbl8_entry new_tbl8_entry = { > .valid = VALID, > + .valid_group = VALID, > .depth = sub_rule_depth, > .next_hop = lpm->rules_tbl > [sub_rule_index].next_hop, > @@ -781,7 +782,7 @@ delete_depth_small(struct rte_lpm *lpm, uint32_t ip_masked, > lpm->tbl24[i].depth <= depth ) { > lpm->tbl24[i] = new_tbl24_entry; > } > - else { > + else if (lpm->tbl24[i].ext_entry == 1) { > /* > * If TBL24 entry is extended, then there has > * to be a rule with depth >= 25 in the > -- > 1.8.5.2 (Apple Git-48)