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 709FEADC3 for ; Sun, 22 Feb 2015 21:29:05 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 22 Feb 2015 12:29:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,626,1418112000"; d="scan'208";a="458049666" Received: from omishael-mobl.ger.corp.intel.com ([10.252.18.211]) by FMSMGA003.fm.intel.com with SMTP; 22 Feb 2015 12:13:41 -0800 Received: by (sSMTP sendmail emulation); Sun, 22 Feb 2015 20:29:00 +0025 Date: Sun, 22 Feb 2015 20:29:00 +0000 From: Bruce Richardson To: Igor Ryzhov Message-ID: <20150222202859.GA6840@bricha3-MOBL3> References: <1424438206-29526-1-git-send-email-iryzhov@nfware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1424438206-29526-1-git-send-email-iryzhov@nfware.com> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] lpm: fix overflow issue 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: Sun, 22 Feb 2015 20:29:05 -0000 On Fri, Feb 20, 2015 at 04:16:46PM +0300, Igor Ryzhov wrote: > LPM table overflow may occur if table is full and added rule has the biggest depth that already have some rules. > > Signed-off-by: Igor Ryzhov Acked-by: Bruce Richardson > --- > lib/librte_lpm/rte_lpm.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c > index 983e04b..cc51210 100644 > --- a/lib/librte_lpm/rte_lpm.c > +++ b/lib/librte_lpm/rte_lpm.c > @@ -298,6 +298,9 @@ rule_add(struct rte_lpm *lpm, uint32_t ip_masked, uint8_t depth, > return rule_index; > } > } > + > + if (rule_index == lpm->max_rules) > + return -ENOSPC; > } else { > /* Calculate the position in which the rule will be stored. */ > rule_index = 0; > -- > 1.9.3 (Apple Git-50) >