From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by dpdk.org (Postfix) with ESMTP id 463B13238 for ; Wed, 30 Mar 2016 23:46:35 +0200 (CEST) Received: by mail-pa0-f52.google.com with SMTP id fe3so50062619pab.1 for ; Wed, 30 Mar 2016 14:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4S0hVUaI+Z0Y1WurwbdQN05vyLJ7MKbNqulrOppdLT0=; b=tyn5tJH1LXhneti9zqARYA3b+KZBZWMS56XdnJo2q6cXI3zGgkOTvW5q2IOnQY/+8p dbFvgI0UHbO9SqDDk/5G8+k/kZ5nrGZn3zqHwOPV87bjkHZQ/7cV3KPgl+odq6pVRtHT ntnRj0AnXzE7ab7KxsRjpkEX4SPqbvgIPOgydGHpGdok7idN026NhbeNGtnHWo4AYQ1y Wgz2SzOcN2cdyBHlvBVwiJZJt0PRQ9VYlJH2l5rxTjfnKhC7iHfbCCvdXmgs1O2dToqn u/1kQRZDS2P6JxDikXOz1gYGoaVP+wi6algbH7D9bwX6dlXhNz7hbbmkl7yKoDummX40 FESw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4S0hVUaI+Z0Y1WurwbdQN05vyLJ7MKbNqulrOppdLT0=; b=Xfvf3gOk8g6s9zCqWHEilnAPJwkslVbdQz9bRmmNBVFp69MrlZTU3pEDYV8ytaKvgt SqjGX4WIjgY8MCPHwUZZ5vkL7aLMZIxvwatPGfSKZKFdzq+VtsKoOa5cFL41bib8k5PW 11F3fj2Z9QLYWGEifX/XgYxD6CxfnAcOkId+CkGaUZOV/Rhmu3z8jMjQ78QmovVQu/Ks gPUWJMB914app8yohudX6btxtFCRUnKC3XKcRl1V1CajdeJq1ffxGSBSKC2X2AhsrrjX b5bC6jU2hQWhP2DSIWByE/3C21BSosPGziIbhDxW6jsKr/Fbw8rN2d2MrRQ6eJ7PNzrn wp/g== X-Gm-Message-State: AD7BkJKDuyFdrYjMcWzdWZGTHmnAajbjo0ThpmuMu/VByW5YXaB7/iejY3FDfqgWn+TxfA== X-Received: by 10.66.141.103 with SMTP id rn7mr16600805pab.70.1459374394714; Wed, 30 Mar 2016 14:46:34 -0700 (PDT) Received: from xeon-e3 (static-50-53-73-178.bvtn.or.frontiernet.net. [50.53.73.178]) by smtp.gmail.com with ESMTPSA id 85sm8144169pfl.18.2016.03.30.14.46.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Mar 2016 14:46:34 -0700 (PDT) Date: Wed, 30 Mar 2016 14:46:49 -0700 From: Stephen Hemminger To: Olivier Matz Cc: dev@dpdk.org, bruce.richardson@intel.com Message-ID: <20160330144649.670d66d1@xeon-e3> In-Reply-To: <1459351827-3346-2-git-send-email-olivier.matz@6wind.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: Wed, 30 Mar 2016 21:46:35 -0000 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.