From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: Re: [PATCH 1/4] lpm: allocation of an existing object should fail Date: Thu, 31 Mar 2016 11:55:03 +0100 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 Cc: Olivier Matz , dev@dpdk.org To: Stephen Hemminger 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) Content-Disposition: inline In-Reply-To: <20160330144649.670d66d1@xeon-e3> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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