From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D001DA034F; Tue, 22 Feb 2022 00:03:03 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C3F840DF4; Tue, 22 Feb 2022 00:03:03 +0100 (CET) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08on2089.outbound.protection.outlook.com [40.107.100.89]) by mails.dpdk.org (Postfix) with ESMTP id D180F4068C for ; Tue, 22 Feb 2022 00:03:01 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VSNS/DebRfgAJ5JkwH8bYOO6E/KuByRQtA3TDyrZ5vjM+Ei4fTXrWblens7eAnG+BPw+JecOwXZVO0Ec7a5ttTB/O7Ag98mfD90F06YH2whF8ODzLtRaKvkWAWds17nK9qQPMKHqdV6uxPLXdzlzbnUX56x2/+BCCpYS7xSmDmmQme3ArDseMBMko8exZmZO0+faa2V8mO/pDTexraGrT4Stk8HSJTSaXfDBUlmbjwlVODgeZz0ZcvNkA3v2f57cTtil3Ei4KTBN04FElra7B94bJJQGPfe/IJ/qU0onXbL5vX+XIvsL6BJSscPZuPyTBnPNK8DhiWIi6MfeYLGksg== 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=xAxw+8Q8i/bPSQcD1QuxRJO3qZXP3fKTkvTxzPM8hLA=; b=m7MSmfOIh0D4F5WgIHs/i9S7loFcIn1WZWVUxY9YuWUjfVEMk+WH3QNnqM+Y1k66gmulDXCH3Cd8hbsBkp8gZuw1Doo2SCeZqlTcgzTUdl09+aKqQpTT08XVACK70tCjqdKKF2GgSDb9QIMl+azEUATLrOC8cUs+2bI/dIQPOxIGD/54nrQaa8vv2IEtNZIBhC4weh+sYFHuS8OnDOa+4PDbRWPEd8qbMXW0tpDEZW9A7TGr+nUjMFJUIDrGBg1WTfaadC/RT1xpGKsmaJcSG4SDgKtgu5nrZNDG0XniKYTWhwPdjYU4jCh2ZgXZzFh+FXbgPQkXD75dUsfzUspDVw== 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=xAxw+8Q8i/bPSQcD1QuxRJO3qZXP3fKTkvTxzPM8hLA=; b=o021I5vlyVpq2Zubflrd5U+HvTutHGr+SIUYUdJsqrQ9rsgt4n9hOWci5MrwwKm9//MIRkiDhjI7UAjcsEtnmioe88jda14ODi2f/NQX7SWGJnr5aaG8JV/P2Yz88DdJMYH8XiejAPSV8RA+8w49jkDSHfdDHcpFE1hLRAxQKS40VjiWH5iBfR4U8cjo8IDSxdD8KuaEBpjxJCPDKyYwlRNrdvy1YJ34Pu6ow4ul6p+A/kOoRf659V4wCFSm6AEdRR4Sc7N3Ff75JUrXJaACTsPxN5mxuCExmSl8YRAL+oOGjJSC00kXQ84zwatfNvDGCdQZoc5Lr/bFx9w7AYWgWQ== Received: from DM6PR12MB4516.namprd12.prod.outlook.com (2603:10b6:5:2ac::20) by DM5PR1201MB0108.namprd12.prod.outlook.com (2603:10b6:4:58::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.19; Mon, 21 Feb 2022 23:03:00 +0000 Received: from BN6PR19CA0067.namprd19.prod.outlook.com (2603:10b6:404:e3::29) by DM6PR12MB4516.namprd12.prod.outlook.com (2603:10b6:5:2ac::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.22; Mon, 21 Feb 2022 23:02:59 +0000 Received: from BN8NAM11FT051.eop-nam11.prod.protection.outlook.com (2603:10b6:404:e3:cafe::ae) by BN6PR19CA0067.outlook.office365.com (2603:10b6:404:e3::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.19 via Frontend Transport; Mon, 21 Feb 2022 23:02:59 +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 BN8NAM11FT051.mail.protection.outlook.com (10.13.177.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4995.15 via Frontend Transport; Mon, 21 Feb 2022 23:02:59 +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; Mon, 21 Feb 2022 23:02:58 +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; Mon, 21 Feb 2022 15:02:55 -0800 From: Alexander Kozyrev To: CC: , , , , , , , , , Subject: [PATCH v9 00/11] ethdev: datapath-focused flow rules management Date: Tue, 22 Feb 2022 01:02:29 +0200 Message-ID: <20220221230240.2409665-1-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20220220034409.2226860-1-akozyrev@nvidia.com> References: <20220220034409.2226860-1-akozyrev@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e0450d6d-df74-434d-162c-08d9f58e4e04 X-MS-TrafficTypeDiagnostic: DM6PR12MB4516:EE_|DM5PR1201MB0108: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: /OjAsQoNJiEi/nDyU0ir7IyBfZ6j3jJeWLztMD6PETUv68M6+QEhlKpL2pvXxc9+Eypl+BywiLc6c9ITyc8cMl89M0A4SwbDbGlsbwzkwc2uZ7QNp+aqPedi9KWTj3QVgW2oF+UFoVZQQpMOOY8gADHLjtiEfXTok2V+YKfoeRFcy5swf72KMCpct8pbqDoqmWDoPcH56icYGPZ2HB6ZEf5BZlxA2Sh5D1R9PfQyWSs9jmxvSi1xuwaTvqx5VUyRnac9M8hbG7e26ibAfY2Gg3g4xIByh3Jvw9emHDtWY9wf+t1eBqL5RnI8xR8IAjx71ODbb9jtK8kc5oQze48LEkvLWh8lSrG3WqOVkBuZBlWARgHVS1kbQvkMjCTImwLLfrj/Iwcbv9G7z8Np5hSUuG0uYXqYk0fGYjgmyMFuy9DV05//X+1MnOP2jrhSJ5FkuPv8JZ1RY4MpqppYcewKEubEd0YST/q3PA7Ldf4MBb/q/rxSqlnIzyptwABGMQ5jg+zUNzp93ig1+Sg/0NsAWKTpC09GgcBs9j/NoxtLEUZAsd3mazJMRsrxc3yabSY2iJBxJ5Dsxk9jHzNcfuMDYnkAr+uLnvQ9ptx8+zJtrHM+3VpzW++ULglf6HOlxrvMUDcSRAT1ELQbJTdwTEGHp0gbGLKTbeR9l8GpN4DCo/wxgOpnrweaEHlWzJuOr863pfOv7X9d0C9YwDUFO57GgasxMsjnsbEmSJC70p7LaxySYjQP2SkTgA/kcuoth1lvkLotqDLBfAOS1MOPqlhbJvEU1PRA/QBDaDGjAX+7w4g= 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)(40470700004)(46966006)(2906002)(5660300002)(7416002)(36756003)(966005)(356005)(70586007)(508600001)(16526019)(81166007)(83380400001)(8936002)(2616005)(1076003)(40460700003)(426003)(54906003)(47076005)(86362001)(316002)(336012)(6666004)(26005)(186003)(6916009)(82310400004)(8676002)(4326008)(36860700001)(70206006)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2022 23:02:59.0812 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e0450d6d-df74-434d-162c-08d9f58e4e04 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: BN8NAM11FT051.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0108 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 --- 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 | 460 +++++ lib/ethdev/rte_flow.h | 741 +++++++ lib/ethdev/rte_flow_driver.h | 108 ++ lib/ethdev/version.map | 15 + 13 files changed, 5119 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 -- 2.18.2