Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/107184/?format=api
http://patches.dpdk.org/api/patches/107184/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220209213809.1208269-2-akozyrev@nvidia.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20220209213809.1208269-2-akozyrev@nvidia.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20220209213809.1208269-2-akozyrev@nvidia.com", "date": "2022-02-09T21:38:00", "name": "[v4,01/10] ethdev: introduce flow pre-configuration hints", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "0d5a8402d763928c6eae8963fb0f70068c15e984", "submitter": { "id": 1873, "url": "http://patches.dpdk.org/api/people/1873/?format=api", "name": "Alexander Kozyrev", "email": "akozyrev@nvidia.com" }, "delegate": { "id": 319, "url": "http://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220209213809.1208269-2-akozyrev@nvidia.com/mbox/", "series": [ { "id": 21577, "url": "http://patches.dpdk.org/api/series/21577/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=21577", "date": "2022-02-09T21:37:59", "name": "ethdev: datapath-focused flow rules management", "version": 4, "mbox": "http://patches.dpdk.org/series/21577/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/107184/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/107184/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "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])\n\tby inbox.dpdk.org (Postfix) with ESMTP id CEC54A0032;\n\tWed, 9 Feb 2022 22:38:41 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id EB9B741151;\n\tWed, 9 Feb 2022 22:38:39 +0100 (CET)", "from NAM11-CO1-obe.outbound.protection.outlook.com\n (mail-co1nam11on2062.outbound.protection.outlook.com [40.107.220.62])\n by mails.dpdk.org (Postfix) with ESMTP id 7988E41150\n for <dev@dpdk.org>; Wed, 9 Feb 2022 22:38:38 +0100 (CET)", "from CH0PR12MB5169.namprd12.prod.outlook.com (2603:10b6:610:b8::8)\n by MN2PR12MB3326.namprd12.prod.outlook.com (2603:10b6:208:cb::12) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.17; Wed, 9 Feb\n 2022 21:38:35 +0000", "from CO1PR15CA0077.namprd15.prod.outlook.com (2603:10b6:101:20::21)\n by CH0PR12MB5169.namprd12.prod.outlook.com (2603:10b6:610:b8::8) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Wed, 9 Feb\n 2022 21:38:34 +0000", "from CO1NAM11FT037.eop-nam11.prod.protection.outlook.com\n (2603:10b6:101:20:cafe::a0) by CO1PR15CA0077.outlook.office365.com\n (2603:10b6:101:20::21) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11 via Frontend\n Transport; Wed, 9 Feb 2022 21:38:34 +0000", "from mail.nvidia.com (12.22.5.234) by\n CO1NAM11FT037.mail.protection.outlook.com (10.13.174.91) with Microsoft SMTP\n Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id\n 15.20.4975.11 via Frontend Transport; Wed, 9 Feb 2022 21:38:34 +0000", "from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com\n (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.18;\n Wed, 9 Feb 2022 21:38:33 +0000", "from pegasus01.mtr.labs.mlnx (10.126.231.35) by\n rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9;\n Wed, 9 Feb 2022 13:38:30 -0800" ], "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=dewzK8j0s2Hhm7tKbebawDpShz88i0xZ2CB2z7g98G60tNub8AEcdciEDFeIHbErBltq9BDbvqEB49RNBqwGsXTys0hG4J7Hw9E40ciKxkmCX4sOU0U/VvrjorJV+3IJpeaFJPfzJP4WhlOEBw5NJx+W7WQXGiOObfEw0WvPxjHQ9FwEIrr2mgGFS66ptQCYfdYLqoxLs+9O4hkfOrkZyfdGVPe6UcSztbRDunErUU9hVdbV/Q3gq45tWfwgnqTsbABM76Kva084pZTV7+VGgV3EYQk0xFS5soHdzpMnHY0GM9T1O+hDH0jscb4/8jQA5ZXOI18Mz24t0g1GkJoqtw==", "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n 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;\n bh=5ldIwqFcSQEgC04JQBhVGsQO0KLEKvsmcF92WoiZkto=;\n b=He+3V1B7Q8Bpd4uy+WunU8F2ShjRT3hNs3m0NOJk1sDY2eZirbR0hrT13LnEtCS6RmeXE4q+X60aIuyN+ebm5HXzM++chAdvwCGAFbtXWwtDge8xylAp6q/cMOg0Hiq7p92zq1beUkRqXuneif8RTVLBfFiAdeZq88mWlkqj7Zrx/WzWyr3B0/C/dFtS4gjdSi1gnBjTA+VSuTJR0So6p+bcboefIQU/XG9ViFncpyj1bRkAeCtMZc6sErfAjQy1/CA/I+gd0ynOEuyVLjhuaCrSpS9Bfw8XWM5uHysVF8BRPLbOHqYTP0Fr3qPtz6OjR4psIz3Sse+JIIdVmLHD6Q==", "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 12.22.5.234) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass\n (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none\n (message not signed); arc=none", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;\n s=selector2;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=5ldIwqFcSQEgC04JQBhVGsQO0KLEKvsmcF92WoiZkto=;\n b=kCs82eLei3djw8vzOnN0e3eohjkv6RDfZ9ODzG0or97YH2+8YnxiJ6WVuv01A560NgGmPftNVIBz6Pc56+IZB4tsDkdXuiVTMSgriuz+x2mQkUH1QOurTyVFBprJtEmNCfte7jvIKZQ9bL98/d3E5lCRkGCD2n3slLu6olLNyoqz887p09c+CvGt2B/N8fBZNXNqtlhdPjzWUoMKIl5yiyWVTXB+HzJ3Q16mhte5AWLBCg2lgAqouns6F3c+ldBhMQ2gm9aKk8+3gNEESE0j0HeQqd9opTulNoy1GsGWO7FGbeSMOUVrlvmB1fFxMTe2M+C0Xgjo+sO3tSGvGh5MoA==", "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 12.22.5.234)\n smtp.mailfrom=nvidia.com; dkim=none (message not signed)\n header.d=none;dmarc=pass action=none header.from=nvidia.com;", "Received-SPF": "Pass (protection.outlook.com: domain of nvidia.com designates\n 12.22.5.234 as permitted sender) receiver=protection.outlook.com;\n client-ip=12.22.5.234; helo=mail.nvidia.com;", "From": "Alexander Kozyrev <akozyrev@nvidia.com>", "To": "<dev@dpdk.org>", "CC": "<orika@nvidia.com>, <thomas@monjalon.net>, <ivan.malov@oktetlabs.ru>,\n <andrew.rybchenko@oktetlabs.ru>, <ferruh.yigit@intel.com>,\n <mohammad.abdul.awal@intel.com>, <qi.z.zhang@intel.com>,\n <jerinj@marvell.com>, <ajit.khaparde@broadcom.com>,\n <bruce.richardson@intel.com>", "Subject": "[PATCH v4 01/10] ethdev: introduce flow pre-configuration hints", "Date": "Wed, 9 Feb 2022 23:38:00 +0200", "Message-ID": "<20220209213809.1208269-2-akozyrev@nvidia.com>", "X-Mailer": "git-send-email 2.18.2", "In-Reply-To": "<20220209213809.1208269-1-akozyrev@nvidia.com>", "References": "<20220206032526.816079-1-akozyrev@nvidia.com >\n <20220209213809.1208269-1-akozyrev@nvidia.com>", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Originating-IP": "[10.126.231.35]", "X-ClientProxiedBy": "rnnvmail202.nvidia.com (10.129.68.7) To\n rnnvmail201.nvidia.com (10.129.68.8)", "X-EOPAttributedMessage": "0", "X-MS-PublicTrafficType": "Email", "X-MS-Office365-Filtering-Correlation-Id": "b14e3daa-8893-4226-a4bb-08d9ec1485fd", "X-MS-TrafficTypeDiagnostic": "CH0PR12MB5169:EE_|MN2PR12MB3326:EE_", "X-LD-Processed": "43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr,ExtAddr", "X-Microsoft-Antispam-PRVS": "\n <CH0PR12MB516986F2955A2C8A6353C9EBAF2E9@CH0PR12MB5169.namprd12.prod.outlook.com>", "X-MS-Oob-TLC-OOBClassifiers": "OLM:10000;", "X-MS-Exchange-SenderADCheck": "1", "X-MS-Exchange-AntiSpam-Relay": "0", "X-Microsoft-Antispam": "BCL:0;", "X-Microsoft-Antispam-Message-Info": "\n VywTPrYNqAJmO9uLaTM3b/0AlniPKF4UhARai91vlcBAsWLaI3tkLz/SySfsxIFjXa0+briVX3oLb1M4KIBg061Y9zIiwcCp/LXvyYBKyNqZYn573Rvg7XJk2khWKN9VhQeMMJLEcYagcJeq32cwYSAS9BPbNLEgO8eP0NCpcvBx+GvJ5Z//J/a6NYt+emGPSL75FJzux7/zg8reiCURLRnAB9uEzYkUycqBgrRrqSUtjl9OIn66tBeGMFSgKtuvtVT8vbgh5uPjFxZNvmpC3slJPlmQRpIIrILoGYfjhoBtVSk2tQ4uY78UdujdfSfkH+oMOYjTqrJ6QFGZuV63ERZzwn8oNM9nMlF3ylj1SKpruQPziNke/nZGLgLAYGqUw9iHDRhJN8A3BFnBiLWB88q/TdINnxU2cjFbbWb5u0CYE74EUBuR5cwpiAr3nbCIDoL2gs+lZ5yVyM+BKGR2bGtetSS45EC7kPx17OiME6FigoCBXE3Z14rO2eBqg3m4lBwoGj9eabKqWtUn9DjcsInY1R/hRsazQbFsbqY0CNDGzEp+sh6mw3wbzs7ipUmqdFE+oZxfoItGYEtVeTjwJGC7fYR0/VgRb7LG5v+BzFCxAtBudK6EdtHERuU29VGkoclnLjXHLmqB14u2WX0Yhtu/tSrKNkTCZuWDEmzFW+mc5zn4IcqvVdXBfBDraZKwRu8w8lwf+edImofp7TgXsA==", "X-Forefront-Antispam-Report": "CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:;\n IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE;\n SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(1076003)(16526019)(54906003)(6666004)(26005)(81166007)(316002)(356005)(336012)(86362001)(8936002)(186003)(508600001)(8676002)(426003)(4326008)(2616005)(83380400001)(36756003)(82310400004)(5660300002)(70206006)(36860700001)(6916009)(47076005)(70586007)(40460700003)(7416002)(2906002)(36900700001);\n DIR:OUT; SFP:1101;", "X-OriginatorOrg": "Nvidia.com", "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "09 Feb 2022 21:38:34.0035 (UTC)", "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n b14e3daa-8893-4226-a4bb-08d9ec1485fd", "X-MS-Exchange-CrossTenant-Id": "43083d15-7273-40c1-b7db-39efd9ccc17a", "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.234];\n Helo=[mail.nvidia.com]", "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem", "X-MS-Exchange-CrossTenant-AuthSource": "\n CO1NAM11FT037.eop-nam11.prod.protection.outlook.com", "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous", "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "MN2PR12MB3326", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "The flow rules creation/destruction at a large scale incurs a performance\npenalty and may negatively impact the packet processing when used\nas part of the datapath logic. This is mainly because software/hardware\nresources are allocated and prepared during the flow rule creation.\n\nIn order to optimize the insertion rate, PMD may use some hints provided\nby the application at the initialization phase. The rte_flow_configure()\nfunction allows to pre-allocate all the needed resources beforehand.\nThese resources can be used at a later stage without costly allocations.\nEvery PMD may use only the subset of hints and ignore unused ones or\nfail in case the requested configuration is not supported.\n\nThe rte_flow_info_get() is available to retrieve the information about\nsupported pre-configurable resources. Both these functions must be called\nbefore any other usage of the flow API engine.\n\nSigned-off-by: Alexander Kozyrev <akozyrev@nvidia.com>\nAcked-by: Ori Kam <orika@nvidia.com>\n---\n doc/guides/prog_guide/rte_flow.rst | 37 +++++++++\n doc/guides/rel_notes/release_22_03.rst | 6 ++\n lib/ethdev/rte_flow.c | 40 +++++++++\n lib/ethdev/rte_flow.h | 108 +++++++++++++++++++++++++\n lib/ethdev/rte_flow_driver.h | 10 +++\n lib/ethdev/version.map | 2 +\n 6 files changed, 203 insertions(+)", "diff": "diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst\nindex b4aa9c47c2..72fb1132ac 100644\n--- a/doc/guides/prog_guide/rte_flow.rst\n+++ b/doc/guides/prog_guide/rte_flow.rst\n@@ -3589,6 +3589,43 @@ Return values:\n \n - 0 on success, a negative errno value otherwise and ``rte_errno`` is set.\n \n+Flow engine configuration\n+-------------------------\n+\n+Configure flow API management.\n+\n+An application may provide some parameters at the initialization phase about\n+rules engine configuration and/or expected flow rules characteristics.\n+These parameters may be used by PMD to preallocate resources and configure NIC.\n+\n+Configuration\n+~~~~~~~~~~~~~\n+\n+This function performs the flow API management configuration and\n+pre-allocates needed resources beforehand to avoid costly allocations later.\n+Expected number of counters or meters in an application, for example,\n+allow PMD to prepare and optimize NIC memory layout in advance.\n+``rte_flow_configure()`` must be called before any flow rule is created,\n+but after an Ethernet device is configured.\n+\n+.. code-block:: c\n+\n+ int\n+ rte_flow_configure(uint16_t port_id,\n+ const struct rte_flow_port_attr *port_attr,\n+ struct rte_flow_error *error);\n+\n+Information about resources that can benefit from pre-allocation can be\n+retrieved via ``rte_flow_info_get()`` API. It returns the maximum number\n+of pre-configurable resources for a given port on a system.\n+\n+.. code-block:: c\n+\n+ int\n+ rte_flow_info_get(uint16_t port_id,\n+ struct rte_flow_port_info *port_info,\n+ struct rte_flow_error *error);\n+\n .. _flow_isolated_mode:\n \n Flow isolated mode\ndiff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst\nindex f03183ee86..2a47a37f0a 100644\n--- a/doc/guides/rel_notes/release_22_03.rst\n+++ b/doc/guides/rel_notes/release_22_03.rst\n@@ -69,6 +69,12 @@ New Features\n New APIs, ``rte_eth_dev_priority_flow_ctrl_queue_info_get()`` and\n ``rte_eth_dev_priority_flow_ctrl_queue_configure()``, was added.\n \n+* ** Added functions to configure Flow API engine\n+\n+ * ethdev: Added ``rte_flow_configure`` API to configure Flow Management\n+ engine, allowing to pre-allocate some resources for better performance.\n+ Added ``rte_flow_info_get`` API to retrieve pre-configurable resources.\n+\n * **Updated AF_XDP PMD**\n \n * Added support for libxdp >=v1.2.2.\ndiff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c\nindex a93f68abbc..66614ae29b 100644\n--- a/lib/ethdev/rte_flow.c\n+++ b/lib/ethdev/rte_flow.c\n@@ -1391,3 +1391,43 @@ rte_flow_flex_item_release(uint16_t port_id,\n \tret = ops->flex_item_release(dev, handle, error);\n \treturn flow_err(port_id, ret, error);\n }\n+\n+int\n+rte_flow_info_get(uint16_t port_id,\n+\t\t struct rte_flow_port_info *port_info,\n+\t\t struct rte_flow_error *error)\n+{\n+\tstruct rte_eth_dev *dev = &rte_eth_devices[port_id];\n+\tconst struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);\n+\n+\tif (unlikely(!ops))\n+\t\treturn -rte_errno;\n+\tif (likely(!!ops->info_get)) {\n+\t\treturn flow_err(port_id,\n+\t\t\t\tops->info_get(dev, port_info, error),\n+\t\t\t\terror);\n+\t}\n+\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n+\t\t\t\t NULL, rte_strerror(ENOTSUP));\n+}\n+\n+int\n+rte_flow_configure(uint16_t port_id,\n+\t\t const struct rte_flow_port_attr *port_attr,\n+\t\t struct rte_flow_error *error)\n+{\n+\tstruct rte_eth_dev *dev = &rte_eth_devices[port_id];\n+\tconst struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);\n+\n+\tif (unlikely(!ops))\n+\t\treturn -rte_errno;\n+\tif (likely(!!ops->configure)) {\n+\t\treturn flow_err(port_id,\n+\t\t\t\tops->configure(dev, port_attr, error),\n+\t\t\t\terror);\n+\t}\n+\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n+\t\t\t\t NULL, rte_strerror(ENOTSUP));\n+}\ndiff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h\nindex 1031fb246b..92be2a9a89 100644\n--- a/lib/ethdev/rte_flow.h\n+++ b/lib/ethdev/rte_flow.h\n@@ -4853,6 +4853,114 @@ rte_flow_flex_item_release(uint16_t port_id,\n \t\t\t const struct rte_flow_item_flex_handle *handle,\n \t\t\t struct rte_flow_error *error);\n \n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Information about available pre-configurable resources.\n+ * The zero value means a resource cannot be pre-allocated.\n+ *\n+ */\n+struct rte_flow_port_info {\n+\t/**\n+\t * Number of pre-configurable counter actions.\n+\t * @see RTE_FLOW_ACTION_TYPE_COUNT\n+\t */\n+\tuint32_t nb_counters;\n+\t/**\n+\t * Number of pre-configurable aging flows actions.\n+\t * @see RTE_FLOW_ACTION_TYPE_AGE\n+\t */\n+\tuint32_t nb_aging_flows;\n+\t/**\n+\t * Number of pre-configurable traffic metering actions.\n+\t * @see RTE_FLOW_ACTION_TYPE_METER\n+\t */\n+\tuint32_t nb_meters;\n+};\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Retrieve configuration attributes supported by the port.\n+ *\n+ * @param port_id\n+ * Port identifier of Ethernet device.\n+ * @param[out] port_info\n+ * A pointer to a structure of type *rte_flow_port_info*\n+ * to be filled with the contextual information of the port.\n+ * @param[out] error\n+ * Perform verbose error reporting if not NULL.\n+ * PMDs initialize this structure in case of error only.\n+ *\n+ * @return\n+ * 0 on success, a negative errno value otherwise and rte_errno is set.\n+ */\n+__rte_experimental\n+int\n+rte_flow_info_get(uint16_t port_id,\n+\t\t struct rte_flow_port_info *port_info,\n+\t\t struct rte_flow_error *error);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Resource pre-allocation and pre-configuration settings.\n+ * The zero value means on demand resource allocations only.\n+ *\n+ */\n+struct rte_flow_port_attr {\n+\t/**\n+\t * Number of counter actions pre-configured.\n+\t * @see RTE_FLOW_ACTION_TYPE_COUNT\n+\t */\n+\tuint32_t nb_counters;\n+\t/**\n+\t * Number of aging flows actions pre-configured.\n+\t * @see RTE_FLOW_ACTION_TYPE_AGE\n+\t */\n+\tuint32_t nb_aging_flows;\n+\t/**\n+\t * Number of traffic metering actions pre-configured.\n+\t * @see RTE_FLOW_ACTION_TYPE_METER\n+\t */\n+\tuint32_t nb_meters;\n+};\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Configure the port's flow API engine.\n+ *\n+ * This API can only be invoked before the application\n+ * starts using the rest of the flow library functions.\n+ *\n+ * The API can be invoked multiple times to change the\n+ * settings. The port, however, may reject the changes.\n+ *\n+ * Parameters in configuration attributes must not exceed\n+ * numbers of resources returned by the rte_flow_info_get API.\n+ *\n+ * @param port_id\n+ * Port identifier of Ethernet device.\n+ * @param[in] port_attr\n+ * Port configuration attributes.\n+ * @param[out] error\n+ * Perform verbose error reporting if not NULL.\n+ * PMDs initialize this structure in case of error only.\n+ *\n+ * @return\n+ * 0 on success, a negative errno value otherwise and rte_errno is set.\n+ */\n+__rte_experimental\n+int\n+rte_flow_configure(uint16_t port_id,\n+\t\t const struct rte_flow_port_attr *port_attr,\n+\t\t struct rte_flow_error *error);\n+\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/ethdev/rte_flow_driver.h b/lib/ethdev/rte_flow_driver.h\nindex f691b04af4..7c29930d0f 100644\n--- a/lib/ethdev/rte_flow_driver.h\n+++ b/lib/ethdev/rte_flow_driver.h\n@@ -152,6 +152,16 @@ struct rte_flow_ops {\n \t\t(struct rte_eth_dev *dev,\n \t\t const struct rte_flow_item_flex_handle *handle,\n \t\t struct rte_flow_error *error);\n+\t/** See rte_flow_info_get() */\n+\tint (*info_get)\n+\t\t(struct rte_eth_dev *dev,\n+\t\t struct rte_flow_port_info *port_info,\n+\t\t struct rte_flow_error *err);\n+\t/** See rte_flow_configure() */\n+\tint (*configure)\n+\t\t(struct rte_eth_dev *dev,\n+\t\t const struct rte_flow_port_attr *port_attr,\n+\t\t struct rte_flow_error *err);\n };\n \n /**\ndiff --git a/lib/ethdev/version.map b/lib/ethdev/version.map\nindex cd0c4c428d..f1235aa913 100644\n--- a/lib/ethdev/version.map\n+++ b/lib/ethdev/version.map\n@@ -260,6 +260,8 @@ EXPERIMENTAL {\n \t# added in 22.03\n \trte_eth_dev_priority_flow_ctrl_queue_configure;\n \trte_eth_dev_priority_flow_ctrl_queue_info_get;\n+\trte_flow_info_get;\n+\trte_flow_configure;\n };\n \n INTERNAL {\n", "prefixes": [ "v4", "01/10" ] }{ "id": 107184, "url": "