From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier Matz Subject: Re: [PATCH 1/4] lpm: allocation of an existing object should fail Date: Fri, 1 Apr 2016 18:25:29 +0200 Message-ID: <56FEA0F9.4010500@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> <20160330144649.670d66d1@xeon-e3> <56FCD32E.2090707@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, bruce.richardson@intel.com To: Stephen Hemminger Return-path: Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id 1F30B2B9B for ; Fri, 1 Apr 2016 18:25:33 +0200 (CEST) Received: by mail-wm0-f49.google.com with SMTP id f198so32650440wme.0 for ; Fri, 01 Apr 2016 09:25:33 -0700 (PDT) In-Reply-To: <56FCD32E.2090707@6wind.com> 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 03/31/2016 09:35 AM, Olivier Matz wrote: > On 03/30/2016 11:46 PM, Stephen Hemminger wrote: >> 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. >> > > Could you be more precise about the use case you are > describing? Are you talking about a secondary process? > > The API description of lpm and hash says since the first > release that EEXIST should be returned if a memzone with > the same name already exists: > > * @return > * Handle to LPM object on success, NULL otherwise with rte_errno set > * to an appropriate values. Possible rte_errno values include: > * - E_RTE_NO_CONFIG - function could not get pointer to rte_config > structure > * - E_RTE_SECONDARY - function was called from a secondary process > instance > * - EINVAL - invalid parameter passed to function > * - ENOSPC - the maximum number of memzones has already been allocated > * - EEXIST - a memzone with the same name already exists > * - ENOMEM - no appropriate memory area found in which to create memzone > */ > struct rte_lpm * > rte_lpm_create(const char *name, int socket_id, > const struct rte_lpm_config *config); > > * @return > * Pointer to hash table structure that is used in future hash table > * operations, or NULL on error, with error code set in rte_errno. > * Possible rte_errno errors include: > * - E_RTE_NO_CONFIG - function could not get pointer to rte_config > structure > * - E_RTE_SECONDARY - function was called from a secondary process > instance > * - ENOENT - missing entry > * - EINVAL - invalid parameter passed to function > * - ENOSPC - the maximum number of memzones has already been allocated > * - EEXIST - a memzone with the same name already exists > * - ENOMEM - no appropriate memory area found in which to create memzone > */ > struct rte_hash * > rte_hash_create(const struct rte_hash_parameters *params); > > > From my point of view, the behavior I'm fixing is more a bug > fix than an API change. But if required, I can send a deprecation > notice for 16.04 and have the fix integrated for 16.07. > Stephen, any comment on this please? The problem is today some unit tests are not passing correctly. Thanks