From patchwork Thu Sep 5 16:51:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 1981343 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=Mr8zwO5O; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=147.75.80.249; helo=am.mirrors.kernel.org; envelope-from=netfilter-devel+bounces-3713-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X05850q7kz1yXY for ; Fri, 6 Sep 2024 02:55:17 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id AEEB11F264DA for ; Thu, 5 Sep 2024 16:55:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B28591A4E69; Thu, 5 Sep 2024 16:54:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="Mr8zwO5O" X-Original-To: netfilter-devel@vger.kernel.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2062.outbound.protection.outlook.com [40.107.96.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE2181A073B; Thu, 5 Sep 2024 16:54:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.96.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555248; cv=fail; b=oCkWEIh8PgT+WFEhnsMUr7uD6vflJDRyxYls50AKvoTGxX3I9Qhw6TPYLl2ygYJ25wXDAxkDOaUoMCFZ0cy3PTDIF9g7a3kfha7Vku6kJDzekAuEVJw34JQOTvOOeU7JacvSPQG6PLRLJQH8Nlr2ewxnm+YhvMqoPhabtrgf3jY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725555248; c=relaxed/simple; bh=B7Zf5l2IYRlHjaXCYqXQEbwNa5e79x7bReIJc97zXYI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=q0zgIGpHw2lkquPh62wE/XzZJXW7tC2ueN0dHU2YMUlp5Ua1SvT2ElP4tEl+XrqLju/pERyR/6QqUKhTnfoOusvwjWEkT6F2df3a3U5IS8fjcaxdWkYt68nzaRXT/Zfng44L0ZMqckDUlDoKJWXVAi8LMfPfKUOoGvhEAJslDCg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=Mr8zwO5O; arc=fail smtp.client-ip=40.107.96.62 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=F83MV97TZQ5bhfiQqPX4eCN5+m3aL10VVSaSahZDaO0Vgg9IlpjK0Cvfy8vB7doibbGtolL0DHdhoGQtf1jVHSXXSf2+Y6bsunt1w3ei1opqvdEa8P9nbt+sYL3hP3FdUMQmugNHk5wE/taai8m/6LQ9KMy/1WymrfSWBNSHEa9aWfNI8GG1d2sm17Hxi+RsYtzaOBCaVVNWK/j2shkYuGEHpyFpcH67+ScxDQrWCECzckv0GAgrUANa78UnX+Q+UwDdP/EyzawOLXU9qTPQjS/Z5H3VDgjOmB+Ng+euTnDQmB+1K4ve4QgOi576hg6/zz4y6eE7PohDaUbF7IHO8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=krMxDlktnnPk8S9qsZwUuIqIucu2zygBKdu5hpxol6A=; b=goFBmvO9T3L/yV5d9R1y+baaArRK/i0QoQXUDOcnWM4BkVrZWxRR5DFPJ+BpXQBrxKZ8/on4qjQlyF2YZ5fHaSL31CYz32ZI6PwP3UZEeJDbpqTHLuXimILaVbXACnj4k9ekrzFZeHa24NAejJnkIdjsPmspI7+9cOubKbdqHt3sKw4a6bdQCWHbsAVaPNbeL2AbeCFIbVZz09ScjdNKz3C6T12WKm/XdRpaEyka/kU5b7BtLaCG+jsSrtv54/PQembsKKIcoidLfdEBIxKjElUYXACPhxHK9PWT/9wxeujPhFyB9O/AzWGn++P3GUFR+7/KUckOuxa4EyGwwBKhUA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=krMxDlktnnPk8S9qsZwUuIqIucu2zygBKdu5hpxol6A=; b=Mr8zwO5OZA8+eQWpG4bdynxKAvig/KWZz5gJsYRMKA0t+MoVWes2GzjxGCoP95oeoAC83Sf0Ol/Fvrn4YU93pZ/ydEypdtmChmy1v+PcU5b9KJGeY6vkihdBQ4LpEnr7klplNxsT3Nq3AzsNGhJ+VPct3Jfmn/mhInGTiR2Jdo7TBtvNW+zXLmeqH9veHkigKPe34ViRT8HowyYAA5xX9anZKE+eK9uSv1XnnsCMj7vmkq4A7utgWS/coPK/xe6gFxxqLd2oz4CZz+eG0uWAbZMv4Nu8dXl1R0un5L6SMqVU7VuH1EhkcNvyMq36p8F4euuqKh78YjxPSyEBLqmPoA== Received: from CH2PR10CA0001.namprd10.prod.outlook.com (2603:10b6:610:4c::11) by BL1PR12MB5707.namprd12.prod.outlook.com (2603:10b6:208:386::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.28; Thu, 5 Sep 2024 16:54:03 +0000 Received: from CH2PEPF0000014A.namprd02.prod.outlook.com (2603:10b6:610:4c:cafe::b0) by CH2PR10CA0001.outlook.office365.com (2603:10b6:610:4c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.14 via Frontend Transport; Thu, 5 Sep 2024 16:54:02 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CH2PEPF0000014A.mail.protection.outlook.com (10.167.244.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Thu, 5 Sep 2024 16:54:02 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 5 Sep 2024 09:53:49 -0700 Received: from shredder.lan (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 5 Sep 2024 09:53:43 -0700 From: Ido Schimmel To: CC: , , , , , , , , , , , , , , , , Ido Schimmel Subject: [PATCH net-next 09/12] netfilter: nft_flow_offload: Unmask upper DSCP bits in nft_flow_route() Date: Thu, 5 Sep 2024 19:51:37 +0300 Message-ID: <20240905165140.3105140-10-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240905165140.3105140-1-idosch@nvidia.com> References: <20240905165140.3105140-1-idosch@nvidia.com> Precedence: bulk X-Mailing-List: netfilter-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF0000014A:EE_|BL1PR12MB5707:EE_ X-MS-Office365-Filtering-Correlation-Id: 36b584ef-5b9a-4c21-1dce-08dccdcb58b0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|7416014|82310400026|376014; X-Microsoft-Antispam-Message-Info: p4fYSl2PxFJnCKkMrEQmJCZ1O4WJVMc5y/yO1gnX2n4+1XNf5YR8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UL+7zpMEbrtP3GL3WJCG1qjSruiC3yQBIZVS5WQMt4snUHIscgdvCLhRvrqs375EqLT2hjVHuWE0OCoxAElxH674YJCas5wRfwLVTbY44uO1vdrdcRFrks1Xl3/VwD+UD5rLDIc1oZ5ziC5xwZ3IngHuqKQ1aaFQUWB6NiTCkxn3cpH0b0aPZt+fzmab+RdFoERgjERQqvU0B1Uh0zHwrrylrwQfanXAbUKVaOUb9DqpnsgSBgOKOikiyEBGVYba3E1vzNISZtDNkOCHWp1aaawIZx2lnSwjNZZ8lqKEi/M0ByOS+mzh1LDdQcAFzee2rI/C3q8HBPOGDBKQtsJdYDAT X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(7416014)(82310400026)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 16:54:02.8197 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 36b584ef-5b9a-4c21-1dce-08dccdcb58b0 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CH2PEPF0000014A.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5707 Unmask the upper DSCP bits when calling nf_route() which eventually calls ip_route_output_key() so that in the future it could perform the FIB lookup according to the full DSCP value. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- net/netfilter/nft_flow_offload.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/netfilter/nft_flow_offload.c b/net/netfilter/nft_flow_offload.c index ab9576098701..8e7234107ae0 100644 --- a/net/netfilter/nft_flow_offload.c +++ b/net/netfilter/nft_flow_offload.c @@ -9,6 +9,7 @@ #include #include #include /* for ipv4 options. */ +#include #include #include #include @@ -235,7 +236,7 @@ static int nft_flow_route(const struct nft_pktinfo *pkt, fl.u.ip4.saddr = ct->tuplehash[!dir].tuple.src.u3.ip; fl.u.ip4.flowi4_oif = nft_in(pkt)->ifindex; fl.u.ip4.flowi4_iif = this_dst->dev->ifindex; - fl.u.ip4.flowi4_tos = RT_TOS(ip_hdr(pkt->skb)->tos); + fl.u.ip4.flowi4_tos = ip_hdr(pkt->skb)->tos & INET_DSCP_MASK; fl.u.ip4.flowi4_mark = pkt->skb->mark; fl.u.ip4.flowi4_flags = FLOWI_FLAG_ANYSRC; break;