From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH 1/2] mempool: fix returned value on 64 bit after counting objects Date: Fri, 29 May 2015 17:57:29 +0200 Message-ID: <1652788.pJy0Kp4cx7@xps13> References: <1432571266-25840-1-git-send-email-adrien.mazarguil@6wind.com> <2601191342CEEE43887BDE71AB97725821431E1D@irsmsx105.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Adrien Mazarguil Return-path: Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 2AB81B3D6 for ; Fri, 29 May 2015 20:41:37 +0200 (CEST) Received: by wgbgq6 with SMTP id gq6so69940175wgb.3 for ; Fri, 29 May 2015 11:41:37 -0700 (PDT) In-Reply-To: <2601191342CEEE43887BDE71AB97725821431E1D@irsmsx105.ger.corp.intel.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" 2015-05-27 00:43, Ananyev, Konstantin: > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Adrien Mazarguil > > rte_mempool_xmem_usage()'s return type is ssize_t which has the same > > architecture-dependent width as size_t but is signed. > > > > On 64-bit architectures, returning a negative uint32_t value without casting > > to ssize_t first does not work as intended, the sign bit is lost and the > > returned value is garbage. > > > > This commit fixes an assertion failure in testpmd on 64 bit architectures > > when combining --no-huge and --mp-anon outside of Xen Dom0: > > > > PANIC in mempool_anon_create(): > > line 170 assert "elt_num == mp->size" failed > > > > Fixes: 148f963fb532 ("xen: core library changes") > > > > Signed-off-by: Adrien Mazarguil > > Acked-by: Konstantin Ananyev Applied, thanks