From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 32F0E6945 for ; Thu, 31 Mar 2016 12:55:07 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 31 Mar 2016 03:55:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,422,1455004800"; d="scan'208";a="945164030" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.221.107]) by orsmga002.jf.intel.com with SMTP; 31 Mar 2016 03:55:04 -0700 Received: by (sSMTP sendmail emulation); Thu, 31 Mar 2016 11:55:03 +0025 Date: Thu, 31 Mar 2016 11:55:03 +0100 From: Bruce Richardson To: Stephen Hemminger Cc: Olivier Matz , dev@dpdk.org Message-ID: <20160331105503.GA22600@bricha3-MOBL3> References: <1458044745-32764-1-git-send-email-olivier.matz@6wind.com> <1459351827-3346-1-git-send-email-olivier.matz@6wind.com> <1459351827-3346-2-git-send-email-olivier.matz@6wind.com> <20160330144649.670d66d1@xeon-e3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160330144649.670d66d1@xeon-e3> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH 1/4] lpm: allocation of an existing object should fail 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, 31 Mar 2016 10:55:07 -0000 On Wed, Mar 30, 2016 at 02:46:49PM -0700, Stephen Hemminger wrote: > On Wed, 30 Mar 2016 17:30:24 +0200 > Olivier Matz wrote: > > > diff --git a/lib/librte_lpm/rte_lpm6.c b/lib/librte_lpm/rte_lpm6.c > > index 4c44cd7..9877a30 100644 > > --- a/lib/librte_lpm/rte_lpm6.c > > +++ b/lib/librte_lpm/rte_lpm6.c > > @@ -182,8 +182,11 @@ rte_lpm6_create(const char *name, int socket_id, > > if (strncmp(name, lpm->name, RTE_LPM6_NAMESIZE) == 0) > > break; > > } > > - if (te != NULL) > > + if (te != NULL) { > > + lpm = NULL; > > + rte_errno = EEXIST; > > goto exit; > > + } > > > > /* allocate tailq entry */ > > > > with older memzone model, objects in huge memory area were never freed. > That means when application restarts it finds the old LPM and works. > With your change it would break such an application. Is all the memory not zeroed on initialization? /Bruce