From patchwork Thu Sep 5 16:51:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13792723 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2087.outbound.protection.outlook.com [40.107.243.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 16354C2FD; Thu, 5 Sep 2024 16:53:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555193; cv=fail; b=r3IEYhvjhd54TqauOnx9dopOhNiho9zllJcxD7wv9rHVdGFglczC5B4lRAnbUUxpIPaPhPrcGmQEs/fgPcTGJ+ZDGDReBiMaxqWkOwcBnBgl0ueoHYwd57ab1nHI/oBJ54Y5yvljCqPhvGFdsDhf+OjOBVxl+mhAp46XgkcEibA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555193; c=relaxed/simple; bh=kiMlZ9RWtMuldHNRBCPRQqoOwU3hb+OtntrXXKysTZs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FYvBD+Wsep9TA1Cz7POSFeBjN5EDLASESQPc9y2YN7HEqOKKHtXcu5YKxmYSZZES3hsirSeUJxFWrnXmvHBclOct6uadnLH8LuzNpO/GKUmQg8autKPvYXPz1NVhcqLleCQ5YAe6RRbov13a6J5VNUX+AImxhfyqmgwEjVXqOX8= 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=XpKUHETi; arc=fail smtp.client-ip=40.107.243.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="XpKUHETi" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=D4b8IFAQH2hWv2x+yiwrZPWd3U97LudyzvT/NsoY2mJ0OjsugtoqWIHAjl4BJ/e8ZaIiBKzT5g+4x2aIJffIxTNdfU6DGFVXi2xH/nB5Cjs1MjYkifCrL5TbGk/+Iy1DYh7KdWyX2Dsm+EHtPhC6KnJvqciJJf98zEkLC6ScyWjtasjwASiDuufIp0pA/sfAvxULQL2VzPpfWXpCtTi4KGENreJtvwdxM2mu9JEGdy9j1LNLWFVtsWYsLf2LeQCpdlOwff1bWv/laglGFT9tzGLjh/D3rhkM9mVbvCFKelasDKWT13AKOGWE98EOFYfF535+Jt8r2UC9yi4bKjHtHw== 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=IFhicse2F72kK5uCVWDWiw4PUDLAgCSYTRYWXZDZDJo=; b=iJNudiiqU5b+5ja75xgZU9i59YG+Tulnt8whXwBGtTNjsJJwgVrzW3VFvbLnt0jYRMubnIJKIbubwOekHjHrnvZfirjlSPIDOTnWK3ze5TaN0k0m25Nb2lTX5tNHm1u+cwOR8/uRKAWMcIgSoE+SPkDjP7igZgjM/jUEKWbZ+6ZVpIkPtR7yMD5JiQiFPN7eMt1eQ/Lbmxw562EqtLjn2nWToygaHyRuQpop+FhkrS1zKPKR+ActxEXFvANWqnVtnkjFxXHd8Pkva4FnUW65MxENx5DjESschHUt8DSESpC0ll5lYWGYB4xYK2ZS/Txs5TLI3yMcQTxNvvY3DbCe+w== 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=IFhicse2F72kK5uCVWDWiw4PUDLAgCSYTRYWXZDZDJo=; b=XpKUHETiVKu7DJguKTSGrtyd/VbE76CaMl+cSCaAy2pKKbVFlMBmCjuxkwM9HnGAS6XXK0ZlAGXAmurCQb1FLGC0iCtrKPOJmPYbOJARdDX2Gbvo7isBtd+icsqJdQWSGhtMfQJpo+k0ixo/jx1uVKl9NcqnazSNNdq9DMkJBKVB8W7G3uGnQHzphoS0Jbr0IIkSZOjLqHsLSQ8kWdcI+BdEC/zS/FX6lPB+oGKdi/MgBaSDzPPOIDjf2f+JaWLgP2CgFaqdQ9mFDQLhFvejK/CBe/61QRKfn4t9v1WD8x22/bKsn9RWQiJ+OVmrDKJl/8ESDMwgN9P/EPoBVeQT7A== Received: from CH0PR04CA0113.namprd04.prod.outlook.com (2603:10b6:610:75::28) by PH7PR12MB7354.namprd12.prod.outlook.com (2603:10b6:510:20d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.27; Thu, 5 Sep 2024 16:53:08 +0000 Received: from CH2PEPF00000143.namprd02.prod.outlook.com (2603:10b6:610:75:cafe::e1) by CH0PR04CA0113.outlook.office365.com (2603:10b6:610:75::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.16 via Frontend Transport; Thu, 5 Sep 2024 16:53:07 +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 CH2PEPF00000143.mail.protection.outlook.com (10.167.244.100) 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, 5 Sep 2024 16:53:07 +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; Thu, 5 Sep 2024 09:52:53 -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; Thu, 5 Sep 2024 09:52:47 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next 01/12] netfilter: br_netfilter: Unmask upper DSCP bits in br_nf_pre_routing_finish() Date: Thu, 5 Sep 2024 19:51:29 +0300 Message-ID: <20240905165140.3105140-2-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240905165140.3105140-1-idosch@nvidia.com> References: <20240905165140.3105140-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: CH2PEPF00000143:EE_|PH7PR12MB7354:EE_ X-MS-Office365-Filtering-Correlation-Id: e9827d8a-f80b-47a3-6a28-08dccdcb37d6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|36860700013|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: h8ClPmuaVKhHNfrKPc2Qa+aqbHhdvJK0Dq9Rxn/sPxVzEewAOYNW7gjNoSaw/TS3DLe8t7mn3rvR+CJDCgmj5w6ppCpd+pqIRyCRET59HwqZdBEXOWFfNB8AFips5wEP7AK1ZNu66eDIAooZBPMa1Cj9TUVQVxPWjM/NyIeWPd1FHeoUtxQy+5zK4BCbSWGtbUuyG2qBvNGyox/5mDPDpHGQ8K6sUgxplZGcUgw6HWaOpK+2tvqBUK1qP51ai+8VWpak3ypkuxMwoaZpOrJ9XXStaT4xk1pvMERAxWquMhaPdPNWmcLNJdeYJuo4Y402N0w4EXGzEdRagWhI1RSDEfKI8zlGl4vxvu4ffvBlec0fMIbU8n31WSX/lZjl0eZprO37Vqt6SEo149aH6Jj/B35E0dH/3l+s5j1NpBS4nN3Q9EtcL/1yqixSeZ9UMdd7J/57DAlJne5cCA4IppF8n3N9/XWf5iH8yAdYGzze616LDTCQvOKwF/qYgWQBkyXzrZnBIl1ztn55VV/rAvLw55xVKAAUYUerfVbKF9ivS8W+RK+Ks8Ezzakj+2hqus6jcHnMhPxzO1sMpRChEbFU3Rm3eJoAwl6MbFLrDasvgexU0LmVpVTxz/WssuntLYD4yh7VB0vH8SU2aB36vkAXpxyyvGgStgnszZ0SjHfz/UzVogoxgKeOBF98IPAj0rDRHL+TQ8WzMzunRwBHuLJqDDp/50GWdvrd83qe8vAlrUNzX+XIPxZC9MqfK5vWlopqrufJGyVJ4C/t9sIka+/E97pTEr6V9fAbNu+Unt8yGNFXQsBGtCYQgNzONlIyZGMkSNfXkOvSb+kBa5KciZedX7WlWrjB9oYe129knAPnKb6RlYngcVLCMnb0F41r4KyFRBWFI7BLtGth5XhdhWf6WutBwuGp3uMeR5ocnVvqDLDacW8EHjWrWd3wE25xTyMFDFacpJhgqZ+G8wRznNrlYt94QvDygASDsIVQqguCiq7pJU5ntmr/zBoxrSAuvyh9aB4mUzVPvOgJQlo6PLi9Vb7B7zqLK/iOsLo5T16SJhlIl/3+9Mh0TtlxrV48yCd6WsIdIZ0wWi4f1CbX4nLat2TCpYrbP9EX+5rzbODD3zwCvUQQ+fJpCGO87SfGaRR6tQOUvzVzEk4+NufERizAKbuJQU2zA1pgju5qYwVkZqE2NgFZDQ8baJo/OiGKMHZL3jY+k9x/xLxDVCoKU6ofE5F+tNJkQgC9M/Q0GB5O9W+RMul4ig0yF7/x4GYRSacL71KlcAnoxytQMllzc7HTFxrdfvvxASQ4gVzeAIPSpIxL+tNA5NAZnR///AyvzaDRUkd1OGUE+nMI6dmLfqd5qISosJUu/tg8oL3kkngVoA0NIcuFIHXbikkBJqVhegKo8TQHTy3/3cXjFylq5rvDeZOnQdgBzqXC5Frpu+WPjb9A++6cQyhpRm9bRLXvoX5F 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)(7416014)(376014)(36860700013)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 16:53:07.7059 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e9827d8a-f80b-47a3-6a28-08dccdcb37d6 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: CH2PEPF00000143.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7354 X-Patchwork-Delegate: kuba@kernel.org Unmask upper DSCP bits when calling ip_route_output() 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/bridge/br_netfilter_hooks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/bridge/br_netfilter_hooks.c b/net/bridge/br_netfilter_hooks.c index 8f9c19d992ac..0e8bc0ea6175 100644 --- a/net/bridge/br_netfilter_hooks.c +++ b/net/bridge/br_netfilter_hooks.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include "br_private.h" @@ -402,7 +403,7 @@ static int br_nf_pre_routing_finish(struct net *net, struct sock *sk, struct sk_ goto free_skb; rt = ip_route_output(net, iph->daddr, 0, - RT_TOS(iph->tos), 0, + iph->tos & INET_DSCP_MASK, 0, RT_SCOPE_UNIVERSE); if (!IS_ERR(rt)) { /* - Bridged-and-DNAT'ed traffic doesn't From patchwork Thu Sep 5 16:51:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13792725 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2065.outbound.protection.outlook.com [40.107.95.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 CDBBE19FA8E; Thu, 5 Sep 2024 16:53:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.95.65 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555201; cv=fail; b=k8zooPhVXM2C0m0fZbpzf8YU0WVlcH9Vsyw1rBFPswgTm02KujmiiBqy0Bg32xmwloT5VsVwAwbOK/uEXc1Cqjlr3fyFc/BiLYEanzhUXq+Ih90oTtwO/NDM+Hb5XyaakAsQaO+cNUsZjc4twyPiMx3Dhd+AV1rA0z3vEAdbhYY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555201; c=relaxed/simple; bh=ZdARP7gaQDFvqpaUePtGLCW1hiGJh1I8MU2922X0GLs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hZUoratTb6FcXN8Y/jmLDommaODCgZ9npd6vvfWZ9CJBw8ia8P8fPguZrTrywQX0rY4jhfQCRd8UjUF/jfxGNCOZgI3UJfdMiyB9ijltkdUuWDUEOspkCtdWMMGFD/Uw5VnhWnuJoI5x1qZ9MGlITzIoHjjNV3YyfXMuTxU9z4Y= 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=pg+xNElT; arc=fail smtp.client-ip=40.107.95.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="pg+xNElT" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=E1rBipW0bblB3YhtHVqB7Tp24q3VFsisueuCnfJzlO8KZkdHJShY5IaDVT4YKpUa/fUnO4n2PZg/kE62cZlqALw7jcPHpm4/udhPEQ59qH/0c9etGnXUFygbKYy1R1EJ9jNCp0bE61lz5anuNsDl2BdfcjxgT72yVpQPSHmEagq6y5YmOkWvDNfCqqhicJtHVYg2Pb9a28mHmR4+jTMOW7AcFH92D2IQel4w8xpFUoaZ4wGnnyQQh4Lr5ZT69kVir7WTFJI+EKMmZCCzwq/9dbU4fzwrAh7A/HBdaoGB0BMhd6xDd642sQ3r7EkpFCY9dIo5V0exI6KBFYQbSJb9+A== 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=9OBg8ULCo6Q62CHnr9sZBhNDIPBr9FwsCZxGR+Ys3VI=; b=K5PMT7S18TqbjxPPtnEhUsIqGVECSk6a0f7KyZL8JSZ9Mo+YLTTUN/bsPQyX2dqCbvc21K1hWuxZCgdJpkM/u20WY/S95itBztnQtEgwWlYO9MhaPwmHJ6zopE3PT1BrWqlfAKxpj7WJsWykOT3marB8Ide8HoDNbUWanKp+JZC3iFF4Icc/7YOu7CJwhYJjmQwEdwBDC004M8U/CcyrMWVx9lN6OcYZDl/eKyk5plno5Jeqh4l2JVTCB8LZhAlAVSJ/qxjsDcYSGgOmUtBCpA7QPGLGjekhVq+3m+LMHhQyM1JNdy4rXrL76UYOC97WWiPk6fGpTIf+VxHv24JvcQ== 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=9OBg8ULCo6Q62CHnr9sZBhNDIPBr9FwsCZxGR+Ys3VI=; b=pg+xNElT0NNbqik+49TuqZxT3JVUbrKJeS8nUUqdKuSnHCoqOqdlsczgmc3ruanavkei/fa/ieN7/UzYAX5/8sywl6hfdmOix49rv7JJkhm9TDv7JiNH4mKIuKS8riV2UGbcLnPNBhFTvuoVgdy5vzhoHj5XS/dPhCOq9dGwdvH0fzlErXp8TyvYBnyoIzgb1emuJgqz2DFLB7wZQj76SnW9ZStIrVaLshiv0a9Wb0PSgkg/tUSx7/0ME/5wSEEX77ZYiMuzZgJqKWDhc8Zyi/5dFQL1h5aQdHbH1EspGenEhCYNPFAH5sdUiyinnwVBldNmJ7OqV8ow118GDWo6vw== Received: from MN2PR16CA0046.namprd16.prod.outlook.com (2603:10b6:208:234::15) by MN2PR12MB4175.namprd12.prod.outlook.com (2603:10b6:208:1d3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.20; Thu, 5 Sep 2024 16:53:14 +0000 Received: from BL6PEPF00020E64.namprd04.prod.outlook.com (2603:10b6:208:234:cafe::2b) by MN2PR16CA0046.outlook.office365.com (2603:10b6:208:234::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.27 via Frontend Transport; Thu, 5 Sep 2024 16:53:14 +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 BL6PEPF00020E64.mail.protection.outlook.com (10.167.249.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, 5 Sep 2024 16:53:13 +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; Thu, 5 Sep 2024 09:53:00 -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; Thu, 5 Sep 2024 09:52:54 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next 02/12] ipv4: ip_gre: Unmask upper DSCP bits in ipgre_open() Date: Thu, 5 Sep 2024 19:51:30 +0300 Message-ID: <20240905165140.3105140-3-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240905165140.3105140-1-idosch@nvidia.com> References: <20240905165140.3105140-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: BL6PEPF00020E64:EE_|MN2PR12MB4175:EE_ X-MS-Office365-Filtering-Correlation-Id: b2c7052a-04ab-4af0-3b71-08dccdcb3b89 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: zUY7z5QPvdNAWSOZBU8lEf52gJ+zI+Y5YbURJ8Trw1JPZO52yjrDXbUyCcX6Jx/aeLb2/p6Lnc6vL7mnn7Bj+h9Gp+UgjKBUWNGWmbByRMx9NYyAcn5mIc7e7LiJV7EED1J7YoKRCH0QhCtFwTITC201Trdd/Ia8EgBvX/Zq/O+BGr2UCFfzkWH/3q2fUmdOe9Um3Jhcxqkd1vodTDcSy/mv8/Lsy70PHM09VZf4pi1Fe3khoD7yfiBhapR4BQeRRvrtrnDUkhi5zPcR8jhtgcPP0ULdPblRucwGdPVvWWkwN3xxV0O0Vd+MWJUM9gYDU1KPWe9BMSCgt9KaThAt//WHgOeMTOXGdZiemjdEjg4eLN1Nv3u2yQAm1ulvH27aFJ3ddRhK/eRKCMkWmOvizyCicyQxaUmh4HEsUQkSmeZ4758qKonKsyJoDNffAVyWz7wJHTJZ+eB+JVLwVkMWUef5lvtYifBu8hIo4kYMQGBsbwwwuYXNtiAlHeOhR83Msv4fFDkzCYCge57UeBZnZfosR9wqd5GUEToJ/HQY5FH1mw3aRilSEe3ZHUgCCsW9Vi+ey0/CAt5wOUsl3CBZQWLww0k5rsOkYE6y4rKZjZpTLfgdqw3WaZJJtGW/SO5fUGnjjhfW6Fd80qZBx+nrxW7OOkE2YneCNv7oCk5L/Daka8tLJ65gv2XS2tyL75S3WIZFzBN79EZ/NqQO+ndTfYVfCPMPNcGUr23+oy5tGLfhQRgWrrUmpgALMQc99sIhOxc1uz6Qb37mrCtM9p7dlKczaLKxcM7vF1eBzVEu4LKbYiI8ousk4smOjM8OxmWN89HGcqZi56ldLosb/Zy23ROBuz0w79TbezVlSyr3POyix4yx1hJ3aQO4GPJm1Cascm1GE2lxIEV2ZoW3OmEiJvzK9YTobLzx6rLN+ZE2Axhl/aCyJPRSSFj52MgmGBtyk2bUUREEouarmv+eKSmtcT60CsSTJZnG0Zb6TTwwPo3eyVda05vTMWMJTD7VHWRP3zKxOAib8KGfEnknxSjQbtSCe1D8Q29DFWyGSNdnUZtDIiXKO480DJVqW6aBJ5tuIcv6PwT6W1X+bXFjmSeuCNxr/mZd4F2NP/hU7E+Efeoit015FgV6eRezzYOIqeb5kTx2JBEb8be+pHmDQtH3c2bQ8AEWFAg1r6EMo1zXAyZBTi4LV0Z6bspa2vs/7C1EVVxqy3ZgKt80FWVETuwXQdnsNPyOL1AyYSrAqDO8QIHpbiz4S6zWv9pn1kR56AgudwktG5Hz8EUXNo08Ad4Pk457HMBOdSqZmlFlGuC6UVUblI26bNgoAUSeXy9fQGufHjc/S50L6V9WWTlu2yxQ6Xc0nvtym41AFaMxKzxTNop7SuH3La+VI1JUsq7hy4iju55pwvUO1PS2l7pArmCtUqnOweK8HGrpK7cBbq5hJ0R3fKtghluKQylSPMNtnSNM 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: 05 Sep 2024 16:53:13.8797 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b2c7052a-04ab-4af0-3b71-08dccdcb3b89 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: BL6PEPF00020E64.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4175 X-Patchwork-Delegate: kuba@kernel.org Unmask the upper DSCP bits when calling ip_route_output_gre() 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/ipv4/ip_gre.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index b54c41f3ae3c..5f6fd382af38 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -44,6 +44,7 @@ #include #include #include +#include /* Problems & solutions @@ -930,7 +931,7 @@ static int ipgre_open(struct net_device *dev) t->parms.iph.daddr, t->parms.iph.saddr, t->parms.o_key, - RT_TOS(t->parms.iph.tos), + t->parms.iph.tos & INET_DSCP_MASK, t->parms.link); if (IS_ERR(rt)) return -EADDRNOTAVAIL; From patchwork Thu Sep 5 16:51:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13792726 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2072.outbound.protection.outlook.com [40.107.236.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 A787F19C578; Thu, 5 Sep 2024 16:53:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.72 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555210; cv=fail; b=YrElOXIygj4xF8UWLmCzIstdf4WAZXpeLp/1EjXIibud2UTaorNfjhWFITAJH3lvM+Dvk6LF8/MKx+NBs6zQsqheZEW0qz4qYQectdi6y5xOZic5l6dl//NRFBj8prG6d+AMmec4NVD8WY7phjZoRUoj4LCEnVGYronte/4gBGc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555210; c=relaxed/simple; bh=cSrNHdHtlseE7Yn9X1eFH7bh6jE49Wd5WWlKBsgTIYU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KyC5p0CkkKFMX5zX5aZsE7GdIam0qvK29tCnGX6SJ3qNIfXDHq3lzzvrjCzFPcNy4LrFPonD6inQBS0ik0eLUCVwGTCgIpNoWfm3WyGn9S9VU/LkpHIZB1gkN9Rx/L1brwlcLR53aP6Jazkf05cd4rVNyG8Z0psNnA5V4tZHz9U= 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=utvxE/7/; arc=fail smtp.client-ip=40.107.236.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="utvxE/7/" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=B0FfI8wQUL/ORuJVqlgzyEFTTuPnbT/3mbC7xX3RcRAy8fTT2+WIxdhaGYNnptTC0JxY7PHjQ09+5KYwozaTDo2x5TwuSVB3kLKlSFwJfbsIf9tKBlmGMEDt9xPd1IWbnxcDIXzA7VzxeCH4RNW0jp+IOTbGote3A+byG6LepMM51GGlgjZse218qzFxc14XtWTJmTCCfEJTliYGDnBo9rWgImJkS6FSEQTL8LdOWXy4JYNQf8OQglowl2srCHNL9eCFWDneEI/Deq1MkivXoO2eMCTuHdhYYhVGFrMToyCh5llhT7AeZdfxf6JycdedGGqSw8z17GgEkEIjVSE72g== 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=lRMb+eB8y0wfaJODOjXOhQGzOrBnV64b9vMyAWLYuR0=; b=X5i+JLw0PTyyP6g3I6GTbALbpQ1cAJFecDNs1HOo1aAzb3ycVx9C7/V4rASXvIz/2rFpdtbi7bfO6Y6TxEtt68OsGOl+7xOnNO3cuXClOcMptWw8hJ6g4JOe2Oko+X7S8k3MYjWMMIONT7mrvaVkKHJvqwmkaC5BlnSSWuIKM0wxdkxXvbgKDXjWRUlccphwwN27j7LaTBk2m0R8+rgm+eiufCHLgu+ZaqhPWPjcIjbJeVBT5I14wxyy2NRsYFYBmSHGJsPK8uWJtQ26UuURPBw/EHxbHwMQz6G8EYN+jCZflzgpusCebAl6pYQoeZJd+pxF8puSzgVK/cVr5oH92A== 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=lRMb+eB8y0wfaJODOjXOhQGzOrBnV64b9vMyAWLYuR0=; b=utvxE/7/mIlGHArpQv7FEmRFpV7POInaumguGJeju6sgN83XshgtZ/UOB5ONWQEt+/9UWp6U+urERPhtZ0c2J4bGh7p/SI2TV4hc1tFbPfmN8H6IUnCyCSE6ThUl9k5wz7sTmjwBg7DDSiYwNatVN7VqmrEUajtcZouaS3KRGqnJeSiaMt/OfLu9wNPkbI/x6HuTuIFeyCJ6JEOq0HTpgDTMhv2oCkHPclSYEeXGUaYAN1IvvnMaKyC1UnTp8XRHtSRVPp0BHIfSx4aEWObMLNz7hA5bDLmRrt/FYPCTZP3uqegNqC6RQ3eWCc9a/nwZ1/zYTq4Dl0RhRn2CUiYrfw== Received: from MN2PR16CA0040.namprd16.prod.outlook.com (2603:10b6:208:234::9) by CY8PR12MB7658.namprd12.prod.outlook.com (2603:10b6:930:9e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.27; Thu, 5 Sep 2024 16:53:24 +0000 Received: from BL6PEPF00020E64.namprd04.prod.outlook.com (2603:10b6:208:234:cafe::a2) by MN2PR16CA0040.outlook.office365.com (2603:10b6:208:234::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.16 via Frontend Transport; Thu, 5 Sep 2024 16:53:23 +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 BL6PEPF00020E64.mail.protection.outlook.com (10.167.249.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, 5 Sep 2024 16:53:23 +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; Thu, 5 Sep 2024 09:53:07 -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; Thu, 5 Sep 2024 09:53:00 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next 03/12] bpf: lwtunnel: Unmask upper DSCP bits in bpf_lwt_xmit_reroute() Date: Thu, 5 Sep 2024 19:51:31 +0300 Message-ID: <20240905165140.3105140-4-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240905165140.3105140-1-idosch@nvidia.com> References: <20240905165140.3105140-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: BL6PEPF00020E64:EE_|CY8PR12MB7658:EE_ X-MS-Office365-Filtering-Correlation-Id: abd9a2e7-b96e-4d7b-f5c0-08dccdcb4158 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|82310400026|376014|7416014; X-Microsoft-Antispam-Message-Info: iLMwk3OH0Owe7TrgqlAPFRBkIHa+WQrIhDY8N5/MiAWPXuZI1xbLNSCdGfcoZncbaGDv15Kq2h9Xi4U1FOSiwD8dUpQv1fqH53T0BvtmzgOVSyJoOq0StNC8SKRmx5ETVd639QKK3gwpB4/eqYwjSc4Wt4Ueg/Jm8LmhpQ7Zfq+UFfE1kBEFcC/lYMfNQ7gOcFM7qzC+0eQYqNlxPoohCoUAUqfdpakDpaxtxBj6AwObGq6BBE1mWnX7FH8OpnYTgt3+d7uRsKuuv3lHsXpfjKuGWUCEIJ3Ipso1FHemx2kIbXbq86c/soyIGx5Ck213mKapkZGQxtZO2CZ3pnz3TbW+CkVd4m0PmVfLCEJ9ecJNPJXUJ8T+Gna3vcM93PTTAzgK1sNQ+AlfoipXXbrBAW0Z38Wej55VDDP3crkE7VoBxdCW+KrrASWfEiPRFreYME/J4d7leYHyk9CbNy0fVgpvJVBYNjt3PWEK2wkIEKfOw56RogEtBlvO8XF0zTr4IWWqsB7CekPb5UtC4GDV72IiX1W+QjH26MLppLVgi+BZKhjrn52mXhv0AX+n/ICtfic1yRK4LIyK/Dx2hWaDZQK54eU0iT1VXkCGr9Hdyx1jrigEuzYWTHnTDgaD/fIAhgL6zblvqjP8w1x8zvufZUngc4ewo9JgPj/5QdMRphp1XReDGuHG0a3Cw/0VisPrfzIbF16A7iRiM6n3vtubcKfSXpZTYcdG3o5F1GhWZytu1vF1gFrh1jihbDYTBf9MIO3D+n/9SIlLYUruqK5/RV4iGqJnOWYEXY8ID1Txwp+E/Uil13S0iEzDAxzsXZnq0G3wDM17Nwd34zcWnlxNgBnW/9T8A5o8VnEONMc+cuwMs1HZiAjAvJ+XJnE5xJwoSw+04XK0VENx2V4Liz3M3KXYIxQb60+PpchlLWNqIW/hAIvDDw/Wh+ZGiil+VBBrR7HXxWYbkfzXaaMyZOBGqLDaPxIvSYhoVlV7OfXc27P0IEDO2OWWTDtOOkzmf62p5dWSIztnD3QXidPrzHWzte/T6SWrHaCWLmJkkidF0akS7+BIdHTEzXizRXUp1dGxJVc5oQn2SY9WxkRux5DvaH26wjtPfIjCtyUfqnuT2y7NKMaTGs1kawfeMAWJmCIhQGrvadYUyHOPqtf9P3+CARvDFZlYxwnimGHQXlbq6ywqCS1zebJDH00hP4p7ywZgK4GtCzF/jMGfuj6Et/rj4P8r1GcYZNEoV38hLYQRqQYxlQvUeHvAbPmT62uyleVEHSeup5OJ7Oi02RGqfb6gCEA7dNt8uQjyjRa/BQ2651mgllIDHNbfjnmn48c1kDA+Fp8gLWOK5FAEwZSdzAQel5Mra71+oiS+/Z3I2haXIojM3fSf0s/BrRTRvTuqlUbqKUY+lNYP2o8LOEpGTseH+v9LmpuevrlboSO+6Qd/UWkUTvrgDb3cZMcztjr/Agze 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)(82310400026)(376014)(7416014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 16:53:23.6140 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: abd9a2e7-b96e-4d7b-f5c0-08dccdcb4158 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: BL6PEPF00020E64.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7658 X-Patchwork-Delegate: kuba@kernel.org Unmask the upper DSCP bits when calling ip_route_output_key() 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/lwt_bpf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/core/lwt_bpf.c b/net/core/lwt_bpf.c index afb05f58b64c..1a14f915b7a4 100644 --- a/net/core/lwt_bpf.c +++ b/net/core/lwt_bpf.c @@ -12,6 +12,7 @@ #include #include #include +#include struct bpf_lwt_prog { struct bpf_prog *prog; @@ -205,7 +206,7 @@ static int bpf_lwt_xmit_reroute(struct sk_buff *skb) fl4.flowi4_oif = oif; fl4.flowi4_mark = skb->mark; fl4.flowi4_uid = sock_net_uid(net, sk); - fl4.flowi4_tos = RT_TOS(iph->tos); + fl4.flowi4_tos = iph->tos & INET_DSCP_MASK; fl4.flowi4_flags = FLOWI_FLAG_ANYSRC; fl4.flowi4_proto = iph->protocol; fl4.daddr = iph->daddr; From patchwork Thu Sep 5 16:51:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13792727 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2062.outbound.protection.outlook.com [40.107.94.62]) (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 2D3031A08C6; Thu, 5 Sep 2024 16:53:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555216; cv=fail; b=k0iFaMOLbZkWuKE/5iRjS5FuQAb+fn3D+Huh4Hflq7gxXc5BGUOEuhZvZJ2/o2Ay9Li5/UAQuixpoE1B/txnQ5zsQ4EeP6fVK/KGOKtAF+tNxz3pVAVQULffshwjiXH3BZAnTQe9EvsugvSwovv4VzYt0SpKRQegJ+LRrhzMoC8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555216; c=relaxed/simple; bh=10VfzemEXni6Lu4wwgFefyGgZoovD9nM03xAdksIzMk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RioHonmiBEzSfPKCRkb6cTszWXANr+WcYdpMsN4zrN4qE2Gyv6704ZQBvKUm7CD0CRo9pFmWLNB0bJm3XfY4ffBsieIIBTUxF6E5Cz0euiombBjVet4qLreYrAeei8JOP0irOYnurA61kk17wIuOK/OTLPAKPtBb5L/yzS12hns= 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=mQwuq4Ul; arc=fail smtp.client-ip=40.107.94.62 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="mQwuq4Ul" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KPICT5Fe+Yfz/UQFYEAkFM0dkY8L3JBDqOau4zzY3Wlz2YI4kHPjYnboLfXACmMI3yP/sTB8WpsG7VYOkZvd8jxZzTdDi9PPLj4Z5LkGCUsUkydrMCAP+/uzJJ0YKjsalc5Fk91rEc7PCBqdD6hHERDT0DjD2gqDVtd0OaBRCiGSoQm0l2Q61QITpjP9N4ubjrMoq/efGK6DWv3NDazv3jzONz+dcMfwxBa+SBOfd4c6KGtUScx2SkWDNubgOXTBxqLMmr7a0YKdoXnzB2IkpHvlfv/XqjjuBRFBnJCYjnA9LUF5qlZo5oMoM54gYDU7NCbmP2Om5QFXdaZFGF3x8g== 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=MG1K1yIEqj32PZ8N+v5bIctZRsy5NFoDTpYH7Pj7+ow=; b=RH3+2Ua7KYAPsJnR8oaDaO9jjZnm89CM24OJrUn7rlopVBGv15IJ3Tzp4Nj37ppej5GF38tvD9c1NNMQRwSO9zsw7FEy2Ijf0BEfTELDLFiHUYf0BnPFwyBg5himDbqi9n9WPHHvhMRH2JWJLhl7Wdn7xYZpjwfZLVZnFuQr7KU+CLzqjl1EB9ABJBRlFxc2QdjdhPntbfdEVqUmp3GvwT+jmdnt8VGs5r5oOHL85NXkSr9xsZX+Z93FnokUctCNOXCb0Zfbvut7hnj645kybSDQq3gGofK8XLNdVu/lyOZ95AsWyEsh1+GJ9ahlF6mEnd3NgAMyv3Wu/7mSZzgKcw== 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=MG1K1yIEqj32PZ8N+v5bIctZRsy5NFoDTpYH7Pj7+ow=; b=mQwuq4UlQxVXixHvw1n0VNbeJl13Q3qT7fa18PIVQbMofMqb2sz//gdxW54iAO5/Z+6R6H3ngk6E3vtOVulInpAJPTXRd33gmyQXsqAveT0H0bbvrFZ4J7g9BM2dwmKsYi26HPwsSKlQEilPITwxK4ycxdI45AR+ry3b3hgxrBKsM916jSZMUQShClOz80JPU2BmnuChIqj3WQ96/WczPBXAtxWV2LRG6vBE0FU3M0eUcbMSR19J/yRQEhLsvY5byCOdJ9/RFRNVxX9by1qhIpFII02y1TXND/pTqo9P3ILeVEVL5YWqydJfz6IDYfLD9wvBTbltFjC6wC89dJGBwA== Received: from CH0PR04CA0016.namprd04.prod.outlook.com (2603:10b6:610:76::21) by IA1PR12MB8467.namprd12.prod.outlook.com (2603:10b6:208:448::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.25; Thu, 5 Sep 2024 16:53:29 +0000 Received: from CH2PEPF00000145.namprd02.prod.outlook.com (2603:10b6:610:76:cafe::d1) by CH0PR04CA0016.outlook.office365.com (2603:10b6:610:76::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.16 via Frontend Transport; Thu, 5 Sep 2024 16:53:29 +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 CH2PEPF00000145.mail.protection.outlook.com (10.167.244.102) 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, 5 Sep 2024 16:53:29 +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; Thu, 5 Sep 2024 09:53:14 -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; Thu, 5 Sep 2024 09:53:07 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next 04/12] ipv4: icmp: Unmask upper DSCP bits in icmp_reply() Date: Thu, 5 Sep 2024 19:51:32 +0300 Message-ID: <20240905165140.3105140-5-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240905165140.3105140-1-idosch@nvidia.com> References: <20240905165140.3105140-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: CH2PEPF00000145:EE_|IA1PR12MB8467:EE_ X-MS-Office365-Filtering-Correlation-Id: 39c05749-e054-4ea7-bffb-08dccdcb44f8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|36860700013|7416014|1800799024; X-Microsoft-Antispam-Message-Info: 3QZ/18Gj7fIZ3AG6Kcy55NFgrNj8xj+ur3DwNNohvkRDN1lfDIU/NZ4Ty3agtVEFpWeHyjJxweKo9ihQD2aM8tUGdaKQ+QVLSzgeyTgxhcMKtd7zSlqDoNqOHCqh/tnLVBxUIybCF6aWu3CATcQrafXNJfK+X9OICBXWBUbqu2UTOQnbtf0TCQ2W6IgcesGWKfhhXj9PrHcalnwpLVyBIcY5jTp0SLxpsRD9lTjzEb4fKg6XxJwrk35aMZI8SKO+KvQUnAiO4E9Ju12S9hWZiW1lNXsOlfpESBmc2YhZyo5m1Vv9ACGnqXMl7Z+BrWpd+wkb8CO0NTI17S2IYGlIHtBWWIkbiVtLrZS2+5428HKR48FvWUtTTyWYvGYv7p4XTbn7GVjt7xectHmWuaN8f/vwFNgOjDf7KYvTXspLswEYf0oCCg5y8iTft3sXLFn0qBnmtZGcmCfgch2YgvpagadljEW7quc7iEq3aqGwAl79veITV+MMXKO2KRfJTaDe8Bd8aO0r7bj0TluV6dzfgFlUjBhXyj2drnUbzcsjm50jUkS8P4hQ1VhdXT5gWbu9X3dKaCwizb7E34HLoBZp4yB5R2AOjQMAZmMs0UtiNmROfNx2QCrPcTCWnGU0XbiOPGJ1g2qxvBpiTIX0sw4HwwKGUPzV8FRV6cSTznnymnpo7AA8xuR5kPY3O6ytFsC+8qR4HLWUY8Pjp9UGXXYAPtPEqt0v7v7X0ubaINhDQUINvDeWc9+OExuPlnAe4vxPoOUvKOoThGIi59b+f2xhfr6tj4KQxNVu4bcHrB3CPmJbRTwCweUFQ+tNzv3ZETRClMcstCEnhS0f+7tT6Ptx4vAYYM9K4Gj/78MF1uPPar4aDavghELZqEhESiPbuGjVL0usLFcPi5WyaABSiNsk9MgYuK7ZVEWKTvtw7s4bagMPmFjlDYSaToab8hfE2Id+iZ8Hd7nTCSNxqy/Gt468CrDoRK9Ieop7nI2UKiZJCs/3Qq3Wixpw1WtBD9XrhUqAg1/cYhVrOtdJ8yRSqc+AuRQxvKzjfcJ9sLmSKLadlo4/tx4eL+piKbEEJJmRK4Fk9JBxG4RMdbwQtL0iMmRNpIwc4aCtSXZCVpgc8O4Gg4KbKB/4knquOFjsUHgLWlXGuIGM0l4o21jM9SH1v34PHgw38MZVg3luWw7z/ul5G5L/qhN+MAzoObO4uKQKDA7f1zkiglRXAt4ma7gzEQd3D8oxe0CyAaeetypitX7PPlL5jMtYPSPWvWzPaMfoewet/2NvGb1SgUwPIEc63j3nSwfbl7W4v+8jG8UIKyiVQfYiyIlDO08ST12QD0vM64DinJsXJ0WItWv3q3EXA+/LVaUamJ7FIDJpHu3F8kiR01KmvbOr7jtB7hDD8FGqhbfcCuBFmSiyBOLkI7k9ag2v58maknCXiWn6SUKY3tp8erhQK1LB30HOvMjJZCeBFGmg 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)(82310400026)(36860700013)(7416014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 16:53:29.7256 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 39c05749-e054-4ea7-bffb-08dccdcb44f8 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: CH2PEPF00000145.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8467 X-Patchwork-Delegate: kuba@kernel.org Unmask the upper DSCP bits when calling ip_route_output_key() 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/ipv4/icmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index d2463b6e390e..e1384e7331d8 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -445,7 +445,7 @@ static void icmp_reply(struct icmp_bxm *icmp_param, struct sk_buff *skb) fl4.saddr = saddr; fl4.flowi4_mark = mark; fl4.flowi4_uid = sock_net_uid(net, NULL); - fl4.flowi4_tos = RT_TOS(ip_hdr(skb)->tos); + fl4.flowi4_tos = ip_hdr(skb)->tos & INET_DSCP_MASK; fl4.flowi4_proto = IPPROTO_ICMP; fl4.flowi4_oif = l3mdev_master_ifindex(skb->dev); security_skb_classify_flow(skb, flowi4_to_flowi_common(&fl4)); From patchwork Thu Sep 5 16:51:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13792728 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2089.outbound.protection.outlook.com [40.107.237.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 C6C1F1A0731; Thu, 5 Sep 2024 16:53:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.89 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555223; cv=fail; b=ansk5msLkwtwuZX1bI99vaJhKR9AEQ6EfXjvpF1TVErMPYxhcP2ZyXqAW667/Bir+22JnroKou/KzxKxSsx1F2dfk0rZOJACinFRnC5PIZhY6sHoAFAhMR5C6FLPU3vr8trcczCuSppqYOi22lAYaEt5SM4A8s17nyyq5qIusVM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555223; c=relaxed/simple; bh=c43dXuOb83RTSDV55P5LoocBLzqtSKFlvO0emGQJCKM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Md+iwJN1fvTcDuFzRTt92PtC1sl/ME7nPbKlc97gUSoH1UY95tXFXAyfjoK/p/wyFB5SuAnrpY2mhjceCTLiGnsWR18CRjCY6+88FgkrYKkhxCD66EOPe6fgQT5t4XH40vmLP2shoILECse82vhjATw7sY/TMgD2LYWz2cu6Wv4= 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=MGyrYbu3; arc=fail smtp.client-ip=40.107.237.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="MGyrYbu3" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DqTNpNezA8cAmTky3iYwqzqKZOpYRzMNpQxdcX7mQSAYphU+pglSsa4ieEW4juUl9UiAmRJ9PA8OXFDfQilfJnVGl1NN5qNR9FRUdlKn3cEs12ssivxUb08svwYqxLIxkz2Xii6HhYdqh8wb5UM+rj0GeSbT/rfQTDFIAe+JOioMUEo3oBzoCOdArIswGRLeFWoJoIUrgvUPb/uNpFcbMDNmeQeC1WYywfMSZolsI0IdpAmQ4rXvdRZclHf4vlvolAw9G31IokjDCqrGK6Se+fZXajZ+7b7s4kYsAijsHPkZNyh1uVrBbJHtUM4tHT0UxE+iMXEheVzEB5/70Y73vg== 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=DGT/0X7Y0NBOOg0EEtgOzcOygPeeKAMFDwuGVROjGhk=; b=PFS26jZDBMbku6V8HLPX2r32f+E3pp0pUyn0XO4h2emOLnbrPZJ7AoGhxtXC9H249abAMo4H5EGuintRi2tG/wk4pRWkh+kcN45euDrCH5XAkU4aN2WeBoVm2pDiCNC8bRfByTd9VhX7zEse+tXCtZVXWBIP7gRTHwcWQzxVs+jRZPwD0pgv5KWpsm4bc6OP2rVm7uZKYge1vO+p4/rZvryycsVOazj2XvZJ+pxfcPap15gaQM4gfyKFUFMfHOzP37gVtfE2UDQGAJ33AroXyGNWb27nDHaU7rkte3O3SVIa7AFlEa9TiMV0WCote6bitQLMe1Ljn8Ov3DAr2BGauA== 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=DGT/0X7Y0NBOOg0EEtgOzcOygPeeKAMFDwuGVROjGhk=; b=MGyrYbu3wryaE9wle6/qxMUdvJ+rIaQ9cXY3SjU2ANrqkB/mEElm4wWmDAVg2Q5LPvVnzBVG/51EkwFaWpLaoJG5I3F5hx/9LeoIlFplTVBwtnVbJZMFNQqCCxEYnf6G89MEcC90uhcWA5Hu59NDAOUf6akXyHpjUTTqRz4qwvSpf8nWpei6uKhg5+RjFp4qoqDMlbkhupWoHQqVomxRG+rZ9wxIgafAFCgpeSm/xVHh4+vkh2bYM0lEmD0poyq3cQ7P2a3hYKA55F4ihVEiCKJda4ljZrVJE8sQEBbXpG85l2Qjx2q8bzxNhXsHQm4syAcqmAdGN0AKrS8UgzXHXQ== Received: from CH2PR10CA0027.namprd10.prod.outlook.com (2603:10b6:610:4c::37) by DS0PR12MB8413.namprd12.prod.outlook.com (2603:10b6:8:f9::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.27; Thu, 5 Sep 2024 16:53:38 +0000 Received: from CH2PEPF0000014A.namprd02.prod.outlook.com (2603:10b6:610:4c:cafe::e7) by CH2PR10CA0027.outlook.office365.com (2603:10b6:610:4c::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.14 via Frontend Transport; Thu, 5 Sep 2024 16:53:38 +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 CH2PEPF0000014A.mail.protection.outlook.com (10.167.244.107) 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, 5 Sep 2024 16:53:38 +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; Thu, 5 Sep 2024 09:53: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; Thu, 5 Sep 2024 09:53:14 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next 05/12] ipv4: ip_tunnel: Unmask upper DSCP bits in ip_tunnel_bind_dev() Date: Thu, 5 Sep 2024 19:51:33 +0300 Message-ID: <20240905165140.3105140-6-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240905165140.3105140-1-idosch@nvidia.com> References: <20240905165140.3105140-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: CH2PEPF0000014A:EE_|DS0PR12MB8413:EE_ X-MS-Office365-Filtering-Correlation-Id: 5e945d41-9f6e-449f-4332-08dccdcb4a32 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|7416014|82310400026|376014; X-Microsoft-Antispam-Message-Info: H8g4/aJ/AUIMYu9MJYrp/06Y5elrVKr2LIS7QSzs8SA5OnBtd9ZNTpXPvjT5SLZ+kK12veLkUw6hx/gHruvLGBex7eJDuA3KJOvmGOY4X/A4RANqPtyAhlSI2G70L+gTFJeT94SVi0sFuIKbdaSB5+9QczexdeTRL5SrV5B30WVqYU54XPOw/KYrBtIYRomU8nhdeuSqRi6HXpRo+ytGJm4ghLUIUrn69SxdorhcpQnkmcUIG/eE4bASdpx0i9doPEf0SZtqqc37SxOoYDTnJF2MV8PWAxXOnCBmuVgNWsLoNV5bqUis1Ek5llPmZcqZMae9VBVQjUkiMcD/cZLaNUJSDW+qYVYfyA6jC0JrMcGGQ2Vq0AsVRgDOYw+P+KcqDMEzxWKD4sEdGWgmHgzGEvtcqIJ/+Zy4p3imdXS1WfuWWimYajPNt9YI0ew0M9L6HSgmVh3YWCADR+sWJOihTcmwtJMCyQVe7vOVLQ/cVxYkjKQLeXt58cWZd/11rZ8j7hTKwMXVS70EPA51J6RfXvFDeDA/nnfQOjIZQ1XQDcdmcmDrkkE31E9DonGsP9bKmLX/EDZRHHM+G8axy1v6phRkWrJugvP6hxisFFUXlH8FNtBju+RPs+sXBY31Vngg/fKa/8piYRm6DuvB7ng7fKL6q6wwDUK8oSGQWTIfaw15HtCcsr6TeCWvK7SLnWsZFfzsU8fnKByBfwB0ufUEI5ROdPuey5CcwY7GZ1R1NBLGaUugsMHD6rSFoZ7oimB8NLWtQoo0t9ZUf1foYs7ccOb76UF5YpkZ3O+7p+Dv3F+RWutAWldt7+rgUX3fYm/r47f0o9CA8tS65ipYW3yOZnHhoz/5vsHJx7DcuCEh6D4H8kItIiKaHOBXVoa0fuU/3G99IeQRMgmJB0xxjkAR4IP4d0b2NAxR4qoA3/B4gO7JsGmaYUOZ7PH3XILw9dOz60bkfD395/LOReEB59omnsO2O8rOxgSfksuS/q84zFg94YESi8APMHtxMH1/2AlTzyHQtL2yDYd2Wy/EcaI0H/s5YlltbWZwqAhdLbIYVqDcjxsxfKSP2oAJ1gXeh0J0PqGFnxScLUkxTjtub08V1rVu1e+JJY5tziv7M1JkIx6yysmGVSQ+Q9OfT+KCDGBFx3HD1iZ66d2SWKoV/0UHoH2Fdoo5l/VwKYds7RXTzG9jiRrCkonmXFfKbEkgQuD7sLYyz7CpEOZKqewiGiqCyFEjqcYAFzj+ZzGihhRuSpttCY7pbN6wxUHficlDsK39LJVIgBPryjj1UlSdCldhFUfu10auPyuTyltbLNBCWH4Hz8tXo/51VlYV4yUnN2wJHeFQame+P6x3hC+vbIdae0ieA5IS/7W1jGCP1u5IMWLpe6n8vDDNgbKXFr7jIOM9rHyjMcxRr9sbqXfx+Q3D51cMF0bAmBqDQvVdeDtAp7gdbZMyGoHfJAZTQxpIEI3o 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)(36860700013)(7416014)(82310400026)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 16:53:38.4912 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5e945d41-9f6e-449f-4332-08dccdcb4a32 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: CH2PEPF0000014A.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8413 X-Patchwork-Delegate: kuba@kernel.org Unmask the upper DSCP bits when initializing an IPv4 flow key via ip_tunnel_init_flow() before passing it to ip_route_output_key() so that in the future we could perform the FIB lookup according to the full DSCP value. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- net/ipv4/ip_tunnel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c index 18964394d6bd..b632c128ecb7 100644 --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c @@ -293,7 +293,7 @@ static int ip_tunnel_bind_dev(struct net_device *dev) ip_tunnel_init_flow(&fl4, iph->protocol, iph->daddr, iph->saddr, tunnel->parms.o_key, - RT_TOS(iph->tos), dev_net(dev), + iph->tos & INET_DSCP_MASK, dev_net(dev), tunnel->parms.link, tunnel->fwmark, 0, 0); rt = ip_route_output_key(tunnel->net, &fl4); From patchwork Thu Sep 5 16:51:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13792729 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2076.outbound.protection.outlook.com [40.107.94.76]) (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 7110D19FA7B; Thu, 5 Sep 2024 16:53:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.76 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555227; cv=fail; b=GczxZ1cR1Ufn4aS0LZy8Cncpe8X1h6u8MnE0jxSxwOopX8tHy1T522Vv8sZdAoNjajbSpsEtkpq2Kge8CLL9Twd9uA3++maY/8hg4L73PGj6bLJcpxuL/wNkub/vs24vWDxExZEwREotzUO6A8J6+BuoCositsxy3F7eFCmapag= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555227; c=relaxed/simple; bh=v2hI4qYUxX1FaDEygs3k3UoKkG1n2O4w4Qjx2zWE3qs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=e91WAj0HlUPcEgG+xWoeiJnTS8o7sQHL05Y8DbEoRXXswETvNQrRqtsT1lszq7kqWD2cAGreO4ylfw/n35dlcJyaq5Yzn/XrAQCGxOKp58gRDntZVW6eMljsp7xaYT9ZHTKiplfwFARYDbSKeqH6QAMaeAyiitZGvvS1/otXEzA= 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=IoL92wEt; arc=fail smtp.client-ip=40.107.94.76 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="IoL92wEt" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NCy4j4HOcWhsxWJUXD4+EbeMMV/RwQxuI4sMdZQANK0BXPPixRMFqdcdKOsbIAD30dT1iEsiHdr/VOSp8H2zcplhABdF7hy15Mnu/JUMtF3dhU6BoY5IJYYsh0P/uaYEZvGjhXq9yOEAw7p9AIKKgciyuY08qb6yaCVUc5q6h6jyL7MjwsYs3xPsf/2r0TOSTjZ0oLgDozvTELs0Xavzz8LHz+Ny8j2vfuZcMb9nLZDtVBQLLlC40XybV4kyXmFFCfZwpPJPKnVoZpIetO5m+O/T1tdf8yOntffv5nC/1N4Jt3WIupoPSA0M8InGZCRlaDSginQLmVYG+WrC3V0X2Q== 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=G8usJFygsNES1ec5uqJ644YVwThc/z/TcvpZKA0++d8=; b=sJ/W3F8QsKSmoGPUYA2v6wkZTiBs+sKFB7UssIxGi/SNZu0s34YRhhIXoSd2/SlUb73rN/xCbTK1lFzpfbAY24X3AuEkWRxyXkRHS4qfXSiwZgKswEOMmIvO6wEWr/V2zaBcjqJiYKgDGGMVrhyjmiP6xVK6CarohiqRm+SjRoY/Pzw+HkRNvFd6Sl6grAuV+7CPIJxRriFV8Cl90jS85bKIar6ZL24Oz89TmA4LyfvgAdpWlZ7A3FLJIxB/V2jMlVsu314BL4XZix+45JswBTPao0vZ5hpxYrFACvsp4igHm1QiXT0NO05oIXsN5/ljQFbPW5NtghrtBD+k2PzplA== 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=G8usJFygsNES1ec5uqJ644YVwThc/z/TcvpZKA0++d8=; b=IoL92wEtDpOJV5N53p5Z/1qsjWkDL7zqn/Uz3nVA1bCl2occnQhV9r6kpqNsBixh6mPxitOuTkEVbG9sW3bG86n7TDRVY2OC2X3gQbI+V5xXlDYcdARppcOq5i4Cl1GvuVDtKHujZjNv09mTFDh8h10lH4uXPDqCy479AbFNdisfu3YNdyMEGPP5+vcV9Jzu1lSCrNsfakex5IWPxqBlcsSMtVNgOrgnrkz78VrPa8WT37e1BZ3hYpXHJxRNsT4uqmjOz2i1VFdGhKqG6w0AtptZ8G/AXvPiazhj+apP4mWlzflruXj/yyiAk0R8FUzarterl/5QIiCU9XWOL3bNFQ== Received: from CH5P220CA0019.NAMP220.PROD.OUTLOOK.COM (2603:10b6:610:1ef::17) by DM4PR12MB5988.namprd12.prod.outlook.com (2603:10b6:8:6b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.28; Thu, 5 Sep 2024 16:53:42 +0000 Received: from CH2PEPF00000144.namprd02.prod.outlook.com (2603:10b6:610:1ef:cafe::ab) by CH5P220CA0019.outlook.office365.com (2603:10b6:610:1ef::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.14 via Frontend Transport; Thu, 5 Sep 2024 16:53:42 +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 CH2PEPF00000144.mail.protection.outlook.com (10.167.244.101) 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, 5 Sep 2024 16:53:42 +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; Thu, 5 Sep 2024 09:53:29 -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; Thu, 5 Sep 2024 09:53:22 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next 06/12] ipv4: ip_tunnel: Unmask upper DSCP bits in ip_md_tunnel_xmit() Date: Thu, 5 Sep 2024 19:51:34 +0300 Message-ID: <20240905165140.3105140-7-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240905165140.3105140-1-idosch@nvidia.com> References: <20240905165140.3105140-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: CH2PEPF00000144:EE_|DM4PR12MB5988:EE_ X-MS-Office365-Filtering-Correlation-Id: 809fda69-0546-47a4-717f-08dccdcb4c8a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: 5Y46brMqadYb1o0jyWhfHs0jPHfhiqdCNkTCJoxOvF42tOxZ66OFVZEsSG4oyAgSL52wGLD4CtIrEmNLpbWcYR6hBV9vfKDU+AlFjIOizjQnwGwFhcxTqsQQMmQ7A8UmpI+hHR02cUwdHfNi21zHl9deT9678GXBayJfKGSGVo7B+NUfyO3srHap/kr4tOdeyDocQeW1Lpmez7NKdhx3xqObRYBJC6SNX30PLfcfZbnZdnQV0/Nm05DQ4xMksE1SvEIa3upGxHJ6S7pNQj2eF++nmd0s8kF7hwUP52iqMacM0eMEFHUM8O3+BGXYT306xkClAP4mYLUDUGuz/v4Yc7WgVOc0a0wVtiyrgTuRrwFBUAADzIS21DU8g04/7RsekiPGO+7t4mnatVssX/LTyFil2YccP1hYnaWO5H1VJCySbQ7m0cuCCPt/tljDhT8dbxecitDpLCKYejBOCsQ2NUTMeTJvPIYcqw6WgPIXBykgjwOnw5sV6RcMXxyFslYfacU0J0AV1hMyzaau9EFybzBXTSGBfPZT4FdMvP7NW8PiiD/a9MJ4H1rjWHiuSFvdhtkpnt+HXeG4Q/SfFlGZr8xzRwhC6DSI8szWYsPZ7TSwykfnRQrRn4S3M5FNoZ2vOysdGUVNKFEuqETQyidAgXQZArxZEdgVSZjP2LcqJI65vt8UxG7yxzeqpXQIF2XpVyPyOBBagnhgxR8+PxZ65JFQQp3/8Y7kR4pFOOvtvBEqaRITXj6yRn5kvF8OyJ+4NCG+bOQ2NfzzXoc8ycelTfSzR8Mp5DyMoCLX4GwzFUw7HASlS2zfe+tQEiIZrltqaF6Am2rP47PRoWq7rmcxgX51rD6dUoNNQUWUvr+QYzx4+BbZjg82Dslks3sn2xJJ6y0UAHzNL9V6V1x0fieWC13O082vxyLS+hyeeUkZ+DTI783igQ1Nsc0RLyp/1enUlGctZrp6S1cu/Ysbaw22ORR0ta6tHDggXY+UrXOn5fddwPlZVHhK+bFueMLtQe1/b7ZTtRzw3U9GzPQTCoHJG0Ld9/+x4McfPjJzit33unVTXBpOA/S9STBehXHdWafia2vcVbJIrlRsU6Zzn/vdG+PQ5IyuB/+RV5c700ujegyYhsCL9A2akGEhKdMZgsZboCMWDT2slaykgVhdPjS6BJvdFcJ2GmAil9elUrtgrHPC/iKMVqqBu/j/JzbsrE+ZnGbxQVtQTINfQ9WyRJLgf/CN8k62LRBHqVyYSohJCYKjmi/9rVtwap9TUOQrM3UbeGwGiCZ3iKBWR8dnkmEHDTV1hvdtGsyKNrXKlU0drdGpQGqBfavANOnxvojutK42SSte9hx1TjjiMVX8iL7qiToNrG+cgMPIKoQ8NhGH+JsAIjzUc/zz1+FamDX+v4qe6OPJ6zIcZeJ18naONk2uK7mbzkG+ryoHgM0DOp761kRt2U+ni/dMEox+0TOsfytY 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)(7416014)(376014)(82310400026)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 16:53:42.4089 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 809fda69-0546-47a4-717f-08dccdcb4c8a 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: CH2PEPF00000144.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5988 X-Patchwork-Delegate: kuba@kernel.org Unmask the upper DSCP bits when initializing an IPv4 flow key via ip_tunnel_init_flow() before passing it to ip_route_output_key() so that in the future we could perform the FIB lookup according to the full DSCP value. Note that the 'tos' variable includes the full DS field. Either the one specified via the tunnel key or the one inherited from the inner packet. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- net/ipv4/ip_tunnel.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c index b632c128ecb7..09e0effcd034 100644 --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c @@ -43,6 +43,7 @@ #include #include #include +#include #if IS_ENABLED(CONFIG_IPV6) #include @@ -609,9 +610,9 @@ void ip_md_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, tos = ipv6_get_dsfield((const struct ipv6hdr *)inner_iph); } ip_tunnel_init_flow(&fl4, proto, key->u.ipv4.dst, key->u.ipv4.src, - tunnel_id_to_key32(key->tun_id), RT_TOS(tos), - dev_net(dev), 0, skb->mark, skb_get_hash(skb), - key->flow_flags); + tunnel_id_to_key32(key->tun_id), + tos & INET_DSCP_MASK, dev_net(dev), 0, skb->mark, + skb_get_hash(skb), key->flow_flags); if (!tunnel_hlen) tunnel_hlen = ip_encap_hlen(&tun_info->encap); From patchwork Thu Sep 5 16:51:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13792730 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2055.outbound.protection.outlook.com [40.107.220.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 196F01A0719; Thu, 5 Sep 2024 16:53:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555232; cv=fail; b=n8Ka0R0AFyePx1Nf1NyDrmU4gKNcvv8+yg04m/7ty25zTrShHT8B46UxqgdoyJXiGVKIm0w7Dyg2QEc2OdE+VgAJUt4CSufGVk/O0O+jaiTQYQtE2vnT5IR+J5s8tTd3PuLytb87GtvQOuoyxTGKH2fnTj0t7TuXcW9xNrDHae4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555232; c=relaxed/simple; bh=rhaTMcj710LpjcIgxqXFf1b5EbTypgnIgk46bddlvw0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SCKB15i7Tdw5eb7UDMYKQ5XKUT0Ek+RmJn+Jis7aj/M/+6J6qP7S4O8y1sJ+NO5M1K/PvDU7cj+VakuWik6hgwDO6BS6sXjxyqVXpCcssBWw7v1CVz6CIjjAt5DaokaAotUUKLOTkhH4rIvZ0wRqur1h9LACcwMRuQG0oXO3JB8= 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=pvTI1+vD; arc=fail smtp.client-ip=40.107.220.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="pvTI1+vD" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sUN6WGdO/fc5PnzS6IuhLfJAfvgAnHA3od6tcEOXOZEo7nP7jREbcbgET9zwS4z10BTK4A/zas7K0Wy8EuaSdAmRk4O7Sdun/z1rXZQz34fVNRyt4KwoQS4YrIhq7caBl+n/9r40RwnQyjefuTegPDwtNHTc1ddYNLCqN44SQ2jbWXKQA93Weo7UjfEeQTk6zpImjYcxXJSeWeKpbV8WqMk+FswUfq/OeGor0sF0SclfGkVTcdKX4O6CY3y/67S+SinDf3ZFIBprKix5S23s9WpjYhsyUW0oj/auHaiAGox6uB8jYWMjk58mSI1SDgEKdHHWWZ/4YtILxm7Xpx6xJg== 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=5DWp6Hvk7r+d8v59uhCYjuBx1Ng2bV/VbEVP9jBbyEw=; b=F9q7e6AT6BVnllJvwcheiIQMAwyvAC/wRDEkrSIGG0lZiSXUwBon5az+TVQjvIi6mJrMDaekFU59vZ9K1Xklx1znuURCkbx3LTR0zJN8kW8JftvcQDeoTr7FQbvYH8mSNXTSJE5ytYSjkCbog5ACz8xmoK5BLx5UyvmHRCRi4yxkOkNkL82DDh4f7afoLNsM1EDHfCfA6kfmljl4MNGcLHrGQ7eT9eIhZFa7/tV4Hildqb7iXRk2jbsLoXVYl+NTyhqD1ZmCuKGecDlGFvGxwtAUgUKownEgWA/7svRASsvknQqvjpLXOo3CAWYVTJL3gPUhDRKIbTFYM15/wkFw9w== 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=5DWp6Hvk7r+d8v59uhCYjuBx1Ng2bV/VbEVP9jBbyEw=; b=pvTI1+vDMu0KQ870MlWvaxS0o2/gEK/2m3o5VQ2v779gB0DVyQJOd8Z9edGi5RBuRgOqU8H+AQkLTOBF1z2IouBUSc+dHq4VT2dvJUZYeTjylqus3dZ29v0683vsjLXl41iq5o6EYNv959u26k/frIc0QJx8ua4v9flMZ11gAjJ5tGzhniC9gszwSBuGD/ku7j8L15CtAB8DLVMlT9qjk0IRs+Lc22L4GERSFMbeGusM7DtyBhGAPa2QYqYcOot3s6dgfiinLdSbWCdPlkNhaVGVMjp8gpdDofCln7Xx3yXEySZbMCOAarpR306jvWZc2uU5TZwhtTJamW2Tn/TyFQ== Received: from CH0PR04CA0096.namprd04.prod.outlook.com (2603:10b6:610:75::11) by PH7PR12MB7428.namprd12.prod.outlook.com (2603:10b6:510:203::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.28; Thu, 5 Sep 2024 16:53:47 +0000 Received: from CH2PEPF00000143.namprd02.prod.outlook.com (2603:10b6:610:75:cafe::fc) by CH0PR04CA0096.outlook.office365.com (2603:10b6:610:75::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.14 via Frontend Transport; Thu, 5 Sep 2024 16:53:46 +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 CH2PEPF00000143.mail.protection.outlook.com (10.167.244.100) 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, 5 Sep 2024 16:53:46 +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; Thu, 5 Sep 2024 09:53:35 -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; Thu, 5 Sep 2024 09:53:29 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next 07/12] ipv4: ip_tunnel: Unmask upper DSCP bits in ip_tunnel_xmit() Date: Thu, 5 Sep 2024 19:51:35 +0300 Message-ID: <20240905165140.3105140-8-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240905165140.3105140-1-idosch@nvidia.com> References: <20240905165140.3105140-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: CH2PEPF00000143:EE_|PH7PR12MB7428:EE_ X-MS-Office365-Filtering-Correlation-Id: ba8ddfde-7a35-42ac-cfb9-08dccdcb4eae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|36860700013|376014|7416014; X-Microsoft-Antispam-Message-Info: wtbK0weEkxXtI/mFlkmEN1NpVXzFpR8XReFCpXsYXqJ+2E8hPqkFlFgISLXIVMWw2b/PhM3FQ+LdpCKYa/qCvlC1t42i3hcCkGHa225/QU9Zyh1fqNWCh269lmFGak0A7yBjbaFkTq33PL+n05lwYAP5LFU65PSuGgi4HGY3pHc0hnWFg6AyyhC40UHOmXcDwxThpMefQD5H+VcsExDjiChhURcmdGYzqbsl0w7Zb8svQ1ghUcg3c2dwU+aP05xY2k8wA594CP7gCPAiIMZDxGMm/XTeKnv7bNQAg87B+pBB/jJGV7dNFqc6I05c5ARMK3rgy7PszOytiIvAkbU9p+fDr7Xtmvs+uubZTE8TNvx66J1hCFNNkSY2Il6cTLocIDL0hFn16om6L7QLaSn3pSa4U2GAppNA65byl6nimMYhN1B4moJm7xqMQgN9uwX9XFOSlQDYkt/2+/ZDIWZ9mNdFCfkKiEVG6V0q8jigt5d9qktyZ339efhaiwOfurEoYdDx1agqukyCcQjJisr09Zbs0jOjEzSjPfvVJzzfkDrs4w52FKiRxg1wPwIzVxpA+MUPowSLOIAiOJNaP7Tz7Am3oA5rQeUaOpgo+q50S3ZmSxX4KP8/ZntmnHO3r/dcfkeYkoqNC0oWsev03lexmPfTRy3cC63rBtdqNlWFUXY96+mnDdm6o68G8GBgbxeP7w4bp8jA3W3TyM72/KIxe0QgqxnYqtOERKdYJ/IpDhbeBoLzzf47nnbIeIykss+KuDK+IfGFtoFrHPtdqVS0uqGjfDk9Mu/QJoX90FXcZB7TmYHJmYUrcUZwmGnLND+lymTEOpE86DvA5CBUzg6pwhI8gfnkF+o0MiXkDlEGCZBUx2UV6eTQ1cgwORGrU+98vus0RDOAvwyUpJQDaIRP1FOadGrZ2IxEOWDHMojQrBu3xKGgkBmB1wjcF9W5OoRLw5W2K7NKbIAB1GcTYDr+qbGAZ+gfgx7Sew7h89oLwc92zFdGN337atruJf/G+CeCWYjwkb+kOh+q6hl+VQqnGTo79Howd0m9UkK4bzLoj7JCYkLA2oX9SJ6LYnyG74GUpdtrAoJFuw6MwzXvJH1/SfUhp8qqQqmU6RYZOqHyguv14lcoyFeGmvseOuqGZrvlrHjQsM+ywqbhYBuZ0q6l5lw0Dn0hZSbVjafkeZWvEgXZ/jkhT2Yx2Trz9WJ3zYMJkViNvI8VgUlsxe+/mCLYmRg19YKteyJRW+qD+FOYBKiPxFMPXRm1onETotbS/ZxFr+iOd3ednsMkvK5nDhyC6tkaNs/acoRwooTEY3vfDDvzmXw1LD86vWZR67ZyEf6nGQnFqLkGgBcvP4+ehUSJ38nOoBrIK6wjk2QqknzhdTYk+gcCf3/y9UDLMnLIgjxUEtqyKv8+epJl14XSRiUUeIedyEVowLS6jSekoPiccO8RblkHpzeHmTaQt+oBP2PE 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)(376014)(7416014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 16:53:46.0027 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ba8ddfde-7a35-42ac-cfb9-08dccdcb4eae 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: CH2PEPF00000143.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7428 X-Patchwork-Delegate: kuba@kernel.org Unmask the upper DSCP bits when initializing an IPv4 flow key via ip_tunnel_init_flow() before passing it to ip_route_output_key() so that in the future we could perform the FIB lookup according to the full DSCP value. Note that the 'tos' variable includes the full DS field. Either the one specified as part of the tunnel parameters or the one inherited from the inner packet. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- net/ipv4/ip_tunnel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c index 09e0effcd034..d591c73e2c0e 100644 --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c @@ -773,7 +773,7 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, } ip_tunnel_init_flow(&fl4, protocol, dst, tnl_params->saddr, - tunnel->parms.o_key, RT_TOS(tos), + tunnel->parms.o_key, tos & INET_DSCP_MASK, dev_net(dev), READ_ONCE(tunnel->parms.link), tunnel->fwmark, skb_get_hash(skb), 0); From patchwork Thu Sep 5 16:51:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13792731 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2045.outbound.protection.outlook.com [40.107.96.45]) (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 B13FB1A073B; Thu, 5 Sep 2024 16:54:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.96.45 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555245; cv=fail; b=KbQq64sSjaCAFMZJl+AtUH3Yk9LSudlFnCauhbenAEMi+/OClgi/oc0QB3UWNfrYrHQp0OUqnhKE1d5ivUWLVh0WSG5DXbx/t9hzBvgUG9chrLclf1vye88rEoFNrefQv8Y4/sVcjzFKJbqP3UlxAFugYOJw8NfE99os1+1SAnE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555245; c=relaxed/simple; bh=VwYctOglwmFLNG9v5O6UKWkMuHV03hOUEfduGN25f/0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gMwwpltGFlvgUBhcRInIHgPhqyGRnvmUP/VYJbnkWVO32AWafGWIzeg4IAERkL93aTsiJfADX43jpJqa46jBGOSrRQeblkZvvoZkZAR36xWUQ4UgoAgKm4xLp5QKfCkyYsh3w2Tw1OUthwTwz6b5ym4CTFCS6Qh5QUFzjueUog0= 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=MPW00m8r; arc=fail smtp.client-ip=40.107.96.45 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="MPW00m8r" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=c4zvUikUkSVNpM6eLuxY4CFx/yHxFG8LGxLQZeHTPoUPCCIzR4EzWkjCHyRKmobV4izCRuWVVTX/exDvbT+G3Ol4n8Qj4nWBkg2BO3wHiRkcdEwNTJKBVCf7knXfsyoLA7+CRwp//Iv+JuBD4SskHZCbA3I2MzWQVCfyKd1Rsya/pQfRH+dadto10BfT+4AOAG6mbdwxWqvvIPpnXLFcbXI3MxYpMdZRD/ZprqJ62hcnM9m8I/mqHsyBHin+6WkVqd3Aa4KenNc0kzithl7khnPR5s5MSKV2m3zo2n7kFsO1TnfQ7bxNKHQOwLfvDiUoKaKDlVFFbA786N3lxYwlTQ== 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=njjOpOpkG5eoLceLFWeINxDNWm9lX+aWBjHaOpMJGp8=; b=MmvAUi5gEyC08tPw+5cLbO4Ng7KYaG4uNUjtdjQt4t99HQXdmNv6+EGzkBDN6SKYZ/Vn+N0nTwv8Bbhocl7pd09eOhez+EFXRlcBdzKuYmW7I3sCJuBZkSHQwvW3LPWm1JQP8yzoQGBuWLkkaO1RpkXTxaTzfYWH6IEkmln47kS7dFCBJwkKmBBN6XoEbrtdot8IsflxX+DxxDKNWpUPMo8/UJKf4loZK8RmwIHShDIXLBaoTiLNSgMK0+sgpJtFnHm5LRS2VhKCPef+ScvFXwZQzWfDKAR4QIujJgzcxDKx2Y0IgqiliiSnsmkJjVd6Fbg4lkSuzGXn56nJVLduSQ== 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=njjOpOpkG5eoLceLFWeINxDNWm9lX+aWBjHaOpMJGp8=; b=MPW00m8re6zSmsYnlJifv295/a07IgdqSNuVowzDtJVZp6pYN6MlN63+SSEkCyQ+I9dE2IjhOdiBZhWPO1F/na7hM/sKwOCy7zZj2pxU8LZoLNcqgej9WkgOudY0YAtphaINE7pdQYVE82I4Pt95WnXVTMLzGnhqI7fz8Vry+yncEsncou/1gd1MeuSR3dvFr3EufhCcF2WJIjaFIH0qJEQ1lfz3+xTg8eDTDgOM2TZx+yHumYhEIeMFEAsa+r+/Rd6rD5fZzBYfByx1N8ZhUci2Yr/VCQn0+IaZ8i4/Xb2m9euxwtCu/mgL2mAr03b5rpyAYCw2v2JU1jPcAbWsoA== Received: from CH0PR03CA0108.namprd03.prod.outlook.com (2603:10b6:610:cd::23) by CH3PR12MB9027.namprd12.prod.outlook.com (2603:10b6:610:120::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.24; Thu, 5 Sep 2024 16:53:58 +0000 Received: from CH2PEPF00000143.namprd02.prod.outlook.com (2603:10b6:610:cd:cafe::a7) by CH0PR03CA0108.outlook.office365.com (2603:10b6:610:cd::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.27 via Frontend Transport; Thu, 5 Sep 2024 16:53:58 +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 CH2PEPF00000143.mail.protection.outlook.com (10.167.244.100) 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, 5 Sep 2024 16:53:58 +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; Thu, 5 Sep 2024 09:53: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; Thu, 5 Sep 2024 09:53:36 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next 08/12] ipv4: netfilter: Unmask upper DSCP bits in ip_route_me_harder() Date: Thu, 5 Sep 2024 19:51:36 +0300 Message-ID: <20240905165140.3105140-9-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240905165140.3105140-1-idosch@nvidia.com> References: <20240905165140.3105140-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: CH2PEPF00000143:EE_|CH3PR12MB9027:EE_ X-MS-Office365-Filtering-Correlation-Id: 6e2a0998-5aac-4eb0-26a7-08dccdcb5641 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|7416014|1800799024|376014|36860700013; X-Microsoft-Antispam-Message-Info: DTdhoi1PT3XG9bFS/uNGf0ykbBDm5IZ52N9MwS5JTseehkFiSkkRU8mc8PdbzXmB/ettvHbKtxKhwTt8lgWw6bPyZWnosZSPnZVtR7D1OYUKZzArbSugtK161c6WOkU9PGUBcZ2whKH7lKsBNTo3qOtxpToKEkh0seoflWhZzr20/ym6H4QP840StFtYO7ICkehDo7j2symsThti+3CadwCuT09kAEu172LPZ8QvnWkYK1AXBmh6MNGQWL/Kj2O83APaZNikdLYpH+cYi5GCrz2cWZCWqReTSIQ5xv6Iw6sSwrAktoKz6TvboNSQqEOo1YyHwYH3bETzvnv65bTUyGOnR0IuXK6LoiUjz45/kDa30RoZgqfeBYiR1j32P24IW2IrzRpMhUKsGJq160CXZggeNdVkfnQjnEJKmGw73En1x2ZCg8kmU3k2rIny419ZNVWMI/0tMva8xNeC/g3+xi0x0cDOsQLwhYaG9wh0/TbbB+FNSDLINopjut4f5qmYj3sqa/zGMwyzWPQiaAQhRRXZE0MvZGXAyKiYN9esxjn75tyzq9sl+GmJ6xnAHgsSQ+ajewT2kjXvCAN8bOuAMMFcmyTEGbvg4BK+l2GUDtfqd4zFHj+QVuPsdjVap+e/QCx6cWN8jZbpBnkZLkkqVaJO01d7NNtYkshPPCzaqomcKrsxr9ybQuQlNDbBtagrgrenVVywM127FoH4Rx5sC33mOfMlXBLwNFNY5wfLtcwU6sacg80usdV0FxGqgMgxAL9Yjez5rfc4CxpTT6/QF2SMOAmnvqUG5riG9JZm9BdxDTaG0RJ/vsq+EWCF2t78lVucDUEYbNFqG2q1nWsDbhOmpggpoF0W/oprLi8UG3CZtHm1DtjoZvu+z3deyktAAIbA0uFBOSVAtMCURIHUpOAxKTS+Ug1ZSsDLOwXtBY13IfO06/DH4ePoJNJLjBvaas0sH4oV0JgdFnoZdzASYCcL8lHol+INxjn2FhHxjytR28BZvtmfUxoJFRsdNTdOHxufrtLJ977MLOoS2lAERY8eFRQjCfZJ26zTmXEI1fpX9oqg5HU4/nAgukUrouzaH35/skm2FURT6HYSe8LaLXdfKkaWSB6Lln/VWI9fkEg6RJ0AzkcR5gq0ststJI48XmIOjverz6qajlhkX/2oP+GMqZSqk29Dpe41RCgs61B34lEJvOgK9SGH+PyVoJ1oaOMo9bQ9EtZizLFPuOKR8f7PMU8JxtPyysj1c3ZtNp5W6Sp+pu+8KXRrpKPcZb3i8uOFbnpZH48L1MUtmHPZpEMB/EvZMZpgJ6ZxD/1opTztojPLqtsuf53l/V7fts2o9eqL/C8rIm7etHGyNd1bQwslx8LDTKI5IRSyIoSS1obpXCJwqBYtF2YRhhcUB5XfMJV27+PEnkfDyyxrVQ+iPb18cdDO6lwaVCKbvJ1gPPmAAHE7V/eUCnDFNR7DPeKl 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)(7416014)(1800799024)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 16:53:58.7214 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6e2a0998-5aac-4eb0-26a7-08dccdcb5641 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: CH2PEPF00000143.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9027 X-Patchwork-Delegate: kuba@kernel.org Unmask the upper DSCP bits when calling ip_route_output_key() 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/ipv4/netfilter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv4/netfilter.c b/net/ipv4/netfilter.c index 591a2737808e..e0aab66cd925 100644 --- a/net/ipv4/netfilter.c +++ b/net/ipv4/netfilter.c @@ -14,6 +14,7 @@ #include #include #include +#include #include /* route_me_harder function, used by iptable_nat, iptable_mangle + ip_queue */ @@ -43,7 +44,7 @@ int ip_route_me_harder(struct net *net, struct sock *sk, struct sk_buff *skb, un */ fl4.daddr = iph->daddr; fl4.saddr = saddr; - fl4.flowi4_tos = RT_TOS(iph->tos); + fl4.flowi4_tos = iph->tos & INET_DSCP_MASK; fl4.flowi4_oif = sk ? sk->sk_bound_dev_if : 0; fl4.flowi4_l3mdev = l3mdev_master_ifindex(dev); fl4.flowi4_mark = skb->mark; From patchwork Thu Sep 5 16:51:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13792732 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2062.outbound.protection.outlook.com [40.107.96.62]) (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 BE2181A073B; Thu, 5 Sep 2024 16:54:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.96.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555248; cv=fail; b=oCkWEIh8PgT+WFEhnsMUr7uD6vflJDRyxYls50AKvoTGxX3I9Qhw6TPYLl2ygYJ25wXDAxkDOaUoMCFZ0cy3PTDIF9g7a3kfha7Vku6kJDzekAuEVJw34JQOTvOOeU7JacvSPQG6PLRLJQH8Nlr2ewxnm+YhvMqoPhabtrgf3jY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555248; c=relaxed/simple; bh=B7Zf5l2IYRlHjaXCYqXQEbwNa5e79x7bReIJc97zXYI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=q0zgIGpHw2lkquPh62wE/XzZJXW7tC2ueN0dHU2YMUlp5Ua1SvT2ElP4tEl+XrqLju/pERyR/6QqUKhTnfoOusvwjWEkT6F2df3a3U5IS8fjcaxdWkYt68nzaRXT/Zfng44L0ZMqckDUlDoKJWXVAi8LMfPfKUOoGvhEAJslDCg= 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=Mr8zwO5O; arc=fail smtp.client-ip=40.107.96.62 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="Mr8zwO5O" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=F83MV97TZQ5bhfiQqPX4eCN5+m3aL10VVSaSahZDaO0Vgg9IlpjK0Cvfy8vB7doibbGtolL0DHdhoGQtf1jVHSXXSf2+Y6bsunt1w3ei1opqvdEa8P9nbt+sYL3hP3FdUMQmugNHk5wE/taai8m/6LQ9KMy/1WymrfSWBNSHEa9aWfNI8GG1d2sm17Hxi+RsYtzaOBCaVVNWK/j2shkYuGEHpyFpcH67+ScxDQrWCECzckv0GAgrUANa78UnX+Q+UwDdP/EyzawOLXU9qTPQjS/Z5H3VDgjOmB+Ng+euTnDQmB+1K4ve4QgOi576hg6/zz4y6eE7PohDaUbF7IHO8g== 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=krMxDlktnnPk8S9qsZwUuIqIucu2zygBKdu5hpxol6A=; b=goFBmvO9T3L/yV5d9R1y+baaArRK/i0QoQXUDOcnWM4BkVrZWxRR5DFPJ+BpXQBrxKZ8/on4qjQlyF2YZ5fHaSL31CYz32ZI6PwP3UZEeJDbpqTHLuXimILaVbXACnj4k9ekrzFZeHa24NAejJnkIdjsPmspI7+9cOubKbdqHt3sKw4a6bdQCWHbsAVaPNbeL2AbeCFIbVZz09ScjdNKz3C6T12WKm/XdRpaEyka/kU5b7BtLaCG+jsSrtv54/PQembsKKIcoidLfdEBIxKjElUYXACPhxHK9PWT/9wxeujPhFyB9O/AzWGn++P3GUFR+7/KUckOuxa4EyGwwBKhUA== 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=krMxDlktnnPk8S9qsZwUuIqIucu2zygBKdu5hpxol6A=; b=Mr8zwO5OZA8+eQWpG4bdynxKAvig/KWZz5gJsYRMKA0t+MoVWes2GzjxGCoP95oeoAC83Sf0Ol/Fvrn4YU93pZ/ydEypdtmChmy1v+PcU5b9KJGeY6vkihdBQ4LpEnr7klplNxsT3Nq3AzsNGhJ+VPct3Jfmn/mhInGTiR2Jdo7TBtvNW+zXLmeqH9veHkigKPe34ViRT8HowyYAA5xX9anZKE+eK9uSv1XnnsCMj7vmkq4A7utgWS/coPK/xe6gFxxqLd2oz4CZz+eG0uWAbZMv4Nu8dXl1R0un5L6SMqVU7VuH1EhkcNvyMq36p8F4euuqKh78YjxPSyEBLqmPoA== Received: from CH2PR10CA0001.namprd10.prod.outlook.com (2603:10b6:610:4c::11) by BL1PR12MB5707.namprd12.prod.outlook.com (2603:10b6:208:386::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.28; Thu, 5 Sep 2024 16:54:03 +0000 Received: from CH2PEPF0000014A.namprd02.prod.outlook.com (2603:10b6:610:4c:cafe::b0) by CH2PR10CA0001.outlook.office365.com (2603:10b6:610:4c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.14 via Frontend Transport; Thu, 5 Sep 2024 16:54:02 +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 CH2PEPF0000014A.mail.protection.outlook.com (10.167.244.107) 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, 5 Sep 2024 16:54: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; Thu, 5 Sep 2024 09:53:49 -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; Thu, 5 Sep 2024 09:53:43 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next 09/12] netfilter: nft_flow_offload: Unmask upper DSCP bits in nft_flow_route() Date: Thu, 5 Sep 2024 19:51:37 +0300 Message-ID: <20240905165140.3105140-10-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240905165140.3105140-1-idosch@nvidia.com> References: <20240905165140.3105140-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: CH2PEPF0000014A:EE_|BL1PR12MB5707:EE_ X-MS-Office365-Filtering-Correlation-Id: 36b584ef-5b9a-4c21-1dce-08dccdcb58b0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|7416014|82310400026|376014; X-Microsoft-Antispam-Message-Info: p4fYSl2PxFJnCKkMrEQmJCZ1O4WJVMc5y/yO1gnX2n4+1XNf5YR8sLmu6a2sUXIZU5qVj3pShYS/n55ao5LBdYX4c7H7cEU/PW41xAn3MMcwE7scYgd370NnOzmpR2KymfIteD3oZTNvPj+mmn7GRE7c9eVSO4/7R8hLffWftAkbf3TdKlNRdkpzN545UpLDtCETc3t4dGjlfrQSs2M2kRQdjzIZ7wulmd3vRk+Y/6q2QJlfVBW1Idfp8DowZNo4tj9ViSpy2l81L+v3HE1NvnV/VUhNr0J1dIpkbaJPjgk+HDG1bES8dHNVtBiPx0cTSu+2Qu85X3H/tGuJF2ix6hBODxsUkKo6FCytS0e/A3AkYr28MrNx/PnFweHOhf0NCkWc5TatCYS8LORwWOOmb+O3IVxDqW2nbRNhKiMfI/LonxKU7OP7SQSK7+l/Tg/qo3xxa9Kgr8mAFlJ0KV+045c3F+gZpgxGvP8+VYX32BAYp1NerR7pQmTASeO06pgmYLnJbzK0AtK9yPrHhsu1wK8x/KlVN+NrYANU107e7upRploi+swncXDA4Gpkue6PqYCEXwvb5nVgTY9Y/fdVs00J1wQsJqnnyWrm9T4BIyK5N03C4xNZE4Vkkd7a4KmC2xsqOS/EeEXVrjvsKQanPnhkLBp2Nz1aABGmFVqVJFEEC/S0JFjuB+RYHZe1M01/Q9k74NrNP+GbxkV4AupQM9jjXBGmMsM3tjf9wME2ZrVocp6fpoBn4YmwtRoi6vwZA4I4e7raBJdTVgon3hfVFhS3wtmHOIxtdmYq0E4Ue0SrEs11tqB8sP9bXm3+Zj3MX8IikTDPmCboEhbj6/nWLwS7JLnKQDyKAxtkR18HI2hVcGY3fEPbmX6Rsj+ogp+IyoR9I00OKveK/NSRmVB/HsvOB6Ogn7g0EU61WcmWV/MMv+yVhd5FXcxvRgQnaXXeX4rgtIgCax8jITya3uhjoFu1smaU5hRhTcKKgkhCi0WKo8vknx4ukdT0Ms0BZfZaxrMsE8e232px/3boPd5SKLyO/r2NmIjsb6UmXmp6OFIKTB7GrbDkkyhFLrrEF8M4N0p9lqXcM/4zR/SdPyJtEVQPtX/jtOoEHYru52vtUL+7zpMEbrtP3GL3WJCG1qjSruiC3yQBIZVS5WQMt4snUHIscgdvCLhRvrqs375EqLT2hjVHuWE0OCoxAElxH674YJCas5wRfwLVTbY44uO1vdrdcRFrks1Xl3/VwD+UD5rLDIc1oZ5ziC5xwZ3IngHuqKQ1aaFQUWB6NiTCkxn3cpH0b0aPZt+fzmab+RdFoERgjERQqvU0B1Uh0zHwrrylrwQfanXAbUKVaOUb9DqpnsgSBgOKOikiyEBGVYba3E1vzNISZtDNkOCHWp1aaawIZx2lnSwjNZZ8lqKEi/M0ByOS+mzh1LDdQcAFzee2rI/C3q8HBPOGDBKQtsJdYDAT 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)(36860700013)(1800799024)(7416014)(82310400026)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 16:54:02.8197 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 36b584ef-5b9a-4c21-1dce-08dccdcb58b0 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: CH2PEPF0000014A.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5707 X-Patchwork-Delegate: kuba@kernel.org Unmask the upper DSCP bits when calling nf_route() which eventually calls ip_route_output_key() 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/netfilter/nft_flow_offload.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/netfilter/nft_flow_offload.c b/net/netfilter/nft_flow_offload.c index ab9576098701..8e7234107ae0 100644 --- a/net/netfilter/nft_flow_offload.c +++ b/net/netfilter/nft_flow_offload.c @@ -9,6 +9,7 @@ #include #include #include /* for ipv4 options. */ +#include #include #include #include @@ -235,7 +236,7 @@ static int nft_flow_route(const struct nft_pktinfo *pkt, fl.u.ip4.saddr = ct->tuplehash[!dir].tuple.src.u3.ip; fl.u.ip4.flowi4_oif = nft_in(pkt)->ifindex; fl.u.ip4.flowi4_iif = this_dst->dev->ifindex; - fl.u.ip4.flowi4_tos = RT_TOS(ip_hdr(pkt->skb)->tos); + fl.u.ip4.flowi4_tos = ip_hdr(pkt->skb)->tos & INET_DSCP_MASK; fl.u.ip4.flowi4_mark = pkt->skb->mark; fl.u.ip4.flowi4_flags = FLOWI_FLAG_ANYSRC; break; From patchwork Thu Sep 5 16:51:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13792733 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2061.outbound.protection.outlook.com [40.107.223.61]) (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 ACE441A072F; Thu, 5 Sep 2024 16:54:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.61 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555254; cv=fail; b=dz+Btj7gUBjFwLZzZXh+qyzT3F3xDwAPcd2kQ8a5EKr41JBl8cqt4g7KL+BqH2NY/L/DvKBkrTv1sHR7tel24r/Pl3HPyA97F5nKL9VvwN+ZdIhIyeg+Gl+wrdfkt9zxLRtfhjzoOF0hj2og46ZSUtmHYSP7o5TJ4nw/l7iazQs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555254; c=relaxed/simple; bh=o5CfKTfCwI+dFG19TWMj5qSFwWObZ0tCAFPmJVLf4t4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MqZ9j58zuTVIQn1mYfxeVg1sPevRaGvSBQ5fBRqv2b48kfBXF5ftcwwZqnKGWFvbYFrRpC13S2kbgcVd7vdkx9P5z8Oyo8l4FvsgrtYZ3ss/RgrngyG2thPIbPvobZ0SrJw5279ryJvR8CX5EWvYFAUAj9xfe815VtqSQyHBV4g= 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=Kq2ay+tR; arc=fail smtp.client-ip=40.107.223.61 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="Kq2ay+tR" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Hj/vXDWR2+dSNNcxV2f/o4PnPQQ5Vz8TMBwD+u3Gowbf8nBSxE02XYhEpqQzqpBQvDR1cRg4YDmVo3JmHoXDTgS4P/bHquzHyFJYEeFoEow+3i08BGvS2bkHg8mtkR220nVOVyKeNA81U3djSWwiOjDifZ3siZFo1JF7cy6YlAm6lFik2K5WxWz9fhXOhWAl61WfBI4gfhPuw2KQt5hpSK0rEP5tewQzyK5qVJhEFiF7MgPc/CNEHOZSQl0BzuWHyFm3K0zAWlq7VfqqQ40Vu4I/Rt8C9ph/Bo2cOiOwxnmJfxHJol2bHIh6CBqlQ3q9xxiO9jzRKTejJe3M+If7dQ== 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=r/l9LxCWEVqHtiP1Vmr6TBlDr6K36C8/G4CEYV+Ulug=; b=oMTwWpP/GrmtpIvnTh6rrBDOVxw3VUFGgj2ukvNfe9Bqo6vbzZGnDlqOx0zxPBy7GZahU3+WLdlmdDgTpVIHAzac88F4VoppX4o0G4o6KIG8X4xwM1nOTUH61QYJYAsidZY9mdntEN/cpLJUvyFzNQpQX5r9yz1Um+r1RM81qMK9v/dPme3kZpikQNZBReTOoftUDqounWPKwBrsNwK3So8QUo7rbreLBF9/MHYU65j61xwQho9YVkLg7LgsN0Z25fmvBh/XPuvLgE4+BWF1Yo7NlIAg+F733NcrX1GLxhfzOkEshMceduVJByhs8Y6N3IsGD08D4xrzUh7lRA7y9A== 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=r/l9LxCWEVqHtiP1Vmr6TBlDr6K36C8/G4CEYV+Ulug=; b=Kq2ay+tRpHkj8E0KNJ5+SybXqE52wQrxZ9/9HINb8tWK3JpAq0boa/gNqYSV1TNRFZuOc9YMwLobEsZnQwKO1zgd3/gZnppX+G9tPde2VHzmWhlBPzFDQdrFC0rtZjVBYFW0rSBD+kEW5u9tK+DQ6xWg2dByl8M1LZdOzAgLaru3liHCAubxMuei8GrykpXknDn2do44YMaAk2hfpTLeKZnyEgfGR4NySaI0k1pruzfTa6MHeE6hmdo072b8IYhnqhuXH1Ea3E+IGhBPfxGATZzZxPlehxuS1FDMK84MnjSVVZy8JLkOcqPvyn+wwJ0FF52vAIydix9J+y3qcObV1Q== Received: from BN0PR04CA0152.namprd04.prod.outlook.com (2603:10b6:408:eb::7) by PH8PR12MB6796.namprd12.prod.outlook.com (2603:10b6:510:1c7::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.25; Thu, 5 Sep 2024 16:54:09 +0000 Received: from BL6PEPF00020E66.namprd04.prod.outlook.com (2603:10b6:408:eb:cafe::5a) by BN0PR04CA0152.outlook.office365.com (2603:10b6:408:eb::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.27 via Frontend Transport; Thu, 5 Sep 2024 16:54:09 +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 BL6PEPF00020E66.mail.protection.outlook.com (10.167.249.27) 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, 5 Sep 2024 16:54:08 +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; Thu, 5 Sep 2024 09:53:56 -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; Thu, 5 Sep 2024 09:53:50 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next 10/12] netfilter: nf_dup4: Unmask upper DSCP bits in nf_dup_ipv4_route() Date: Thu, 5 Sep 2024 19:51:38 +0300 Message-ID: <20240905165140.3105140-11-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240905165140.3105140-1-idosch@nvidia.com> References: <20240905165140.3105140-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: BL6PEPF00020E66:EE_|PH8PR12MB6796:EE_ X-MS-Office365-Filtering-Correlation-Id: 5fc48fc6-a8bd-42a3-7ede-08dccdcb5c5b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|7416014|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: zlUOGcrlGoG2Aivlt7IJlA2uMbKBJzp26f0t9FakFt9NHFK6BR/9VVRc6MS8zjCgQY8zgGqNbTygkYlip7FApmIMrTTx3FuMlc+oHkFKKfwgatedCruohxIBxWJ9jbRC+kMyWZukTkXZ+TWUiP0tE3dG2JYegm2lo/5uMA39NPsxjgxM9W3SK2dAmx3rsciuqvGGKJ3pVtcL1UbvwIfkLTwhdkoxnq2V/3vRq44Fa7Xv5k/YAaGy2jK7va9jAEsI39Juxl8xvqyUGeuLn1mP+ZVjaQKz/IrVsZZqMJf21W31//ZVrj6p6eSC46ziO1fndhbzLvxcMrPu6oImPoJB+wgkBCOqC3vanuLAooUTPDAgOfwbtC18iqLrTHklRnXNuVlueoRyK1SkKPgtDDxHyzt66+3Z6RRK/lqjxLkYIN7QesXjX3kbr6PzsCJ7hR4Dql31EufmLXhlfIIzhSAFzD9HxGDktXeDwLHTVR20inMrRqrEucK0SMZGjBngQZ4MJ1S9uW12rc0tAlsw9U1f6jXrZauZynb5vI+vvGOApVSIGm8OVw+XIgRs3falD8R3f5HDmKav+QlxhwvS5h/B3V65XNYw7VIOAVQqugOaLNrgnuRoC5jgMoLJH0g1KfY/t/wFvMkdf0geMNndr76V9eJ5XpN9VQDjGfuRv+j8wECJHAQK/l84gRSav92v6NYjXIZ0FrO+ErIjXVNVpExWEpr4Qyiud9tujwKUd8v7kuzB3pkQihNvoukjUtB85HGu7rC/F4tDuxiutJNsZ9E6T2u2Ay0oSVMqRpTiea85Uv/mGEvYGdKcMSGYIV/TXEpGgl+SoCy+R7wDcm1FxoeqFVAZiIXNl1lyuUgIdIek8gPSq4MhPxXvMWU5AW7sNRMzA6P5USq+6LlGKvS2A1qJMIlCPye4Zbh00gUlJMI3owlsjp/LlPN+5hnX7pnxkQRpqGUtMntXDzRxncmxT7Uc3c3I0e+Ts7N3fvVh1HPhQLvlYazVH9elyXUfmG7Ftad1RqxOT0Bf7GKpksxRRMkEsdCzc+Q+hWU4fyLAlzZkCQZy/2Sxjoi+btFzMbs0B0vOT5u7ToT2S8bA4GVjd6xg5e+rpsPD/TNGNanQi39u0JauF7BTSgCd9uEF7D9XvqqrIqlXyefooRqGWbPGhE4xBEqyiJ8ecgkxEDI+Hxljd1BRBL55WSfwI/b1AKZB70+o3SWYlgMIhK4mt8tbhdnPPblpRYJ2++EHxTOMym9jfKllW5qhBH/h7tpyUFC/ZhyvW+aZnnAUAtCVGFF/ewYYBnlf/uKJwLLM5yv5r+55XaapCQEorp9hCx9eJwT5DZAS+1I+eroLSAPxUpYhEP38FToUkC6Oabe0wzf4IDDTvkHOPHIcr/oELvVLbccRoQgDg17XqROzZercWbDVmbSPR231Hmk9DAtlnYG4NA5DRngkf7kNNsCHlTFFNWvQsKqI 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)(376014)(7416014)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 16:54:08.7885 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5fc48fc6-a8bd-42a3-7ede-08dccdcb5c5b 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: BL6PEPF00020E66.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6796 X-Patchwork-Delegate: kuba@kernel.org Unmask the upper DSCP bits when calling ip_route_output_key() 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/ipv4/netfilter/nf_dup_ipv4.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv4/netfilter/nf_dup_ipv4.c b/net/ipv4/netfilter/nf_dup_ipv4.c index 6cc5743c553a..f4aed0789d69 100644 --- a/net/ipv4/netfilter/nf_dup_ipv4.c +++ b/net/ipv4/netfilter/nf_dup_ipv4.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #if IS_ENABLED(CONFIG_NF_CONNTRACK) #include @@ -32,7 +33,7 @@ static bool nf_dup_ipv4_route(struct net *net, struct sk_buff *skb, fl4.flowi4_oif = oif; fl4.daddr = gw->s_addr; - fl4.flowi4_tos = RT_TOS(iph->tos); + fl4.flowi4_tos = iph->tos & INET_DSCP_MASK; fl4.flowi4_scope = RT_SCOPE_UNIVERSE; fl4.flowi4_flags = FLOWI_FLAG_KNOWN_NH; rt = ip_route_output_key(net, &fl4); From patchwork Thu Sep 5 16:51:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13792734 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2046.outbound.protection.outlook.com [40.107.244.46]) (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 A464319FA8E; Thu, 5 Sep 2024 16:54:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.46 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555262; cv=fail; b=clGfdFou66+yDImLusYYNIK4AhXrlEVpwkA9yNLbQlAZ7ftNRiZelTYO1NMBRiePP5m2cvh2Feh+B+COn/zOhJs8y3VgznXCLktUK4qHj0oLr7euEFS+QduTucfU7zI/QhbqMsO41552TD5dXDxCZ72TAEZ3NEWBQ3xap+Wo8U0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555262; c=relaxed/simple; bh=HcOmb6W+1vJBdhsUj7dSq3U0L9zuxpAMalyFHtoAzeI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=X4Ai3Cq9C0zuqPJLLL+r6zIHa17inPcB8MsgVKsi9tH6Euv3mzjGmdFLrzlZ/AiXa28GyPWixsQqO6hVuF8C+lrmpmrDRzwe5JK2z1B+WySR1AO9TPo/eTX0HbiqdxTEfuBQLZ47sWXnUbxWFqucAbWp48wWtQZMKPE19gwt//g= 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=VP3H8gJk; arc=fail smtp.client-ip=40.107.244.46 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="VP3H8gJk" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ka2DMeqKjdSMrn1ms7UC7V+ES9BEERGwk+RLCgdwGmIP0RxoQzadDfTBNGBVxXQSPC2wPH5ISWL3jkk0EVQa8I1Y7n9ZZT1Lckm+5oOzM6OH/SI4W/kFln3GjfdEMgvjG6hMuJScAl/0+TZ9izWsUEEGZLVi8pDQeFLM30tVVRXSCNdY/3qzuASN/IzVRa7SFB7aTIYLCM9s6E8tmWcC+04qT2gZ1vCaRxFf+Jc+JjyvX8eOnesPvSND5iDbPIw5+gIEvFM4Bhf3+HkaMRTcuNEBMl06REiAPsEqXrLIY+ZsK+hya5C+uwlvq8/JUbDjf1OeRiiLXDT3EpZYzVNlOw== 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=NU1i9+eBNnGg490a+zDafnELUmYGEDBe5qbyA68dFno=; b=aq5vrMZCK8B0n0VLyEzAhL5d9rm+heqTiio8Yr5s7ewXI+KGlvWzOJp8K5EH+u7zpi1uOph5gjkmFPLvBj4VkXLfp20Wpmm8+1I36sjQNl9PfbbeFx5B7MEms6FDTASjmeanl0n1ynXd/PWtl4zngzif2haWLix6TJAtYpzB0eu3BeuniDbws2pwxHoo8EXKyQsU7kR7jxiiVSfIg97rWL+cszDcHPkUMyIqw1Xs1oHsszk3oUa9Uumfak4MEpkClXhX+c9SK0TvKNM2we6SSiBsu6P0uEllmbqtn2TyiN8NIIH0QSiLbyJVbPg9b7xVA3yCYoNjnSCBPRl+dSecGA== 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=NU1i9+eBNnGg490a+zDafnELUmYGEDBe5qbyA68dFno=; b=VP3H8gJkSxLfYlXIceToPt8ye7sE5g23YK1H3CDdIJ3NNEhBcAqn5k1mSjXgJNsDdZT9J027Sy96WnIzuuFt7sJnMbBHlHV57cgtKpGeBNYnGfBueYwqbV573X02jvqCKDAMHG7h/RH777YChZfg5IR5Fj1on4RCf/CD152zlhsuTNC3njF9tfo0P2GB5lXgmlQ92LsqGWT9lw1++748Y4LKBgYPLvH7avbvJmYNFqdQe0O+6PFB2W6MwYB+jeeNBzNVG5Y1dPO5dIPYDTmqvChYu9jZAKjEb2BhnK87+zNIkeWwX45U+cEUSAiLJpHAZpiff7yv62lDWJz7N2Ms9g== Received: from CH0PR03CA0113.namprd03.prod.outlook.com (2603:10b6:610:cd::28) by PH7PR12MB7916.namprd12.prod.outlook.com (2603:10b6:510:26a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.23; Thu, 5 Sep 2024 16:54:17 +0000 Received: from CH2PEPF00000143.namprd02.prod.outlook.com (2603:10b6:610:cd:cafe::35) by CH0PR03CA0113.outlook.office365.com (2603:10b6:610:cd::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.14 via Frontend Transport; Thu, 5 Sep 2024 16:54: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 CH2PEPF00000143.mail.protection.outlook.com (10.167.244.100) 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, 5 Sep 2024 16:54: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; Thu, 5 Sep 2024 09:54:02 -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; Thu, 5 Sep 2024 09:53:56 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next 11/12] ipv4: udp_tunnel: Unmask upper DSCP bits in udp_tunnel_dst_lookup() Date: Thu, 5 Sep 2024 19:51:39 +0300 Message-ID: <20240905165140.3105140-12-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240905165140.3105140-1-idosch@nvidia.com> References: <20240905165140.3105140-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: CH2PEPF00000143:EE_|PH7PR12MB7916:EE_ X-MS-Office365-Filtering-Correlation-Id: f3e92934-ad96-4d98-06bd-08dccdcb6129 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|7416014|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: olPkyE3/Bc5Z+NwuRaospLzF8acVT6HT3N/3hjN8ejt6XXgndfN8HUmftJz7hvWa4xjQgIxxDb9dvuu5l8QoGI8wwogrXPJGLsw9eogmmjgaek44CQUnxWGDgHDqvRblW5APs5IYG+1U6AWsp3o+PExlyKjQhbGHgDeCnvKN9XE8VR+XfFbL4GOePt9vYGhzP7ZMKJaLQyZTnxZz1TGTOl8uaEBVZs8kFOfgZpN0O0Q55BCPN2hfoh+3NIFaOrjH6ortLlXlEucnCqVWXpHGbUiPY2GgHcOX+32/CaLyFgfIOBXYlOwUFNFAdEOWXAPlFOp99YzGCNxFi1oQZxj5znik7mlFs4TbrFkXuF9X61+QduyFkJm2msHODv34PPf1q83iaoQWtOLAsw9sOCxJGEKHSNjpPex8nX8q7JQYwx/ri98ADpeVaIhU570GBBxdkXqCqRo3ec6xatQ14hHrmaJpdcFewak41/0bMZQGahSXSFW1VkeLCJ3oJlP60Cy4yDOcenrN77KlobYit+2B73Csar/PxQe08RKf9bSek9+NThcQ8IjzHyECBkwsQBO+otasnL/A1uVcXN+spQE5oN9bOA/hHNzHZvqjVI0q4NnrdSq9J31JceOU35wJF5KsUi/FsOdT4gYXMegBmSypKK1uHJ0R4H/lPeQiyUbv38rYHk/Dvo53NzOCZxFYhqvbKQSK3JJySgfMdpU6rdjxoAQ3bKVEYd6HJKOJlKozsr6+99fdwt6qgm3txXHubnFJvCIK8EfTSLUaKKwdhayVHk6u1RI3/Nz0HJU7FpdxEsXG9v6UI/bil8mYKlfaEEZzcUHfeECGbP4LRdWLj+oR+k7BpVZWUV/hkorYtm11YFSTYEYf5PHLUd9Pdrr49MR0ABwkHsFJE6oIpbtamPvAfeBhRu9+VmqiyzRCnWmWfXRlV1lSdjuocX10Yi78Ulddj+C5wMjfo7dvEB59Qy3dVb0GkvV9yO4n9MwuiyOxSokTMshm5wYjGyfnA/RTF5z0d73wC58LVy6xLVS2WmM0lwaIvrUn3lyW6+/Gc3rOEbdwzMZX7up1/N2DamcrklSizWvlD6nO29WhN0Q7GFdaHzD+Z7gmEZTs3qupCHZ9nDxN8XxhIp7QArJ/F7PXxuZ8kp5VjxyVD+UWsqwZcL3B9nPKO4S/AvousQvU/XiZRK8wbe6m6F1lzZ1+pEk6JwQ3lcWhwpq/k61eZxeLXj8krIUwr++khDN8Fx3kQtKxqYIPRG7deYQaC5iz+9HbuKvF1iB7021kLsPTQvQiTfCTVnv/ISt/gjYyZfdklPiCDakeucMwI60sS6otyB2rnAyzqwDL0mMrJImX5OPr+LzEP6M/MTwswhzjfF6TJG7LlzHE9VYT5jhM5QVaQrLl/VtrHzUEn+0BniIzKDmkehOH8XZcEQT4BzpmOjM8nfMe3xTrkMEKY2WDfz0fUMlwjuLp 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)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 16:54:17.0339 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f3e92934-ad96-4d98-06bd-08dccdcb6129 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: CH2PEPF00000143.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7916 X-Patchwork-Delegate: kuba@kernel.org Unmask the upper DSCP bits when calling ip_route_output_key() so that in the future it could perform the FIB lookup according to the full DSCP value. Note that callers of udp_tunnel_dst_lookup() pass the entire DS field in the 'tos' argument. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- net/ipv4/udp_tunnel_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv4/udp_tunnel_core.c b/net/ipv4/udp_tunnel_core.c index e4e0fa869fa4..619a53eb672d 100644 --- a/net/ipv4/udp_tunnel_core.c +++ b/net/ipv4/udp_tunnel_core.c @@ -6,6 +6,7 @@ #include #include #include +#include int udp_sock_create4(struct net *net, struct udp_port_cfg *cfg, struct socket **sockp) @@ -232,7 +233,7 @@ struct rtable *udp_tunnel_dst_lookup(struct sk_buff *skb, fl4.saddr = key->u.ipv4.src; fl4.fl4_dport = dport; fl4.fl4_sport = sport; - fl4.flowi4_tos = RT_TOS(tos); + fl4.flowi4_tos = tos & INET_DSCP_MASK; fl4.flowi4_flags = key->flow_flags; rt = ip_route_output_key(net, &fl4); From patchwork Thu Sep 5 16:51:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13792735 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2059.outbound.protection.outlook.com [40.107.94.59]) (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 701671A0BC4; Thu, 5 Sep 2024 16:54:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.59 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555271; cv=fail; b=kdUWySl0m3ZWYTMVab9bGmyXkYzVDKWGmDVEeakeJOgHevdxwlgy7wwMd5uboc+p6QGhTupCWn4CenSfRotDF3yy5pxK6zP+HwNugLlP3ud/+vkLbDRQr60ID7FoyutLh1o12LWzf3LoblQZPFuaRaIIeq+XCFMIXHROypSxMcc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555271; c=relaxed/simple; bh=QBXTvurjCgE0OVMvar9CMynCY/AONwcSr7kICORKzuo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=o/2U955SyoPREOZyiuT6+z8SlICaetB+dhA6jqjZ7LcMd3KJOmIhk4SNJpLxGT3rk37FygQTAIDYVbvWFsYEtUbdfgJC2OkTczBg2xgFG6uWUEA8mdoW5MxMxAGVEndFbtPIJI1Pq1XfqAeRSsSTWsXm87fkJpX0d23nwcH88UA= 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=HdlfeyLm; arc=fail smtp.client-ip=40.107.94.59 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="HdlfeyLm" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=P7NncgJeLDWcF54q/7gZcaE37VSnccKHK9LRPFovI+qXLnPd2UBvC+uXXcN/Y6xU3Eok5o/CbStO3CMXCTYed/rTcxM7GjPkrGC4iK/f0ffRerCcL3UN9rUJ84PwKv7SVK8m3DNZ/oSmXtT6T+47BIDePwAnDfTxqAguTdrY2/oBVDBEiYMSQ3gIB+BWfShwCr8aY0o5V8/Oy794OC71BOsL//1gJ7WOVmU7KBglJsxDDjlpjTfed9rNY6tio9XGySZbzaUzSajwJ/rxqHVzZNpYJ6PSoCax8cm7qk2W/HfljFUt/GIX3g7z1YPZ1F7ftGk3MS5VEhFpo33lUaLpLg== 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=nlW6D5jbBGzf9gtdxA6b93Ji9LzG1FR8AAebl2Ncboc=; b=fzxrSZnfzwJ4Ch7QPma63oOv8Zu/t8J2KCH45wxENyjDdYUf2i3aVBKQE9biTGqS0zZKvCGd6x765hPxqSDlFMCsk4gsj+WnBipUD1Sq3snNrn/UKuB0zMr2ff99xEgj0bnjAf6wdihVGhMal0QHnI2wNf2XeECQYPYOZcsxAarpJW249ngiiXFOSQdTwIfcOYzm2p7oRNo/B0xcAczNYqGSEx7XH92Nwnp2F/bpkUNYjqswYRwUuz4jOGtx2mx1JwgqjEdZv0xJ+Y++aXv4KKeO8xGMlDX/OMG3ug4wWNzyN0HXfbehZNZPLzfIocq44VkY7shGmaleEJdNCC2Xdg== 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=nlW6D5jbBGzf9gtdxA6b93Ji9LzG1FR8AAebl2Ncboc=; b=HdlfeyLmFptWi37ZPhoj8sh4vOVieU1PomdwubJnNty/SctICgOkbobgCFarwmT6cdSG+yDB3JHOGD7m9ciVO3OWG9bnXp/vS18MFbh2a6NFNLWZgajFbitha7smQ80/3sd0kokn7HfHtAicDpU6rMQYYJXKmETwjqYQ7Z7kDTQXMv7i7PajyRfV7L+D1oRaoevn9THASvN0nrmBXnO3lXxp7IvRCCHhqlHiqBkk1zmMOiAadYPMCnERZjRgfTILa+T18uU/7GF+O18omPgIGHbiydHXNt4dIdyypKYrhBywzsbx8K1yofytJEh2aUulT+00/wzD/2qwBeJ8mgEbrw== Received: from MN0PR02CA0017.namprd02.prod.outlook.com (2603:10b6:208:530::35) by CH3PR12MB8482.namprd12.prod.outlook.com (2603:10b6:610:15b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.25; Thu, 5 Sep 2024 16:54:26 +0000 Received: from BL6PEPF00020E64.namprd04.prod.outlook.com (2603:10b6:208:530:cafe::53) by MN0PR02CA0017.outlook.office365.com (2603:10b6:208:530::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.27 via Frontend Transport; Thu, 5 Sep 2024 16:54:26 +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 BL6PEPF00020E64.mail.protection.outlook.com (10.167.249.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, 5 Sep 2024 16:54:25 +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; Thu, 5 Sep 2024 09:54: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; Thu, 5 Sep 2024 09:54:03 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next 12/12] sctp: Unmask upper DSCP bits in sctp_v4_get_dst() Date: Thu, 5 Sep 2024 19:51:40 +0300 Message-ID: <20240905165140.3105140-13-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240905165140.3105140-1-idosch@nvidia.com> References: <20240905165140.3105140-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: BL6PEPF00020E64:EE_|CH3PR12MB8482:EE_ X-MS-Office365-Filtering-Correlation-Id: 55f86aa5-fcf6-4ffe-d4a6-08dccdcb6681 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|82310400026|36860700013|7416014; X-Microsoft-Antispam-Message-Info: cw6XHcrnZRbE3TMYzot8moeE3Dm3skmwarZgxBmAyeDnTpDsdQzaoU838c+JCAMKV3QIu25AiwE2xHj+lK3dHU4ilmGuATfYIggikTvRzcMYRbbVBR0FHOxUfZ+dwxEtGkZVIUPsgJXn/jlmBIhR8Pn9LpKw0Ggoe6QxgQXBCZh465qQoPSqATYddjEQkleNzbqgk49Xs0tzpPRQQlyEWQdnPU5Kli+4qV0z4YGyg8NxG4wO+dUyR4hBOfKKTy33a1SFWdtd8qLyHTT9tNMrh1YNNkkDG3YsJNY1/Z15AkeKWB0rEDgUfDfO4EOkIvR2VvHhUgPon/hPuzBpilBjb5poSFVp5ynoJGGeFnD/yDH5p2+TihCPvfkTtRQZxHwNuM5jd0AmjdM8iqNSEAQmwqev8vieG7iAw0OksOXPqt/S50xT23E4ddQsy3VePWv+eOH8JLhG+NlNy4sr27soqI5zbgQyCa9R0xsFmDfHKXwlJcuSTx6dB5eRJUhIFRvfu9zYbEvKkAvJmptw7UZ7uEbajqx5aPqqjeL7Q9UWAq98slPRdhRSponEtHipJeptQNkrlkAoLx8QUBrO9pslLMINFgWqIOdMnOZs2I+VZh5u7noy3HDaU6gRM+fxUNvy/56nVbWxGh6vFAEikANYY0GYfjSjiY8pSih3zdR9BgAYuUTUZH0/ZVzJ15tAKI6bQVP4loTBtbzIbF8r5A//4khZU9S+BXTiUdBBeIhxt5UGn3UxP6c62e0bS0TnJH6J+G9+0zDnZ/2YxCELXGlLmmhQsKDBNms1FWHNYl7Mrm4JiVXAyGWjeD10mit1N+2iZAD6W0jM24L3LZRLBgyMfLOp8otmvKQaWccKPWNiCNDISS1loulBotxQGVIeURfEhf68qBtR5ts4jJOJ+FEypBqR5Pb30Qb92GjJ4meA321IQl0NpkuKCyEAE0AQhH7V91pohJorAbiN7TxS+5efbaRASejjuvbi4MhahYfH7VHaDxngv0NDFqjAVqvIlrFhp0IZUmXs0eSoXb/ZnA7EhYWjOtlhqP6fxOvg1YUDbwmfwVIKAKgRSrDbrIndQtGn2PO/SpzvnAkNVYDLCfrJV/U1FA1bmQ+oIWsven+0oPy1jz3/ycqwm1m7IciLcVUqD+6Z7Mjr1Lyi2xIERSMqKUFR5Y2xSUmAPq+pVQsXNWVmQ5tcJmSfBWEblMhqZVZGTLyyK0Ls81wBTWaUnJ37zlFu0RIpqZF9G/8japVA5hx49syDmIADEz1bJw552D+kg1IMA7+YwZX/0x3ArsI1M0ReBWoZQFOkEb3aYy567zGzB1Z1V1ay+UG4zmQi4GbfZVneo+5qNVKXUZu/KIuFbSf4dfbSf8Ga/+LVo48Rfizd84YM6FCAGoE9OZzySDTocGAVLWLmpApnKXUGMwtH+mpIIaquSujd6y6hGJbko4U= 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)(376014)(1800799024)(82310400026)(36860700013)(7416014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 16:54:25.9732 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 55f86aa5-fcf6-4ffe-d4a6-08dccdcb6681 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: BL6PEPF00020E64.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8482 X-Patchwork-Delegate: kuba@kernel.org Unmask the upper DSCP bits when calling ip_route_output_key() so that in the future it could perform the FIB lookup according to the full DSCP value. Note that the 'tos' variable holds the full DS field. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault Reviewed-by: Xin Long --- net/sctp/protocol.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 5a7436a13b74..39ca5403d4d7 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c @@ -44,6 +44,7 @@ #include #include #include +#include #define MAX_SCTP_PORT_HASH_ENTRIES (64 * 1024) @@ -435,7 +436,7 @@ static void sctp_v4_get_dst(struct sctp_transport *t, union sctp_addr *saddr, fl4->fl4_dport = daddr->v4.sin_port; fl4->flowi4_proto = IPPROTO_SCTP; if (asoc) { - fl4->flowi4_tos = RT_TOS(tos); + fl4->flowi4_tos = tos & INET_DSCP_MASK; fl4->flowi4_scope = ip_sock_rt_scope(asoc->base.sk); fl4->flowi4_oif = asoc->base.sk->sk_bound_dev_if; fl4->fl4_sport = htons(asoc->base.bind_addr.port);