From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by dpdk.org (Postfix) with ESMTP id B579E2BD0 for ; Thu, 31 Mar 2016 09:35:13 +0200 (CEST) Received: by mail-wm0-f44.google.com with SMTP id 191so115732979wmq.0 for ; Thu, 31 Mar 2016 00:35:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=23CRo0Bxx0IqWLKHUEbaE5ox+BU5xdPNA5+oUdEtipg=; b=L9/novYs3YJH2oooqM1R/vUXCjSsjGaC3fNULl9QSXZRU43aBltVt2pu8pIYM00PdQ QlIfFhy2NlycZa83dDFoVTRxD3YKDnH1L/zsGoqwdBRRKhICbIrKPXyfRPyD2K9TwfFB FA1uINmkluG7Jk1HZs2R1ql7KIz3rsSkioGLQMNMGLFwkGfyhIWjpkIb2S/yCbScehuy AnW8arQulEs5P9X/yb4En9t+9sUh7luTwW7eUm1ITnvh5xCcj4qhi+ox6FfxR8ZRovqT WG+BPaDVklDMkLfadIpyA4kj0caVOpacgv3ZiDo/Tgy5JVMO1GViKAkgYHPs9JS9ZbGO MYfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=23CRo0Bxx0IqWLKHUEbaE5ox+BU5xdPNA5+oUdEtipg=; b=fV0tL7f0BSFXdD2094kf9aHynDqUgy7rmLk1GTFY+dQJdtPa1YdSY6wG+maMD9nPGE Gy3dPzKzhC2yFduB3yXyjkiSucN8qkNVPjzLF0Qt3gbhfkl8+C9BeHlo8229oEWyv5k1 JN+YgKFsveFVLhtaXjhh2fl+4IMp0GXjWSYAfg4SnjRGNV5jOyvqGvHuiZHhr4HestuR 89Gt1hKzPNPV9+Io4ML9Fz8svuyjsIL6wKx2RfcfWLhuGA8dNKj+W0Pann6O7jDPbrbx SYp0NOkqQxXH7szfBu8OgTrx2Ozyb3Mg6+HvKOV9amOY9yz65keUz2vAP/3fteOZGdw2 zaXw== X-Gm-Message-State: AD7BkJJjDoOAz4DG9c9Z1NhBFCJG5ZF0H/Rp+or2EMmRcYrcMqIQ/pLVWQeMt6P8pd0tR5ES X-Received: by 10.28.194.132 with SMTP id s126mr14888954wmf.76.1459409713551; Thu, 31 Mar 2016 00:35:13 -0700 (PDT) Received: from [192.168.0.10] (was59-1-82-226-113-214.fbx.proxad.net. [82.226.113.214]) by smtp.gmail.com with ESMTPSA id gk4sm7579970wjd.7.2016.03.31.00.35.12 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 31 Mar 2016 00:35:12 -0700 (PDT) To: Stephen Hemminger 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> Cc: dev@dpdk.org, bruce.richardson@intel.com From: Olivier Matz X-Enigmail-Draft-Status: N1110 Message-ID: <56FCD32E.2090707@6wind.com> Date: Thu, 31 Mar 2016 09:35:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160330144649.670d66d1@xeon-e3> Content-Type: text/plain; charset=windows-1252 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: Thu, 31 Mar 2016 07:35:13 -0000 Hi Stephen, On 03/30/2016 11:46 PM, 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. > 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.