From patchwork Thu Aug 29 06:54:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13782649 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2072.outbound.protection.outlook.com [40.107.96.72]) (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 851041667F6; Thu, 29 Aug 2024 06:56:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.96.72 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724914615; cv=fail; b=iYPa/CHDQUA9te8PRydPjhrhHJ1hSkDj365WDDmbfERYxX5ZWVUWT/UoMcrsfZN53z8dK3xUh56XsQ1zuwr1Ucc0E6JshcanE5li3jXVpJZBKfPTC6SL7eZ79T0yiZjrhUCCSx3WAN68PbTcR84eSb+EDKf3oY/FIqX3Q86TFio= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724914615; c=relaxed/simple; bh=/Lx8r3IqAu1wd83IbelkEc9LgSfjXipzetwdJB93++M=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TwPhnmQdBFTMgkCa71WwoPy2tZJT+AEDLaMjL0HCdoDlopWB+ntu0MMYHb2ypjPIfoWRGwtfljDCM2oquH8Gq46MxTn0L9UHf/UENu2i/G3SIB7zf5oEpPUK7pSwrbTSj25OC+N7uAByvcwpddqyfQx6fy3dMejarNpfjZVKwIY= 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=XXhhgDOY; arc=fail smtp.client-ip=40.107.96.72 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="XXhhgDOY" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RxoZE/j7+PpN2m00+v71Buv67jC8cVfyWy+ADTj/Oc4eQi6ED9lfgFddmVBozc8DBqHUnl0yXKJwJuVwC/9DpX2yhlL0OgYGJ/C+i/ns41DGME775ndH8qg9mgvpBv7aDhNK7OUF2bCH4GjlLuZr1fUjniJcHVKQpNAHWaY7NhQmqTu+wugjybfXEwi2BDIbBFeFwFEVz+tBR1HDXdbEk/2SP8yFQZ9iMnSj/ll3Dy7JcfEDf7gLagnyKtQLBHT5tlPRfO2ffgNh2S5Lg+F7ntPqsefe4WTe9MkGgSzfoRJ0kD1RlgczrziVdl1/frwp47WoD2wrToiYTS2kA0gstQ== 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=E4sjNMn/mlbn92i81LlovqYh0m7A7/JbeedEzYiwNWM=; b=I281N12d+Czr2so1sGiQ7FZ/QLpSyPqrgZwAPgvrGuzJyx71f7Cfzne1V9+U3yet7c4x66Z3ibR982DlC9QHTMHFKBgI7ovW9JZPv/213f1tcSn1xipRCkAGZJfc1l4PY8w9ZD/lhC8S/CP4jGnIaRcqXhNVSq3w5iJ5JsJCZpd9UPW9koU+wuBV9VCvATUfgl0vpiofG2/CBB310KcUyJAJ/dXdSCt0D1rZBusqKF4xHJY/TC656zrAQrcp6PiT+Vc3aGQirynwUpT8He4/ymQj6mgMr6AfTWzpOJnY+cjTNMGyFU7iVm9BquErB9cVuJyCRFgnbDnSv9ipG6asYQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=E4sjNMn/mlbn92i81LlovqYh0m7A7/JbeedEzYiwNWM=; b=XXhhgDOYwB/N/48Vl24ozbr5QC7SMlc/IuewW2yzUe7HjAWbYcrOQPItyiP6TEzEa+38fBXv1VkJlZ5jnb8HUXlOQTxYe44jK2gsbz7Kd64nQRmVPxQt9JACMMNw3WltcL7W0hn9Ool0gBWcRqTrOoL6aHBObUfeknqCpZWpM72wiN/IfaOhorIveOYzIMSkhmvs0dAyxmUGU9GfLIekUwOhLilxTH5IqQpmmFzeyH6oy//G5y2rYSi2v1lqig5oSCLzvDTf1Cg+spysX1UKlGDGFSPKVuVm0hZqfXA6HC0l2CiNfmuV9Rsv2/1NpJd3T0F5bfeWTVnPPHxjYULIwQ== Received: from MN2PR10CA0014.namprd10.prod.outlook.com (2603:10b6:208:120::27) by IA0PR12MB7722.namprd12.prod.outlook.com (2603:10b6:208:432::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.26; Thu, 29 Aug 2024 06:56:50 +0000 Received: from BL02EPF0002992B.namprd02.prod.outlook.com (2603:10b6:208:120:cafe::f1) by MN2PR10CA0014.outlook.office365.com (2603:10b6:208:120::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28 via Frontend Transport; Thu, 29 Aug 2024 06:56:50 +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 BL02EPF0002992B.mail.protection.outlook.com (10.167.249.56) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Thu, 29 Aug 2024 06:56:50 +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.1544.4; Wed, 28 Aug 2024 23:56:36 -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; Wed, 28 Aug 2024 23:56:30 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next v2 01/12] ipv4: Unmask upper DSCP bits in RTM_GETROUTE output route lookup Date: Thu, 29 Aug 2024 09:54:48 +0300 Message-ID: <20240829065459.2273106-2-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240829065459.2273106-1-idosch@nvidia.com> References: <20240829065459.2273106-1-idosch@nvidia.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: BL02EPF0002992B:EE_|IA0PR12MB7722:EE_ X-MS-Office365-Filtering-Correlation-Id: a43131cc-05ba-4d1b-adb8-08dcc7f7c1df X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|1800799024|7416014|376014; X-Microsoft-Antispam-Message-Info: 3fi8b5+lNoSWiWVtHlEkEew3OC1fQ4YytTR/8TqQm2cQwS69kPZ1MSKbNImuWxnTs9Nny31DLp2yQ+RaQR+xp3kTg7cf576ea4Yy5cRPYSBXTJD9RkrNPASYs6Djq/H2EN75NLDwo3baloBZXzTDxY9PpmbNIywzfch0aiPL5MH7o1el5wK2IczDXXe5zIDLGty5c/QGQ5j6YFzLc4MpxRlCnmPLWvBYE+KKJxcbx49tMUMKDL2jJZHiUlGHCRhfUfDvSboIbtCbgUBxoa2oN1AQ0vTkbDkhHQ96sQC5m1lODCAzs9RfqekzyvuhQhg9eJ11YepTGYUvrGHR7k9e/lMbl+yBpqJKuhJm2TF/Z/VGe8/iJRPxVS5FIwqvcG2SLK6Aw/kzuzta0k2/Q6vfVOCgYHrdKUA/FWj8rgYqQSJ/8YVlWmcwYhVWAhZASH8FOnLNdVzlP+dTRmJRR6hLCF9fdBH8RD12mU98+dNHcUQw6p602IIi8OdkIJaFMfCah8vEBzcsW1Cxnv93cB/K/rHNB5qrJZRSetizVU2aY/6UyfC1KlVH/2yo/dclJl9Lmba/4EodrP4ma8ECBfWoJvOls2gJrHv+A6UU/XCH4NCdNLYTb8GpdH4nrCun48/KJIKvrdc717KXfn9OegCfCVT9v/gKSwpNIudIfRQN0y84zuq7S7qs1Injy2o0yBk2y1nctyFOtn+JbLvD6Pgo/hfXgfhVt/joXRdw1FTJgyBku8XzofgSZwHVcSMdblzY1D6QbAzcnb66ARLrUseOwivpLiKHIsuUcRPdltx5z3QG9chJ5+/S3I97k3BP/YKZviRt+/ICl04kaxDARe57ZDIZ4MGaPJJFCeZM/ChHazzG7daunYevYKgKUHjGJYy4QSeWphVf2OpwRGNRHQ25GpRawB/mVs5QmTT9LXyEK0MP/SPFJ2fCa7mK3dp+x6qOff8+GtgsEPdj88iA0bQTeWS5q5N+OGuAVJ2SBc2NMSWywrmi4gNueXbt82q8Lcnv6sjdgNgrG36YaGJmkzujdwO0DVb/KH3/jWAmfcVp8XqS2TIcYoL1lGvbWZROXosAxQYyXr1amcNh2Nq43ohhcSLYxhyUpOZrjWzZU1bLfguOsii8l5PqIeqijrnQ2fUzzaQdbAdL0WIE4cnq/dMwi5KsJWMdkV5PlPvOGoxPw32aeuB/93JqneieumZ4COEYeu1mg40Y6vy0/kE5o7D3ep83ihAtXCfYY1yovWT4YrGg9pLckfMp5v3saeNPTAAaz79tw7OxUs9A81DCHm6RxJ1lJ55ieC69g9fh5QAGlt0zimtkvPT64/bybcou+x5Nu+/JWb7hMu3iO7XTstLIBZi1AwtpnlGeCa9Klpog8p5YUOUqmHBPst6bcklPZwMaj5WXnJulsi/x5V+asx+8HLxxzTBl73mIDFThPB/yf1KVLCVGqzo9ULSioRR8K9U2 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:(13230040)(82310400026)(36860700013)(1800799024)(7416014)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 06:56:50.1404 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a43131cc-05ba-4d1b-adb8-08dcc7f7c1df 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: BL02EPF0002992B.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7722 X-Patchwork-Delegate: kuba@kernel.org Unmask the upper DSCP bits when looking up an output route via the RTM_GETROUTE netlink message so that in the future the lookup could be performed according to the full DSCP value. No functional changes intended since the upper DSCP bits are masked when comparing against the TOS selectors in FIB rules and routes. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- net/ipv4/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index f6972b24664a..e4b45aa18470 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -3261,7 +3261,7 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, fl4.daddr = dst; fl4.saddr = src; - fl4.flowi4_tos = rtm->rtm_tos & IPTOS_RT_MASK; + fl4.flowi4_tos = rtm->rtm_tos & INET_DSCP_MASK; fl4.flowi4_oif = tb[RTA_OIF] ? nla_get_u32(tb[RTA_OIF]) : 0; fl4.flowi4_mark = mark; fl4.flowi4_uid = uid; From patchwork Thu Aug 29 06:54:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13782650 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2079.outbound.protection.outlook.com [40.107.236.79]) (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 D7CDE12F399; Thu, 29 Aug 2024 06:57:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.79 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724914622; cv=fail; b=mLKs8mvj2MgJgGb1xg4BRv210kOShWJ9vsTlcZEUgGWSf66MAsuCymqWv33f5kUJoe5jjQpZT3R5PrRSWG/RJ/w3Nkf9/tWR52sLYtpsFodTRrrHK2HYTbwL+JCSW3LX073WzrhLaT5w3dgsewxMAOdDuzGAK6Cfa7jqTIiPyWQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724914622; c=relaxed/simple; bh=9rZ7KD5CNyNlM9PFJUhPFCt98Tnb6n7HD7QrRcXTIMM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=J/wWpmJTFBvzQwz/KPSpEZte4yitfk3mCoNgktj9Qku8hfStSQsuKIadNzHgNzLCxzhF2XQ06LkrHfrBztiomaP3ik9C4v2DtdUN/5Rwu9xhTDPYlvK/mY+eT810jqegmKM03IIJ5dZ6BsvfoyMc4w6MQ2CccALEng2mFYgCmF8= 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=Dbpil+pp; arc=fail smtp.client-ip=40.107.236.79 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="Dbpil+pp" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=X3rHr2wRuLye2YXK7uIj+vT30/V7xbBToJI0FJVtT5hHalSM5UhAqbhSH9744l/u6qXppjv5QaVgtWplnlejquYsrDvTer5LK7PZFwt0HPYUyo9K+EsYlgjSVHvNPP7QamjFuVFy+CwjU4UGlfvd3hcgBW5DR6h3dw5x1kuJEcIfjH974B2eiHx0SFCmWRvwMa5wtGeFEu8ZOFWRs8m100PhsLuPjnfooKMvfXJRKX5abVjp2MxfT023QHk3bQnE5sJeqpH9lMe75mtIsTf5FWgbFuC5YVuaeuWFsETQd46NKP9kfYvVoYtz04Xc54IW4f5UqRLaFMgdqHs50Se9cA== 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=9O66q/qUN37ASSq7775bE0lMg0AWD9iz0lzm8yaNXkQ=; b=d3pa3ZC5Pycw3psoUMsZRocVXPgt76YOdSykIWWrDq8SryJEVqzfvFtCuL8PbwoEqFuVxiR5/YnkZ7BRCLFLD0aLrAFBQvZv0dzWnUCeLyCkAiRJKK+yVOdqONjVwpG5i0IJ99+hxkhOeIhADm1sOdgefzYhKxh5kri1TJBawSQpfMMqa0xkH6mcY/xdAxbKMcUutzus6FFlG8iai0aPZY4c4tX3Urseh+ipfkcmzZ4h/DMQ6OUqRGD1psWhgbFba31LmLuGeERyvL900Vtg72xVL+Cc4GDbNUMuPj0GoijzCvFM1jqn7jM4k75NyeRSu2z+EzrcqsN8lpv0/UN7uw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=9O66q/qUN37ASSq7775bE0lMg0AWD9iz0lzm8yaNXkQ=; b=Dbpil+ppnBaSZLOjp9h+jRe2zUqRDUH6UR59FyseUP8yZNd4KSvI/phst0CDIH4bZIYgV49p8LXPXEmuP0Qrh9/iO+wjoJRc2B+EGilS7m0HSXtSwA39OhqzpRds1pZmwKfoa55Ca7g+abjROkLjTiNiTMwEHgqR+ifkUqj967Lri/f+GWQiciBjLb8/9iUvejtkAtyXxKYi9xaI7Q0idThUnpeQ24GCMmICMznH/ZEf3BeUHCBCjHIjSHgyqMh7ZiGD7d/4OO8hOU99P8UA6p0/IQf2BfSbenbVXz/hsBzpn78MdkWjGUOZZ8mqCPQpbr6F4ChLlM+osUbkJj4ZsA== Received: from BN8PR16CA0029.namprd16.prod.outlook.com (2603:10b6:408:4c::42) by DM6PR12MB4314.namprd12.prod.outlook.com (2603:10b6:5:211::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28; Thu, 29 Aug 2024 06:56:57 +0000 Received: from BL02EPF0002992C.namprd02.prod.outlook.com (2603:10b6:408:4c:cafe::6f) by BN8PR16CA0029.outlook.office365.com (2603:10b6:408:4c::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.26 via Frontend Transport; Thu, 29 Aug 2024 06:56:56 +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 BL02EPF0002992C.mail.protection.outlook.com (10.167.249.57) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Thu, 29 Aug 2024 06:56:56 +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.1544.4; Wed, 28 Aug 2024 23:56:42 -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; Wed, 28 Aug 2024 23:56:36 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next v2 02/12] ipv4: Unmask upper DSCP bits in ip_route_output_key_hash() Date: Thu, 29 Aug 2024 09:54:49 +0300 Message-ID: <20240829065459.2273106-3-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240829065459.2273106-1-idosch@nvidia.com> References: <20240829065459.2273106-1-idosch@nvidia.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: BL02EPF0002992C:EE_|DM6PR12MB4314:EE_ X-MS-Office365-Filtering-Correlation-Id: 850b127e-826c-44d1-d200-08dcc7f7c5c6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026|7416014; X-Microsoft-Antispam-Message-Info: hDwF+uOwwdXUk4BoIGyW+VIK4SW7Hdmc0j/Y/MIUwH/qWA2R0EMJkTN6gBgCJgk39gvaTFsTvKeFkaHz6YW8F9C9L6AbnFvvxQpb+4dGOvdA1quyvhdMb8d/sE3aK8MgDByEjyaPR/UhEcwbIt+RWJitn0w9drumIsYF34qWK+EKF3VzvjWtoQxUXhDVcpidbUTB/UHK8z46dcthRJbI1J2jA5urHmQvNeEh/CVTUKplQE9QuMNRIGj/U23RQUwDAdspoeL8IEUOe127BY1TMovh8kgtxH5ECxeHdOmghUzpDrSsJrAz/ZAg9zdqIlvmpdyPeArAV2POxzyOvymdUuuYS9d+CvBJwHMvpmwwKRd/LjwY6t8nBJJBPiTbj+40DAf+H+6Q5VDdt0Kuk1A1QAog0/bz79jefBtHyIU6SYOOCilZFffCRMGqAZyIqsPTSOkf7mGR9mitT6UYzoe4cdujhWrZtNctainFeQ/QWh1rOsLvRejRPs3ixj20ZZpe2cg8TDY9U4G4+QVC/OUjhEbveLxe+xoDn/LPKfF7RT1nhEdDJY2/cAP/BVd6oo38ZllIAjWF9N5q2TqVx+3re602NX/J453NSPCrBOcYpyrRciDSFh7Bv654pWFoNhnuV9BwTXTPKElQ3stZK8WrT0+ayLymv1Th4D1Mb5ObrfVy6t3/+b/nG55GFYA1NGiazvGo2xg6FsFbcOLBxuh0AIkntYWhI5t4pG8bvMHzfUOxbdg0tNi1kEQK8zRKfsiryjDuG33UTb9DLVezeVRFfHQqzDEoXTbv+yXYHDXKBjj01MjolL64/Zp6XB0of361Et8dRkngZTnYmI0EE1lP8KC2oJkliRIgdlbWaWtIeGeMUIh23j/O91q55PaJArHvGCbedQuT9v+9eGNgIKwYWilmmYOU6ilDW4JEQn9oDJwXyet4Wx4NmDv7nYHa3fS05klhbBj4OxPnXSgAC6aiJ76n38EacsJmj/9yv7kVmzVl3/stP+LWzz7/6Z6s+j8a9hAgw/KrCs/C9PxNhCNiWp8PfMXKm31x1WWMPVZn+cEzcKxSddoxPfZQoY+SHUbS25s5hipSCvg3qSbK38HWh3t9NbmwqPuBDOJHAzilEYhqZqFpL2WtRwo8yHl62A46jQInck/+Zp5g9c1uDYcWaJaiZzyIPuJGZ9+TB5sG8Ex5hKDbw7k+Yd+yk8LzOzGntQJmAqvTgoFMwUbv5ZTa3c9gR3EJz2hdaQAB8C/fW102NSwzamjhY6mS3ZBTKJden7HASYtyYbUni2lKOC/po3ifaiZL9crqxAWsUAZjXcwvN687eYEyU+cDxm1xh5oGBm1Mub6gkAMzqT3NOVlYZ872G2hHcsUx2A1UNY1fewLm7r45ppEcVhdbXBe9Tt1xzqZahePNEfeJ6DBaHa9Wyiv/iMo5i08tOv910zUFCFNtOPBXnneC0IPV7cJd5hSa 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:(13230040)(376014)(1800799024)(36860700013)(82310400026)(7416014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 06:56:56.6883 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 850b127e-826c-44d1-d200-08dcc7f7c5c6 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: BL02EPF0002992C.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4314 X-Patchwork-Delegate: kuba@kernel.org Unmask the upper DSCP bits so that in the future output routes could be looked up according to the full DSCP value. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- net/ipv4/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index e4b45aa18470..5a77dc6d9c72 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -2618,7 +2618,7 @@ struct rtable *ip_route_output_key_hash(struct net *net, struct flowi4 *fl4, struct rtable *rth; fl4->flowi4_iif = LOOPBACK_IFINDEX; - fl4->flowi4_tos &= IPTOS_RT_MASK; + fl4->flowi4_tos &= INET_DSCP_MASK; rcu_read_lock(); rth = ip_route_output_key_hash_rcu(net, fl4, &res, skb); From patchwork Thu Aug 29 06:54:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13782652 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2087.outbound.protection.outlook.com [40.107.93.87]) (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 7CC041537CB; Thu, 29 Aug 2024 06:57:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724914633; cv=fail; b=Kk0fg803SGYfXBZwTKqf41bFWJgP1hS4JLt2A/i7WHQQU+u7gr6XoMgNiwvRTS/wmxaWaMZ1mnKSyPwiKCpXIM+9IF6M8ZGVibIYyNhEJxCVVoFteMa8sW6im/A/B+HVQEDRVGQGQV130x8z95VKjyslHM8Ja0Z+h8U/T5TSCkc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724914633; c=relaxed/simple; bh=9JJ6dT6Xthhxqv9n77twnzAhS6+5IEi7Nx6Vz+YqWa8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EGp7h8zsfNUqSyskXWRHPNn8HyqvrtQ7E2tFS9PFcv1OugfCmqiEOlaPjB8y/CT/jcUQc08p1cfwvR25vGBEfnY/7VSfBqsnRJkQj7qfw4urRkOwexLKWYGuwGG7eFCDC+Hyzef2NBEvO+n59Xq+mKnGdEDeZ/AKeHXLUwxr6hc= 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=jDSN275R; arc=fail smtp.client-ip=40.107.93.87 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="jDSN275R" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jGnHK7zJ9WVJMbjfkHeGbxYu+DC+ntq7ppIwt3zMcdU0b+vD0mFmLepDwydAueep6/Zl9330+vD5GjklnMnE7Vz910i2N+bD+3TtcSQjHS+vdJgVbffgxRnNMLVP8aZCh6vglRsA8CfTIPMedqPUGx+w7jUlvPxPIAfOJXfl15bifw4YgJFxdEwc4djkRZDlbJolu0RSf5YD71S/Kj/h1tRFa9V/hzWYYcjqrPjTtAFMfNSyuLTULAAkymgilUPZYbV8hwCF1x+9KOYrxrIkci6Gj5hH/rvEa7wfr0EK7I8okwkEDOgBRYu49K0ZUxHR6XzkXQpabn5dfx0ujF0HfQ== 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=oOJx0YidO/5xD0gOMtPOoY0QtRMySJjKLD+Rh8m6Bgo=; b=TLy4nfI7z6XMWs0z3A/0b1JWk1aKp9csNFp9SG7XNk9awh1ZBw6kpwhiGNwhxyJZtRfQ4cNK0yoJh4m1EcEOzGUHJLv0ZdYGMnaqWC3weUwUpIyOdcHQF/nIuWpIPGj8jeZt/ZsEM04OJze4i246ym6nAOe+/giK7Cr+H+SVjbVXDVT0LfO2YYOqrA7GgaiUVQcMf4k1wYh/MDrQ2/pEtIO8z7gAr2SdWUTsBEQqxnNOhC+acaNlTsT1X/xuaAeHh8l2ic3C1rd1KihjsQtkn42Q8RfzXnDS5qRxXF99qHf7teXrVr4/5IXLMoJrrtbe8zZBbFK3Z8/UQmYQF8VXEQ== 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=oOJx0YidO/5xD0gOMtPOoY0QtRMySJjKLD+Rh8m6Bgo=; b=jDSN275RbGjPl7nni0l7XU+IBw/lmPg7YXODUpZfxd4VBZQ82Y2B0rEw36gc7tZKnbpux3CTPmSwKfsnIox0M/D6wqBKcxhxQY/j3AC+Bv4iQ08OiD02ObrM5zwSDDGhS5jxIq4+//lQ1usTThaBsGs9QcSVkVpIjIIJ0qn+35H0RxJjyIp7VfuE8QE591S4Htze0gqfpnYtJXdoOVfzehciF7vW5g5dYK0QVf1FX6Za0kVUob7yxJjFvwPrHqKZMECAD7vPvG+ANLwiAqzjQV8dl+KKrH3D6Mz6nm4+JnGFPPYLXhe+bWYesRsxvumiM9W8RCJH1FiKLcjenXC/mg== Received: from MW4PR03CA0224.namprd03.prod.outlook.com (2603:10b6:303:b9::19) by PH7PR12MB6739.namprd12.prod.outlook.com (2603:10b6:510:1aa::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.26; Thu, 29 Aug 2024 06:57:03 +0000 Received: from MWH0EPF000971E7.namprd02.prod.outlook.com (2603:10b6:303:b9:cafe::a5) by MW4PR03CA0224.outlook.office365.com (2603:10b6:303:b9::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.27 via Frontend Transport; Thu, 29 Aug 2024 06:57:03 +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 MWH0EPF000971E7.mail.protection.outlook.com (10.167.243.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Thu, 29 Aug 2024 06:57:03 +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; Wed, 28 Aug 2024 23:56:47 -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; Wed, 28 Aug 2024 23:56:42 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next v2 03/12] ipv4: icmp: Unmask upper DSCP bits in icmp_route_lookup() Date: Thu, 29 Aug 2024 09:54:50 +0300 Message-ID: <20240829065459.2273106-4-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240829065459.2273106-1-idosch@nvidia.com> References: <20240829065459.2273106-1-idosch@nvidia.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: MWH0EPF000971E7:EE_|PH7PR12MB6739:EE_ X-MS-Office365-Filtering-Correlation-Id: 1d645673-7315-47ab-e66f-08dcc7f7c984 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|7416014|376014|82310400026; X-Microsoft-Antispam-Message-Info: omM/QV2zWNkGQcrGaenZzCHp/uLXjuLSnpYAbHhMl3f8GrWJBPmildd7jyQcg9ZDpyMcVVz7Fbf33EfF40pXE8L7snr7eSg8u0BX2tFJTdyYsfnJ746jp3CO+QTzXSAMR1jpjQmCtnVSdhEnVGe7/V3d3QKpzRwvvucld9iDBJxIIrCAHTAukR+BgC802pMUbFTuHYlTgP/Wjfcnyh1chAZ2EA2sNkqz1Z3Vu/B/+wc6+nnongyB6HlNiBSq2ioOiBlh/bMlt3Lri1x9zTSnE9mGhPCgNzu2UMCn/8f4ibu1cVpqaW5SoNJPNM3KyW4dxalcLXw3DrA6n39igDul6j6lfnH+Db+Nnjpn1Y9YWh8Gf0p8IUcvb+GpcANWLuBsLFQLM8MFPaPbsk6/1FejrwBvTKSpUU7qvy3enIh23742MTeZTs45NvuG1q9ehvvJuTUgoE8aBRdHF1jQkqrRr4uhxf30egksujhqTF9HKFUvjjzVuLF1qPlgD84Dve+IBoH0ax9D2Gs+lUEqWiLbJxmJuTdA0YoMP4CSB0qwxUMIFiNrvCZI6zOMCvVEZ+t75z1ury8JokjlAqwHnZ1kCUkRqvXyiPl/ye9xguJz1Y5fA2g2TCxlDVKlQCfxzfkNCe1s7pjXDN8ne2DQSdQwp7GSQPVEPlwYySU3+Z6x4ZhnAgF9pB/RAKThmxu1HFD59AEKr9cGDMaGUvHkyQ2b3Hmu1Az4DZu91bj+4e+T5dViZs122uSU4bUlcVELm0axdA0P4n0t3a5xTGWtiitkGTsf1WuvbPFrmxhmSpPrrv4RQPTNmkCHuVYvIx+KYW9fMeiILn85iGih+s32YcT7wItQRIWaNZ72fgWi+55cI5SMLFjeEqKnrec2ebNsGf7zl30KKqXnZYuWsMHmZDJ+eiCf99RNWmK1aypFLgbfKAWmLEqe3/1ECJ3RVh3a/n+SwK107MF0Si+/uhb/WDqRcO1O4kdomQBqa3VBp/0Qmk9DjlV7yLaoVQssm4VeeV1NXjemLEC9vzWqj+tCR3Rb+i+lo3NinpEkf01cOkr+MDAmGCkgK0ccqz0YUId8ZNq5coyk/E9/NFwsB2R3cvLBqyNLOF54/aUs/zWiR2DvtAUp0ddTQ6yPX+d2D0zayXFcMui+yaXL8K05a9KV4NKqNLmxDP4v6mdl478ZrMjbpL4jOmh7iK7Dwc9ybBtuspAr6LYOk0OwWRL5aylQysZWYkYLJY69Uo5h+F7TSploaNuPCfYdEOU4i1o04eBDlOqZUGjQYpK0Mfzs5otSAFkQYD5rkvXCMZAqKC7HkhRbBU6qqgZC2xawCFuvYKpCbNdCVZa13WGEqzbDyqeOIV43jyKNbygErbjISZYxakidaYO6sHuk7Jm/SSfkiEBgFJ5NQogKr17xuCMQKn8EfHHb+EWvsXvkoHIhEOcM4npUYDbyz+gqCUDoF+IDILKDr2BS 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)(36860700013)(1800799024)(7416014)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 06:57:03.0453 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1d645673-7315-47ab-e66f-08dcc7f7c984 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: MWH0EPF000971E7.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6739 X-Patchwork-Delegate: kuba@kernel.org The function is called to resolve a route for an ICMP message that is sent in response to a situation. Based on the type of the generated ICMP message, the function is either passed the DS field of the packet that generated the ICMP message or a DS field that is derived from it. Unmask the upper DSCP bits before resolving and output route via ip_route_output_key_hash() so that in the future the lookup could be performed according to the full DSCP value. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- net/ipv4/icmp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index b8f56d03fcbb..441057f2c903 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -93,6 +93,7 @@ #include #include #include +#include #define CREATE_TRACE_POINTS #include @@ -496,7 +497,7 @@ static struct rtable *icmp_route_lookup(struct net *net, fl4->saddr = saddr; fl4->flowi4_mark = mark; fl4->flowi4_uid = sock_net_uid(net, NULL); - fl4->flowi4_tos = RT_TOS(tos); + fl4->flowi4_tos = tos & INET_DSCP_MASK; fl4->flowi4_proto = IPPROTO_ICMP; fl4->fl4_icmp_type = type; fl4->fl4_icmp_code = code; From patchwork Thu Aug 29 06:54:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13782651 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2089.outbound.protection.outlook.com [40.107.220.89]) (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 09ADF12F399; Thu, 29 Aug 2024 06:57:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.89 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724914628; cv=fail; b=H6PcQX4weUzunVfHr4iSQTNTbF8llMlMUEpgCaH2LiyOxS5E2ZelfuWDs5Tnbt1e6Ue0bf7v3l62x5/+WDxGy9cd6HYDamoFzjZXbGXay6uxmvtbmFdVXs7aVSdYeFhe4SnROkqJ8I5W+b/iJjodhSdXb1oTWnF+6vi3YuU/HHY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724914628; c=relaxed/simple; bh=GEBK9holuzCsTWf0N2O6nr1GAFiofdfb4fV9ID3fVrI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=kYhHZtxFzZ5Mq+PmLsT8fBvFUUZhcU45BDxNH0ymhU9pBYj20dNMW9Mzz1q26SyVdi6QUBoBC9ilQ9713KBa9quBtF4Jz7cR3zZ8OeaGB3V6NRIuGJ+hl3radsnSZMZIw7yvmrZoUz2zOQ28Oa21FTxE90fBpaKue0UwQJu28HE= 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=QiC/KjjH; arc=fail smtp.client-ip=40.107.220.89 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="QiC/KjjH" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=c64OxT4T2MPO6ChZxWgBZHvEhqqS1aevAKUyW2rtuVeyj85bAx+HoLPq1HJujAFwOFI6x9SAUrcaSdA2fhasn/iGjBerbPshX3wTHwiFeeN/Rnxy8ljdZOG4E/7qO2ihO0UN6/Q4O6URqoOunF+aZ3sSBWktIjdJaC0l+y++k91gv7FH4Pgaw0XVFj+jH48CSyOIt2V3Sj+KfPt/nHYe6CLJBcvtLMdh3PSauEZ9E20b1ff2amDYlMNmZOH6Mz4IxgN5alxo+4mWKkgJv9rsMVYchIt/0eNv8SXdLB8sOWtPSJZs9Ubx+utwWAj4TrxeIbzuv4KjuF4Lowu2c+B5Bg== 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=sqRopwUqYrBusmryt7d299ZIRLr6IU10zDFiq3ZMk0w=; b=QbDce3nkz9ZTFluAjfgwIH2YwS4X6j6pq2J0X+pm69xkmjyl5cOu3gf1607cKCvKcmY29ti94cSr4F+wbTuBkdR5ScmDq09cHtYUnzBAT5DRS2Q9VaMhFxxZ/XLyxJsvuEeZyUN0MPKsWLME9AvCzUZhJMF3fCTOH+5H2G4CWWzXoDrbiOT+2SyxmVaGBWdIk7Wbmk2hjOVsFnC7fHubFlO+C6JE7MjYBe5keg8c3v+0VKjBhGqQu9HTkCDW3P5iZGDOEUZAkTI2hYny090LZAggHNL+eP2hX2SdjGu9QY64+sWCHu90RZHEK9O/qtxDmSb98WrDtXIHm8t+WfqZIw== 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=sqRopwUqYrBusmryt7d299ZIRLr6IU10zDFiq3ZMk0w=; b=QiC/KjjHlPlYvybwfP2N3ZcX1qBN20gWtrOH6V6W3y1dNk7ummhRqO67djr8Ie/VI3RWuCNzCyOrxg88COq+Yj6TtFa2sJeGpxJgri3hrCNsW3TgKqIMmor9CX4sO3XtpsIri1BEZ1EG1Uak76wG3gUOTyoB+IxFKtH1M2HeA7ARgQZwO+WxMVe0/iu2atTud3IPZ0kmtw+vvBo/hRu6Vp09MvKKrFtIy9DHxeue9rlsreiq+4gaeXzwlcd+8aNgaEZAup7+agAoQtnvkkFpJLqU6+uNA2fo24P/GCtdmVOgxJXVkN03z5/O9H35gajS0GIpje8HZaaHmAdzeuA4xw== Received: from MW4PR04CA0203.namprd04.prod.outlook.com (2603:10b6:303:86::28) by DS0PR12MB9039.namprd12.prod.outlook.com (2603:10b6:8:de::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Thu, 29 Aug 2024 06:57:04 +0000 Received: from MWH0EPF000971E8.namprd02.prod.outlook.com (2603:10b6:303:86:cafe::f0) by MW4PR04CA0203.outlook.office365.com (2603:10b6:303:86::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.27 via Frontend Transport; Thu, 29 Aug 2024 06:57:04 +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 MWH0EPF000971E8.mail.protection.outlook.com (10.167.243.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Thu, 29 Aug 2024 06:57:04 +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; Wed, 28 Aug 2024 23:56:52 -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; Wed, 28 Aug 2024 23:56:47 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next v2 04/12] ipv4: Unmask upper DSCP bits in ip_sock_rt_tos() Date: Thu, 29 Aug 2024 09:54:51 +0300 Message-ID: <20240829065459.2273106-5-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240829065459.2273106-1-idosch@nvidia.com> References: <20240829065459.2273106-1-idosch@nvidia.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: MWH0EPF000971E8:EE_|DS0PR12MB9039:EE_ X-MS-Office365-Filtering-Correlation-Id: 2f708602-645a-440d-18c2-08dcc7f7ca5d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|7416014|376014|82310400026; X-Microsoft-Antispam-Message-Info: 1iopZjPMZW5OjX5KF5OBNT2NIfVf8eAP46ld5pUeZk46VT4O5FjJy8/1sBO3mEbjqqMEbCJ16zZtmO6KW6FNSepB8/nrBR29FbOKpd5PEsaDXyoH4ex0oEd9rRFq/9u1aqOFx9eW1aEWxIzcPswN6GeQpnPYIsLG7Z+iS5gT6EC7ytCK4mDaBWFp/SZCyR1su9aMi7xCoZuD+oMNlpUY2yYV3zRzD9xPb5yW470f6nzan/l6luULNIk+gd6EUXp1iprQEa/+k3ZFnkZln9BxN3yfS2VAYLALmey9P6HrkD34lrPlVgWaSrvSzJsAn4Ic0mSxS0MQH+d/6DPATHoYBGgDHDywZLMv0nL8YmzjhEdDrmTsQE77tCjQNCGiwIaTHIJBzKcL3fKUJLkBS20PV2FcSQeHkv2Io00GZ79g87Le4NG+0ST3jAKmx0pPUQUF+Ixbk7NDpaCtdw0ZRYTM0TQ4ImCIs0BOXMk+fgn5AK0uQgq0iP4s6YwktBmQ3+3C1kO+rVgA+e60NdvmvDQWch9hqRSHnso5jbcJ0qu3EuD4qbhDkc5bcJu4sWLHmz81LU7T8BQwuN8qWhjtTGFwg9YD7Y/YxiNvQGrE6VOPVKufP7pmE2oYqogirWfo3fmYGi7vM8/eef/CKC2O8VWlrpS/N6gm1yNdpbQuK8oMh8Mn0OLmgwBsF1J0UMFNtt2+lfZthqmQEXdEx7lc5xlbopkLB/0zQqVoX04AaEdT21VIDmT6YyFVhdTHqnB6l2UDMXIFMrppLOZ14/CbDrZGzBiWqjI0mKbV/GZWweG867t+cMVDg+W1uJYQ6Ffo4P+W4xSjBYo0tX0QZuW2lEPpchQ5ziAVZ2nQK4+1LWlJSgFxlfona9duoOrd3MYfOWBxU8K6qtQBfGDwWkKlIow8HZEJ41nd8KqWtQTXpmX4YFDsaXi4n8FrJPa64bVg4GhHG4p/pP3GndDNldbQDHFXStKWmwy20VCag+50GF6DmdwRXHah/m2yAFU0TrpL4glSf28TVf9Hq4LdRjGmusOJcs68rMF/f+jSQ+f1haK5fl9XqQ2YLsTkw7bREu6TAOc47mo7t83dQDQjkm7K+PL0Ja+nD5C4nFml7WMwrpQN1BmfnBWROdI2c+j9VdE5fksruYJdgOdVwRA0yuOdGhMC54O9Fz9sAIH83T6YNxZF6hLz40LwCC78aXE62+0UFxhcxOzEvryUBuvWZTI1YaPtuTyMQe3GJwwVnfaZhdUpmNGtQjvp3YIqVJxaYIWqx8KbxGC5Eyn3BLW5mR57LrLcWE2CG6YBJ3nuv1uhkwQKvRUby9sVxpYocr/qjarX2cGpYcACq7kK3Ft18KoTNPDGaiMZ/B8v29JggY8jT7GuW9xTp3dKSg4IY+GjKFCB5Jzsfxz++Bfk+Kh+YF5gkijFy+CP5iM+ScLEedpF5LmJ08Un3kTBT6gxsM8OyBznxLw2 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)(7416014)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 06:57:04.4778 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2f708602-645a-440d-18c2-08dcc7f7ca5d 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: MWH0EPF000971E8.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB9039 X-Patchwork-Delegate: kuba@kernel.org The function is used to read the DS field that was stored in IPv4 sockets via the IP_TOS socket option so that it could be used to initialize the flowi4_tos field before resolving an output route. Unmask the upper DSCP bits so that in the future the output route lookup could be performed according to the full DSCP value. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- include/net/route.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/net/route.h b/include/net/route.h index 93833cfe9c96..b896f086ec8e 100644 --- a/include/net/route.h +++ b/include/net/route.h @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -45,7 +46,7 @@ static inline __u8 ip_sock_rt_scope(const struct sock *sk) static inline __u8 ip_sock_rt_tos(const struct sock *sk) { - return RT_TOS(READ_ONCE(inet_sk(sk)->tos)); + return READ_ONCE(inet_sk(sk)->tos) & INET_DSCP_MASK; } struct ip_tunnel_info; From patchwork Thu Aug 29 06:54:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13782653 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2086.outbound.protection.outlook.com [40.107.92.86]) (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 75C601537CB; Thu, 29 Aug 2024 06:57:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.86 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724914637; cv=fail; b=RH8keZ9wFgIuMxyW4OFJbD3zLLTLKIsiLBf8x6+ciEDAFw8SSmG6R1qw9XEli/+c3Vvu4zDu7lijl96wBdsjYj6OvRnrXUCU0B+Cr/E29XrSNklv5zvO0qHnhADcOGW0r2vBqQ/Txnfn841MoNvhrrKyPJl4m7i+w/SwyGZsB4A= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724914637; c=relaxed/simple; bh=BeNxN6BHADuYybAIR1/+oMTbAD+xYbrZclTiiRZQXOU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sv/QujvOtrYFEqJcgkp3W0oiPpFBuESSgvlQByfv/OJL7aqn9Z53Qf5JNqAydKRcfeM/tnktGZ86MgOiZ5uAUkvKOJw/10dSjsSbwaOXQB37BGJ/3w+Qg/zj2Qe6wKlia1wF/UyeqLX8H3sysmkPlc91A40SRkFSNyK875rowtg= 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=sRZB8Evw; arc=fail smtp.client-ip=40.107.92.86 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="sRZB8Evw" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EcZKw+KaWOuyKQ1E4U5azpk9r8mHNfQsLLTt/0OMsrAPjRJoaUHc1A2M3erlXhozPQtDxKZlnGkpHGf7mE3DBO8GHdpjtVh7qyV1JhS+XYqS/AMk4R0GuB5YbcyhfXEzo1A0bO+j9rPBoTZ8eL9W3pgdjRjt4d/MqocDGk8KaDH5MM42o3LVijTWKDDHnTAsjfuIcPuyn6cf+yLRZVYKQJ/9nz15Zi5o+vmmNna8BcqtF0AIlNrazjMn7XrWlC2rbByLsDSLSnu26IIXMxLwrQ2pR+95WXFfgNc5REjTuICmW2IkH0LUeNMN0de1YZ7knLYRZKzq4nuSccTgRIbvNA== 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=QgOch3gYGh6J5x1b5eN2ZtQTthaDQtfg68kfvlSQPEA=; b=pMyItRN7L/zZVkT0zN+6tDI8W6P/V61NDysMMkmZILQ/Ob/1Nq5NSr7VInT18VdcX0k8pJzyeKtsRhC/2UxluHa3Vcko5ge724sgU2XM6g0arDzUlvOj7C8Xn+sB3Zqr+8o7QImMYHnmkPS+HPuGnlGQLMDmYsdon6/C3EMoOXpdHC6P83vThT11RedVOKfU1UdriENR8FClTGEYutsyvlrqeg/wZT8998soQ4dmR4vtjvv+H3XktWzlbgxL2YnV4xIyljSAokNeyhQujQz5w/rwdLEtGLeaBhmTRvcIyoizqJTOuHUl+zu5qItt4cIgpNJkKO7yOhcDgdTj+FKdfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=QgOch3gYGh6J5x1b5eN2ZtQTthaDQtfg68kfvlSQPEA=; b=sRZB8EvwL5VelmwUjljMKnIfSGSQzuDQRz8NaLt2OMjpVhrlZwTkOT7HKjKVV5rdCnP1R+MQPE3EZcqeWwZu4CiX0RsNUEwGr9uwdBpOUw968JCbTtRWlpfMjCy0CjErpwk6lJ2RbU0nc1xZ/eG1LvRe0QCXuHg+WjtL+WIfy0E6pxj6Ogur7OSRAXe+sGXD976Abij8Ju/OfFiUMbbdK25wq7fuBJIWeEP7oIHHIi2rI8hS3Xjp47QEQHDlFd08UJwrh2xtx42dp7UhV++lX/rNUSQL5vZYMEbC91nYKBo0RW0feL+gMbOmzZDWVwBqGFm8Q/yphLQ0okaXrjLYdQ== Received: from BL0PR1501CA0034.namprd15.prod.outlook.com (2603:10b6:207:17::47) by SJ0PR12MB6710.namprd12.prod.outlook.com (2603:10b6:a03:44c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.26; Thu, 29 Aug 2024 06:57:11 +0000 Received: from BL02EPF0002992D.namprd02.prod.outlook.com (2603:10b6:207:17:cafe::b9) by BL0PR1501CA0034.outlook.office365.com (2603:10b6:207:17::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28 via Frontend Transport; Thu, 29 Aug 2024 06:57:10 +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 BL02EPF0002992D.mail.protection.outlook.com (10.167.249.58) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Thu, 29 Aug 2024 06:57:10 +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.1544.4; Wed, 28 Aug 2024 23:56:59 -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; Wed, 28 Aug 2024 23:56:53 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next v2 05/12] ipv4: Unmask upper DSCP bits in get_rttos() Date: Thu, 29 Aug 2024 09:54:52 +0300 Message-ID: <20240829065459.2273106-6-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240829065459.2273106-1-idosch@nvidia.com> References: <20240829065459.2273106-1-idosch@nvidia.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: BL02EPF0002992D:EE_|SJ0PR12MB6710:EE_ X-MS-Office365-Filtering-Correlation-Id: fa2b8b42-f60e-4a40-c8e1-08dcc7f7ce2a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|36860700013|7416014|376014; X-Microsoft-Antispam-Message-Info: 5/W1yI4O5Y6Y9LVDScv+iUT/emhnHtWzljzj3a6MeQF4Ou5QFVXe6/dKM5/l/bvLl+qr4nxKN0kbADAxFrZr3Y8ShDyUBv1dcJBRNQfVq1E8xAtQDnWW8lTKaNGnZpKBpA6KJ2K8igg2q61beScV+rmZgP0FyA2JjhYoh01bJBEq+4+jjP8qx/jLDAZ01/KetM8pPxvbzrqch4jqLRvGnwbyW1URyRJuC4vMvwycxmwCTio1mVNqEmaOFeJkCK6XHpfLRKG7w7DNr0uG16zrKu4Ge5+/AKK7knlHh24Vmot1hF5PaNQqxniLJXe/bC+aWI9rTODCHmuzgT1i0CKKrgPSzAjszEu5FX3UnijyiTOUlWOzokCZ7+OvRA+oOoddqKSSGKccBTZqUqVevSDxxxZKskjGKv/GtjUV7P2T7uLgJaci6KuWKW7k2iTMfKU8pKe3v2syzB/qgoQUsUZ6bfByzJ4Rnii7Kn7C5EiDnQHz4XwoFMmopXDqJvn3LRD2f5RYVV6gGWPTUffpw3gWsaYK3pBnkknoNi31VXItscfabmGy7FKhY6NKdFGGMP8KwPN5AY0ho5zKP7hMgDnGcImF52jdk2NANwBet5lqmHQEBtDHwiB5q25kP/unrhRyVw3xEQggy2If6CdgDmFtaXYnEbKtPnvaLUtMB+dybQDkqH+ouHyQ0S8PPATGD15KdnedmPsE9G4YK3EkGmbriOsPmWJFZs0GGNDX62o6pCktfcEGKlZgskjsg9STp0vmFlOTgpb7/BKcGfXVm0c0NsgX+sFIkUNePu013u86oEijaey6CwRwtuW0XBYyiLKXrrgVurdCRILx+VRDqhblCovxzbwFoFymUpPbXSk3hPFCje1fnk60XUTZeCsoJEZUBIOdnCButo+jhehT9Dpv/Hg50eM2Myw4Fv0HZCPjR/huJYxNvWYMovNwfA0UaLTj+NQZVzgyeJGRq0j0JAuGc6m7FuHNML4Imbm0crpU4PcgXB1ARpePHGQLA2gKWFfBTxEeBbxSCkUUeDcEoUED66LOCBsq7kgOWmtsWRyMpCVZNf99AHuIMhFlcr0QTSHOglXHrMrq+wP4dUvlISt/RNPM6MYtS8YrGHQWc3Fxx9xYAcm8wa0Eq0oL6YNPn07ziVmeXqplablpZbnJpZSyNJnsLR6Jf6eIfq0N5JaAxoG9ic+LNHumzHGIIikzwPwly3aN01Jif26l7WhMIKyhN0r3eXdQmmSPJ2B6fJ5Y3fo4qgf4OU7B6Ccdw+TZPUMsp7dgcLCbVlLV/bqfYlRkp1ljziIWq2s3geu8UQGIy9HbZcNp0xL30noF5jynKHuVZMWpoJyfsQ6cPnvFUuNuoCiBOhZeO64Aj7Cz04lLpq2iAxtDjelCoVrUnm3XUhLadUhL2ZplJkR8LS2WV4yzXTjDYLsGdnpoY+WFf6JmL74cC8s6eyopubFy8oXZo0nz 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:(13230040)(82310400026)(1800799024)(36860700013)(7416014)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 06:57:10.7496 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fa2b8b42-f60e-4a40-c8e1-08dcc7f7ce2a 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: BL02EPF0002992D.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6710 X-Patchwork-Delegate: kuba@kernel.org The function is used by a few socket types to retrieve the TOS value with which to perform the FIB lookup for packets sent through the socket (flowi4_tos). If a DS field was passed using the IP_TOS control message, then it is used. Otherwise the one specified via the IP_TOS socket option. Unmask the upper DSCP bits so that in the future the lookup could be performed according to the full DSCP value. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- include/net/ip.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/net/ip.h b/include/net/ip.h index c5606cadb1a5..2b43f04c7d03 100644 --- a/include/net/ip.h +++ b/include/net/ip.h @@ -33,6 +33,7 @@ #include #include #include +#include #define IPV4_MAX_PMTU 65535U /* RFC 2675, Section 5.1 */ #define IPV4_MIN_MTU 68 /* RFC 791 */ @@ -258,7 +259,9 @@ static inline u8 ip_sendmsg_scope(const struct inet_sock *inet, static inline __u8 get_rttos(struct ipcm_cookie* ipc, struct inet_sock *inet) { - return (ipc->tos != -1) ? RT_TOS(ipc->tos) : RT_TOS(READ_ONCE(inet->tos)); + u8 dsfield = ipc->tos != -1 ? ipc->tos : READ_ONCE(inet->tos); + + return dsfield & INET_DSCP_MASK; } /* datagram.c */ From patchwork Thu Aug 29 06:54:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13782654 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2065.outbound.protection.outlook.com [40.107.220.65]) (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 187A41537CB; Thu, 29 Aug 2024 06:57:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.65 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724914642; cv=fail; b=ShBNpseZsqog4A4qUn82zjuh74NNNvtlCXrKWdtw76sbG0G86SGSC+K8PRLtZGqQdCGlY5BJeUFlcKIBzVkA3pntlLNq/qwrePmoYRdtqpqwbyFXwUscCvYND8WpLCNNVP9ICo4UlhzGa3NOzHCdf8j5DLZIN4lw6Vt3zp7rp6I= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724914642; c=relaxed/simple; bh=8poBJutE79QChEnyrr9Q31AIQkjFoqop/k41/JmKcy0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=vAxQ8vFAhPD00BG3bbPItu1jjbt93D42mTwdi4Z0AnTIG+cPu7KuH+1xwjRJp7WCoYJh7eF+VyQOPqdQXY7MdLi89/6416j8eiYlrvSbQh7gQV49jxIGN7ZP7UcroeZcG5vISSXXbCqKrgYbjdpGBEkfVO3K62uo4Xh5JQrAKZk= 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=tylfFaXe; arc=fail smtp.client-ip=40.107.220.65 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="tylfFaXe" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=W3xidKED+0KiywOhgH8cjDehpO5yWCveBWrZKekWi5AOsEUj7LAM3k1B7JCwlc/kOs4kSwTtT0cx/TLd4t65SQu+e0daaIDh4+TcbevHeFSUtdOtccSPmdmNB41oduzS5bqdfaQv6hgM54d+Fjl4wV/kyz/ZxzkEjnoKRopssOyXTjCDBIjOP+r8MpPl7xweP3xdrjIMduTMCorlt2GtngynMOvWM1bgfrE2eqCMh5/v9iEouo+lyK6W/MqdfeWeyu42lIiwJcnAnDwkeU9RxbTR0KwDLbMvWfdjNmu4U8VefHARp3UU88dH3SLQNtMXUgcBpqP8WjzscCJqS7TStA== 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=Z0YzbnRwLaXc/7mdC99erH53FZxB9c2BLDoAI04xQeI=; b=XNbYWqh2zhCpk3ReV85rUkLZYBxOplWJTADuPBb1WiQ/c1WNBZQKmQQqbRAMIUBa1ztYvdTxh4ZP7lCHcPrbHOwpP4TdNRibfqnBU/gUDCayXHoJSlqUsLBkjU81z8/w+dhAUA/cTq3WRHbEjFC5Ad+qZecnU/Jd5d0SmBFMUilx0czQ+vIPDYWQ1onvPpriOGWryY0oyaYj4gLn/qJetVALW7tIF+SZOq5j16eCENkiZ2MlMzBCi9A5XjU8rZsgHq68qOptxLj4vB5Sz/cPBIGJTgL18L/zXF+JXU98TSDZiX13pIPWed4C1jzTEo3wDDYUj1t29o/cmIhIZWIJVg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=Z0YzbnRwLaXc/7mdC99erH53FZxB9c2BLDoAI04xQeI=; b=tylfFaXe3Q+06b6hR1NR0PQF8x6me64yPWTPCrn6QDcm4O7T+L5iz/PQNt3FBfw99pC714RKUWipJcjjHNLuaKmXSbPQVAVBypR0rt6vPqIY9/ZtbtE+/iJU1nVlDRGm82htKCxYNZ7N2XRtDfr9NH4/9oAqrSJzbMXrlBD5u9TcX+C4K/Qfx9mBwHknmKoUuxfpITCHruzWqDVeepsZ+6JYqLUOBNYmkE5ta51rVrBgQgwq7ZXflQx2ZLGQXtvQedUHmJ1Z1z2W8ceqf7iw15MdfGWdNEwWlsHS2jgWifXWED4kQz9+y/sTdKULgG+PKK0g9Vcah46+KGmMb+TF0g== Received: from CH2PR07CA0007.namprd07.prod.outlook.com (2603:10b6:610:20::20) by CYYPR12MB8892.namprd12.prod.outlook.com (2603:10b6:930:be::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Thu, 29 Aug 2024 06:57:17 +0000 Received: from CH2PEPF00000099.namprd02.prod.outlook.com (2603:10b6:610:20:cafe::e1) by CH2PR07CA0007.outlook.office365.com (2603:10b6:610:20::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.20 via Frontend Transport; Thu, 29 Aug 2024 06:57:17 +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 CH2PEPF00000099.mail.protection.outlook.com (10.167.244.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Thu, 29 Aug 2024 06:57:17 +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.1544.4; Wed, 28 Aug 2024 23:57:05 -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; Wed, 28 Aug 2024 23:56:59 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next v2 06/12] ipv4: Unmask upper DSCP bits when building flow key Date: Thu, 29 Aug 2024 09:54:53 +0300 Message-ID: <20240829065459.2273106-7-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240829065459.2273106-1-idosch@nvidia.com> References: <20240829065459.2273106-1-idosch@nvidia.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: CH2PEPF00000099:EE_|CYYPR12MB8892:EE_ X-MS-Office365-Filtering-Correlation-Id: 674d3da9-6b6f-465a-79c6-08dcc7f7d22f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|36860700013|7416014|376014; X-Microsoft-Antispam-Message-Info: OL/MpuTyVJKawo46oadLzEFm7KcL4XI2LVYJy4Q0i7NuhEzLCQZsgBdRSvclLUoT/bH6U92gMlZDFWNmRuslfBVD7XrnO6fvkARBZuH2O6uIPDhRlQSHqe44hUw3jOqacCl9NjBuZPMcejaDkKJ86zsxci/GeZpPj8YmvpnKkXcN05iCjjxBInmt02hmo1uJ+ybJ/lY6vv0EMIS/yZlnvwV85taAtchkn2MYGR2xwTb4P5tofCLTTQNHhC7UQn5evfGHunrP+LmvVDyrFhCiCCIK/Vlcn1bw1pv0GTGJ4ndH7wa89ARw5dePTF/hFRzGhLww/pUq3yZcDuKEdpGcAIR0uAxzqgBV9FhXwz7Z88qcRTduRiWZD9rZ9EIbK2jwMxOzTvleakR438eFpG9wyy3/t4WVFzA2PqHYqHjkhg4HbrjRGi9g9z3eP2veglm3ZBAyRjq0VbW2SVJ2PN5ZOb8UM3DZmT99GIJzcBeH+ZUAT7N7iS/jQVwt4QeWIo81c8j6f/es50qZrGAOEj6QlL85bZdoHJlUFP+f7YDGogTcT4lCyr3TMa3PdOy2fz3jRqUpq42etyzwebdlZd5ajpB8cU97D8KA+vlw7omHreYC3JvMbj/jKUdKShGjY9YFI0RDAeu3gsNi4G0rOjbP0Y3gkZEbWfnfjXl2XVAFfXWC1PrTtyB7YioEc6DDpAgImKSezSIJ2NxXrkQ4JRbtfQbxTnig9NZGSYG3qnGTmB6GafTB/OMddCddg8H8sdCj5d22DDCgkOYFrWdMD94p78C9EVXvSihrws6Uz7exW00VGg4vQUONh77Yl/CwJoGBxDpdajYmn2ZrjUaKTkAa8GM/7M/Apv21RslUDLvWszSatmlVjSJRuZ8Vd+rfr07KfTjOXFYSfJQk63yLlV/YBio8qAFiPeMYsAEbnHOMDKoPu1fx6WwoKuqwY/JU/jtwv7WRlbl/CQuhZ2qp1/ZztqWUptcfhFztHQQfBtSl7GQ41RZNvRsNcq812FUl1dnFeM3Y62XqOtbiNrPkasOw8ENQoK8xfCLZffr56ZN997vDGlHNwuelKqp/63S/EVlb88dcd6oDeoIY0sZwKs3WCmkO713wsj+zjzOUH5zeOBkEI7dMyun2wltfT97bWm59LgE2Y6Rs2rT3NXJZL/ntwR/lLCrVMdxBbY518i5D2UIcFITxiICbecR3MhIbUfZEJAb04cEsizlSgLJlSUJmbZF4xvahY9JQCr7B2t0B+EujRAwdkpLiNQ3MLs91Qa/CwNPrCocEEhrrxiH4Sb/iYb5TlABtIOhDGxfDE86YW0aUdLXQdVV7CFmpTaY11M/1fmMgJEpSTjV/Gnm2KJCUUeot34Qt0JwD9u0eusc6r35sDfqpWkN13XxwmhLjIiKElHG7Da2jPnt2A76JFLjVN8b7HF/TbEHYL21UbKikOos= 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:(13230040)(1800799024)(82310400026)(36860700013)(7416014)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 06:57:17.5694 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 674d3da9-6b6f-465a-79c6-08dcc7f7d22f 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: CH2PEPF00000099.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR12MB8892 X-Patchwork-Delegate: kuba@kernel.org build_sk_flow_key() and __build_flow_key() are used to build an IPv4 flow key before calling one of the FIB lookup APIs. Unmask the upper DSCP bits so that in the future the lookup could be performed according to the full DSCP value. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- net/ipv4/route.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 5a77dc6d9c72..723ac9181558 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -512,7 +512,7 @@ static void __build_flow_key(const struct net *net, struct flowi4 *fl4, sk->sk_protocol; } - flowi4_init_output(fl4, oif, mark, tos & IPTOS_RT_MASK, scope, + flowi4_init_output(fl4, oif, mark, tos & INET_DSCP_MASK, scope, prot, flow_flags, iph->daddr, iph->saddr, 0, 0, sock_net_uid(net, sk)); } @@ -541,7 +541,7 @@ static void build_sk_flow_key(struct flowi4 *fl4, const struct sock *sk) if (inet_opt && inet_opt->opt.srr) daddr = inet_opt->opt.faddr; flowi4_init_output(fl4, sk->sk_bound_dev_if, READ_ONCE(sk->sk_mark), - ip_sock_rt_tos(sk) & IPTOS_RT_MASK, + ip_sock_rt_tos(sk), ip_sock_rt_scope(sk), inet_test_bit(HDRINCL, sk) ? IPPROTO_RAW : sk->sk_protocol, From patchwork Thu Aug 29 06:54:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13782655 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2083.outbound.protection.outlook.com [40.107.236.83]) (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 6D25F1662F4; Thu, 29 Aug 2024 06:57:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.83 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724914647; cv=fail; b=dci4+VYcFWgl2NP6vtMJKr4GRJVT/qINb3LURmMXlIvVIQhJnAoF/w2ORL/RgS4c1UIzR01GfIBhk9IaYDz0Z2t33Ombor0riHeF9XU7axcRj/HYNS5vspBHxX1lGr0wg16g71e8NPlzVI3sST63uDYY6dKkiV/2Mlu09gqTz7Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724914647; c=relaxed/simple; bh=W+jYR9PLFuP7/FIyD5Z+wK+J5lHS5/HhqiWzb0Hp4f4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=csINezDrwQq/xXPU7hPk6ogd0kr3aYWhAfOUwmtPubdaH8DSJTrTwCAOn4wL9rsgjMh9t1WnRlU+e7+YXu3rvii988+m4XRIa3dh0C2I+uQ5o8c6rPTZeR7tEPZ3oI2EXlCRIINKvJScwTb7MGAu5k4CEFcXIJ+LUfZkmqmEyyk= 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=MMSaPYTJ; arc=fail smtp.client-ip=40.107.236.83 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="MMSaPYTJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MMsGXQNtRnLAqJkRW1YVH41MK8OgIqTra+klbiWoH5TV5LQPZeVosQ1eX5B/xTSio6ti7lWA72kK+AoKyZf/9tCmzWFxU+RRJdigABZRNTAhBXxM+/Wm1TlUhYz/IVdQyqNK6Qjpz+K8v7iFKCGOw556kxdPWmwbRp3TdeYFaAZx+fl9XmpVlSu5BrzitPm+G67QYrukJLR4LzYmaf5D/UdzGNOAheiaHcn70V58ZH7lk9s91V7XltfInbKcOSs8RHdeRGQWzfTBtCpLMhFnhUWA+6/JYxXYjvXliO3Qc8yNbTVfZoecZ8bSMovDXdFziSKnB+dxJQ94ki8c3eYMNg== 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=wdFPITCNeYRxCGb9fUyANh54EvQdQHAryXOsUqnJL+I=; b=rs9znMqesJKdB8rWSOBEV/RbatIHw1RkH96dvO82GIz2tktu56dJPCnSdce8vvfX4Y75QpReHUcogC8WoXoWUmp6XVX6XjJqLbZmDwiMT9REJ8YfYMkGLf9kQu8LLBwhuMuojD1OTdH62+2zZA2fluP9kaF1LyphG6D+QBQ8Ljjmw8uD1v9lnAVMUhkFkEC7pSJ+PV9W74s4fNiYOStb+aFARciopKM+PY2NRics4TcFo/7ulJ7cA/K4tvfw1fOik1tTLw+4U2rgbvvpOuUaeEsMBTqr6wsDsR+LDsn3CZkPvclRjdIT6S4tsbMeHqo8J+Hyw1oTTmhTpjRaWf0UhQ== 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=wdFPITCNeYRxCGb9fUyANh54EvQdQHAryXOsUqnJL+I=; b=MMSaPYTJYGDMG0yMw/loXBNvhUjt+6Rva4MGuDtp7l3AnOzPH2VUdA6LxxpU7obGg0hxXiktnDghdfaHBp96oBYXYTogVVTT58tIsdyNaFNBK5u6HIGPuIItngJ+Ax/i8CFTRVpx0CC3ziVc0YVqR2iKhpsL+0KZ0rECu5nQh0wD0cSzUznlroySDjrXAt1DFafaxhMdow5Z8cM02p46vY2yVi1yMeYeoFedmzDC6ggBBs0Td2KS4cilWKDSM6lLAOXlDt0QzaRu1DBwe58wfmHsf9uv6o0ig/i6obyfBaAaoyeBdCPvwbsBZVHG+nIi/tPkG/YwsVKpy12zO4e0Eg== Received: from MW4PR03CA0320.namprd03.prod.outlook.com (2603:10b6:303:dd::25) by BY5PR12MB4308.namprd12.prod.outlook.com (2603:10b6:a03:20a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28; Thu, 29 Aug 2024 06:57:21 +0000 Received: from MWH0EPF000971E3.namprd02.prod.outlook.com (2603:10b6:303:dd:cafe::7) by MW4PR03CA0320.outlook.office365.com (2603:10b6:303:dd::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28 via Frontend Transport; Thu, 29 Aug 2024 06:57:21 +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 MWH0EPF000971E3.mail.protection.outlook.com (10.167.243.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Thu, 29 Aug 2024 06:57:21 +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; Wed, 28 Aug 2024 23:57:10 -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; Wed, 28 Aug 2024 23:57:05 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next v2 07/12] xfrm: Unmask upper DSCP bits in xfrm_get_tos() Date: Thu, 29 Aug 2024 09:54:54 +0300 Message-ID: <20240829065459.2273106-8-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240829065459.2273106-1-idosch@nvidia.com> References: <20240829065459.2273106-1-idosch@nvidia.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: MWH0EPF000971E3:EE_|BY5PR12MB4308:EE_ X-MS-Office365-Filtering-Correlation-Id: 575634b1-67c5-43e0-015a-08dcc7f7d457 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|82310400026|1800799024|376014|36860700013; X-Microsoft-Antispam-Message-Info: klkGLo892iWd/01H1L9laFrzWZ0u2+rF7szZ+DG2mF24zbs9e4EStBLCNvc89AfPHIl915JkrN/LKtd6YSAXRWzH5r9A4fF0n4oJglHabwqj1nhhgkHFI97hOibPQ4bcbhhlh45AWHBUj+kuOt2BPXBrXN1GyfbdKi/iyXlEpCm+nORWjzo7eePTVUPPf8wIJQvazQwKdo85Enizdkhg9uSFnQDKiz+HNTOWmoiaasPW90xRxYIZx94PdgyZ9t00LEFw11yOSShFRqGXrbONZnv2OEcDWYbJbEkcAV0YwLtXDrp7buszvdaVev5p7Ft1p57n59bqPtxc8jIyDWHkOH9uIQR2I4uPKj6Poc6cQqlaXHH/CSadwHo4Zwrlf14N0bb58IDEQhnTUCdK0OdKu0ADg9dYzqY0yQMzant1b1Q7odbDlBww/Kqt6fokRk2hXgR44pbNLbdf/58M7XZx/tVVc/0/nxn2qQVJ0j5Sg8TYoA1/i+N/88nvi3qTkqSl5iT+rqhbY16NgsegUdBSIfg+nctNUnor6nCLcpYM3OXkadrgGScjgMLBrUaQHFbsuS9HLyxIKmH2EUVOx0AnQS/bh08zXy3tITSPcAsOxe/AUR+7PK98e4sOsRtU63stQTvZRsEXzRRB4qZ8C8wctX80I2x8rv4EbqVGNfSk2WViqCwKyfFPRcVpgTMNAeGcyUXi1Anu3vrZiDEpIcQPsXbsoPYykeg3SQ8VAmB1N5hLcSCVQ26SARGMRoTB6AkaxbCRjzrvq9rRmBa+4W8nVj49dL8jUQgBsiaDDsxu1sx7geiw3aSen1wlWPhu9K8V1u/EoRbkf9XWZyKGa29DnO2I66LcumatkNuLJVQv395jdEKvW9oCXQ97dmKhHcSmfYhRPXuKsfv51bX80SRn0SU3ojkXcwHyn7Ig2DqS7vYTxawIbLIEriM51Y0nijC0wswTDWda3CsCxjeYcXX4F6W5yu16EpDYukfE3b1vBwyGTIpfaGQ4xtQud7GoKUp4IL2AFHjQiovV8oTcwZZjuNSstcPDLXdmPTNOhBD2eLWU0X79VP5VjlGsNIAJJcljQ2EKmAjYTcmJDyJGfV6ctJ2O50sBtI7rn8yVgqDz/Mc54etfX92OM9uMcVWyb09QVuM/OLUUwge8b9AOEMBCsLmxt1LMZNr7XZq8iKU0nL8YqNXpgzGsNvlxOeKYFpilQOAqiji9vMC7XByCktMGVAkNO26KFsM7SCw2JKwtqH1aaLv8/FqJ9oBXWJF+wJ3dJpfVGXbFWIH21FP1Llu38AZnLyb3x8Rims1orJXYQPRay5U+QRhebpmwGM25/nTi3O1tcUJCyHw0Yxvf56L0lvx3H3CxY6qci8JwwXNx0Aga/FwpuhCV6InhpOa2K8SH+mhFI3Oiyb57cAGsdVFYbjVwks0oT7pzfNfFC0k8Emdjv86BvtnkrtxGRcAoSKs3 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)(7416014)(82310400026)(1800799024)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 06:57:21.2151 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 575634b1-67c5-43e0-015a-08dcc7f7d457 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: MWH0EPF000971E3.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4308 X-Patchwork-Delegate: kuba@kernel.org The function returns a value that is used to initialize 'flowi4_tos' before being passed to the FIB lookup API in the following call chain: xfrm_bundle_create() tos = xfrm_get_tos(fl, family) xfrm_dst_lookup(..., tos, ...) __xfrm_dst_lookup(..., tos, ...) xfrm4_dst_lookup(..., tos, ...) __xfrm4_dst_lookup(..., tos, ...) fl4->flowi4_tos = tos __ip_route_output_key(net, fl4) Unmask the upper DSCP bits so that in the future the output route lookup could be performed according to the full DSCP value. Remove IPTOS_RT_MASK since it is no longer used. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- include/net/route.h | 2 -- net/xfrm/xfrm_policy.c | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/net/route.h b/include/net/route.h index b896f086ec8e..1789f1e6640b 100644 --- a/include/net/route.h +++ b/include/net/route.h @@ -266,8 +266,6 @@ static inline void ip_rt_put(struct rtable *rt) dst_release(&rt->dst); } -#define IPTOS_RT_MASK (IPTOS_TOS_MASK & ~3) - extern const __u8 ip_tos2prio[16]; static inline char rt_tos2priority(u8 tos) diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index c56c61b0c12e..b22767c0c078 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -45,6 +45,7 @@ #ifdef CONFIG_XFRM_ESPINTCP #include #endif +#include #include "xfrm_hash.h" @@ -2561,7 +2562,7 @@ xfrm_tmpl_resolve(struct xfrm_policy **pols, int npols, const struct flowi *fl, static int xfrm_get_tos(const struct flowi *fl, int family) { if (family == AF_INET) - return IPTOS_RT_MASK & fl->u.ip4.flowi4_tos; + return fl->u.ip4.flowi4_tos & INET_DSCP_MASK; return 0; } From patchwork Thu Aug 29 06:54:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13782656 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2087.outbound.protection.outlook.com [40.107.93.87]) (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 4AD4A16C6B0; Thu, 29 Aug 2024 06:57:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724914652; cv=fail; b=tDdaWMQouAjwgCD4Tbz72LNvdyW4i0VEmarzJESX7RK1IOmxoJX+1xkk3RcyBQRWvVmJF53KMwC/YfNm/fXqCcHA9sb5oxxKvTdI1Jcoq7+oZbiujnko14BH6Svb436g3DV0kt+ZsG9Lcj1cG42GrHZYz0p4hepMo9REP8c8pXI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724914652; c=relaxed/simple; bh=jvi1gMc8usqCC5Y2HjICOgtwTI7ZC/Ke1mvMSYVcTCo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YmB2sxKE24S0jz+7kp/Rmf0JB0P7GC57RYE7RM5ZgyBpZxVRoAd1fA+8XlZR4qeA0kzYeAKAErq1CoPJl+yW7qFPIbDMi6pTfSqrUYkVy3S9CJw+1H5Op19RhUSnt0ShyH2JQSBuzu8oWjRrKX09SZ7yYdSGw/s5tqO1w5Tel/E= 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=d/lbfpyD; arc=fail smtp.client-ip=40.107.93.87 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="d/lbfpyD" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=shQrToa1Ki/OJkNlqI2FIMCrjbD+nVBP7gG7G1El9El6nsH1BNTy0+kG7VxAg53Vahtx0SUeyeiRrNEOUBNVRg2iIoxyTmC2oLwaZP9ANUvLkU8rXy68HO5kG9k9t49nMOacz1MqzfTKEcQbptE+r5fFAub08bBSOqBYnLb/+X+qyUeoTSfyuE1YPms9g5kDqNMA9Zg31v0RHlPzvdMgTbzxKwC/ZuPeUyypw1U2puGmH7Xoy6PQiY1O22vMQAjbvUGPrK2025KHnXRAnsH9Vga4Y/QbfZxrSHijb3OpLLt1FIUtCYsGzDHGZA2iY1T7tYpB1PDm9VT61lZdXgbtAw== 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=30mFF7JqNI1HKeEzyn/LLjwo08vl8GpE3tTpaquC8nY=; b=xV68Q/UtU+Gx8I/JSeDGiXegbyUm1DdGag0tHUmjjGvd0lWztW2EXZQL/3t6C3hoH22NO/s52FQ/yjGF9M+ftmT6abwtpcQJ+i585VIiES7eiTnL6gHLv+B+kSG/kT7R7Y9VTGrf+dux+BfEku4z0TGp9lSzkQ9y5PcEXeOkc1BLDJec6c/ajgOB1cQ5oDAeYKRF4PFKSqN0/NgNi3ImbHh1LMCWJGPDy+YFgnXQarz4QVqOsuGfg4qSGH1I7mfpDt+d438JrF0eIEYsMmoEIN/jfdhnCtijNwzXK9QL/GkpSlrB0gBv72t8nnTeA9wqJknvP3VbQVZ1mzJMz2OZVA== 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=30mFF7JqNI1HKeEzyn/LLjwo08vl8GpE3tTpaquC8nY=; b=d/lbfpyDb9rPuKFqD/CNddVFronqMu5MiNAomcvUymeq9EfM3bIy/FP/u0xxGEcSPkoEYHIo3gLx36zPekjCDU6Wdkhvnzu9ddd6jBMk+qCxUBeHMReTN9AmRNuYIISfuvGV+T3L/3NNsOmMmfuFcmoXT3Oom0VvR4t2L30WdiOchHwlg3F0yLLnm8ar5oKtQ8B+d5sHNVppFx2SiWsgojfdt9JRC7y2fxspkoMhl7ufyjy34IoLEe21Lm5US81Ny6Kf6x4URJERu9fHLU2aSFOfgEoVvUOkTKipUG8/TTnkF0ELxpx6sCMzp9tvbC5Jofg63/wrSqmTzdhxC2r0Ug== Received: from SJ0PR05CA0005.namprd05.prod.outlook.com (2603:10b6:a03:33b::10) by IA1PR12MB6553.namprd12.prod.outlook.com (2603:10b6:208:3a3::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.26; Thu, 29 Aug 2024 06:57:27 +0000 Received: from MWH0EPF000971E6.namprd02.prod.outlook.com (2603:10b6:a03:33b:cafe::64) by SJ0PR05CA0005.outlook.office365.com (2603:10b6:a03:33b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.19 via Frontend Transport; Thu, 29 Aug 2024 06:57:27 +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 MWH0EPF000971E6.mail.protection.outlook.com (10.167.243.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Thu, 29 Aug 2024 06:57:26 +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; Wed, 28 Aug 2024 23:57:15 -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; Wed, 28 Aug 2024 23:57:11 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next v2 08/12] ipv4: Unmask upper DSCP bits in ip_send_unicast_reply() Date: Thu, 29 Aug 2024 09:54:55 +0300 Message-ID: <20240829065459.2273106-9-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240829065459.2273106-1-idosch@nvidia.com> References: <20240829065459.2273106-1-idosch@nvidia.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: MWH0EPF000971E6:EE_|IA1PR12MB6553:EE_ X-MS-Office365-Filtering-Correlation-Id: 3833a075-07e5-42b5-84c9-08dcc7f7d7c6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|1800799024|7416014|376014; X-Microsoft-Antispam-Message-Info: /sXCqLMgKFO2Owuxz5+iJ5TpGJcycvjHrcRzXwx9x1pzBE7jVUdiHKG8vczUY3RnGEfX9elstLQsvvsmjQULY8DgLODy81yfutftIj72mBkmCDim0oKvg0fwOEQ3sj+wg6CoSBmorbVreMDL2RIzawSGZFV29kBNBijXoDLRe0wTY/VAUeTqEmjnMO+zc2o4JaYIDDXBVgvXux8bYCRfA/fqfh6NHB8H3JeUCVtxy9TwPrEuRouB0Ee4NcYTnTr8dCFB8uATWIxs4NxtA69AvQ8S87LRshT7BrSSNq0w7NpMiYVLI6j0NfQug54c8IZ/NwxrUSlidkP9Fvk4P2KaZt7faZbvkv5kXOZJfN5yaM9eX4IBy3Piba/qK5M5l2AvvBvJO7tDQ1JQekTU+/ezXwBQXROVDHaj3u5/EgbMhQc4ZlKcRT1gxa0awwNS8tGAT+J3TdWsKcLT63YyzyEhCW5pnSTLrNYpyRFvEUxx4wgeHdkLkrWUMotA4fqznUSQETCRyWBc1lKs7ZPbByqIHAyuRHu4hLtH0+gCIY2IN62sU2uHAiUwnxnMZg7NBYzWp6uFsZuRdXM6bAdE1PjPoY1KUvS9UNTH2GkmP2MxKpBy6zWDjoPtVb8ARMypktKM+t32UVRdPhaso27UKPKMrZPBK8/a68GVIn23gERepITvSbriZ6nRM7Qoov36CF11idUrmyV+ODt/CZShwfsIVV/ydcsZxgpfigg2EeMRqe3b1wDu0Wz/xe9vQWLHukyeOdf4gbfR2gj31muGZrohEmJBLRCqwpnPkQk4NXdq5hWxG4MtPXuWKhTpW4pR//utA28zvnSIy0239oJEIht6ZrQthEr9g6GQKZqUB1wCN54b88dYTJRaThSgI7KYDXBb1hnE7w8QpfvCKMv4uJV138Z+z5siZinlpwOIlsPGInCWJ4v+qpdDeUL7+EHmkq3D2eurUIv6WD4wTJRP0Ovt2eLQBKU85i1aPN57zBqIEk8r3Uy7LsH35C2nmkiadCN3ED4xGUcRULtEnAysl6PRFbIHjdWwErMwUDaBgP46C1q/24x19OSWGHFrYzun0H0dJ5r3xTWp2zLg+FHqA1hBHX/b1Lid9FvuzKHxbcOT4naRKJlgVuMhHEOX/Brf1AvwucjLkc1Hbr4OHok/0J473cMyZazR6W3hqh1K1KhXV/jsAMqVnquDaxnnaJUuPux1TmezijyjskXeHUheGAVJX/mPPFkRmLg9P5zuyCgIDiHFPmSZft+owiqTRJ0Y1+nwO2W5TfoDhkqz7OdeKwuvRmvcjuI2R+7CqxXs8y+rzqep79tfQFFq1xyr+KXWRT8gOHmsTFqjoRaPsv9BfqXEqD0OHbax3KWmVF0UUW9gmjdWYqsHG8vTfFvSOHIEp1O7EzIrRLZZKyQndNbVTZ10nLqQcIeZmrwzbfqeGJTR2PmsITm2bIv0IYCpmKRXu2Ut 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)(82310400026)(36860700013)(1800799024)(7416014)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 06:57:26.9791 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3833a075-07e5-42b5-84c9-08dcc7f7d7c6 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: MWH0EPF000971E6.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6553 X-Patchwork-Delegate: kuba@kernel.org The function calls flowi4_init_output() to initialize an IPv4 flow key with which it then performs a FIB lookup using ip_route_output_flow(). 'arg->tos' with which the TOS value in the IPv4 flow key (flowi4_tos) is initialized contains the full DS field. Unmask the upper DSCP bits so that in the future the FIB lookup could be performed according to the full DSCP value. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- net/ipv4/ip_output.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index b90d0f78ac80..eea443b7f65e 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -77,6 +77,7 @@ #include #include #include +#include #include #include #include @@ -1621,7 +1622,7 @@ void ip_send_unicast_reply(struct sock *sk, struct sk_buff *skb, flowi4_init_output(&fl4, oif, IP4_REPLY_MARK(net, skb->mark) ?: sk->sk_mark, - RT_TOS(arg->tos), + arg->tos & INET_DSCP_MASK, RT_SCOPE_UNIVERSE, ip_hdr(skb)->protocol, ip_reply_arg_flowi_flags(arg), daddr, saddr, From patchwork Thu Aug 29 06:54:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13782657 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2064.outbound.protection.outlook.com [40.107.101.64]) (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 4B99F16133E; Thu, 29 Aug 2024 06:57:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.101.64 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724914664; cv=fail; b=P3qXTMVb75swaZAulvLP7wdVW73H1zlGylHzB6nlEtyGJ8SbvBC8mv6NjQRkHH592v7O/6b1Hg+yITy6tS3qC3GivcklEXMU4RCvqZAB8DZPADexAwTD4ukC0J13oUX9M1nEOvQ+NTzstTjRSnXDzdhakv4q3tbxvB5TgvGq2Vc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724914664; c=relaxed/simple; bh=Z9JoJ00RaJuveE2bNXB1drQQTRl4TOyJwZpO04QGdxI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Vd7+Pm7BaYZbUOkkJYfeL7V6dcTgbm6JEyoTeilsYpLZ5g+RcqH8y7KXSiuHW3uBaeEhXWvpfwQEezzg0H/Z35GM/kSGYaK854+PWYK6y9RsuhUKM0E1To+UFRwDPcd/n9V+LMrh7C0cAUm6rCngEcn2SiCVJnXJG8N/+EdSQKU= 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=kUQIqYsF; arc=fail smtp.client-ip=40.107.101.64 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="kUQIqYsF" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bU04j0BPAZ+aGv1sT3dtP82bsWZLisZAs6p5m6y60RmRSiiL9AQIToSA13hXoOMIpsjRnQu/WKVs9VivwHkTlyX837IwlXeztKBAxsl2uxxjDuOtu5WU2Cg8xwM/F40Itf+zYlxtSHY56+bVwOE32wMKSjvFtPCqP8KJ5BJz3efJhykyZjiB+mjU7lDdJfKwAadhKHGZaEm8QFQWlBttzB0OenGQslZpypVntJRnXkonrg0KbEVS9ypbk+IYXYpA0ursBGTxRy8sqh2t5JAS7U0yoiaQKYnbEkhHmKUg80jUALN/4mxmUlOkRfxEHBZP+GbxPoymcta94zdYwQKJjg== 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=EKqkKGH1ZykYAvgv1f5F/xXkLVLKvRmX9/iPWuPGgBU=; b=kOT9qDYShKgnya6gmfou5i1lTQB4Xd2TpAvb9PxgKJUGK6EG3jw6o9M4AZ3/aXWCSJY1KyXerDaR/k2T+u6laDQc7ERGQJQMyWrMlpxw5d0VRJzYd2bLQyX/cyKoHtUdVEUR/JzNCPxhErtz9vyWYqZHBgQ+mB9XD1j1OfkrvFYbxy6U6B3iQh+bOeZdSyZlqvLe4Y231iXAzxv3Meky6e1fGCKR36BMb/ocGyG0aRqVLk6JADmRkmG0wa+LPlxdRbBLDijUTg3sUbYoGobNVTBA+R4tUP/B24S0HWRMdDVCXKETE+ROqBabNBmfxdStRXJBfcJ9gAR4Rlc7eSz6PA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=EKqkKGH1ZykYAvgv1f5F/xXkLVLKvRmX9/iPWuPGgBU=; b=kUQIqYsFdqzdyYxtmhWHkWdhDphRjHCjKQNcOcs3v2CEmovx5ZZBlvmzLRVQoi+fdBAKxC+fJ5RK/sdk7ioyP2yM5JlOO7KnSFeLA0X2xGB1LSFukQF0EsG926sVDgbWQ+Erj1NudmQqhFiNeF2NqCvxVPLw9pv2mfm3VyA+QP9ebjetk4LdhZlcwCjkg05jh/J34S6wwBIRv2Rjxvadqt/otRZPzYQD54UglfW6nUTR1vAWmMJYfvgBA1VHGaY9AzbiZuMcV6YY0Zp/cfnO18e8J8WE4KIMi4Jfi3h5MnvPjVjYH/lp5eC5LZ58TOUyWblhVpVZGfSou/6iZyjY4Q== Received: from CH2PR14CA0017.namprd14.prod.outlook.com (2603:10b6:610:60::27) by MN2PR12MB4272.namprd12.prod.outlook.com (2603:10b6:208:1de::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28; Thu, 29 Aug 2024 06:57:38 +0000 Received: from CH2PEPF0000009F.namprd02.prod.outlook.com (2603:10b6:610:60:cafe::42) by CH2PR14CA0017.outlook.office365.com (2603:10b6:610:60::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28 via Frontend Transport; Thu, 29 Aug 2024 06:57:37 +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 CH2PEPF0000009F.mail.protection.outlook.com (10.167.244.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Thu, 29 Aug 2024 06:57:37 +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.1544.4; Wed, 28 Aug 2024 23:57:22 -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; Wed, 28 Aug 2024 23:57:15 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next v2 09/12] ipv6: sit: Unmask upper DSCP bits in ipip6_tunnel_xmit() Date: Thu, 29 Aug 2024 09:54:56 +0300 Message-ID: <20240829065459.2273106-10-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240829065459.2273106-1-idosch@nvidia.com> References: <20240829065459.2273106-1-idosch@nvidia.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: CH2PEPF0000009F:EE_|MN2PR12MB4272:EE_ X-MS-Office365-Filtering-Correlation-Id: d0f481a3-905b-4b27-6ee9-08dcc7f7de21 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|7416014|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: TzMFsKiulmP5kbeEt0G0A8zD6hccj9S01Hq1CvTZNBmFCCmcLCfeLXjiKgIInAL53beSkjBrU3s+iQJfvzMkHLxUl6TGFk4tV7Dn+jGHyouvqX4YJkiCE+1jNC3ZRwCGJ2rtNIaqzze4Oedyqi11aOwgTMBhzKqcREKZD5SqyHgoOMGUfErh4PeTN5ewJYsj0lfQdafJQIUEwGd9262c7BwYIQ1ENedSG4xVCzhsWoB4MCYp/42ZwMeALpqcBSza89My7h5uXuJs3ozLSfaDfXaa2P5LA43KyK07Qu3y1io/Q0CkpkxhiaW+7wYdyGhNYYZ1KDEDvtTkIMRlOd9EaGuVjQGCRE1iq3Wh5Vvtk1wBNT7w5K3L+tzNUwzIK4y0ouH+SVnJO3oM1CioSwcKDwhoY8wExhhex4WkeMQyv5OlgKVHOvJFa3IcE2tFbIqKwyn1WQ8UY4153z5Jrup8sZ4JexmCF4XcX+oDA5Z8QU1tPBFhuKcg9sZ530uHO0UIPFM9POLGWZaRldBjIrlitA6ZmymVWrRyFi5VxXt+UfVO8yJb4jsRRZ4OC17maERH4gb+BOktTouLk0ACLgxZbyMv6aThyXGah9BpW9NjUDWbkfe1y57SUyTAag/sI+Xj19lsf5c2QmbRERoSZujA4pBQNjxaf7mfoIdJnad34CvX+8+cIMhZGCDd8nARi8Lp7UNDIZJi5k5jennQEZbrt22O/ChiwaD74Wou+CjQHzO9ZPDtYPbh8zIIwNa/8IPl1BrX7AWAFCxi0vKLlsaCmX27GkJv7mlwzWKZu26qfW138sf/J2GVDftIJq4bRftNK1H2sTylnQkpGe1klcQr/0xwAgcscTht8IajAnuL2yE+KyCBYVNxjiWGewQo5Cgm0Ozm7X/MDbNdLn14mJoChNdj23LT6dfMFJg3ZH/Ho4BYPxDla1zZiuwvvCu4EMhEiUlFVAQGBNzjgal67r4+NQShvY7ivLS2fy8jjlpPfAIeoDSmIIE/KjPMzVc/edOUqucRMbaaNAs9FpzO5B/XgLs8MEa+gQUWOFjO7QOq1oiSilMYlr4daq8XSlocotBNaBfwgvkCFmFlIAMz67pfiKhXEhrNjtsyFVltcLU/unBe8gCTQo8cQvexwse4mzGN+gTlg3PIIAwwHpmY4bufWtbyyvAWHjAp9e1f4aRvJ+xmcVKmsQ1vSFq5xCcbgxev3uISYaXPB3fss4OQAp4pw0F4Dp8ZkYnoJ7cWUG5MaplkerewGMznLqpJfx/k3j16uD0kY59FQqMLu7VBEKTz+4zJVDMbc9lEchLLgjpQMaX4CVdssU619pskZg+P85jsTMcUVInsyhKsnSsNxfimpKyix3ak9quNqRJvR/GgUlwfh/RygbO0CRnWPX4YVcvY5od0wrCwKqpQtzc4uV3KYfpoqV070pEGl9ZMpJ5FCenF/ovD0z5L9psnzhMw9Nrd 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:(13230040)(82310400026)(376014)(7416014)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 06:57:37.5787 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d0f481a3-905b-4b27-6ee9-08dcc7f7de21 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: CH2PEPF0000009F.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4272 X-Patchwork-Delegate: kuba@kernel.org The function calls flowi4_init_output() to initialize an IPv4 flow key with which it then performs a FIB lookup using ip_route_output_flow(). The 'tos' variable with which the TOS value in the IPv4 flow key (flowi4_tos) is initialized contains the full DS field. Unmask the upper DSCP bits so that in the future the FIB lookup could be performed according to the full DSCP value. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- net/ipv6/sit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 83b195f09561..3b2eed7fc765 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c @@ -51,6 +51,7 @@ #include #include #include +#include /* This version of net/ipv6/sit.c is cloned of net/ipv4/ip_gre.c @@ -935,8 +936,8 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, } flowi4_init_output(&fl4, tunnel->parms.link, tunnel->fwmark, - RT_TOS(tos), RT_SCOPE_UNIVERSE, IPPROTO_IPV6, - 0, dst, tiph->saddr, 0, 0, + tos & INET_DSCP_MASK, RT_SCOPE_UNIVERSE, + IPPROTO_IPV6, 0, dst, tiph->saddr, 0, 0, sock_net_uid(tunnel->net, NULL)); rt = dst_cache_get_ip4(&tunnel->dst_cache, &fl4.saddr); From patchwork Thu Aug 29 06:54:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13782658 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2064.outbound.protection.outlook.com [40.107.95.64]) (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 5A07E1F61C; Thu, 29 Aug 2024 06:57:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.95.64 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724914670; cv=fail; b=eBuScAUUrzbQEV4YA0dMOd3O05i/eyXjLpBZIArMoeWuAfAozYks11qVkwpbcP5TfpJTv4Jhdic9thGJwLEsQlIMANjqXhEbQvr1XmXC+61Q1diwEnEqE84Dc9kbXxVNFB5dALwUuH/x4XqWox3IrjGcMv+XIvUsUL0lu2L3XF4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724914670; c=relaxed/simple; bh=Q6DCgyGPCyWM1e3MmZ7KUEf9BpiFeX1aXiwlVB0sCeM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=owtU/cSSedHUgYMSF39/gJtVHR6z/pIssOjSwFph03FJhN7DunxUp16a5QvgNYkDWqblaNh2VNLsliF33VY3zJU8EzRizh6fx5+u3C3+In3fpOEYBgxONao3Xr/RKCFuOIiYr/fbx20x8ruB945CcK0ZJ1aYooGP09/q8vTfBL8= 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=EB352dhW; arc=fail smtp.client-ip=40.107.95.64 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="EB352dhW" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MEZEaGN555XJawR6Bt1h4FMkEwChk6PaPbZlcTnZiUCcingy/1VT53SGSiPS3+3YCZ41oYDhPJjZvnqHsmmZTShLnmH05X0Ip47SIsm3H9GHfRUZJF/xxC9qx6GzFFn6T1xpGjLbnuM9/5RysH7dEDFEUmdwYXBkJw2i/4dypHB8IeC8JdYHOVhWVadhM6rkn5Ll66WEov9BIPFlnXv5V1JsIIRGLIfjZtj1eXVUnEsYebxzmKqAfglRLg0Rp51XD2BpyBC5VAM2GSk8GlLdzt8neMgmdKPZ8lH04TPXG0j1Uotowbps5WLg87y//Sof0m0chA819Em9Z106oUBLhA== 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=YX13TuVBXOIT7A7klMaUzHbARyxNZTQ2EerN7KekEZY=; b=Ue9Z6v62YG1Qsy+EIKMCoQxzWKb4JA7O5HZ0xKRb3Hgnmf2oRQQhGpUGDrzSC7bstQqBnmYDJFV6dA+/DvDqTMSkDh4/vaF8FDR2WBdnDI8FX3l/UTtEPhv6y0ZH5SgO4jIs9IaTpsbC554pJ6BlPcot4aU+GH6YbTjRZ6qDie2RA7x2dHcM6GMiubNoB0P8CSnpxQyMSp0F70P+HRHu+s2eGzzpCDzLQi1BJ7frXlNQyJag1LkS8yT0TqvZ87t/dNe511+sBvwGh0KgVZ8c8QAJz4DEvx4LUTTtYeuzgblw28Cx0VnCfB6/PXOeUJIHcCMU/Zs4g7Tr/X+lWyGIcA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=YX13TuVBXOIT7A7klMaUzHbARyxNZTQ2EerN7KekEZY=; b=EB352dhWWgTnm/7eObVYAAKbMR5EM6GNC868hmzt/8BI5DlLZlNXPqssGJsAa0sdi1UVl808Za2AQgQbkJskgMhp6eAGZJtupDt10a654PFcChEIIMHtAgsk32ZISvw7XOSh0z3NFlGIpvs+0mkpzC0IHgZV+hLimdDC/Gey/dtJihH4scMWq56Qe3jhU9JTg7ki3ZfrM/IRtzNnvbNL4lIIx1Z3nZfWRCjqyLrkJq7087y8EcyZqQ7DbJYmQWB9WuFmJWWQIjTvRibv59ZF1MudJs9lzdP0CSV2wVmblvxvCEJxggGuw1oMVFnfoewI2fHc4OzCj/11NUdXmoTOyg== Received: from CH0PR03CA0348.namprd03.prod.outlook.com (2603:10b6:610:11a::23) by MW4PR12MB6778.namprd12.prod.outlook.com (2603:10b6:303:1e8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Thu, 29 Aug 2024 06:57:46 +0000 Received: from CH2PEPF0000009D.namprd02.prod.outlook.com (2603:10b6:610:11a:cafe::54) by CH0PR03CA0348.outlook.office365.com (2603:10b6:610:11a::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.20 via Frontend Transport; Thu, 29 Aug 2024 06:57:45 +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 CH2PEPF0000009D.mail.protection.outlook.com (10.167.244.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Thu, 29 Aug 2024 06:57:45 +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.1544.4; Wed, 28 Aug 2024 23:57:28 -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; Wed, 28 Aug 2024 23:57:22 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next v2 10/12] ipvlan: Unmask upper DSCP bits in ipvlan_process_v4_outbound() Date: Thu, 29 Aug 2024 09:54:57 +0300 Message-ID: <20240829065459.2273106-11-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240829065459.2273106-1-idosch@nvidia.com> References: <20240829065459.2273106-1-idosch@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: CH2PEPF0000009D:EE_|MW4PR12MB6778:EE_ X-MS-Office365-Filtering-Correlation-Id: beb1afb7-efab-4a05-6689-08dcc7f7e2d2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|376014|7416014|1800799024; X-Microsoft-Antispam-Message-Info: MyV/UACuPV60uH1SBNZYVHI6WOmHro59oWePkBzx3DJVDo9L4nQE1kd55Ww4L//xXt6DWRQi3iFviDB/ndUfr9s3YHh3OBGYtzm07WCWDiD62r7DE7gpC1+BeEQVgfeSxsPCsbs5YRGCE/WQIKoCXuiSgDGU5G5otmNEIU7PV/Fsj9WVbWLSWAzgVYA+Ex+yiAjOw5v4PN3UMGnuMng5Rw1NtSa7+HdkycUklYaVSNud7J/Z7tPNTF7GYER2yJJwuzbCGlewemaHK3zavjVr+MKRNjc8ybSzGMfmQz5NxbffH+2/BPQYaUQNB5lLzyfDmyccaEzEHREt8db35R8dJW/JMCsLIAcq90aIUgWwhO58qX1BXZSi3z2klTst4+aO9lH4RlXYlS/eXqjjCKo5SfqZRP8X95xZJ18Hq/xEPKaUSoAojySg0s9UcB1QGOLIHwR648GMo/Fj3/DFXztI5DyhIvcsOktTsIhDNOS/WaBfOBYRihDx5Vs4oQL6URF5RHXMuIn1L90nwfnttOUhZDQ3RWY26DATxoyaMhx+tSIZd/elupQi/NH5BX9dMtAhj/knjqRSshJcb+gQVY9cqjrgva4epOrbKuJHsj9+WqVC3ICJfruNrrxUjsiXHoOX096+g/U2nqFrggWGt2GFe8xYJtPeZLfN6Xtldh6czpfngEYxzjoWsRt11TBqRKz1YXdxL3AGH5g+WdjI75AcLJXjZhv8FtMcB+TW51UJKjpxbQ0sOS+FYpdUNPqpvRNNgOnms3Xd/Fq0BgjtyuCCgIrfFfJxIshCy1k/iYmcEH9w3XXA25/nN5gbMiOFNUiCDzWaoqoVMZNROLiDCPnIe6gZ6U6EWNZIqDu5dz9uM05pKNDhpGvWMW9aU3Oy6xlB9iZqVzn0conY7zliFwRmLIqmxrv2zZkGXZvtmh1FQjSvRxtYnUVKHn+J2VfINxER7lEmCNO8Hu/83wboimFbW9+zWY/ZmbcKbh4xoI891QF1VjX6y5BeVb3i/C8phW+f+YAEVwfK++GR2KhH8xIENngVzIqqjKixJrdWKFPcYrKTjQmwP3WTqxmQlTpaa8yKhJ8SWbTsYqHEmbCqeyTftaXKha98pQOBQMaO4TxG3lrrpMU8JwZ5IwLjTkg+qCifmKG7x+dyhhstBKp5qYVpQtJELuHEMCIR0z0XMfd829sXdPU9uUNBbFNNrhOSZ5omsZESF7z44D53HWVo0KS0Dc5eWpYch0i5Y4ezfUH61Clmi8xOyDpZ5bMxdO0whQTyFRIHtnUuE7/N13viTutYKOOv0kRNl1lvqNLGcsYYUWqproogqusyCtmHPLmlc1xnAQ3JIz+06L4ciTF3X3hW6l962siwWeKofddPEtMG3woAN6ua+Nlb/e/ubWvVbNeGDso9AFxYjmCf4UOKJEs0zSdf7IgeJZIh+ncHPCW18VZKAGzEEF/4PqPSnZtFeHnd 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:(13230040)(82310400026)(36860700013)(376014)(7416014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 06:57:45.4181 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: beb1afb7-efab-4a05-6689-08dcc7f7e2d2 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: CH2PEPF0000009D.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6778 X-Patchwork-Delegate: kuba@kernel.org Unmask the upper DSCP bits when calling ip_route_output_flow() so that in the future it could perform the FIB lookup according to the full DSCP value. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- drivers/net/ipvlan/ipvlan_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c index fef4eff7753a..b1afcb8740de 100644 --- a/drivers/net/ipvlan/ipvlan_core.c +++ b/drivers/net/ipvlan/ipvlan_core.c @@ -2,6 +2,8 @@ /* Copyright (c) 2014 Mahesh Bandewar */ +#include + #include "ipvlan.h" static u32 ipvlan_jhash_secret __read_mostly; @@ -420,7 +422,7 @@ static noinline_for_stack int ipvlan_process_v4_outbound(struct sk_buff *skb) int err, ret = NET_XMIT_DROP; struct flowi4 fl4 = { .flowi4_oif = dev->ifindex, - .flowi4_tos = RT_TOS(ip4h->tos), + .flowi4_tos = ip4h->tos & INET_DSCP_MASK, .flowi4_flags = FLOWI_FLAG_ANYSRC, .flowi4_mark = skb->mark, .daddr = ip4h->daddr, From patchwork Thu Aug 29 06:54:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13782659 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2086.outbound.protection.outlook.com [40.107.237.86]) (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 C585D16B754; Thu, 29 Aug 2024 06:57:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.86 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724914678; cv=fail; b=DgqUcPRmzBMC+b6qt7RoIANIMfa5S+LTal4rpN6Q4rQgtFsSXeMQWjAZiV0vW4+boQP92YQij/aiZNmi6aVQKWur06R5bEAoBYNVKEUmM7vX3FaB57JAJxUn4gpnmsYJmjt9Lc03IQFcHAPFgE89JfTWwAtT3I6E6CRiPTU0mm0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724914678; c=relaxed/simple; bh=gT5axdLBSY6BKd+4OpmK3jt0qETi9shp93KBgabuCLk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dPxUYkbgHPwsWTKYU8/BjMeEdooNpYsPF4vbLTTYBdhKRkv7EPl5uAIkHT9kYYoy8o8H/m1hbaN8iz+d/4ZqQuAdPHU2s4MjOjL7ifm1Eem9k/pSqnmvGJle1Fo80DsWHv4iZMxYsnTU37fffZVi78RCpPjPQIEj7TED6oE+jYk= 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=MSOC4AxC; arc=fail smtp.client-ip=40.107.237.86 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="MSOC4AxC" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OZI349x7jm9hdNQRzP4uil48qrsJMcOQCs7CP2JNpCVCN4Gzw0l0X0Bj8GJl90aAcDq7GZeezfa/tM+EBuBp2x11++KYn8+UwXbntJ75ktuwg0BY8A0ExAUN0qS4HTKrhy7Kq4PmClHiWhFhXUah05GjYiujBs5Mdwxc22DhqcnaJ9rFGCJ60t0T8gGybCl+9YuTeqRzIAqtPBnPTiKuuz/wtFQUM92XrXoZDo1U9nLX/ryk9Uin2TaZkyj9zvhyiWL8xSxQEm225Dx8bSw02IKmaupLUEy3rMmxZrutpNfwCq25DK0MwzFvPvmXe8K2+dk8mdzR8dCVGX+wdlG1ww== 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=InKboZipqUsKJt2itvVoXND0Mya+GeP3Sk0rjUoSLOI=; b=G1OljGWUWdfgtAVpXoEkVdYhxMmw9T0YGrPEFGZO06piHqPfutRtayqwgIF0Rb71Dhym1JQs8cTZG74bVw/YUIptW6rYWgXvVSfOm6PggqxLapJVy1rKRXU2/2TMDZ7bw3aDG94LIWmxx61cHpvEkDRUThzoLeAvuWRyQDIv2nNHD2BWmd7D2QLXY4Fp3/mSVhSdXTIK/Cc0yfaqrPBV8bOqkpVCQQdoValEt3Wzgvr+/d+A1vzdAtJqq9SE1HY5zzDM01+WNfLBaqzHx2s+FZqPpsPAMhG0a58gztw5KA93koXV7/agNGA8NSc6dkbDU80SiqX2DBGyEK6IPLACzQ== 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=InKboZipqUsKJt2itvVoXND0Mya+GeP3Sk0rjUoSLOI=; b=MSOC4AxCnvhUH0bxI+hVrTpPyuVFu4QzIsmeoqWhsjhyO0k+093686eIXCaNHtQvdKDbdm2tzeybSGhIeOsXrMg98R21hNEnJayQg43UAoUqdQIa1wuvTWODDzrF1+Yw1lzAyi4ro0tmdYdpnkfMG/GnAAbxIYFjSogqR/Gyzyz/UEUY9lskIn3IG6GrpAZ4gfU77pRZl0IgXVl5S5pQym1BNXdxyzZSHa2YyZv6pM5/oyh3ejAannHasoMqLMMcOklCcXIeYwnzYertP4GQvB+lvUqmR5MbnjyJsNKgs4yKJZfJ3hZfiShoeua68DjYSTno1XkpJIdOTjhljPofiQ== Received: from BY3PR03CA0027.namprd03.prod.outlook.com (2603:10b6:a03:39a::32) by CH3PR12MB8483.namprd12.prod.outlook.com (2603:10b6:610:15c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28; Thu, 29 Aug 2024 06:57:53 +0000 Received: from MWH0EPF000971E4.namprd02.prod.outlook.com (2603:10b6:a03:39a:cafe::8) by BY3PR03CA0027.outlook.office365.com (2603:10b6:a03:39a::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.27 via Frontend Transport; Thu, 29 Aug 2024 06:57:52 +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 MWH0EPF000971E4.mail.protection.outlook.com (10.167.243.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Thu, 29 Aug 2024 06:57:52 +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; Wed, 28 Aug 2024 23:57:36 -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; Wed, 28 Aug 2024 23:57:29 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next v2 11/12] vrf: Unmask upper DSCP bits in vrf_process_v4_outbound() Date: Thu, 29 Aug 2024 09:54:58 +0300 Message-ID: <20240829065459.2273106-12-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240829065459.2273106-1-idosch@nvidia.com> References: <20240829065459.2273106-1-idosch@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: MWH0EPF000971E4:EE_|CH3PR12MB8483:EE_ X-MS-Office365-Filtering-Correlation-Id: 310c74fe-89d9-4144-6275-08dcc7f7e6ca X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|36860700013|376014|7416014; X-Microsoft-Antispam-Message-Info: Dn1QRxnhaK4NhS/zXU0zeRfm8fzUcKiT0glJ1B3E1kQlsxotcFO4xWjyL087nvT3+0FDWf1fAxfc33/6sPfojMJkjRp0hyGMRKuUYLQb50vwMy/VyA28CSBcX5GweapZ9sDPa37NEUC+wpUOvcWGdyFTOyGx7DQMFR4AAMDk7bZrLqcng/cReKy41BJumRJLEvd65viaMZpkem4rIiT8Rh4IUK2fXxLmwb4sLBtRdoCADDD1qwjBrmIyh2eyy/yeZPyH2czpV52ifpXxkcll06qT/8PiwviSOuM77ogavhLXrS+kaCpcTMOuL4az4GJKZlu2QgvfhQuJZYuE01MZlt28q9hzAzXb/seBFxnRcl2g0TVW9/7CT8uSJ3ghXiyVclNxee6hfT8GV9Z4U/kWxkT9jo3qK14MO2KB0jqPOmfb7ofuRz1nSoLS0DpEirr+xJWNbyOmV8U999pnJn0GcgKQ/9pYSCQ4kTvQ66uyfmtaQgn4NMgwwIAxrhdQvv68DsTZc5kcRmmlZi1Pc19vFF+D8cDnksj6B7ff3l74z5BM3c2oipP/BnwPpb77s99Cdk6Iy3hUrndGZ1UTELUeYk2ebu6I0Ok2o/nd1ajP52Y7JAiZqSkyPX7GsSCLymFnvMn2VDaPZggCa/5uZZKub56OnRjc7NzvhpB79H4XqhGZCxjHL+1/zvdEl+t6EkBvVM0OKWbnhFlF+e9QWMApM1ySQnCIESPtIghnCIyywAb0wKHp1m3QfaaYX2N3rQHTax7C5YzHgVrL3waLl0D6MHszzlDWbkJOFKJiq+Q8L8KO26w8g4PL/y/1Ffd82N/phhgFQzZ0iJ4fQ1b36DMBWnq4qIYB1/LR7cDUPQ6NiNaXsQ7UdVCoht6o6M7F+4K+aOAnjNpWrnMpXML60xzQWmu8rjF0EbrUQ5UDdqBbX4C+OaFB6yciQy0MBaHhBHBGvMPLA/EaA/YcE/zuzpUQxW2PIlNh+Hsjpmmob4898/aBJAIa2tI2DB4Gjb9jyt4uzFciWtly/R5jQKqvxUHTCg666U4JpeLOAeLFQ39HFiTT2KvlphAEeKkNy89kS1ZkwGkwMWKghKSKf1rdYy0TNUxnrxxV5Jis/5Li7pc+WALcXDzcu6j6gzk10m0At6QvA6lQme0ao53RwXPTqauovWQKMBC5Is8gybakyVmgsalKtufZ4PqPxQwK/0gRKBiyfzNKRDW5ULtQbbr5gBRXsAR2H6Z7QBE3S5UbqYztMom3JBJ5RoE19j4eZs17S/9pFJUplOf8B3adZXGjEnlrqlR1JGxFaM6Fdyps0gLBbyad3FBvBWaZC9FLq8mE6zpT5OD27zqd7CIVycm/avcSBbKjo3uMJUFbCe4844BpH17CA5AGcMl1ORtpbcUbzeH1V8t3UySyXWwlGx90EAoSSBIv4vz2kpviw3ZczBt4mqpS13+3y5rvp7KdH3O9z2zI 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)(82310400026)(1800799024)(36860700013)(376014)(7416014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 06:57:52.1702 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 310c74fe-89d9-4144-6275-08dcc7f7e6ca 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: MWH0EPF000971E4.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8483 X-Patchwork-Delegate: kuba@kernel.org Unmask the upper DSCP bits when calling ip_route_output_flow() so that in the future it could perform the FIB lookup according to the full DSCP value. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- drivers/net/vrf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c index 040f0bb36c0e..a900908eb24a 100644 --- a/drivers/net/vrf.c +++ b/drivers/net/vrf.c @@ -37,6 +37,7 @@ #include #include #include +#include #define DRV_NAME "vrf" #define DRV_VERSION "1.1" @@ -520,7 +521,7 @@ static netdev_tx_t vrf_process_v4_outbound(struct sk_buff *skb, /* needed to match OIF rule */ fl4.flowi4_l3mdev = vrf_dev->ifindex; fl4.flowi4_iif = LOOPBACK_IFINDEX; - fl4.flowi4_tos = RT_TOS(ip4h->tos); + fl4.flowi4_tos = ip4h->tos & INET_DSCP_MASK; fl4.flowi4_flags = FLOWI_FLAG_ANYSRC; fl4.flowi4_proto = ip4h->protocol; fl4.daddr = ip4h->daddr; From patchwork Thu Aug 29 06:54:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13782660 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2056.outbound.protection.outlook.com [40.107.212.56]) (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 6245F15E5C0; Thu, 29 Aug 2024 06:58:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.212.56 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724914687; cv=fail; b=jVYf4HbarkpITkSbUwP7aoxDIz+InpTTSpZyCApk/tv4XwM99B+GyqCX65aZh1ROq6iD0dWJxgSrZPBnsHPXOVPWyacSNcEOTnBEELBQ5MaPlTUdJF4kDmfZaihFwQMAYMrJFjnPs0iH+5juI/A7+Ds6ma61iPtdghYvAKzpiDE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724914687; c=relaxed/simple; bh=5KTqU4JntSTsJdIhbrp6bHPxu/XXGn+lkQXKhaVfxFg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GiLCdhkCYCTUzu/Bs6+wZ5tGHVbNoq8NMO4YDQFDi+p/BU3NcJ0HMnFvJqu4j8hiIl71xx1XvdLpnH0UIA2zgfDc0ydnAMZhYk5iXLwUGeErN/39KwBLbbOpXaFL1AmUyXxh5qNeoWvNdHK589ksqq/sofgHV2Hjnr0p5mzdWe0= 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=SePJsqOL; arc=fail smtp.client-ip=40.107.212.56 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="SePJsqOL" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ouiTY5KumSy4NLIKk9v+DfuYGjncKdjhy8i/KjtGeDlswi+Dpl9lkbM9SUgFxMwwrfseFD9JmwGt/U7TvzgfmxWDlGo9+lECcun+I857KQZzHAhsnv9exb0TVQwQ9BZiDLs73vFqA9skHLCFkGI9JiDEKJGRo8G6ew00owiaoOl5jBnCOVSo/02O+xCuOV16W3KUwNjvFbM5JNO60lLmk3ou6u6FbwJMPyZL+0IaZHB/r7SLJygtd2x/0umcs7wrGxczHPJzCGzSNNUR31bs5XTnS9yRz16SeFunca1qX7UfNCMghSP/1hL6rfTizvgCNqFFnFIqV2CqtbFu/olHcg== 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=alonQpJ9HT9EaR2IMd1Oh85w1Z/2Rn+SvwQrGdHkO64=; b=h22rRvYcEF7xOiCBRWgrgsCI8y4ID5esxYFmRhV5p0pdcxWRlH6sW4Ll8zbI7pGsGqOhbBQxjON/64jOLxzwBVzm806anuCjCCRZlwjVVyaFXfIrYxTEGOuL0P/vNGQJsWu5FcpeARyomkHSC2JEO97UsyV4kGkmigqIQFgqKjFC7YSFSVFIPkD9byZNx5NTdMcScmJ1xsvAo3xm/WXvlfdQB7BlzENdxvqD3jE+vI4UnnkyKqGTgwvMUp5Z1QSlcyL3U1Fl37u0yQfZdhPdSwyBgQD07jp4Va/dKrRRqI6Zllmwr8CRmaOZksU8x2E19OhPbPxZYBJ0uoW48MMagg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=alonQpJ9HT9EaR2IMd1Oh85w1Z/2Rn+SvwQrGdHkO64=; b=SePJsqOL/RFYka8xhQ3BFmYzI/dpsRUsonRJPguEluTzgmLFitFXFUcwZQWu6UFBvvt1DSzdXFWVdZbQ/2cJLOT8q4nnvWMk6ZcMhVG5MM64ZYe75ab0KlbKmFtFGcSW9ioydS1+dsXApY0brR3pRQ+pk9wYFx7pWcCxJA48uONdrVNA0MtPfmoTeENvn2HdgVwRjNxRtlBnTydSs5vntOpOAvnQcuPay8rUhiE7zwFzC4A0Fq4wnFsaLpQnT4vajMn6dUHKxkkAgc6U5QeJDc1cmY6T6tvCuR7CZUo3A0GY2JBngZV+PxKznbzB8MxTBupFCQWHQcLKur5/Fs825g== Received: from CH2PR03CA0029.namprd03.prod.outlook.com (2603:10b6:610:59::39) by SA1PR12MB7269.namprd12.prod.outlook.com (2603:10b6:806:2be::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.27; Thu, 29 Aug 2024 06:58:03 +0000 Received: from CH2PEPF0000009B.namprd02.prod.outlook.com (2603:10b6:610:59:cafe::9) by CH2PR03CA0029.outlook.office365.com (2603:10b6:610:59::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28 via Frontend Transport; Thu, 29 Aug 2024 06:58:03 +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 CH2PEPF0000009B.mail.protection.outlook.com (10.167.244.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Thu, 29 Aug 2024 06:58:02 +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.1544.4; Wed, 28 Aug 2024 23:57:43 -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; Wed, 28 Aug 2024 23:57:36 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next v2 12/12] bpf: Unmask upper DSCP bits in __bpf_redirect_neigh_v4() Date: Thu, 29 Aug 2024 09:54:59 +0300 Message-ID: <20240829065459.2273106-13-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240829065459.2273106-1-idosch@nvidia.com> References: <20240829065459.2273106-1-idosch@nvidia.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: CH2PEPF0000009B:EE_|SA1PR12MB7269:EE_ X-MS-Office365-Filtering-Correlation-Id: d9de2095-f7ab-4af1-c2c9-08dcc7f7ed33 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|7416014|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: GNN6PQoxM76ekgYE01pZGVDotUKuNZI3i8nOzlYw8L/Zcw9Zo9ayUHuG3mThqWjJnf9ALZStNnGTejHdkzgwtlWNVO+5G4HbStvfWfO1oeiTaSsSiqQs5H0CdwUKCgdOT+rzSPf5tI9K9wXZadO3TysKQnh/nousOpgpMpGBsNcQwV1Al29hOldRyoCjFjv45uVUVud2NltLh1gITSvdHByAyAlHUtx3LkOLVHQ77BZU0aksMB38UiWvLw3254c2VX+HYDWwqbtUwpvLZecYpOra/QEP7/6EaaQ7c7rSffeGDMo/ocmBEj5RKyNM4zoj62DlKHvno/UGptSiQOdnEFj4jBzVeUOONpECi00hqFh69/MQbHIu5sMIcYG23nIP2uczR0tY/IRTiEOmWv0K4WpND6Ynk2g8u5QpuzeAx1t6kVCbgVnHieetjONek81w0/MPBIWWNFKHv8csgs3UrOHM5gK3GKMIH0dgVngVJEgr7oohtliPkeHoQ91cSdf2CgaZMjB317i9+J94c7Fnh9uUWP2o6z2YRlGMZjigO/Rw1IPMB0mZ7Ph1NWoMDACvbDtyKcbhlJhOgUiIAqzcxTWmS7+4Eu07uN7b/B7wFgw9UX9Wca1qrmbDKBgKNNsn7nmrxwl6UlM/X6belvwFJSuQ5m8eHVML1IEfXABXLPpEBvLVinfk+QPqCWA1SLY5SBFW+U8jk5dS6XqzoRCZkSazI20HtOIn3qIf5Iaqh++wsZ6jlboj4sLPUt9BT7CBAzkHm+1kB2GZaZAjdCn9cGv0kCh7Wncc+crdBaQ9QuqyWe0K37MkUBQ11NG7DKmZkiVZIIVUJ595Sout2YolcOINWzolRYdO4fmYD4M9lJmznZ7cWnYJgrtfW8d3W/uhRnAgB+86EHiW/3cqKomoHjw7GzMLa3CvvKihx1YQwuXnB5SrwElprUKBflmQeDZKKM7Xw12X8vgEkiapn7+L4rC35TFnQviIs8LZxK4bo9oew82SCjS48xGgNz4q+Q5xmGBLxeTJnfi5jI6cMU629mxopIFG1XautM3mZBCqcFrPbzox3si+ObuB+BoVnv8rLujc20MxYm83rhRuKErTlypvKJfyEXeVM1JVPcBbW83BOucqiR+UwLEYO3W3UZuE2+YcDK9G4mxHdSTYNgMFudizloQW+kH5cpfl/lsL6a9mgvSjseDCfgr8ru3lBFTH15VaT58hI5C/WWQSaSAbLaTGhGFNt42GAqCNa6a5uZjJ7I0Uf8Yyv9tFcjkHI1Vi+/vottg7nxHr8Bii1r0WNsvfx4Bif9BfC9m8qYXy0/FiZrBIodRVm2lk0rYNlhKIKX5+6vG+MC/8VmBxZWXBWRr10fyypx34AbRLwETcy5cjJU4wHwa+xky8SHlJyl5qfTOmR8fjkia6vFnBJAhWqaNQfV8nKc3Dh7xHZcS7VK7AbqsaB0XwIH7fU7yMGC01 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:(13230040)(82310400026)(376014)(7416014)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 06:58:02.8647 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d9de2095-f7ab-4af1-c2c9-08dcc7f7ed33 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: CH2PEPF0000009B.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7269 X-Patchwork-Delegate: kuba@kernel.org Unmask the upper DSCP bits when calling ip_route_output_flow() so that in the future it could perform the FIB lookup according to the full DSCP value. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- net/core/filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/filter.c b/net/core/filter.c index f09d875cc053..8569cd2482ee 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -2372,7 +2372,7 @@ static int __bpf_redirect_neigh_v4(struct sk_buff *skb, struct net_device *dev, struct flowi4 fl4 = { .flowi4_flags = FLOWI_FLAG_ANYSRC, .flowi4_mark = skb->mark, - .flowi4_tos = RT_TOS(ip4h->tos), + .flowi4_tos = ip4h->tos & INET_DSCP_MASK, .flowi4_oif = dev->ifindex, .flowi4_proto = ip4h->protocol, .daddr = ip4h->daddr,