From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 266ADA00BE; Thu, 28 May 2020 09:32:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 015CB1DA7C; Thu, 28 May 2020 09:32:00 +0200 (CEST) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id CA8DE1DA75 for ; Thu, 28 May 2020 09:31:57 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 368E75C00A0; Thu, 28 May 2020 03:31:57 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Thu, 28 May 2020 03:31:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm1; bh= iczLr1rC7AJsjSNeKEunYKdtncE+lNYsVka6wwMM/GU=; b=AQNrG82mI6wALFvw ovTSdk/iM84QUPLBpFhGeSYq8IGdnzDjhPfj/XLD2Ip2Oi3wfX3cC8eTsnfLYU4J QDOndKfjT6cHh6xfbt8sL5fUOJorcgnA2zdxvECAcIfKLZmuO5vVIuq562KJWQhJ o2oXYP1uR66MKl0EWzH0Rh2ojJKrJKzaW0sX7D6p87W7P2lax0D2hok2T640cI4w 0wUVL+2I3vz6Ryj3znO8vY6dfV8mcjS4mxadTvZcl/uRlmNX0FgegTeFtxN7xoOj jqh7e2ETvUDBQSXj5B72cHrka1QmKQJrmmVZ5LQwYV1EKHNMknS0S23AbjrPmXya jwsmpQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=iczLr1rC7AJsjSNeKEunYKdtncE+lNYsVka6wwMM/ GU=; b=Kj0xFT8cE7xNRTcS5uE+e3sQjmeBWBRMZXRrTaM2C494PGVAx8SEZR0rK rErJ//jrCzuGvEPun4l5YbaZXVADweAzytD3Sd8BUqnqQ/CFbRlQvr2jHVtOLwac Ro0AXBq/0bh1BqLFM6EOev+FLZ1VAiFa9HUAYdB3Ie7LJ3SVke/bjo++arpiZFuj 9h7r8qoG7H5h9txOWmH+OJyCuIxK32WeFF0PgtZSNYQiJRI+XgOsqsTp/z76pccu QkU8ban2K6l6F2VXAeawAe97HhZvDQnNq9CbmVH8MMhp/oXU4ypYzCzKfDYrx7rl /Kq9ZQ6MpuiHButOB7PbhdH83i1fQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedruddvhedguddtudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkjghfggfgtgesthhqredttddtjeenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpeekteehtdeivefhieegjeelgedufeejheekkeetueevieeuvdev uedtjeevheevteenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr lhhonhdrnhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 8798130618C1; Thu, 28 May 2020 03:31:55 -0400 (EDT) From: Thomas Monjalon To: Dmitry Kozlyuk Cc: dev@dpdk.org, Dmitry Malloy , Narcisa Ana Maria Vasile , Fady Bader , Tal Shnaiderman , Anatoly Burakov , Bruce Richardson , david.marchand@redhat.com Date: Thu, 28 May 2020 09:31:54 +0200 Message-ID: <93568913.luAXIRNmGZ@thomas> In-Reply-To: <20200525003720.6410-5-dmitry.kozliuk@gmail.com> References: <20200428235015.2820677-1-dmitry.kozliuk@gmail.com> <20200525003720.6410-1-dmitry.kozliuk@gmail.com> <20200525003720.6410-5-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v5 04/11] eal/mem: extract common code for memseg list initialization X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 25/05/2020 02:37, Dmitry Kozlyuk: > All supported OS create memory segment lists (MSL) and reserve VA space > for them in a nearly identical way. Move common code into EAL private > functions to reduce duplication. >=20 > Signed-off-by: Dmitry Kozlyuk > --- > +void > +eal_memseg_list_populate(struct rte_memseg_list *msl, void *addr, int n_= segs) > +{ > + uint64_t page_sz =3D msl->page_sz; [...] > + addr =3D RTE_PTR_ADD(addr, page_sz); This is an error in 32-bit compilation: lib/librte_eal/common/eal_common_memory.c: In function =E2=80=98eal_memseg_list_populate=E2=80=99: rte_common.h:215:30= : error: cast to pointer from integer of different size [-Werror=3Dint-to-pointer-ca= st] 215 | #define RTE_PTR_ADD(ptr, x) ((void*)((uintptr_t)(ptr) + (x))) | ^ The original code was doing a cast to size_t. > --- a/lib/librte_eal/linux/eal_memory.c > +++ b/lib/librte_eal/linux/eal_memory.c > - addr =3D RTE_PTR_ADD(addr, (size_t)page_sz); I believe the correct cast should be uintptr_t. Maybe it would be even more correct to do this cast inside RTE_PTR_ADD?