From patchwork Tue Sep 3 13:35:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13788719 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2055.outbound.protection.outlook.com [40.107.223.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 607093C24 for ; Tue, 3 Sep 2024 13:37:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725370623; cv=fail; b=JdGslOb9ZseXhlxftSKJYWTii9RnUPY6GdTl8r1PzBvZaactJvYkO9XfTd0CR5QURRYZE9rzij3xUfLnb66FTFFsHexheB7ZJNzKebfriSbyxbkwCS3/ra4gcICKN57qgbFuv8y6dHoXBYjjW76VyfYUCigMe5CCAYZDuFIWy2Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725370623; c=relaxed/simple; bh=M1Cr+fyNIiaV65UZwaMz1YRPqmPeyZF81WEXfLZ91Sc=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=b2B+LULslMb1MVVI3Cp3BkkGwjkTZ2Yoh9dOZS+lzQH94iNcdY7Ky0ofnfihOMOB6MT7OC17Hpcyq3qjCyfJlGbZnHVWjdKMu2+eWEsuUOQkVAMfuOIyehOrqKgBLpb9Sli+VnM7xq3QhOyAKSPBs3KpN4Zcn+gAK4BDu1/AglU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=TNOyaBtv; arc=fail smtp.client-ip=40.107.223.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="TNOyaBtv" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tqd8BX/ZnpCIERBfBe3qZoFXyXfAGKodqCUOVinoO38pHh1ZPIxmAqyUbc5v+hESiaMfpBwnvgG/SZzwAa85bx8mPj31JdRvwsIXwOeOXMl4IOhmxwMVhSXHVJf6BfCmZMc4sbPk4DoEJ49A38SEGtLvWK89v8pgiqVEch/dBf7FGuZ+2Rgr/PgKNBcnW9v/Y7qhK6CXHxSqSowlUAi4Wubgraf8DKF/25ehV31KYvHadhnqEsqKbrpUfXKUk6p9W5Si2kwQcLmkpZx0EMtxf/VYi473E+zgWWZ798kb/jsMPv551gtYausQgYXbBmx2KGwGBuSqDetRRsvaV9PLVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=NNp3RHxFosTJQjV6Bty5lrOjulngh5hXyQ7lv07ajZo=; b=rb6YD1H0cURlj3XZb02gQwXotubNx1F0MNsl4V4OGxXNVg78vC5y82ReRJR5iBUgdgz3L/B65nEwKpphG8o3xjGB5+4WFVKbd0/kdPsY7101jAdMmreTbBcp61nH6PQRSdXmov2v3M4wz1Da7XLVIwlFQweEXB22HGiJkW1Gd7RaTWGkhov027zMdvXpgfztqErkqVYE5AI2EM9lOQSWOYzv6Rl3s1sq0G24PsEB88SLXNZ7ZSoleSPb2TYhMqyeQG2GQ/2Zjmnp0jMokK/7ja194hyGGZJEKl7Ix9yjpAjsIL5LNp3gxfRLcuuc98987nHY695AP84nZqzozenz4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=vger.kernel.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=NNp3RHxFosTJQjV6Bty5lrOjulngh5hXyQ7lv07ajZo=; b=TNOyaBtvXDT65q3QrD7kL5Pbn/BsvNgQWpCSfy5YnJWGJzuCI3zieidb1rcjNYYfrcTl/t4dG+M4VmvdQv1FGNWJ8TK0udoWuo38mFKlXB2TVCDS/bO+lBM9daQI3Yl70zwYgVIDx/NIPK83TzUAVW0108hhxT+fWRlcoQ9Ka8l6+GLC849cZ/LX23jJzVeALbfycOATLkcb3QQzhjV+ZTC7/z7pGQ9IZ4PSqbkmv26kEhw2FN/8ZB3TMDjRw/yzC3y1B1MJmAHge+j9A/0JWaPPMBx0fuCpbCSxsHMP3ZA0uhdKFU6MgKSIL7UiT6oe1Bt2uvT7GULIZo+V+PsANg== Received: from BN9PR03CA0053.namprd03.prod.outlook.com (2603:10b6:408:fb::28) by SN7PR12MB6672.namprd12.prod.outlook.com (2603:10b6:806:26c::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.27; Tue, 3 Sep 2024 13:36:56 +0000 Received: from BL6PEPF0001AB58.namprd02.prod.outlook.com (2603:10b6:408:fb:cafe::22) by BN9PR03CA0053.outlook.office365.com (2603:10b6:408:fb::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.27 via Frontend Transport; Tue, 3 Sep 2024 13:36:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL6PEPF0001AB58.mail.protection.outlook.com (10.167.241.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Tue, 3 Sep 2024 13:36:56 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 3 Sep 2024 06:36:39 -0700 Received: from shredder.lan (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.1544.4; Tue, 3 Sep 2024 06:36:35 -0700 From: Ido Schimmel To: CC: , , , , , , "Ido Schimmel" Subject: [PATCH net-next] ipv4: Fix user space build failure due to header change Date: Tue, 3 Sep 2024 16:35:54 +0300 Message-ID: <20240903133554.2807343-1-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB58:EE_|SN7PR12MB6672:EE_ X-MS-Office365-Filtering-Correlation-Id: 80d48c9d-901f-4c64-355d-08dccc1d7ab8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?q?1ecG3EeE0427ZYmQjcFFd0ZWgEXPp4A?= =?utf-8?q?5PFG0zK+oLkr/lnJSdRR51X0MUusx7YRsO/k1FfRAEHyKAi2Bd044a1vgIKThucBw?= =?utf-8?q?rcXz1EJV25DyoNn1rHJhXPTwa5vRu6oCiwq08RR+n646/PZvl7nU/2YRBOccsHIW1?= =?utf-8?q?O41Adi6HQ0e8eAaUPLrgeYQq71BAWfk1hjUZbAoJdrSHbbrPDYkPbMOs1hGS9RTf2?= =?utf-8?q?9+bmPPz7CIgr1hpvq4vaG81tY/KPhJ1ROcH9X4cWEwrimd/naBiSWfT7aT10l097n?= =?utf-8?q?fu6Ry4KF2eDhXBlIprMvohDwgPxCM9F7Ea8fgUP3GOUrB+Xo0pdDV5/RsX6SJsQw+?= =?utf-8?q?MuyfF0NpsRAXNtRdJfHQuUa1lR7O0BtQoAzXuN6mL00RBKiK/7GL0XFfWsdKo/RPW?= =?utf-8?q?zZR471HIC1wx7U4p6lEqDuLvu9Ad3g4BHzCFYxhmDzT/6VqnthI1ab4pdLF5ugpaT?= =?utf-8?q?n0KQOWLo7cnL93MP/unoqZQ3PfOZkZ3kft1Mc4BENP3eM8lfQ9cHKa0pK3UKELm6N?= =?utf-8?q?5bLVY2vp30Y/HppCv1Z2z2CVdyWWP0zdk1Zvth45BJQkpP002xVXWCx954ElCzPAS?= =?utf-8?q?G2r/PuxOWAjDIE7BcIMx4EEDKJEyFj6qLcumLVrUdG4epM1abbbi/42Eegq8to9Ve?= =?utf-8?q?umfZz3WHQrt3VQf0jv5hIR0ihUrCptii581loYplhhNEYvQIyc36imidqARycIgaL?= =?utf-8?q?jsR304few9pw9ppv8AANew2kYKN1lSH/Nx1N1P3c/jg/9uxrKTXJ9unTKhX0r8sjH?= =?utf-8?q?h/C1Z0AQPAY+xI8Y7Bvxtf+Hve3MIjGpg5Nsqd6XjUHfGoU6qAtU4x4dnXPKrQtGN?= =?utf-8?q?yz+3BPjLH5tHVwyLazout2P20faf0IIFouwDqZ4zsAFo4yZ32clhCSpxtlcgBeROx?= =?utf-8?q?mLkLWdT1yqH55XLNEW62ZJnYVYg7CThVEX9peT5J4oGtgd4JmprwnbEwEl4gaTPj4?= =?utf-8?q?skArQmwjA624el/5io5ROJnF111c4qKfWyMhNpOP+gywhyN2zVSBFGpWpXgmWaCrV?= =?utf-8?q?8PHAssrXu1u1WBrs8DrnqYWD1KQsT2fW35tTZruOK5EIYnCzcn6PivTp3qS2LF3Jr?= =?utf-8?q?WFIe9VrDiCH7rtkEZZpZhJaAUhY5IQBgZZWL6NpCXXHEW6IHy5rvBHKNL0rVP9Dta?= =?utf-8?q?kpwrQh/oWt6Sk6BhshsSc0vCKHn43PUhAopwUBcvPRzoZVdUeQlo0ZE8PuoUd83DO?= =?utf-8?q?HaQrO5IZ86fx/C2CJy0SoDJ0dv9NHXr+9kK1myrbbq7+2485M4EFbHtjbHIU13cnh?= =?utf-8?q?yKF/cmgFBaXxln0LvA/M7b0miPbezc74R4wjT1kWiAcdwVy7+P8pVnvwSQVRJr/9x?= =?utf-8?q?tXEUYGZAW7qtH8ZMm+HwbiblUhqfszTdeJP/7kZ0fjTEJV2MIiFlkiDk/rEe9nCPu?= =?utf-8?q?Go1vGfnDtNk?= X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Sep 2024 13:36:56.2903 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 80d48c9d-901f-4c64-355d-08dccc1d7ab8 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.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB58.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6672 X-Patchwork-Delegate: kuba@kernel.org RT_TOS() from include/uapi/linux/in_route.h is defined using IPTOS_TOS_MASK from include/uapi/linux/ip.h. This is problematic for files such as include/net/ip_fib.h that want to use RT_TOS() as without including both header files kernel compilation fails: In file included from ./include/net/ip_fib.h:25, from ./include/net/route.h:27, from ./include/net/lwtunnel.h:9, from net/core/dst.c:24: ./include/net/ip_fib.h: In function ‘fib_dscp_masked_match’: ./include/uapi/linux/in_route.h:31:32: error: ‘IPTOS_TOS_MASK’ undeclared (first use in this function) 31 | #define RT_TOS(tos) ((tos)&IPTOS_TOS_MASK) | ^~~~~~~~~~~~~~ ./include/net/ip_fib.h:440:45: note: in expansion of macro ‘RT_TOS’ 440 | return dscp == inet_dsfield_to_dscp(RT_TOS(fl4->flowi4_tos)); Therefore, cited commit changed linux/in_route.h to include linux/ip.h. However, as reported by David, this breaks iproute2 compilation due overlapping definitions between linux/ip.h and /usr/include/netinet/ip.h: In file included from ../include/uapi/linux/in_route.h:5, from iproute.c:19: ../include/uapi/linux/ip.h:25:9: warning: "IPTOS_TOS" redefined 25 | #define IPTOS_TOS(tos) ((tos)&IPTOS_TOS_MASK) | ^~~~~~~~~ In file included from iproute.c:17: /usr/include/netinet/ip.h:222:9: note: this is the location of the previous definition 222 | #define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK) Fix by changing include/net/ip_fib.h to include linux/ip.h. Note that usage of RT_TOS() should not spread further in the kernel due to recent work in this area. Fixes: 1fa3314c14c6 ("ipv4: Centralize TOS matching") Reported-by: David Ahern Closes: https://lore.kernel.org/netdev/2f5146ff-507d-4cab-a195-b28c0c9e654e@kernel.org/ Signed-off-by: Ido Schimmel Reviewed-by: David Ahern Reviewed-by: Guillaume Nault --- include/net/ip_fib.h | 1 + include/uapi/linux/in_route.h | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index 269ec10f63e4..967e4dc555fa 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h @@ -22,6 +22,7 @@ #include #include #include +#include #include struct fib_config { diff --git a/include/uapi/linux/in_route.h b/include/uapi/linux/in_route.h index 10bdd7e7107f..0cc2c23b47f8 100644 --- a/include/uapi/linux/in_route.h +++ b/include/uapi/linux/in_route.h @@ -2,8 +2,6 @@ #ifndef _LINUX_IN_ROUTE_H #define _LINUX_IN_ROUTE_H -#include - /* IPv4 routing cache flags */ #define RTCF_DEAD RTNH_F_DEAD