From patchwork Sun Apr 11 11:46:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roi Dayan X-Patchwork-Id: 1464799 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=M39SMaqG; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FJ97Q1gXxz9sVt; Sun, 11 Apr 2021 21:46:26 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lVYXm-0004co-MG; Sun, 11 Apr 2021 11:46:22 +0000 Received: from mail-dm6nam10on2042.outbound.protection.outlook.com ([40.107.93.42] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lVYXi-0004ZG-HH for kernel-team@lists.ubuntu.com; Sun, 11 Apr 2021 11:46:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j+9Cqtz9tJ+pSYbQBgHQXTH0oKXs1wr2yPHsnJmRmbjJ7coyV7QiZdfjK+r5R16DjAgB0D0m8xmkTzi3o6JsOm+VKfAhFluylNfsfu73M5rc2UFjH/rwmadkixRLekcqiB3eVOVCJBu412jwLm5ISbomTF4cj//c6djaMWdLb6Mz3r6zudpm3Gu8fM5OQRTcDyiDCCR9JI8oP+7HoNwlrjLSe67KqnE0HCXz4Lk9mHZcYCL7JF+isaq6eBcJGVkIji0Cxg9Rm4aSxrVsHHWyvW80kNow52YDzM+C7/9+ZSLC/n32vqDa7TEPVzsjxE90NTdJKeNfmyAfZeOW3BmweQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=l2Er6HV7/nGF3IkmOWcFLzS3dGeCMdpFdWurLKhUm8o=; b=l/jFWLPemGSQJjvBHuNpSALM6EqW3NsQzkTjIeesDSfENEibsrLjmhZQN5x4qJNjHI+gI1EYxQ+yIy5joHM/3zc+t5NJsY8xCLIO6xH882qrCwjAzgbU6pzMAIx+ob0a2yBBGCAc8ARktGuRBoLBq/YjX7ieKErsT0qOIu5ihqZhEoTxpyRMaQ2NYc40TpXuwdOETVA0smyvl6BOOq99evN2+vbUDLPHqjFN3wC+d5dvYe6jaX3CevJ92wLNMUHIaF7LSKHp10XYzEDzHNp0u/wW8405cS/FZkgM7sd3r7OVaF6DSt3F/nJkGku5McbBGHzWCCJ/0rzHMxv13/Wg/Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=canonical.com smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none 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=l2Er6HV7/nGF3IkmOWcFLzS3dGeCMdpFdWurLKhUm8o=; b=M39SMaqGoekXIxw/GaQvMraUBi7CdGRD0CNpJKNGDBguW7sCj4uUzjzbzhEBWypu68yX8R2VxkUKL4L8LxFd8GXB4vaixt5jl9Iw4NI7rrXBBg8j2ym5RKfZH+W+Pnqk/V/y5ZGieBkLdXZ37PXZpw0Q0IA73m5pZjpuLAy7K6EAFKGvHfD1bR2UT1D5ICJMCh//J34eN3R2FQCBEAaFzrqnNp4J9Sfo8Lp5U+cagZGjfIBneFo83JFAaif0D6vUlX4eHeaSde4LEQZhD87lpiMfZyuqNU+6anMAb78cu4lx0FTQ/GEAJNnzpszubAzI6QpqjbZ1WJTZlzO6qtE8Jw== Received: from MW4PR02CA0027.namprd02.prod.outlook.com (2603:10b6:303:80::29) by DM5PR12MB1787.namprd12.prod.outlook.com (2603:10b6:3:113::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.18; Sun, 11 Apr 2021 11:46:16 +0000 Received: from CO1NAM11FT035.eop-nam11.prod.protection.outlook.com (2603:10b6:303:80:cafe::66) by MW4PR02CA0027.outlook.office365.com (2603:10b6:303:80::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.22 via Frontend Transport; Sun, 11 Apr 2021 11:46:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; canonical.com; dkim=none (message not signed) header.d=none;canonical.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by CO1NAM11FT035.mail.protection.outlook.com (10.13.175.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4020.17 via Frontend Transport; Sun, 11 Apr 2021 11:46:15 +0000 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 11 Apr 2021 11:46:15 +0000 Received: from dev-r-vrt-138.mtr.labs.mlnx (172.20.145.6) by mail.nvidia.com (172.20.187.18) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sun, 11 Apr 2021 11:46:14 +0000 From: Roi Dayan To: Subject: [SRU][F:linux-bluefield][PATCH 5/5] net: flow_offload: Add original direction flag to ct_metadata Date: Sun, 11 Apr 2021 14:46:02 +0300 Message-ID: <20210411114602.2003649-6-roid@nvidia.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210411114602.2003649-1-roid@nvidia.com> References: <20210411114602.2003649-1-roid@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f7346831-3fc9-4b43-b320-08d8fcdf69fa X-MS-TrafficTypeDiagnostic: DM5PR12MB1787: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:513; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 15Nwyt3EludzTb65jLhuknznlnAbrLFLFFhmBhE1+X9yV/ggl4rgoPAggL4Ye7Y9HcX/5+C+Ve5DrXmKZlftqcnnVc9XBzIfjepLjedZr/Xq1nB5cmhguBTYJ1wEhXCGIyLRE1nVRf5vOwl31C6TUaW17h13J2kZ2/gwFjHP4QuJR07h2PLRTg3VxtGDmW7zTUrdgAUrppo60lLK9U8dkPV7CN8qNSDuLMssiOdVu1azWeDxVz2EZg6pvyULkJtElSe0eCFmttSXb+S4M8/Xiy0xmfNPWhAG8BHsVjziGUIkxrJNdVRS400+8IulzkNYKGB+AJp0nelxWX0qx+v+zQTGPdklTT32VVuCijR+PI28T9FH7ZcRn06dpdbtKcjec2qa8P1PbN3YWZvjdqA1TnPXryKSzZ4fV/Ttr5JHkfIYf1arwhj9ecYlPGOqJ2imvw3V7zocskF5VVPG9pPDVlyXuREvypz+5zqC1Ta8zU5fVG1Zy7PS5W8iS7gEQT+BvKmHRW1c+cS/h1ZcqnJ93uckFCzEVRNvSlUTjKstfQktrWIFoE9wEr5dvGlwuZMn/dDeoiOlI1BZ66qApZPB47O9bPERMypKF1SJFBr5awKKCgPmch1iPQwrQMTgdu5/Pas0kBM19ACelO6oQDZQwmCnyJekVdmOBtT1hK1v1n6HoTZDT/ygEc3MqKojtPbNAVT9BK6jei6NIQyQTdeKOjsc1cNn+uL49vQ3WJ4xy5c= X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(39860400002)(136003)(346002)(396003)(376002)(36840700001)(46966006)(36756003)(70206006)(26005)(70586007)(6666004)(36906005)(36860700001)(336012)(7636003)(5660300002)(82740400003)(316002)(966005)(6916009)(82310400003)(8676002)(8936002)(86362001)(1076003)(2616005)(2906002)(4326008)(47076005)(54906003)(478600001)(356005)(426003)(186003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2021 11:46:15.7889 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f7346831-3fc9-4b43-b320-08d8fcdf69fa X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT035.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1787 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vladimir Sokolovsky , Daniel Jurgens Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Paul Blakey BugLink: https://bugs.launchpad.net/bugs/1922682 Give offloading drivers the direction of the offloaded ct flow, this will be used for matches on direction (ct_state +/-rpl). Signed-off-by: Paul Blakey Reviewed-by: Jiri Pirko Signed-off-by: Jakub Kicinski (cherry picked from commit 941eff5aea5d4371fb8a496a66e29aa8fc7a0c23) Signed-off-by: Roi Dayan --- include/net/flow_offload.h | 1 + net/sched/act_ct.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h index fcc7a4e2a25d..4f442ab26689 100644 --- a/include/net/flow_offload.h +++ b/include/net/flow_offload.h @@ -211,6 +211,7 @@ struct flow_action_entry { unsigned long cookie; u32 mark; u32 labels[4]; + bool orig_dir; } ct_metadata; struct { /* FLOW_ACTION_MPLS_PUSH */ u32 label; diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c index fe132943eac2..4627bb7bdfa7 100644 --- a/net/sched/act_ct.c +++ b/net/sched/act_ct.c @@ -186,6 +186,7 @@ static void tcf_ct_flow_table_add_action_meta(struct nf_conn *ct, IP_CT_ESTABLISHED_REPLY; /* aligns with the CT reference on the SKB nf_ct_set */ entry->ct_metadata.cookie = (unsigned long)ct | ctinfo; + entry->ct_metadata.orig_dir = dir == IP_CT_DIR_ORIGINAL; act_ct_labels = entry->ct_metadata.labels; ct_labels = nf_ct_labels_find(ct);