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 50033A0563; Wed, 15 Apr 2020 12:32:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 28F0D1D60E; Wed, 15 Apr 2020 12:32:30 +0200 (CEST) Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) by dpdk.org (Postfix) with ESMTP id 72DBB1BF9E for ; Wed, 15 Apr 2020 12:32:28 +0200 (CEST) Received: by mail-lf1-f67.google.com with SMTP id x23so2242684lfq.1 for ; Wed, 15 Apr 2020 03:32:28 -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=gCEoBCqFpYrvz+K15auYGsi8NYfQz/m+J2g/zTyhykA=; b=XZ0fEbSrFzyNi9EQir7dCN4umZqE5tf+lqH7nMWT2rCd5C8hBpjQd4Em4KpNac1nnx J9YBcXfOeMyrajiEJQG5SjHVc6CyBKp72m8B4oBtFjqXAL05rX5h4CuYeNumCXtx8iMc oZPxkk8ks7Xt3IceYD1WZDyPRb6iyktj6iC1dOUPeoJ54uyAcf+R1MsTHNxAhk0BvEPA gsHkUNuYsRWUqZT2xOXA6xGvf55S4WWjPKttmyg1tGYEeuY8Qd65cpzGD5KIr83SIeb+ MNkcPk8qms3KzB7EEDwzhACHfZl5/lk01RVQRH6XQREyMb0r/coG6suyJ5XuREwDNom+ TJmg== 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=gCEoBCqFpYrvz+K15auYGsi8NYfQz/m+J2g/zTyhykA=; b=IpW5zdiFntP+nZTnKyMOZugrsKF1zvwmts0NdMW+rgTIBVQskLjki0WjpWEml1gbN/ 1w5+DnSepLTvmb9CkmH+NgsF2DHMxDtgO5tp64A7EBkMqgRLtKwUpdLV/KFEd284gK2C LHL4+MkangkTXwBLCG3+z0MfWBuRLt/M39u1qWFh6u4fsYVLlPjqEKaxPCGukBKAkMsv Bzho9OvBo3jUTDyoZTuoBcREoBaN7cd7zQd+7/uRsIoAoOHeh3cvaYipRrllRGbhGjr+ t0yVZdXOGVXT+grR1PmHNNSnJV5Zis7Qtsyss0nJqg324bEEUfYdku6RetzIrh4GWbJ6 GMaQ== X-Gm-Message-State: AGi0PuY8cQ9Lhzg3sFZnIRKZaC+tlIRucgbuCAunD125EbrRqoTMgGKA RAwmoEC4d9D68tBJQJUpENY= X-Google-Smtp-Source: APiQypIhdphKQKCkntTyD9u/I0QOoUHoPLWyqsWFwPz4X+Xv7AnQ+bcEj72u9DrAnJUDH4Vc6dlEDQ== X-Received: by 2002:a05:6512:685:: with SMTP id t5mr2606639lfe.47.1586946747915; Wed, 15 Apr 2020 03:32:27 -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 z65sm12527769lfa.37.2020.04.15.03.32.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Apr 2020 03:32:27 -0700 (PDT) Date: Wed, 15 Apr 2020 13:32:26 +0300 From: Dmitry Kozlyuk To: Jerin Jacob Cc: dpdk-dev , "Dmitry Malloy (MESHCHANINOV)" , Narcisa Ana Maria Vasile , Fady Bader , Tal Shnaiderman , Anatoly Burakov Message-ID: <20200415133226.180cffb9@Sovereign> In-Reply-To: References: <20200410164342.1194634-1-dmitry.kozliuk@gmail.com> <20200414194426.1640704-1-dmitry.kozliuk@gmail.com> <20200414194426.1640704-9-dmitry.kozliuk@gmail.com> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 > > 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). -- Dmitry Kozlyuk