From patchwork Sun Feb 20 03:43:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kozyrev X-Patchwork-Id: 107857 Return-Path: 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 0E19DA00C2; Sun, 20 Feb 2022 04:44:36 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D0D334068C; Sun, 20 Feb 2022 04:44:35 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2070.outbound.protection.outlook.com [40.107.243.70]) by mails.dpdk.org (Postfix) with ESMTP id 6938640395 for ; Sun, 20 Feb 2022 04:44:34 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ST7Piq65kddKsvezqzzkh55fPuxtmrj82b1Vb/eo4Zt+TQ3wVVUS+6k6wUOPHX7whX4+05IsOIh5wh2sgMkhYR7WfT7mXnGsvDF0jvbWRAPDI6pa2zJ7IpU78ZbkoamTWm0eYXiIpp1dzQvYJJQOwXB2XGLBQL1WWhY60A4AKN6plHOwd/Xizi+xqt72beb514+CFzEdZS38iFrPBzQ0fQgZR6+Pn8NH9R1a/lpX+iFKLfX70lHSa82jpQex6UMKRJSeCUd/0PbiFxWx5aggDHJpN43AmcxjaHyUnYoKZdQwZ4GrdUtN0H0kowDZYIjW3azAV93QNrq/Bbe+yxlSXQ== 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=dS67Olg9Qx0s9VGGvGPqg/i30/y+tcyNwn3+ZjAEDFw=; b=Vf24sX1RkeMbmNZlwfRlY3S99pRztsYm214lc1q/mKrp/ElEn4dFyHjFiYrdf984JW0lgzkjBZnS+WqpMxhsOPMh3O0+zBSYfUGhelrMTfqYRRDSFdXd+f6+/hhmjHNxnIRJBny7ScxX6wkZI/XQmgNH9uGbvp+ts5lpQWSHJ6SbqtkgeujY5ncKt0NT0+xh/XJFKrPqBYf5Qy/EAm8/7BR0z6edj7nJWAB76e+CCUXgOOA3ZIFxwxcVrJ2wszbmQC0V3G7xaNmEJi+e2Jn+/4yoBSJCJN9x4y8kpH7haG/kqlQpMF6o0p7OWZ/dwvYsRx3+e4bZuyb9VPy3X4Fk8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) 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=dS67Olg9Qx0s9VGGvGPqg/i30/y+tcyNwn3+ZjAEDFw=; b=ejrJjnWnZk788b0fND3I5POEZiatcHSEsw0yVcG/6MO3H1d0KFcyNp2ckjY9uRKIQFZ6fjG1ufYumOqEd+Q9AbXPHWNDO00nFepAnCC9naDbO1ninotTaIIN3K7rV96zcHw10VoxPstQQ+VPLcQ8AyxvNg9xBuO1prWkLKT0QIn9WhpW9FVy35vkNrfCB+EM5LGVV4orE7Hn2t4Xf0a9I+AvdEWA0AyuL1G+cv40RpvA4J6a89q4e8qabdtiQfYbbQBqfukG07jxH6XrN8XIZfA57IGEiGh2htZDzMK3k5GsKxL6wj/e/6ghW8KChOAzuv7nj7RnZ1barGqmfvBbtw== Received: from DM4PR12MB5842.namprd12.prod.outlook.com (2603:10b6:8:65::13) by DM6PR12MB3658.namprd12.prod.outlook.com (2603:10b6:5:1c8::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.22; Sun, 20 Feb 2022 03:44:32 +0000 Received: from BN6PR14CA0041.namprd14.prod.outlook.com (2603:10b6:404:13f::27) by DM4PR12MB5842.namprd12.prod.outlook.com (2603:10b6:8:65::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.24; Sun, 20 Feb 2022 03:44:31 +0000 Received: from BN8NAM11FT011.eop-nam11.prod.protection.outlook.com (2603:10b6:404:13f:cafe::87) by BN6PR14CA0041.outlook.office365.com (2603:10b6:404:13f::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.20 via Frontend Transport; Sun, 20 Feb 2022 03:44:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) 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.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.234) by BN8NAM11FT011.mail.protection.outlook.com (10.13.176.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4995.15 via Frontend Transport; Sun, 20 Feb 2022 03:44:30 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sun, 20 Feb 2022 03:44:30 +0000 Received: from pegasus01.mtr.labs.mlnx (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Sat, 19 Feb 2022 19:44:26 -0800 From: Alexander Kozyrev To: CC: , , , , , , , , , Subject: [PATCH v8 00/10] ethdev: datapath-focused flow rules management Date: Sun, 20 Feb 2022 05:43:58 +0200 Message-ID: <20220220034409.2226860-1-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20220219041144.2145380-1-akozyrev@nvidia.com> References: <20220219041144.2145380-1-akozyrev@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0dabe173-1596-49fb-c769-08d9f4234d83 X-MS-TrafficTypeDiagnostic: DM4PR12MB5842:EE_|DM6PR12MB3658:EE_ X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P8cs5408q7KKJ+W3rxUg0xGGchRZqa2uxGquAElCaEn95GH/DKPZQWlWNE9ODqK9ltH0/Q2Ugw3u37nmLht6eRvf59uXz1jmL2a5/KitcORcmtWBRy0SNjhhVoM+51jTpKj44UMj4Fy2dGNqqy4sYpHyom6HnBuxYuCa4FtOVBTuqdtZwHsLyhP2TOR8R9PRPp1eHp9uu3FG7q4PQZAWZAF+u7GJIbcNqjl2y+iCj/B0EMfVTQa01ai23oNrejNnwT/NcPiFvcmD94Zy/6F5lH9lbgvCFMUrXG3UX9D3HZfZ1I6NdjIJadCaDVPsKynbBY3nwRjhfa5ut17FrwwIuzpKOWZfZhdYH8bMh07kPBWZVmwRtNsA8preTGvgRUwbEwGOFSiTz8vFVgQins0w1eIzPA9lv0q7l2z9eOQGpeyP8qK+ue2HHdqreussGvsZD1ZNPw3tw1VHuXJ06mt6A2iWhRP1T2biNRReKWCPLZPoXWF7OgpVzx+2r0gzyEPvWjZcn8/Nr2Mi0qNJX8hmhcRwcvY0lGIToVA6Vve2yjDhd5ahTo340GiXunbcw3zxwsbFadu7cXV+KSF3/EhpTE3wEwz0/D6qwEBK+Ai6MsKO8Hr5FTXEAc3sKsJT+AWdcDQqliswuLJhvhegKSWDnQQYBZAUO5Yqk0P9jActksPUZ7PniOxbDhI1pHzr1KtOJzMjLjbgSeT7F14GPRi31Mlc7mQBy3+QNMyHdIGzvjOEMrimyvR9HAJdJ7IFjfKUWHxy7KbGjR7Bl7K64rAEWkZmRjNoAfbO7ibUlzVH01o= X-Forefront-Antispam-Report: CIP:12.22.5.234; 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)(336012)(426003)(2906002)(16526019)(26005)(1076003)(186003)(5660300002)(47076005)(7416002)(36756003)(82310400004)(6666004)(83380400001)(2616005)(966005)(508600001)(81166007)(356005)(36860700001)(70586007)(70206006)(8936002)(6916009)(316002)(40460700003)(4326008)(8676002)(86362001)(54906003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2022 03:44:30.9275 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0dabe173-1596-49fb-c769-08d9f4234d83 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.234]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT011.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3658 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 Acked-by: Ori Kam Acked-by: Ajit Khaparde --- v8: fixed documentation indentation 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 | 26 + 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, 5184 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