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 31284A0598; Fri, 10 Apr 2020 18:45:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 59B541D642; Fri, 10 Apr 2020 18:44:07 +0200 (CEST) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by dpdk.org (Postfix) with ESMTP id 3232A1D629 for ; Fri, 10 Apr 2020 18:44:03 +0200 (CEST) Received: by mail-lj1-f193.google.com with SMTP id r7so2474396ljg.13 for ; Fri, 10 Apr 2020 09:44:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Iork4+fw+umgfjcoLg8piSqfkvrIXDOmesUDuo40mjk=; b=unZxZXfcuIKnaRBSj3vqFBqFfEL/qJk2pkXrRDkbcSE816in97PJBSAlYnxGrJ/saG N/HitsyCdu04atvRH0vj7oI4uEiBUmk8mnVE7cT7QB3nCP60O2COUaIrCipnym3Js0IZ uHDwvfWWj6KZsZ5/pmKCjAz1OA5sLMi1ZSPa6sXCTVYbaIAUd1pGkKitXpnk8y9H6mrq bjEvrZnuSZDTkzeSSCD065VW3w6au0l5mtrP/9ffQOKNdl90D6F8rGGMlXeHUDJbTSln TCFlaca66WeyNkmPH3I+HSUV3KVBQ4LrO4OVYsMIgKlFd3wdqoEUsCwn4d7ChJqrO8Id HMZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Iork4+fw+umgfjcoLg8piSqfkvrIXDOmesUDuo40mjk=; b=F1OLX+Wpgig/y4s2gmwqgE+r0kmWSHCEhO53X4+AEQjAD7fQftAR06r9BggGhH1Q28 x58kUmcUSpr3woeLc3Czy+faIaV4rN/lCDK08fcGbB4lNU7yVsAchSctu2rZW/J6Bepr sJRDwEha7AN1vIkHWC8wNOJ5ID1QneTbs7i0H+k16i9RFm3aIX9PSiukUAU45GuR91MT XZbiVf/aZXiLjYCNr6YhUq+vS96gdSSt4AJtKn1RkDEKZKjyn3yL7nFYw2pob78upj9R XEvSPPPwRhUp5L2xmHeWRB6ilWIpWj+v+Pul0dPgW9Du8PfiK6/K/9LMu/C24/gU6NmK 23CA== X-Gm-Message-State: AGi0PuZgdkadSjNMty7WWO1fqOQDzhEBOQtGFZEbLxAxURGjpFTldM4u vw03VoYpefHx06BxuGM69YQmvKih8H/iSQ== X-Google-Smtp-Source: APiQypLJd4e+/ChFH/Xoe4vV8Y9Zw8MluhamZYWz7HwxOtAojornVOP5DrgSSKifV+gBSKJXKYlEMA== X-Received: by 2002:a2e:9b07:: with SMTP id u7mr3455899lji.110.1586537042529; Fri, 10 Apr 2020 09:44:02 -0700 (PDT) Received: from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.googlemail.com with ESMTPSA id d21sm1343075ljc.49.2020.04.10.09.44.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Apr 2020 09:44:01 -0700 (PDT) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: "Dmitry Malloy (MESHCHANINOV)" , Narcisa Ana Maria Vasile , Fady Bader , Tal Shnaiderman , Dmitry Kozlyuk , Anatoly Burakov Date: Fri, 10 Apr 2020 19:43:40 +0300 Message-Id: <20200410164342.1194634-9-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200410164342.1194634-1-dmitry.kozliuk@gmail.com> References: <20200330041026.784624-1-dmitry.kozliuk@gmail.com> <20200410164342.1194634-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 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" 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. */ +#if !defined(RTE_CC_CLANG) || !defined(RTE_EXEC_ENV_WINDOWS) 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