Message ID | 20240905165140.3105140-7-idosch@nvidia.com |
---|---|
State | Awaiting Upstream |
Headers | show
Return-Path: <netfilter-devel+bounces-3710-incoming=patchwork.ozlabs.org@vger.kernel.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=IoL92wEt; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45e3:2400::1; helo=sv.mirrors.kernel.org; envelope-from=netfilter-devel+bounces-3710-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [IPv6:2604:1380:45e3:2400::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X057K4jx4z1yfv for <incoming@patchwork.ozlabs.org>; Fri, 6 Sep 2024 02:54:37 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4BFAB2891BD for <incoming@patchwork.ozlabs.org>; Thu, 5 Sep 2024 16:54:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1E9371A38E1; Thu, 5 Sep 2024 16:53:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="IoL92wEt" X-Original-To: netfilter-devel@vger.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 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 <idosch@nvidia.com> To: <netdev@vger.kernel.org> CC: <davem@davemloft.net>, <kuba@kernel.org>, <pabeni@redhat.com>, <edumazet@google.com>, <dsahern@kernel.org>, <gnault@redhat.com>, <razor@blackwall.org>, <pablo@netfilter.org>, <kadlec@netfilter.org>, <marcelo.leitner@gmail.com>, <lucien.xin@gmail.com>, <bridge@lists.linux.dev>, <netfilter-devel@vger.kernel.org>, <coreteam@netfilter.org>, <linux-sctp@vger.kernel.org>, <bpf@vger.kernel.org>, Ido Schimmel <idosch@nvidia.com> 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: netfilter-devel@vger.kernel.org List-Id: <netfilter-devel.vger.kernel.org> List-Subscribe: <mailto:netfilter-devel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:netfilter-devel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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 |
Series |
Unmask upper DSCP bits - part 4 (last)
|
expand
|
On Thu, Sep 05, 2024 at 07:51:34PM +0300, Ido Schimmel wrote: > 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. Reviewed-by: Guillaume Nault <gnault@redhat.com>
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 <net/rtnetlink.h> #include <net/udp.h> #include <net/dst_metadata.h> +#include <net/inet_dscp.h> #if IS_ENABLED(CONFIG_IPV6) #include <net/ipv6.h> @@ -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);
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 <idosch@nvidia.com> --- net/ipv4/ip_tunnel.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)