[v7,00/10] ethdev: datapath-focused flow rules management
Message ID | 20220219041144.2145380-1-akozyrev@nvidia.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5735CA034E; Sat, 19 Feb 2022 05:12:10 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EE6A740141; Sat, 19 Feb 2022 05:12:09 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2042.outbound.protection.outlook.com [40.107.244.42]) by mails.dpdk.org (Postfix) with ESMTP id 5A8E740040 for <dev@dpdk.org>; Sat, 19 Feb 2022 05:12:08 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B1JH4fplw7LdBHfTOM5LuiN7sHQMR8u7BWQFkt+ik56VG13vHWgftPoGzMJJbOyaLv0vd1BQj9U1yhFQQs9NjAqdTHW4uOYbcaGILd2N2e/Gqic/PnNSthn/SFrrtcOiKSf2yFjXcGy5FJk+I8yOh3U79fKHAAvOFHgxVl7u4KzNCH9QOkzHJtiqvPFYXOMBEZzSzzVU6/hogrRV2NrA3a2qfT4BURbBXcTW/vS9Oz8c04W+aa7/TkKcYTJYequ67NVpBnIu/+9dlX2XVDOh4EkrsPUWpHyRxAKGFwDKgX5wZ5ImxQNfNdarqDqA9wE4mV7o07+FfSNPq5Sj0A6DIg== 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=9+2IjWvzOU0v49PWUhVsSqoJRCndgrrOvXwvrv/RI50=; b=SZeZTxJS9WpmolAJVmuu5DnGJCg9DETyKVXqAmkWUO94ZAs4qGuJ25HCgCM68bYnT2M5S782BVRWw6ZCcuJM9KzYiLjRxlitsDkex2L0blOqrv9O5FKN0YUz6hRFlKmcLlOfZ/ftFxwUydKkKDGgHTg0UPJsvi9H5BPn9Rixw+lOgiPQEKJSrnYaCbh9baDoaSogRdRv4ksSF+58bbLTCmsLGqHqtJ8sH3mJ1QZ8GU3aTTiV9wbcACOHgcEO411IGCBF8ww3+RmHD1lb1GpnwyXTWPeImmXnKxZ2XIIK9NQlMldd2AG4TzQsJRiu2BCANCaiomuqAp3CiiDP8y6QXA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none 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=9+2IjWvzOU0v49PWUhVsSqoJRCndgrrOvXwvrv/RI50=; b=hyJu8WwpDJKwA+gz983pkV1XovfQ9Cmtd+VhI1gygBJEXZ5LrTO6KmSDAseCplpbuOohiTg+Dg2jUtVfCKAePRbFGoML8e52qCeoaZz6f/oooXnFLV5qivMYMVH0sVZG0HC8XuOILqc1nB852SCXk3npQUg94vPp+BjnpptGZ4FapJ6l0l271Xppz6JT2glcCzEJa5Du88bZcRQzw5L3h78eaHfl3bQttbKiYXYJnR+gz6SBT11vzV98oGvOa/GdqfJngWyqvTHi3Sob/HjALozxCAp8idiTCu3PjpjeBQwx74MDIJzGqAnxGs287KwvQd0V+TeOLa+lKPhAd4vA8A== Received: from BN9PR12MB5322.namprd12.prod.outlook.com (2603:10b6:408:103::13) by DM6PR12MB4218.namprd12.prod.outlook.com (2603:10b6:5:21b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.24; Sat, 19 Feb 2022 04:12:05 +0000 Received: from DM6PR03CA0023.namprd03.prod.outlook.com (2603:10b6:5:40::36) by BN9PR12MB5322.namprd12.prod.outlook.com (2603:10b6:408:103::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.24; Sat, 19 Feb 2022 04:12:04 +0000 Received: from DM6NAM11FT062.eop-nam11.prod.protection.outlook.com (2603:10b6:5:40:cafe::a5) by DM6PR03CA0023.outlook.office365.com (2603:10b6:5:40::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.16 via Frontend Transport; Sat, 19 Feb 2022 04:12:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.238) by DM6NAM11FT062.mail.protection.outlook.com (10.13.173.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4995.15 via Frontend Transport; Sat, 19 Feb 2022 04:12:03 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sat, 19 Feb 2022 04:12:02 +0000 Received: from pegasus01.mtr.labs.mlnx (10.126.230.35) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Fri, 18 Feb 2022 20:11:58 -0800 From: Alexander Kozyrev <akozyrev@nvidia.com> To: <dev@dpdk.org> CC: <orika@nvidia.com>, <thomas@monjalon.net>, <ivan.malov@oktetlabs.ru>, <andrew.rybchenko@oktetlabs.ru>, <ferruh.yigit@intel.com>, <mohammad.abdul.awal@intel.com>, <qi.z.zhang@intel.com>, <jerinj@marvell.com>, <ajit.khaparde@broadcom.com>, <bruce.richardson@intel.com> Subject: [PATCH v7 00/10] ethdev: datapath-focused flow rules management Date: Sat, 19 Feb 2022 06:11:33 +0200 Message-ID: <20220219041144.2145380-1-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20220212041930.1516767-1-akozyrev@nvidia.com> References: <20220212041930.1516767-1-akozyrev@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To drhqmail201.nvidia.com (10.126.190.180) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ed0b9560-f7fc-49e8-8f24-08d9f35dfc56 X-MS-TrafficTypeDiagnostic: BN9PR12MB5322:EE_|DM6PR12MB4218:EE_ X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr,ExtAddr X-Microsoft-Antispam-PRVS: <BN9PR12MB5322E96C2C2FB1DDB2432AD6AF389@BN9PR12MB5322.namprd12.prod.outlook.com> X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4zv60n3dpPBS3azoyI+vyswIdzY50AnJ7jMDBNfJwQmZyexDdg/2vIFRpTqIPN1dbOPc9CF1/gSZtgCLfACZoZ+S2+YxHIIwBSXsdHqF2yNmcDjZFKPsHFYIYjkcBo6H9a/cHsyA6q6jfbHpUuC4X+EXzWH9GL1q+cq9tVBgfgg0dzanlM4WT4NzFAV/kHfxKSvg5s8xm/QifE97W2XT9lBa1Yw0R4oaiLiPIVhoO8BWbBt/qVR2P9WBJqCCBbPFOVDd4lVxqV0uEflB+KxFnxgAvAUtm8omebMeGR1Ojixm9ub3cJPFvKO++9p05jYgZfQp/8Gtf8NJDIdQgqFhT03JpFGFAyN26OiZyD9WVKxm+0zDsll2+jU2feurWTUyqE1XnpjliVrarH89DMoGaM2gYOKk2COuMyxBRR5DOtZ3etAt7fMcMrne+Y8rBSblNVb2+pRNV2qpUgLdYvBAlxxufWefc982UINwciPNMNPInZyNxdw3WviYkgZ8xKo4BWhi6Hph3JASRdWajf+B5vEu5LO/C1I73qUlkWmKsom8BWA032IX4wcLhioqVeONsUUrC51n9uWBLduFnEIYmJE2FWcKe4BjN8YQseS6Lk8AZLTXhrOysJtLas/MBvl0mio+N3X8s7x5lFzntmLk3jQ6n/EVM7ZEYw6fYaJiJU40KA8m/rVFbYFXOL83GH00RzSY3xCP3fCFG3uBNVExDXXhcgDGij8s+E4d3iCWsKKb+1F4Ph750Liwqxm0plXxqnE/H0boiRBe2jpSsAlrNlErfd53/2YkhbFO7DcqeNLaTsYSTq1Yr9Es+yXwsqBZArPDhLVfAkVf7CXRtSEBnA== X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(46966006)(36840700001)(508600001)(82310400004)(966005)(16526019)(83380400001)(426003)(336012)(47076005)(86362001)(36860700001)(6666004)(2616005)(186003)(1076003)(26005)(7416002)(5660300002)(356005)(40460700003)(70586007)(81166007)(2906002)(70206006)(8676002)(36756003)(4326008)(6916009)(54906003)(316002)(8936002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2022 04:12:03.9425 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ed0b9560-f7fc-49e8-8f24-08d9f35dfc56 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT062.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4218 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Message
Alexander Kozyrev
Feb. 19, 2022, 4:11 a.m. UTC
Three major changes to a generic RTE Flow API were implemented in order to speed up flow rule insertion/destruction and adapt the API to the needs of a datapath-focused flow rules management applications: 1. Pre-configuration hints. Application may give us some hints on what type of resources are needed. Introduce the configuration routine to prepare all the needed resources inside a PMD/HW before any flow rules are created at the init stage. 2. Flow grouping using templates. Use the knowledge about which flow rules are to be used in an application and prepare item and action templates for them in advance. Group flow rules with common patterns and actions together for better resource management. 3. Queue-based flow management. Perform flow rule insertion/destruction asynchronously to spare the datapath from blocking on RTE Flow API and allow it to continue with packet processing. Enqueue flow rules operations and poll for the results later. testpmd examples are part of the patch series. PMD changes will follow. RFC: https://patchwork.dpdk.org/project/dpdk/cover/20211006044835.3936226-1-akozyrev@nvidia.com/ Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com> Acked-by: Ori Kam <orika@nvidia.com> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com> --- v7: - added sanity checks and device state validation - added flow engine state validation - added ingress/egress/transfer attibutes to templates - moved user_data to a parameter list - renamed asynchronous functions from "_q_" to "_async_" - created a separate commit for indirect actions v6: addressed more review comments - fixed typos - rewrote code snippets - add a way to get queue size - renamed port/queue attibutes parameters v5: changed titles for testpmd commits v4: - removed structures versioning - introduced new rte_flow_port_info structure for rte_flow_info_get API - renamed rte_flow_table_create to rte_flow_template_table_create v3: addressed review comments and updated documentation - added API to get info about pre-configurable resources - renamed rte_flow_item_template to rte_flow_pattern_template - renamed drain operation attribute to postpone - renamed rte_flow_q_drain to rte_flow_q_push - renamed rte_flow_q_dequeue to rte_flow_q_pull v2: fixed patch series thread Alexander Kozyrev (11): ethdev: introduce flow engine configuration ethdev: add flow item/action templates ethdev: bring in async queue-based flow rules operations ethdev: bring in async indirect actions operations app/testpmd: add flow engine configuration app/testpmd: add flow template management app/testpmd: add flow table management app/testpmd: add async flow create/destroy operations app/testpmd: add flow queue push operation app/testpmd: add flow queue pull operation app/testpmd: add async indirect actions operations app/test-pmd/cmdline_flow.c | 1726 ++++++++++++++++- app/test-pmd/config.c | 778 ++++++++ app/test-pmd/testpmd.h | 67 + .../prog_guide/img/rte_flow_async_init.svg | 205 ++ .../prog_guide/img/rte_flow_async_usage.svg | 354 ++++ doc/guides/prog_guide/rte_flow.rst | 345 ++++ doc/guides/rel_notes/release_22_03.rst | 27 + doc/guides/testpmd_app_ug/testpmd_funcs.rst | 383 +++- lib/ethdev/ethdev_driver.h | 7 +- lib/ethdev/rte_flow.c | 500 +++++ lib/ethdev/rte_flow.h | 766 ++++++++ lib/ethdev/rte_flow_driver.h | 108 ++ lib/ethdev/version.map | 15 + 13 files changed, 5185 insertions(+), 96 deletions(-) create mode 100644 doc/guides/prog_guide/img/rte_flow_async_init.svg create mode 100644 doc/guides/prog_guide/img/rte_flow_async_usage.svg