From patchwork Tue Aug 27 11:18:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13779326 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2044.outbound.protection.outlook.com [40.107.102.44]) (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 0EC1F19F46D; Tue, 27 Aug 2024 11:19:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.102.44 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724757564; cv=fail; b=V6W2H/OXdz/d0FA94CZM5u3J1j5nX4sXQlKB/UygVFZFk4KxdQmpuNhnuuUxjY42r7afWNfS1MIUuA0zvZxsvV7Y+nuWQ/FedQQwdmUJWlHaTRE9Vb5c6MTOgbZVM9+luH2juXEefbphKDlL/+33T0VOUzJN9xA13PLgMTcEXhE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724757564; c=relaxed/simple; bh=nR9h8CGc8lkL2HZYBXD+kh25pcDbzUIUbxh9hhYd6Ls=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RV5UqCZzEpyZfGEd2EVswe02X8kdv3JlZX2dkCf3gUcr+MxGOhdTIMEQw/xFCkqGXbAVYTRCesIRR9PhXSCfkJOgLhqp4u5iLGfzlhW0bPkaz14sQZq5pfNl8EEO7Ht2HSrdGFGQLFvZ5CAfkLyYdYgElzchkJiJnFxoLlmx4nI= 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=PxYiqPTy; arc=fail smtp.client-ip=40.107.102.44 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="PxYiqPTy" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WRa1Q1NsMGbj+Bwtn2z4uD8ep7OQZ80yWnGmgJiEWUtIQODiH+vQNxIcVGilyfTXy4O3FrUn6s+ryncjYZcpEFlQ1ANHjrZ7x6h0uj5su7dRzAy9OZBDEDTN72UgSAT1YboQx0ywcUXN4Fnm3XygTpIqO/yZ/i/n2kheWY2NaRYDdoqp2RNgBeqABXvqk0o5u3sRxfDm0zSNn9Xl2Cj/UkOkCIab6r9DOttN4iStZ9e7sB+l/6zt5Lt3ixgo1nSw+nXPMRr7umQ5Shsyp4D3zIHBDGVrqYioGvsz0kaJPheB1eeVTXrqtDr8MJaQes57Jq7EwgKbRd42G5CxwMWRUA== 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=mka0Bd/tWl4lydJeoL0KyeYnNSXOFH8yEhnO5ZvQ4O4=; b=Pi/76CtRXyaEdMt+dftFJj0oxgDvtObQKT+TTYiBvcqtiR9YnpJ5p51eujI2JHVKfeyChw995eL3/wsv1+Ztc74fRCkmLrSFP9lkziMXhNoybRUWRCP4l8QVZDW+XolCpINElDc7LYW4W1s5vQH1fcYp/Ml+wEi95yhgNfM1ew5yvVR9uZ9s826SEK3oep4EgKIYUPJ2b24FOQ/U6hNTni3Xgzn/TODeMkjnf8+nX+xp19/32ER8cuHi9XIST7VudZek+K0h02HSbEHc01fHuyfNaJDpB4LflRsexXFFTPw16E5iOru8lXsHn8Agrlzi3e/ULTzKC72iW9HPNIUVfQ== 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=mka0Bd/tWl4lydJeoL0KyeYnNSXOFH8yEhnO5ZvQ4O4=; b=PxYiqPTyH2xOyb/b1mHwykA3SKPB97TLRAt+xTa19tcuLHIort2dl+ecBNyZ23+smChlklVgGQYJFxsxSiarrB+yd3tAZ2MkpIVsES45Z5wCiaH73paeYdKO9fg5JUo6pK4CBo0DqadsWBJ/EHvEMKt6YN8gZ/Y4Zt/oALlpjKK+74OXzHjxtrbso92KiktU6ilzZTHU4ZbGhiGqqLLlZvITn/CIkqok/8NDici1Yi5ZDVX7ovCpEpTZk9vElnlOG3IHONnXbzUXsL6STq0+drd9f0/mlmKb8j+jlNmWo0O2RUiJeFR97LHHBmWOwl82DCBG4rZQU9ZQK1AleedC8A== Received: from MN2PR08CA0025.namprd08.prod.outlook.com (2603:10b6:208:239::30) by CY5PR12MB6621.namprd12.prod.outlook.com (2603:10b6:930:43::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Tue, 27 Aug 2024 11:19:18 +0000 Received: from BL02EPF00029927.namprd02.prod.outlook.com (2603:10b6:208:239:cafe::2a) by MN2PR08CA0025.outlook.office365.com (2603:10b6:208:239::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25 via Frontend Transport; Tue, 27 Aug 2024 11:19:18 +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 BL02EPF00029927.mail.protection.outlook.com (10.167.249.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Tue, 27 Aug 2024 11:19:18 +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; Tue, 27 Aug 2024 04:19:02 -0700 Received: from shredder.nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 27 Aug 2024 04:18:58 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next 01/12] ipv4: Unmask upper DSCP bits in RTM_GETROUTE output route lookup Date: Tue, 27 Aug 2024 14:18:02 +0300 Message-ID: <20240827111813.2115285-2-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240827111813.2115285-1-idosch@nvidia.com> References: <20240827111813.2115285-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: BL02EPF00029927:EE_|CY5PR12MB6621:EE_ X-MS-Office365-Filtering-Correlation-Id: ef6b1153-4a13-4ab9-0968-08dcc68a17ac X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: +fZeyLzFKQbw7zQ7Dt2asxEzxlyLBYw9HEtpnm7Uw4olP5+E2i4wW3zTBilPfP+dZEZu1rnJHjiDrsSbB4Tw1kGwHwgxheEyBtsR/8lpBOFfN1wPfhDkuczusbpAZQcXSHkYAr5QFbJMfHk6m88ExDjjD6mrO3+ULet241tcR96Q8bm6Ui48fJgtnm4djxxxMNy1xIt5Th4/lXJ15V0ICA4HXUR6pGD/hoATwnkv2qMKGJuaQtQVuq24G3BzYo+2HErfIJ//dm8DsmnF/A+hkfU0d6Z9xDrKmiIsAhyqSsaCdqaVRdPMGtDigKpt5rJ2z0Antu2223OepO1Yql1WQUHSTd4rqOGKQrERzhAPJP/md1n72S+mCsTHY3EbJYdBNJLd+y5kN1GUdvC+v7ayxwxjSheq2Zr0uuxJhY/HRvGqQr6aBfIS3fksXuGkHQfyz7z5zxSeupRH5ub0U28W1M+OCIG/S5Uk0okNTDt83559/AIFqVGsfsPb9J4w6AS2sf/2+gOhEyUGM8Z29i+xKTI5gcIo+r19B8WDO9TfEGq0sM7rW+l25/bBwLNHVj514PPg9U6+HJTHwV2n9wWyDO92UB/tr+Xe7YoDbIb23byC/df0fi1gt2DGXEu/n8F6L4sfSOgO7kl7FtIZVEBOtL4bXJFgfEsXZ5adZ5OaEAUwlS/QmXr8xgLfdsnOe1aHqNJb5AVp6rf0ec9dLdUXcBqdc1TCogxy+H21UX1EXp/Vl3nkCaNLb0hNMADTQgMnj9BVQK8iHB2dkJGF23dSkdat4RvelOBc7hPNmksyRPdlCeiCgpZHcT/vwXMMlNeWoM+3lpNlmWS3VgYekRE5BUj8MmvIlp6iwV0/VVSMKSrt+Sz1O0SLzZv9VuvKaE02NLj9KoO8s7EvOO6tm1xdjb+Nuqa0eKBwKPAW7rw7FwylakjzfXh00+yR1XomCX0dqY/IFlThbUROciWHYfDTb69otM9INGfeqtI8paMiqu5/FDV3trjbvfYJiHnOc0k54tGwLXN775rntNHbgK3tBrFeBrFQxzhujqAUaFXt6pwbpCK0sa27TyUTMqRc0ny9bwXaRJL1ahlUhWoeQ+Hffiai43VjGH7gdxCivSWmdN7hxxoNQcp7J947T9kqPQ5vXoQsXvRWiG9ehaD9ZJUzgkc+TnL9upglmJMbLzygatS4XNrVA81GQp4NTVtWyxzlMRPto3VmwlTQ2OC2O/jbkxEVVU6gH18dtSFIA84bkkal+amI8qagS9PzrT28psJWloMC+bPEZhqF9fQAX5zsWEUa/36eGdMk+PvuH7p74JYJn7lG6vs3ayBNp0pGfOM7FkRt4z3m0z0gt5hofX0Pqb4fgP3kXzjgTNnbuC9Qtu5ELCzpngrmQq1pryishl9WE2tEa9YHoaYxnSe1dzkxzB35XpJfWM8Fy4mVebPXmpqJAmarnyAe5sQ7RQvPGuat 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)(376014)(7416014)(82310400026)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 11:19:18.2829 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ef6b1153-4a13-4ab9-0968-08dcc68a17ac 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: BL02EPF00029927.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6621 X-Patchwork-Delegate: kuba@kernel.org Unmask the upper DSCP bits when looking up an output route via the RTM_GETROUTE netlink message so that in the future the lookup could be performed according to the full DSCP value. No functional changes intended since the upper DSCP bits are masked when comparing against the TOS selectors in FIB rules and routes. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- net/ipv4/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index f6972b24664a..e4b45aa18470 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -3261,7 +3261,7 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, fl4.daddr = dst; fl4.saddr = src; - fl4.flowi4_tos = rtm->rtm_tos & IPTOS_RT_MASK; + fl4.flowi4_tos = rtm->rtm_tos & INET_DSCP_MASK; fl4.flowi4_oif = tb[RTA_OIF] ? nla_get_u32(tb[RTA_OIF]) : 0; fl4.flowi4_mark = mark; fl4.flowi4_uid = uid; From patchwork Tue Aug 27 11:18:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13779327 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2066.outbound.protection.outlook.com [40.107.92.66]) (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 E68B019F46D; Tue, 27 Aug 2024 11:19:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724757573; cv=fail; b=LG7XkDkZlYrRsK+KrsojNClonQcOxoH/991u/0XHtODD62y72oR+BK9HIjNNgpcg+bDIow68TbhBDYkC4NTA+StOZz5IufjYss4iPTwdIHxb+1AL5uxbn0OQXQhekRu0ndMK4iXTKTujjVpYarvBBj2+kvxPWkJRUEDAlDH/2t4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724757573; c=relaxed/simple; bh=VCZs+AXTTjEaHoT24M6P1LixZKytOvmM4qaeAT+XYwo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UuKZOfx+C4A0eGtcTWoonme0XSUqgKbGWnQydRxJIMrI1UY5dm9BKlorEk+0GYAcb5C5FvSsQQmglcWjPRYQt0F2goAWlk3sT0E/ZoJx7YeLj7VR6+UMnAn/Vk3S773PrRmAhLoxGRYDY2AMGFiTwHxSM7BS4yiV0zQi/sUPlOw= 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=JuBN1ly7; arc=fail smtp.client-ip=40.107.92.66 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="JuBN1ly7" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dbUc8yISmog4vTfUS6RGX5zt0TQDbsqTSnjfZssdOzREZyllgO/pOXnI1FLSWYhQ03XbRCeZfmVvaIMpAiVX451iy/IqbJqyh6RAk8yNwJM3LWAwp6MDiziATsDgsjHRdj2+FeLpb/oF1jMDMYKcec+hMnicc2tbEcHe/N9glr6k29oFUUc6mjPzkwN2jb82gnNI7LTQhZ1w3RlinF1aBvfhcST9U3xA4t5LVA+v5L1C4kmp/U3Cx1bR0KsTnYDxPYBPWbxQ/xM9yI3a35iFW5IC0k11PKA3LZh79af+j6L2LpkAVUv7+a0Kug3I0qW/eCS7P4tXYCBGp0KWAhCyUQ== 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=mtr2WBvUsosFanWr/xxGmcpnzsGRHMyqvBQoH0jgCf4=; b=hTSMKa23Lg2CFGMPjJmecxuQAH7/8nuBQni6GBmb/J1kmkz9DQViik0pt6wtqX16DOXq9qSfOSiL+md8turEFm3Jvf6n8CJj/698HAy5Vf1WW7EiBkQ0lENP5ByXoVbHYMhzyirGi8YeSNgrX21SDn9BUFkc3g9GC6o5d+21sonD32vSLQ+Lq+H5iIVyZPse9hWl3HmzCYs2Ioqt2R1a2wH4a7O/NtirsyxZVphDPa8rBZmlyFd0+JFrxJH8TGCW4rKqmvqaj2+RzaHJRWYjuNE5E6dn15zu61RQltXDn8vEPaR0ajYn8WO1uTuPTR5B0o8UgNFWSUT3XopYJzyG+A== 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=mtr2WBvUsosFanWr/xxGmcpnzsGRHMyqvBQoH0jgCf4=; b=JuBN1ly7wx3WLWSLdQLYIuIDWZsJHZusONq4I0CdgxX2u+AshzNtAUqtfO17pPmorG8GuYaNlDfjeAgL/DlWGdVD0kJcoZK7eHM8pYr3iz5ay+Udj+HKtLZyCnSjYNUxYBCYdK6zGluudsHoS/8rg79LHIIHgTw56cZfY1VwjxQUyrQbxoti890wOvmhJB9qDxNtpz/mO9191Vb2XnSbtnpjjVwR/PASj9qhL+nkDDWFKx4oMXxZcOwYs3ips1KmM0zhnriwG1D9gpufIvTCWllE5F7JfrqNAKNavm6QQtgAN/6IlTc9ylLb4cmZb0e36xZeD241DoSlCDI5crdH2Q== Received: from BN9PR03CA0526.namprd03.prod.outlook.com (2603:10b6:408:131::21) by SJ2PR12MB8737.namprd12.prod.outlook.com (2603:10b6:a03:545::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.24; Tue, 27 Aug 2024 11:19:26 +0000 Received: from MN1PEPF0000F0DE.namprd04.prod.outlook.com (2603:10b6:408:131:cafe::5) by BN9PR03CA0526.outlook.office365.com (2603:10b6:408:131::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25 via Frontend Transport; Tue, 27 Aug 2024 11:19: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 MN1PEPF0000F0DE.mail.protection.outlook.com (10.167.242.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Tue, 27 Aug 2024 11:19: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; Tue, 27 Aug 2024 04:19:06 -0700 Received: from shredder.nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 27 Aug 2024 04:19:02 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next 02/12] ipv4: Unmask upper DSCP bits in ip_route_output_key_hash() Date: Tue, 27 Aug 2024 14:18:03 +0300 Message-ID: <20240827111813.2115285-3-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240827111813.2115285-1-idosch@nvidia.com> References: <20240827111813.2115285-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: MN1PEPF0000F0DE:EE_|SJ2PR12MB8737:EE_ X-MS-Office365-Filtering-Correlation-Id: e6f2025b-e5e7-4529-c04e-08dcc68a1c2e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|376014|7416014|82310400026; X-Microsoft-Antispam-Message-Info: PMs/OH8jWvhP+EJ6nb+nDE801fzToXCth1dYhaPZkWqJvLmJ9781sf4qbnKAvuits4cythLYAX8Gqrpi/6lg6NtxjMaSzwAwZ4IvU5efQDmYBiZY777+/WUqsOmiU3Rnbn2swOivbSYC6VzcIg/mjtl2pL1slK3kFB1h9HMEKSIAlBXSRu2J5Rc6z0ivC5qtDDwVXYQ0YiIcbnv8Ollnozw5mxZ7CZsDTeBunuTIQNMbiYFH1sR+5MCgCVGAk74oh0I4FNp2GB7fs4aVR9JUtZuHUYoquqw5BXwPq64y/P3I1NNl3dadDbXMZZcCuwHC/CBkHnQhv6IAdc0uZZoA3txZ23eTj5Vw4M4mQbSDzvUKoSnO33HfYLHWCxwn/nui9zbkNslNmlg6cd4rfSuUPur/5Rw/gt7skSt7Ahd17+2WqkxgWSLCeDy56/eZIP3gSbFB+Up2UnYh4L84PUqbkWULCvYFN0Pqko4csASUzXOxE5+ph5XGOXPErXrTlNr8MuiRfMJCzSApIUNsjrPDg2oFyq9Ble3m4D2771jcwScW0usnAAIPkbIsi7jq8kBeLiJg0KMOCDRGkzFKOSZc0SeT/sNVtHcFEyXAmX8p11wVXgnjjUArszLlwUdUg1J7/Akxz1uqndS+zTDNJsNqtU1tCbU23GHty03aue7XH3kjWVdgScMYmdiFfdL1MTDk/bHH9pdx2jRcelTxPeRXB6afkh9XQQ9At0G+czg8e+Tw4PPI2fQhKOu+EZM1EcSErgs1Os7ziPuw2BlhAjQubADmND/27dyb8a2T7tlp4431MT3ySPDqR9AJ8rXRWhUbM593+qn7MIP9tdPV6Lz+0iRBft7WhUvLHi8Gh01j7sQD7Xy0I/6EfIfDPsEylUpONG3GCAGfKRsecka2eY4FaniCIxREODUrxv2/x8oc4zRZk+ZrIAKKgYIfJMDugEYzh5xq6pBf7BDK7w5N+bXMrNZYKhe1gYysvdYHEfixGzzMmqNLjvRl0KU7gYz27FptKIDWvsQj1rqmI44/tWbnKxgKDImLYECpXdlr4aMBh3T7fwYG4BetCHtyQ2OTt0NOYUC1O6/dV4NXKjbzhUQu4gM7Iv4B+QZedkPvUy6WFffGGnl3rm6MQnHBC/O/iFNyNHdyhEOhPdNW2d5+Hw3H0wdUMG+ZtsVBkNZnuRcWhq6Nv9+3vRtipn1HHBndc4ggtjog0eXUaAViTiWXEO+Y2K+Lvvq3nIbt1CvxERxmDXIhw+4A9obrQU3GLyrkH4zO0N4ILCrVU5vWYO9mUuH1n6KSDS9Kbj6jxhSfv2wHoLrhWtdmLo/gur0xS5W3GWeG1TeZAlIH2nn2FYggFrmVLGSw9PzkJcwKDce6NL5Qx04P77qw6yc37LRU7MLkqAy2ZRmFUdyWt/AK3ReYUVPl+TTSUreIRkfEL+t34owrjglpJH3QGxT++uhhARlCXHJo 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)(376014)(7416014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 11:19:25.8349 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e6f2025b-e5e7-4529-c04e-08dcc68a1c2e 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: MN1PEPF0000F0DE.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8737 X-Patchwork-Delegate: kuba@kernel.org Unmask the upper DSCP bits so that in the future output routes could be looked up according to the full DSCP value. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- net/ipv4/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index e4b45aa18470..5a77dc6d9c72 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -2618,7 +2618,7 @@ struct rtable *ip_route_output_key_hash(struct net *net, struct flowi4 *fl4, struct rtable *rth; fl4->flowi4_iif = LOOPBACK_IFINDEX; - fl4->flowi4_tos &= IPTOS_RT_MASK; + fl4->flowi4_tos &= INET_DSCP_MASK; rcu_read_lock(); rth = ip_route_output_key_hash_rcu(net, fl4, &res, skb); From patchwork Tue Aug 27 11:18:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13779329 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2065.outbound.protection.outlook.com [40.107.220.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C05C91A00CE; Tue, 27 Aug 2024 11:19:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.65 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724757578; cv=fail; b=f+BW88dSCJcW2WssDJnBzIKExgx5hTNKsjZQW63pbYttbfkoi4wG/+L8iWCaNDPPyKf5yz/TzJaCkGeYvOuHRu+/M43wMVFg6/YJsRFFDvqTuFL991FSteQVpLrWdycMDGkcQb0ngDQX7NVu6n3Zj9YmVgd9tOa1Mj9pQUhANxw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724757578; c=relaxed/simple; bh=ZSO9BS7FQnyfh+P7GBIhB20jEHsBwFAt/IzNjE08fB4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=o2XeN+jBHYJFgxFoeYr5eCQpMkow04lqQMkxwx7fHVCr0LQcS6pUqgQpHiTzfYI4FXGwx1EaKC6Ot9dniGy5U5roz7ht065NBWFIqBZ69q2a3sdHVF9sM97kzQ7TgQL93sfnfF0HNqxs4rLfvjKiAOx5ea+y0JKiOaaiW3vMXrc= 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=edQ2OFBb; arc=fail smtp.client-ip=40.107.220.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="edQ2OFBb" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mbZJbMai9ebHlpibdi1n3b47mpvPCBWI/GMbh+g+ZXQpj1IFQiIuXE1I5KTgiiio440GRccyxMpyvVpMmrqg1PAIOxjh9WuQe8zETZ5QL4z4k0kniDPqwuBwfAhax71l5aYKEfRRVLWXpuRnX5eOfJbEH1CaUs8Ll6ImoPoLaKy4YJUZgPDXSs13IT9aIEAIP7VSr5A/Mdfj9yul645SJ0xQb2zgzfn36e8F6BiwCxyfROmsHss4sdeFVv4rUjoHuofu/LFd/P923MtIHG+XT2DPDUonUG37gtOvG2TU1iQE/ySvtL0DcF6I88z3KuG8Ngc+vSL/PLJTmh9693DzVg== 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=JTEdbrFhmQFupAiwpXEZ4pVUw4FSxjqhWoIykOtD+2Y=; b=tQ+PFOCrnJo72KzsApOApWSV+2KZL5mBmrbk8xlncHpjFct4U5Ij/t4A8cC/sqcGU2rymVUENaoP4KYKOV8AqfvDvkJaT9C0Siy8BOKAsFvs3xGbCLeDNZMX+M54prBRv2r8DreiNXDesK4weM824T1WvKsbhxF2MEoIqb59See02stMPErfKYEu/mWZNDhTLNOgG+d/459HWXY1oxELfqeW4++CNfsVbdxoXDcgKSC6vVrrYJe9ZKyyxsLE0kp5LZGQ8GF6uo4UJzDgE9b0N0bf3PKy1uFXNN4tGs099g91X+/6Vq3WoEufMHzoMZVWp1vPe5IBAjK6Zjxtw0Dzng== 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=JTEdbrFhmQFupAiwpXEZ4pVUw4FSxjqhWoIykOtD+2Y=; b=edQ2OFBbL4QFDzAPjnjwbM0mI6r2Zx/7lBcAfZig4ikVqTQk3TBbAxsesYneE+wnvOYDDpuG2wk/Mg597j2sZasVm/5vHtidjEMAovfxqbVpSMQhPCnf299AKyRlA9b5wtY5B/P3CX+xYHFtqYgjWnLqeci5qkXeB7cVBUi0+ZHLXBGBNP+76ErXYzLg0mDTbRqyhql8v7uUt6IwYSRkBSURJ31OK2K/wfCeUwKCEDFgG+690k7LY/mm8A+BGReB+cGMQvTK9q2y24Syt7Ouf1O31c1T0sjTk6ZqVIyPSHuTe2NhWjmmRWdm6iHMZPKDZ5J22nFoI68i6zHlV8bw2g== Received: from BN9PR03CA0113.namprd03.prod.outlook.com (2603:10b6:408:fd::28) by DS0PR12MB7747.namprd12.prod.outlook.com (2603:10b6:8:138::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Tue, 27 Aug 2024 11:19:31 +0000 Received: from MN1PEPF0000F0E1.namprd04.prod.outlook.com (2603:10b6:408:fd:cafe::d4) by BN9PR03CA0113.outlook.office365.com (2603:10b6:408:fd::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25 via Frontend Transport; Tue, 27 Aug 2024 11:19:31 +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 MN1PEPF0000F0E1.mail.protection.outlook.com (10.167.242.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Tue, 27 Aug 2024 11:19:31 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 27 Aug 2024 04:19:10 -0700 Received: from shredder.nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 27 Aug 2024 04:19:06 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next 03/12] ipv4: icmp: Unmask upper DSCP bits in icmp_route_lookup() Date: Tue, 27 Aug 2024 14:18:04 +0300 Message-ID: <20240827111813.2115285-4-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240827111813.2115285-1-idosch@nvidia.com> References: <20240827111813.2115285-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: MN1PEPF0000F0E1:EE_|DS0PR12MB7747:EE_ X-MS-Office365-Filtering-Correlation-Id: ee1fe48a-f54a-43a4-f5be-08dcc68a1f48 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|376014|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: umBkg8nC9ayoc1Oazs7N8sGwMta/LDikziavlEQ8wBy6i552DbTjDsUYB40eDGPFI6/ZYHE5l+wVqr2Y19VWU4a4TK/d3TzLZ8sCqSWdo8a/yNwr/8WxTjC1B3Z8hpZvexW2WiaN5k26ExFh7mEnCxH+SjJVYDWd+zCjqrtdhLN4dlIWuSJn9uO/SmtV34IBOZGwThYc7V5FAxK7G0leTm9izHAxbr7+2/garQUG59RFmN0ClS1/WZ4Al1vxnscRjL05z83VBDBhBif8U66yeV4//wAIQImcFXBYLFy+AjD0YcxBaf3rOitl0PCrggcb2rGCa0BmbtV5xtrBtAWKU9WpO3rNI0rFbRSB/j/tTPDWUPPjgj27IYjmuc2+YRb0GsWz4ua8aGLTzHuev+gBq0R0ENhxKWKyWTIKzf6rm9XnUwOCmp9oUWzqCl8eeCc2YZ1kS7odSpy+mkq/5uCb+3JT//kmyMBbLjJ0G1GMu724D5AMedOY8TJgID9Djj/DExSHbPs0TgZ4+rrho4n8se1k8p7io+ys4lvXwSmuP0YwSzxuSGKyMFzG2Nb4VS054rk2Sxl5030PS6ZTsFQWGPxhXgglEJ+SlPZ9tfXt7yhhKjlN6pXhUGZF9fSFV+ryikhNHZQONM7ZfWlDJYz6S4DTrExyrikH2fc5RXY85EyFRwJ5hjUUMPp26W15jFxGWwx6AfAv5QqPspYxwNu7WCmya90zQo+kTRoVGW57LED1YfTPHyYv1YsvtWBgkZmvAWKhIF4sAqkG0DJBPvQAzQ6QKNY+7v+72zfhgzDELByvzgdOjtOqLRAjHBj7bpGiByDQYE3Cl3GuivHyA+xqiB9jFrL9bgwdE+40OKGkaXS3KnHaBpFrHkwrFpqKT+5zzX/SV3bH2ylj6At+luV/mwHJEUDDMS3Mo+BP9thDgtl03pC618BlVB27WgHcE1oLbcDiSP8oClkn3LTR/yvKP7bR4ErLKgmhIP7ZWdFQqiqAJfLuMtvaSXf+VlxsuB3Fv01awMgxZmLA55+DytFsY4V2yy4WQJ1mruTRwCR28PcVsDImHHawEx6ax9NaIPOMY8dSO8XtdckEv7etQw/ECmqYALw7X1XTekvYbSuejB0Af9tHl+opAO9ujkXgKncbtn8vkpxW/7NQdP4bswMK5TvJjVf8vYVcMEGR+SUHmtyZXjOHtIYoK7mSHO5RyRiL88Hf1dUkW7pKKHYA1VzXd+rZfzDtRuFggxXhupmN1ExfRKaVFCcSsg1OAZjSY7DpAJYD9cAJUrauoWZunPs3g59nauxcDkswDnNffjINCU5gG5HVVo0lePfNMQuLw4DOrU2NQD9np9Y5e2zFdL4Iad/ols6Td80WNQlIQKe/+9w2wZBcL5QxQgjhE26xYHPSL8xrK/rbMJ33splyttp0mSkygN4QGuTb4LTzrcCAsMGCQ4b2WiRZAUXf8FSLhj2Z X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(1800799024)(7416014)(376014)(82310400026)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 11:19:31.0242 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ee1fe48a-f54a-43a4-f5be-08dcc68a1f48 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: MN1PEPF0000F0E1.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7747 X-Patchwork-Delegate: kuba@kernel.org The function is called to resolve a route for an ICMP message that is sent in response to a situation. Based on the type of the generated ICMP message, the function is either passed the DS field of the packet that generated the ICMP message or a DS field that is derived from it. Unmask the upper DSCP bits before resolving and output route via ip_route_output_key_hash() so that in the future the lookup could be performed according to the full DSCP value. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- net/ipv4/icmp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index b8f56d03fcbb..441057f2c903 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -93,6 +93,7 @@ #include #include #include +#include #define CREATE_TRACE_POINTS #include @@ -496,7 +497,7 @@ static struct rtable *icmp_route_lookup(struct net *net, fl4->saddr = saddr; fl4->flowi4_mark = mark; fl4->flowi4_uid = sock_net_uid(net, NULL); - fl4->flowi4_tos = RT_TOS(tos); + fl4->flowi4_tos = tos & INET_DSCP_MASK; fl4->flowi4_proto = IPPROTO_ICMP; fl4->fl4_icmp_type = type; fl4->fl4_icmp_code = code; From patchwork Tue Aug 27 11:18:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13779328 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2061.outbound.protection.outlook.com [40.107.236.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 EAE2519F48D; Tue, 27 Aug 2024 11:19:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.61 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724757575; cv=fail; b=te6Ls/dFEqE8j1bq+JDNiRjejm2cm2M9FP0hPthY+9IBH0Y05LRxcMuXyBngVus/30Cge6iweUkZMZn4waym8InkVbflE4ZvwD3AJKuN1ZFh+RIX52FNgsQczZem4nHlEEDzuhxJV6AZavpl8GBE/i4EYjklcmF8I+WUiNoIxxw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724757575; c=relaxed/simple; bh=rAM0eyus0dvwp6x665Vb6VoqcQIdMW3QiQpG/CBlBtQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nh/uIxIGvPdxmeGWOHZlexswWrH9j+h0qnwYKk7OQIAk7kBlqqHbr+hR1LsSk/mIpK44u57W6q4l02VXFNcR9a1iNG3PcndnoeX3qa4sa+drCsuhe2k1MS5N+cf7lj38hZ+IV+tht/PAh1gKJxVCB/v7AD37UMU2fQ1SyVq1xF4= 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=Osg//OjX; arc=fail smtp.client-ip=40.107.236.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="Osg//OjX" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EZWugld8zh9LRg0LUEhvUqCRUCFka7h+t3HrmQM50MDq+I+zlFxsiJvhKqXAwHwZVWtT8L2SRzKcdFsXfm/BDDYYOtrRGAtSugVtQyxNbauAl4y2LcJewz6iyNu8Ih0CGrcPag92RdCsmPtTl4dlAbehu6Kt1v8MUNbjlWWscwZq+zXO5J3VNhP2LhlwMlwIsOUAxGmiyyiSdz44jgc2VrqRKWpBDtdKQqhcjyS+b8beqx4qRAnvoODcA9c8u2CmGMXbyoWsSo2cFtSTyOHyJLlAQ/Du6h2Y0Cif2KPyByagqeLagKP2+1DDKRD5e8vNk5haLZkSI3Krr6/7wRqqKQ== 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=F/WC/bc3OK2FxtvbRRrudoNM002joPtYD7dTEG6vObw=; b=MsxXO8gpiH/g9ibI0zj0Yz2My84qwDGydDH4/yXiIj47Bs4WpOiCfuEraQyn2crzAGnAaS+oZzIKUwCdHVzZ8x9LFR8u8oIiM3+B2jWob8YqxHCql8gV/++xa7pZgPP5ULw2L351b8E2fkkI71i+yc5uMStyPOrPd3JAwqCehpVQIzdfdSkc82H+eh581NyKR726RksQmHoyWGdAmO7Q29U9ymdJ4/7JJL8jp1uCMcVEj2MUShB2IzFwlSyVfrmuPK/8CtaEBHk45Ep7wXDfKRGlBdU39B8nAuYyhu/MMnMlCimRs6z7mSlaJQ8cWeCI/ytxk4ev6y1bEdhU6eliQA== 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=F/WC/bc3OK2FxtvbRRrudoNM002joPtYD7dTEG6vObw=; b=Osg//OjXmXgPzxyLp9lB4Lj52H95dStfBtpcSsO6Yq/FFzuiC2h9rK9y4GT8Ho7aTUuar9AgRhg/StNApMvJ+ZPqPII5mXDRzhYue4gPOZAkXzOsm4Vugq+i/TENXtlG/hYJnTnJX9Ad3z6E6FSu7ZKSoCKoN21KjXun95x0HCOdtquafpAauDF1caJfHyYpKGqSvNx8Wt5bU5Un/DExbzmwwgreetfBGg6zQnXOeGDX1TYtL8qTbk70WFDEWhDfHj9YfwuoklFb+ekdr7zboE734wgy+QUkN7+bnffybj0PqVnXrB0fUQlJsWKwxkGI2KTAjxvEpv1xQ7GJmHF5Vw== Received: from BLAPR03CA0121.namprd03.prod.outlook.com (2603:10b6:208:32e::6) by DM4PR12MB7573.namprd12.prod.outlook.com (2603:10b6:8:10f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.26; Tue, 27 Aug 2024 11:19:30 +0000 Received: from BL02EPF0002992A.namprd02.prod.outlook.com (2603:10b6:208:32e:cafe::79) by BLAPR03CA0121.outlook.office365.com (2603:10b6:208:32e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.24 via Frontend Transport; Tue, 27 Aug 2024 11:19:30 +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 BL02EPF0002992A.mail.protection.outlook.com (10.167.249.55) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Tue, 27 Aug 2024 11:19:30 +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; Tue, 27 Aug 2024 04:19:15 -0700 Received: from shredder.nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 27 Aug 2024 04:19:11 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next 04/12] ipv4: Unmask upper DSCP bits in ip_sock_rt_tos() Date: Tue, 27 Aug 2024 14:18:05 +0300 Message-ID: <20240827111813.2115285-5-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240827111813.2115285-1-idosch@nvidia.com> References: <20240827111813.2115285-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: BL02EPF0002992A:EE_|DM4PR12MB7573:EE_ X-MS-Office365-Filtering-Correlation-Id: 70e88e3e-82cb-47ea-88b7-08dcc68a1ee1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|7416014|376014|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: fadfb5DqWpwUTJBaU0AjLR+bYk+urX9Ejn5BFw038IgFjZgtueeN4UY1HD/4bHpeZsJh+zneefdDPcASIjHjD8oGdOHm4fJAyJa8QZYTp/WR4fNNUNkV+7YCetbFJd0XLtnPMckzbe/rRrYXLXXdGxiHMzkHuCCOCwCMPTNxC9p+zjhF4L8gCxY52BdEcme8UTAKFuBgoWkePNLBuaveAV2omsh46Z+En4ej0g9dPHBfvC8zcRZU5Pet5OkgdGCQflOakuPyDXrV2mHHgEFyMcfl+EGtmClIAzbQ0YOH9+/hWNKbwlbSxSnYYmjM5bhAqkPg9PVW5+t86av7aeHJwmS0MbOyScSWoSm53AmS2tGKgdAorqjnQenDlC8DgvSD/EDWGDMH2Ma0N0d+P2z9stydNZT0ZwNEpLVRgpu/XDRpNdj5kdsLPwEwOSAuyZU8L4UhulDpbzYEPSalUnAWwmcqPJbjJM2PmQgWMC5a19CM038Miyh06u0OaKGvZvulbm+P8a+6izuoF9fIJLMb8m6Y6R7KJCLq2phGog68YCp7YgCp2pKz4hO0yGRKb0ix2CQXdRv0uLwZ1ZTeL9SjgNr7G4ztoNhVTwwqIX9v9MSh0W2aEWN1jA465BY68xF31FmahLY9hdRPskkwgPggq5nzybDisnNAfvLRMj4p8C0uhtpLsP7SDVfYSn49Hyw3NEzN3vezQ0zJMoBcQnKdQG3Pe/DwlW9TZc+6+GuYnVXpBDfJALOcz/+q2+cm7o5TP/tU4VQ0zR+lzTt4jVqDyFmPDS0y9oqiVvRumqewSf4lFGxBQEQQFNspn5ofGuWaafuNRotpiB0TInzQHhfWlMBanQC9OJ8SM1K2dQEbtJfFeC9jtCy8gIoVp6i71ZpQOXGEV0z201hRVe6nmkCfKF27g60bQx6QrZeLeXdDRrjobMp7hhF8xIv6SjB0r9RSHo6xVoEsBNxca1K90pHisw0yPfLyLqsazLL/jLNoTMQVT10yn3e9d6yiSb7b9BtTpNV83YzfPCiJ/cQawvCZ4Dz2VjQZwa5uyM2af59xq6Gm0MKk+lU3S8YzFuI1y4rTll2pcF8DXnkYXKLfIZ/PC/6g5nAbdBmbQ1XnIXE0GeOpIV2cN7CyX9rS4m16m90lEMi3b14LfY3jXqdfoeEu9scvNGtGpG2vKg4iRoHmUrN6nkPuEnNi3goe7p5F2/2rjyW7xJ3oG0BISZZT98LX0xg8RRMk5Cr97qplpe1/aYdZlwB7Nv4dTPwAM9pFedQmfX1PRcRpTf2TobdnEDV5KeThP111cXQ7oIrRgKXMuIEY7hgTghW22C8PRvcib7yh4XDBURW2mnVeqkhSjr2DG3Sf94mKhmXUlEAByEWQmV8JnmGQgWPqgM6YUq7rj/Nl7LAxIACC0xmIN4NncflVu6cIg6qMCgBKt9FIEeNM5QIuQJtwY//TEyBBISYgEO00 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)(7416014)(376014)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 11:19:30.3620 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 70e88e3e-82cb-47ea-88b7-08dcc68a1ee1 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: BL02EPF0002992A.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7573 X-Patchwork-Delegate: kuba@kernel.org The function is used to read the DS field that was stored in IPv4 sockets via the IP_TOS socket option so that it could be used to initialize the flowi4_tos field before resolving an output route. Unmask the upper DSCP bits so that in the future the output route lookup could be performed according to the full DSCP value. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- include/net/route.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/net/route.h b/include/net/route.h index 93833cfe9c96..b896f086ec8e 100644 --- a/include/net/route.h +++ b/include/net/route.h @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -45,7 +46,7 @@ static inline __u8 ip_sock_rt_scope(const struct sock *sk) static inline __u8 ip_sock_rt_tos(const struct sock *sk) { - return RT_TOS(READ_ONCE(inet_sk(sk)->tos)); + return READ_ONCE(inet_sk(sk)->tos) & INET_DSCP_MASK; } struct ip_tunnel_info; From patchwork Tue Aug 27 11:18:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13779330 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2059.outbound.protection.outlook.com [40.107.96.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 4FB971A00DF; Tue, 27 Aug 2024 11:19:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.96.59 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724757579; cv=fail; b=GryVWGTSbaetPlWpaD6Omh0364Wtrt5t2b3q4WhboDLA3u3WWVrGKXsb2H9TieZGKAeCGxG8flZDCbSpQ8mOF0sNt9AjqX85hKZ3eFtoYRhW+lcmbfhmEhg+eOXqt9rtVEa5z+JE85NX2lKIpmLB9l266FgnjervsiyLXH/Nsf4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724757579; c=relaxed/simple; bh=JeinloMhWkQtbeRhNY9HjXMsQgFY/vP+p0TGY2wfRb4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rCq9GO2SPSr/eIWiyNe+bzi0uWduKF/D6I0DeGLTo6hTze9GEvGrjrVD2RJlizjKdcLASHQvdxdzGCeeE4a/cTOL+h89e6yMS/JmPHrslU0SvJZUiI8PQF+xHirvGHk3McXHjd7fjeF09h0VGtssN18hOh4/qcu/w4PUiU6o2AY= 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=uVI3nfPO; arc=fail smtp.client-ip=40.107.96.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="uVI3nfPO" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yQLtGLXeVqQhyzNgd9wf3+szT1ZQPSRhjMlbYAD4Lx6/pNnSXWUK08DlrPlmHYaiv8161JLMyFk9Sz8kS+rbHYOaJzVvS6ak/uwDpR+99Ca5UQmtM22nkf2maO0VWkCsDkWA+EKvwFW7qFXochLJCq6vd8v6QOs7vNEz1YjLrFxou9FAtEeyFxtNhx8ARt2lWYTTEsjZrXSGayrFKdX2W8rulUQHxk7lEDUleFl/ZJdkLjUoMtrDP6PAj5OP0NMVJw0byZQU7GKg9bC3SUmlefHxNR9+rgaMSQWI+cOSAXsB7YlISLqI4kes5nlJ/IrGMmUI4Zw/X0yC3noGmGEqoQ== 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=fkf/EFPMphsv2xPDyBVxwEAK9tZ116IyCBc+YIcXSwQ=; b=x09QgbUWEgi/HQUE0+tT/9qA9l2iQrvdOMEsUB9RKcXMI81jZLeRPlO+ceKvGaoeCOWkfFD1bXl1yWnj+vFmg4sPdEoEDeGTLV0H7uKQ5M4mJA8OANq4hjSADweFW241DQ1g3fqXYU/0wQsXxaI84mTq1k9+cHlYQpqGfUPpWL9VxjQC+QEsVp8jVr1TJ4OI0ufgts+QoaQYRl5zaPHcdqTcZ0XBXSsVromPmqCDQ2kcgAvzpD0DvpDZNVdm9z9OGUC6x02DhsSwp5y+NeML8Td3yewwWLlsWjR08x2qEnrvia8OHsx3GXDpWgsZlzNYJD0HSx5Z/ltyrLBAZGtOjA== 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=fkf/EFPMphsv2xPDyBVxwEAK9tZ116IyCBc+YIcXSwQ=; b=uVI3nfPONR+71v1OJktYcqF83rvD61KYwSbeTRV70DsMD4nI5YDgjv4+pmZ1JHSnMcneY+pZMeCLgzHO9xJEootBanNmokTUMks69v4wTU7RTDiknUklAYCfWKs7QlEFzUl6R3KRVg0TBukM0hgPUxiLQLxIxyeZmfL0irL9V0W+5C3dhsPWJJXXOcB2L2aaITyLfse+IPtXF8VyL0RPtTIZOyBBKvO8VL+Y2GOYwTz3sPC+cITcRJ6jtryd0nS6uzDkMA/jFmMqw6TRFpniie6PmNz7sI/M6jHZKFDFdtSsVoa7fyCF6mbMpWZVyfPZuSuLRyXov7j4bpnkX+8Bxw== Received: from BL0PR02CA0036.namprd02.prod.outlook.com (2603:10b6:207:3c::49) by CY8PR12MB8266.namprd12.prod.outlook.com (2603:10b6:930:79::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Tue, 27 Aug 2024 11:19:35 +0000 Received: from BL02EPF0002992B.namprd02.prod.outlook.com (2603:10b6:207:3c:cafe::cb) by BL0PR02CA0036.outlook.office365.com (2603:10b6:207:3c::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25 via Frontend Transport; Tue, 27 Aug 2024 11:19:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BL02EPF0002992B.mail.protection.outlook.com (10.167.249.56) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Tue, 27 Aug 2024 11:19:34 +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; Tue, 27 Aug 2024 04:19:19 -0700 Received: from shredder.nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 27 Aug 2024 04:19:15 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next 05/12] ipv4: Unmask upper DSCP bits in get_rttos() Date: Tue, 27 Aug 2024 14:18:06 +0300 Message-ID: <20240827111813.2115285-6-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240827111813.2115285-1-idosch@nvidia.com> References: <20240827111813.2115285-1-idosch@nvidia.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0002992B:EE_|CY8PR12MB8266:EE_ X-MS-Office365-Filtering-Correlation-Id: 58ad1c0b-d902-4898-e724-08dcc68a2177 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: C4nT0KYwRAoYijPYmdXKGSDcklHaNnZBZ2hE6onCKp5gLtDjsAmHn4OQt7pqqdaHYDPyb1UQ0DK3fwnUaKe/QvOQKaF+dAjUeMmiPbMZrtBDVHEAD3RiQeCVtMvObu/23iYo/9VOn1OQfhVWCLCSsVozRxIbSbwPy7m59RfMEH/lmvoW+FakffHCV7YlfVz5HxCIHSx7ZOQmdvVasHLEYZxucnfTKvaHu/zxa7N3KOLDaGlG5ok/FUWZ9WShO0kRcTlaTjvOknovHf0Gxk4SFCkzvW0KbXBdwiBBbwEXtaLHQGb/VovukrblLd42kqA7h3R8ZyZZj+p+8rWpdc/BlQ3FXOcl+9ALqbMkWER3Lh5O0fLTqwrWRfjrp3NAxe6xoYaW12TmP8YKRz6dcysLMmSU4vTPAyLlcq5+/vxgenNS+Pc8BluwJ6PXBbnrqnljq5nuUJPn5RJ5j7Mi1XRxUDkM6CwMO4/eaJVGLKqrAlpp96iD/gg0CuK8BZmYqN+O0EQh+ysNNOXfcWjgMU6QOdm1u6clT6fo9QdbIP9WJJw5Mp0uztDNDEV+GWH3qnTYA7tcg5GKcXUQc0qu2JwbtDeN0/W+Px4WkuqZQwVuL/kSZxDn8H2IIilf9hnaX0wJBw3/7VnJJqy9aG4lUCdq6LN8ikn4a17SoTuAnHPgyICLsb6oT35/A56pZaWu26VjLxd5oGbJvi/n6g+Avjzds1vJgbC/G7sbs3/VAuIyLA57sf+mhx9+sj+57xFtwTlQgANbfm4/fpvJGrqlA7o+aHpxDfKkrVYXf4IVBVX6vGyooLdIju6lUGlV1/AHMSn5fAT2fYkdi6YUs82bQLp98fDrr0HpRqjz6ZArzhDTXeExescAi/mt4mhNje4rxYtDrmCzWny78DVoS0KleKj7CoLW0wv692aUQGFnAepxttzL6k1VtZEOvoUfWZCvUe9hTaNZ4nhvT1f+rBH2gOzKLgymU9tSB7uFzR7+ijUnsIZ9Z0mQnEA4LmVkUvwy0E9a+yZ1XJiyV4FN/l7xA6qw2cSmCxU7pc5OzsybEI3KQvlae9KOrUkw2dUpv3ksxZsHPhdm4Pfwk6qH4sgr4bqG6weg/iUS7A6qavlKpYnfxi41nY3l/yRQnD5IfdHQttqhWTf5s2pejjFMGNFfHezwtfQhEkKwhya3E6EvXlSBQnt8TsEG/V45efsOEmClAPf/OSBspLrwnpj245zW3UgGc+hb+j7WENK79Jc8I7pwLYdIkYie3JNadnrZ/AB+x0UbHQMd/A4oUxxpsPsxXpVXSEY9ykBCLoJhGH9x9quXuguMkmO29LeD4UobY956X62uGJu876wL3PD/w+qHk0CUf4e/ZTJKAjRNPcKy2sK50Q+3gRWmFNAmO8q16oFHy2ZYLTxHQA6Xh7BxpkYdKZMhQEZe32yTG1JCceirkQhqrKr/M/IZKMGjggoMYADfmqWd 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)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 11:19:34.7029 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 58ad1c0b-d902-4898-e724-08dcc68a2177 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0002992B.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB8266 X-Patchwork-Delegate: kuba@kernel.org The function is used by a few socket types to retrieve the TOS value with which to perform the FIB lookup for packets sent through the socket (flowi4_tos). If a DS field was passed using the IP_TOS control message, then it is used. Otherwise the one specified via the IP_TOS socket option. Unmask the upper DSCP bits so that in the future the lookup could be performed according to the full DSCP value. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- include/net/ip.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/net/ip.h b/include/net/ip.h index c5606cadb1a5..2b43f04c7d03 100644 --- a/include/net/ip.h +++ b/include/net/ip.h @@ -33,6 +33,7 @@ #include #include #include +#include #define IPV4_MAX_PMTU 65535U /* RFC 2675, Section 5.1 */ #define IPV4_MIN_MTU 68 /* RFC 791 */ @@ -258,7 +259,9 @@ static inline u8 ip_sendmsg_scope(const struct inet_sock *inet, static inline __u8 get_rttos(struct ipcm_cookie* ipc, struct inet_sock *inet) { - return (ipc->tos != -1) ? RT_TOS(ipc->tos) : RT_TOS(READ_ONCE(inet->tos)); + u8 dsfield = ipc->tos != -1 ? ipc->tos : READ_ONCE(inet->tos); + + return dsfield & INET_DSCP_MASK; } /* datagram.c */ From patchwork Tue Aug 27 11:18:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13779332 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2088.outbound.protection.outlook.com [40.107.92.88]) (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 DAA69196D98; Tue, 27 Aug 2024 11:19:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.88 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724757590; cv=fail; b=UrwX37g4dvzWXlPr4q9MWZbbZremFIpGhgRZC1rx/GQ70bMIz5C20pvwDVr5unEpKaZRaOvkA805GSA4Kdy9pYCsSAG7hQI/G6IDHeCQ389kJ4QyrVWKaiJoHOFrYd2uvGiSJbczC6p/rXgOCqpmn2wDHHQNBUmI8gikTodA2pw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724757590; c=relaxed/simple; bh=BCY9n1j8fvx1aGYorSbpNoSErbYYfHK8bWdnwceLLr0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=R5QjodLu1p0N4ach3ylrr1zDIawQCoMjV5HsBHlfA2foNAvAmZ+3bvUR/+VbXfbvQRHSUitT4+JwYnTF7ZtZuTaoF9VaVdYksgkDMPGh2GFXuma4suzQ4sCGkyvcaYZezP+UCZMI3+/YL90ZLKZZuk394Q+4vwOVk1S8LSX+qTI= 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=sJUYN1fA; arc=fail smtp.client-ip=40.107.92.88 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="sJUYN1fA" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rGIUy9aRfOUKuFwQLrjX4zyCNKlDmktPw2qouJlcDGczOE17HGFNMxnuId1dbO6cKVBgPVvZQdsvciEs7eMDP7Q3JeRtx+fZK3A0Z5+3fuzogcymTYdekZ1HneCLmoZbq7CWyWAgVkXDugV422c4ESnoWU8S3MD0rnsMi8Shyq34hsGggZ7tDjKjJukASrp+gTv0fcpsepueH2ezoCnvF3p6HHQpJYNVHLRbSqLyKdgnFbZgnsPc8MlHzWDxGjokon8Q+zOOKDHDprRZvB5JuALiA84p8aH2Uag6gibKT3+UfB0MTBybPyj/Rh9Oxfeuv8JReiDNENlSZLNOD+qZLw== 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=aE+5zcDGRypOphruptI+RyVAQvxKMK6b2Iu8/PzdycM=; b=ujEvthy27qTyAVxNltTxE685GufFDaa0UqLdL0YD5vNIjnPsOafqlczomCBc7q1EOARXdt9/igzqp/Yz1hwidVKKPCkHzTn3f283w98vQnwsi395ZrIAbzB9Vi/UT0EgGqvDMFpRCduo4jtTdqzYK8IEyXvDZerM2939jPqP9JkoL/PgiZh0DfSt5SlzwNgUGh+ClRFbVoTXeyQKAzn8KXcAqL3rmYp4Ko/nCgRUQ1TQ+CnUL0S1heiyPXzwoY4hvXP9yxA0cPufhhhj+opM9VY/57NA66/bQFah4JqXkzrPw1kmZK5TVQ0UaWL2kdDGrEAhPdNHzu50p1Fmgt10Zg== 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=aE+5zcDGRypOphruptI+RyVAQvxKMK6b2Iu8/PzdycM=; b=sJUYN1fAypczD1A0UEnlyxDLU01VofciClUX334PuaPiPqFpCWoKR3AGfxhOjU67WzB7Qjd9LDLc/rdO32tEVvmPNpF64iDEegWidFhE4O55QPfeBnFK8F1gK0zjLm4K6tgQfRLYh4SQY2YCZn/0sWofv65gZIeRIOuseHRkesXrOQiVIZh5SIrCGYuxTWSlADr9S7QKjkg+2YmAMz9UN/3Kek6MBcMqufRPqKn1EmOqvudIgOK379PTDytHfVsi4dOQZovyQyRHLY64nmQF5Jn7ukAI+3FXF243KNk9qpiFgmzeWBgyo7XnVTz7S4i2veMXU0xnrdtsR6ta8mk5xQ== Received: from BN9PR03CA0189.namprd03.prod.outlook.com (2603:10b6:408:f9::14) by CY5PR12MB6370.namprd12.prod.outlook.com (2603:10b6:930:20::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Tue, 27 Aug 2024 11:19:44 +0000 Received: from MN1PEPF0000F0E4.namprd04.prod.outlook.com (2603:10b6:408:f9:cafe::e5) by BN9PR03CA0189.outlook.office365.com (2603:10b6:408:f9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.26 via Frontend Transport; Tue, 27 Aug 2024 11:19:44 +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 MN1PEPF0000F0E4.mail.protection.outlook.com (10.167.242.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Tue, 27 Aug 2024 11:19:44 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 27 Aug 2024 04:19:23 -0700 Received: from shredder.nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 27 Aug 2024 04:19:19 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next 06/12] ipv4: Unmask upper DSCP bits when building flow key Date: Tue, 27 Aug 2024 14:18:07 +0300 Message-ID: <20240827111813.2115285-7-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240827111813.2115285-1-idosch@nvidia.com> References: <20240827111813.2115285-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: MN1PEPF0000F0E4:EE_|CY5PR12MB6370:EE_ X-MS-Office365-Filtering-Correlation-Id: dff27d1a-ea3b-4c5a-50bc-08dcc68a2757 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: BnDjccjSpwovbIby6d07M8RVJOG/EsngP/RTb6sTo8/3LFbcfFUdsnXbcVR75aYZKYDdOWXRgVCD7XhKCM1sDpibsjo8NdjAYFK+ZYhgyO8BzA0aqclVjqA3Hbr4VcYYvgSRDWIaVvq4IDn8YotL7lB0B/63dxFrQdc7Ze9QBfU76C1Dg8BOBNefyjSK1R3ICVO6eKiwTMXB9l7U/f5W6lhtoO8OWTBEJNi3AZiyOQjyNs76zxZzrN47xEIQ8F8BjW5DsSWnrte3X0nVu1SU4D78s1bfvJ91fmWd6yatctQIn+vZh18QdV9IPsxsZ/r4DtLeNYmSptNqRzfJAzDvxckAWzqAukQck+2jsOnH7gog8kEteKJsmk6DTqbtgHytIH9FeFbyHgFR7xzH3SzjNVNbowiMlMsaSM2Y3W0gjB8lZdF1W3NVdpIsYqUz/QJ4ErQL/pZK7VGmg/88p+4ycrPYdFweuN9qVyxq8oNdXJDSeTHcRl+uTVpuAIpPrXPi/njyEBwwcIKKSDxkpTtnLQpyUnKjIk+aMwRyBc5lspFS0R+t8MQ/pqnbGDfUHXdBYgNAQh9Hr0vkJLlsA33wLd/Mj5weLGefjU6sgC4s4qz6khHi12SjtN44VkJuCFzI0cBQN3GoKGuNdWIJkHmBxjRm3xgUq+SZd26yt3RneoyM7uAiQjVxmi0mm0G/f3E0gteDAk9jk/w1mSgvkb2hWeUcrGDsjsmlhEvZhn8MCo90CfeGHJ5Vk5hbORupi+pU3ilTvH8pNWBCKACKAz56u4GthgUQtaJe54WE3lOcAR7wz2uKZa1CWZ0wTfgHUkoISWLoS1Z/3vlKFP/3mqFO7ndRmT52Q6fRsN+pNiBPXJxwAlOl7GFz5aJTur1tdFJt8ad7n0wP91uoyWpnDnHEHS9V7XbdVU/tD96V/oZnXYdVGcN7frMMPQZyh3bWu4a2OzS/BkfU73G8ZDX0XakBHJdUVfOrC8NmrtDKjF22rzJUj4HsXVOeajgCVijIX0m86gl03EviNoNxfl3c6RL1+UFoNxhS45jQuoBpz4EpyXme0akcrnbWyfm4H+6Am3R1R0x32uGvvcX/lNG7JKMVud/k8ap2S5BJPJUicRX5e3jieAzsg6QronfYsr47h4sqavlm4tmdwSDRWOv1sPJQYPBCzMzE73TOktBAbqLFscFyy59yvZcHaxwWChKhIP3+GEb4O78RUUs9F34D2onBoYlmnZpW6ph8BfYRbjjUr0YTlRcFTgcND/lAV/eAuthaXF8f5x84ZaHxYCZyRK6zZCjd0YkfMIy12660J600AvE2dG/Xb0w7IOaNh1JaE3F3lJkfd2aKZuLB6EwsIDqsJfo3Hli1sy8hyt1u9HUElI6WUKxT3w/sxy5yj8s9qEg/Cn8Ft5HoUW7rkf+Gmmy8XzJ6RSSFJrr7VUHHZFVrOXhue9/2sfo+TGd/i6iiMK23 X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(1800799024)(376014)(7416014)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 11:19:44.5556 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dff27d1a-ea3b-4c5a-50bc-08dcc68a2757 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: MN1PEPF0000F0E4.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6370 X-Patchwork-Delegate: kuba@kernel.org build_sk_flow_key() and __build_flow_key() are used to build an IPv4 flow key before calling one of the FIB lookup APIs. Unmask the upper DSCP bits so that in the future the lookup could be performed according to the full DSCP value. Remove IPTOS_RT_MASK since it is no longer used. Signed-off-by: Ido Schimmel --- include/net/route.h | 2 -- net/ipv4/route.c | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/net/route.h b/include/net/route.h index b896f086ec8e..1789f1e6640b 100644 --- a/include/net/route.h +++ b/include/net/route.h @@ -266,8 +266,6 @@ static inline void ip_rt_put(struct rtable *rt) dst_release(&rt->dst); } -#define IPTOS_RT_MASK (IPTOS_TOS_MASK & ~3) - extern const __u8 ip_tos2prio[16]; static inline char rt_tos2priority(u8 tos) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 5a77dc6d9c72..723ac9181558 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -512,7 +512,7 @@ static void __build_flow_key(const struct net *net, struct flowi4 *fl4, sk->sk_protocol; } - flowi4_init_output(fl4, oif, mark, tos & IPTOS_RT_MASK, scope, + flowi4_init_output(fl4, oif, mark, tos & INET_DSCP_MASK, scope, prot, flow_flags, iph->daddr, iph->saddr, 0, 0, sock_net_uid(net, sk)); } @@ -541,7 +541,7 @@ static void build_sk_flow_key(struct flowi4 *fl4, const struct sock *sk) if (inet_opt && inet_opt->opt.srr) daddr = inet_opt->opt.faddr; flowi4_init_output(fl4, sk->sk_bound_dev_if, READ_ONCE(sk->sk_mark), - ip_sock_rt_tos(sk) & IPTOS_RT_MASK, + ip_sock_rt_tos(sk), ip_sock_rt_scope(sk), inet_test_bit(HDRINCL, sk) ? IPPROTO_RAW : sk->sk_protocol, From patchwork Tue Aug 27 11:18:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13779331 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2054.outbound.protection.outlook.com [40.107.243.54]) (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 A5FF9198A34; Tue, 27 Aug 2024 11:19:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.54 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724757589; cv=fail; b=MATu5g3drH/+UnVNO6LppMPBLmVWvYabNZkd6GU3hZHocjUKC5AUZQJtNBEkpK5GQ2+ktRe3jzc7ItBwKG4Bo7PNPFIUO8hcsjgWcRe23fUZWNSzes3PzRHZF2QUZx+pCgnr9qT3hgzVObeTfJsHe3l8s653UefyxSVJda75IoQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724757589; c=relaxed/simple; bh=0Qv4ybhnSSpkcm8GFi8YArgQ7bADsaUMTi6ZIJeC/Cs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FQu//5gGsNnBrYPNLvpb8dbjglaXJklDbjYsiRSA60qFpllWNqUzXhtNVe0HS6Gz9U4UvWkuNRl7Dmt5gYjijWiiuh/EXizPlrEFHK6L0ETGOJQARuWnikSv7kmeWd3+xlZ4dHOPM1Z8gX+ynQH2rHUDEHVXP05ijnYntp/0fKY= 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=DMRs+Pzq; arc=fail smtp.client-ip=40.107.243.54 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="DMRs+Pzq" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UIbYdaz6vAqZza0Ufbu1hmPb7TkaZ6KmBP21odzoFuvic52XLw3kn3Y9t7tVy/w4iD9bE1GMFv198nYUV2IIJXGT3KtseKkpeoaQcuOeIGtVX0fQLu1j+m2eQhfROYG5Ak2qvuLkD428gCyndmbmZkhlP6tXR8bBEPl2k/wVOnz4W16s2pn3orHXCx+8gyl9+qUOqjHvNl4LNhxvn13bkbniQ0igOWjwD4xyHwZXsgTGv6yJgYdAe+jRnjvg/98JTTrD0sHATYB7bOMgVFdlDUGdv9goXZbEaWYNoax9XLz+KC7MeFch9ZhB8u1OZbHpCiy6qfDSsKOTH6W1HZjmEA== 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=SRRxiVw4vsC8dDiNvPJTwDAHtY4y8XoqWYHNCYyC2Bg=; b=AJ2RpvI3XTzTZMsIST5ZVnvb3q3nHa6FXjJTXOZ0diS5RlrOmaTHGuK9k49z3fubMCspczJ8yMVyMcFItI95zlQmZiqxOjz20e4GkhkYQZXa6s36GMQXjJHOK9jWYmKl++ABBGNK9kVSYWNio0rRJpTLNLXFBC01r5XZDN6G0HL1RjnoQTLUuZRuBcPh6eM+5VbCTQQ0hQgRY1hHQSrIeSHCyCXZFBe9vfO0OSROVxR3y5ityZZgm9bdKxnsN8ZLRD5rMoDE61eyQkRuApxlQt4IEKuZk+m8cZ6emSqUn5PmGDBmEruFeoMyaq4OVNI9AVSwnXUjmtEtmmRGanlr3Q== 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=SRRxiVw4vsC8dDiNvPJTwDAHtY4y8XoqWYHNCYyC2Bg=; b=DMRs+PzqvUxc0zFVDcocrEh5N0XDZ4WXzKYgWFBqaUooiDZHc8Stn55sB1zWZrhPFNv7HaSUBUVsqDK7NwgUjnRC5rqMMQSb/lTpQyj2lrBjLgkG4sgrAIk1eK/+iG8hwFTEgkbmV6q+WPquqiHJDqhY5ul2Rgv3r9Qst0YXKDxflhpNscjG0Y3gmjCz7Xaad/ar9Lf5d55kcBZ1CWa6H9RCyhQLy1j5APMQ5cb5ab1k9sJgvD/HCnKG2dUxQEJbK0do1UqgpYKeycD+hcYKVcqDaZCWWq3eo5Uq/cvvGWwi8RD1nX6flFXJymcI8QTEezD2hZGcmx0sX9hVlMjEdw== Received: from MN0PR04CA0008.namprd04.prod.outlook.com (2603:10b6:208:52d::22) by PH7PR12MB8106.namprd12.prod.outlook.com (2603:10b6:510:2ba::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Tue, 27 Aug 2024 11:19:44 +0000 Received: from BL02EPF0002992E.namprd02.prod.outlook.com (2603:10b6:208:52d:cafe::fc) by MN0PR04CA0008.outlook.office365.com (2603:10b6:208:52d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25 via Frontend Transport; Tue, 27 Aug 2024 11:19:44 +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 BL02EPF0002992E.mail.protection.outlook.com (10.167.249.59) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Tue, 27 Aug 2024 11:19:44 +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; Tue, 27 Aug 2024 04:19:27 -0700 Received: from shredder.nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 27 Aug 2024 04:19:23 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next 07/12] xfrm: Unmask upper DSCP bits in xfrm_get_tos() Date: Tue, 27 Aug 2024 14:18:08 +0300 Message-ID: <20240827111813.2115285-8-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240827111813.2115285-1-idosch@nvidia.com> References: <20240827111813.2115285-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: BL02EPF0002992E:EE_|PH7PR12MB8106:EE_ X-MS-Office365-Filtering-Correlation-Id: a81658f0-36a1-4701-268a-08dcc68a2718 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: Wse0irJXBD1NMnjy4tP4dnY83U7+s4y4SPxXvjwGbwT+nFs6CEHeHn0yxflGirULCfkDlx5EDuxl3wbGDlrzw1iqx7WeoW82Xmz5/j5HFOvdmj1BZJmfh3Zs3UDQdwatXQUPNrZ6q+Wgad9NJd19NZeMWKalLkVWxwcay+L5gHUUzIl0LQ+Rn0YmCRDwl82d33UMPwprl4fVbVx7NenGrrHtlte+xHz+dDJp0gGno+Sp/0nNM4T4CwOmv8jrrqqM2RMWYqXtl0Vh2pxEC05bLTuBBQM6+WlqGpx1LfjbSJfHOM54zgUbwMNMHfrCBtFictD2+04VGesKzJavVaUS6Cw+N9gqT6fkj0t5a0CH9WddlKQ5l64AbCkV5i5rLKDUJ3aAMIkKiJkGNcxkA1YSn7Ohg9y+r3GcYkcc7zOA52SX6zh9Q/lyfiYIlcZ7gFVwiIV3UekHC6CmMtoHvqM2irXobqWGg+nruryDbUjtF2eMdGwhP/AOHc1DwFq7tMAlLpaOhatM4KwvdmgbGD7/HcyLvQcvTsA0yxvYQH/Bq9DhCF+0uRfXDHPm+EWzjsE6u/C9mrPWyubsTD2pm5hrAwgdrHKpR+627IvknyBw8b3LprEViQH0oHC7FXIiJJ843YBU86aAjWu60Y3DDatC68tuE5YXQjzqQA3oUrLEbrejHOQiPXZF8sqk70/3LbKOrGG0yXvHHeWBvH7it36phf/abkMsDLeuIstt7hHWMyjhq/FirKK9+ebOA8FTmNijMcWc2hJeAamDG+HQN+yB0aYrTWewOJ/NVGbEwF8lHBaOX2LSGHU+uBwAf+eYkw+wZVjt8hZASWomUGKE0ODGFvFl2J8kqPWPcU9KVX5o6Uva4nBY9I61wf8iLIaHeBa0/1shAVOFFmcKeJ3VcyWmArd2XwpV/hY40EDV3OVWHj/ETBkYhsEa1mZdmY5sZBmujOpA4V8YF7Frxoyl/qBew3HYtu8h+Xg55hW/FJ/71B70LBbHpBxyLzcevERG1RCTEoUQGImO+YCIHY6EvbLU0LmPlyR5KzTCTyRcSSiFtkv/LZlQddQ7xv1u8cN6S+0cEQfor+7/4AH4cbw5rGjsWAe2gn3usRX1P+004UhjKGumTQipl7a+PZfRbk6nL94A9lSYS8DMRYNw0NYyTxh63Pw9pctMiUHz3SU6tY8uBs+bEEQM3IIUXjoeHmbmnVPh0AYJlGCxMkNGdHy05SmeKEBEAYT0734beX07lAJmbxRrpfWyAyMbLHpuLj1P6uJW8BnzX5IqlLwUwKhO5iXeCuZMAcNAjatdsgGQ+Ff+QknvJ8ii2nBhNNTFV8RzIofmcU0f5iloYKGQYHQ1Bam6sjjZWVR+wdVP7MjGGB2jZRjYSxJdqEW6QOlLd8211Bx/xNyihHArYX/C49eJ9sEV91WDModozl3NFiUODswAiPn4OgudLqRdvB2HIJyFlcQR 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)(7416014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 11:19:44.1417 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a81658f0-36a1-4701-268a-08dcc68a2718 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: BL02EPF0002992E.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8106 X-Patchwork-Delegate: kuba@kernel.org The function returns a value that is used to initialize 'flowi4_tos' before being passed to the FIB lookup API in the following call chain: xfrm_bundle_create() tos = xfrm_get_tos(fl, family) xfrm_dst_lookup(..., tos, ...) __xfrm_dst_lookup(..., tos, ...) xfrm4_dst_lookup(..., tos, ...) __xfrm4_dst_lookup(..., tos, ...) fl4->flowi4_tos = tos __ip_route_output_key(net, fl4) Unmask the upper DSCP bits so that in the future the output route lookup could be performed according to the full DSCP value. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- net/xfrm/xfrm_policy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index c56c61b0c12e..b22767c0c078 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -45,6 +45,7 @@ #ifdef CONFIG_XFRM_ESPINTCP #include #endif +#include #include "xfrm_hash.h" @@ -2561,7 +2562,7 @@ xfrm_tmpl_resolve(struct xfrm_policy **pols, int npols, const struct flowi *fl, static int xfrm_get_tos(const struct flowi *fl, int family) { if (family == AF_INET) - return IPTOS_RT_MASK & fl->u.ip4.flowi4_tos; + return fl->u.ip4.flowi4_tos & INET_DSCP_MASK; return 0; } From patchwork Tue Aug 27 11:18:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13779334 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2076.outbound.protection.outlook.com [40.107.95.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 085D219E802; Tue, 27 Aug 2024 11:19:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.95.76 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724757600; cv=fail; b=CxBYquoDzQFgsp7MyJHh1tqzTj7NMjOiOoidBd+MpBvonL7mkVDI6embhabTaqQA45v4bKWRs2C9LUDWIJ6tLyqeA1ts10dyJ5sJl25rU9eGGKT12MtY0IRrE+eBQrt0ZGqtQDEI30jbOImVKi9UkvNiP8nrjVbHZWGGCTXwBcc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724757600; c=relaxed/simple; bh=APNbrr/UCNrr6ZaEuU8a5UEsIcntj0yIskJvsac5GpI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZtCDJjU5Sm0YvtitxDRJguCBxXNfYD4mYnRTkJqB0aG8NvMZpRtRL1xgzywyJbOQJd7UDPWyTq+3wdITSRKrUV/fSDWBHDzqRQchWmXEOYP+5OPQceA4YQaOv9ZuOaoW5hiKDmHbh80s2kOiVNkDPxGAOTR7nJByGjJbe7ucL3k= 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=eliozZcE; arc=fail smtp.client-ip=40.107.95.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="eliozZcE" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lvScXHpaJWXpxcXP8feDpvay5NOTxLakq2hBh0+sHa3dn+WLEjj3e/4+Hlak4JlCP1pJ9P/ajBnUMMGJjZjeUssu2QSQluqHn2hfJ9f0rQw77huOXluVhyUdBopNeIpnwpmsRlEfdAdMGY3xsK14j5w8CcIaadCGXyluNlFZ89PMEZ1Jfw61yFf7lteMRpoMr9Yh9KKCL/pIJEvbYHZfBT/ZNvmA8EZpCnpNCJ4Cew6gbsbW5eJnKhWfQzxCdzlM5Kgq9iqyn0CVL1wy+P5YDlzuZy8Vpmd1pxLBFHUs7CZf+ILn+/ai21FqX3jNT8Uj3ruErrgopgFGTzv7V48SUg== 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=iMS2N7vOBZo2lrHWR+Taru9/YT9G88+xE5xprkm4+dc=; b=lS4ZishJtLlpJaaVfMRNVfYLaqkvPR34K/Jaabh9o/51kdjHEwHy6ONVl7nV97vY+KQ8lzqY6HOcXJ4rYfW9c6fCJ0TAMfye1zmrpQwO2SZBsqnrDNgQCncj0r2ghGqQrdRGQgFIHzy3MofF8O2ZaDMTZgbhI1+IVE8r3TJ68TmcjTpxbLZLHwLs/Plm15rMuWzXDnP+0yxAIj53XACaIeFHKoRNwBP1g3BCfv87Zdv3lnYuM3bwMy+bvHdIaekUm5l88YRhrmbIRqKNw7IbSH0WyY/wc7XoTMRxxiISeVk3nrMDLTsEgg3rfghJKkBZdF8KZddPiKuuI5NG9YujOw== 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=iMS2N7vOBZo2lrHWR+Taru9/YT9G88+xE5xprkm4+dc=; b=eliozZcEEHrpVzTbkH4MheCPDPyLBZ9VSe0E9e9SXXowVk54/7qz1GPXRMPsbwbqGqo7MQgURtVNvpgEjBgKXl+CYklC1j4w1MDVe/NAG9lNrQScw0ykkYVkDXzy7TA+3s12GtNRYDVfm3NJDhP/EU2B7B7pYGxuPb5ewf2bPkRM9ECE19YstSLAtSj/vy+1mJU70kDQ2CNP7zFVWQzkx/X80h1CL8oFAqAWSQyIA7TvbCjmOhlBeHrWQNMDgB+P9nMvbc4fehgQZ8IvKXtj38Qnwyhsi87xKbtQ9cEfCdh95fcKoWsoFc1lk31Chh/1+3sYex3asC4FrkRBBVC5GA== Received: from BN9PR03CA0209.namprd03.prod.outlook.com (2603:10b6:408:f9::34) by SJ2PR12MB8649.namprd12.prod.outlook.com (2603:10b6:a03:53c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Tue, 27 Aug 2024 11:19:54 +0000 Received: from MN1PEPF0000F0E4.namprd04.prod.outlook.com (2603:10b6:408:f9::4) by BN9PR03CA0209.outlook.office365.com (2603:10b6:408:f9::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25 via Frontend Transport; Tue, 27 Aug 2024 11:19:53 +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 MN1PEPF0000F0E4.mail.protection.outlook.com (10.167.242.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Tue, 27 Aug 2024 11:19:53 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 27 Aug 2024 04:19:31 -0700 Received: from shredder.nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 27 Aug 2024 04:19:27 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next 08/12] ipv4: Unmask upper DSCP bits in ip_send_unicast_reply() Date: Tue, 27 Aug 2024 14:18:09 +0300 Message-ID: <20240827111813.2115285-9-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240827111813.2115285-1-idosch@nvidia.com> References: <20240827111813.2115285-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: MN1PEPF0000F0E4:EE_|SJ2PR12MB8649:EE_ X-MS-Office365-Filtering-Correlation-Id: 04d40f1c-73c2-4463-8ecb-08dcc68a2c63 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|36860700013|82310400026|7416014; X-Microsoft-Antispam-Message-Info: Urbi45V5WsxzKW07pY9O/TximKPlxirvGMzTVRDuRY8sKZ61G4e/+Fd1QiGgvtxl2pcao9zzpUw5JtV4hTRiQuOq6kGY2ujwj5dTVNQ5Ya8mpnTiCpDPG//jH8AbYKqN2z8M+p7bLQr3VKWI3jc+jsBMCjN7snUZ4FX66l6/anbSmBu9/V3txgoARAzB/o+uWW2ODM8XiXQrs3/MHGfKF9f1esqj6CmRywYcY3kX/D1OjQhQibfwCpsxO6SNgWPrILHl9bdhDG68EnrQcvPAK6TN3FXchJUoeCiCNUbjLeCY2klCxSzp9iMpNE6b+vOVff4PwAQ7O+zc3BdJa5iSdvqIiXxV9L7+8olra8EYBESgKIL8u0lyZTKkyFrMObUJIh2aGmw5RmIgGfr3hIuZSpEUWYdxrHorMt+j5F9HCAGb+Xe+AuBcL/KmvF8SCC7JNgoGX6R8+w3Wjt3u2tMbsmh3Vcsu/NtyqtdSpzUTDpyHppFtN2XX6G/1GthJsCSZPyMcYnGbDCr3HNaMUNXH8n/0nNiQHQsSPVoETKEotDpNC6YZEMQg2Eihe3d4wsLf/umjG32YmMRfOA9iFDg8o4uVoHjSxFABU307TdFplI29iEFn3Kv7D6dmECi+Rls/jh2yET5YDz9pPqmpVsSMJ3yhYdfGOq3b4EOXIOgRlmCSluI1vZuRq4Ds0UYA5YKuj9pkjSAkCzOuufkZ4yl+v2ETNeRlAC0CReswjat2i8i79H9RZfB1mP9OSbVz6C+IawsGzezqaQH2ANClgBOAeO0V+bRsofX6XgJcjRolf4JEeG/KqIeJaaQB/SD4icu7BThVXaveHzj5/ZMQOTY143veyurdo3j52YrPLPyKfYnLWfXyWlV2voOQLpRKJWk7bqlt993+S+b/8nGHIz0sManIW0kVQnxISLtzpCn8dPDAt7bZ16RHhvoEsZTgpfSDl/7OesnWiGldlD83Ec4vR05UsCZGl+x11UlH8hHJpIfwXMUfWzx9MBB6rzT8uMYo464gOadI3y6zftALc7UuPgJ21Uay2KjF3nKL1q2RErzidyy2JU0CdY5DZGHp1EV6D+I5nu70yioMq+T30Z56U5v5Y+RU4pJaqH27VHLVhVJ9HaTQuRXy5rHqkNZKormopNsnNlIuiFAuf7/njG6d6CRaXG4v0SfvJC3s5Ms+omCugPmCB5JV50b6uGAlVfBg7Q68tMZOU8J23IE0rQ43m26arN2re+RVAdOPIDdpg6DEcq6R52fAenXGagLkc2UyFbxI7fj2W3wy/SjprTxEvcDSDnReFF1A4nm/0VvI+1rms1luZ4C8E7FmVdCDVH0N8smQvAN1FIODqRIAJYrin3qS1Y/qgrwGQzAAEyHk4FZ+qw+b06MzH5PVnhv/97zETFVcdFeAI52fVq55qxMOKtBwhc5dG5Kb+I/TewIJ6mHZk4yVce/4M2FDrjr9fKru X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(1800799024)(376014)(36860700013)(82310400026)(7416014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 11:19:53.0401 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 04d40f1c-73c2-4463-8ecb-08dcc68a2c63 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: MN1PEPF0000F0E4.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8649 X-Patchwork-Delegate: kuba@kernel.org The function calls flowi4_init_output() to initialize an IPv4 flow key with which it then performs a FIB lookup using ip_route_output_flow(). 'arg->tos' with which the TOS value in the IPv4 flow key (flowi4_tos) is initialized contains the full DS field. Unmask the upper DSCP bits so that in the future the FIB lookup could be performed according to the full DSCP value. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- net/ipv4/ip_output.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index b90d0f78ac80..eea443b7f65e 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -77,6 +77,7 @@ #include #include #include +#include #include #include #include @@ -1621,7 +1622,7 @@ void ip_send_unicast_reply(struct sock *sk, struct sk_buff *skb, flowi4_init_output(&fl4, oif, IP4_REPLY_MARK(net, skb->mark) ?: sk->sk_mark, - RT_TOS(arg->tos), + arg->tos & INET_DSCP_MASK, RT_SCOPE_UNIVERSE, ip_hdr(skb)->protocol, ip_reply_arg_flowi_flags(arg), daddr, saddr, From patchwork Tue Aug 27 11:18:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13779333 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2042.outbound.protection.outlook.com [40.107.223.42]) (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 A4F5419EED0; Tue, 27 Aug 2024 11:19:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.42 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724757599; cv=fail; b=r0mxpb91pzbFEi1uihkgp8l9AN5ZuPzqDGCFkzEr5QpYtlxk5aOWNMNQjTc9fvxbgQiVaLlXnNpfbfQ/EvXwhoTBxN+s55VZhS134VULCf6T+8gulfun8Z7qCHUxWytTcT5fnj29Z5UI9mw5rEQh20cYtRyT+Xe/cu5UqfPzMvo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724757599; c=relaxed/simple; bh=Fyz52jKHuBm42hP/JTx2nrkGhHqDKj9Wgo8sKy2WQUg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pGLnLu9CJPvXxBl1EM9tfivMBLsSAPuTHfEKZrauITO3u4BAHXdlwn6beszLPCvxZ3Ja28ieX3M+RWHjuCP3UUp0rgtsyC97qk+90J/Y5Jtwe/Sx2zKPgzcnwYigyZ5em+i404OSSQJ5vaV7bOZAlYTYGJqsYFOtHtlI03f9niQ= 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=AkPRi4J0; arc=fail smtp.client-ip=40.107.223.42 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="AkPRi4J0" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JZ72QJoSMs6Kbq3LfFuwTUOClk6j1x81Ts//Hhx1gJ83FjgEXlaZzzlqJHMGfFxdUEsQfIreEHwVjT71er993P32INaEtIsyPBK8vwxNt/A8sQGn2WIO7Lu3WkodDhxciL6VjvKAPDG68f0YyA/P0uVueRcz3/XticgszgrfgRi3+qHe2aAr9JE8w1j/hDVdlEWDClKWlimxCkyOSnK+OXluqRyRm8ny/pphCiKQ/eai07yIZZ+2KvsqX2RVVv5ys8TBQxpQCfzNWKp/ont12BhpnEyNzxSYDuALWeS67VrXH7u8gQy2FrjaKwC37y2ZkSk3I/Ajvrzuppb0kaE0xA== 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=qokbfmim53lgb6bEqM4cCVypLveI8YA4aI/FJ9K9xso=; b=uJyNdp1p9Oy5vAKBAF3LCskvrVmJmxd3byT/9tKPNzrSPg3T/unjEO9hFl2hjsVh1SQZA6dqYM3gBM+C6tqTHsSealE2+o5IB67E5u+8CuBLU/CNLXVve+olIU/acfF3Lz9rvB0JpAZ/NqjzhXoFaGCCu4W4KbNUL3ldMvPXRwJ+UsW5nWXy7PeZls384wDXcDQDBq2BZYyuCyHgVa+D3oW8lKwCa0BDvclSXZAE0iqO7hLY64zBR6+ZhFLy34qwworbuAnNarCeUaMpMdGFW1SvhYTVgrnyPPT93tev/2Sn6ZOyhz/KxVIuFZWzjuFVNH3M61m8W1ba64U/+gvDxw== 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=qokbfmim53lgb6bEqM4cCVypLveI8YA4aI/FJ9K9xso=; b=AkPRi4J0/niQCc2egDUG9sBCdSAy2loq2G1G3Br8IeWjbCG3BTeoj0PiJLOVcDa4fzG8mDcFvqucRf08/g61+hQJ/RowmIrwpQTrEZiqFAPyT8jPSsWRYtF5ofQ2KsY/Sh8sDac0l2XhROwxZ99nQt60Jw3nWKsqQKWWnfcKR+OygyD7lHDKwMldEbdyiOfNvyeAKb0Gqbjc72Ldd68ElisGLaXFj8njmKpcBOZdTKWXkWbM3awv3BuRl4zRFsVLLc+PNZU2Xu+KwBhr6Hh78ZOOStA1Mu83EFYDIdueBSEGLoER5NSeOm528lJWtfEzFefjF9FcrnRoYl8fhHE7Og== Received: from BL1PR13CA0194.namprd13.prod.outlook.com (2603:10b6:208:2be::19) by BL3PR12MB6594.namprd12.prod.outlook.com (2603:10b6:208:38d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Tue, 27 Aug 2024 11:19:53 +0000 Received: from BL02EPF00029928.namprd02.prod.outlook.com (2603:10b6:208:2be:cafe::1a) by BL1PR13CA0194.outlook.office365.com (2603:10b6:208:2be::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.16 via Frontend Transport; Tue, 27 Aug 2024 11:19:53 +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 BL02EPF00029928.mail.protection.outlook.com (10.167.249.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Tue, 27 Aug 2024 11:19:53 +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; Tue, 27 Aug 2024 04:19:35 -0700 Received: from shredder.nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 27 Aug 2024 04:19:31 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next 09/12] ipv6: sit: Unmask upper DSCP bits in ipip6_tunnel_xmit() Date: Tue, 27 Aug 2024 14:18:10 +0300 Message-ID: <20240827111813.2115285-10-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240827111813.2115285-1-idosch@nvidia.com> References: <20240827111813.2115285-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: BL02EPF00029928:EE_|BL3PR12MB6594:EE_ X-MS-Office365-Filtering-Correlation-Id: fc6a6524-593b-4b67-4446-08dcc68a2c8a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|7416014|1800799024|376014|82310400026; X-Microsoft-Antispam-Message-Info: w3RdunSxHZEun7yq/DV6AFFKD8VFCk8H7Zc4PoHfMVG7oBBayWuIFm8+d1WAOgXT4BGAWFo8Iw6I+XkMCf7YN9xNfpo3JmAScVfpWlI61NA47j/h4Sjlb8D9/a6aSjCGmBwp9fxdrH0JPsY2b4mGbv9b+ovqw8bshhofFFLdDVbV20rdZISwh3oTFynsI/2ddjOSvBEdjzFYLv27oFDCTQGv05C8oN2oLj0WoZhBwskasiS/3+gH0wC3QtgUinbln2BrwUyZFpFN8R80QKJgzLZ0yNIiqeX3rHufhORm3l2gHbLixfYpW84hVtTkZj79cHfF+uu0ibUCKPdD/Cy0/t5l3KHleqyuE/Ww8pE4iR96GL3TZHXaerPxCuWbPLol6DHqGIxMfqrW1LOywGAp1VQvXlOYx5Hgn9hqUNHIRB1/iCNcRMc5NJPsx5nW/6w1nAEx5Y0SRFL125D6LDqtVwAq3j1fHPa+qkBIilZzvGFwmZss64RF14DkkJ7vJ6G4bi84AC2C/bLZcXeYd1hupQvZcYwlYzIQG/1yUgewI6pGntmrMtXriP0npQmTx2Ilg0iONv0ERfuBHdjy6wHSIgtWZxeWJ38EZCfHTbyn4vVhdjuZwj/PcrHw2+VAHNnNEHnOCp3hx1p8VxT43Dz1MI1L4lHmh03dc6GbyZWk42swFvbzVBM2/ksl+E6HLjEZ54/K4zyQa0zB+a6qa790jYRJwc0US+ykLLCagg+4WRzldSp+8ataqXUeKWWI+KnQ13ljlSsYZ+C+ira2UenjAH93JcUqol5PW6ICTc2Bakz45/l5apTwTJX2fhRuRTagANriHt137akuUGOQfxTa74m53P8Co7HTPst3t7eeHvWF7TXvFwhXbcQGafXHOgPRvjziRlN312Dg04hQ/MeKyXMKb3HHALd//1uDAK9Nqc5+g89UZ8sIaFnrNEa0o2JV0A3FW7atNMy1FuIIJbzg5/YBjl9y4EA8IYgA9j2uuQvLJkhu2ZeuYeD9A3D/sTeKtmx/Z5J6GKYQKHTWeWlBofKq3U1G2UyzXC6NUOC6LgCRk4TiJ37q8pho2IEJjTvdYr79Qe98E+AMDNGtPec4arULORwRoAFt4XQ76LXLE8P00LmglyI81mreZnM+fJpQFk+YtccgT6QYO3xHgASddeS64ZeDlisRZpfTrxc1ZhPyYiBC9WQ7HBRzqplN2vfYORQoDsQrlslVOy3gT6PDvVLPNZ/sUeskkwoLgK63Q0I+eH3H2eWonwODz0Az62LoHLO+0MwP+xOStBaUuLuIJ3cDCetjt+fjPAxToD1Ehtslz89fA7hB1YMT+267ueBeMsnzvXXAOCPnsk07HQ5Ncw7oomkHJcRP0f58Jus71gODe1OqY5LBStBM5Bdi91nsKceCT0ZQByAlZyElOeAxzFjTJ1nxKx/P3MUmjb8G2OVUzPb/mNt1OWQWrF9HzgWU 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)(7416014)(1800799024)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 11:19:53.2781 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fc6a6524-593b-4b67-4446-08dcc68a2c8a 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: BL02EPF00029928.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR12MB6594 X-Patchwork-Delegate: kuba@kernel.org The function calls flowi4_init_output() to initialize an IPv4 flow key with which it then performs a FIB lookup using ip_route_output_flow(). The 'tos' variable with which the TOS value in the IPv4 flow key (flowi4_tos) is initialized contains the full DS field. Unmask the upper DSCP bits so that in the future the FIB lookup could be performed according to the full DSCP value. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- net/ipv6/sit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 83b195f09561..3b2eed7fc765 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c @@ -51,6 +51,7 @@ #include #include #include +#include /* This version of net/ipv6/sit.c is cloned of net/ipv4/ip_gre.c @@ -935,8 +936,8 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, } flowi4_init_output(&fl4, tunnel->parms.link, tunnel->fwmark, - RT_TOS(tos), RT_SCOPE_UNIVERSE, IPPROTO_IPV6, - 0, dst, tiph->saddr, 0, 0, + tos & INET_DSCP_MASK, RT_SCOPE_UNIVERSE, + IPPROTO_IPV6, 0, dst, tiph->saddr, 0, 0, sock_net_uid(tunnel->net, NULL)); rt = dst_cache_get_ip4(&tunnel->dst_cache, &fl4.saddr); From patchwork Tue Aug 27 11:18:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13779335 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2080.outbound.protection.outlook.com [40.107.236.80]) (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 59C0A19FA9F; Tue, 27 Aug 2024 11:19:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.80 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724757600; cv=fail; b=ga9VoHMYLi2349WY5ZV1JUXCJkfm5F6DKWBL9a6KkNU9VOHnixbtJS0GEO+bVe3st9joNqkbpeaCNT9fper4Px2dGY0XmjEVXbPZ2KfCvxO/bWkaAPM6flp3geMJ0tWWx2dzrFfki4joPXI9aTmFHHCD3IFjNsGpxGZ2PkaglCc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724757600; c=relaxed/simple; bh=q/5k6ot3xoqd7hlWEV14gY+MzskC1MBhrNI2Mj373Sg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=M0s+TgPNb+u/Oaj9IcZ2xpA3YReM2AkaaTeXzbWI+idPIm5p/B7UIBiVZWyuqv5BkzrLXNitWzT4eKWb1ykT/Dgwfo/syr98DXWn68EW0jyEQZwPHody44/usMHptozujdd8V9tE8d3VLVKD67lkgLI5tJ0Er0AwIBjJrE2j9Rs= 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=ZMRB4koE; arc=fail smtp.client-ip=40.107.236.80 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="ZMRB4koE" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lRklrnejhH6guYUHBm/wq1OW44d7KqiW4fOVIW1a7wAOGO5NjHE2pz285NKrxEoGxDoxP0GZdy0MxzOZbvKJCutYPFAS2jNg/MwvVSNvS7S3WViZmT2jztnnkHfPMCue00V1GQgnxiMBBG8NHees3EueQksfygvDbQ4hyIY9IpicHnMNgf3nKIczBUCNq79KngJ3z1kmM7Kua1hagdCaQ3gL+uB296vcimE+RdVKQngWkVQm9huhVlpedwYvHdK05ZRk9AVW/ZGeAmw1mMbsRVNTLR3ADmgiLEaEKhWSP6w3xnIOfBtSmL0gVr3Kh7fULDt4mv7SDwXuBOoruxiBRA== 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=YgdfvZkuelcLLpm1MQ1bLSOfwJX6wvJMkxjScOTmXaM=; b=wbd045Bj8hQtcSm5KmRggdRiV0FVNoW39etjCcawko/5lHtUs6Z3CUQQs3ZD62XHfwwLccJBCnpN7d1wpLojDy6oxluO0pR4mmtpUAKzSyzTATYGtpBb5LwZ/wbDKJ79ZBrFIgjrKvDkvDsEWXrSpTwYbUG0UKWzxDIHhUZfHea1VgqcZKgUyVW2F11kKB6YYiQ8s7p8ygsxaNqG6iSNHttoIkV5nkCLj5tKAFNJEJRUeuN1R5l2OemlBSrYQI2TUYs0rsNinFhETVw/CMUsmS9E5f31aJcmaFuL4eAJwXW4JkqCvi3SJlvc1Fhk9xnEZyXU5bglQt8Pa4vjEYychg== 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=YgdfvZkuelcLLpm1MQ1bLSOfwJX6wvJMkxjScOTmXaM=; b=ZMRB4koE8KiegExDO1mUQ5gEx3i5I4W7axhKoKuXTc6jay3kjpk5edCNIT1xBJzLlmFWdxAxXk9pRMZI8KTFvYbZgzqiNvyrxVp5y8/ERDCMgxTU6UxYf9P74fjk9ylYPUslBMDCYqsNz4D+b+3kSgyB9VE+9yh27NvtCL+QPMCKeCtuXOO0nhoBFU6vkMrNd+0O/ZGae9WIbhjY6/mXQbIGRxSvHXuKYHPP4bcpXSReUN8pWKHK59eF2yWvelaB9Sr8S95mCy2j/njDV2FLBRF2RwPNebPHE/RlI2KvVXOVTEp/sYX1Y9yybzxa47lREP0WYSqUrekz2BMdqYUC8Q== Received: from BN9PR03CA0644.namprd03.prod.outlook.com (2603:10b6:408:13b::19) by CY8PR12MB8065.namprd12.prod.outlook.com (2603:10b6:930:73::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Tue, 27 Aug 2024 11:19:55 +0000 Received: from BL02EPF0002992D.namprd02.prod.outlook.com (2603:10b6:408:13b:cafe::ad) by BN9PR03CA0644.outlook.office365.com (2603:10b6:408:13b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.26 via Frontend Transport; Tue, 27 Aug 2024 11:19:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BL02EPF0002992D.mail.protection.outlook.com (10.167.249.58) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Tue, 27 Aug 2024 11:19:54 +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; Tue, 27 Aug 2024 04:19:39 -0700 Received: from shredder.nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 27 Aug 2024 04:19:35 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next 10/12] ipvlan: Unmask upper DSCP bits in ipvlan_process_v4_outbound() Date: Tue, 27 Aug 2024 14:18:11 +0300 Message-ID: <20240827111813.2115285-11-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240827111813.2115285-1-idosch@nvidia.com> References: <20240827111813.2115285-1-idosch@nvidia.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0002992D:EE_|CY8PR12MB8065:EE_ X-MS-Office365-Filtering-Correlation-Id: eb3dd10a-8e75-428e-abc0-08dcc68a2d83 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|1800799024|376014|7416014; X-Microsoft-Antispam-Message-Info: SYpYMgU/uUGVWxq7wPjD3gjBSoulDUVJc5fqXNtW4mieFhEF0IOgaNWfY7LbGik8+e09rUkctdt/VzNrAgV0Iw3KWrwUL3fuDKvdxptIKvsUdPxI4w143AP4v6Iv7cGfbnEXmTVsYGrAR02U9gPUUv11Gzi0Zi4rQgVRu468DN8Lv9tppn2IIdtpT7sqnAEU17o/HIz8echRVI4jLH3Qp4WdBPBvS5k1txyyXpfKqBRyYIaB9sJd+CjWMZMI2uqCthUkz1CEnI9mWqm2PNC53xYB/ANy1nHBgD+kVMZnqGVXgpoJgBrJKtkDySXjHxNNnyPIDJKFWK65lcbBp8OYGqXrP/XBMt0nq9mRpGNCS7SxN1zZPYkqFVBgiokENTUvCxkDfAPslupIN2NjCt732Jr1Qm2ekgXGqAdBH9QVIqgv6E36Y6/8fWHKqrkcSOhadtolHaJboCuZMbZGR5pV2NVwa6J3i4cKcDRRCEeXXG/TPsBuIG8Op/nZ4jI1W9v86eqdUr2eBmUppv5YpFbyuP3GP4BvdweNss1TI2yoabbPOIhde9ZedW4JYpn0Sal6c5JTsU7dy+MEKvKwaqfsxAFWYabj5H+QNdcvdpjJXJcl+s8c+QrEXM9W2ZoM6jhwh8pHncIU8TXpP6dCWVK+TYeRfrYFtp3cu7ahsA/R79fkIt/TEtSCtNlXMH6oia/UJjwJxMQAk9VH/THmLXheRF8TMoR7nAgWduJCgRwRlRWUfWsgiC/+tnl6vtIvGQFmJ7ya1kFPeO+FGsll/TB621JqDQCbJAdY7gL92OFWM0jslR6Ruso9ZQfEFe925viILf+0ZtVr6RwDRAxJbFvW2O7npnYve+VxTp7pUVruWSWz8QoiMe9I0imetTRIvWygVxb8bZ7EJro/2BQ2ZzebL4c4QeI+Av++TzRY1x1hYENMBKySz9QQvkvhgfiyuEee7bb1/7sHfkDpqm/XOjG6/H/R4T7sp0D2pgbEbQGJBY7mceaFgjYEezCEHDAlILdfJIZDXDSZH0yrRr+6xhQqGhoxdUCB/9YBaA930+IG6FYa+lMcSl1WCluf5ZZzP55l6wDa7H4KCkPDnmapcFti3csrdMowglIxqL3ik8MlB2aOf5fqZ1wjJozCCIrRB/dDnnDj69m6lXVuHqO6I3EYEoNxzRjUbL7Z6y699mkYGbX2uS8/pHOcd+W0WrH+S0lIDLA0XfNry+a4kUtXkqhoJt+WBMz/tKnN4hCqiUXnpHezlQw0M45Tpszwz0vYdSMMm35CxsR5y9DYlx+KXRsQYpdw9sFyDV8AXXQgSt/ied3Po91qqFx6X+tHxWgcEMt+M0ChRU2lNU1H6xBCwXHWPQwGCcMft/cWR3t6GPpPC7HZl1Wlm+GF4jxqoa7W628ClHAr/i+ojci7eHypjsCDMp+pSI6Mp1CKybw2kJIHi4t2l2e/XH4vvjZiNqUdpYST X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(1800799024)(376014)(7416014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 11:19:54.9126 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eb3dd10a-8e75-428e-abc0-08dcc68a2d83 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0002992D.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB8065 X-Patchwork-Delegate: kuba@kernel.org Unmask the upper DSCP bits when calling ip_route_output_flow() so that in the future it could perform the FIB lookup according to the full DSCP value. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- drivers/net/ipvlan/ipvlan_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c index fef4eff7753a..b1afcb8740de 100644 --- a/drivers/net/ipvlan/ipvlan_core.c +++ b/drivers/net/ipvlan/ipvlan_core.c @@ -2,6 +2,8 @@ /* Copyright (c) 2014 Mahesh Bandewar */ +#include + #include "ipvlan.h" static u32 ipvlan_jhash_secret __read_mostly; @@ -420,7 +422,7 @@ static noinline_for_stack int ipvlan_process_v4_outbound(struct sk_buff *skb) int err, ret = NET_XMIT_DROP; struct flowi4 fl4 = { .flowi4_oif = dev->ifindex, - .flowi4_tos = RT_TOS(ip4h->tos), + .flowi4_tos = ip4h->tos & INET_DSCP_MASK, .flowi4_flags = FLOWI_FLAG_ANYSRC, .flowi4_mark = skb->mark, .daddr = ip4h->daddr, From patchwork Tue Aug 27 11:18:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13779336 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2049.outbound.protection.outlook.com [40.107.244.49]) (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 246B619FA9F; Tue, 27 Aug 2024 11:20:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.49 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724757604; cv=fail; b=IzOyjKR+kam5ka3T4n43YDJ4PcWgOMoK3Nj+70HdbhooYJNyq0q5VacrFQJHi0Nk45DScKbZHpyrDQn6sKW9YDqSDC5DVn1UU17ma17qvlFcHBGDBAMCzKeNmDtuvXU8Ym66FATSWnWxEIGSUpROizAwZBsJnbGlhluRUrs08qk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724757604; c=relaxed/simple; bh=6j92+AG2SkjSPGg8M+Wnnc0INH7Yp/nhRz+wbVynJhg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rIWqq8rTEbWGWqNelawPpMSLe2wmhsSaIBH24bgb2yskKpeEWeaOzepJpxtNnH1xHpPTREW7kOc/fj/VY2Pp9/mwYKpzX+jgpt1SpEMp71iNQeoQg3YDLYy7+jnE01mdnwcWEXcvoPdit3XWGo9q6Jo8iI9lmNIcWlaOTnBUdIQ= 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=H8QGrAtp; arc=fail smtp.client-ip=40.107.244.49 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="H8QGrAtp" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=keOFG/JwOr5tVJxVrG9OnQPuM5X8UzY4d5DwK78MT5Eb+bxe2w4HAe4NrpA0c7cjJ7o/KOyC92nu58in3G5e2HB9XGG1IRNAm5PHmhgVb8Mdrdj21Lv0uNBlcLh3po5Q16sbYrI47VfV0wRpkDiDcjh8NrK86TyKSGCRFunQMSxNcvAjTl8TauffbjhUQCerALugR9YYKaT8gv19eNGMec6dzh+I8GZyJSJH9FYCAjzFRndOTwCW+poGCSQ3BmsOL4LZQyjudoviAB2Xr7ShP45v8nOxJvaDN2YBhBL0bVLNUPax+knvS+ALJScxizj2f2AGSP2vPlkhRpMqxLKBFA== 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=4Zqrm9McsYc5XcS3ktiPj2ux3HVyL8Nl+oqyniWCFQo=; b=d5xoUccsm95ipqtEmLdPmFqibhBarD7YszTYXU6l8hHjz5wrou9SvRARuYXXPMfWn1CEhlgtwONReXw6KTdyUO12IpnQywBJGU5cIiUcmIaCaz81WZ4wQKIKms/2oSaB7t7rMB5FwQZPgwm+LQRYumNZROnSCXl+FSTSlRh8hYZbFfqX7UTlwmP0NIe7DxvnypsNgKU4sMZYG7W71UmhuFztabGVNf+ltvOq03txJdN0xwKX1OA3cf6NutcfQr83664wzLejqYij+HYGoqzbPq5Qn7Lt5Imva7zeO10dTKyfAggKoEXcMg/8pbuf2nSeGfmLETHEXoqXRnB5rfY/kA== 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=4Zqrm9McsYc5XcS3ktiPj2ux3HVyL8Nl+oqyniWCFQo=; b=H8QGrAtpzbKnl0UvZ3ZuJsTG9i1FefabZSZQBuZZsvbf1X3sRdGwaC9OdGokKjR+ImbdFALXtyIRK7vWZ3LCULdjIwnVPTNNuGBgWpuXTasXXJYNYbKLozchcphdaetGIU/fygFzaQczyIha0DRGxjhT6i8Eeb2Bz9W+L+FN5DTQs0ELmA6w7pC+cU2d+HZoYhUFCUmw9yHeXyciQRwg7Nx/j/1MPRSgEiMMUg+09/WesaQOmMuXwSiICj89NIhSM97XZJabzHgMbZoRiFhPfGZePjsRtkNTTYZdJBzf/HYx26i9CvShZlx/frg7Kx+iiXTV9U9SOUMC54vDtXcNIQ== Received: from BL0PR0102CA0064.prod.exchangelabs.com (2603:10b6:208:25::41) by LV3PR12MB9167.namprd12.prod.outlook.com (2603:10b6:408:196::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.26; Tue, 27 Aug 2024 11:19:58 +0000 Received: from BL02EPF00029929.namprd02.prod.outlook.com (2603:10b6:208:25:cafe::14) by BL0PR0102CA0064.outlook.office365.com (2603:10b6:208:25::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25 via Frontend Transport; Tue, 27 Aug 2024 11:19: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 BL02EPF00029929.mail.protection.outlook.com (10.167.249.54) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Tue, 27 Aug 2024 11:19:57 +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; Tue, 27 Aug 2024 04:19:43 -0700 Received: from shredder.nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 27 Aug 2024 04:19:39 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next 11/12] vrf: Unmask upper DSCP bits in vrf_process_v4_outbound() Date: Tue, 27 Aug 2024 14:18:12 +0300 Message-ID: <20240827111813.2115285-12-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240827111813.2115285-1-idosch@nvidia.com> References: <20240827111813.2115285-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: BL02EPF00029929:EE_|LV3PR12MB9167:EE_ X-MS-Office365-Filtering-Correlation-Id: e204d7b3-b036-455d-37c1-08dcc68a2f3c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|82310400026|376014|7416014; X-Microsoft-Antispam-Message-Info: zEY3fSNCdarWtGynJhC9ulPYEykr/yyTMKKJvnk3t3RILQ7w6wJotyndpVA2I9TcwXSVsvDD9kX+AFp8j2ctwKFHRpouuWglRyhQlfF7zXrMykmpmWnNYcoreQmqv5h7nJflWC/7bp5SqU/+Wrw6P8aSoCc/Y1kDvdM0J3ZpPSL6LY0u8xqSPnvyP98ibkhdRX3rK76lrcIAFQj033WIGsc76MaNBC6LilBaUFhhAeDCCqDzZXl8vuoNelzF9/sH25DlrSo+iObZdxQaKuN9U+qkkQBHu7zC8JGboHhCYUOdv8zCMo3AGFq9uKmLqMQLa33p7LDFc37cQAHb49RsO0KOb+Ry4d/fqe5jowiXux0vpiZQHU/Znt0nauDtbTWapqFnAcak8J8qDNTIxR7V6GQqhzNWqta0d04gA6jBXiYCj/e2xE0JxwcdxL2V4FUSRBq8PPR20T0Wuiblj5RbaCBK2LPkP8EVJa4rUHocNmxKFIN3TbXEVHNj8EFfBY50qji1DpuCxJ9g+oCMrvwp8fF0Wd9eWMo1Z9dc19Oh17Ji+9R3gTbT3tyA9EXDjataAtiP+MIjpzFZ8dwCdjAGWCCGd4dM+Owr/R1Sh2y+SWJrft4TjIDBO/wl7m38FQOC7pNPEQnr2blggtcisqqzF/b96I66YxSUD1/npDn1ecCVPX+CCRBNaT4p/+tk0m42l9OAHJ4TV5Nm1r6I5T6/CAooGWblDMDVKSsw5iorA2+6hsF0oaa3YssJ0accgtObRhrSduJcGCRZC/U2xwYwGaC7XwqOw+j3cATW+goGrspeAPSGMnl+wcgqmhp7r/Ip8SImDSRtdeGhVmg45PCKU8K6VZQ8n9xW5Mh/+1ECSu5ossZP6z/UVPyhMuaKGvDD3nbcwgkYxJlFn571dWkBPkX1pRe7re9Et1Pylfa5LqKGdPCUQgZ1HReg3MSS8LN6b5yitu41UZ/uvyWgzUU0y3L9opvWh3w7TdkDcryOJ2DTR4WAVnRdQKTB6z5bzgp5RsYMiimHVS5qWFrIBx+VLaoTR3ivlDCzqoDb9EbYBwrA5Yjok9xHawKMufr8ixYBmuw4V+T2yqLyRUuiCx+Q8WmV9STrQc6X/2HTa8/DlyfJSk/zZW6udBg98qspdAmMnB0yc2uVnqplGEESso6bx7vYC2KwHwYgx0yzI00WtABTol3fPByhLzgBTLYFtg5iIQZWsZF2d+/5NYBixqP2yb8oXC+BLLwWDQOH2opgub+WC/0UBZrrCx6nQgC0O0h0AUy1j9LLYLBHqtab+3J+1XXInUWQMX6DYTAeJNC2nkPS6HGSi4kSuz627tHQIKkskugDqVgmwMhkKG00tPFuQ4eEzNSeab2v41vy+JhxCBdtg5qf6rl5pnq2JWd/f+mPL5sIlx1Uqqs/qV749d+BVzexAbk4nsSVW7QITimblyIeTPyjx1Q/WEVwsnIzDlF6 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)(82310400026)(376014)(7416014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 11:19:57.8779 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e204d7b3-b036-455d-37c1-08dcc68a2f3c 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: BL02EPF00029929.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9167 X-Patchwork-Delegate: kuba@kernel.org Unmask the upper DSCP bits when calling ip_route_output_flow() so that in the future it could perform the FIB lookup according to the full DSCP value. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- drivers/net/vrf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c index 040f0bb36c0e..a900908eb24a 100644 --- a/drivers/net/vrf.c +++ b/drivers/net/vrf.c @@ -37,6 +37,7 @@ #include #include #include +#include #define DRV_NAME "vrf" #define DRV_VERSION "1.1" @@ -520,7 +521,7 @@ static netdev_tx_t vrf_process_v4_outbound(struct sk_buff *skb, /* needed to match OIF rule */ fl4.flowi4_l3mdev = vrf_dev->ifindex; fl4.flowi4_iif = LOOPBACK_IFINDEX; - fl4.flowi4_tos = RT_TOS(ip4h->tos); + fl4.flowi4_tos = ip4h->tos & INET_DSCP_MASK; fl4.flowi4_flags = FLOWI_FLAG_ANYSRC; fl4.flowi4_proto = ip4h->protocol; fl4.daddr = ip4h->daddr; From patchwork Tue Aug 27 11:18:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13779337 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2046.outbound.protection.outlook.com [40.107.95.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 EE9711A0732; Tue, 27 Aug 2024 11:20:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.95.46 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724757606; cv=fail; b=MxTgQbwjCYb3j0X0ZRmNam5Kr793VuSZX89j6+vux84a8tAAbOt5/X6Trg8BqJd5gItH3IG5QheI6T4vDf9mTBerkxcbSVV4D6BhVNXzQPvXf5dFCLvBgoInQtFc1gooVOKgzZ10Yftf8VeZnACyhVsVglVjPkFGEkgKICkZxF8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724757606; c=relaxed/simple; bh=5KTqU4JntSTsJdIhbrp6bHPxu/XXGn+lkQXKhaVfxFg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IUsfsYts9AJAHEBn3/99rfbD57QHk06ylGiPyzDFnhs9jtVZeg/rqNH+aSansnvs4rmDoAHre4XjBopFb2T3vAMKdfvrn0ZjXFBoamFyavM9EEWrh4IfgRZLfl/aKqnid0Oruaj0l+56Lw7NUL3Au+8odSRoE7DaNPKeeQBng7g= 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=eo8NvpkM; arc=fail smtp.client-ip=40.107.95.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="eo8NvpkM" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mJKydwOpIT1uLJmGrKOXHq7wFckHX/q9y4QOQ6JDK+9lVlZUTPDOn/ApRmdnhsurRpkUYW+2l22aAl6i/DCWoEKSu/RSUMVSq7D/16oU0W49j1oVwTTGjAxu1LZssx5Lm1IUHTy6qwsTmo3x5QPSrLX4Vaix9k0QEkmZ0EjWltXuBSoHjsPWi63iusHQiFTV/+T7rvMqhN73MKU7TB8Exuxr1BKCQBmAzzkg/JJB/98ph3dPNiGHdhTWfxiHeVN9Ly4Uwm3h1NCCfZcBIJXhy8yZNALxjwpeSYTnItjHuULkTPf2etl4EU7Dl7/6kssOjI2q/IitYoHdXGnu26Kmbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=alonQpJ9HT9EaR2IMd1Oh85w1Z/2Rn+SvwQrGdHkO64=; b=ZvdYuX8801pei7XR0Ul509SVPcH21sMtclfrH/agqdW/YCZ/41rFW8UB+7S++rAp1wL+hNLNFbY0WT+DkFbhp16JM3RGUZ7ycfe3oZx7Iok5INAUoh1fARlKJRdtsxSYvtd1fAXYjvipglJ3q2bEsh3ibe1sq1Z+L4AddLm5q4bPxaf0QMEnOgVWhFOanzKAxqHJNTqhWJYUxqVfJFd2ecSVez1lt11d93YOygHhOqgKB/OdMpkEAAAVcre9EgDWzhW7J84beBf1r7271mgD9Q2Ma+4uJDa6JNo5Y2Tou4ExPVMlMtRTRP2fLvZq2sd5buAwR8J99i5yxGVDm7AO6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=alonQpJ9HT9EaR2IMd1Oh85w1Z/2Rn+SvwQrGdHkO64=; b=eo8NvpkMfzCJPIjOLDpzUY8AnZwzqPRfj4/Ri5o9iIRYre0KlTPfpEbanjQJYLVdMEZ775zuQn87nh7/0sABp6eRouGcCVE30yQlWqViowL25hxEh5N1+5HsSiVGHcpMygNDqqFo/5/inrpsEVD+R2rVUf6eYJYkqoxojg193SZbwiFfkaySio6Rv5xF35nQrUuGyqHRxOEcrODmeDvIc9RL4847/M266dQvoSH2B1hSZlO6gb27+f54A1tYpKXEWexgKA5VxcWh1Q/EJ0M0wdRyLnJ5IlDxYiO2IWb4VHde37pTXhyvRsLwlV4ErwYvwybcfZRRlqysXmg5VBRrOA== Received: from BN9PR03CA0034.namprd03.prod.outlook.com (2603:10b6:408:fb::9) by CH0PR12MB8577.namprd12.prod.outlook.com (2603:10b6:610:18b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.24; Tue, 27 Aug 2024 11:20:02 +0000 Received: from BL02EPF0002992C.namprd02.prod.outlook.com (2603:10b6:408:fb:cafe::ec) by BN9PR03CA0034.outlook.office365.com (2603:10b6:408:fb::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25 via Frontend Transport; Tue, 27 Aug 2024 11:20:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BL02EPF0002992C.mail.protection.outlook.com (10.167.249.57) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Tue, 27 Aug 2024 11:20:01 +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; Tue, 27 Aug 2024 04:19:48 -0700 Received: from shredder.nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 27 Aug 2024 04:19:43 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next 12/12] bpf: Unmask upper DSCP bits in __bpf_redirect_neigh_v4() Date: Tue, 27 Aug 2024 14:18:13 +0300 Message-ID: <20240827111813.2115285-13-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240827111813.2115285-1-idosch@nvidia.com> References: <20240827111813.2115285-1-idosch@nvidia.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0002992C:EE_|CH0PR12MB8577:EE_ X-MS-Office365-Filtering-Correlation-Id: c9b26bcf-e648-4175-6c43-08dcc68a3199 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|7416014|376014|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: 4pStYhWBL7Oul3qv0u6gJ5aFhoZWokKgUByc/n+rbyYUkmlWXOvKXJFQwhWWl/8PRGNDNGswvH8CizApma1dS33gCZIqWDQ47GZQhFVmljgePniFpXAAoQo8qfd6a5fmPijRerxigKlkUV0gu3oS3zJc594HKp27TnwIyDhqmqE5QAz0aZtZkEGYFX+wDf5wfFZKhTp23T2sBKVPpXeCfJ8mqICehl83WCkSvvDpbSMkQasBkB8MF3LfaLSTyHGodUNIf0oI0Efj3gNxAQMDmQellY87NMXE93D4R0xOtBQHlUOyUYLEvH9oWVoID8El69qQHl6r5p79ZhM4ZWDm72kkR+PYOx6hhMaD7o5wKVjklHFtM92a+4iSVdK18A+j4u+/iOCXmqDYxnNkWfs79cLgmuFYE0BTO3eWR2dKchWwniUO4GqPabRbelOu9tu3T7RHvDMJRp4uGvGf6crqhmzcXkm2p6s21Nb5vsIie+kPDRy77mjKNQBGgzqArMGw+i9LFl8fNQWBENk4TGtZZa0CVTSSYvIlxVygeMvteXZJ8zFt+VNvWH5pWeiEs5KovDzaED6nOOfnYAEDuUM86SXBuIEYlOomgIUK2JxQGsw+B80asOG42vVi1FJBaNa54Wwo+S64QVzJCMeKPatgLKFwVr0S8ty4fvDPnHHYVUoqmA6j9dGnot1IODpA/aZN9v1xZKCKn15vyekubXKkJincGHERN/ih+fiNOvybO5ujX4YLjDKiXLnj1AmyDGjmunNT3pEKyH/p8g64kVJsfRtn+4HfFcVpMhdIQ3W8LWjvnCAQ65rnZEqzV1FYI+JDB4T1dFoNdd0XaExyeCEc+4uc/Y1vsfynhHwLJum9ChLZM+yU2LXNE8XydcayDwNGs23Wjj9yaCo83R5rIgLtJzDkCMECxP3WbelA2Ijj3NXebHXOfl0X+YpZ7k3y/EhEw5FBFsXDrnzYi37MLEppXN9DVJtWSw/VB0Y59vzk/el+KqRhdFmjtINY7xByUOXM84RbVJdzsbmtcQSfj0xpw/ySGaXx+1MlHi9jNmvZo09c7Hcy9fKik02aw12u9RoTtff7MPzAagzwS/hhC/RFjEL5bWEaSjhZ49Q++qC3dcA8MbsoMAgSSD9bE95MvZd5VIvTF1eAKWA80GlJ7zsqAShgOAlkp9v8YYF6oLgUo5gQmKja5OD/QXb8q6qzPNohJxBLzqOJZW31qD1ySI9fWHLaFsn3lyaFNCFMCvm/bLBF94neB4zsm6ml+R3F/vgYZW5Wf/dGBlUIixVoHw5u1ALgHmuGqXvkeGBWd9kkNLxfvO0TXct2aUnxZ9XJYK32SaxBe9B+hw0D+mIbkl7PyQ0bPawFDUiiqhxcaxiwu/8aJ3Fj4rCJv2ux6k/DleFIEm5SYWJiIklFoQg+XTL1QyIrfxHrpZemlom+8SoLOd30Q5p1WmrTeKG5ln8uQMEn 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)(376014)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 11:20:01.7505 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c9b26bcf-e648-4175-6c43-08dcc68a3199 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0002992C.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB8577 X-Patchwork-Delegate: kuba@kernel.org Unmask the upper DSCP bits when calling ip_route_output_flow() so that in the future it could perform the FIB lookup according to the full DSCP value. Signed-off-by: Ido Schimmel --- net/core/filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/filter.c b/net/core/filter.c index f09d875cc053..8569cd2482ee 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -2372,7 +2372,7 @@ static int __bpf_redirect_neigh_v4(struct sk_buff *skb, struct net_device *dev, struct flowi4 fl4 = { .flowi4_flags = FLOWI_FLAG_ANYSRC, .flowi4_mark = skb->mark, - .flowi4_tos = RT_TOS(ip4h->tos), + .flowi4_tos = ip4h->tos & INET_DSCP_MASK, .flowi4_oif = dev->ifindex, .flowi4_proto = ip4h->protocol, .daddr = ip4h->daddr,