From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 882034332D; Tue, 14 Nov 2023 18:06:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D61AE402D4; Tue, 14 Nov 2023 18:06:10 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by mails.dpdk.org (Postfix) with ESMTP id 6890840279; Tue, 14 Nov 2023 18:06:09 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HxqCMbaLrJ/SFXNqmNEzOcB8+RrtZZosJat3sEF+XUydLpmqqxK+MkaW8ioD8M5ZDBbOeBmqc05VkWjkB3z34MAjV1KjBo5rioSjqpFjxbvj/4C10BwMqzugagfn2ySQYdAanj7NGkG3ArjI+972DM2wH4yL73fgPSkIX+GqumPIyNdQsDGEWKiNs+29jlpHNOViv2csk9An8vIGUjJ7A2w2vDIaw+bJZNX78ZJusSqY2NBSMbMDH6JQvm2SiVnVGrL9eMzps83QiD+EqEPMSmlccVdek5lVJ4N3lD8i4xAaEqXbPz8xW7aGIgHUnkMA32B5LCFXtmW2rf0qreVUTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8UBlJL+kArzSxMghBaD3+92qRf9lyGtVAF11soxq3RY=; b=WjlZf4FfF2LwAuRFzUKA2sVcIU7miU2hv1ELl8gB9vkGYPAZwEvPeTsakcK739RgmKDBZ2kP7aPjDrxGLaEdT7eWyvbODcAKAFg09wAX10wZ1hwpvvSBXb3h3Nd+cdfYftCp1kQ2TEUKjVqb4g44ZcNBuNhWT21TK9U5b9Umq/0i4K+1B7GAJJzGWzAk3Ey1JyAMOqU1PEeMZkbiEgwDQ4an51OeEanNZafarpK3FH56muVfV45NqTycJuNDpDVhZcuv/c/thmspBaWEe+vM4U3TzKVIv+XJmvWvY7FajnwhsfwiBRWSfb7PGLUR3CxmP/oZYVNaCTDgEhlJVG+tZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8UBlJL+kArzSxMghBaD3+92qRf9lyGtVAF11soxq3RY=; b=lPtuurEnbiBSOmdIvJMh2MYP9mDuwqW/pa7b9qc2Ohp9OBUiONR8FYd57ReReHRRWNbCAXgALN/wazc5wGRMgXU+xdkpRPZH/Wd43bgwEK+feYoesrrnI6cw2ceH+Zjd30SdFXCu531+kvMxY99ETgI/soVo+qRox1bfCDaLE2btil4N98dpY0KFJoXGeIqADM0qhFrTcqjYZPfYosfYeNKYAm2XWKEKZ+YK1qHJ3ZnElxYrrT0lgcx/4LYtftxhuHxNhxhyEBbwerFNnu+rbgqbi5LrqUe7IPhmqyySmuqJPphffM75oONtssLmfxU0lAY3NGNok/XUYal9KhS8Tg== Received: from BLAP220CA0013.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::18) by CY8PR12MB8361.namprd12.prod.outlook.com (2603:10b6:930:7b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.31; Tue, 14 Nov 2023 17:06:06 +0000 Received: from BL6PEPF0001AB4B.namprd04.prod.outlook.com (2603:10b6:208:32c:cafe::1d) by BLAP220CA0013.outlook.office365.com (2603:10b6:208:32c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.31 via Frontend Transport; Tue, 14 Nov 2023 17:06:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BL6PEPF0001AB4B.mail.protection.outlook.com (10.167.242.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.13 via Frontend Transport; Tue, 14 Nov 2023 17:06:06 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 14 Nov 2023 09:05:46 -0800 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 14 Nov 2023 09:05:43 -0800 From: Gregory Etelson To: CC: , , , , Dmitry Kozlyuk , "Narcisa Ana Maria Vasile" , Dmitry Malloy , Pallavi Kadam Subject: [PATCH] eal/windows: fix memory management macros usage Date: Tue, 14 Nov 2023 19:05:29 +0200 Message-ID: <20231114170529.176665-1-getelson@nvidia.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB4B:EE_|CY8PR12MB8361:EE_ X-MS-Office365-Filtering-Correlation-Id: bd609c9c-7238-4642-31cb-08dbe533fd86 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Gr8Fa+MoUrK0Y1kvAX3/Mut5rowzEqefyTiAOJcTJvw3tTP+eUWOgcNp8x97BgR1S3IT0s2ZJGqV10hxwHxgv2SkoZAdXd1KUk0L7TtPBSH+hqTl1RxuTDcKzQpwbFzG6AUPOWwxl6+7G1W+rF7Dm8ntNCwdh3FCGqAP+w7UMFZZwO/KwxbBL3UaIJw1V69NsAqBZBXIH2bqTzeCoO32+1NDtG21xomnp+v16CldbtooqrKqt7CYnZyEsaOWw2h1vd7qT/5HFHVfITcQxdqqD4ExGaZ5OHtWdZ/oNv3rkfVixjZw1c6CoLSlV81TjkMNJFrLZFhtDKuCoL0muXc6i4id7qsfA0ygGi7MPitEt0AfLHtZWETL8Ievu6xO2HWBpEe2za46DSjH3AgEaPza4+L0pify3DWMGQX61iu6mbdCNPH/UjxoLaAzoQtFHD8AFEvmb0M2SdIxZzQpGquIOW+DqVInm2eSSYLLWpS7nxnCc//AVRBBihKTJ6n+cKn2vBYp9UafG0VR9Zf7fvTnVae7xAxblk6f7geNvy6Gkg4s4BE77Xf70J7FHZnWh8fHUvwhpMzm0H58ano/6q/SxaywPau461H6UdtObYFMb9OK/3YteveiRIB5m1AE7DmWY/rP5tHFns5ibCmIPUZysL99zNE5j1owLH6lv6wPoO3mcOz+Gb4Y+1afnly7dSs/R2UjRF7JmRbvKgle9DckEsLhlD27RPPQRe+NziG1dnJDj4iflhpfSGNxhO/OubLP X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(396003)(136003)(346002)(39860400002)(376002)(230922051799003)(64100799003)(451199024)(82310400011)(186009)(1800799009)(46966006)(40470700004)(36840700001)(8936002)(8676002)(55016003)(40480700001)(40460700003)(54906003)(2906002)(5660300002)(4326008)(426003)(7636003)(478600001)(356005)(6916009)(82740400003)(70206006)(86362001)(36756003)(316002)(36860700001)(41300700001)(7696005)(6666004)(47076005)(336012)(70586007)(2616005)(6286002)(16526019)(1076003)(26005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2023 17:06:06.0392 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bd609c9c-7238-4642-31cb-08dbe533fd86 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB4B.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB8361 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Windows compilation with cross-mingw on Fedora 39 failed because MEM_REPLACE_PLACEHOLDER and MEM_RESERVE_PLACEHOLDER were already defined in the compiler environment: eal_memory.c:77: error: "MEM_REPLACE_PLACEHOLDER" redefined /usr/x86_64-w64-mingw32/sys-root/mingw/include/winnt.h:5710: note: this is the location of the previous definition eal_memory.c:78: error: "MEM_RESERVE_PLACEHOLDER" redefined /usr/x86_64-w64-mingw32/sys-root/mingw/include/winnt.h:5715: note: this is the location of the previous definition The patch masks MEM_REPLACE_PLACEHOLDER and MEM_RESERVE_PLACEHOLDER macros if they were pre-defined by compiler. The patch also masks MEM_COALESCE_PLACEHOLDERS and MEM_PRESERVE_PLACEHOLDER to prevent similar errors. Fixes: 2a5d547a4a9b ("eal/windows: implement basic memory management") Cc: stable@dpdk.org Signed-off-by: Gregory Etelson --- lib/eal/windows/eal_memory.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/eal/windows/eal_memory.c b/lib/eal/windows/eal_memory.c index 215d768e2c..31410a41fd 100644 --- a/lib/eal/windows/eal_memory.c +++ b/lib/eal/windows/eal_memory.c @@ -72,10 +72,18 @@ static VirtualAlloc2_type VirtualAlloc2_ptr; #ifdef RTE_TOOLCHAIN_GCC +#ifndef MEM_COALESCE_PLACEHOLDERS #define MEM_COALESCE_PLACEHOLDERS 0x00000001 +#endif +#ifndef MEM_PRESERVE_PLACEHOLDER #define MEM_PRESERVE_PLACEHOLDER 0x00000002 +#endif +#ifndef MEM_REPLACE_PLACEHOLDER #define MEM_REPLACE_PLACEHOLDER 0x00004000 +#endif +#ifndef MEM_RESERVE_PLACEHOLDER #define MEM_RESERVE_PLACEHOLDER 0x00040000 +#endif int eal_mem_win32api_init(void) -- 2.39.2