From patchwork Tue Mar 14 06:36:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louis Peens X-Patchwork-Id: 13173744 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D2E8C6FD1F for ; Tue, 14 Mar 2023 06:37:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229684AbjCNGhI (ORCPT ); Tue, 14 Mar 2023 02:37:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbjCNGhG (ORCPT ); Tue, 14 Mar 2023 02:37:06 -0400 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2122.outbound.protection.outlook.com [40.107.95.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC49F7C3F0 for ; Mon, 13 Mar 2023 23:37:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gbmyEZhzs3YMseh7ZZw9M/Rb+6VMyBUvfknIMMl51xVUNQdCJDEUOJB0UNGlW1bdZjN+vYkBAwmNAnF1Ya6RcpOij0gyFbsIiDF5UY8LCv1tdwP+WCAY2EDm4dFEW6swVsuMgF51peOkAqQwKk35DytdOccDAMjldffutcA1xrroDmU3bOh7LKlMqXNa52EiAj6wdIJIA5QaZ1HQBI8F7IhMo6NRUG3ktWHUSCb+ZQUsFijPox0uVmooq6gFDIbZ86R0syz5Z2tGF3Bdb5eGxx5ZexKUuk5uDX1NjHKwivGLaF/sOS8KfX7PAqKN/5W9N7iHltooOskvSqe3p2ufYg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+ThK5VKosdzObkrCu7BV/WxZ2JiCcFM5ZqVokEi1fOs=; b=B7ZYyW77rs1lWcc14NFW4R21sjwl7+92lh6fw21JNW6yjUXjH8LzOiC11p4KHfQsFcx6IdWUuDkk+CTQOPUL2VtxMMUjLJGbSJtRQTvzVvI4eRLhxhK2CSQrJltEWJ2umNWBlvHHsWDVUQ9py7p2tjPdr0JbA38wgKX9pXHMZQfQCXvNNUi1CAln8CIOrkJxjBvpzBSI4ZAW3nbUvMBOuPJDKbewmZUClv1sEY7XzAGJ17WVn8vGxzXuykBpzzqP+tAQC+Ii70hMy+JPyCAGvHfvnuulsLNLOpNeoUpRqWiJ17Eu2c2Dtzi8v9YXP1mtLEHQb30gPQr0XtMiwdMcPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+ThK5VKosdzObkrCu7BV/WxZ2JiCcFM5ZqVokEi1fOs=; b=mKS5pw3rrcA+JwqNOh5f/eADPG+oUW6leMUSxeDKs9rCjVKY9u9e5KbTn+fe0JWC9FtGKwGU2o2CjujD5mcvfLlG/d7S/fTdiynEiDhdmIi4FafEWPVBuhDS2JtzH5943aGN7CS66JXkgx+OAfJvS+5aaVfX01IpRn3djrOlJ9c= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from DM6PR13MB4249.namprd13.prod.outlook.com (2603:10b6:5:7b::25) by SA0PR13MB4110.namprd13.prod.outlook.com (2603:10b6:806:99::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.26; Tue, 14 Mar 2023 06:37:03 +0000 Received: from DM6PR13MB4249.namprd13.prod.outlook.com ([fe80::c281:6de1:2a5c:40b8]) by DM6PR13MB4249.namprd13.prod.outlook.com ([fe80::c281:6de1:2a5c:40b8%3]) with mapi id 15.20.6178.026; Tue, 14 Mar 2023 06:37:03 +0000 From: Louis Peens To: David Miller , Jakub Kicinski , Paolo Abeni Cc: Simon Horman , netdev@vger.kernel.org, oss-drivers@corigine.com Subject: [PATCH net-next 1/6] nfp: flower: add get_flow_act_ct() for ct action Date: Tue, 14 Mar 2023 08:36:05 +0200 Message-Id: <20230314063610.10544-2-louis.peens@corigine.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230314063610.10544-1-louis.peens@corigine.com> References: <20230314063610.10544-1-louis.peens@corigine.com> X-ClientProxiedBy: JNAP275CA0067.ZAFP275.PROD.OUTLOOK.COM (2603:1086:0:4f::13) To DM6PR13MB4249.namprd13.prod.outlook.com (2603:10b6:5:7b::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR13MB4249:EE_|SA0PR13MB4110:EE_ X-MS-Office365-Filtering-Correlation-Id: dbc90445-8704-425b-ed27-08db245685a8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7KXXQfTdMT4/9lOfXhIzKD+/R1Qf1phpTIss/ZJ1yTSJvqfqeZ6KbaZB3isshCMr56z0mso50Z9iR4N7S7p6k/TunwPZ/Ji3pgEl5nwC+9N9h4NYg7jhFe3taOuyNZ/gYyX51JOCTnKIntEPudvZdMSzXGQAmOWO+ZHriKFPIrDT1NkME3J03d1xs/t+MMsEwoeDGgVhExtwzvHkvuNJIU7U/kwxvZMsA47f7iF8XqXpmVuvfLAnMR5TPeOnhCjj0MihswEbJie1eIpP2umLbOpvT4JNncP0v7lRRN41QP6cqZDi6WOeSmdPxkN5qAul44lVzxpMvw49ZC1XxYatVrl5o7+6Ut8LOfVBZIcIS0masq3b07ZZ8RnEUaDQXPM1TvOkatUHp2wmF7peJkt928n33tMVUfzWpbOmlOxB8Dm4UO6Vm26sqH7whW1UNRhQnCp3tPuw7JgKw0aRUc34SiT54tpOW2x7r2MUFCJG403RdQIDQQ79od804l7V3yKmVvIBXYRNJcoS0+ItXOe/FdF4f4IFYKSL++ORX/9u5Kb3gKwz0v22Qkd6yraVlFNh2gbArdNKPhe7XCd+zmNMj0sIyp3NsGtXASgaQyhRKTAlxfRztyWEPQj4WEgmpHoweQhM0Lfk1DNTxVXUvWTyyZN78j9L0CozNTmzwLJ+pO6tRKfpRP4lXk3m/7BulBOrwbuSNUlk0GA3X2ZHf6jZ2w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR13MB4249.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(136003)(346002)(39840400004)(376002)(396003)(366004)(451199018)(41300700001)(5660300002)(44832011)(2906002)(86362001)(38350700002)(36756003)(38100700002)(8936002)(52116002)(478600001)(66946007)(66556008)(66476007)(8676002)(6486002)(107886003)(4326008)(83380400001)(110136005)(316002)(1076003)(186003)(6506007)(6512007)(2616005)(26005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: h0K4GkTsMZFcHwR+PJ0hKgI6DWqNPMVgGACrMyxe+3j0BoTorE8SXdfnIk0LFTdrDsHUcREsacPxGJ6wBC7vfG33VicUuZfXlY/veamekmIeBD1+2ctnL4qiqme2wbAbCl1NHtSqmKW0mLxB2d0DG2GzkH4TIiI0f5diMSEoDK1c+8VNLZqnSOSCUHGzDNm6CVkaJD1ze1EtIeh7XHYslj04hsEqiSCnAXxWgDuFrR0+V04qPH1MnIXxARTMYeuzLB7dXqUxnzthh6PA0OlhQe8PP5ZVrJvpTjFbRw3x5jXwN3176Dvai7UkCaJVRCdrAbW3gB7UKGZOip0P9g8iyaGxh4pxHeDa7OhvYffo+TQAadH7tAYS2HVR9DNH90N1yTyGwrOVyYFjNkOHRZvEHJO4XoJVxgGVcN71GCLPeA/rTDyaMf67zUizC3kB9sowUpceqeECBdADUJqlwQ0C/+jHcrF5rlh2b36k3ZY0t5yQlouulUN8egKJcrEiwXypHEZLEgtClon6hs3BYySvooLRg6nj6+a6fzW/QBxLRBucVqWSC3xKPJWHgKB9in1pWL74eSAhvAJy02XWz/mPRo4ZCfUHjZwQRyyjumGAz9JBBReYZXExflKmJdOkHSsQODOB4z9Z1bNiu+cN/xubaTC0lysOG9ASc+lFsGx1Y77Y27eP1iVZgynJNKZqDRnhOsnIHmugooEy16rikI87QYMa1aIngIfSSo3rjQJr4FN2SQiTib2IwdX696jz+OiRVS7WQBC9FHzRNL/rfjgXHWxeoQQsXvXeIximZRDADqLtZFPziwjumuNgDCw0Gh9hRwWWBjy5VF/9gPhIXuJYjdLrT5rEgWA8Owwk2sM7lP9v1bxrh7OpaLSXwFFi+rQ+bPHNhb9jBsKKYcNt3OAtf1JeurRjFCbRxr+hwP1PsTCubQE4o+Z4LAa4JXiSfRUvshktR3tR009Od/exr2qFpYIclkkO/svzvqxXJ0/RxYlhIGgmlHOLoJD99/3/VNP/y9A5OjY5aUb9L5AfGK53XyEcX4bYn8/zcAuyH9DZxwFTyriiaquoKaMrpIE8k2V5X81Z2BSV/78vnI8E2e1y727hIIsr8qfWco5ZJW6oMcRLcm6EJ0UW0wH+nzzOQ/BorH991A6HrYLWvZambxQSeTIQIV45envjZfN1TVhfugSqsuIKhjKp/tUOKusgxQNMurm3we6NRso1/pFEBYQPyZUbJzgu13V8h3Ud9iFCLpyScjmagBwk8lJUiZOjawSbRF/hXleGZCaYVoZyFVysf2DbzJ+itXlDwG3El4KAL03i+7bVlePQLjVS7P8RByVM7/AB90hny/1RiDmv9RPhdFP2tKsfTA7cAvgROxvkbbKxmfUHXvE90OD/l42DTIbxn4jtybsWed1pDVqb5Vd5YyYFS+4FC1zks8PK5VoQ7UeItLk7+jdQwHA22TsBDtK2UdBuMecufJcf9ihdxVHelEkq+KgthJW3AFDqEyuB2c0j57daJb7h2bNGyX43q/gKrAVrfjBrR6WrIyA6BP3ScRP0jiOSQZa+cj1LSgSsDsvqQD12W7G7HMj/Iqp8kmOzcP07kk0l0pDcYYQwuNVMfQ== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: dbc90445-8704-425b-ed27-08db245685a8 X-MS-Exchange-CrossTenant-AuthSource: DM6PR13MB4249.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2023 06:37:03.2378 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: LgbqeJdVjgwZKH9+MYIgumgBFzvg6vODAkcxRfxB1gY9RpCivl8OQlOr9HUwbPwnIVIM/rDkw4mJgbU8v0VE700pvXX0Z5+MBDmo+8D+zyg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR13MB4110 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Wentao Jia CT action is a special case different from other actions, CT clear action is not required when get ct action, but this case is not considered. If CT clear action in the flow rule, skip the CT clear action when get ct action, return the first ct action that is not a CT clear action Signed-off-by: Wentao Jia Acked-by: Simon Horman Signed-off-by: Louis Peens --- .../ethernet/netronome/nfp/flower/conntrack.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c index d23830b5bcb8..a54d374788e1 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c +++ b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c @@ -1656,6 +1656,22 @@ void nfp_fl_ct_clean_flow_entry(struct nfp_fl_ct_flow_entry *entry) kfree(entry); } +static struct flow_action_entry *get_flow_act_ct(struct flow_rule *rule) +{ + struct flow_action_entry *act; + int i; + + /* More than one ct action may be present in a flow rule, + * Return the first one that is not a CT clear action + */ + flow_action_for_each(i, act, &rule->action) { + if (act->id == FLOW_ACTION_CT && act->ct.action != TCA_CT_ACT_CLEAR) + return act; + } + + return NULL; +} + static struct flow_action_entry *get_flow_act(struct flow_rule *rule, enum flow_action_id act_id) { @@ -1720,7 +1736,7 @@ int nfp_fl_ct_handle_pre_ct(struct nfp_flower_priv *priv, struct nfp_fl_ct_zone_entry *zt; int err; - ct_act = get_flow_act(flow->rule, FLOW_ACTION_CT); + ct_act = get_flow_act_ct(flow->rule); if (!ct_act) { NL_SET_ERR_MSG_MOD(extack, "unsupported offload: Conntrack action empty in conntrack offload"); From patchwork Tue Mar 14 06:36:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louis Peens X-Patchwork-Id: 13173745 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B219CC6FD1C for ; Tue, 14 Mar 2023 06:37:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229851AbjCNGhM (ORCPT ); Tue, 14 Mar 2023 02:37:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229808AbjCNGhK (ORCPT ); Tue, 14 Mar 2023 02:37:10 -0400 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2099.outbound.protection.outlook.com [40.107.95.99]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D114B96636 for ; Mon, 13 Mar 2023 23:37:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hv+ogvkK85kqS3F7vCuBjCXdnrCpSTxnObNK+1jhK3DW25/ia614GnShrFO+o6rfX2A+4igzQRpayjtRmY9vFFkhiDhbgD8The9n94h4S/g9A6jPN1JR8xBlFpAF1uzs6V+M9f2zAyT+vLCjf4YB9uZSMa6C3DhKsdZgmunU/Fr9qxP3ycc+30unGx4VPMRf7eRkRGAZNN246HyaT0jmASX6chaq5mjz6rlepTguZvhW2fdcGX3OXQk1/dPuUkyP3dFlhsnXR+pe/lR/bm4ycKM97+yCsY90D534CJMvyoAvTIKQ6PaYa/8LCG88cCy9Yq7vHxzE5yu8AZOpZGJ4iQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EWlTZ+Sa+njU1uAfjrZltTAqeGxDlznY5Drnynx0Mvo=; b=Wppi8BFtFg3o39xC0C/GBMQNm3EDGt3oMB81IpzdhOLoCyp0L7xxhjhq0kFDACQkxApWTIlcx/oQWqHonVsEkCH3Iris5Qk6LULOZv2ieCaabArOP4UtxEJzROEI5fvHRVsmI7ObOCZwrcx5vL8PfKkPUJewwioROrR5kv6vZX1On95RqM6LTavKFml5NLIx6TpCIXYxr2smuhkJLz0EdvlVRNEqD03hFWMctzRBxW19hQW4YYxTh87y0Xms/gYUMeVmPRSdhlmNSJuMVS8Y9vtJ3SnKkWVnyAYVRkqvVDLtuLLrFxDQfYgWXGd9WVoHBz/mvmCk88Uhr2VQHafMQA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EWlTZ+Sa+njU1uAfjrZltTAqeGxDlznY5Drnynx0Mvo=; b=cRX7EeNp9BnJBo2Vlup0ETf/51YwQazmuh8Hkz3P0Ophr4YtwCWE8bJx2bbFSkq9Xxc9O/iXr6nCVFIpOHH87lkqGCNv7KaFF7QbFiNy07+fq7fulGgzNtWls9eBcJvVmqxREqSn1mPPYgCHg8fArxuWicYhpqcDeRh1q6xPCao= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from DM6PR13MB4249.namprd13.prod.outlook.com (2603:10b6:5:7b::25) by SA0PR13MB4110.namprd13.prod.outlook.com (2603:10b6:806:99::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.26; Tue, 14 Mar 2023 06:37:06 +0000 Received: from DM6PR13MB4249.namprd13.prod.outlook.com ([fe80::c281:6de1:2a5c:40b8]) by DM6PR13MB4249.namprd13.prod.outlook.com ([fe80::c281:6de1:2a5c:40b8%3]) with mapi id 15.20.6178.026; Tue, 14 Mar 2023 06:37:06 +0000 From: Louis Peens To: David Miller , Jakub Kicinski , Paolo Abeni Cc: Simon Horman , netdev@vger.kernel.org, oss-drivers@corigine.com Subject: [PATCH net-next 2/6] nfp: flower: refactor function "is_pre_ct_flow" Date: Tue, 14 Mar 2023 08:36:06 +0200 Message-Id: <20230314063610.10544-3-louis.peens@corigine.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230314063610.10544-1-louis.peens@corigine.com> References: <20230314063610.10544-1-louis.peens@corigine.com> X-ClientProxiedBy: JNAP275CA0067.ZAFP275.PROD.OUTLOOK.COM (2603:1086:0:4f::13) To DM6PR13MB4249.namprd13.prod.outlook.com (2603:10b6:5:7b::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR13MB4249:EE_|SA0PR13MB4110:EE_ X-MS-Office365-Filtering-Correlation-Id: 25acccbb-40bb-4b7d-1f6f-08db24568769 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QFIq7nXBYBZiSv/kAAK7SMDL73BSAze+RozMGuC1jId2v5w2RvqeeIQKfsrcerkV9Y5stMof8n7fE/a1GKwwT4KXP2A/Yz9ma6AP1wczIR1LUS6teG4iSFj7X+EOMGIzL1IQ1BtmKMc0LA25PKSpFfg/UwWLD+mV4RXXU9QalVAXntCHKyoGAN2HiH9thzP+eotHgG6ueCZFfBi0pJPhJ58TAKHnDYeuXVluK4a2WiDJy0CDvGAZZtDgHonttICPeF944i67ZrUJTKsleqBc8A6k3YjOQaOeE8MXW2DuCYdRVBOZht8/FeHcf+6pBPGrYaJH3/6sHr7VIJvBPSAJmyW6/b8h3YvpNPxLGKHMyp9ky1M2KvLMjXQ1pat3HGPKDuGCiitEBHb2pVZLbb9Dpwf8AKgC60XA/4mgGTJPAEcy4+XJysMTiSCpnwycCEISegh4LTjROHfxyOpppCY64osxevtTe2wOPkvp83D3D/YJmrL54aO4NNfU8mm0+DWY6yNzVspxSDQNSdSKg2qRAMRtzqSXlZGspe9VhPwK+YBSKsH9rFQoFQQXlAsqXt0K/7bvaQfrkXlo3ynOoLjz7meCOlpqdYnKKBD8u5wQ8KugoPFMZ9q780f6dYd+qptmTszqVioRBuhAdMtfg2erk5vpsrX8gkIgeeNG54qkVtJknaPtDij4j7vEKQpPrAUtWMjG65UuV1PenyywCnJCSg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR13MB4249.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(136003)(346002)(39840400004)(376002)(396003)(366004)(451199018)(41300700001)(5660300002)(44832011)(2906002)(86362001)(38350700002)(36756003)(38100700002)(8936002)(52116002)(478600001)(66946007)(66556008)(66476007)(8676002)(6486002)(107886003)(4326008)(110136005)(316002)(1076003)(186003)(6506007)(6512007)(2616005)(26005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4iiaPsCi8Ikw9QnYCNUZS/RENIvG2bALTWZ/LjBCbFY5Vji9IUsnWiOYzG0vu1gHLT0c6/uPYA+ggatGpe97com8B/d2P+yMRVtBD1nuq1etFbcWbHmRXnhFdNWy6b7FMGhZ+CM2qdT6ZuI97QCK5FhK7XroArk9hrPqEMMti98im7iZFmiwdK1tJKSNRvI01Vbq5mGVPHna1tZo3Jgqr6XOkO9ySCTSD3y9DwXGvXx7DaJTW+R2oDTnjeFpwIrna7VE+SGLGfrY1Fh/6WGNeFJRn0xhFXn22MV0pV4vfM+/eX1w3eaBu4HU30DDhCthzx/d72rgUrTbs3/a8lRpCRhAee6+ioOorgRvZIFNq4InT7I+O2pIrS8Kt6ToQ8CXhX4spMrPUbhSxfVFOFxzTYRoVqASGD3ghW+OKuyUm+/uSR6lzW0QZHiiRReZWq3L9TH5puZq/8ZdhlVSzPYuZvqwgq4qils/zk7vgMeTBi4YZ5x5jKX685nHMyA6KHj4U4NrwY1x1F83ouNr095bTLjfkL2AEt0FbpKYUldSMVyevArCLr6dJvgzwJ4DZynvT0puHTjHAOsQS4ggBUZcq+ILmjLhRBBLvp/R+/kPMJwtTDS4J5omiqyDIHGhNFDq1qF1EqUtmlfPNPzZwPBpT1ZD1fjvjOtekfYSbCA1ND5RUvXcnZ24LyhEtxtEssN2DvYQc8quBAImLnKUJwDNoMgEyR2y0AJjRfsnXdVhPY2o7ryhSDLyv95O9MlsGOTKC4LTUj6ejRU2M5osC/Sqv8LDxbXVHcJKRwqHr6Cqwr+pWXLE4SfxE0KqvktjvuvrV3IkygpKHLvxSHaoqzCBEuw9/577QIAo5Sdc94VjaewWgWRtL0nd6h64rDMenXhk6SmUGq+uA3CzZoIJiRiOeerxn2jMQBiZpNMXoEkXOPDmf5iIpkNQ5nnv8mS6zYyVaXZjOxC14VQr6yWMGhMuzftoS91koyRvS502TEy4JkM/f1DrVcRa6bkND3AKHylo5KuO6Fzdk6Mo8bNLZSU1n3M+23HNCvHXDRYvD6P/wXR1XvGmQoTwjjsdNHApBPMSV1XpcPXReeWbZTWHPtReNsXd3EycncbArEr0XF4xHZpoZqocRKprSRUW6VK8vKUMWOH00Ax50xndMRZiGynz24g+yjjXhPsSAi6jPWt1lSMQFCG6By2uPoHET+fk/9SrUChU7AGtj2jujl5aSW1YX8Oy32Jq1rPXMDMhtlJ9JHZhhvHMHng+bqZoKxg00GrD4/qTuUQp6TO0iHAS9eXBIFC0zswGOmNhPYtnHMYZGC1PepF77qJ5V5cPX4gnvaxDNXw/99Q3RR5BBnT8ZKUFNgshs63SMmTP8vZZQN57VPOsPD/A0OoGX/wdlFc+glk06y7ggS5yxOGh5btmy6uMRCZ9POtqpFvHk2W/hmd3TVUBh+eWcsRBGVSs4UmdEVNAh6G6yWu/JboDA0QABEDRqlWAtoXSQ9LnUtalK8u0ArR3rns4PF8ZSO4gJuZI8+Tv2H3ep8VMX4MILTflWnmt/LAtl/iNE5fdBkM684mEekTZthXwoA7kCi844drD9EozOTwoOB2sWdSL0jL/aW+nyQ== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 25acccbb-40bb-4b7d-1f6f-08db24568769 X-MS-Exchange-CrossTenant-AuthSource: DM6PR13MB4249.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2023 06:37:06.1595 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: r8yCejsVamZqUDBvwUluMqW8cadeBtsXB2DHWjTIPtUaDuEDTb4rBD4jip4DfG5TU+o7QREx+jxVD2zGl/IJy0fHliZOckFxWQwpCCi8sGc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR13MB4110 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Wentao Jia In the scenario of multiple ct zones, ct state key match and ct action is present in one flow rule, the flow rule is classified to post_ct_flow in design. There is no ct state key match for pre ct flow, the judging condition is added to function "is_pre_ct_flow". Chain_index is another field for judging which flows are pre ct flow If chain_index not 0, the flow is not pre ct flow. Signed-off-by: Wentao Jia Acked-by: Simon Horman Signed-off-by: Louis Peens --- .../net/ethernet/netronome/nfp/flower/conntrack.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c index a54d374788e1..e0d6c8754272 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c +++ b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c @@ -55,9 +55,21 @@ static void *get_hashentry(struct rhashtable *ht, void *key, bool is_pre_ct_flow(struct flow_cls_offload *flow) { + struct flow_rule *rule = flow_cls_offload_flow_rule(flow); + struct flow_dissector *dissector = rule->match.dissector; struct flow_action_entry *act; + struct flow_match_ct ct; int i; + if (dissector->used_keys & BIT(FLOW_DISSECTOR_KEY_CT)) { + flow_rule_match_ct(rule, &ct); + if (ct.key->ct_state) + return false; + } + + if (flow->common.chain_index) + return false; + flow_action_for_each(i, act, &flow->rule->action) { if (act->id == FLOW_ACTION_CT) { /* The pre_ct rule only have the ct or ct nat action, cannot From patchwork Tue Mar 14 06:36:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louis Peens X-Patchwork-Id: 13173746 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0E07C74A44 for ; Tue, 14 Mar 2023 06:37:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229735AbjCNGhN (ORCPT ); Tue, 14 Mar 2023 02:37:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbjCNGhK (ORCPT ); Tue, 14 Mar 2023 02:37:10 -0400 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2099.outbound.protection.outlook.com [40.107.95.99]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EFAE96633 for ; Mon, 13 Mar 2023 23:37:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IdYjJbS8w5Uts1aMYZvI0l/9+4lJoSsQ7SLG4DUOcX02giRgYc0UdSwnRhHJraPTKUVG2GTvrZsShbxi0LAhAVOsNpW+ZgPA+IcJgvN6oizQUb4RLparwp8PR+4p4QMB61Ylx3TFJze991O4Ma2kAWbIMVE9GiEHUA9bTZd9ldwOMk4Z6WAZq2s+2004B6Ux9ihFoYjM5rN4dovSWBNqRA/TzZcfmgnTj8uV+EExaKYJbd5oL1EI0d4r/KeGkyzJSYrFyvCUOaRvqaq5MjYY9cecl1f7LcG7EvbmR5Hmb++e3/etPGxp0ADbpPTnathqQp8OGlzL/yNBM0rk4PjfMA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SWTK8hfdOtKZjlTl794Ro3Ker7FSkOR2e6u8X2gKjCE=; b=MEaykyZCs/+6esvu4zHdOFXHTfV2iX3QO7ssNJVw2PeP1Vhe9csEGAXTOrQj+c7xGpI7kBwx4ZvkdX991aD3OjH7zOcsnZSUhBojeh3WLZnJQq+5mSXYX/aDZfpgMACvODSegwrFpE2QJCI/G2A158VGX6LRWwiuFnj6aESLiaWKOHIMffRdwCgzkuFmwwiCdkH9GcAdXv1rmCpwlcpfT9dfDddGis23N3cAJfY+ePNoj7kQw0UcVGgT7btELiTtgNYpIKP4j8Y8t61BbpokJnbXt8nvVBaT1VJ8PxZl7DNdBTFsSEs3qonmL5hChqULDP97R2NzQeyMhsgjF708lw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SWTK8hfdOtKZjlTl794Ro3Ker7FSkOR2e6u8X2gKjCE=; b=mSIfKBPsazRXk4LqL4GsFGrj623GnITWndk9h2LSUEy6K4XQr+sYkqUTJsWH9Dxn0Tz13cXzWh6xO6OfmkSdcWnfy1zNrxxKj7KFfQeTqnSpE+vl9V4Z3xvVKk9oaHcK4D2e7qTGzYcq23nUn1Q9pZxUHwxv2Hezzv8aZSD6avk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from DM6PR13MB4249.namprd13.prod.outlook.com (2603:10b6:5:7b::25) by SA0PR13MB4110.namprd13.prod.outlook.com (2603:10b6:806:99::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.26; Tue, 14 Mar 2023 06:37:09 +0000 Received: from DM6PR13MB4249.namprd13.prod.outlook.com ([fe80::c281:6de1:2a5c:40b8]) by DM6PR13MB4249.namprd13.prod.outlook.com ([fe80::c281:6de1:2a5c:40b8%3]) with mapi id 15.20.6178.026; Tue, 14 Mar 2023 06:37:09 +0000 From: Louis Peens To: David Miller , Jakub Kicinski , Paolo Abeni Cc: Simon Horman , netdev@vger.kernel.org, oss-drivers@corigine.com Subject: [PATCH net-next 3/6] nfp: flower: refactor function "is_post_ct_flow" Date: Tue, 14 Mar 2023 08:36:07 +0200 Message-Id: <20230314063610.10544-4-louis.peens@corigine.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230314063610.10544-1-louis.peens@corigine.com> References: <20230314063610.10544-1-louis.peens@corigine.com> X-ClientProxiedBy: JNAP275CA0067.ZAFP275.PROD.OUTLOOK.COM (2603:1086:0:4f::13) To DM6PR13MB4249.namprd13.prod.outlook.com (2603:10b6:5:7b::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR13MB4249:EE_|SA0PR13MB4110:EE_ X-MS-Office365-Filtering-Correlation-Id: 4f58970f-1cc3-42cb-3f4c-08db24568916 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0SpUrK3p3HFPmm9LNQI/ZDgckxiVo6Vg2mYXidrlWqyNtMsqKWg8aoGZWLlj7V9C/KD7mOAtRhr83mkieUTGz03arI43seDpPEP9EjqNa3hWyzV8X0acA1MXHuoLYexEQwjzik53IoIEy18b09jOIb80IClim3q9kutIvc6eLlcynrpNkaRfYr9o+TD5TMOkTdhWu8M2eJ++fAs59mlkM3d0RDZobn/mOBOYSsHfTdxSKctWk+eQpptJUPNr/s9+QgZaY/Ct/fEvTH/z9ty9kP7MED9omZKB8qnF/aWucAt4/WVPtlmMOssjjcnJrexcdfkm8zK3kLwQSp4SLnaJwfBBMxpeRpiqU73/OWzHZ+Om3k5oev+3ViCNOO3An/xquvT76Jv1m/jGQP6Oh1nOv5bwLjt8h1AouWNvDJJ4H40NFSZW/nPcDMT3PD7LESwkepjbyb+gh7P7hsCUGy2bPbhs3tzGMfeg/+vn6j/Yc2fzfxAPIbk90wKD/U59zlsmn2m9FLg41Q9LXSHZvPDH0W+SVDx+h5dqV0TLV8ssFzeYmdlm/3Jl4StlzZckUTWfZVWaRLXQwh8rwuMgntt5D3TmSbVQfQmkH4cnd6mGk6tz6uGfrCbd6Hd21Ugte0wT6+MULWXqBN7EqJnL3bmGoZ33ATFKeqktBoodbEJmiPrFNqoE3tsYZmkFqxkuurQIDISYQ4qTx6aZccaDm3t+HQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR13MB4249.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(136003)(346002)(39840400004)(376002)(396003)(366004)(451199018)(41300700001)(5660300002)(44832011)(2906002)(86362001)(38350700002)(36756003)(38100700002)(8936002)(52116002)(478600001)(66946007)(66556008)(66476007)(8676002)(6486002)(107886003)(4326008)(83380400001)(110136005)(316002)(1076003)(186003)(6506007)(6512007)(2616005)(26005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6U9E045unJ+LVO9VthDibFhiGuPOTh4JR5cnM5zW6reZzU+XqSqfyq8FVrWRgo/yNshHtHhXbkw8JesEU6+aqOaWqdVoHRPw7rNnsmDO14URE1wVwXtXTKDpClW1yhbT/DIOUotz24Pf3mV4vzjnPfWF9yfXHTtt2gckQ3OqxX1G+3wvYYx/okXbjE8L7KgRQE8UehgwAgndCoTPA+iJUJ6eNxRdr9Q0/rDfvvzoryn70JN166FJuWLqpk6Na0etVTeafT8zkBj/47ZyBjLzlXdfyWuV9RK9Is01PMLheS2gRhbt86TyjqgEm8gUNikJ+TM/sgqMB4gHGVEIURsJp6zdH186NEQoSNR8W0Q2htQFQoutrzWzsGojlBh50yctao5m9L8Shi5wmiFzWhiyERY1DGbfdOEdashmRxnIzVDsDEfjTugSUgas+BUHdsVnDqywoQws5ZbpnBG1yIwZLjT3Nwx5bUVxGZMRkyJK/2JHm1gIRQjMDnjzbUHT/eOR32o/4s04U/7ojx/Fc/oJCTNgdi0US5Ld1JA+N8o0piKHKmp0VGg0LORfkNn01x9weuFtQFQva9DUDpwIyZyNQm6tyu1A6dXajrVwRPXwQnqTh1axZjlLKVT89sLFnXbPqIFIlcDVBBuuObELqcnDrA5hOLnUpHWtsdi2ZJlzVAZ2dR5f1tSiPtkEt/RP42iAtfJ09KgKZecSQc8kl4hkAgPzbVX8cDBXXAstPF8EO9PYoZwK2Oz7P5EzTj6Um9kI2yNFZ5HwdvgjXgVxFXlaiTGxJs3NBGahIM0+yny1nbSFF1xVUiijMqLZhRQcKD43LrdOcdGE0SWXni3hUJR9lTda5nj7F/VOKs1xY9Fc086qzrz0QRbEGA0oDIXrNcGqjBQrAIrdZJ+xHL+05A4auXIFTL/cvObjUEzPPjEHFaBj4U2NQZB7DD7AhqEBxxb6uoZFjS8M4k3tWW/FdnwL663abTPnqZcHpWe17M/T+wWRVxM+eX4P3dLAbWe5VXFBvcIn206XNgl/wGHyCYDpiNF5xVp05sIzPcTwk0xXakD/T1UQJvngWPiVQyYHjk0S2CHNug8lZV16LOBqC19g93jxHDKhlg0zZYEsScE/PAboP7Z1wbCGUMJBOLXnYj8mRgzrKkwn1qOmDfeoAvTj8I/g4ZnwzPkMAI1ZkzrtOq9Q3J/BzGiYKbSTHpJmlQr3Jc63Edl4VhZE2pb6SJlPmlsRQLCW/3K3QY5VKbLI1ThmWd0Zy/u/3PDZz5chFQofnKHWfkBDnykqAHhLKOucoR0Vlbg+57z2QK+yoCI1cKfcRiKtcHAtzCk+sDcjyCj0RipYcW+JvWC4biRVVYaYENwy7LJ8RRxsgFzptFW0IQfosaBhzWPjC455bdzFo/lPXEKUqwEWA0ba2OtMoC+Li/ktKy1MfothHYCL6VLAgOMqTf7PsP+w/4Kxl/y4jYYruVB4RPHvN/KNdyYDzGwNUNe/L9EkqM7BFvFIJR3R0v80qWAqKO7Z8ZArGFmqblbU5N/q6jEE/hucsEmXfnneFKuQYvl7zB75LyCZp7AsGHCAtRlakG3erE4O+05Jgqpug7aV1yotSDhvaeX7qJ72sw== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4f58970f-1cc3-42cb-3f4c-08db24568916 X-MS-Exchange-CrossTenant-AuthSource: DM6PR13MB4249.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2023 06:37:09.0031 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yrY04HV98ys0+8j8rIn9XqOaNUmSZ91ZQ5cRH3x9fEuFbBnaxwgAUqW8RusCcfxaxFKQCmb/4pQhN0rxnLobTNMSpnAZpxvmwb0S+xVyUew= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR13MB4110 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Wentao Jia 'ct_clear' action only or no ct action is supported for 'post_ct_flow'. But in scenario of multiple ct zones, one non 'ct_clear' ct action or more ct actions, including 'ct_clear action', may be present in one flow rule. If ct state match key is 'ct_established', the flow rule is still expected to be classified as 'post_ct_flow'. Check ct status first in function "is_post_ct_flow" to achieve this. Signed-off-by: Wentao Jia Acked-by: Simon Horman Signed-off-by: Louis Peens --- .../ethernet/netronome/nfp/flower/conntrack.c | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c index e0d6c8754272..6b90b922bac0 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c +++ b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c @@ -94,24 +94,23 @@ bool is_post_ct_flow(struct flow_cls_offload *flow) struct flow_match_ct ct; int i; - /* post ct entry cannot contains any ct action except ct_clear. */ - flow_action_for_each(i, act, &flow->rule->action) { - if (act->id == FLOW_ACTION_CT) { - /* ignore ct clear action. */ - if (act->ct.action == TCA_CT_ACT_CLEAR) { - exist_ct_clear = true; - continue; - } - - return false; - } - } - if (dissector->used_keys & BIT(FLOW_DISSECTOR_KEY_CT)) { flow_rule_match_ct(rule, &ct); if (ct.key->ct_state & TCA_FLOWER_KEY_CT_FLAGS_ESTABLISHED) return true; } else { + /* post ct entry cannot contains any ct action except ct_clear. */ + flow_action_for_each(i, act, &flow->rule->action) { + if (act->id == FLOW_ACTION_CT) { + /* ignore ct clear action. */ + if (act->ct.action == TCA_CT_ACT_CLEAR) { + exist_ct_clear = true; + continue; + } + + return false; + } + } /* when do nat with ct, the post ct entry ignore the ct status, * will match the nat field(sip/dip) instead. In this situation, * the flow chain index is not zero and contains ct clear action. From patchwork Tue Mar 14 06:36:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louis Peens X-Patchwork-Id: 13173747 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39257C6FD1F for ; Tue, 14 Mar 2023 06:37:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229930AbjCNGhV (ORCPT ); Tue, 14 Mar 2023 02:37:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229864AbjCNGhT (ORCPT ); Tue, 14 Mar 2023 02:37:19 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2100.outbound.protection.outlook.com [40.107.236.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21F9A968F3 for ; Mon, 13 Mar 2023 23:37:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RzyYVUG/deSvpZS3YNIcxOIauJ9rDxsRaIBXmYAkJd2FaqgRbIT2MNZWAaVvxox77L4+XB494/Rz2fdxgUDGIzJDv6KfNbpw6j7ql6XupAH+ccpKWhRnZzG9y8yTu7Fhx88KeQFJn/3IRbOBsCcv7H8nEnpRu3JMKqMyKuelpp6gw3EXkhgrY1UQZ+W+bnbjtnEkKHisVKChA0CoG8YovjeDtWsYl2NdeiOb3ROuV75wSrNPVPynsn709S8298wFxvpDpCU9iRrmeOAvyCyADD7iNVRDT57/St/4xjYqwiidJYZIn6JPrLUafvO8ZuPFLWPI7Uj8nZhZ1l1XkquoaQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=a9D7uUliMZ5cQBgeOWiLR2WipqWnpiSpRh5nWTCTiRU=; b=Rux4aDDB/q0UJkhIYR798+kHKoLnYF44I+UMrlEAy8Qjlkc6nNZ+rL0MCWhyTyz3LI6GHngfIvav2LNB6xeAL2GAaHh1WewgNdZQn/bPOsBLtAzctD4fVc7MmyClrmTE3s2VgBm2O0npPjTyuX44Jqel7fLLRIjyjso9a4rAV4lSe0xpn02uJvAjtngM4Z5/qKe8/Hvw71820tyedCIFCTxqzBu0cuH/sbLUD/sfJnsrdcIhDTRTJ+PAtXIeaS/PXT4JPQQM7/PBHOWPZHe7uE+Wg5jacH6+0KeIG6bwsYmTbyBEPnZmvgQn1DPHp0MVxxgPPe6UHKTgmEYezRqAvQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=a9D7uUliMZ5cQBgeOWiLR2WipqWnpiSpRh5nWTCTiRU=; b=P/d6OYlkXhIXMV/LqMfJrAur8JqZpSQkAdr6ggZzZ7EKBffhsloeqZl6HfDZhxWN+NDe7ndW+xDhlZTtK83uyJfXSLSfrIkdlETwARXvgm0sNPGzecUhOVavvPVym3zfQMLMTLqyfaJb7l6iav/tsVM+DhQELG3/4ZSG6A0PwHg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from DM6PR13MB4249.namprd13.prod.outlook.com (2603:10b6:5:7b::25) by SA0PR13MB4110.namprd13.prod.outlook.com (2603:10b6:806:99::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.26; Tue, 14 Mar 2023 06:37:12 +0000 Received: from DM6PR13MB4249.namprd13.prod.outlook.com ([fe80::c281:6de1:2a5c:40b8]) by DM6PR13MB4249.namprd13.prod.outlook.com ([fe80::c281:6de1:2a5c:40b8%3]) with mapi id 15.20.6178.026; Tue, 14 Mar 2023 06:37:12 +0000 From: Louis Peens To: David Miller , Jakub Kicinski , Paolo Abeni Cc: Simon Horman , netdev@vger.kernel.org, oss-drivers@corigine.com Subject: [PATCH net-next 4/6] nfp: flower: add goto_chain_index for ct entry Date: Tue, 14 Mar 2023 08:36:08 +0200 Message-Id: <20230314063610.10544-5-louis.peens@corigine.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230314063610.10544-1-louis.peens@corigine.com> References: <20230314063610.10544-1-louis.peens@corigine.com> X-ClientProxiedBy: JNAP275CA0067.ZAFP275.PROD.OUTLOOK.COM (2603:1086:0:4f::13) To DM6PR13MB4249.namprd13.prod.outlook.com (2603:10b6:5:7b::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR13MB4249:EE_|SA0PR13MB4110:EE_ X-MS-Office365-Filtering-Correlation-Id: 52b3a057-d964-4c39-361e-08db24568adb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jGZv76HSn/f46MXyBSj4WSKlAhPXF9XNsO2LbaIJo2jKXjOxzq1el29vxjNS1xJtBjeiHp4dMlT2QPYCSfzWfGpty5b7ygn4oK/gjJ4lF8Byaq2Xyhy1w8N6viycS4bfrEK9kRD0WVRtjeLEeXS8LRs6eszk0s2BP7AqVrUEd+n/bEqAWk5kyLCIdcuK5d/JH0rJazCVJ1HtP0tTOrw0FS/4v1UltKBPYIbS47IiY5a2fTRt+Gc+Om30LuQ7+OlA1+yuFr+9TYCLCLhSKs6pF6TXoqCKdWUF0/koDiIYTMLUB9cJnshGGK6Yo/BZzIZcHRsf/EdAwAf9GeJ7YmLmH+CLF5mu6v8whsFG+3Ww1r63Zv/T8Btoat6BP2rxqU/x2CyagyIGAUUp0Ix+cmYVKF0OL7MxKG9WSENk29xH+DiJshmBDYNbCQnXvpyTBu04UBtXQaVIGfjkMZ+7lQA5Ol17EEUcenUO0Gxcpk7p1v5kDoZUp91uDwG23bPoY2NGInaJ85Pvt3SQLDo9GbBBodMV/AAEwglzJSZpQsiSwPApp390AytiroTqj4wq0asadKYtBcCM+SztTWDbMoyETQmky5exzV00Yx0HAaCSIfYrCf2ZET/fSFmEJcct2SxRVRxQDIbkO46O8vdlYZ69wL6PCw0MTAzP5l5ky2NC74TZ2Di5QKPJq5etsULWLntGtCh6oVPtC0aJHs9wP+jqpQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR13MB4249.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(136003)(346002)(39840400004)(376002)(396003)(366004)(451199018)(41300700001)(5660300002)(44832011)(2906002)(86362001)(38350700002)(36756003)(38100700002)(8936002)(52116002)(478600001)(66946007)(66556008)(66476007)(8676002)(6486002)(107886003)(6666004)(4326008)(83380400001)(110136005)(316002)(1076003)(186003)(6506007)(6512007)(2616005)(26005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nIhZfo8bIK4ReJUzxCshuXmmCsdYAnbU6g3D306SYXrdBIB0FUext5Abl70XhYSKNICqHmU2UJqk6mqTTx0blybdXsj/JoJmJd1seKXX+PmUnFmCfhO1KiTcxVwhNvQdXLpMxNLLXtiVjyytRGJLCU8bkCSr65FY2NDfSODQlVJ/OvvJQ742aRGJ4dSb8gmqjuUUSqSREro/u4v1+XNoPn7FEH3S0PmoAam9mM1oVTbuU9Mc/0/RiSk+01nS2e1GHKlL8b5x6u6uSpEaF/w3BwbAsk3jeRqoEHLdpW85gBFbMis7LCq8xiz6QG+NvzJlM4Eg/Mc0IHR3XEc+Gl5o4g/t5z613w4zOrUyrYsl226AS30MDdpBeefF3V4YTkBGnSmLCRgsbysr80SFx7HNd/SsNxu02ehf/AuOjvXCql9jpBV/DX9t5Q6gubDsrLJQYftlAunAIueipfyLFKtRHC/sOjj41gW2dzBPppADqzY5KV1kMGgJe9BvCXBDoC4lqkwEdvgehRCWUiLDv/J92qEvxiKxtAFB0n1vVCx4icXVVJXQzcBgFyftTy4Bd57GVn0jzE89OTGU5nB2iuOyXKWw3usl9MCuyPIGr33/r1P+NWAqwOLi8u9DEkAGROwTrd7zSLGmWIf7a2biXu0CHp3utvP3yg4bIB9eY4psFF/O/awFkd2CiWLRCGdB17YEv10ll1aCqjXJ+4zhwO9UNGVjPgsJrBvnHNfE4YGKXTo49i+oxRru1eEZoeeki0XcZSrNm2clUS4b5z5gb2RLi96j8lANBk8r+jTVzpHz7fmOnrYPKMAyCNqLmqMslbRMNjwgnX6URyMezt9OKbo+1E0az9sf9oak/7+3u+3DoDhS1ZSBZFCJM1ZlpbKolsnU3vUqICEbZh9rtICoiGQpXYfdWKs3OgY5xEBnR0tZc3OXNBtVY0GyTvat2huGM0G8cyH/SLi9oXJsdN8eHypUPW/U6Rw0ce42ZSu9pZgx17G/HYT4oB67dkvxhtQ4L4EgDYzQMfXsVRGcpPTMsPyyB/Tqhn3ruruRTO3+sG7kgsxN/iF3Tu1hzjyp3U91VJX7EptBNIVnzaeVZcq3/YyGHSRncYsCedL8Xd8g9YXbWrF1OiNqc+n5S8kwLZwuVmrt+QizhlfF8NFlB40BvM1CmFnitQNRPXDmyVW6QnMk8+OS1xzNbiHy60a3vCSkzeTu9tzT4X424rpiDbI8zAJWwnLRWNyvrwoduTjzqv818waIOxgZSp7k6SMCGkwNJWv6X3EPAX4uCmf6xqwPS99HXJRn5/GNQSTrszZ7ABLPGDwCreejGlzxSlY35WmZxANMDW5S5HBi5HDKP+a68RgxECnnIjPG/uQfu9NAjHE6eMSYddOYzodbWv7Dt7C/fZ1NO0b9pqrfW/kGp4o2l+e4kS5SD8MSd3BaoGYZCLoeK0BBdThj2HAaa4iLiEj/INIxB5gWBBYOyG1isWUmh4XSTgLS+rakidOWPk90x+EkB1F63cbQooaYdtRxM+tTaSkh8AIe/XHHrUdtnRa/j9bBBBqxRQVXT+licHPMpmbj9M6mXM5df+BPVO/NxX/+ssK7j7/jsWMvy2vvGhOwma8TCQ== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 52b3a057-d964-4c39-361e-08db24568adb X-MS-Exchange-CrossTenant-AuthSource: DM6PR13MB4249.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2023 06:37:11.9872 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /PwzzowPaX0ppzMJhlnVDTyiyYtv/46pySwz3WMaOsxGV7MCGPQ1bi65rKg2gW6E/seGGYi03u2BEHkt0LcG50mCIc9nuzx9gMZYqNrWZiA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR13MB4110 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Wentao Jia The chain_index has different means in pre ct entry and post ct entry. In pre ct entry, it means chain index, but in post ct entry, it means goto chain index, it is confused. chain_index and goto_chain_index may be present in one flow rule, It cannot be distinguished by one field chain_index, both chain_index and goto_chain_index are required in the follow-up patch to support multiple ct zones Another field goto_chain_index is added to record the goto chain index. If no goto action in post ct entry, goto_chain_index is 0. Signed-off-by: Wentao Jia Acked-by: Simon Horman Signed-off-by: Louis Peens --- drivers/net/ethernet/netronome/nfp/flower/conntrack.c | 8 ++++++-- drivers/net/ethernet/netronome/nfp/flower/conntrack.h | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c index 6b90b922bac0..86ea8cbc67a2 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c +++ b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c @@ -1254,7 +1254,7 @@ static int nfp_ct_do_tc_merge(struct nfp_fl_ct_zone_entry *zt, /* Checks that the chain_index of the filter matches the * chain_index of the GOTO action. */ - if (post_ct_entry->chain_index != pre_ct_entry->chain_index) + if (post_ct_entry->chain_index != pre_ct_entry->goto_chain_index) return -EINVAL; err = nfp_ct_merge_check(pre_ct_entry, post_ct_entry); @@ -1783,7 +1783,8 @@ int nfp_fl_ct_handle_pre_ct(struct nfp_flower_priv *priv, if (IS_ERR(ct_entry)) return PTR_ERR(ct_entry); ct_entry->type = CT_TYPE_PRE_CT; - ct_entry->chain_index = ct_goto->chain_index; + ct_entry->chain_index = flow->common.chain_index; + ct_entry->goto_chain_index = ct_goto->chain_index; list_add(&ct_entry->list_node, &zt->pre_ct_list); zt->pre_ct_count++; @@ -1806,6 +1807,7 @@ int nfp_fl_ct_handle_post_ct(struct nfp_flower_priv *priv, struct nfp_fl_ct_zone_entry *zt; bool wildcarded = false; struct flow_match_ct ct; + struct flow_action_entry *ct_goto; flow_rule_match_ct(rule, &ct); if (!ct.mask->ct_zone) { @@ -1830,6 +1832,8 @@ int nfp_fl_ct_handle_post_ct(struct nfp_flower_priv *priv, ct_entry->type = CT_TYPE_POST_CT; ct_entry->chain_index = flow->common.chain_index; + ct_goto = get_flow_act(flow->rule, FLOW_ACTION_GOTO); + ct_entry->goto_chain_index = ct_goto ? ct_goto->chain_index : 0; list_add(&ct_entry->list_node, &zt->post_ct_list); zt->post_ct_count++; diff --git a/drivers/net/ethernet/netronome/nfp/flower/conntrack.h b/drivers/net/ethernet/netronome/nfp/flower/conntrack.h index 762c0b36e269..9440ab776ece 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/conntrack.h +++ b/drivers/net/ethernet/netronome/nfp/flower/conntrack.h @@ -112,6 +112,7 @@ enum nfp_nfp_layer_name { * @cookie: Flow cookie, same as original TC flow, used as key * @list_node: Used by the list * @chain_index: Chain index of the original flow + * @goto_chain_index: goto chain index of the flow * @netdev: netdev structure. * @type: Type of pre-entry from enum ct_entry_type * @zt: Reference to the zone table this belongs to @@ -125,6 +126,7 @@ struct nfp_fl_ct_flow_entry { unsigned long cookie; struct list_head list_node; u32 chain_index; + u32 goto_chain_index; enum ct_entry_type type; struct net_device *netdev; struct nfp_fl_ct_zone_entry *zt; From patchwork Tue Mar 14 06:36:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louis Peens X-Patchwork-Id: 13173748 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB365C6FD1C for ; Tue, 14 Mar 2023 06:37:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229932AbjCNGhY (ORCPT ); Tue, 14 Mar 2023 02:37:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229864AbjCNGhW (ORCPT ); Tue, 14 Mar 2023 02:37:22 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2100.outbound.protection.outlook.com [40.107.236.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16F0096C05 for ; Mon, 13 Mar 2023 23:37:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CjnLnO8mhOOKfiUgF7BallrBziZfaa+cjHePdPdnvQAB9yavluoAEAleLK+B/uXOlqoghASQPlOt8rNummctdcnaRnGRsNXIIzC/i/+ExE+rX0R3JP51K5MWvVEHxn1i/vSrH50ZmwpthES8MjRkATg1MbY1IjzZYltz7+GuwxXujsH+DSTkC8fETATfhiyhsMbltoNhwwmze4dcW/KItx2Z+fOhHGjy5qzoDfxufll2uug4f8NxgWNKJ8rIXEor/NlOvSJoDwB+Q4pnWG6RQy1O/Ctmu433KZiz7rP7sX/4AUiSdJgroh2URA5Lb6S/X69vUdOblvz4m8xQvcE8jQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7R7hSp8KiKzZeWFu4AIRWKKRbcbz5GPqdzrp4gDuY6M=; b=HfqH/giHhDdZe+lB6Z/NMhFIVh0EjwjOSa1Bth/ND3nrN/DjEL463OTtZhqZuE+mopZb/A74WDmEqZQcCCs5PR1XrdLZzZGKh2ysAT0cLZGnskYABV70gpFObb5YSUl5LT44/iiNERjsFzqOPuXUcJLoakinrzsEJKJ62xd2Ep5eRC9Wj19Uu6G3nSmV43xcimT6K8Ba13226Z1raL+Urz1fRkBl2Tqo3YEO+nLE+dkkvFJ/1Rut+vJ/+1qKULEl8lkPlSikbKs9Uis9YBIJFTxeZnVNYTYIDgyjOrwEMe5xQ4mly21czAuOZuxaVTNa1nVgdIS0qWkNoKLefJCijg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7R7hSp8KiKzZeWFu4AIRWKKRbcbz5GPqdzrp4gDuY6M=; b=Re2qHTott6RdIh+w8C+DaR0mSRtSnvAcdVuhz4hayEa/jFrjltS+HZf9J+lpFR02VPQWfJ58HSy+Pu62e+gRe1aPr5L3Ij6GtDW5RJqUozW6KdTGSPsNEiMpma/EgB7XCTJgNG2b2JZ+H5+MmvFjTsKjbP3mZHshPmmEFzT6B/4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from DM6PR13MB4249.namprd13.prod.outlook.com (2603:10b6:5:7b::25) by SA0PR13MB4110.namprd13.prod.outlook.com (2603:10b6:806:99::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.26; Tue, 14 Mar 2023 06:37:15 +0000 Received: from DM6PR13MB4249.namprd13.prod.outlook.com ([fe80::c281:6de1:2a5c:40b8]) by DM6PR13MB4249.namprd13.prod.outlook.com ([fe80::c281:6de1:2a5c:40b8%3]) with mapi id 15.20.6178.026; Tue, 14 Mar 2023 06:37:14 +0000 From: Louis Peens To: David Miller , Jakub Kicinski , Paolo Abeni Cc: Simon Horman , netdev@vger.kernel.org, oss-drivers@corigine.com Subject: [PATCH net-next 5/6] nfp: flower: prepare for parameterisation of number of offload rules Date: Tue, 14 Mar 2023 08:36:09 +0200 Message-Id: <20230314063610.10544-6-louis.peens@corigine.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230314063610.10544-1-louis.peens@corigine.com> References: <20230314063610.10544-1-louis.peens@corigine.com> X-ClientProxiedBy: JNAP275CA0067.ZAFP275.PROD.OUTLOOK.COM (2603:1086:0:4f::13) To DM6PR13MB4249.namprd13.prod.outlook.com (2603:10b6:5:7b::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR13MB4249:EE_|SA0PR13MB4110:EE_ X-MS-Office365-Filtering-Correlation-Id: afca909d-ce73-4564-060d-08db24568c99 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +hIFJlf6gNQHvboquwIGwAF/lUe+iF/aDPaPXleZc1B9zFhShUDtjzm8GqImka2lYMvvKthU+YNBx/8l7yF8V5Krqaac2eXadrifa59fJsB1EgyU8fnPVap/5qrXp/V7gzowZHjrmLKAxOOMNEgy/00rouhcLTuKmoL5UgZXIuP9yit+CUR5yZCLOSL5J+Px3nnYzS+8YPwpSC2g+7QRUOgnznKaPiC+Ow4N79ecH8LJfvH8RRKZC04H3f7Ux1hjFRVf1+k4z1TK06yxZoy/UFFBKl2tBfu+BNR7jIZuukJ9S0ofnTWDbXJgrSfNLGBSDOt+GX5SZ0XDRRJjbQr7gZzDrwVf1Kzg/mcLzfQEytOG0L5qt1abfucME5eiEsrrI84h8IWkjp97KU1TaLggFOcv5vX6o9CZvUIGKASG3X6NOGoMpnYrgSWWmrgwh12hR7ahQl+Cr/GggihfasO0I5s/7b6bdbuRYq4R0cJ5xW4XSMPN+G2xpDU52cDYnmb0JrgwHkWgFsLM9lUafc4SQgb9nuvJUYD20iGiaIktP+dU7YPrqs9z/WK/odcioBFkuowrxolRYT/a48WR9p7vw9Da/ACEAy/6v5Q3WWoujrxRGAgUN5vVZlaRfIEI6C72tXtxp768sl/4eKHrg1TyowqDT+boEQ6l/5f1y28FVz2Dbk6qPpkzFiYyF5HQ57mbmzM5ONN+sChSBVE2kP30Mg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR13MB4249.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(136003)(346002)(39840400004)(376002)(396003)(366004)(451199018)(41300700001)(5660300002)(44832011)(2906002)(86362001)(38350700002)(36756003)(38100700002)(8936002)(52116002)(478600001)(66946007)(66556008)(66476007)(8676002)(6486002)(107886003)(6666004)(4326008)(83380400001)(110136005)(316002)(1076003)(186003)(6506007)(6512007)(2616005)(26005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3BvIXzKfsruXLnsEKywm6NBZhmrZvZBm99ZHzJ7jNUsU5tksuxN6HEw7/YXoQn4cdvXM6raL4DdpOoWwmhd/uYz+nBnxtYp4kZF3j7WZOcQAOkp6glNrfh/gBlIfic+yGzyxw2b8LXCCTgC7QMQI38tyRm44HOMQc9Ab0xZnUYG2Qodx3r26fdvAKZZhDk6//2bYjMyj72pmO3Wxmoltknc6/98shrOS7Ps5pvT9MlKKepHDQIGiHImiuvx01fly8Nw7fE801wZYO9Ck2W4bRK/c7oID31Q9RwddDh9Qn0P7CCtDVYOwd4yvzZ9tnehib7OKA90kyxKol6AvGOanpyAnRmDAqgvu8oo2FQ+r7fOrv4706JA0mRP+uVilkAX2WiWvsY9T4j+Bc/qu35RLLZXqCcE+Y7KfDaCaq55lUvoBigczL/sKIV7i9xOGmO/RLFZwVjtvrUidiNvNmizJ9rEJVM/GOVl0D++orZnBxyS6AmcDG1D61UFjLAdRU+VmyTpKu/2O9muIFL9Ppc/F4Tll91Ij1ul9z6iaBhzyraI6Qlvhogd3Oj9GJ9ggIv99j6LVDuDngQPi96GxzO/e9juEmkxHdbzeVA69b4vy+eCTrQVRYj4QxAdDPIeg82lgqhiWn7i/lEnH14z0JmUcTnfNXKcbYdpnsZ8Gc1zAnteGiqLDO2EhR4b6mPAbORGHFeClB2uiay19qBJ+uYdHtf3EfXqbUgSWI4/TD/PLxJ52UYhOdVzm7C+69e1xMX6F3ONbi2ditpd7VVxwvzrYFGtSMebsd4yqXbcfAmS4JLS6LtY3bF68AKu3a1SAvJansq4w9zQefGRaDH1UKd0LQ89xXd2YaQyPYhs8dsGF/op3ERBpPAswd73pzzVxAQZ9EQlsyKVzKhLdAL08s5OQVCPpBO68KJ8+s5Wjpegl2mOqCDKNRHsLkD1w7dib1+D+Xaom0lzQs067UEEGkC/AA2b2N8hqhILhNe8lY+OUXVTtsywBIvUTjbpd5xvkMwG3I/6+jA36AVQY1T5MvTGxvXgf46FW9R1z5+wzdvFP+NDin4TBAc17ynEOtV8TyhTMdkNtG8K/gQ7kPiUNyh3/T+DTzJE7LLGaOpMvuuLYoJKHhLYkyObTjJYu4BcCNaWa0Hx5xR1KyowTYSeSzubRWYqUUdb0e0QNeguI+iI50JWGzhdsQ0666YDKDBJ27vxm3i/lQuxXRH803Q5BNUKBXw0bFKUSweri0kvXtWfQ6xsdUVVI+LQWdPMRZHnRjQ+uY7waMIzp84417R/NAuJpvbJSjmV2Q0vLKgGdxFijku+DQn6vsRt2mas9wFDx9TxsdrOhmWvMUOX9p1sAxPxGZ4sNKAhe6/MYl77riWa2yekG779XjF8QKSaUNlZNew2gpsrfCHyNq25/CA9PejfmwQr0d1SVaggsXUZQl3DT1OYtQ6vfW2e18g8BKAzRk0a/begcCTZBedGV30Z5Jz6VAx3Rf/hQ19ZjCrv7APRAfZFQi/iE0nEK2r57p6lH1bJtdalXwGzwfuEiazNV/TSOZycBUN1ej0fUK24NIUKNNPomGwLoRIH7l8nlHGQrh3HnCXrPsBvdHUmoz7gpWqBuTw== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: afca909d-ce73-4564-060d-08db24568c99 X-MS-Exchange-CrossTenant-AuthSource: DM6PR13MB4249.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2023 06:37:14.8777 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: sX/YuHK1aj8ng7RCUhbxE/n7+sPpjCYs/Ozqx2veS5Nn7v4Y1rHi5XfR+RTh/wu+nEaiMB1sGWfHxXacJtr1TFFxtZ3EjnfA/Dfix9fmM0s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR13MB4110 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Wentao Jia The fixed number of offload flow rule is only supported scenario of one ct zone, in the scenario of multiple ct zones, dynamic number and more number of offload flow rules are required. In order to support scenario of multiple ct zones, parameter num_rules is added for to offload flow rules Signed-off-by: Wentao Jia Acked-by: Simon Horman Signed-off-by: Louis Peens --- .../ethernet/netronome/nfp/flower/conntrack.c | 54 ++++++++++--------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c index 86ea8cbc67a2..ecffb6b0f3a1 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c +++ b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c @@ -693,34 +693,34 @@ static void nfp_fl_get_csum_flag(struct flow_action_entry *a_in, u8 ip_proto, u3 static int nfp_fl_merge_actions_offload(struct flow_rule **rules, struct nfp_flower_priv *priv, struct net_device *netdev, - struct nfp_fl_payload *flow_pay) + struct nfp_fl_payload *flow_pay, + int num_rules) { enum flow_action_hw_stats tmp_stats = FLOW_ACTION_HW_STATS_DONT_CARE; struct flow_action_entry *a_in; - int i, j, num_actions, id; + int i, j, id, num_actions = 0; struct flow_rule *a_rule; int err = 0, offset = 0; - num_actions = rules[CT_TYPE_PRE_CT]->action.num_entries + - rules[CT_TYPE_NFT]->action.num_entries + - rules[CT_TYPE_POST_CT]->action.num_entries; + for (i = 0; i < num_rules; i++) + num_actions += rules[i]->action.num_entries; /* Add one action to make sure there is enough room to add an checksum action * when do nat. */ - a_rule = flow_rule_alloc(num_actions + 1); + a_rule = flow_rule_alloc(num_actions + (num_rules / 2)); if (!a_rule) return -ENOMEM; - /* Actions need a BASIC dissector. */ - a_rule->match = rules[CT_TYPE_PRE_CT]->match; /* post_ct entry have one action at least. */ - if (rules[CT_TYPE_POST_CT]->action.num_entries != 0) { - tmp_stats = rules[CT_TYPE_POST_CT]->action.entries[0].hw_stats; - } + if (rules[num_rules - 1]->action.num_entries != 0) + tmp_stats = rules[num_rules - 1]->action.entries[0].hw_stats; + + /* Actions need a BASIC dissector. */ + a_rule->match = rules[0]->match; /* Copy actions */ - for (j = 0; j < _CT_TYPE_MAX; j++) { + for (j = 0; j < num_rules; j++) { u32 csum_updated = 0; u8 ip_proto = 0; @@ -758,8 +758,9 @@ static int nfp_fl_merge_actions_offload(struct flow_rule **rules, /* nft entry is generated by tc ct, which mangle action do not care * the stats, inherit the post entry stats to meet the * flow_action_hw_stats_check. + * nft entry flow rules are at odd array index. */ - if (j == CT_TYPE_NFT) { + if (j & 0x01) { if (a_in->hw_stats == FLOW_ACTION_HW_STATS_DONT_CARE) a_in->hw_stats = tmp_stats; nfp_fl_get_csum_flag(a_in, ip_proto, &csum_updated); @@ -801,6 +802,7 @@ static int nfp_fl_ct_add_offload(struct nfp_fl_nft_tc_merge *m_entry) struct nfp_fl_payload *flow_pay; struct flow_rule *rules[_CT_TYPE_MAX]; + int num_rules = _CT_TYPE_MAX; u8 *key, *msk, *kdata, *mdata; struct nfp_port *port = NULL; struct net_device *netdev; @@ -820,7 +822,7 @@ static int nfp_fl_ct_add_offload(struct nfp_fl_nft_tc_merge *m_entry) memset(&key_map, 0, sizeof(key_map)); /* Calculate the resultant key layer and size for offload */ - for (i = 0; i < _CT_TYPE_MAX; i++) { + for (i = 0; i < num_rules; i++) { err = nfp_flower_calculate_key_layers(priv->app, m_entry->netdev, &tmp_layer, rules[i], @@ -886,7 +888,7 @@ static int nfp_fl_ct_add_offload(struct nfp_fl_nft_tc_merge *m_entry) * that the layer is not present. */ if (!qinq_sup) { - for (i = 0; i < _CT_TYPE_MAX; i++) { + for (i = 0; i < num_rules; i++) { offset = key_map[FLOW_PAY_META_TCI]; key = kdata + offset; msk = mdata + offset; @@ -900,7 +902,7 @@ static int nfp_fl_ct_add_offload(struct nfp_fl_nft_tc_merge *m_entry) offset = key_map[FLOW_PAY_MAC_MPLS]; key = kdata + offset; msk = mdata + offset; - for (i = 0; i < _CT_TYPE_MAX; i++) { + for (i = 0; i < num_rules; i++) { nfp_flower_compile_mac((struct nfp_flower_mac_mpls *)key, (struct nfp_flower_mac_mpls *)msk, rules[i]); @@ -916,7 +918,7 @@ static int nfp_fl_ct_add_offload(struct nfp_fl_nft_tc_merge *m_entry) offset = key_map[FLOW_PAY_IPV4]; key = kdata + offset; msk = mdata + offset; - for (i = 0; i < _CT_TYPE_MAX; i++) { + for (i = 0; i < num_rules; i++) { nfp_flower_compile_ipv4((struct nfp_flower_ipv4 *)key, (struct nfp_flower_ipv4 *)msk, rules[i]); @@ -927,7 +929,7 @@ static int nfp_fl_ct_add_offload(struct nfp_fl_nft_tc_merge *m_entry) offset = key_map[FLOW_PAY_IPV6]; key = kdata + offset; msk = mdata + offset; - for (i = 0; i < _CT_TYPE_MAX; i++) { + for (i = 0; i < num_rules; i++) { nfp_flower_compile_ipv6((struct nfp_flower_ipv6 *)key, (struct nfp_flower_ipv6 *)msk, rules[i]); @@ -938,7 +940,7 @@ static int nfp_fl_ct_add_offload(struct nfp_fl_nft_tc_merge *m_entry) offset = key_map[FLOW_PAY_L4]; key = kdata + offset; msk = mdata + offset; - for (i = 0; i < _CT_TYPE_MAX; i++) { + for (i = 0; i < num_rules; i++) { nfp_flower_compile_tport((struct nfp_flower_tp_ports *)key, (struct nfp_flower_tp_ports *)msk, rules[i]); @@ -949,7 +951,7 @@ static int nfp_fl_ct_add_offload(struct nfp_fl_nft_tc_merge *m_entry) offset = key_map[FLOW_PAY_QINQ]; key = kdata + offset; msk = mdata + offset; - for (i = 0; i < _CT_TYPE_MAX; i++) { + for (i = 0; i < num_rules; i++) { nfp_flower_compile_vlan((struct nfp_flower_vlan *)key, (struct nfp_flower_vlan *)msk, rules[i]); @@ -965,7 +967,7 @@ static int nfp_fl_ct_add_offload(struct nfp_fl_nft_tc_merge *m_entry) struct nfp_ipv6_addr_entry *entry; struct in6_addr *dst; - for (i = 0; i < _CT_TYPE_MAX; i++) { + for (i = 0; i < num_rules; i++) { nfp_flower_compile_ipv6_gre_tun((void *)key, (void *)msk, rules[i]); } @@ -982,7 +984,7 @@ static int nfp_fl_ct_add_offload(struct nfp_fl_nft_tc_merge *m_entry) } else { __be32 dst; - for (i = 0; i < _CT_TYPE_MAX; i++) { + for (i = 0; i < num_rules; i++) { nfp_flower_compile_ipv4_gre_tun((void *)key, (void *)msk, rules[i]); } @@ -1006,7 +1008,7 @@ static int nfp_fl_ct_add_offload(struct nfp_fl_nft_tc_merge *m_entry) struct nfp_ipv6_addr_entry *entry; struct in6_addr *dst; - for (i = 0; i < _CT_TYPE_MAX; i++) { + for (i = 0; i < num_rules; i++) { nfp_flower_compile_ipv6_udp_tun((void *)key, (void *)msk, rules[i]); } @@ -1023,7 +1025,7 @@ static int nfp_fl_ct_add_offload(struct nfp_fl_nft_tc_merge *m_entry) } else { __be32 dst; - for (i = 0; i < _CT_TYPE_MAX; i++) { + for (i = 0; i < num_rules; i++) { nfp_flower_compile_ipv4_udp_tun((void *)key, (void *)msk, rules[i]); } @@ -1040,13 +1042,13 @@ static int nfp_fl_ct_add_offload(struct nfp_fl_nft_tc_merge *m_entry) offset = key_map[FLOW_PAY_GENEVE_OPT]; key = kdata + offset; msk = mdata + offset; - for (i = 0; i < _CT_TYPE_MAX; i++) + for (i = 0; i < num_rules; i++) nfp_flower_compile_geneve_opt(key, msk, rules[i]); } } /* Merge actions into flow_pay */ - err = nfp_fl_merge_actions_offload(rules, priv, netdev, flow_pay); + err = nfp_fl_merge_actions_offload(rules, priv, netdev, flow_pay, num_rules); if (err) goto ct_offload_err; From patchwork Tue Mar 14 06:36:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louis Peens X-Patchwork-Id: 13173749 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C2B7C6FD1F for ; Tue, 14 Mar 2023 06:37:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229709AbjCNGhg (ORCPT ); Tue, 14 Mar 2023 02:37:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbjCNGhf (ORCPT ); Tue, 14 Mar 2023 02:37:35 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2100.outbound.protection.outlook.com [40.107.236.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC72796C07 for ; Mon, 13 Mar 2023 23:37:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W4usMP99eRUgRejPxpdM6S7yJJPkRXcUNwGqJSmxsAMWIicj9HxTf+GuH2Ivt9xcUQLqg5l4G4PEipgTAgv5hJAlbHPqXVR5XAn1E4pdvLoLW4taXNnRMM69ZCQeCK8lSCClEFGHH0Ns+IqEZVTBwblEPotNtf0YDM+E4X/EWI0zXFW969SoV8MlHUYfCoXTGUDndwJ1ErXx6MeLfgjvEyFUfxEuM5QaLEcK7HmcS7qtxpTmItX4gwkJuo9DkY3DiftPlayJpqipnd0UixgMRe4ZD0ob5D3BbZRiypDF7owhuZoSHPGxPauZrWKctQgEDzUcag6tXK69vaC05sM2bQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xrJLZ6+o6bUbcXVMXvnkLtrrFufGnBxCY1d4x1upUqw=; b=alnS37szYnBlIeTLR+H2+CzBQM2WmMiQXtkak1kTP8/oQMP2SroPdh3kX16UjtybHehvYBrT9az6cGrmrUvVYdRClelK8nsv0LUJd8/ad9XAknoiG2vXgoH5F2QGBDelXqtWTeQQyLGvw4ckNRDbQNNk5i7udPzGfbb58++3RCyjokbjfBIEWqFlJi/+imybXaWXkTAAUiFM+rfOTMranbVoXqTE79faJ70oJisUoLGT7WPR703kcj9Ty6ECge6jKcPZIcHAXCF6+Jo6/WCcdwxne67WAxBQgLIUh90vkLiRuDuEbfh8WKdDaLVLLa/Mlsv0/AyA5Qx+1eZKo6k5MA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xrJLZ6+o6bUbcXVMXvnkLtrrFufGnBxCY1d4x1upUqw=; b=f28Xek9kIGL8Nq/Ii9Cb43+uUjvkgfdzaCZVYVajqLvuz/2kLmWeAmwgUtHJ2tWQ8lyGjwAB3x5Yi1OwrWJ62l9w501u8Hyfu+7YRwsIxGhM9WIU013SbtH9gLvSYdDoGRHM5kDPsOfk3UzV30mPSpba1VUamVxafHzeT3W+S0k= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from DM6PR13MB4249.namprd13.prod.outlook.com (2603:10b6:5:7b::25) by SA0PR13MB4110.namprd13.prod.outlook.com (2603:10b6:806:99::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.26; Tue, 14 Mar 2023 06:37:17 +0000 Received: from DM6PR13MB4249.namprd13.prod.outlook.com ([fe80::c281:6de1:2a5c:40b8]) by DM6PR13MB4249.namprd13.prod.outlook.com ([fe80::c281:6de1:2a5c:40b8%3]) with mapi id 15.20.6178.026; Tue, 14 Mar 2023 06:37:17 +0000 From: Louis Peens To: David Miller , Jakub Kicinski , Paolo Abeni Cc: Simon Horman , netdev@vger.kernel.org, oss-drivers@corigine.com Subject: [PATCH net-next 6/6] nfp: flower: offload tc flows of multiple conntrack zones Date: Tue, 14 Mar 2023 08:36:10 +0200 Message-Id: <20230314063610.10544-7-louis.peens@corigine.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230314063610.10544-1-louis.peens@corigine.com> References: <20230314063610.10544-1-louis.peens@corigine.com> X-ClientProxiedBy: JNAP275CA0067.ZAFP275.PROD.OUTLOOK.COM (2603:1086:0:4f::13) To DM6PR13MB4249.namprd13.prod.outlook.com (2603:10b6:5:7b::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR13MB4249:EE_|SA0PR13MB4110:EE_ X-MS-Office365-Filtering-Correlation-Id: 26f7fa9a-02df-41e3-4cc1-08db24568e4d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: k7gstR1B5vZsZwrk6ZPDVRZio2pNg2OYwSFgQCpuiSQPaWIIUZnDLiW8jTkjpBfgWEBzqyOyNuyBcoiPEWqQ+Fas7BZY8XZA3E5MEynKc/Q1iGu4PcGI42EjmapnjfGGaKNf8cTjEnPth0pNdM6qY+wRO5LjuyjeVC2vyF40Y2m5UdXi4u3++xQxElrvQlUjAh9ZKCR/4/CQR7JQhv0hQFbdLI+TPJubA0oikB0zdoMXyUGvw4sO6QE1BRbzyAIqmYiRvBOGoN59cbZYKy6Adf7U9l8CEkFaDh+36NJNh8wuuW543biQSnSAQOLK6Er8fsb//q/hdYYzXqLQ6vwhkuI81VDhpFaPPR+fw1aVs3xac6TPYp6Ry3wHIs3ECJoGG70vs+BKKNuaKAW9ieiKeTSUwEMf9KAOVzF2718QBuL4X+sgwvil1+LOZFGp/oSBk2bhIKbXW44alEcxXkyNiXBbmI7oCilFQg+MxwgEM7CN7dw1Lajt7m17hJRl/XRCnffXVek2D2jOjAfEnfi/XZht1IeUK823NPvpM4hikkTUygNZrNRAKGSffP7jCq0uaMB7j2ferKlGQzilN6YV9Q+P7YVCMPkR1BjFHVly/by3EEyLJFAClD+FyG+pnQQypOv/yStt3IbsPGPR3bg0Cto8zsv9rE8dAXYussAN+S+yVCFOzqY8P1ftOY/yq7we5FpBpF99gDaDm2ZCqq+hqg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR13MB4249.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(136003)(346002)(39840400004)(376002)(396003)(366004)(451199018)(41300700001)(30864003)(5660300002)(44832011)(2906002)(86362001)(38350700002)(36756003)(38100700002)(8936002)(52116002)(478600001)(66946007)(66556008)(66476007)(8676002)(6486002)(107886003)(6666004)(4326008)(83380400001)(110136005)(316002)(1076003)(186003)(6506007)(6512007)(2616005)(26005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5ydVc8v8ulwlgr9eyCSwfUbPxc0fmsnjqXhQq8T/d+F0LCm2x3bovDsbFn67yBN+GmTXK3UzItdE9GG9yQtLauGcbwB9R+R0zimcMlD1QhEnpM8myZ1bintS5dhjOi+Fxc9w8PGKIN+/Vqk9sNDIREjSJwr5B86AXVNazkkbzSTXgU3Rb1ZGFiIyQIeot1BCHPVGmx3mTqxOsUhcpYZipFuGmKzEReG+wFyrJ+QEGJoFDTD2PLtePmd3KvAhyNREwlZFgNPF9q3Vv9vg+sUahrXCotZ2/q43V9YzUTgT/WjYrDhqu831fi5KNwubzgiRYEui9EaoWm4+iViX6ZmL35rAKJUs+TnUVTvT8t4+OAIFyON8jIpUhi2KDm5XbtO0a6H+5aW+80e6OaaF8jd6vLQMVHpYWWGWi52Jp7B7wSq9cBwWPo7kFSG8n5uhJVDNCj6dBq+D9LiKNvetjpf92namim+K06EDPUeVd1kNfG+2Qf3Kv3PFnjaazQpgY8NHE1D958vANFZ2dDu7d/si79hLXUWudLV+PPiYm7CPeDsiWID/lgZKpoZtdAo3T8MI8kdTsP5PIbnzSQCYRiRsD5B2z8lL97a8NQfMhw/7H8pArcL8BYOvwr292YHSzPRPoA8DscprZYRp8OzpFLZqDi72kb01yIgfH0oF3NDUOqI4+lHePvNITOMrT2flsrPFq8QwsQUr+jHchCy80xvWpmr8LeV0OHlxB7WraCbu2FYdb/56q7WSujKbgkQhtjZ7oly88bQurxGsKvWfqheIw6XE38oj+RVSKGf0YHswefCg5jq0vhaev7+JbQ+DxyVtU5+Cw+YPe8jjvOa6+mUtEN9Lc3pxjvNl/dOmBgjnTiYj/x+K6YTzHN54EP+s7M21qCaePHTc5+dp5J5yLFo2kfSisTnRozTnH+3hfOSB0nuIeEJEvlaMlO3r/tTe6BM7DxQfEjShMSUNx+qCIihySdA18emI23FPZ6RxMAyYk1HCLLWFUUgHAQMVvSdehVeLi3UUbg9k3I7APz2y5lS646rvU3jh0uxzXmisNFFp2MC0gPfM79UzQlZeHdQoiEInOHt/kYM62ua+Vv4XUZyikyWHIL1LOL+fIuPezMhbdpbbgV8kn6fflYNwGjV/qdja/L7PkPLfKPn/M80kvt6jxyVEkuw+ijVmdY12T7tiL+ck945iSzEFVx47p8fO2RGFWcF97vv0BWHIGkoQFDJ7N4aeFnyYxArTuf+jeBaEoeVwSaP4ZXwl1HK35wXsyg7t6ZbCRK2tkP+00bfe1OUYoRrpGCNsDAobV9011NnryWZDvI05eVfuHHj+XnrGVHoZJNFNnMrScMGCYeB+GUDc5aY74H2qyLjyNp2qrBHPA+q/4VKKuDqgKWOzycpVkPWoovQP+rcP44C78AkxY58B9//R5yik91rVHaWq2aqVb37rVDzUfRyZ1vfxabaf3QI/wiDZ2Dw2Z55SunchowFPaD2EwYv2INTyt+t7hzFSojybuJ/8rJ2XD5mNmN/YwMb86PKKFGeSkspl/7r5g726slp5JBqBdjwzAvoMK6byFzE1Bi6RFAaAXO7wAHIdmwM+AKeVthnmxWczSutjm/vDHQ== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26f7fa9a-02df-41e3-4cc1-08db24568e4d X-MS-Exchange-CrossTenant-AuthSource: DM6PR13MB4249.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2023 06:37:17.8150 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9LgJuXjIeUu8Q9CyEomCuUbCK5Yh7ofyAtmMlUieUIKHm9zAwMr/J7rk4hwb6P9kbH1Kyj7aM9/OuGwY9ypEZ3INM3i72X3UxVvqca0TMWw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR13MB4110 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Wentao Jia If goto_chain action present in the post ct flow rule, merge flow rules in this ct-zone, create a new pre_ct entry as the pre ct flow rule of next ct-zone, but do not offload merged flow rules to firmware. Repeat the process in the next ct-zone until no goto_chain action present in the post ct flow rule in a certain ct-zone, merged all the flow rules. Offload to firmware finally. Signed-off-by: Wentao Jia Acked-by: Simon Horman Signed-off-by: Louis Peens --- .../ethernet/netronome/nfp/flower/conntrack.c | 145 +++++++++++++++--- .../ethernet/netronome/nfp/flower/conntrack.h | 30 +++- .../ethernet/netronome/nfp/flower/offload.c | 2 +- 3 files changed, 154 insertions(+), 23 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c index ecffb6b0f3a1..73032173ac4e 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c +++ b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c @@ -522,6 +522,21 @@ static int nfp_ct_check_vlan_merge(struct flow_action_entry *a_in, return 0; } +/* Extra check for multiple ct-zones merge + * currently surpport nft entries merge check in different zones + */ +static int nfp_ct_merge_extra_check(struct nfp_fl_ct_flow_entry *nft_entry, + struct nfp_fl_ct_tc_merge *tc_m_entry) +{ + struct nfp_fl_nft_tc_merge *prev_nft_m_entry; + struct nfp_fl_ct_flow_entry *pre_ct_entry; + + pre_ct_entry = tc_m_entry->pre_ct_parent; + prev_nft_m_entry = pre_ct_entry->prev_m_entries[pre_ct_entry->num_prev_m_entries - 1]; + + return nfp_ct_merge_check(prev_nft_m_entry->nft_parent, nft_entry); +} + static int nfp_ct_merge_act_check(struct nfp_fl_ct_flow_entry *pre_ct_entry, struct nfp_fl_ct_flow_entry *post_ct_entry, struct nfp_fl_ct_flow_entry *nft_entry) @@ -796,27 +811,34 @@ static int nfp_fl_ct_add_offload(struct nfp_fl_nft_tc_merge *m_entry) { enum nfp_flower_tun_type tun_type = NFP_FL_TUNNEL_NONE; struct nfp_fl_ct_zone_entry *zt = m_entry->zt; + struct flow_rule *rules[NFP_MAX_ENTRY_RULES]; + struct nfp_fl_ct_flow_entry *pre_ct_entry; struct nfp_fl_key_ls key_layer, tmp_layer; struct nfp_flower_priv *priv = zt->priv; u16 key_map[_FLOW_PAY_LAYERS_MAX]; struct nfp_fl_payload *flow_pay; - - struct flow_rule *rules[_CT_TYPE_MAX]; - int num_rules = _CT_TYPE_MAX; u8 *key, *msk, *kdata, *mdata; struct nfp_port *port = NULL; + int num_rules, err, i, j = 0; struct net_device *netdev; bool qinq_sup; u32 port_id; u16 offset; - int i, err; netdev = m_entry->netdev; qinq_sup = !!(priv->flower_ext_feats & NFP_FL_FEATS_VLAN_QINQ); - rules[CT_TYPE_PRE_CT] = m_entry->tc_m_parent->pre_ct_parent->rule; - rules[CT_TYPE_NFT] = m_entry->nft_parent->rule; - rules[CT_TYPE_POST_CT] = m_entry->tc_m_parent->post_ct_parent->rule; + pre_ct_entry = m_entry->tc_m_parent->pre_ct_parent; + num_rules = pre_ct_entry->num_prev_m_entries * 2 + _CT_TYPE_MAX; + + for (i = 0; i < pre_ct_entry->num_prev_m_entries; i++) { + rules[j++] = pre_ct_entry->prev_m_entries[i]->tc_m_parent->pre_ct_parent->rule; + rules[j++] = pre_ct_entry->prev_m_entries[i]->nft_parent->rule; + } + + rules[j++] = m_entry->tc_m_parent->pre_ct_parent->rule; + rules[j++] = m_entry->nft_parent->rule; + rules[j++] = m_entry->tc_m_parent->post_ct_parent->rule; memset(&key_layer, 0, sizeof(struct nfp_fl_key_ls)); memset(&key_map, 0, sizeof(key_map)); @@ -1181,6 +1203,12 @@ static int nfp_ct_do_nft_merge(struct nfp_fl_ct_zone_entry *zt, if (err) return err; + if (pre_ct_entry->num_prev_m_entries > 0) { + err = nfp_ct_merge_extra_check(nft_entry, tc_m_entry); + if (err) + return err; + } + /* Combine tc_merge and nft cookies for this cookie. */ new_cookie[0] = tc_m_entry->cookie[0]; new_cookie[1] = tc_m_entry->cookie[1]; @@ -1211,11 +1239,6 @@ static int nfp_ct_do_nft_merge(struct nfp_fl_ct_zone_entry *zt, list_add(&nft_m_entry->tc_merge_list, &tc_m_entry->children); list_add(&nft_m_entry->nft_flow_list, &nft_entry->children); - /* Generate offload structure and send to nfp */ - err = nfp_fl_ct_add_offload(nft_m_entry); - if (err) - goto err_nft_ct_offload; - err = rhashtable_insert_fast(&zt->nft_merge_tb, &nft_m_entry->hash_node, nfp_nft_ct_merge_params); if (err) @@ -1223,12 +1246,20 @@ static int nfp_ct_do_nft_merge(struct nfp_fl_ct_zone_entry *zt, zt->nft_merge_count++; + if (post_ct_entry->goto_chain_index > 0) + return nfp_fl_create_new_pre_ct(nft_m_entry); + + /* Generate offload structure and send to nfp */ + err = nfp_fl_ct_add_offload(nft_m_entry); + if (err) + goto err_nft_ct_offload; + return err; -err_nft_ct_merge_insert: +err_nft_ct_offload: nfp_fl_ct_del_offload(zt->priv->app, nft_m_entry->tc_flower_cookie, nft_m_entry->netdev); -err_nft_ct_offload: +err_nft_ct_merge_insert: list_del(&nft_m_entry->tc_merge_list); list_del(&nft_m_entry->nft_flow_list); kfree(nft_m_entry); @@ -1474,7 +1505,7 @@ nfp_fl_ct_flow_entry *nfp_fl_ct_add_flow(struct nfp_fl_ct_zone_entry *zt, entry->zt = zt; entry->netdev = netdev; - entry->cookie = flow->cookie; + entry->cookie = flow->cookie > 0 ? flow->cookie : (unsigned long)entry; entry->chain_index = flow->common.chain_index; entry->tun_offset = NFP_FL_CT_NO_TUN; @@ -1514,6 +1545,9 @@ nfp_fl_ct_flow_entry *nfp_fl_ct_add_flow(struct nfp_fl_ct_zone_entry *zt, INIT_LIST_HEAD(&entry->children); + if (flow->cookie == 0) + return entry; + /* Now add a ct map entry to flower-priv */ map = get_hashentry(&zt->priv->ct_map_table, &flow->cookie, nfp_ct_map_params, sizeof(*map)); @@ -1572,6 +1606,14 @@ static void cleanup_nft_merge_entry(struct nfp_fl_nft_tc_merge *m_entry) list_del(&m_entry->tc_merge_list); list_del(&m_entry->nft_flow_list); + if (m_entry->next_pre_ct_entry) { + struct nfp_fl_ct_map_entry pre_ct_map_ent; + + pre_ct_map_ent.ct_entry = m_entry->next_pre_ct_entry; + pre_ct_map_ent.cookie = 0; + nfp_fl_ct_del_flow(&pre_ct_map_ent); + } + kfree(m_entry); } @@ -1742,7 +1784,8 @@ nfp_ct_merge_nft_with_tc(struct nfp_fl_ct_flow_entry *nft_entry, int nfp_fl_ct_handle_pre_ct(struct nfp_flower_priv *priv, struct net_device *netdev, struct flow_cls_offload *flow, - struct netlink_ext_ack *extack) + struct netlink_ext_ack *extack, + struct nfp_fl_nft_tc_merge *m_entry) { struct flow_action_entry *ct_act, *ct_goto; struct nfp_fl_ct_flow_entry *ct_entry; @@ -1787,6 +1830,20 @@ int nfp_fl_ct_handle_pre_ct(struct nfp_flower_priv *priv, ct_entry->type = CT_TYPE_PRE_CT; ct_entry->chain_index = flow->common.chain_index; ct_entry->goto_chain_index = ct_goto->chain_index; + + if (m_entry) { + struct nfp_fl_ct_flow_entry *pre_ct_entry; + int i; + + pre_ct_entry = m_entry->tc_m_parent->pre_ct_parent; + for (i = 0; i < pre_ct_entry->num_prev_m_entries; i++) + ct_entry->prev_m_entries[i] = pre_ct_entry->prev_m_entries[i]; + ct_entry->prev_m_entries[i++] = m_entry; + ct_entry->num_prev_m_entries = i; + + m_entry->next_pre_ct_entry = ct_entry; + } + list_add(&ct_entry->list_node, &zt->pre_ct_list); zt->pre_ct_count++; @@ -1864,6 +1921,28 @@ int nfp_fl_ct_handle_post_ct(struct nfp_flower_priv *priv, return 0; } +int nfp_fl_create_new_pre_ct(struct nfp_fl_nft_tc_merge *m_entry) +{ + struct nfp_fl_ct_flow_entry *pre_ct_entry, *post_ct_entry; + struct flow_cls_offload new_pre_ct_flow; + int err; + + pre_ct_entry = m_entry->tc_m_parent->pre_ct_parent; + if (pre_ct_entry->num_prev_m_entries >= NFP_MAX_RECIRC_CT_ZONES - 1) + return -1; + + post_ct_entry = m_entry->tc_m_parent->post_ct_parent; + memset(&new_pre_ct_flow, 0, sizeof(struct flow_cls_offload)); + new_pre_ct_flow.rule = post_ct_entry->rule; + new_pre_ct_flow.common.chain_index = post_ct_entry->chain_index; + + err = nfp_fl_ct_handle_pre_ct(pre_ct_entry->zt->priv, + pre_ct_entry->netdev, + &new_pre_ct_flow, NULL, + m_entry); + return err; +} + static void nfp_fl_ct_sub_stats(struct nfp_fl_nft_tc_merge *nft_merge, enum ct_entry_type type, u64 *m_pkts, @@ -1909,6 +1988,32 @@ nfp_fl_ct_sub_stats(struct nfp_fl_nft_tc_merge *nft_merge, 0, priv->stats[ctx_id].used, FLOW_ACTION_HW_STATS_DELAYED); } + + /* Update previous pre_ct/post_ct/nft flow stats */ + if (nft_merge->tc_m_parent->pre_ct_parent->num_prev_m_entries > 0) { + struct nfp_fl_nft_tc_merge *tmp_nft_merge; + int i; + + for (i = 0; i < nft_merge->tc_m_parent->pre_ct_parent->num_prev_m_entries; i++) { + tmp_nft_merge = nft_merge->tc_m_parent->pre_ct_parent->prev_m_entries[i]; + flow_stats_update(&tmp_nft_merge->tc_m_parent->pre_ct_parent->stats, + priv->stats[ctx_id].bytes, + priv->stats[ctx_id].pkts, + 0, priv->stats[ctx_id].used, + FLOW_ACTION_HW_STATS_DELAYED); + flow_stats_update(&tmp_nft_merge->tc_m_parent->post_ct_parent->stats, + priv->stats[ctx_id].bytes, + priv->stats[ctx_id].pkts, + 0, priv->stats[ctx_id].used, + FLOW_ACTION_HW_STATS_DELAYED); + flow_stats_update(&tmp_nft_merge->nft_parent->stats, + priv->stats[ctx_id].bytes, + priv->stats[ctx_id].pkts, + 0, priv->stats[ctx_id].used, + FLOW_ACTION_HW_STATS_DELAYED); + } + } + /* Reset stats from the nfp */ priv->stats[ctx_id].pkts = 0; priv->stats[ctx_id].bytes = 0; @@ -2113,10 +2218,12 @@ int nfp_fl_ct_del_flow(struct nfp_fl_ct_map_entry *ct_map_ent) switch (ct_entry->type) { case CT_TYPE_PRE_CT: zt->pre_ct_count--; - rhashtable_remove_fast(m_table, &ct_map_ent->hash_node, - nfp_ct_map_params); + if (ct_map_ent->cookie > 0) + rhashtable_remove_fast(m_table, &ct_map_ent->hash_node, + nfp_ct_map_params); nfp_fl_ct_clean_flow_entry(ct_entry); - kfree(ct_map_ent); + if (ct_map_ent->cookie > 0) + kfree(ct_map_ent); if (!zt->pre_ct_count) { zt->nft = NULL; diff --git a/drivers/net/ethernet/netronome/nfp/flower/conntrack.h b/drivers/net/ethernet/netronome/nfp/flower/conntrack.h index 9440ab776ece..c4ec78358033 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/conntrack.h +++ b/drivers/net/ethernet/netronome/nfp/flower/conntrack.h @@ -86,6 +86,9 @@ enum ct_entry_type { _CT_TYPE_MAX, }; +#define NFP_MAX_RECIRC_CT_ZONES 4 +#define NFP_MAX_ENTRY_RULES (NFP_MAX_RECIRC_CT_ZONES * 2 + 1) + enum nfp_nfp_layer_name { FLOW_PAY_META_TCI = 0, FLOW_PAY_INPORT, @@ -114,27 +117,31 @@ enum nfp_nfp_layer_name { * @chain_index: Chain index of the original flow * @goto_chain_index: goto chain index of the flow * @netdev: netdev structure. - * @type: Type of pre-entry from enum ct_entry_type * @zt: Reference to the zone table this belongs to * @children: List of tc_merge flows this flow forms part of * @rule: Reference to the original TC flow rule * @stats: Used to cache stats for updating + * @prev_m_entries: Array of all previous nft_tc_merge entries + * @num_prev_m_entries: The number of all previous nft_tc_merge entries * @tun_offset: Used to indicate tunnel action offset in action list * @flags: Used to indicate flow flag like NAT which used by merge. + * @type: Type of ct-entry from enum ct_entry_type */ struct nfp_fl_ct_flow_entry { unsigned long cookie; struct list_head list_node; u32 chain_index; u32 goto_chain_index; - enum ct_entry_type type; struct net_device *netdev; struct nfp_fl_ct_zone_entry *zt; struct list_head children; struct flow_rule *rule; struct flow_stats stats; + struct nfp_fl_nft_tc_merge *prev_m_entries[NFP_MAX_RECIRC_CT_ZONES - 1]; + u8 num_prev_m_entries; u8 tun_offset; // Set to NFP_FL_CT_NO_TUN if no tun u8 flags; + u8 type; }; /** @@ -171,6 +178,7 @@ struct nfp_fl_ct_tc_merge { * @nft_parent: The nft_entry parent * @tc_flower_cookie: The cookie of the flow offloaded to the nfp * @flow_pay: Reference to the offloaded flow struct + * @next_pre_ct_entry: Reference to the next ct zone pre ct entry */ struct nfp_fl_nft_tc_merge { struct net_device *netdev; @@ -183,6 +191,7 @@ struct nfp_fl_nft_tc_merge { struct nfp_fl_ct_flow_entry *nft_parent; unsigned long tc_flower_cookie; struct nfp_fl_payload *flow_pay; + struct nfp_fl_ct_flow_entry *next_pre_ct_entry; }; /** @@ -206,6 +215,7 @@ bool is_post_ct_flow(struct flow_cls_offload *flow); * @netdev: netdev structure. * @flow: TC flower classifier offload structure. * @extack: Extack pointer for errors + * @m_entry:previous nfp_fl_nft_tc_merge entry * * Adds a new entry to the relevant zone table and tries to * merge with other +trk+est entries and offload if possible. @@ -215,7 +225,8 @@ bool is_post_ct_flow(struct flow_cls_offload *flow); int nfp_fl_ct_handle_pre_ct(struct nfp_flower_priv *priv, struct net_device *netdev, struct flow_cls_offload *flow, - struct netlink_ext_ack *extack); + struct netlink_ext_ack *extack, + struct nfp_fl_nft_tc_merge *m_entry); /** * nfp_fl_ct_handle_post_ct() - Handles +trk+est conntrack rules * @priv: Pointer to app priv @@ -233,6 +244,19 @@ int nfp_fl_ct_handle_post_ct(struct nfp_flower_priv *priv, struct flow_cls_offload *flow, struct netlink_ext_ack *extack); +/** + * nfp_fl_create_new_pre_ct() - create next ct_zone -trk conntrack rules + * @m_entry:previous nfp_fl_nft_tc_merge entry + * + * Create a new pre_ct entry from previous nfp_fl_nft_tc_merge entry + * to the next relevant zone table. Try to merge with other +trk+est + * entries and offload if possible. The created new pre_ct entry is + * linked to the previous nfp_fl_nft_tc_merge entry. + * + * Return: negative value on error, 0 if configured successfully. + */ +int nfp_fl_create_new_pre_ct(struct nfp_fl_nft_tc_merge *m_entry); + /** * nfp_fl_ct_clean_flow_entry() - Free a nfp_fl_ct_flow_entry * @entry: Flow entry to cleanup diff --git a/drivers/net/ethernet/netronome/nfp/flower/offload.c b/drivers/net/ethernet/netronome/nfp/flower/offload.c index 8593cafa6368..18328eb7f5c3 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/offload.c +++ b/drivers/net/ethernet/netronome/nfp/flower/offload.c @@ -1344,7 +1344,7 @@ nfp_flower_add_offload(struct nfp_app *app, struct net_device *netdev, port = nfp_port_from_netdev(netdev); if (is_pre_ct_flow(flow)) - return nfp_fl_ct_handle_pre_ct(priv, netdev, flow, extack); + return nfp_fl_ct_handle_pre_ct(priv, netdev, flow, extack, NULL); if (is_post_ct_flow(flow)) return nfp_fl_ct_handle_post_ct(priv, netdev, flow, extack);