From patchwork Tue Jan 18 15:30:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kozyrev X-Patchwork-Id: 106029 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 8A7EAA034C; Tue, 18 Jan 2022 16:30:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7A78A42723; Tue, 18 Jan 2022 16:30:55 +0100 (CET) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08on2042.outbound.protection.outlook.com [40.107.102.42]) by mails.dpdk.org (Postfix) with ESMTP id 098AD4068E for ; Tue, 18 Jan 2022 16:30:54 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ArWpO05NZWBOL/GK7jq3FjVkywP+ot3PTVYnlDS6SWiczIfufE1yyjNgaJVk/RidrbXqcgDFB3MMNPPXTRs7nSJj1CaoZfUdK05drdXid1z5XzO4ElQlIG9kJNOXRPmFbF96oZivLrN/3DBoRGRursrBZvmVDY7xcx++U2mGJ/giWPLU0h9kvR2coB0hGe8AVMMEBBomGpnBQksXc2hB7IBHC3NkaPxY5ulDTrNwm2ErEvXBnjI8yGZZ6OWuRsibsRL5fJ9dBDQoxvTJdqnaNpETg7FY8GHwOjdyhsHt5S3JcNu75B0l55IfMBMSjoRH3stx1pkCTwAYQs2RM4CoVw== 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=F8sJEeR5nvj0Ky65Apl1XD5UsMgRp6Mioer3VQ0WTtw=; b=CPEaveodTtdcK8ka/92Cd4cHM2L5WaKphcEuV5FMNH5fjcywzSMPrl+yRc9cHIw3iCTCEUkR3KeXMbbNBi9AOrvPB3z5AQOqoWKCMwZ4PpGk5hIjTc22vNnUIrQRGV650pS/MHb3SGIaluFZaGeYoThnjqTGe9pN+4toxbW+gSTCKSGiD7d2+6FPVNpjZHZ/cMlBTeGbF6y2/rYfOEvgf65W5eNTyXm7v4SLPRnc6TWiNzqDLdVFsu4+JPylpL0PUAZjhLYZi3Ych+qCXOZyAK81rf21XbonEJPzfNHpjXw8D/Ol4ugvt3bqH1uxcHyIuepVV+HtqKXG5N2P7uEkZA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) 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=F8sJEeR5nvj0Ky65Apl1XD5UsMgRp6Mioer3VQ0WTtw=; b=d6VSanKCzaNxzhV1cMV5gaN/apcq7WSrd5bEYffrj1u7HYXyrcCwEJz476nL6ol98iff7SGrElt6elUD8IJK8I4KMsrS68ZILNb0VBRYqHARdF6d1qGxunnImCA3B5l1ClFkHUoFirPPzvqhr+4Qk0vle9BOjiTcO3yX4/0cnhFxQou1hl25YxyPFs/VsBpayq9NYiQMS9kMhwTQ0DVIrvbqQWl4Mzghy+FZycMZn8LMQrqEpDs8t2/Kki2S+6kfMNFv6XeyqiZ3626b+0Ia9q482ZqwJ4J3oT0A6J7ez8T8SpHz4Ce9RFJueTDDQKgGQb+YKpbW/rItoNeZB4DULw== Received: from CY4PR1201MB0055.namprd12.prod.outlook.com (2603:10b6:910:1b::14) by CY4PR1201MB0117.namprd12.prod.outlook.com (2603:10b6:910:22::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11; Tue, 18 Jan 2022 15:30:52 +0000 Received: from MW4PR03CA0012.namprd03.prod.outlook.com (2603:10b6:303:8f::17) by CY4PR1201MB0055.namprd12.prod.outlook.com (2603:10b6:910:1b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11; Tue, 18 Jan 2022 15:30:49 +0000 Received: from CO1NAM11FT028.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8f:cafe::7e) by MW4PR03CA0012.outlook.office365.com (2603:10b6:303:8f::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.12 via Frontend Transport; Tue, 18 Jan 2022 15:30:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) 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.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.236) by CO1NAM11FT028.mail.protection.outlook.com (10.13.175.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4888.9 via Frontend Transport; Tue, 18 Jan 2022 15:30:48 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 18 Jan 2022 15:30:48 +0000 Received: from nvidia.com (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_CBC_SHA384) id 15.2.986.9; Tue, 18 Jan 2022 07:30:45 -0800 From: Alexander Kozyrev To: CC: , , , , , , , , Subject: [PATCH v2 00/10] ethdev: datapath-focused flow rules management Date: Tue, 18 Jan 2022 17:30:17 +0200 Message-ID: <20220118153027.3947448-1-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20211006044835.3936226-1-akozyrev@nvidia.com> References: <20211006044835.3936226-1-akozyrev@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5540ba60-e421-4329-7d55-08d9da9780fd X-MS-TrafficTypeDiagnostic: CY4PR1201MB0055:EE_|CY4PR1201MB0117:EE_ X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0UcJhYtCfSchZ7eOm2KyJCm/q8Jy+FfzGGzVkZG6eRkf+fmv6jQmrPaVwsLXEDVBgK/f9osntKx7tPKgsFcwOJL9SijFojCS/WYwLkTcH/V1jdkrZFT1+HFkBfDcbXZ8b62ksikaa0O8LISW/afO/0e+LxMEZelUvCJh4C7ty2avYKdZSwSBflZ0ANfV58H8mJI40OlkrS5h/X4PMiZOGBTYGuyc6Q8P6Rovl2ssWjVhATOR0JUfLD7vhe4wx2ozurFAeJctAYN1JnYz/fP4a60/4qko4ryEBsA2HVGyXJ2b8/eGif0FR1tcMTE8UMI8QBlbU8uqMHH0UBazaQ9S7ALr9mxd5eEtwMTbP3CfMktT84bZTj/e37XMoMOqTggXhyrWF1olNw16ZOfdPmPETbmQroNcIn7OzKKzbLV/riCw/0DPU2zZlX4KwPKwAUVTLcRaJNM6obDfmDpucY10qyDJxpXs0BPo0KvjBDwxGXsAXSsaIl3uV0eHaFvYzlikfMTrfqP1/Xp9BMOnNzNtxRabPU4ldmHtfo4NbahbSRDWaevLRy9YNenr0nH3ZL/R7lXutvD7ZgxsPSWRswD/9Fw/57o+S1mgW9dHOueZvFBHqI1mIz72NEloXpNQwjI2xZhoR2TL/VvVa9tqb6L826XE2AFp6IbM7PD/efn/FcQNJaBOtQkmvQC+kh3KPRmScNfEyq92zZOftOUtV6C8JPgwZT9PghAi0bH9JPeZnZfjai86RNDTn3EeVTkEbXm4gxWZAsqtncK+XMVrlf2sUTU2eznHaQRzXBy/WuZiHt5w55t4h9TZ9Bi4B9U3in4BV+anarEvXOndmFYfoNPbnlWRibdjbQJ9U+2iIAi4qu0CKBQ1+lWJhC7yKLESUhY7 X-Forefront-Antispam-Report: CIP:12.22.5.236; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(4636009)(40470700002)(46966006)(36840700001)(55016003)(508600001)(6916009)(54906003)(6666004)(5660300002)(966005)(47076005)(2616005)(82310400004)(8936002)(70206006)(26005)(36756003)(336012)(83380400001)(70586007)(1076003)(86362001)(186003)(6286002)(2906002)(36860700001)(81166007)(7696005)(426003)(8676002)(16526019)(356005)(4326008)(40460700001)(316002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2022 15:30:48.7555 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5540ba60-e421-4329-7d55-08d9da9780fd 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.236]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT028.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0117 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 Reviewed-by: Suanming Mou --- 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: implement rte flow configure app/testpmd: implement rte flow item/action template app/testpmd: implement rte flow table app/testpmd: implement rte flow queue create flow app/testpmd: implement rte flow queue drain app/testpmd: implement rte flow queue dequeue app/testpmd: implement rte flow queue indirect action app/test-pmd/cmdline_flow.c | 1484 ++++++++++++++++- app/test-pmd/config.c | 731 ++++++++ app/test-pmd/testpmd.h | 61 + doc/guides/prog_guide/img/rte_flow_q_init.svg | 71 + .../prog_guide/img/rte_flow_q_usage.svg | 60 + doc/guides/prog_guide/rte_flow.rst | 319 ++++ doc/guides/rel_notes/release_22_03.rst | 19 + doc/guides/testpmd_app_ug/testpmd_funcs.rst | 350 +++- lib/ethdev/rte_flow.c | 332 ++++ lib/ethdev/rte_flow.h | 680 ++++++++ lib/ethdev/rte_flow_driver.h | 103 ++ lib/ethdev/version.map | 16 + 12 files changed, 4203 insertions(+), 23 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