From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id 71490A6A for ; Tue, 19 Jul 2016 17:37:34 +0200 (CEST) Received: from alille-653-1-293-182.w90-1.abo.wanadoo.fr ([90.1.53.182] helo=[192.168.1.13]) by mail.droids-corp.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1bPX7x-0004ui-Vq; Tue, 19 Jul 2016 17:40:10 +0200 To: Zoltan Kiss , dev@dpdk.org References: <1468939061-19734-1-git-send-email-zoltan.kiss@schaman.hu> <1468939061-19734-2-git-send-email-zoltan.kiss@schaman.hu> From: Olivier Matz Message-ID: <600cac7d-b0aa-7919-93f2-7a396ef7b3ea@6wind.com> Date: Tue, 19 Jul 2016 17:37:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.1.0 MIME-Version: 1.0 In-Reply-To: <1468939061-19734-2-git-send-email-zoltan.kiss@schaman.hu> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] mempool: adjust name string size in related data types 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: Tue, 19 Jul 2016 15:37:34 -0000 Hi Zoltan, On 07/19/2016 04:37 PM, Zoltan Kiss wrote: > A recent fix brought up an issue about the size of the 'name' fields: > > 85cf0079 mem: avoid memzone/mempool/ring name truncation > > These relations should be observed: > > RTE_RING_NAMESIZE <= RTE_MEMZONE_NAMESIZE - strlen(RTE_RING_MZ_PREFIX) > RTE_MEMPOOL_NAMESIZE <= RTE_RING_NAMESIZE - strlen(RTE_MEMPOOL_MZ_PREFIX) > > Setting all of them to 32 hides this restriction from the application. > This patch increases the memzone string size to accomodate for these > prefixes, and the same happens with the ring name string. The ABI needs to > be broken to fix this API issue, this way doesn't break applications > previously not failing due to the truncating bug now fixed. > > Signed-off-by: Zoltan Kiss I agree it is a problem for an application because it cannot know what is the maximum name length. On the other hand, breaking the ABI for this looks a bit overkill. Maybe we could reduce RTE_MEMPOOL_NAMESIZE and RTE_RING_NAMESIZE instead of increasing RTE_MEMZONE_NAMESIZE? That way, we could keep the ABI as is. It would even be better to get rid of this static char[] for the structure names and replace it by an allocated const char *. I didn't check it's feasible for memzones. What do you think? In any case, I think it's a bit late for 16.07 for this kind of fix. Regards, Olivier