From patchwork Sat Feb 12 04:19:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kozyrev X-Patchwork-Id: 107386 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 62EA5A0350; Sat, 12 Feb 2022 05:19:58 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CE15540395; Sat, 12 Feb 2022 05:19:56 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2074.outbound.protection.outlook.com [40.107.92.74]) by mails.dpdk.org (Postfix) with ESMTP id 2D1EB40140 for ; Sat, 12 Feb 2022 05:19:56 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DUDHJoK3f7h4lm4Dg/YaT8Qk+38ds4kQg15ZI9xbekuVV0dfk7+Sn7n2ODGH9PDbER7kkVikDu7vQoD8deOUiSohYVx1VpsBDCzK76ZZlNoCuusyhZ7pf4XVE5uRZ+aqLw9J5ahUmhL9ZUJa70X7a/fTCVkp00GYWyX3A0DeBvNaA5Iwnfy6Ax2PJgWBpD4MsWHiiKtD+Fe8sv25XOdzM6bPg/iQ7/6JmbpGc7Zj91DrEi0oT4BQvwaS4PAWBWEbQneAFgBsahLluuMJkEWixqgJDMkvozXSK5uONMvyafykA5cqIpPneF8YYdzD9JvzkvQ7q8NNfWgr3Ae2AnqCLQ== 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=vQmBpW66yAViI4IqkA1Ae0LPs0rUFVQUFAowRyXSKrY=; b=L0jMVt2LDFZ+ha4o56EoGzpZe1R0/OxpAMiCOT0tCPki0CJaoC3mQNPMc/j4RHwoO4+1jod7jGKDdZjjSE+Tbhy+F4vmJtvdVVDBAmaGIDkWRC0iGHUphD9Lr/oM5vJJZyhRj4qqnQRvhnajouOIjetOSWO07m/77K6iRHnxy8+5OAV8cfxM4Crr/0WA/wtmtfy9yjzv6y3b7UqvCfSTm5S73eePfQRh1mDAA8f+ZEswaW1zT7jJA8QrhtCn4LHiela4Q25HvG0Ui/fYdrglRv9TkdLfw6J1k6cSSptmqneRXnsQ5T6hXMN91laRR2lvg/7yQFWRAuGRr5PbUzNv3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=temperror (sender ip is 12.22.5.238) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=temperror 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=vQmBpW66yAViI4IqkA1Ae0LPs0rUFVQUFAowRyXSKrY=; b=sLCh8wQfxsA2f6Wyc5xR9AoLr14FmWjFHLd3slsJ2s/zAWeZw0jK6ONjGFSXmOKF8JBC8ypAgxWPmfvm+NC9FHU5lK3p8O1gEcYxqRo/plu7ufbHq48mi0GxbTa73mJ1AjTwV1KGwfe69bJAOsucSWCmbF3i3ZkBhTifE137NTEi4/ylzrbGZsb4BHE1BC7eXUe+cz6e56cWWw+mKieEfNgw+8nbCLkUoW70zBL/HvvP2LKFqqX1k4tnwZ/Xg26kT3NFsswCQ16kpV7kUqY8wJAun3EhqZ1ygyU+ozBfoOb6nZN15tYEfTocFBH9n1Pp0z1RcCNu0IHhZvdDxehJOw== Received: from DM6PR12MB2922.namprd12.prod.outlook.com (2603:10b6:5:18d::25) by DM5PR12MB1434.namprd12.prod.outlook.com (2603:10b6:3:77::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Sat, 12 Feb 2022 04:19:54 +0000 Received: from BN6PR17CA0045.namprd17.prod.outlook.com (2603:10b6:405:75::34) by DM6PR12MB2922.namprd12.prod.outlook.com (2603:10b6:5:18d::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Sat, 12 Feb 2022 04:19:53 +0000 Received: from BN8NAM11FT028.eop-nam11.prod.protection.outlook.com (2603:10b6:405:75:cafe::4b) by BN6PR17CA0045.outlook.office365.com (2603:10b6:405:75::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.15 via Frontend Transport; Sat, 12 Feb 2022 04:19:53 +0000 X-MS-Exchange-Authentication-Results: spf=temperror (sender IP is 12.22.5.238) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=temperror action=none header.from=nvidia.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of nvidia.com: DNS Timeout) Received: from mail.nvidia.com (12.22.5.238) by BN8NAM11FT028.mail.protection.outlook.com (10.13.176.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4975.11 via Frontend Transport; Sat, 12 Feb 2022 04:19:52 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sat, 12 Feb 2022 04:19:51 +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; Fri, 11 Feb 2022 20:19:48 -0800 From: Alexander Kozyrev To: CC: , , , , , , , , , Subject: [PATCH v6 00/10] ethdev: datapath-focused flow rules management Date: Sat, 12 Feb 2022 06:19:20 +0200 Message-ID: <20220212041930.1516767-1-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20220211022653.1372318-1-akozyrev@nvidia.com> References: <20220211022653.1372318-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: fc1402cb-c3e7-4ab9-9461-08d9eddeeace X-MS-TrafficTypeDiagnostic: DM6PR12MB2922:EE_|DM5PR12MB1434:EE_ X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ej/9k3sTsIIXg/M8aqTa4RsL89FEklgoPP0iucDkJItIeCvOOAV+3mSz3ZvPcse1W9bc4UX0F9G+YIL4P0EwkDwm2wGNPMquG623YMwU93sJAc6aT3t9g9WRyFyYriRmGeQTMio0zIWyYkYtG1kA+ePtoAX4hHro3EGUnm010msDCxNJgv2oovjik06YBi+8ct26b+mtFHSym/cflMW288NdzVLZ4Z15XDjyYGtTQe1kAoVAU6r4b0vRF6OObKTmgsFd4r1xoVU5f5w1R1JOALcHXa3Ic3+/3Fk+SIig+tCWptbu/hGwZXdX9oh/uJ5V7kA/v6dczrL0zSbu9h4ugwsCiS+uDek1h68tHnqquiqpiamm89HhdPw6GwI6fCdZFAD2fFNHMwtd+ncagxtbCeiYOTUp7wMtcgFAi89+DX2I7Pc/kz2g49E1RodFr1SqABfpM3StB217gMai58TeyXqDghx06FNjc5WdoZmVkb98Y4LGlD7gO+t3MU7TI8ggdHoyf05lYYMksRClVT3XfgIZsvaY58Kk1oo0MsuK7NcNydHYVwVO08qeob70ygbu2cXgF5U/+aRQWNoRGObQuJX1QpuO+FBrzf2ebxHi15hzRNkQz8wDrV6aziXeFGUTOJC4M6akuSOCIoT6OveOruCsIbKjWHdvCVWm2xTOaaZORjbQOujxec52eOb3vKA3GHtHxq20SDM2f8KvVglYO3lQj12zkVOF1xWstMqiLgjHD3nLy2nx/ZG1wRuOK2VFUeTu/uM47x+ghJvETfJJdSBaz5gCDxp0OWpAzQGM7js= 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)(36840700001)(46966006)(40470700004)(36860700001)(6666004)(8676002)(5660300002)(7416002)(86362001)(82310400004)(8936002)(426003)(336012)(36756003)(508600001)(4326008)(70206006)(63370400001)(54906003)(966005)(63350400001)(83380400001)(1076003)(2616005)(40460700003)(186003)(2906002)(81166007)(16526019)(356005)(6916009)(70586007)(47076005)(26005)(316002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2022 04:19:52.5846 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fc1402cb-c3e7-4ab9-9461-08d9eddeeace 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: BN8NAM11FT028.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1434 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 --- 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 (10): ethdev: introduce flow pre-configuration hints ethdev: add flow item/action templates ethdev: bring in async queue-based flow rules 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 creation/destruction app/test-pmd/cmdline_flow.c | 1496 ++++++++++++++++- app/test-pmd/config.c | 778 +++++++++ app/test-pmd/testpmd.h | 66 + doc/guides/prog_guide/img/rte_flow_q_init.svg | 205 +++ .../prog_guide/img/rte_flow_q_usage.svg | 351 ++++ doc/guides/prog_guide/rte_flow.rst | 338 ++++ doc/guides/rel_notes/release_22_03.rst | 22 + doc/guides/testpmd_app_ug/testpmd_funcs.rst | 379 ++++- lib/ethdev/rte_flow.c | 361 ++++ lib/ethdev/rte_flow.h | 728 ++++++++ lib/ethdev/rte_flow_driver.h | 103 ++ lib/ethdev/version.map | 15 + 12 files changed, 4822 insertions(+), 20 deletions(-) create mode 100644 doc/guides/prog_guide/img/rte_flow_q_init.svg create mode 100644 doc/guides/prog_guide/img/rte_flow_q_usage.svg