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 9483CA0577; Tue, 14 Apr 2020 21:46:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3DE931D429; Tue, 14 Apr 2020 21:44:59 +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 6CBEE1D429 for ; Tue, 14 Apr 2020 21:44:51 +0200 (CEST) Received: by mail-lf1-f66.google.com with SMTP id j14so726934lfg.9 for ; Tue, 14 Apr 2020 12:44:51 -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=p7hruKcFxLUSWAR29/W679JJ4VzTW/lsc269VWX384ZPTSlkWB9uYBP4BoyhewpTE5 3bAOGKdGvtMivxbsJ8oQH6VRFBg2lr29ZHsuuY0N+cEzMxgQRoLPLd3cJAy2NDdCbUkF 90zk6WmSo9tIz9WAV6kodaVuiW06gzN8/A/90dggyUqnyJ8/TxLhNmMKfpX9MOIFM1qc ErDgVI97QfUoEkl5Y+PPpKFIVGarYP1eCO4y7AZJYozpDqw+KGd4rvf0oMRcKbXS4Pn/ +F5swgIHThHktRk5xBFTlkM74j1uiUW1+xBc84JlVEWc5Ld5gtdMbRTVHxlASiXx58kR wEKw== 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=HTl+xXyF5OEUe3jHjdhFwYHD+IAVgM50OsFwW1ikzxvxLtRZn8vwPIU09dXURf/qNC DS2d6fXX554DcH0OdkcHid10lkHA8BwkbsVB752nImpateM+b5NcgY+Z7XeHbh5oBRCO Qoxyqs/sMk73Io5TgEexMeKsK/rNbpQWF0A2+7zwwvwlE1i8rhOjYpe76ftNoo0gf8cE +qlyUnhK/nZXYvTG/8+I7nPx4YpqsEgLX8Y9Qn+e02b3StLP205IuwvORcb9AFiMukuD ZG54RQVHvHlEgdnNCAkqXkXOCSaIaNx4Cgc3BkaqkpUxU4nw6ykaPuX37hEUnnBASXSA k3Hw== X-Gm-Message-State: AGi0PuZWaj6gE2Z+Og+ZFcRqwe8QbDPVBOvgQS3WD3asllpwZOOwbDR0 8zVAHQ+62B0XyB/HAiaaWRXKi4P9FP4LCA== X-Google-Smtp-Source: APiQypKKUruN4UpNtUDxC94m3izwkEdFL6NsZAlI9bGmIoXWIFpRHay2w2+PxXwZLQZmRiny8UiL2g== X-Received: by 2002:a19:5e46:: with SMTP id z6mr769100lfi.74.1586893490748; Tue, 14 Apr 2020 12:44:50 -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 h14sm11272426lfm.60.2020.04.14.12.44.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2020 12:44:50 -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: Tue, 14 Apr 2020 22:44:23 +0300 Message-Id: <20200414194426.1640704-9-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200414194426.1640704-1-dmitry.kozliuk@gmail.com> References: <20200410164342.1194634-1-dmitry.kozliuk@gmail.com> <20200414194426.1640704-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [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" 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