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 82B6EA0563; Wed, 15 Apr 2020 11:35:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5EE321D63F; Wed, 15 Apr 2020 11:35:07 +0200 (CEST) Received: from mail-il1-f194.google.com (mail-il1-f194.google.com [209.85.166.194]) by dpdk.org (Postfix) with ESMTP id 96EBB1C1A4 for ; Wed, 15 Apr 2020 11:35:05 +0200 (CEST) Received: by mail-il1-f194.google.com with SMTP id t4so1283013ilp.1 for ; Wed, 15 Apr 2020 02:35:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2SuP2Jk6fkTDov4aoBHOnF6N6Hd6LFxURRzC/BZCmyY=; b=T9yYns/K/OKYeSh9rxKS8S8fbFHtOn2kmcBDLYiPfZlibcw/J/SDckMg8vHUzfi0tb Yv4y2B3SjQgcXTfH6pJOVcuZ+PCJV8J315vFitEWXNYbZmVUoY5HIqVvp2qomNhx3hws GIUR/Kt57If6/p6s7h4M4lPejoNeVOT+fgMkhx/U/2j3pqiEV5fn3Uexe9Ujp5Aniwba RMU7J/ih41/71sSDO7MoJFaDfbYgFNk6CEGlcsjOAb9MAJ0qSCY9yoRhMiPY8Yg/FCiz pxwpXUgrFlI9ItflJ8asEnmOat7yE8TeDcYBi4NxqBtmZwkhVdfjAffVddQuEviRAF+D sUtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2SuP2Jk6fkTDov4aoBHOnF6N6Hd6LFxURRzC/BZCmyY=; b=BYxEcsfxx8fNui+C7gjkcfn8TigKUV/LiCdegUify2LxaNwZq0mOR/oraCAYyBjLeS mhhkFPq6JOTLdJpjJaPPgRVfTkByGOJK8/qtQs48yZZ5G+9oN+FZSwttK64MMOWeey1J TFUOty/kBNResBghOtLAN8XN0hSMmn3Bm1eVbm+6mhKqqFUn1+V4XFGUiKuTqBp9mjaC qrlwyrY9eFOs4PGZu8C2BBH77e6nOKCz3kmamRNtGaHU2mT2LKpc1crBATzwiM7GxCt3 v9j3rtSXl8EEbAXat9RT27pBjM/3g7Mf8RVWLE8IV5Ll2orscbHdBDlKgvWZ0BKxlvnf CMnw== X-Gm-Message-State: AGi0PuYNuCRORpZoaE+DQ34l36GTBK/uSjPONXlMO6vlyXFDQ/rNu3Bg RzyJuVYsYf8tS0xBtzULA+5J8QqUNA2mIWyfrdc= X-Google-Smtp-Source: APiQypLdEMW0JBvYw+8OdNubPj/jCQlH6HglXUoaY/TGXYlJwYZVcS205HSx3P4hNX16O3X0A7D2zcJRvr/tqkEVLxg= X-Received: by 2002:a05:6e02:790:: with SMTP id q16mr388762ils.60.1586943304840; Wed, 15 Apr 2020 02:35:04 -0700 (PDT) MIME-Version: 1.0 References: <20200410164342.1194634-1-dmitry.kozliuk@gmail.com> <20200414194426.1640704-1-dmitry.kozliuk@gmail.com> <20200414194426.1640704-9-dmitry.kozliuk@gmail.com> In-Reply-To: <20200414194426.1640704-9-dmitry.kozliuk@gmail.com> From: Jerin Jacob Date: Wed, 15 Apr 2020 15:04:48 +0530 Message-ID: To: Dmitry Kozlyuk Cc: dpdk-dev , "Dmitry Malloy (MESHCHANINOV)" , Narcisa Ana Maria Vasile , Fady Bader , Tal Shnaiderman , Anatoly Burakov Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v3 08/10] eal/windows: fix rte_page_sizes with Clang on Windows 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 Wed, Apr 15, 2020 at 1:16 AM Dmitry Kozlyuk wrote: > > Clang on Windows follows MS ABI where enum values are limited to 2^31-1. > Enum rte_page_size has members valued above this limit, which get > wrapped to zero, resulting in compilation error (duplicate values in > enum). Using MS ABI is mandatory for Windows EAL to call Win32 APIs. > > Define these values outside of the enum for Clang on Windows only. > This does not affect runtime, because Windows doesn't run on machines > with 4GiB and 16GiB hugepages. > > Signed-off-by: Dmitry Kozlyuk > --- > lib/librte_eal/include/rte_memory.h | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/lib/librte_eal/include/rte_memory.h b/lib/librte_eal/include/rte_memory.h > index 1b7c3e5df..3ec673f51 100644 > --- a/lib/librte_eal/include/rte_memory.h > +++ b/lib/librte_eal/include/rte_memory.h > @@ -34,8 +34,14 @@ enum rte_page_sizes { > RTE_PGSIZE_256M = 1ULL << 28, > RTE_PGSIZE_512M = 1ULL << 29, > RTE_PGSIZE_1G = 1ULL << 30, > +/* Work around Clang on Windows being limited to 32-bit underlying type. */ It does look like "enum rte_page_sizes" NOT used as enum anywhere. [master][dpdk.org] $ grep -ri "enum rte_page_sizes" lib/ lib/librte_eal/include/rte_memory.h:enum rte_page_sizes { Why not remove this workaround and define all items as #define to avoid below ifdef clutter. > +#if !defined(RTE_CC_CLANG) || !defined(RTE_EXEC_ENV_WINDOWS) See above. > RTE_PGSIZE_4G = 1ULL << 32, > RTE_PGSIZE_16G = 1ULL << 34, > +#else > +#define RTE_PGSIZE_4G (1ULL << 32) > +#define RTE_PGSIZE_16G (1ULL << 34) > +#endif > }; > > #define SOCKET_ID_ANY -1 /**< Any NUMA socket. */ > -- > 2.25.1 >