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 65B0CA0563; Wed, 15 Apr 2020 13:17:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 45DD41D6D2; Wed, 15 Apr 2020 13:17:59 +0200 (CEST) Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by dpdk.org (Postfix) with ESMTP id 85EB61D6C8 for ; Wed, 15 Apr 2020 13:17:57 +0200 (CEST) Received: by mail-io1-f67.google.com with SMTP id y17so16643062iow.9 for ; Wed, 15 Apr 2020 04:17:57 -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=f5dCMheivFCtX8x+aqGALo9D4H7j/Krkjy1otWp4kfA=; b=sSUslLmtsGh+R6P5UKhcVK75LVRrrxRihJeSXjrwSvsd8BYHPw02g5xjCJl7iVVl79 AnjblQsFHYwuBo+Ktwd2PtyT2M3GaOH9jtkFphk77nRMoYRbaKdP6KGQdnHdRqbum6oc QnEJFRz0VZiT2XsySOJEvOfX2+Uv3vI3EOqfINVanILUR9q7ZDA+7LyDU3vzvTD0/Fgh GL1F3qVa8cP202qqQOhLZ97HgfGWADYtIs4dMK48HxGJ1f5n4B/Cda0ex+QxM2Bk8V+7 32Qv0VkAEbwLjxiPmpoJCxD90Em5vJDz4eqyB1JOGzfwuppFuxw0ejr+k5qahZZr0792 J+OQ== 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=f5dCMheivFCtX8x+aqGALo9D4H7j/Krkjy1otWp4kfA=; b=PO7v78Ob/UodUseN9WDoJK99cpkBIQDlL1oLWwiOquT7BT0d1gS1KYFdde9D2yNkuP S/dK6X94Hn9LIyXgtnbDzrNaO1L3qlMmQqIr/PDxCkIOiYH2PwcWPz2n6awWcO8GGH0K 3hHGx4EnjAyuiF9AN3pVCqqT1AwSs6XGeZIRa/EazCopeeWkcMICqZZbEj9BYqO87z9o RhvA+Du/xj0w2ziG75UZjBhtSdU0y134DjSyYC3MkYMIPZjZgI7Q6bf3FpFK9fKcMBWx RLA88EtV6fKc5ijPyb/mlCoAAHBtk8tfWVymx5zk2aDMssjOzQaoUj4+bEGNmwaNR2Y1 6/6w== X-Gm-Message-State: AGi0PuahQ7SB8HX8tmjC9Pu67F6fScsAYoxhNWYB5xyDMTtci4bngH0T n4btO9ZJhgFawDjpPl3cKFPZP8cGiFPESmvAaa0= X-Google-Smtp-Source: APiQypKmt0R9AeI4LVn+ExtL8BJB64IauLwexkXdOgbHBGzH5yhg9pC/Xznwp+b3w27gKbLMxoMuN9j7ZlKp9V9GLAI= X-Received: by 2002:a5e:9806:: with SMTP id s6mr38064ioj.59.1586949476888; Wed, 15 Apr 2020 04:17:56 -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> <20200415133226.180cffb9@Sovereign> <20200415140930.51ba810c@Sovereign> In-Reply-To: <20200415140930.51ba810c@Sovereign> From: Jerin Jacob Date: Wed, 15 Apr 2020 16:47:40 +0530 Message-ID: To: Dmitry Kozlyuk Cc: dpdk-dev , "Dmitry Malloy (MESHCHANINOV)" , Narcisa Ana Maria Vasile , Fady Bader , Tal Shnaiderman , Anatoly Burakov , Ray Kinsella 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 4:39 PM Dmitry Kozlyuk wrote: > > > > > On Wed, Apr 15, 2020 at 4:02 PM Dmitry Kozlyuk wrote: > > > > > > > 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 > > > > > > > > > > > This is a public header and removing enum rte_page_sizes will break API. > > > Moving members out of enum while keeping enum itself might break compilation > > > because of integer constants being converted to enum (with -Werror). > > > > If none of the public API is using this enum then I think, we may not > > need to make this enum as public. > > Agreed. > > > Since it has ULL, I believe both cases(enum or define), it will be > > treated as unsigned long long. ie. NO ABI breakage. > > I was talking about API only (compile-time compatibility). Getting rid of > #ifdef and workarounds sounds right, we'll just need a notice in release > notes. Good to check ./devtools/check-abi.sh for any ABI breakage. > > -- > Dmitry Kozlyuk