From patchwork Tue Apr 6 17:52:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roi Dayan X-Patchwork-Id: 1462961 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=ks2j8nN+; 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 4FFFYQ2Y3Yz9sWQ; Wed, 7 Apr 2021 03:55:22 +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 1lTpv4-0002zt-6t; Tue, 06 Apr 2021 17:55:18 +0000 Received: from mail-dm6nam12on2045.outbound.protection.outlook.com ([40.107.243.45] helo=NAM12-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 1lTpuu-0002qX-Oc for kernel-team@lists.ubuntu.com; Tue, 06 Apr 2021 17:55:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KfScaLW76aCni2TfosekMyoKfKZlUS8MQamZTtaBCVhvRbu4e+2ue14V2USk70OIjG1TsPolb51yOP6DVl/+0+PJy4+205erekkhdDMlFJ8/9/GNHBgrY0Y5cRzfI4eOrPd/vIcy134bgQZ+zpFnBmNAmZQXDgXaKQgEu79w1YmHEyxe4p+sr0nFqWbcU+7TGZLO7VjAaWKYikTkpz5qJtW81Qbs5HYyBlg0dwwylyBqZ8vKxJzLSszRC8U8QkAPkmo4RCn6ZTfRvKalsQUTttJAgGfGsGhRrx8OMhlGhiZU2M+G3YOWLfROF92QxHc7LYYIV8PwxcOlXsYS0NIs+w== 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=PdRKfw7UeFQBo32czXBvaRPCU2JIHhWRGjE4Ex65PME=; b=Z3ITHqG/PWOjkR4Ix3uwu+mltyPuly7fCUyoBJyoz+UxM8Q6wpT++5oMDT/VY8rgo811+UcqY6Rf5vZD6jm0TX9dVYeWBGjgbTPKT5JssPh7jU+lAbfNoFYi/A9VvK9IeGdSQ8N+QXORPZJ6FUeApHhK/LmjEF0TOp+MGnA2iRQtjuo+X/lQYPVQN7cpPZ2lyzyQSfXUvuFvXLEtt82qb79CkeLPTAoDpJ+UL9GwQZgGVcAQlZ+Ro3Smvi4yhD8w+WPSLXaStvzGd4pCabQIMGjPf192q8uHw11wFDFulqXgSUHt4xikYh3U0QUBcznM/DsspJ09L3wv2F2BCTygxg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.36) smtp.rcpttodomain=lists.ubuntu.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=PdRKfw7UeFQBo32czXBvaRPCU2JIHhWRGjE4Ex65PME=; b=ks2j8nN+hFBss0/4dbCXZjDLhMJEN4Gish4xCKJXdFR1kue6DnAK9MmI/1sy5PQPPFadSe0c6vWzEVcfHEse1aB1t7+GrU3Ete+edeVrmS2pz6H7vwD7P9IVpJkitZpv7NVqokhDco2q6wrJFsDq7XkHVkZDEVCXS7c6A5M2hFrehNAp/op6hquzN+V/08dGdxR2yQUbH5AYIXMHRutIIe/ar77+XJjQxbLpTTntroGZvnFdMd4srz9OAiv3NAmAFZeH5naPmZgYm6spIU4p46cO8uahGkSDneLDOcq6ZQCfNDv3t/yfsRpg3oLcDnLJRGwW9nz/YChxEAGv+8TPvQ== Received: from DM6PR18CA0018.namprd18.prod.outlook.com (2603:10b6:5:15b::31) by BN6PR12MB1876.namprd12.prod.outlook.com (2603:10b6:404:104::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.26; Tue, 6 Apr 2021 17:55:06 +0000 Received: from DM6NAM11FT048.eop-nam11.prod.protection.outlook.com (2603:10b6:5:15b:cafe::9d) by DM6PR18CA0018.outlook.office365.com (2603:10b6:5:15b::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.16 via Frontend Transport; Tue, 6 Apr 2021 17:55:05 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.36) smtp.mailfrom=nvidia.com; lists.ubuntu.com; dkim=none (message not signed) header.d=none;lists.ubuntu.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.36 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.36; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.36) by DM6NAM11FT048.mail.protection.outlook.com (10.13.173.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.3999.28 via Frontend Transport; Tue, 6 Apr 2021 17:55:05 +0000 Received: from HQMAIL101.nvidia.com (172.20.187.10) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 6 Apr 2021 17:55:04 +0000 Received: from dev-r-vrt-138.mtr.labs.mlnx (172.20.145.6) by mail.nvidia.com (172.20.187.10) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 6 Apr 2021 17:55:03 +0000 From: Roi Dayan To: Subject: [SRU][F:linux-bluefield][PATCH 9/9] net: flow_offload: Add original direction flag to ct_metadata Date: Tue, 6 Apr 2021 20:52:09 +0300 Message-ID: <20210406175209.1714809-10-roid@nvidia.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210406175209.1714809-1-roid@nvidia.com> References: <20210406175209.1714809-1-roid@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 471559f7-129e-44b7-a3a8-08d8f9251c56 X-MS-TrafficTypeDiagnostic: BN6PR12MB1876: 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: qifN7ShelaK3tLkWIbZgwcvA/8k2NpFR9QlN8bQ+z8Ym98dB1p72octBBzXklYlCwM5enPXHSE9UtEqZGcHMMkMeCLxB+F5VS2sQmcvvvzCsbq2Jb/raiUunSnsqtUivT9sKLnTJy4r4TTmhD+5naNvJXf+mD00BRAYw7EVCtoQcfdJ9Flole7pFzLqU5YQbp7CxsaomyWenCvOXquzeJpFkLGpWhIyIYGfWXmyUmdnbGs90zeU9FmkVsEjlulCjddRarW1AvW4ALVlqQBYE+A8hgyDR0Tcj8C915EAkl7KWR0+rpL0Dt4DLb6jspW9FgmU9UbagGXK9ghAxLCF3zb3jMZx7j5WBnEZvkAjuwuRxKb9uPXW5wO0x4GAEfowZ2Kf5+x6Gd0Rom3uUGuX3Ua/pGQSZU+P1pgyG+5wGmir1yHCtWr4/mnkOIhRxHxukjnWjIGMrjdqToGz7jr7jE40grNjw9RyxvghEuqWGoW1MGDhyweNX3OY1MHej00ZvH1A0UkB+DsfIvA6Lv2c832YrrR0WGXHONJefXY8aOr0FcQRS2ln0sHZykWws8gw5zEvaLqdZgyVeNYEPLuulKNjkxQCy2aDkrh2FNOpCasQjjQR0W44hQg938PchvA3SxMypL/uE4zMpAKJBzvkzYYx02cHi41FUtRcAuk1trs4XzN8TP8sVBLsVjbwMnMftH3cfzcjrwzC3fkOXq+0L/+r1xr1k1yrA7uJJV4TZCa4= X-Forefront-Antispam-Report: CIP:216.228.112.36; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid05.nvidia.com; CAT:NONE; SFS:(4636009)(39860400002)(376002)(396003)(346002)(136003)(36840700001)(46966006)(186003)(8936002)(966005)(2616005)(1076003)(2906002)(6916009)(82310400003)(8676002)(36860700001)(316002)(107886003)(54906003)(82740400003)(36906005)(478600001)(26005)(70206006)(336012)(426003)(86362001)(47076005)(4326008)(7636003)(356005)(36756003)(5660300002)(70586007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2021 17:55:05.6382 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 471559f7-129e-44b7-a3a8-08d8f9251c56 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.36]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT048.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1876 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/ubuntu/+source/linux-bluefield/+bug/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);