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 855E042CAD; Wed, 14 Jun 2023 07:42:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4D518410EE; Wed, 14 Jun 2023 07:42:21 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 7523240A7D; Wed, 14 Jun 2023 07:42:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686721339; x=1718257339; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=REw0bHzq7STk4M90qdpITp1DIAkmF6UkspIQISTmjHc=; b=KrsTC9LL3rR2irybCCEGL2DXqVa3DK8NZdhY0QQZRtbeM/1xVWS3+dVI pgDAYwAvgpGKkvhrm9f8aJJDLSTwJJzzpPXVzKdwCNznCcz/wwUUsdbtQ +cr7I4CFHqlgRhK5FMRtk05TKZ5amknDNvdtUuGlYnuDoOM99u6zCFZOl j59JjtqDs9syikkbiVMjun5v3Iy81Tfthjaovv0tvFZfdRgCK3z2gKqaB 3+CTkijyrxzhnautKuK2wGxIJIeS8kj6TnMfD3kGVYSZh4RbXNZv04KIP bkORLBdPmaZf9dWefEqC5h6OM+YdK4QEqcSgU/2ylX45TQSF2UZ6EnaPD A==; X-IronPort-AV: E=McAfee;i="6600,9927,10740"; a="361899319" X-IronPort-AV: E=Sophos;i="6.00,241,1681196400"; d="scan'208";a="361899319" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2023 22:42:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10740"; a="706077555" X-IronPort-AV: E=Sophos;i="6.00,241,1681196400"; d="scan'208";a="706077555" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga007.jf.intel.com with ESMTP; 13 Jun 2023 22:42:17 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 13 Jun 2023 22:42:16 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Tue, 13 Jun 2023 22:42:16 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.174) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.23; Tue, 13 Jun 2023 22:42:16 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S0NmeJ6TEfxIue9wytGfpp/m8iWpu5w81f7KqC870QfYuGLtIvVIRxPSI16Gnblp9uZicUAfE75tHCtw7pwnzHMEAkwjk7otLpb6JjZCqoMv/X5Vl/xgwpw6lLNJbZSo4o9jTBNbLoeZLeuwLhU7EAKMPboDDBmNzaUuSvjM3B0mHCyWG6uQwtZk/tMtnEZyU6clqwWctYGGtmqG1rDohNQwbEIFyrP8Vp6GuqLBAKSsPr7OA9TqEbOemRYEFZbV69wu/OwSfd43PnHEj3h7VeO0t8uQUth4QGQbposIwCJQO72jpsjN70zX8NTZrz3lPs0OAfdxop+PP1sC/g/Faw== 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=WFuLSFTbluy8ZqSKynY3LumErLG1EcAyIn5IfHYDkjc=; b=TFSXcSXte9H+hh6OLJIQU71Gi+R1QhSGbj/W7o9Ir+edMlhCqSJH9GtBBd0Q7wQ/o2OtQrUiFCDK2ZHwHEBX3qYXCBw3HK23a+GlQX6sILxTVr0VhADggFZjK+R7txlwg5a6JmU9QBYJX3qL8jS1zGYTpSwlZxo1PYk8q81xgobL+6FFY3amfIBKQsd/aInsr2mQnMvhIc9U5lePqUaJNi1QtTepb2/AD+HJU1wpbd/4PHCfRiQ5CTi34n0RixMpSguNMec2C1lpFOAXf5q4B3BSX5xBkJ+Z7D+2z06ujmZA5zAzPYaAaiEao/qttvC1RBkDYT7PVMuTLDYGhrzGUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM4PR11MB5994.namprd11.prod.outlook.com (2603:10b6:8:5d::20) by MN6PR11MB8242.namprd11.prod.outlook.com (2603:10b6:208:474::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.38; Wed, 14 Jun 2023 05:42:13 +0000 Received: from DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::e570:d9a7:df1b:1589]) by DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::e570:d9a7:df1b:1589%6]) with mapi id 15.20.6477.037; Wed, 14 Jun 2023 05:42:13 +0000 From: "Zhang, Qi Z" To: Ivan Malov CC: "thomas@monjalon.net" , "orika@nvidia.com" , "david.marchand@redhat.com" , "Richardson, Bruce" , "jerinj@marvell.com" , "ferruh.yigit@amd.com" , "Mcnamara, John" , "Zhang, Helin" , "techboard@dpdk.org" , "dev@dpdk.org" Subject: RE: [RFC] lib/ethdev: introduce table driven APIs Thread-Topic: [RFC] lib/ethdev: introduce table driven APIs Thread-Index: AQHZnNl/YukvwyUJXUylZdiSr9fMFq+HTIIAgAC0zHCAAEhKAIABfZtg Date: Wed, 14 Jun 2023 05:42:13 +0000 Message-ID: References: <20230612111539.462084-1-qi.z.zhang@intel.com> <3b4c548-bf1f-ad57-6587-ad2b427d08e@arknetworks.am> <48b87e57-e01d-29bb-863e-16c4fef0568a@arknetworks.am> In-Reply-To: <48b87e57-e01d-29bb-863e-16c4fef0568a@arknetworks.am> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM4PR11MB5994:EE_|MN6PR11MB8242:EE_ x-ms-office365-filtering-correlation-id: 50b6d698-c8a8-4188-e112-08db6c9a1abd x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ZiiPR9nKdE+Kkz6V4ELsmVWA1R5m3d//mBn6As4z5Q5vP0NyJW1RogGaa5oUG86vXaDNk1JZvfqur5fw20A94wMJsOSqcWB6QZ6pZpzLI2HMgXxwiMVmQ7z2wwK5ahY0EXJPhZ/qQkuMlbqR3EnpHgNulO/QjnbWJ8P7abwkmBpHvQa8i3bDPSKjX+MUwceZkWVccjpUGWQ/R646xy71oBHX/r5Bp8yezPoavtq45bwvIN/v3+C7vqfPjUr0iMSMtRsYqNeKqGvzeDc3c4X39NNjcsZdvX1FUTwxaAfispGOCn4XSgk4nEBY4aRflvmuNwg1OzKFR8YCkGhPXeFA5jRPaJNW8ZgYCAS0pMilGFPn8tUpQzXWUNCiLGTsmOvFx/eiHOeYNyYMO7dIFnoVfevIXt3r+oZeOyDBfmUngLIan6lOU0+MSAP43ghIvY9BI3s1AYt3sgO9oJXiyNBfoFS5iPRLb+zlFNRkEMy3EDr76GNpNSjRSbbYhkfyGXf1IgBC/LAxJzlIg06/M3WiFDBlpjJZALn2RlUcWBZcF4/ZWmA3QHAVeywABaQHDkf5KmAq/9Khlb+0Tdrmw4wfoFJd3fEbwO6V4IguKHHGkaqb60Q5xQEhCGcWOffC1FN2P4d4uEbB8H022NoL94jmrA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5994.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(376002)(396003)(39860400002)(366004)(136003)(346002)(451199021)(30864003)(2906002)(41300700001)(478600001)(5660300002)(54906003)(52536014)(66899021)(71200400001)(76116006)(8676002)(66446008)(66946007)(66556008)(8936002)(6916009)(316002)(64756008)(4326008)(66476007)(7696005)(9686003)(26005)(6506007)(86362001)(966005)(53546011)(186003)(82960400001)(83380400001)(38070700005)(55016003)(38100700002)(33656002)(122000001)(559001)(579004); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?S7hr0Oa81k6e2Uvpienl5iIFCU7CxJZ5ZbEQKpyKhPlFvAaGGk+Sh4dIizxT?= =?us-ascii?Q?CjDicbPVSrIZ0IiEenD5GbbU5dYUik/RuWHN9w2SI7ya2EBZ0CVh5MhpoZ0+?= =?us-ascii?Q?qgB+VFBIAHGTDSTj81G7Hqjom29M2kOWkQBtnxshpYXvVKMcq5WNJScL3ElI?= =?us-ascii?Q?3yBk70oxJENj1Ipk17yO8nm/W+lLFDhs94TL0Q0w6fBnakoN6aujpYHEUX6Z?= =?us-ascii?Q?DU2n3fdxw5+sk+2lVYDk2ORYxER09B7LQ5x+JADwGzbcei1kVSxV60CnYWVi?= =?us-ascii?Q?dBY+QpQmSK4e8LvVNlmEFLBadlDyfGtgIHnbI8w9DGbOXkNR47Dbd8JymY1L?= =?us-ascii?Q?dKbWNfRDguA6fL6A3MwaJWx4WfJHcBtA7flN94PNi1UYzuu46Kcui8JUZ/KV?= =?us-ascii?Q?xVFeEt5SM07qsaJesdFkC2fIHsYhLCpjdXEipVbJk8CCJl8zS+MaaKU+EmoY?= =?us-ascii?Q?ZICDAabcRJdbmBvlr1fTC6H97obHGZXDoJRBrb+AuEsMnCUuJrQRVCXbwxf8?= =?us-ascii?Q?DaYPIHAhIa1jdIc+P7vXp83b37dALgKROv4oHTgEzp3869bqYtiivMcCbvqA?= =?us-ascii?Q?7cYvpOLt6qIT2EWWr5JPgfdFh9gGlIy4j6ModsLbVBJ12Zokvjl90BhQJX5Y?= =?us-ascii?Q?rS9KJpuED8msQ0HzlPrDMkItPaPanNzrA/uYLi+pus//kG5nV3/W4COnBC6T?= =?us-ascii?Q?WMdJfKpLBxVF4WhBysTCP6jnr4cGpgeoE339NER2EdSyOI8DQyiqqY+2g1KA?= =?us-ascii?Q?BM/WjDWN5DSOJzTCbkK5ojb5jTssffk7I62hIizRJx3a7/bMieHkpLEFqBk+?= =?us-ascii?Q?t3shaMSjnseUywNEi4IPSPkgNuZYsG/CLMEI50sqcXQVs5dmcSSyPJSvi5oJ?= =?us-ascii?Q?4t/ekGCBGcKY+255dpMyC5mSS4RRrmSMDVsotmn027MTipJ2jaEgnb/Uc+Cr?= =?us-ascii?Q?h2dSoGe0BMuyNIQgbbjEfR/Ik/PdNIvSWSu58NK5rUr2K0NtlRxbWGjS76nn?= =?us-ascii?Q?c7V6U3eG3zZlcJ+ecc8NOWmmcopxi0Z0x11yrQVsS5CaZVr6FmlSY+gACW2s?= =?us-ascii?Q?YvnB1cxZeYCG2GUip4Px7zEt4643BnzaKgDW7bqJJLlshmpiC7r8vZ6Yw3LF?= =?us-ascii?Q?xvWq6sMvRfkamBZi4Baevz5jM7gw9HjPfLAIiUvJ8R9/9XW0vYd1G6eLRgNO?= =?us-ascii?Q?A9OEgkNNwHgjeiowASEBtzNReRTn09/FU5B81oX8ifIl2Bdg6LIX9Of1b1nX?= =?us-ascii?Q?XMLayNXBkLcX4Xnq+kSwUX6MQJbX7Ajch+SUX7COxbCtdCc6Qn30Cx7verNS?= =?us-ascii?Q?zCKWB7TjV3en7O58DtrXuDu1vS2Cnib5fSCMfdT/O9zzD0s0cAaDElMIrwSU?= =?us-ascii?Q?GBhF66b3tkw61TWJvNAjWsQ7yCjhtaxp3HKiFLqqz4If/pNo0zgXfyMSWqM4?= =?us-ascii?Q?sr5jZBlpTf1Ug5ng5WlMcWF0mJ7ZzyzwLcDtOpZAI1mRfQjvAb6vHhLprBvC?= =?us-ascii?Q?WSjUbbj2gBuHDwKy8pI3lCYRq0mKdsj5mcphnqFPZS0CoJlG4QQZO3xEGqyI?= =?us-ascii?Q?p0EH+/G79t4tVLRxaGpdxQAdK/53OGlTodqNIYwa?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5994.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 50b6d698-c8a8-4188-e112-08db6c9a1abd X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jun 2023 05:42:13.2142 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: tu4V+iCcXb9TQ7Nw/sedu93iLnNfxbNj7dYaGUMixGy+yFeO+l85SF7F9fkpkD6MO5JYgpm3PGzbfqR8d5U4jQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR11MB8242 X-OriginatorOrg: intel.com 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 > -----Original Message----- > From: Ivan Malov > Sent: Tuesday, June 13, 2023 2:38 PM > To: Zhang, Qi Z > Cc: thomas@monjalon.net; orika@nvidia.com; david.marchand@redhat.com; > Richardson, Bruce ; jerinj@marvell.com; > ferruh.yigit@amd.com; Mcnamara, John ; > Zhang, Helin ; techboard@dpdk.org; dev@dpdk.org > Subject: RE: [RFC] lib/ethdev: introduce table driven APIs >=20 > Hi, >=20 > Thanks for responding. Yes, perhaps my thought about being > vendor-neutral was a bit ridiculous, taking the P4 part of > the problem into account, and yet, this RFC does not use > suffix "p4" in API names, that is, it's not confined to > just P4. If that is the case, then PMDs that have fixed > pipelines/tables (I guess, there might be multiple such > PMDs) might find this API useful and, as I said, it > would be good to know in what way it is possible to > represent restrictions on packet transition between > multiple supported tables, i.e. lookup sequence. >=20 > Can this interface help PMDs expose such info? >=20 > Something like >=20 > struct rte_flow_table_lookup_chain { > unsigned int nb_tables; > uint32_t *ordered_ids; > }; >=20 > int rte_flow_table_lookup_chains_get(uint16_t port_id, > struct rte_flow_table_lookup_chain **chains, > unsigned int *nb_chains); >=20 > Thank you. I think it would be beneficial to incorporate learning APIs that facilitate= the reflection of the packet process pipeline's topology.=20 Moreover, I'm not sure if any certain hardware implementations may offer th= e capability for applications to dynamically create, destroy, or chain tabl= es during runtime. This flexibility seems allows for more efficient management and customizati= on.=20 While the current proposal may not expose these capabilities, we can wait f= or further inputs and insights. Thanks >=20 > On Tue, 13 Jun 2023, Zhang, Qi Z wrote: >=20 > > > > > >> -----Original Message----- > >> From: Ivan Malov > >> Sent: Monday, June 12, 2023 11:33 PM > >> To: Zhang, Qi Z > >> Cc: thomas@monjalon.net; orika@nvidia.com; > david.marchand@redhat.com; > >> Richardson, Bruce ; jerinj@marvell.com; > >> ferruh.yigit@amd.com; Mcnamara, John ; > >> Zhang, Helin ; techboard@dpdk.org; > dev@dpdk.org > >> Subject: Re: [RFC] lib/ethdev: introduce table driven APIs > >> > >> Hi, > >> > >> Thanks for sending the RFC. Sounds interesting. > >> > >> My impression is that this API is rather low-level, so the question is= how > >> does the application find a vendor-neutral approach to discover and us= e > >> specific table to do some job? > >> > >> For example, the application needs to do some tunnel match and > >> decapsulation. It invokes rte_flow_table_list_get and > >> rte_flow_table_info_get. Say, there're four different tables. How does= the > >> application know which of the tables fits the purpose of tunnel match = / > >> decap? > >> Especially in the case when different tables have overlapping match fi= elds > / > >> actions. > >> > >> Does the application have to expect some common names for the same- > >> purpose tables across different vendors/PMDs? > >> > >> I'm asking because I'm trying to figure out how major flow-based > >> applications are expected to use the new API in a generic, vendor-neut= ral > >> manner. > >> > >> Also, now you mention the pipeline approach, it appears that the > >> application may want to do some match/actions in one table, then send > the > >> matched packet to another one, using a jump action of sorts. But > sometimes > >> such jumps are confined to specific paths. For example, there are tabl= es A, > B, > >> C and D, and the NIC only allows transitions A -> C -> D or A -> D. > >> > >> So my question is how does the proposed API expose such constraints on > >> packet transitions between various tables? > >> > >> Thank you. > > > > Thank you for your review! > > > > The table-driven APIs are specifically designed for hardware with a > programmable pipeline. > > > > In certain cases, hardware vendors only provide the device, SDK, or > toolchain to users.. As a result, users, such as network service vendors, > utilize P4 or other languages to design and build their own pipelines, wh= ich > are then loaded onto the hardware. > > > > Typically, the compiler generates all the necessary table keys and acti= on > hints to assist users in building a control plane application. > > > > So, essentially, we can assume that users have a comprehensive > understanding of the pipeline details and possess the necessary knowledge > to construct applications capable of manipulating the tables > > > > The missing component is a driver that acts as a bridge between the > control plane application and the hardware. The table-driven API fills th= is > gap specifically for the case when DPDK is selected as the driver. > > > > Actually, the driver has no knowledge of the specific network usage or > details, . It simply translates the table keys and actions into the appro= priate > hardware configurations, which are also provided as hints by the compiler= . > > > > Regarding your concern about the "vendor-neutral approach," utilizing a > standardized programming language like P4 enables users to develop > applications that are independent of the underlying hardware, that means = if > two hardware both support p4, and be deployed with same pipeline > configure, the application consuming the table-driven API should work > seamlessly on both platforms without requiring any modifications. > > > > Furthermore, one of purpose of the learning API is to assist user > applications in negotiating with the hardware. Its purpose is to ensure t= hat > the expected pipeline is loaded onto the hardware. > > > > Thanks > > Qi > > > > > >> > >> On Mon, 12 Jun 2023, Qi Zhang wrote: > >> > >>> The patch addresses the problem statement [1] by introducing a set of > >>> "Table-Driven" APIs in rte_flow. > >>> > >>> This approach is inspired by p4land/tdi [2] and is particularly > >>> beneficial for P4 programmable network controller drivers. > >>> It provides the following advantages: > >>> > >>> * Easy integration of DPDK as a P4 runtime [3] backend. > >>> * Reduced effort for PMDs to enable flow offloading when the packet > >>> processing unit is abstracted as a pipeline of match/action tables i= n > >>> low-level drivers. > >>> > >>> The new APIs can be categoried into 5 types > >>> > >>> 1. Learning APIs > >>> > >>> Retrieve information about attributes supported by each table > >>> and action specification in the current pipeline. > >>> > >>> rte_flow_table_list_get > >>> rte_flow_table_info_get > >>> rte_flow_table_info_get_by_name > >>> rte_flow_table_key_field_info_get > >>> rte_flow_table_key_field_info_get_by_name > >>> rte_flow_action_spec_list_group > >>> rte_flow_action_spec_info_get > >>> rte_flow_action_spec_info_get_by_name > >>> rte_flow_action_spec_field_info_get_by_name > >>> > >>> 2. Key / Action Object Management API: > >>> > >>> Create, destroy, and clone key and action objects. > >>> > >>> rte_flow_table_key_create > >>> rte_flow_table_key_destroy > >>> rte_flow_table_key_clone > >>> rte_flow_table_key_field_set > >>> rte_flow_table_key_field_set_by_name > >>> rte_flow_table_key_field_set_with_mask > >>> rte_flow_table_key_field_set_with_mask_by_name > >>> rte_flow_table_key_field_set_with_range > >>> rte_flow_table_key_field_set_with_range_by_name > >>> rte_flow_table_key_field_set_with_prefix_ > >>> rte_flow_table_key_field_set_with_prefix_by_name > >>> > >>> rte_flow_table_action_create > >>> rte_flow_table_action_destroy > >>> rte_flow_table_action_clone > >>> rte_flow_table_action_field_get > >>> rte_flow_table_action_field_set > >>> rte_flow_table_action_field_set_by_name > >>> > >>> 3. Table Entry Update Synchronized APIs: > >>> > >>> Enable synchronized table updates, ensuring the updates are > >>> run-to-completion. > >>> > >>> rte_flow_table_entry_add > >>> rte_flow_table_entry_query > >>> rte_flow_table_entry_del > >>> rte_flow_table_entry_count_query > >>> rte_flow_table_default_action_set > >>> rte_flow_table_default_action_cancel > >>> > >>> 4. Table Entry Update Asynchronized APIs > >>> > >>> Provide asynchronous table update mode using a > >>> prepare/commit/pull pattern. > >>> > >>> rte_flow_table_entry_add_prepare > >>> rte_flow_table_entry_del_prepare > >>> rte_flow_table_update_status_commit > >>> rte_flow_table_update_status_pull > >>> > >>> 5. DPDK to PNA Interpretation APIs > >>> > >>> Facilitate APIs that map the DPDK context to the P4 Portable > >>> NIC Architecture (PNA) context, enabling interoperability between > >>> DPDK and PNA applications > >>> > >>> rte_flow_pna_port_get > >>> rte_flow_pna_rx_queue_get > >>> rte_flow_pna_tx_queue_get > >>> > >>> Follow the example in Problem Statement [1], to create a rule for > >>> table decap_vxlan_tcp_table with action decap_vxlan_fwd, we can use > >>> the following code. > >>> > >>> Code Snippet: > >>> > >>> /* Get the table info */ > >>> struct rte_flow_table_info tbl_info; > >>> rte_flow_table_info_get_by_name(port_id, "decap_vxlan_tcp_table", > >>> &tbl_info); > >>> > >>> /* Create the key */ > >>> struct rte_flow_table_key *key; > >>> rte_flow_table_key_create(port_id, tbl_info->id, &key); > >>> > >>> /* Set the key fields */ > >>> rte_flow_table_key_field_set_by_name(port_id, key, "wire_port", > >>> &wire_port, 2); rte_flow_table_key_field_set_by_name(port_id, key, > >>> "tun_ip_src", &tun_ip_src, 4); > >>> rte_flow_table_key_field_set_by_name(port_id, key, "tun_ip_dst", > >>> &tun_ip_dst, 4); rte_flow_table_key_field_set_by_name(port_id, key, > >>> "vni", &vni, 3); rte_flow_table_key_field_set_by_name(port_id, key, > >>> "ipv4_src", &ipv4_src, 4); > >>> rte_flow_table_key_field_set_by_name(port_id, key, "ipv4_dst", > >>> &ipv4_dst, 4); rte_flow_table_key_field_set_by_name(port_id, key, > >>> "src_port", &src_port, 2); > >>> rte_flow_table_key_field_set_by_name(port_id, key, "dst_port", > >>> &dst_port, 2); > >>> > >>> /* Get the action spec info */ > >>> struct rte_flow_action_spec_info as_info; > >>> rte_flow_action_spec_info_get_by_name(port_id, "decap_vxlan_fwd", > >>> &as_info); > >>> > >>> /* Create the action */ > >>> struct rte_flow_table_action *action; > >>> rte_flow_table_action_create(port_id, as_info->id, &action); > >>> > >>> /* Set the action fields */ > >>> rte_flow_table_action_field_set_by_name(port_id, action, "mod_id", > >>> &mod_id, 3); rte_flow_table_action_field_set_by_name(port_id, action, > >>> "port_id", &target_port_id, 2); > >>> > >>> /* Add the entry */ > >>> rte_flow_table_entry_add(port_id, tbl_info->id, key, action); > >>> > >>> /* destroy key and action */ > >>> rte_flow_table_action_destroy(port_id, action); > >>> rte_flow_table_key_destroy(port_id, key); > >>> > >>> ... > >>> > >>> Below code demonstrates how to use the prepare/commit/pull for high > >>> performance table entry updates. > >>> > >>> Code Snipped: > >>> > >>> struct rte_flow_table_key *keys[BATCH_SIZE]; struct > >>> rte_flow_table_action *actions[BATCH_SIZE]; struct > >>> rte_flow_table_update_status stats[BATCH_SIZE]; > >>> > >>> /* Create Keys and Actions */ > >>> for (i =3D 0; i < BATCH_SIZE; i++) { > >>> rte_flow_table_key_create(port_id, table_id, &keys[i]); > >>> /* set key field */ > >>> rte_flow_table_key_field_set(...) > >>> > >>> rte_flow_table_action_create(port_id, table_id, spec_id, &actions[= i]); > >>> /* set action field */ > >>> rte_flow_table_action_field_set(...) > >>> } > >>> > >>> /* program loop */ > >>> While (condition =3D true) { > >>> > >>> /* Prepare entry adding */ > >>> for (i =3D 0; i < BATCH_SIZE; i++) { > >>> struct rte_flow_table_key *key =3D keys[i]; > >>> struct rte_flow_table_action *action =3D actions[i]; > >>> > >>> rte_flow_table_entry_add_prepare(port_id, TABLE_ID, key, actio= n); > >>> } > >>> > >>> /* Commit to hardware */ > >>> rte_flow_table_update_commit(port_id); > >>> > >>> /* pull status */ > >>> int count =3D 0; > >>> while (count < BATCH_SIZE) { > >>> count +=3D rte_flow_table_update_status_pull(port_id, stats, > >> BATCH_SIZE, NULL); > >>> } > >>> > >>> /* reused Key and Action object */ > >>> for (i =3D 0; i< BATCH_SIZE; i++) { > >>> struct rte_flow_table_key *key =3D stats[i].key; > >>> struct rte_flow_table_action *action =3D stats[i].action; > >>> > >>> rte_flow_table_key_field_set(...); > >>> rte_flow_table_action_field_set(...) > >>> } > >>> } > >>> > >>> ... > >>> > >>> NOTE: For simplicity, error check and the rte_flow_error parameter fo= r > >>> each API has been omitted: > >>> > >>> [1]. http://mails.dpdk.org/archives/dev/2023-May/267719.html > >>> [2]. https://github.com/p4lang/tdi/ > >>> [3]. https://p4.org/p4-spec/p4runtime/main/P4Runtime-Spec.html > >>> > >>> Signed-off-by: Qi Zhang > >>> --- > >>> lib/ethdev/rte_flow_table.h | 1261 > >> +++++++++++++++++++++++++++++++++++ > >>> 1 file changed, 1261 insertions(+) > >>> create mode 100644 lib/ethdev/rte_flow_table.h > >>> > >>> diff --git a/lib/ethdev/rte_flow_table.h b/lib/ethdev/rte_flow_table.= h > >>> new file mode 100644 index 0000000000..31edf57a0f > >>> --- /dev/null > >>> +++ b/lib/ethdev/rte_flow_table.h > >>> @@ -0,0 +1,1261 @@ > >>> +/* SPDX-License-Identifier: BSD-3-Clause > >>> + * Copyright 2023 Intel Corporation. > >>> + */ > >>> + > >>> +#ifndef RTE_FLOW_TABLE_H_ > >>> +#define RTE_FLOW_TABLE_H_ > >>> + > >>> +#include > >>> +#include > >>> + > >>> +/** > >>> + * Max number of key field in a table. > >>> + */ > >>> +#define RTE_FLOW_TABLE_KEY_FIELD_NUM_MAX 256 > >>> +/** > >>> + * Max number of action spec in a table. > >>> + */ > >>> +#define RTE_FLOW_TABLE_ACTION_SPEC_NUM_MAX 64 > >>> +/** > >>> + * Max number of field in an action spec. > >>> + */ > >>> +#define RTE_FLOW_ACTION_SPEC_FIELD_NUM_MAX 16 > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Table key match type. > >>> + * > >>> + * To specify the key match type of a table. > >>> + */ > >>> +enum rte_flow_table_key_match_type { > >>> + RTE_FLOW_TABLE_KEY_MATCH_TYPE_EXACT, /**< Exact match. */ > >>> + RTE_FLOW_TABLE_KEY_MATCH_TYPE_WILDCARD, /**< Wildcard > >> match. */ > >>> + RTE_FLOW_TABLE_KEY_MATCH_TYPE_RANGE, /**< Range match. */ > >>> + RTE_FLOW_TABLE_KEY_MATCH_TYPE_LPM, /**< longest prefix > >> match. */ }; > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Byte order. > >>> + * > >>> + * To specify the byte order of table key / action field value in by= tes. > >>> + */ > >>> +enum rte_flow_byte_order { > >>> + RTE_FLOW_BYTE_ORDER_HOST, /**< follow host byte order. */ > >>> + RTE_FLOW_BYTE_ORDER_NETWORK, /**< follow network byte order. > >> */ }; > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Flow rule table info. > >>> + * > >>> + * A structure stores the properties of a flow rule table. > >>> + * Typically, a flow rule table represents to a P4 table which > >>> +describe a > >>> + * match/action unit in packet process pipeline. > >>> + */ > >>> +struct rte_flow_table_info { > >>> + uint32_t id; /**< Identifier of a table within the ethdev. */ > >>> + const char *name; /**< Name of the table. */ > >>> + const char *annotation; /**< Human readable message about this > >> table. */ > >>> + uint16_t key_field_num; /**< Number of key field. */ > >>> + uint32_t key_fields[RTE_FLOW_TABLE_KEY_FIELD_NUM_MAX]; /**< > >> Key field id array. */ > >>> + uint16_t action_spec_num; /**< Number of action spec. */ > >>> + uint32_t action_specs[RTE_FLOW_TABLE_ACTION_SPEC_NUM_MAX]; > >> /**< > >>> +Action spec id array */ }; > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Table key field info. > >>> + * > >>> + * A structure stores the properties of a table key field. > >>> + */ > >>> +struct rte_flow_table_key_field_info { > >>> + uint32_t table_id; /**< Identifier of a table within the ethdev. */ > >>> + uint32_t field_id; /**< Identifier of the key field within the tabl= e. */ > >>> + const char *name; /**< Name of the key field. */ > >>> + const char *annotation; /**< Human readable message about this > >> key field. */ > >>> + enum rte_flow_table_key_match_type match_type; /**< Key match > >> type. */ > >>> + uint16_t bit_width; /**< Bit width of the field value. */ > >>> + uint16_t byte_width; /**< Number of bytes to store the field value. > >> */ > >>> + /** > >>> + * Byte order of the byte array that store the key value. > >>> + */ > >>> + enum rte_flow_byte_order byte_order; }; > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Action spec info. > >>> + * > >>> + * A structure stores the properties of a action specification. > >>> + * Typically, a action specification represents a P4 Action. > >>> + */ > >>> +struct rte_flow_action_spec_info { > >>> + uint32_t id; /**< Identifier of a action spec within the ethdev. */ > >>> + const char *name; /**< Name of the action spec. */ > >>> + const char *annotation; /**< Human readable message about this > >> action spec */ > >>> + uint16_t field_num; /**< Number of fields */ > >>> + uint32_t fields[RTE_FLOW_ACTION_SPEC_FIELD_NUM_MAX]; /**< > >> Field id > >>> +array */ }; > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Action spec field info. > >>> + * > >>> + * A structure stores the properties of a action spec field. > >>> + */ > >>> +struct rte_flow_action_spec_field_info { > >>> + uint32_t spec_id; /**< Identifier of a action spec within the ethde= v. > >> */ > >>> + uint32_t field_id; /**< Identifier of the field within the action s= pec. > >> */ > >>> + const char *name; /**< Name of the field. */ > >>> + const char *annotation; /**< Human readable message about this > >> action spec. */ > >>> + uint16_t bit_width; /**< Bit width of the field value */ > >>> + uint16_t byte_width; /**< Number of bytes to store the field value. > >> */ > >>> + /** > >>> + * Byte order of the byte array that stores the key value. > >>> + */ > >>> + enum rte_flow_byte_order byte_order; }; > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Table Key object. > >>> + * > >>> + * A structure represent a table key object, should be created / > >>> +destroyed by > >>> + * rte_flow_table_key_create and rte_flow_table_key_destroy. > >>> + */ > >>> +struct rte_flow_table_key { > >>> + uint32_t table_id; /**< Indicate which table the key instance belon= gs > >> to. */ > >>> + int ref_cnt; /**< Reference count, in async ops it prevents the obj= ect > >> be destoried .*/ > >>> + uint8_t data[]; /**< PMD specific data. */ }; > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Action object. > >>> + * > >>> + * A structure represent a table action object, should be created / > >>> +destroyed by > >>> + * rte_flow_table_action_create and rte_flow_table_action_destroy. > >>> + */ > >>> +struct rte_flow_table_action { > >>> + uint32_t table_id; /**< Indicate which table the action instance > >> belongs to. */ > >>> + uint32_t spec_id; /**< Indicate which action spec the action follow= . > >> */ > >>> + int ref_cnt; /**< Reference count, in async ops it prevents the obj= ect > >> be destoried .*/ > >>> + uint8_t data[]; /**< PMD specific data. */ }; > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * ID list. > >>> + * > >>> + * An id list with variant size, should be created by > >>> + * rte_flow_table_list_popup or rte_flow_action_spec_list_popup. > >>> + * > >>> + * Application need to free the list by rte_free. > >>> + */ > >>> +struct rte_flow_id_list { > >>> + uint32_t num; /**< Number of the id list */ > >>> + uint32_t ids[]; /**< ID array */ > >>> +}; > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Popup table id list. > >>> + * > >>> + * A variant size list that store all table identifiers will be crea= ted. > >>> + * Application need to free the list by rte_free. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[out] list > >>> + * A variant size id list, store all table identifiers of current= ethernet > >>> + * device. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_list_popup(uint16_t port_id, > >>> + struct rte_flow_id_list **list, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Get table info by identifier. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] table_id > >>> + * Table identifier. > >>> + * @param[out] info > >>> + * Pointer to store the table info. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_info_get(uint16_t port_id, > >>> + uint32_t table_id, > >>> + struct rte_flow_table_info *info, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> +* @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Get table info by name. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] name > >>> + * Table name. > >>> + * @param[out] info > >>> + * Pointer to store the table info. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_info_get_by_name(uint16_t port_id, > >>> + const char *name, > >>> + struct rte_flow_table_info *info, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Get table key info by identifier. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] table_id > >>> + * Table identifier. > >>> + * @param[in] field_id > >>> + * Key field identifier. > >>> + * @param[info] info > >>> + * Pointer to store the table key field info. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_key_field_info_get(uint16_t port_id, > >>> + uint32_t table_id, > >>> + uint32_t field_id, > >>> + struct rte_flow_table_key_field_info *info, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Popup action spec id list. > >>> + * > >>> + * A variant size list that store all action spec identifiers will b= e created. > >>> + * Application need to free the list by rte_free. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_action_spec_list_popup(uint16_t port_id, > >>> + struct rte_flow_id_list **list, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Get action spec info by identifier. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] spec_id > >>> + * Action spec identifier. > >>> + * @info[out] info > >>> + * Pointer to store the action spec info. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_action_spec_info_get(uint16_t port_id, > >>> + uint32_t spec_id, > >>> + struct rte_flow_action_spec_info *info, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Get action spec info by name. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] name > >>> + * Action spec name. > >>> + * @info[out] info > >>> + * Pointer to store the action spec info. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_action_spec_info_get_by_name(uint16_t port_id, > >>> + const char *name, > >>> + struct rte_flow_action_spec_info *info, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Get action spec field info by identifier. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] spec_id > >>> + * Action spec identifier. > >>> + * @param[in] field_id > >>> + * Field identifier. > >>> + * @param[out] info > >>> + * Pointer to store the action spec field info. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_action_spec_field_info_get(uint16_t port_id, > >>> + uint32_t spec_id, > >>> + uint32_t field_id, > >>> + struct rte_flow_action_spec_field_info > >> *info, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Create a table key object. > >>> + * > >>> + * Application need to call rte_flow_table_key_destroy to free the k= ey > >> object. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] table_id > >>> + * Table identifier. > >>> + * @param[out] key > >>> + * Table key object created by PMD. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_key_create(uint16_t port_id, > >>> + uint32_t table_id, > >>> + struct rte_flow_table_key **key, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Destroy a table key object. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] key > >>> + * Table key object to destroy. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_key_destroy(uint16_t port_id, > >>> + struct rte_flow_table_key *key, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Create an table action object. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] table_id > >>> + * Table identifier. > >>> + * @param[in] spec_id > >>> + * Action spec identifier. > >>> + * @param[out] action > >>> + * Action key created by PMD. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_action_create(uint16_t port_id, > >>> + uint32_t table_id, > >>> + uint32_t spec_id, > >>> + struct rte_flow_table_action **action, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Destroy an table action object. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] action > >>> + * Action object to destroy. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_action_destroy(uint16_t port_id, > >>> + struct rte_flow_table_action *action, > >>> + struct rte_flow_error *error); > >>> + > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Set table key field value by identifier. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] key > >>> + * Table key object to update. > >>> + * @param[in] field_id > >>> + * key field identifier. > >>> + * @param[in] value > >>> + * Byte array to store the value > >>> + * @param[in] size > >>> + * Size of the byte array. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_key_field_set(uint16_t port_id, > >>> + struct rte_flow_table_key *key, > >>> + uint32_t field_id, > >>> + const uint8_t *value, > >>> + uint16_t size, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Set table key field value by name. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] key > >>> + * Table key object to update. > >>> + * @param[in] name > >>> + * key field name. > >>> + * @param[in] value > >>> + * Byte array to store the value to match. > >>> + * @param[in] size > >>> + * Size of the byte array. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_key_field_set_by_name(uint16_t port_id, > >>> + struct rte_flow_table_key *key, > >>> + const char *name, > >>> + const uint8_t *value, > >>> + uint16_t size, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Set wildcard match key field by identifier. > >>> + * > >>> + * For wildcard match, only a bit set in mask should be matched. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] key > >>> + * Table key object to update. > >>> + * @param[in] field_id > >>> + * Key field identifier. > >>> + * @param[in] value > >>> + * Byte array stores the value to match. > >>> + * @param[in] mask > >>> + * Byte array stores the bit mask. > >>> + * @param[in] size > >>> + * Size of value and mask byte array. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_key_field_set_with_mask(uint16_t port_id, > >>> + struct rte_flow_table_key *key, > >>> + uint32_t field_id, > >>> + const uint8_t *value, > >>> + const uint8_t *mask, > >>> + uint16_t size, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Set wildcard match key field by name. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] key > >>> + * Table key object to update. > >>> + * @param[in] name > >>> + * Key field name. > >>> + * @param[in] value > >>> + * Byte array stores the value to match. > >>> + * @param[in] mask > >>> + * Byte array stores the bit mask. > >>> + * @param[in] size > >>> + * Size of value and mask byte array. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_key_field_set_with_mask_by_name(uint16_t port_id, > >>> + struct rte_flow_table_key *key, > >>> + const char *name, > >>> + const uint8_t *value, > >>> + const uint8_t *mask, > >>> + uint16_t size, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Set range match key field by identifier. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] key > >>> + * Table key object to update. > >>> + * @param[in] field_id > >>> + * Key field identifier. > >>> + * @param[in] min > >>> + * Byte array stores the min value of the range to match > >>> + * @param[in] max > >>> + * Byte array stores the max value of the range to match > >>> + * @param[in] size > >>> + * Size of the min and max byte array > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_key_field_set_with_range(uint16_t port_id, > >>> + struct rte_flow_table_key *key, > >>> + uint32_t field_id, > >>> + const uint8_t *min, > >>> + const uint8_t *max, > >>> + uint16_t size, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Set range match key field by name. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] key > >>> + * Table key object to update. > >>> + * @param[in] name > >>> + * Key field name. > >>> + * @param[in] min > >>> + * Byte array stores the min value of the range to match > >>> + * @param[in] max > >>> + * Byte array stores the max value of the range to match > >>> + * @param[in] size > >>> + * Size of the min and max byte array > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_key_field_set_with_range_by_name(uint16_t port_id, > >>> + struct rte_flow_table_key > >> *key, > >>> + const char *name, > >>> + const uint8_t *min, > >>> + const uint8_t *max, > >>> + uint16_t size, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Set lpm match key field by identifier. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] key > >>> + * Table key object to update. > >>> + * @param[in] field_id > >>> + * Key field identifier. > >>> + * @param[in] value > >>> + * Byte array stores the value to match. > >>> + * @param[in] size > >>> + * Size of value byte array. > >>> + * @param[in] prefix > >>> + * Bits of the prefix to match, must <=3D (8 * size) > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_key_field_set_with_prefix(uint16_t port_id, > >>> + struct rte_flow_table_key *key, > >>> + uint32_t field_id, > >>> + const uint8_t *value, > >>> + uint16_t size, > >>> + uint16_t prefix, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Set lpm match key field by name. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] key > >>> + * Table key object to update. > >>> + * @param[in] name > >>> + * Key field name. > >>> + * @param[in] value > >>> + * Byte array stores the value to match. > >>> + * @param[in] size > >>> + * Size of value byte array. > >>> + * @param[in] prefix > >>> + * Bits of the prefix to match, must <=3D (8 * size) > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_key_field_set_with_prefix_by_name(uint16_t port_id, > >>> + struct rte_flow_table_key > >> *key, > >>> + const char* name, > >>> + const uint8_t *value, > >>> + uint16_t size, > >>> + uint16_t prefix, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Set action field value. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] action > >>> + * Action object to update. > >>> + * @param[in] field_id > >>> + * Field identifier. > >>> + * @param[in] value > >>> + * Byte array stores the value of the field. > >>> + * @param[in] size > >>> + * Size of the byte array. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_action_field_set(uint16_t port_id, > >>> + struct rte_flow_table_action *action, > >>> + uint32_t field_id, > >>> + const uint8_t *value, > >>> + uint16_t size, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * get action field value, application may use > >>> +rte_flow_table_entry_query > >>> + * to query by key and use this API to figure out each action field. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] action > >>> + * Action object to query. > >>> + * @param[in] field_id > >>> + * Field identifier. > >>> + * @param[out] value > >>> + * Byte array stores the value of the field. > >>> + * @param[in | out] size > >>> + * Input as size of the byte array, return the size of the value. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_action_field_get(uint16_t port_id, > >>> + const struct rte_flow_table_action *action, > >>> + uint32_t field_id, > >>> + uint8_t *value, > >>> + uint16_t *size, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] action > >>> + * Action object to update. > >>> + * @param[in] name > >>> + * Field name. > >>> + * @param[in] value > >>> + * Byte array stores the value of the field. > >>> + * @param[in] size > >>> + * Size of the byte array. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_action_field_set_by_name(uint16_t port_id, > >>> + struct rte_flow_action *action, > >>> + const char *name, > >>> + const uint8_t *value, > >>> + uint16_t size, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Set table default action. > >>> + * > >>> + * The default action will take effect when a packet hit no rules. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] table_id > >>> + * Table identifier > >>> + * @param[in] action > >>> + * Default action object. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_default_action_set(uint16_t port_id, > >>> + uint32_t table_id, > >>> + const struct rte_flow_table_action *action, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Cancel table default action > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] table_id > >>> + * Table identifier. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_default_action_cancel(uint32_t port_id, > >>> + uint32_t table_id, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Add matching rule as a table entry, the rule take effect > >>> +immediately > >>> + * after the API call. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] table_id > >>> + * Table identifier. > >>> + * @param[in] key > >>> + * Table key object. > >>> + * @param[in] action > >>> + * Action object. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_entry_add(uint16_t port_id, > >>> + uint32_t table_id, > >>> + const struct rte_flow_table_key *key, > >>> + const struct rte_flow_table_action *action, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Query action of a table entry. > >>> + * > >>> + * If success, a new rte_flow_table_action object will be created. > >>> + * Use rte_flow_table_action_destroy to free the resource. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] table_id > >>> + * Table identifier. > >>> + * @param[in] key > >>> + * Table key object. > >>> + * @param[out] action > >>> + * Action object returned. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_entry_query(uint16_t port_id, > >>> + uint32_t table_id, > >>> + const struct rte_flow_table_key *key, > >>> + struct rte_flow_table_action **action, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Delete a table entry, this take effect immeidatly after the API c= all. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] table_id > >>> + * Table identifier. > >>> + * @param[in] key > >>> + * Table key object to match. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_entry_del(uint16_t port_id, > >>> + uint32_t table_id, > >>> + const struct rte_flow_table_key *key, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Query rule hit counters. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] table_id > >>> + * Table identifier. > >>> + * @param[in] key > >>> + * Table key object to match. > >>> + * @param[out] count > >>> + * Pointer stores the hit counters. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_entry_count_query(uint16_t port_id, > >>> + uint32_t table_id, > >>> + const struct rte_flow_table_key *key, > >>> + struct rte_flow_query_count *count, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Clone a table key object. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] key > >>> + * Table key object to clone. > >>> + * @param[out] new_key > >>> + * New table key object be created by PMD. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_key_clone(uint16_t port_id, > >>> + const struct rte_flow_table_key *key, > >>> + struct rte_flow_table_key **new_key, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Clone a action object. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] action > >>> + * Action object to clone. > >>> + * @param[out] new_action > >>> + * New action object be created by PMD. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_action_clone(uint16_t port_id, > >>> + const struct rte_flow_action *action, > >>> + struct rte_flow_action **new_action, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Prepare table entry adding. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] table_id > >>> + * Table identifier. > >>> + * @param[in] key > >>> + * Table key object. > >>> + * @param[in] action > >>> + * Action object. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_entry_add_prepare(uint16_t port_id, > >>> + uint32_t table_id, > >>> + struct rte_flow_table_key *key, > >>> + struct rte_flow_table_action *action, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Prepare table entry deletion. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] table_id > >>> + * Table identifier. > >>> + * @param[in] key > >>> + * Table key object to match. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_entry_del_prepare(uint16_t port_id, > >>> + uint32_t table_id, > >>> + struct rte_flow_table_key *key, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Commit all prepared adding and deletion requests. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_update_commit(uint16_t port_id, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Table entry operation type. > >>> + */ > >>> + > >>> +enum rte_flow_table_update_op { > >>> + RTE_FLOW_TABLE_ENTRY_OP_ADD, /* Add an entry */ > >>> + RTE_FLOW_TABLE_ENTRY_OP_DEL, /* Delete an entry */ > >>> + RTE_FLOW_TABLE_ENTRY_OP_QRY, /* Query an entry */ }; > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Table entry update status. > >>> + */ > >>> +struct rte_flow_table_update_status { > >>> + struct rte_flow_table_key *key; /**< Table key object of the entry = */ > >>> + struct rte_flow_table_action *action; /**< Action object of the ent= ry > >> */ > >>> + enum rte_flow_table_update_op op; /**< Operation type */ > >>> + enum rte_flow_error_type err; /**< Error type */ }; > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Pull table entry update status. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[out] stats > >>> + * An array stores the status of all finished entry adding / dele= te > >>> + * requests. > >>> + * @param[in] size > >>> + * Size of the input array. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * >=3D0 on success, indiates the number of status be pulled. > >>> + * A negative errno value otherwise and rte_errno is set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_table_update_status_pull(uint16_t port_id, > >>> + struct rte_flow_table_update_status *stats, > >>> + int size, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Get PNA port identifier. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] ethdev_port_id > >>> + * Ethdev port identifier maps to the required PNA port. > >>> + * @param[out] pna_port_id > >>> + * Pointer stores the PNA port identifier. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_pna_port_get(uint16_t port_id, > >>> + uint16_t ethdev_port_id, > >>> + uint32_t *hw_port_id, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Get a PNA queue identifer from a ethdev Rx queue. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] ethdev_port_id > >>> + * Ethdev port identifier the Rx queue belongs to. > >>> + * @param[in] ethdev_queue_id > >>> + * Ethdev Rx queue index that maps to the required PNA queue > >> identifier. > >>> + * @param[out] pna_queue_id > >>> + * Pointer stores the PNA queue identifier. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_pna_rx_queue_get(uint16_t port_id, > >>> + uint16_t ethdev_port_id, > >>> + uint16_t ethdev_queue_id, > >>> + uint32_t *hw_queue_id, > >>> + struct rte_flow_error *error); > >>> + > >>> +/** > >>> + * @warning > >>> + * @b EXPERIMENTAL: this API may change without prior notice. > >>> + * > >>> + * Get a PNA queue identifer from a ethdev Tx queue. > >>> + * > >>> + * @param[in] port_id > >>> + * Port identifier of the Ethernet device. > >>> + * @param[in] ethdev_port_id > >>> + * Ethdev port identifier the Tx queue belongs to. > >>> + * @param[in] ethdev_queue_id > >>> + * Ethdev Tx queue index that maps to the required PNA queue > >> identifier. > >>> + * @param[out] pna_queue_id > >>> + * Pointer stores the PNA queue identifier. > >>> + * @param[out] error > >>> + * Perform verbose error reporting if not NULL. PMDs initialize t= his > >>> + * structure in case of error only. > >>> + * > >>> + * @return > >>> + * 0 on success, a negative errno value otherwise and rte_errno i= s set. > >>> + */ > >>> +__rte_experimental int > >>> +rte_flow_pna_tx_queue_get(uint16_t port_id, > >>> + uint16_t ethdev_port_id, > >>> + uint16_t ethdev_queue_id, > >>> + uint32_t *hw_queue_id, > >>> + struct rte_flow_error *error); > >>> +#endif > >>> -- > >>> 2.31.1 > >>> > >>> > >