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 D7B61A00BE; Thu, 28 May 2020 12:04:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BD58E1DB89; Thu, 28 May 2020 12:04:57 +0200 (CEST) Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) by dpdk.org (Postfix) with ESMTP id 9E2B71DB7A for ; Thu, 28 May 2020 12:04:56 +0200 (CEST) Received: by mail-lf1-f66.google.com with SMTP id u16so14478156lfl.8 for ; Thu, 28 May 2020 03:04:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=e+e23JwjEfCm8MpsrTNFNCaa+ge8lxGMTn4GJlwA/xA=; b=fdDybs379aSdZ1l35Fed+6reSp8H1vOtDOxjx8nTp0q9mMwXSSGPPNcMhM0MIG0Oeg Xp0lNqtZva9NARpDj+GJpniSepOY+DsD8Eq3dOEBiI4geQLE2DGvwBlgnXZIpLQivVPQ s7DnTWHL5Z++8XgiGwUf6but1borhKIzYVHam+8YLxvDcuBHerdTfW3dkQfstqY7NrT3 POdMYFk2MG8yif87CwSRLfT66YY3LqVOCrCljCt5JbIzJ0JwO0zQqPpECngUnXv8l5EW PCqKrtC/muGJ4gm1S1RDnOtoGt0ZX/V8m0ZSQDT0o5JNuTbySktX6w9ofyI70KphDBAc ci0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=e+e23JwjEfCm8MpsrTNFNCaa+ge8lxGMTn4GJlwA/xA=; b=uCfgqEqaiNI+hI+btqyqDmv/uM/biU8AxUMM0kVBMuguqBRAZ/0RYwq0Do3t9dR8Yi KkMNS3PU4YG4IE/mT7iGt2TVHTY9CiRyk2ixZp91rl6uGsiyv/37eew/liHkt5xnl4uq kMYgIyC2dd0UquHvgA6odfHb930kJQAcyn7w3ot9BvEAcucc6D9QrhHXwA4BZy7lHIR1 FgMjSnngDoRcRDAcQ0CvsKDGhPzRX74EEtaxL7y8cnoLz/nk0pn7SUqrIq9aRwCfmZ0S IaZNkFWt8bd9sSJDHgwwB0H/kAmAhOXJ42tWLs4YuTlUMRG+hXRjodvHyVMFrIEdOys2 OOuw== X-Gm-Message-State: AOAM530QDbZlUd/8IlLCdLhR9TzATZvWFH6D2g0Sx1cTQuXPHf+GNxBH WnOzsKMDAsF3HFfWYCFIG4k= X-Google-Smtp-Source: ABdhPJxbdTTvQVpnyxuDL3vYZpyvqLIO9Xo+/cAa5ZkqXx9P6oMvyAD2tqXfo36uBoFXQKluDq8FKw== X-Received: by 2002:ac2:5314:: with SMTP id c20mr1294819lfh.75.1590660295588; Thu, 28 May 2020 03:04:55 -0700 (PDT) Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id 28sm1349786ljw.15.2020.05.28.03.04.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2020 03:04:54 -0700 (PDT) Date: Thu, 28 May 2020 13:04:54 +0300 From: Dmitry Kozlyuk To: Thomas Monjalon Cc: dev@dpdk.org, Dmitry Malloy , Narcisa Ana Maria Vasile , Fady Bader , Tal Shnaiderman , Anatoly Burakov , Bruce Richardson , david.marchand@redhat.com Message-ID: <20200528130454.2adf1476@sovereign> In-Reply-To: <93568913.luAXIRNmGZ@thomas> References: <20200428235015.2820677-1-dmitry.kozliuk@gmail.com> <20200525003720.6410-1-dmitry.kozliuk@gmail.com> <20200525003720.6410-5-dmitry.kozliuk@gmail.com> <93568913.luAXIRNmGZ@thomas> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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" On Thu, 28 May 2020 09:31:54 +0200 Thomas Monjalon wrote: > 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; =20 > [...] > > + addr =3D RTE_PTR_ADD(addr, page_sz); =20 >=20 > This is an error in 32-bit compilation: >=20 > 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-= cast] > 215 | #define RTE_PTR_ADD(ptr, x) ((void*)((uintptr_t)(ptr) + (x))) > | ^ >=20 > The original code was doing a cast to size_t. >=20 > > --- 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); =20 >=20 > I believe the correct cast should be uintptr_t. > Maybe it would be even more correct to do this cast inside RTE_PTR_ADD? Ack, this is the issue I mentioned in the Community Call letter. I think size_t is a more suitable type for page_*sz* than uintptr_t. --=20 Dmitry Kozlyuk