From patchwork Wed Feb 23 03:02:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kozyrev X-Patchwork-Id: 108103 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 92755A034C; Wed, 23 Feb 2022 04:03:03 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 24BA040DF6; Wed, 23 Feb 2022 04:03:03 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2086.outbound.protection.outlook.com [40.107.237.86]) by mails.dpdk.org (Postfix) with ESMTP id 402194067B for ; Wed, 23 Feb 2022 04:03:01 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZPkYAMdN1w1d1tjuMjGZZ46PGXYXfNk93hXuHF5Iph1sbCR479NRbm4Netoe7ba+prrwety30FstFSfx037gRukvuhIi48gpytYdsu0l0XOmWcSa2CSBbFx4zN26xdPBmaY+N0TXcfrUl9q1GLHSPfym5yz/zTF8HSfAq4tYpvs60QAXiLvBPr5aN/W6P1rwBHEa8E0aSayp5+jQYPoCI7YwsOAZx6eNaxmMmY+cHjt8by7+FlasY+QgTIILLoTrZqnKuSBbd6FBh9i+Ag9GAQQFYC6yUX6TNzIXqMyffpiGDMdS7r/BQAEUAdoN/QpBqCvAHxJ7i0vYCD47L3vtIQ== 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=r/N7NOa/ZlQ8Sep0DGD1zq6H413OFZjS7g7TwQIFOEE=; b=TAsnNJrkpPj8w7FFl6f/N44NBsn3kDgjUtjvPOzsEHfDGGlHb67r3ABQhtOa2X2OnOmBpJB6U7Wy3Ccvjjzy2uyjFdYKW651E56bE4e6z8aOQI4ucoQK1SlDBzogRz1dMypZLfgQpDVhOdNL5WrrRHHrQm3G+FOSyhd21dpn1VR08ExC5kH5xMU9pkMNPY0uOU3ujQ6LftFFAUNRHE5480x9jb8WXOrETtSs2y7Nk5IlNw136v3oDb2ogCudK2mZ9qMiMBy6FYX+VPC/PBD252qT5saEMKPZUxn7aQ1pbCSkp2Oi6KH1JaY4u9peq7sH7+O0DYAExzvhzcGidpWuiw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) 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=r/N7NOa/ZlQ8Sep0DGD1zq6H413OFZjS7g7TwQIFOEE=; b=Q0C0YwkbxwUFuWKjjXWsnkcefFNtZLfBXeSti4ZIK58hsQ8muczUXpLQEXnmz3o3kDjyO8wEd+B9IttUGq+p1N/t6vbpm1qBf18cL5Crr1rvAeHheu77n8J0pDfeAxae2iZ6ZtfvfdK5bwJaE13qqd8WDqJFlT9r1EZ4jcIT8AAO9/fKttzNXH1L2Vkju9MzRr2dpAd2i7qCGTGJnlmM8CweN0Zv33SLBZxQMxD0pGGDlzrGW63SLEtc3z1bXGrxwbnQ83rcVdz7BLReRgnvqRgyy3jQU76GS5UC+3p53y1eptMjGSRQ0K+tNEpl8cr0kIhqlQj/h/esfK2Mh/L9nw== Received: from BYAPR12MB3446.namprd12.prod.outlook.com (2603:10b6:a03:d7::23) by BN8PR12MB3012.namprd12.prod.outlook.com (2603:10b6:408:64::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.16; Wed, 23 Feb 2022 03:02:59 +0000 Received: from DM5PR06CA0064.namprd06.prod.outlook.com (2603:10b6:3:37::26) by BYAPR12MB3446.namprd12.prod.outlook.com (2603:10b6:a03:d7::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.24; Wed, 23 Feb 2022 03:02:58 +0000 Received: from DM6NAM11FT057.eop-nam11.prod.protection.outlook.com (2603:10b6:3:37:cafe::b7) by DM5PR06CA0064.outlook.office365.com (2603:10b6:3:37::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.22 via Frontend Transport; Wed, 23 Feb 2022 03:02:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.235) 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.235 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.235; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.235) by DM6NAM11FT057.mail.protection.outlook.com (10.13.172.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5017.22 via Frontend Transport; Wed, 23 Feb 2022 03:02:57 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 23 Feb 2022 03:02:57 +0000 Received: from pegasus01.mtr.labs.mlnx (10.126.231.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; Tue, 22 Feb 2022 19:02:53 -0800 From: Alexander Kozyrev To: CC: , , , , , , , , , Subject: [PATCH v10 00/11] ethdev: datapath-focused flow rules management Date: Wed, 23 Feb 2022 05:02:29 +0200 Message-ID: <20220223030240.2506513-1-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20220221230240.2409665-1-akozyrev@nvidia.com> References: <20220221230240.2409665-1-akozyrev@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.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: 00c009c8-0849-4d14-ae13-08d9f678fe82 X-MS-TrafficTypeDiagnostic: BYAPR12MB3446:EE_|BN8PR12MB3012: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: 2c7V0lBu1f6caj6GtGYR3VE6JcIWA/gQ/v59NngJKEQWg160/F+b1OtktlvWjksqoWYDB7yJyI38VClnxSbGrh+wAEUhfx0T9S3iqh9c11oxjRjedPZsOnfrNzEj6o5rxtnPcBPvtf4DM3HzveLDJ2M8H9timRtIXq87DsgjZuzdBglwvLaCh94FEdeZsU4fmKQmbC1fod2JWwcCAGaSbUEgN3eb8dIOkvZsTANhI7kRqol594ouPB+epYNQYbxClCPzAmQXFRebPwdtpPz2btWkyvKlHQ/im8HWqz0VxWp1byoKHdCRT9REDYlCY0cetTQnlAru4MuIM8U8UEIkz91rXPa+3GU1LrTWIAVY5h8NcYmdmk+UlP+3McEwkCThBPIvSPVb5ThFE/degKl7sT8uW4/9lPo4zKHxCnvTAWje6GyJaEI/Wve8xPSyVE7vLmDwAbfq3AKVvJKaWLu4WdmE0/5qak3GQFeMe+CwF3XS/vQLImU4ze4XnUmuXuwto++/pDpDF3T9VL0QXmgcYqR61az/YkbiEhOWzwI6IxEPVy84JcJu8Bc+0qGm7HlE29MtD6MetQCG46stPDKH+D4OFj0iZ4cUOVUqlN/i7Q6kL+DXys8WJcf+64jljMPHUvyWQHieZlvyza41Y30RV+yGRSIIqMsyBVlaqyzZIPy7UhCaMSTeT37ADfzrrOXp8z/DIcfZHDU7tq+vSfSB7wrTsCZ7JOou0tmd52MMM6BE2GPmxvPM2qZw83Yi+YhGaj+CDrJbb1mMXjrJHyEfoS9F8OwhRP5zxU4UdImzBnM= X-Forefront-Antispam-Report: CIP:12.22.5.235; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(36840700001)(46966006)(6916009)(1076003)(8936002)(54906003)(5660300002)(2616005)(82310400004)(86362001)(508600001)(316002)(7416002)(966005)(6666004)(8676002)(4326008)(70206006)(36756003)(40460700003)(47076005)(36860700001)(336012)(81166007)(2906002)(70586007)(83380400001)(186003)(356005)(16526019)(26005)(426003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2022 03:02:57.4871 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 00c009c8-0849-4d14-ae13-08d9f678fe82 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.235]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT057.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3012 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 --- v10: removed missed check in async API v9: - changed sanity checks order - added reconfiguration explanation - added remarks on mandatory direction - renamed operation attributes - removed all checks in async API - removed all errno descriptions 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 | 454 +++++ lib/ethdev/rte_flow.h | 741 +++++++ lib/ethdev/rte_flow_driver.h | 108 ++ lib/ethdev/version.map | 15 + 13 files changed, 5113 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