From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0053.outbound.protection.outlook.com [104.47.34.53]) by dpdk.org (Postfix) with ESMTP id C0623FC30 for ; Thu, 30 Mar 2017 12:33:07 +0200 (CEST) Received: from BN6PR03CA0020.namprd03.prod.outlook.com (10.168.230.158) by SN1SPR8PMB197.namprd03.prod.outlook.com (10.169.39.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.2; Thu, 30 Mar 2017 10:33:05 +0000 Received: from BN1AFFO11FD019.protection.gbl (2a01:111:f400:7c10::192) by BN6PR03CA0020.outlook.office365.com (2603:10b6:404:23::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.10 via Frontend Transport; Thu, 30 Mar 2017 10:33:05 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD019.mail.protection.outlook.com (10.58.52.79) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1005.5 via Frontend Transport; Thu, 30 Mar 2017 10:33:04 +0000 Received: from [127.0.0.1] ([10.232.133.65]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v2UAWuRC024840; Thu, 30 Mar 2017 03:33:01 -0700 To: Cristian Dumitrescu , References: <1488589820-206947-1-git-send-email-cristian.dumitrescu@intel.com> <1488589820-206947-3-git-send-email-cristian.dumitrescu@intel.com> CC: , , , From: Hemant Agrawal Message-ID: Date: Thu, 30 Mar 2017 16:02:55 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1488589820-206947-3-git-send-email-cristian.dumitrescu@intel.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131353435847938039; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39860400002)(39840400002)(39450400003)(39380400002)(39410400002)(39850400002)(39400400002)(2980300002)(1110001)(1109001)(339900001)(3190300001)(377454003)(189002)(24454002)(199003)(54534003)(9170700003)(6306002)(65826007)(53946003)(64126003)(966004)(189998001)(7246003)(36756003)(7126002)(31696002)(5660300001)(120886001)(50466002)(16200700003)(229853002)(53936002)(53376002)(53546009)(38730400002)(83506001)(2950100002)(81166006)(77096006)(8676002)(4326008)(85426001)(8936002)(6666003)(6246003)(86362001)(106466001)(8656002)(31686004)(54356999)(50986999)(54906002)(2870700001)(76176999)(105606002)(33646002)(4001350100001)(23676002)(356003)(551984002)(104016004)(2906002)(47776003)(305945005)(65956001)(65806001)(559001)(569005); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1SPR8PMB197; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD019; 1:gEIqh313/dX59BCDALr34NzPceNXIxMd9rMuZUBtXiOOHMZxaHgAqX07mtrBTveuDt2uLTY7qxymaAY88Of8+32Ir1IqrZPPU0K7nYCRjLbynmx3xQHGhDaEgA2efh1K7PxgryUDyTBRZHdPHKydLs5mVKxv4kRvLnBR9u/DcgSXAPg+JsOcJD5SQRQN28nyYc7Ws0zbosaV7EQicQlvwTEm3RKcIg8936ktQtqoBzSKb7pc57b2aa6405GTtfyVI8fP2xfQgUWi8mFYlU42Xas4o2K9PeXmH8YZRhFM3IuR+3M/h5p2Oower6ndLdZSd0Qgwd7q+SmpIX8RCf62zn5jALPC/9u8wU/Dbui1uOonk8L3FrsetIZ1EH+L0aI6fYzW7ubgmD8++vT7jEytjiR63k4ruLNzqvtdvovhaVRLR9MTlNx5gYZNGs+Ctj0atdrnW+sMnts/P/0nI+2A5kiUAy7CEONJQJEpGwL6NwHP2Wq2fAoazEWGGUsN8ecFS2kw3ggZILrgwz8sA+phUIhx5aVePIzqtg4fyo7UVmg1KTabnRJtpPpiodyHIZxkgW5En0M3aSd2q+mjKY4m27ZIST7cQvEUT5DdcTLQtj1tzK4WSbssYyMt7tiWobnW5JvDy+cCzTTZgG6kBqqQtQ== X-MS-Office365-Filtering-Correlation-Id: 04955406-e971-403d-ee96-08d477582632 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030255075)(201703131430075)(201703131517081); SRVR:SN1SPR8PMB197; X-Microsoft-Exchange-Diagnostics: 1; SN1SPR8PMB197; 3:IqBmc60zzSuNH6M+DRNuoJPy9DJhrxn1+jhL+s48Jaqq/9PF0Qw4PcM05eXXuijB0ny8V3VmQhI3xbBwqAR1xIxmEvjT6nicg8r4UXfTBIkwxeG5ijBufSFmZb9I02qQtvEHtRwlhZrhfq6WnO2EOyoSR3y8UzZf2f5+VKtUtgIYP43YHr2uX+x86NplgNLv5k5Z62GoMyzl+qv7tJ7n1QIFd5UopzZRI22qNSL3ijaalWgSituUHkDkCIHGY3sHYbcGAq2JtLgCbibTBHFBNbvoLiu75xDDEwCWuZn4mRxhRWM1lghny/eniIi1BBeNm0hNo3JahdyAirYINI2fzpTE1NKQZ6RPRFP2iofBJIYG2hEx9rdN5xjb5VVscg0IZu/lx5q7x91dSL4VccWkbvZpyrUPRvdLo/1K44QObBL/bydPYVqG13UJ8SWieI0bn+DA3ahkIg10tecwYPV1Rg==; 25:spHJLMxzCMyLI2Gzc5yIORZsb1tGBfe6VsvwYwNR+B6uG27pXcqptfbu3oM6vu+XaVrSbd/VkqfW/i7UxqOz/ymaJt4h9N+fz/sPryf3fZsEBol7OK4YT1YidoqKmHSlWXAfkjyy5KFxBvj68k4YsYm0ui+CHArTJDyShrN2k/jBo43A7GAxMHhZ/pgmxxhitkU2TM7MRgnNsARwADMMji3iR8TZX57MBFszHoN4+Kw3t30uZkzXJ5gTOceT9oPWucS0iSufJg/xa0MEKkTQJgekJr0Gx5OQ8B17sE6vGraZikv0qnFtM9PcrQtbiotXor0jd1TbSAzCGlgcmfJRV97RfX7iwayoRzNJlgCveN/DJj6ocPp4b5jKsRKUu+OCQHrnD18XyxdyEjzn+4qlbzQPALTWosqYvFDOpbxesZs1aIaUhuVKK7pYGp6apVNfqBHiaFaWjSd+4kGhhxMj7w== X-Microsoft-Exchange-Diagnostics: 1; SN1SPR8PMB197; 31:mm7zjLz8Kd+XwCyZdGmI/pcYMF96S+vppDOSDRp7MGsFSy1NaOsnHWf2Eg8n/vh+DfFsP+khmtq4EDRR6W7KN5Gy7N+3VTT7j3nWJBmkS172fSrC65w1n3ZOfeTG38liJGQNvGCLz6wZHEfacnXBvfUzMvEJdEUb11WyL/1rEi05RTvo68+ipOPOOYAJs5g8YMkqRxrryLGjo19/3u/lRzMp8RFb5w1DiPfCxp5M7EgfrTY2sQAnBe8uqdGdY+7QQ1qjBADNXmthl3672365fERXlbUNjKWqe/Pjss062Eg= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(278428928389397)(131327999870524)(21532816269658)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(601004)(2401047)(13024025)(5005006)(13015025)(13018025)(13023025)(13017025)(8121501046)(3002001)(93006067)(93001067)(10201501046)(6055026)(6096035)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259075)(20161123563025)(20161123561025)(20161123565025)(20161123556025); SRVR:SN1SPR8PMB197; BCL:0; PCL:0; RULEID:(400006); SRVR:SN1SPR8PMB197; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtTTjFTUFI4UE1CMTk3OzQ6MXVucm53cjcyMENqM1dOMDQwdUlxbUZzOW5Q?= =?utf-8?B?emNVTm5ycVhKSFJxYlgvb2FiTURPTTVQcnVWTzkwaldUYnNITW94a1N6Z0xp?= =?utf-8?B?Q1ZPNWhYQkhmU0ZEcVNxek9tUkp1dGZLZzJScWVTL0lVaWZaS1Y3ZlpxRGZF?= =?utf-8?B?aURYb3kzSnV1TkxieHY2TkVyMDU2U2IxbGJ0VFFZVHdPT2hBd3lzRVp2blo3?= =?utf-8?B?RExqbzFCbjU2bmdBOTg4akh0bDlDSGFpZENLOTJUWVZ5bEFEejlPZzgzeExF?= =?utf-8?B?SUNqTjhseFdJN3hzVDFpdlhPWW1HaVJ0ZFl2VG5KcnRBd29RQ2NNNUtQWFh1?= =?utf-8?B?OFpLdDlva3BqMXc1d093YU85MXIxclJNTnZJSkdlcUh6RElYUENUOXkwZm9r?= =?utf-8?B?Y2pYM0FYamJFd1NFempVcmpoQ0NZUkhldStwcmxsalBaRUFTeWZTTWRPcXRt?= =?utf-8?B?NlFTdGxYWDZUbE0zT3dNOVB2WSsrYlg1aXh5TThOM1pBUENLV2JxT2xvelFr?= =?utf-8?B?WnQzc0VaM0RTL2lCRkZzbXN6Z2J4UnM1UnJxODREdFB1ODNnV0pxRjNsaXc1?= =?utf-8?B?WDByYXhLUE44Q01sZGJPbVZpb0hSbDRuVkVFZmtRYkphazZFRlp1dzZqYStS?= =?utf-8?B?ZjVQZDdZbGhURnpKdVhuUHBxYi92ejJ1VjVuSnE2c2lQZ0VnSnN4MUhwUnNv?= =?utf-8?B?MExySWlCcUg4NlFrK1ZOejlOUXRIU25sTzV4T1BRZ0ZKUW05TjlyalFUcE9S?= =?utf-8?B?S0kyc1lHOTFvU1FXK052RTdhRTJwWkN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c0c53JYKjZlEcQQVXWw7T/O+hAOWNsbIFjM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1SPR8PMB197; 7:+Q9YPWmt6OfnS1MMvVM4sGLAJrs698UcUjlEc/zJHZVPTBXB+uv8hCVu63eDjqrbYDQWBTwrbrWxEaKSTa2H90+PNTV04bflsYKSH2yAHnHFnQfPPTOdH2+1IEb+N0YBbXh4e+JUhKq2QJbuVwfpMLIDL+4NvXeyrtnKbVoNx3HrBLXRif1tpnHQ4wQn6rUOqZAWd7Woo9EkJVOPBNKg7EOIZnx/bjQvHRYqprKDdooUtvgAu/JdD0M95IWNd2m1ym9ztxpxszsFbWOyz3VOjtShuqlRGrX/XcvpLgZIZXSLGcX9hckg4IChGVIHuJwaRo6Dp8hSIYQujkLxV25Pvg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2017 10:33:04.6066 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1SPR8PMB197 Subject: Re: [dpdk-dev] [PATCH v3 2/2] ethdev: add hierarchical scheduler API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 10:33:08 -0000 Hi Cristian, On 3/4/2017 6:40 AM, Cristian Dumitrescu wrote: > This patch introduces the generic ethdev API for the traffic manager > capability, which includes: hierarchical scheduling, traffic shaping, > congestion management, packet marking. > > Main features: > - Exposed as ethdev plugin capability (similar to rte_flow approach) > - Capability query API per port, per hierarchy level and per hierarchy node > - Scheduling algorithms: Strict Priority (SP), Weighed Fair Queuing (WFQ), > Weighted Round Robin (WRR) > - Traffic shaping: single/dual rate, private (per node) and shared (by multiple > nodes) shapers > - Congestion management for hierarchy leaf nodes: algorithms of tail drop, > head drop, WRED; private (per node) and shared (by multiple nodes) WRED > contexts > - Packet marking: IEEE 802.1q (VLAN DEI), IETF RFC 3168 (IPv4/IPv6 ECN for > TCP and SCTP), IETF RFC 2597 (IPv4 / IPv6 DSCP) > > Changes in v3: > - Implemented feedback from Jerin [5] > - Changed naming convention: scheddev -> tm > - Improvements on the capability API: > - Specification of marking capabilities per color > - WFQ/WRR groups: sp_n_children_max -> wfq_wrr_n_children_per_group_max, > added wfq_wrr_n_groups_max, improved description of both, improved > description of wfq_wrr_weight_max > - Dynamic updates: added KEEP_LEVEL and CHANGE_LEVEL for parent update > - Enforced/documented restrictions for root node (node_add() and update()) > - Enforced/documented shaper profile restrictions on PIR: PIR != 0, PIR >= CIR > - Turned repetitive code in rte_tm.c into macro > - Removed dependency on rte_red.h file (added RED params to rte_tm.h) > - Color: removed "e_" from color names enum > - Fixed small Doxygen style issues > > Changes in v2: > - Implemented feedback from Hemant [4] > - Improvements on the capability API > - Added capability API for hierarchy level > - Merged stats capability into the capability API > - Added dynamic updates > - Added non-leaf/leaf union to the node capability structure > - Renamed sp_priority_min to sp_n_priorities_max, added clarifications > - Fixed description for sp_n_children_max > - Clarified and enforced rule on node ID range for leaf and non-leaf nodes > - Added API functions to get node type (i.e. leaf/non-leaf): > get_leaf_nodes(), node_type_get() > - Added clarification for the root node: its creation, its parent, its role > - Macro NODE_ID_NULL as root node's parent > - Description of the node_add() and node_parent_update() API functions > - Added clarification for the first time add vs. subsequent updates rule > - Cleaned up the description for the node_add() function > - Statistics API improvements > - Merged stats capability into the capability API > - Added API function node_stats_update() > - Added more stats per packet color > - Added more error types > - Fixed small Doxygen style issues > > Changes in v1 (since RFC [1]): > - Implemented as ethdev plugin (similar to rte_flow) as opposed to more > monolithic additions to ethdev itself > - Implemented feedback from Jerin [2] and Hemant [3]. Implemented all the > suggested items with only one exception, see the long list below, hopefully > nothing was forgotten. > - The item not done (hopefully for a good reason): driver-generated object > IDs. IMO the choice to have application-generated object IDs adds marginal > complexity to the driver (search ID function required), but it provides > huge simplification for the application. The app does not need to worry > about building & managing tree-like structure for storing driver-generated > object IDs, the app can use its own convention for node IDs depending on > the specific hierarchy that it needs. Trivial example: identify all > level-2 nodes with IDs like 100, 200, 300, … and the level-3 nodes based > on their level-2 parents: 110, 120, 130, 140, …, 210, 220, 230, 240, …, > 310, 320, 330, … and level-4 nodes based on their level-3 parents: 111, > 112, 113, 114, …, 121, 122, 123, 124, …). Moreover, see the change log for > the other related simplification that was implemented: leaf nodes now have > predefined IDs that are the same with their Ethernet TX queue ID ( > therefore no translation is required for leaf nodes). > - Capability API. Done per port and per node as well. > - Dual rate shapers > - Added configuration of private shaper (per node) directly from the shaper > profile as part of node API (no shaper ID needed for private shapers), while > the shared shapers are configured outside of the node API using shaper profile > and communicated to the node using shared shaper ID. So there is no > configuration overhead for shared shapers if the app does not use any of them. > - Leaf nodes now have predefined IDs that are the same with their Ethernet TX > queue ID (therefore no translation is required for leaf nodes). This is also > used to differentiate between a leaf node and a non-leaf node. > - Domain-specific errors to give a precise indication of the error cause (same > as done by rte_flow) > - Packet marking API > - Packet length optional adjustment for shapers, positive (e.g. for adding > Ethernet framing overhead of 20 bytes) or negative (e.g. for rate limiting > based on IP packet bytes) > > [1] RFC: http://dpdk.org/ml/archives/dev/2016-November/050956.html > [2] Jerin’s feedback on RFC: http://www.dpdk.org/ml/archives/dev/2017-January/054484.html > [3] Hemant’s feedback on RFC: http://www.dpdk.org/ml/archives/dev/2017-January/054866.html > [4] Hemant's feedback on v1: http://www.dpdk.org/ml/archives/dev/2017-February/058033.html > [5] Jerin's feedback on v1: http://www.dpdk.org/ml/archives/dev/2017-March/058895.html > > Signed-off-by: Cristian Dumitrescu > --- > MAINTAINERS | 4 + > lib/librte_ether/Makefile | 5 +- > lib/librte_ether/rte_ether_version.map | 30 + > lib/librte_ether/rte_tm.c | 436 ++++++++++ > lib/librte_ether/rte_tm.h | 1466 ++++++++++++++++++++++++++++++++ > lib/librte_ether/rte_tm_driver.h | 365 ++++++++ > 6 files changed, 2305 insertions(+), 1 deletion(-) > create mode 100644 lib/librte_ether/rte_tm.c > create mode 100644 lib/librte_ether/rte_tm.h > create mode 100644 lib/librte_ether/rte_tm_driver.h > ... > + > +/** > + * Traffic manager dynamic updates > + */ > +enum rte_tm_dynamic_update_type { > + /**< Dynamic parent node update. The new parent node is located on same > + * hierarchy level as the former parent node. Consequently, the node > + * whose parent is changed preserves its hierarchy level. > + */ > + RTE_TM_UPDATE_NODE_PARENT_KEEP_LEVEL = 1 << 0, > + > + /**< Dynamic parent node update. The new parent node is located on > + * different hierarchy level than the former parent node. Consequently, > + * the node whose parent is changed also changes its hierarchy level. > + */ > + RTE_TM_UPDATE_NODE_PARENT_CHANGE_LEVEL = 1 << 1, > + > + /**< Dynamic node add/delete. */ > + RTE_TM_UPDATE_NODE_ADD_DELETE = 1 << 2, > + > + /**< Suspend/resume nodes. */ > + RTE_TM_UPDATE_NODE_SUSPEND_RESUME = 1 << 3, what is the expectation from suspend/resumes? 1. the Fan-out will stop. 2. the Fan-In will stop, any enqueue request will result into error? or it will be implementation dependent. During suspend/hold state the buffers should not hold in the node. > + > + /**< Dynamic switch between WFQ and WRR per node SP priority level. */ > + RTE_TM_UPDATE_NODE_SCHEDULING_MODE = 1 << 4, > + > + /**< Dynamic update of the set of enabled stats counter types. */ > + RTE_TM_UPDATE_NODE_STATS = 1 << 5, > + > + /**< Dynamic update of congestion management mode for leaf nodes. */ > + RTE_TM_UPDATE_NODE_CMAN = 1 << 6, > +}; > + > +/** > + * Traffic manager node capabilities > + */ > +struct rte_tm_node_capabilities { > + /**< Private shaper support. */ > + int shaper_private_supported; > + > + /**< Dual rate shaping support for private shaper. Valid only when > + * private shaper is supported. > + */ > + int shaper_private_dual_rate_supported; > + > + /**< Minimum committed/peak rate (bytes per second) for private > + * shaper. Valid only when private shaper is supported. > + */ > + uint64_t shaper_private_rate_min; > + > + /**< Maximum committed/peak rate (bytes per second) for private > + * shaper. Valid only when private shaper is supported. > + */ > + uint64_t shaper_private_rate_max; > + > + /**< Maximum number of supported shared shapers. The value of zero > + * indicates that shared shapers are not supported. > + */ > + uint32_t shaper_shared_n_max; > + > + /**< Mask of supported statistics counter types. */ > + uint64_t stats_mask; > + > + union { > + /**< Items valid only for non-leaf nodes. */ > + struct { > + /**< Maximum number of children nodes. */ > + uint32_t n_children_max; > + > + /**< Maximum number of supported priority levels. The > + * value of zero is invalid. The value of 1 indicates > + * that only priority 0 is supported, which essentially > + * means that Strict Priority (SP) algorithm is not > + * supported. > + */ > + uint32_t sp_n_priorities_max; > + > + /**< Maximum number of sibling nodes that can have the > + * same priority at any given time, i.e. maximum size > + * of the WFQ/WRR sibling node group. The value of zero > + * is invalid. The value of 1 indicates that WFQ/WRR > + * algorithms are not supported. The maximum value is > + * *n_children_max*. > + */ > + uint32_t wfq_wrr_n_children_per_group_max; > + > + /**< Maximum number of priority levels that can have > + * more than one child node at any given time, i.e. > + * maximum number of WFQ/WRR sibling node groups that > + * have two or more members. The value of zero states > + * that WFQ/WRR algorithms are not supported. The value > + * of 1 indicates that (*sp_n_priorities_max* - 1) > + * priority levels have at most one child node, so > + * there can be only one priority level with two or > + * more sibling nodes making up a WFQ/WRR group. The > + * maximum value is: min(floor(*n_children_max* / 2), > + * *sp_n_priorities_max*). > + */ > + uint32_t wfq_wrr_n_groups_max; > + > + /**< WFQ algorithm support. */ > + int wfq_supported; > + > + /**< WRR algorithm support. */ > + int wrr_supported; > + > + /**< Maximum WFQ/WRR weight. The value of 1 indicates > + * that all sibling nodes with same priority have the > + * same WFQ/WRR weight, so WFQ/WRR is reduced to FQ/RR. > + */ > + uint32_t wfq_wrr_weight_max; > + } nonleaf; > + > + /**< Items valid only for leaf nodes. */ > + struct { > + /**< Head drop algorithm support. */ > + int cman_head_drop_supported; > + > + /**< Private WRED context support. */ > + int cman_wred_context_private_supported; > + > + /**< Maximum number of shared WRED contexts supported. > + * The value of zero indicates that shared WRED > + * contexts are not supported. > + */ > + uint32_t cman_wred_context_shared_n_max; > + } leaf; > + }; > +}; > + > +/** > + * Traffic manager level capabilities > + */ > +struct rte_tm_level_capabilities { > + /**< Maximum number of nodes for the current hierarchy level. */ > + uint32_t n_nodes_max; > + > + /**< Maximum number of non-leaf nodes for the current hierarchy level. > + * The value of 0 indicates that current level only supports leaf > + * nodes. The maximum value is *n_nodes_max*. > + */ > + uint32_t n_nodes_nonleaf_max; > + > + /**< Maximum number of leaf nodes for the current hierarchy level. The > + * value of 0 indicates that current level only supports non-leaf > + * nodes. The maximum value is *n_nodes_max*. > + */ > + uint32_t n_nodes_leaf_max; > + > + /**< Summary of node-level capabilities across all the non-leaf nodes > + * of the current hierarchy level. Valid only when > + * *n_nodes_nonleaf_max* is greater than 0. > + */ > + struct rte_tm_node_capabilities nonleaf; > + > + /**< Summary of node-level capabilities across all the leaf nodes of > + * the current hierarchy level. Valid only when *n_nodes_leaf_max* is > + * greater than 0. > + */ > + struct rte_tm_node_capabilities leaf; you also need to provide a flag that all the nodes in this level has equal capability of not. In case, all nodes in this level has equal priority, the implementation need to to inquire any further for node level capability. Generally in case of HWs, they have equal capabilities at a particular level. If all nodes are not having equal priority, this information may not be correct and it may only provide a very rough overview of node capabilities. the applications should not assume anything about a particular node capability within this level. > +}; > + > +/** > + * Traffic manager capabilities > + */ > +struct rte_tm_capabilities { > + /**< Maximum number of nodes. */ > + uint32_t n_nodes_max; > + > + /**< Maximum number of levels (i.e. number of nodes connecting the root > + * node with any leaf node, including the root and the leaf). > + */ > + uint32_t n_levels_max; > + > + /**< Maximum number of shapers, either private or shared. In case the > + * implementation does not share any resource between private and > + * shared shapers, it is typically equal to the sum between > + * *shaper_private_n_max* and *shaper_shared_n_max*. > + */ > + uint32_t shaper_n_max; > + > + /**< Maximum number of private shapers. Indicates the maximum number of > + * nodes that can concurrently have the private shaper enabled. > + */ > + uint32_t shaper_private_n_max; > + > + /**< Maximum number of shared shapers. The value of zero indicates that > + * shared shapers are not supported. > + */ > + uint32_t shaper_shared_n_max; > + > + /**< Maximum number of nodes that can share the same shared shaper. > + * Only valid when shared shapers are supported. > + */ > + uint32_t shaper_shared_n_nodes_max; > + > + /**< Maximum number of shared shapers that can be configured with dual > + * rate shaping. The value of zero indicates that dual rate shaping > + * support is not available for shared shapers. > + */ > + uint32_t shaper_shared_dual_rate_n_max; > + > + /**< Minimum committed/peak rate (bytes per second) for shared shapers. > + * Only valid when shared shapers are supported. > + */ > + uint64_t shaper_shared_rate_min; > + > + /**< Maximum committed/peak rate (bytes per second) for shared shaper. > + * Only valid when shared shapers are supported. > + */ > + uint64_t shaper_shared_rate_max; > + > + /**< Minimum value allowed for packet length adjustment for > + * private/shared shapers. > + */ > + int shaper_pkt_length_adjust_min; > + > + /**< Maximum value allowed for packet length adjustment for > + * private/shared shapers. > + */ > + int shaper_pkt_length_adjust_max; > + > + /**< Maximum number of WRED contexts. */ > + uint32_t cman_wred_context_n_max; > + > + /**< Maximum number of private WRED contexts. Indicates the maximum > + * number of leaf nodes that can concurrently have the private WRED > + * context enabled. > + */ > + uint32_t cman_wred_context_private_n_max; > + > + /**< Maximum number of shared WRED contexts. The value of zero > + * indicates that shared WRED contexts are not supported. > + */ > + uint32_t cman_wred_context_shared_n_max; > + > + /**< Maximum number of leaf nodes that can share the same WRED context. > + * Only valid when shared WRED contexts are supported. > + */ > + uint32_t cman_wred_context_shared_n_nodes_max; > + > + /**< Support for VLAN DEI packet marking (per color). */ > + int mark_vlan_dei_supported[RTE_TM_COLORS]; > + > + /**< Support for IPv4/IPv6 ECN marking of TCP packets (per color). */ > + int mark_ip_ecn_tcp_supported[RTE_TM_COLORS]; > + > + /**< Support for IPv4/IPv6 ECN marking of SCTP packets (per color). */ > + int mark_ip_ecn_sctp_supported[RTE_TM_COLORS]; > + > + /**< Support for IPv4/IPv6 DSCP packet marking (per color). */ > + int mark_ip_dscp_supported[RTE_TM_COLORS]; > + > + /**< Set of supported dynamic update operations > + * (see enum rte_tm_dynamic_update_type). > + */ > + uint64_t dynamic_update_mask; > + > + /**< Summary of node-level capabilities across all non-leaf nodes. */ > + struct rte_tm_node_capabilities nonleaf; > + > + /**< Summary of node-level capabilities across all leaf nodes. */ > + struct rte_tm_node_capabilities leaf; This is not right, When you are having per level capabilities, why to return a node level capability with TM. In software, it is easy to maintain all nodes of same capabilities. But in case of hardware, the capabilities of different levels is going to be different. This will result into non-portable implementation, where the application will find the easy way to build the TM tree on this basis of these values. You already have most of the capability indications in the tm level parameters. the only information missing is w.r.t WRR/WFQ and SP capability of tm. you can add some flags to get that. > +}; > + > +/** > + * Congestion management (CMAN) mode > + * > + * This is used for controlling the admission of packets into a packet queue or > + * group of packet queues on congestion. On request of writing a new packet > + * into the current queue while the queue is full, the *tail drop* algorithm > + * drops the new packet while leaving the queue unmodified, as opposed to *head > + * drop* algorithm, which drops the packet at the head of the queue (the oldest > + * packet waiting in the queue) and admits the new packet at the tail of the > + * queue. > + * > + * The *Random Early Detection (RED)* algorithm works by proactively dropping > + * more and more input packets as the queue occupancy builds up. When the queue > + * is full or almost full, RED effectively works as *tail drop*. The *Weighted > + * RED* algorithm uses a separate set of RED thresholds for each packet color. > + */ > +enum rte_tm_cman_mode { > + RTE_TM_CMAN_TAIL_DROP = 0, /**< Tail drop */ > + RTE_TM_CMAN_HEAD_DROP, /**< Head drop */ > + RTE_TM_CMAN_WRED, /**< Weighted Random Early Detection (WRED) */ > +}; > + > +/** > + * Random Early Detection (RED) profile > + */ > +struct rte_tm_red_params { > + /**< Minimum queue threshold */ > + uint16_t min_th; > + > + /**< Maximum queue threshold */ > + uint16_t max_th; > + > + /**< Inverse of packet marking probability maximum value (maxp), i.e. > + * maxp_inv = 1 / maxp > + */ > + uint16_t maxp_inv; > + > + /**< Negated log2 of queue weight (wq), i.e. wq = 1 / (2 ^ wq_log2) */ > + uint16_t wq_log2; > +}; > + > +/** > + * Weighted RED (WRED) profile > + * > + * Multiple WRED contexts can share the same WRED profile. Each leaf node with > + * WRED enabled as its congestion management mode has zero or one private WRED > + * context (only one leaf node using it) and/or zero, one or several shared > + * WRED contexts (multiple leaf nodes use the same WRED context). A private > + * WRED context is used to perform congestion management for a single leaf > + * node, while a shared WRED context is used to perform congestion management > + * for a group of leaf nodes. > + */ > +struct rte_tm_wred_params { > + /**< One set of RED parameters per packet color */ > + struct rte_tm_red_params red_params[RTE_TM_COLORS]; > +}; > + > +/** > + * Token bucket > + */ > +struct rte_tm_token_bucket { > + /**< Token bucket rate (bytes per second) */ > + uint64_t rate; > + > + /**< Token bucket size (bytes), a.k.a. max burst size */ > + uint64_t size; > +}; > + > +/** > + * Shaper (rate limiter) profile > + * > + * Multiple shaper instances can share the same shaper profile. Each node has > + * zero or one private shaper (only one node using it) and/or zero, one or > + * several shared shapers (multiple nodes use the same shaper instance). > + * A private shaper is used to perform traffic shaping for a single node, while > + * a shared shaper is used to perform traffic shaping for a group of nodes. > + * > + * Single rate shapers use a single token bucket. A single rate shaper can be > + * configured by setting the rate of the committed bucket to zero, which > + * effectively disables this bucket. The peak bucket is used to limit the rate > + * and the burst size for the current shaper. > + * > + * Dual rate shapers use both the committed and the peak token buckets. The > + * rate of the peak bucket has to be bigger than zero, as well as greater than > + * or equal to the rate of the committed bucket. > + */ > +struct rte_tm_shaper_params { > + /**< Committed token bucket */ > + struct rte_tm_token_bucket committed; > + > + /**< Peak token bucket */ > + struct rte_tm_token_bucket peak; > + > + /**< Signed value to be added to the length of each packet for the > + * purpose of shaping. Can be used to correct the packet length with > + * the framing overhead bytes that are also consumed on the wire (e.g. > + * RTE_TM_ETH_FRAMING_OVERHEAD_FCS). > + */ > + int32_t pkt_length_adjust; > +}; > + > +/** > + * Node parameters > + * > + * Each hierarchy node has multiple inputs (children nodes of the current > + * parent node) and a single output (which is input to its parent node). The > + * current node arbitrates its inputs using Strict Priority (SP), Weighted Fair > + * Queuing (WFQ) and Weighted Round Robin (WRR) algorithms to schedule input > + * packets on its output while observing its shaping (rate limiting) > + * constraints. > + * > + * Algorithms such as byte-level WRR, Deficit WRR (DWRR), etc are considered > + * approximations of the ideal of WFQ and are assimilated to WFQ, although an > + * associated implementation-dependent trade-off on accuracy, performance and > + * resource usage might exist. > + * > + * Children nodes with different priorities are scheduled using the SP > + * algorithm, based on their priority, with zero (0) as the highest priority. > + * Children with same priority are scheduled using the WFQ or WRR algorithm, > + * based on their weight, which is relative to the sum of the weights of all > + * siblings with same priority, with one (1) as the lowest weight. > + * > + * Each leaf node sits on on top of a TX queue of the current Ethernet port. > + * Therefore, the leaf nodes are predefined with the node IDs of 0 .. (N-1), > + * where N is the number of TX queues configured for the current Ethernet port. > + * The non-leaf nodes have their IDs generated by the application. > + */ > +struct rte_tm_node_params { > + /**< Shaper profile for the private shaper. The absence of the private > + * shaper for the current node is indicated by setting this parameter > + * to RTE_TM_SHAPER_PROFILE_ID_NONE. > + */ > + uint32_t shaper_profile_id; > + > + /**< User allocated array of valid shared shaper IDs. */ > + uint32_t *shared_shaper_id; > + > + /**< Number of shared shaper IDs in the *shared_shaper_id* array. */ > + uint32_t n_shared_shapers; > + > + /**< Mask of statistics counter types to be enabled for this node. This > + * needs to be a subset of the statistics counter types available for > + * the current node. Any statistics counter type not included in this > + * set is to be disabled for the current node. > + */ > + uint64_t stats_mask; > + > + union { > + /**< Parameters only valid for non-leaf nodes. */ > + struct { > + /**< For each priority, indicates whether the children > + * nodes sharing the same priority are to be scheduled > + * by WFQ or by WRR. When NULL, it indicates that WFQ > + * is to be used for all priorities. When non-NULL, it > + * points to a pre-allocated array of *n_priority* > + * elements, with a non-zero value element indicating > + * WFQ and a zero value element for WRR. > + */ > + int *scheduling_mode_per_priority; > + > + /**< Number of priorities. */ > + uint32_t n_priorities; > + } nonleaf; > + > + /**< Parameters only valid for leaf nodes. */ > + struct { > + /**< Congestion management mode */ > + enum rte_tm_cman_mode cman; > + > + /**< WRED parameters (valid when *cman* is WRED). */ > + struct { > + /**< WRED profile for private WRED context. */ > + uint32_t wred_profile_id; > + > + /**< User allocated array of shared WRED > + * context IDs. The absence of a private WRED > + * context for current leaf node is indicated > + * by value RTE_TM_WRED_PROFILE_ID_NONE. > + */ > + uint32_t *shared_wred_context_id; > + > + /**< Number of shared WRED context IDs in the > + * *shared_wred_context_id* array. > + */ > + uint32_t n_shared_wred_contexts; > + } wred; > + } leaf; > + }; > +}; > + > +/** > + * Verbose error types. > + * > + * Most of them provide the type of the object referenced by struct > + * rte_tm_error::cause. > + */ > +enum rte_tm_error_type { > + RTE_TM_ERROR_TYPE_NONE, /**< No error. */ > + RTE_TM_ERROR_TYPE_UNSPECIFIED, /**< Cause unspecified. */ > + RTE_TM_ERROR_TYPE_CAPABILITIES, > + RTE_TM_ERROR_TYPE_LEVEL_ID, > + RTE_TM_ERROR_TYPE_WRED_PROFILE, > + RTE_TM_ERROR_TYPE_WRED_PROFILE_GREEN, > + RTE_TM_ERROR_TYPE_WRED_PROFILE_YELLOW, > + RTE_TM_ERROR_TYPE_WRED_PROFILE_RED, > + RTE_TM_ERROR_TYPE_WRED_PROFILE_ID, > + RTE_TM_ERROR_TYPE_SHARED_WRED_CONTEXT_ID, > + RTE_TM_ERROR_TYPE_SHAPER_PROFILE, > + RTE_TM_ERROR_TYPE_SHAPER_PROFILE_COMMITTED_RATE, > + RTE_TM_ERROR_TYPE_SHAPER_PROFILE_COMMITTED_SIZE, > + RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_RATE, > + RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_SIZE, > + RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PKT_ADJUST_LEN, > + RTE_TM_ERROR_TYPE_SHAPER_PROFILE_ID, > + RTE_TM_ERROR_TYPE_SHARED_SHAPER_ID, > + RTE_TM_ERROR_TYPE_NODE_PARENT_NODE_ID, > + RTE_TM_ERROR_TYPE_NODE_PRIORITY, > + RTE_TM_ERROR_TYPE_NODE_WEIGHT, > + RTE_TM_ERROR_TYPE_NODE_PARAMS, > + RTE_TM_ERROR_TYPE_NODE_PARAMS_SHAPER_PROFILE_ID, > + RTE_TM_ERROR_TYPE_NODE_PARAMS_SHARED_SHAPER_ID, > + RTE_TM_ERROR_TYPE_NODE_PARAMS_N_SHARED_SHAPERS, > + RTE_TM_ERROR_TYPE_NODE_PARAMS_STATS, > + RTE_TM_ERROR_TYPE_NODE_PARAMS_SCHEDULING_MODE, > + RTE_TM_ERROR_TYPE_NODE_PARAMS_N_PRIORITIES, > + RTE_TM_ERROR_TYPE_NODE_PARAMS_CMAN, > + RTE_TM_ERROR_TYPE_NODE_PARAMS_WRED_PROFILE_ID, > + RTE_TM_ERROR_TYPE_NODE_PARAMS_SHARED_WRED_CONTEXT_ID, > + RTE_TM_ERROR_TYPE_NODE_PARAMS_N_SHARED_WRED_CONTEXTS, > + RTE_TM_ERROR_TYPE_NODE_ID, > +}; > + > +/** > + * Verbose error structure definition. > + * > + * This object is normally allocated by applications and set by PMDs, the > + * message points to a constant string which does not need to be freed by > + * the application, however its pointer can be considered valid only as long > + * as its associated DPDK port remains configured. Closing the underlying > + * device or unloading the PMD invalidates it. > + * > + * Both cause and message may be NULL regardless of the error type. > + */ > +struct rte_tm_error { > + enum rte_tm_error_type type; /**< Cause field and error type. */ > + const void *cause; /**< Object responsible for the error. */ > + const char *message; /**< Human-readable error message. */ > +}; > + > +/** > + * Traffic manager get number of leaf nodes > + * > + * Each leaf node sits on on top of a TX queue of the current Ethernet port. > + * Therefore, the set of leaf nodes is predefined, their number is always equal > + * to N (where N is the number of TX queues configured for the current port) > + * and their IDs are 0 .. (N-1). > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param n_leaf_nodes > + * Number of leaf nodes for the current port. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_get_leaf_nodes(uint8_t port_id, > + uint32_t *n_leaf_nodes, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager node type (i.e. leaf or non-leaf) get > + * > + * The leaf nodes have predefined IDs in the range of 0 .. (N-1), where N is > + * the number of TX queues of the current Ethernet port. The non-leaf nodes > + * have their IDs generated by the application outside of the above range, > + * which is reserved for leaf nodes. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param node_id > + * Node ID value. Needs to be valid. > + * @param is_leaf > + * Set to non-zero value when node is leaf and to zero otherwise (non-leaf). > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_node_type_get(uint8_t port_id, > + uint32_t node_id, > + int *is_leaf, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager capabilities get > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param cap > + * Traffic manager capabilities. Needs to be pre-allocated and valid. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_capabilities_get(uint8_t port_id, > + struct rte_tm_capabilities *cap, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager level capabilities get > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param level_id > + * The hierarchy level identifier. The value of 0 identifies the level of the > + * root node. > + * @param cap > + * Traffic manager level capabilities. Needs to be pre-allocated and valid. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_level_capabilities_get(uint8_t port_id, > + uint32_t level_id, > + struct rte_tm_level_capabilities *cap, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager node capabilities get > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param node_id > + * Node ID. Needs to be valid. > + * @param cap > + * Traffic manager node capabilities. Needs to be pre-allocated and valid. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_node_capabilities_get(uint8_t port_id, > + uint32_t node_id, > + struct rte_tm_node_capabilities *cap, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager WRED profile add > + * > + * Create a new WRED profile with ID set to *wred_profile_id*. The new profile > + * is used to create one or several WRED contexts. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param wred_profile_id > + * WRED profile ID for the new profile. Needs to be unused. > + * @param profile > + * WRED profile parameters. Needs to be pre-allocated and valid. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_wred_profile_add(uint8_t port_id, > + uint32_t wred_profile_id, > + struct rte_tm_wred_params *profile, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager WRED profile delete > + * > + * Delete an existing WRED profile. This operation fails when there is > + * currently at least one user (i.e. WRED context) of this WRED profile. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param wred_profile_id > + * WRED profile ID. Needs to be the valid. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_wred_profile_delete(uint8_t port_id, > + uint32_t wred_profile_id, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager shared WRED context add or update > + * > + * When *shared_wred_context_id* is invalid, a new WRED context with this ID is > + * created by using the WRED profile identified by *wred_profile_id*. > + * > + * When *shared_wred_context_id* is valid, this WRED context is no longer using > + * the profile previously assigned to it and is updated to use the profile > + * identified by *wred_profile_id*. > + * > + * A valid shared WRED context can be assigned to several hierarchy leaf nodes > + * configured to use WRED as the congestion management mode. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param shared_wred_context_id > + * Shared WRED context ID > + * @param wred_profile_id > + * WRED profile ID. Needs to be the valid. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_shared_wred_context_add_update(uint8_t port_id, > + uint32_t shared_wred_context_id, > + uint32_t wred_profile_id, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager shared WRED context delete > + * > + * Delete an existing shared WRED context. This operation fails when there is > + * currently at least one user (i.e. hierarchy leaf node) of this shared WRED > + * context. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param shared_wred_context_id > + * Shared WRED context ID. Needs to be the valid. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_shared_wred_context_delete(uint8_t port_id, > + uint32_t shared_wred_context_id, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager shaper profile add > + * > + * Create a new shaper profile with ID set to *shaper_profile_id*. The new > + * shaper profile is used to create one or several shapers. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param shaper_profile_id > + * Shaper profile ID for the new profile. Needs to be unused. > + * @param profile > + * Shaper profile parameters. Needs to be pre-allocated and valid. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_shaper_profile_add(uint8_t port_id, > + uint32_t shaper_profile_id, > + struct rte_tm_shaper_params *profile, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager shaper profile delete > + * > + * Delete an existing shaper profile. This operation fails when there is > + * currently at least one user (i.e. shaper) of this shaper profile. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param shaper_profile_id > + * Shaper profile ID. Needs to be the valid. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_shaper_profile_delete(uint8_t port_id, > + uint32_t shaper_profile_id, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager shared shaper add or update > + * > + * When *shared_shaper_id* is not a valid shared shaper ID, a new shared shaper > + * with this ID is created using the shaper profile identified by > + * *shaper_profile_id*. > + * > + * When *shared_shaper_id* is a valid shared shaper ID, this shared shaper is > + * no longer using the shaper profile previously assigned to it and is updated > + * to use the shaper profile identified by *shaper_profile_id*. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param shared_shaper_id > + * Shared shaper ID > + * @param shaper_profile_id > + * Shaper profile ID. Needs to be the valid. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_shared_shaper_add_update(uint8_t port_id, > + uint32_t shared_shaper_id, > + uint32_t shaper_profile_id, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager shared shaper delete > + * > + * Delete an existing shared shaper. This operation fails when there is > + * currently at least one user (i.e. hierarchy node) of this shared shaper. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param shared_shaper_id > + * Shared shaper ID. Needs to be the valid. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_shared_shaper_delete(uint8_t port_id, > + uint32_t shared_shaper_id, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager node add > + * > + * Create new node and connect it as child of an existing node. The new node is > + * further identified by *node_id*, which needs to be unused by any of the > + * existing nodes. The parent node is identified by *parent_node_id*, which > + * needs to be the valid ID of an existing non-leaf node. The parent node is > + * going to use the provided SP *priority* and WFQ/WRR *weight* to schedule its > + * new child node. > + * > + * This function has to be called for both leaf and non-leaf nodes. In the case > + * of leaf nodes (i.e. *node_id* is within the range of 0 .. (N-1), with N as > + * the number of configured TX queues of the current port), the leaf node is > + * configured rather than created (as the set of leaf nodes is predefined) and > + * it is also connected as child of an existing node. > + * > + * The first node that is added becomes the root node and all the nodes that > + * are subsequently added have to be added as descendants of the root node. The > + * parent of the root node has to be specified as RTE_TM_NODE_ID_NULL and there > + * can only be one node with this parent ID (i.e. the root node). Further > + * restrictions for root node: needs to be non-leaf, its private shaper profile > + * needs to be valid and single rate, cannot use any shared shapers. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param node_id > + * Node ID. Needs to be unused by any of the existing nodes. > + * @param parent_node_id > + * Parent node ID. Needs to be the valid. > + * @param priority > + * Node priority. The highest node priority is zero. Used by the SP algorithm > + * running on the parent of the current node for scheduling this child node. > + * @param weight > + * Node weight. The node weight is relative to the weight sum of all siblings > + * that have the same priority. The lowest weight is one. Used by the WFQ/WRR > + * algorithm running on the parent of the current node for scheduling this > + * child node. > + * @param params > + * Node parameters. Needs to be pre-allocated and valid. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_node_add(uint8_t port_id, > + uint32_t node_id, > + uint32_t parent_node_id, > + uint32_t priority, > + uint32_t weight, > + struct rte_tm_node_params *params, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager node delete > + * > + * Delete an existing node. This operation fails when this node currently has > + * at least one user (i.e. child node). > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param node_id > + * Node ID. Needs to be valid. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_node_delete(uint8_t port_id, > + uint32_t node_id, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager node suspend > + * > + * Suspend an existing node. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param node_id > + * Node ID. Needs to be valid. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_node_suspend(uint8_t port_id, > + uint32_t node_id, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager node resume > + * > + * Resume an existing node that was previously suspended. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param node_id > + * Node ID. Needs to be valid. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_node_resume(uint8_t port_id, > + uint32_t node_id, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager hierarchy set > + * > + * This function is called during the port initialization phase (before the > + * Ethernet port is started) to freeze the start-up hierarchy. > + * > + * This function fails when the currently configured hierarchy is not supported > + * by the Ethernet port, in which case the user can abort or try out another > + * hierarchy configuration (e.g. a hierarchy with less leaf nodes), which can > + * be build from scratch (when *clear_on_fail* is enabled) or by modifying the > + * existing hierarchy configuration (when *clear_on_fail* is disabled). > + * > + * Note that, even when the configured hierarchy is supported (so this function > + * is successful), the Ethernet port start might still fail due to e.g. not > + * enough memory being available in the system, etc. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param clear_on_fail > + * On function call failure, hierarchy is cleared when this parameter is > + * non-zero and preserved when this parameter is equal to zero. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_hierarchy_set(uint8_t port_id, > + int clear_on_fail, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager node parent update > + * > + * Restriction for root node: its parent cannot be changed. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param node_id > + * Node ID. Needs to be valid. > + * @param parent_node_id > + * Node ID for the new parent. Needs to be valid. > + * @param priority > + * Node priority. The highest node priority is zero. Used by the SP algorithm > + * running on the parent of the current node for scheduling this child node. > + * @param weight > + * Node weight. The node weight is relative to the weight sum of all siblings > + * that have the same priority. The lowest weight is zero. Used by the > + * WFQ/WRR algorithm running on the parent of the current node for scheduling > + * this child node. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_node_parent_update(uint8_t port_id, > + uint32_t node_id, > + uint32_t parent_node_id, > + uint32_t priority, > + uint32_t weight, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager node private shaper update > + * > + * Restriction for root node: its private shaper profile needs to be valid and > + * single rate. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param node_id > + * Node ID. Needs to be valid. > + * @param shaper_profile_id > + * Shaper profile ID for the private shaper of the current node. Needs to be > + * either valid shaper profile ID or RTE_TM_SHAPER_PROFILE_ID_NONE, with > + * the latter disabling the private shaper of the current node. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_node_shaper_update(uint8_t port_id, > + uint32_t node_id, > + uint32_t shaper_profile_id, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager node shared shapers update > + * > + * Restriction for root node: cannot use any shared rate shapers. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param node_id > + * Node ID. Needs to be valid. > + * @param shared_shaper_id > + * Shared shaper ID. Needs to be valid. > + * @param add > + * Set to non-zero value to add this shared shaper to current node or to zero > + * to delete this shared shaper from current node. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_node_shared_shaper_update(uint8_t port_id, > + uint32_t node_id, > + uint32_t shared_shaper_id, > + int add, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager node enabled statistics counters update > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param node_id > + * Node ID. Needs to be valid. > + * @param stats_mask > + * Mask of statistics counter types to be enabled for the current node. This > + * needs to be a subset of the statistics counter types available for the > + * current node. Any statistics counter type not included in this set is to > + * be disabled for the current node. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_node_stats_update(uint8_t port_id, > + uint32_t node_id, > + uint64_t stats_mask, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager node scheduling mode update > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param node_id > + * Node ID. Needs to be valid leaf node ID. > + * @param scheduling_mode_per_priority > + * For each priority, indicates whether the children nodes sharing the same > + * priority are to be scheduled by WFQ or by WRR. When NULL, it indicates > + * that WFQ is to be used for all priorities. When non-NULL, it points to a > + * pre-allocated array of *n_priority* elements, with a non-zero value > + * element indicating WFQ and a zero value element for WRR. > + * @param n_priorities > + * Number of priorities. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_node_scheduling_mode_update(uint8_t port_id, > + uint32_t node_id, > + int *scheduling_mode_per_priority, > + uint32_t n_priorities, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager node congestion management mode update > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param node_id > + * Node ID. Needs to be valid leaf node ID. > + * @param cman > + * Congestion management mode. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_node_cman_update(uint8_t port_id, > + uint32_t node_id, > + enum rte_tm_cman_mode cman, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager node private WRED context update > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param node_id > + * Node ID. Needs to be valid leaf node ID. > + * @param wred_profile_id > + * WRED profile ID for the private WRED context of the current node. Needs to > + * be either valid WRED profile ID or RTE_TM_WRED_PROFILE_ID_NONE, with > + * the latter disabling the private WRED context of the current node. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_node_wred_context_update(uint8_t port_id, > + uint32_t node_id, > + uint32_t wred_profile_id, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager node shared WRED context update > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param node_id > + * Node ID. Needs to be valid leaf node ID. > + * @param shared_wred_context_id > + * Shared WRED context ID. Needs to be valid. > + * @param add > + * Set to non-zero value to add this shared WRED context to current node or > + * to zero to delete this shared WRED context from current node. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_node_shared_wred_context_update(uint8_t port_id, > + uint32_t node_id, > + uint32_t shared_wred_context_id, > + int add, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager node statistics counters read > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param node_id > + * Node ID. Needs to be valid. > + * @param stats > + * When non-NULL, it contains the current value for the statistics counters > + * enabled for the current node. > + * @param stats_mask > + * When non-NULL, it contains the mask of statistics counter types that are > + * currently enabled for this node, indicating which of the counters > + * retrieved with the *stats* structure are valid. > + * @param clear > + * When this parameter has a non-zero value, the statistics counters are > + * cleared (i.e. set to zero) immediately after they have been read, > + * otherwise the statistics counters are left untouched. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_node_stats_read(uint8_t port_id, > + uint32_t node_id, > + struct rte_tm_node_stats *stats, > + uint64_t *stats_mask, > + int clear, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager packet marking - VLAN DEI (IEEE 802.1Q) > + * > + * IEEE 802.1p maps the traffic class to the VLAN Priority Code Point (PCP) > + * field (3 bits), while IEEE 802.1q maps the drop priority to the VLAN Drop > + * Eligible Indicator (DEI) field (1 bit), which was previously named Canonical > + * Format Indicator (CFI). > + * > + * All VLAN frames of a given color get their DEI bit set if marking is enabled > + * for this color; otherwise, their DEI bit is left as is (either set or not). > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param mark_green > + * Set to non-zero value to enable marking of green packets and to zero to > + * disable it. > + * @param mark_yellow > + * Set to non-zero value to enable marking of yellow packets and to zero to > + * disable it. > + * @param mark_red > + * Set to non-zero value to enable marking of red packets and to zero to > + * disable it. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_mark_vlan_dei(uint8_t port_id, > + int mark_green, > + int mark_yellow, > + int mark_red, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager packet marking - IPv4 / IPv6 ECN (IETF RFC 3168) > + * > + * IETF RFCs 2474 and 3168 reorganize the IPv4 Type of Service (TOS) field > + * (8 bits) and the IPv6 Traffic Class (TC) field (8 bits) into Differentiated > + * Services Codepoint (DSCP) field (6 bits) and Explicit Congestion > + * Notification (ECN) field (2 bits). The DSCP field is typically used to > + * encode the traffic class and/or drop priority (RFC 2597), while the ECN > + * field is used by RFC 3168 to implement a congestion notification mechanism > + * to be leveraged by transport layer protocols such as TCP and SCTP that have > + * congestion control mechanisms. > + * > + * When congestion is experienced, as alternative to dropping the packet, > + * routers can change the ECN field of input packets from 2'b01 or 2'b10 > + * (values indicating that source endpoint is ECN-capable) to 2'b11 (meaning > + * that congestion is experienced). The destination endpoint can use the > + * ECN-Echo (ECE) TCP flag to relay the congestion indication back to the > + * source endpoint, which acknowledges it back to the destination endpoint with > + * the Congestion Window Reduced (CWR) TCP flag. > + * > + * All IPv4/IPv6 packets of a given color with ECN set to 2’b01 or 2’b10 > + * carrying TCP or SCTP have their ECN set to 2’b11 if the marking feature is > + * enabled for the current color, otherwise the ECN field is left as is. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param mark_green > + * Set to non-zero value to enable marking of green packets and to zero to > + * disable it. > + * @param mark_yellow > + * Set to non-zero value to enable marking of yellow packets and to zero to > + * disable it. > + * @param mark_red > + * Set to non-zero value to enable marking of red packets and to zero to > + * disable it. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_mark_ip_ecn(uint8_t port_id, > + int mark_green, > + int mark_yellow, > + int mark_red, > + struct rte_tm_error *error); > + > +/** > + * Traffic manager packet marking - IPv4 / IPv6 DSCP (IETF RFC 2597) > + * > + * IETF RFC 2597 maps the traffic class and the drop priority to the IPv4/IPv6 > + * Differentiated Services Codepoint (DSCP) field (6 bits). Here are the DSCP > + * values proposed by this RFC: > + * > + * Class 1 Class 2 Class 3 Class 4 > + * +----------+----------+----------+----------+ > + * Low Drop Prec | 001010 | 010010 | 011010 | 100010 | > + * Medium Drop Prec | 001100 | 010100 | 011100 | 100100 | > + * High Drop Prec | 001110 | 010110 | 011110 | 100110 | > + * +----------+----------+----------+----------+ > + * > + * There are 4 traffic classes (classes 1 .. 4) encoded by DSCP bits 1 and 2, > + * as well as 3 drop priorities (low/medium/high) encoded by DSCP bits 3 and 4. > + * > + * All IPv4/IPv6 packets have their color marked into DSCP bits 3 and 4 as > + * follows: green mapped to Low Drop Precedence (2’b01), yellow to Medium > + * (2’b10) and red to High (2’b11). Marking needs to be explicitly enabled > + * for each color; when not enabled for a given color, the DSCP field of all > + * packets with that color is left as is. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param mark_green > + * Set to non-zero value to enable marking of green packets and to zero to > + * disable it. > + * @param mark_yellow > + * Set to non-zero value to enable marking of yellow packets and to zero to > + * disable it. > + * @param mark_red > + * Set to non-zero value to enable marking of red packets and to zero to > + * disable it. > + * @param error > + * Error details. Filled in only on error, when not NULL. > + * @return > + * 0 on success, non-zero error code otherwise. > + */ > +int > +rte_tm_mark_ip_dscp(uint8_t port_id, > + int mark_green, > + int mark_yellow, > + int mark_red, > + struct rte_tm_error *error); > + > +#ifdef __cplusplus > +} > +#endif > + > +#endif /* __INCLUDE_RTE_TM_H__ */ > diff --git a/lib/librte_ether/rte_tm_driver.h b/lib/librte_ether/rte_tm_driver.h > new file mode 100644 > index 0000000..b3c9c15 > --- /dev/null > +++ b/lib/librte_ether/rte_tm_driver.h > @@ -0,0 +1,365 @@ > +/*- > + * BSD LICENSE > + * > + * Copyright(c) 2017 Intel Corporation. All rights reserved. > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * > + * * Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * * Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in > + * the documentation and/or other materials provided with the > + * distribution. > + * * Neither the name of Intel Corporation nor the names of its > + * contributors may be used to endorse or promote products derived > + * from this software without specific prior written permission. > + * > + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS > + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT > + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR > + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT > + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, > + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT > + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE > + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + */ > + > +#ifndef __INCLUDE_RTE_TM_DRIVER_H__ > +#define __INCLUDE_RTE_TM_DRIVER_H__ > + > +/** > + * @file > + * RTE Generic Traffic Manager API (Driver Side) > + * > + * This file provides implementation helpers for internal use by PMDs, they > + * are not intended to be exposed to applications and are not subject to ABI > + * versioning. > + */ > + > +#include > + > +#include > +#include "rte_ethdev.h" > +#include "rte_tm.h" > + > +#ifdef __cplusplus > +extern "C" { > +#endif > + > +typedef int (*rte_tm_node_type_get_t)(struct rte_eth_dev *dev, > + uint32_t node_id, > + int *is_leaf, > + struct rte_tm_error *error); > +/**< @internal Traffic manager node type get */ > + > +typedef int (*rte_tm_capabilities_get_t)(struct rte_eth_dev *dev, > + struct rte_tm_capabilities *cap, > + struct rte_tm_error *error); > +/**< @internal Traffic manager capabilities get */ > + > +typedef int (*rte_tm_level_capabilities_get_t)(struct rte_eth_dev *dev, > + uint32_t level_id, > + struct rte_tm_level_capabilities *cap, > + struct rte_tm_error *error); > +/**< @internal Traffic manager level capabilities get */ > + > +typedef int (*rte_tm_node_capabilities_get_t)(struct rte_eth_dev *dev, > + uint32_t node_id, > + struct rte_tm_node_capabilities *cap, > + struct rte_tm_error *error); > +/**< @internal Traffic manager node capabilities get */ > + > +typedef int (*rte_tm_wred_profile_add_t)(struct rte_eth_dev *dev, > + uint32_t wred_profile_id, > + struct rte_tm_wred_params *profile, > + struct rte_tm_error *error); > +/**< @internal Traffic manager WRED profile add */ > + > +typedef int (*rte_tm_wred_profile_delete_t)(struct rte_eth_dev *dev, > + uint32_t wred_profile_id, > + struct rte_tm_error *error); > +/**< @internal Traffic manager WRED profile delete */ > + > +typedef int (*rte_tm_shared_wred_context_add_update_t)( > + struct rte_eth_dev *dev, > + uint32_t shared_wred_context_id, > + uint32_t wred_profile_id, > + struct rte_tm_error *error); > +/**< @internal Traffic manager shared WRED context add */ > + > +typedef int (*rte_tm_shared_wred_context_delete_t)( > + struct rte_eth_dev *dev, > + uint32_t shared_wred_context_id, > + struct rte_tm_error *error); > +/**< @internal Traffic manager shared WRED context delete */ > + > +typedef int (*rte_tm_shaper_profile_add_t)(struct rte_eth_dev *dev, > + uint32_t shaper_profile_id, > + struct rte_tm_shaper_params *profile, > + struct rte_tm_error *error); > +/**< @internal Traffic manager shaper profile add */ > + > +typedef int (*rte_tm_shaper_profile_delete_t)(struct rte_eth_dev *dev, > + uint32_t shaper_profile_id, > + struct rte_tm_error *error); > +/**< @internal Traffic manager shaper profile delete */ > + > +typedef int (*rte_tm_shared_shaper_add_update_t)(struct rte_eth_dev *dev, > + uint32_t shared_shaper_id, > + uint32_t shaper_profile_id, > + struct rte_tm_error *error); > +/**< @internal Traffic manager shared shaper add/update */ > + > +typedef int (*rte_tm_shared_shaper_delete_t)(struct rte_eth_dev *dev, > + uint32_t shared_shaper_id, > + struct rte_tm_error *error); > +/**< @internal Traffic manager shared shaper delete */ > + > +typedef int (*rte_tm_node_add_t)(struct rte_eth_dev *dev, > + uint32_t node_id, > + uint32_t parent_node_id, > + uint32_t priority, > + uint32_t weight, > + struct rte_tm_node_params *params, > + struct rte_tm_error *error); > +/**< @internal Traffic manager node add */ > + > +typedef int (*rte_tm_node_delete_t)(struct rte_eth_dev *dev, > + uint32_t node_id, > + struct rte_tm_error *error); > +/**< @internal Traffic manager node delete */ > + > +typedef int (*rte_tm_node_suspend_t)(struct rte_eth_dev *dev, > + uint32_t node_id, > + struct rte_tm_error *error); > +/**< @internal Traffic manager node suspend */ > + > +typedef int (*rte_tm_node_resume_t)(struct rte_eth_dev *dev, > + uint32_t node_id, > + struct rte_tm_error *error); > +/**< @internal Traffic manager node resume */ > + > +typedef int (*rte_tm_hierarchy_set_t)(struct rte_eth_dev *dev, > + int clear_on_fail, > + struct rte_tm_error *error); > +/**< @internal Traffic manager hierarchy set */ > + > +typedef int (*rte_tm_node_parent_update_t)(struct rte_eth_dev *dev, > + uint32_t node_id, > + uint32_t parent_node_id, > + uint32_t priority, > + uint32_t weight, > + struct rte_tm_error *error); > +/**< @internal Traffic manager node parent update */ > + > +typedef int (*rte_tm_node_shaper_update_t)(struct rte_eth_dev *dev, > + uint32_t node_id, > + uint32_t shaper_profile_id, > + struct rte_tm_error *error); > +/**< @internal Traffic manager node shaper update */ > + > +typedef int (*rte_tm_node_shared_shaper_update_t)(struct rte_eth_dev *dev, > + uint32_t node_id, > + uint32_t shared_shaper_id, > + int32_t add, > + struct rte_tm_error *error); > +/**< @internal Traffic manager node shaper update */ > + > +typedef int (*rte_tm_node_stats_update_t)(struct rte_eth_dev *dev, > + uint32_t node_id, > + uint64_t stats_mask, > + struct rte_tm_error *error); > +/**< @internal Traffic manager node stats update */ > + > +typedef int (*rte_tm_node_scheduling_mode_update_t)( > + struct rte_eth_dev *dev, > + uint32_t node_id, > + int *scheduling_mode_per_priority, > + uint32_t n_priorities, > + struct rte_tm_error *error); > +/**< @internal Traffic manager node scheduling mode update */ > + > +typedef int (*rte_tm_node_cman_update_t)(struct rte_eth_dev *dev, > + uint32_t node_id, > + enum rte_tm_cman_mode cman, > + struct rte_tm_error *error); > +/**< @internal Traffic manager node congestion management mode update */ > + > +typedef int (*rte_tm_node_wred_context_update_t)( > + struct rte_eth_dev *dev, > + uint32_t node_id, > + uint32_t wred_profile_id, > + struct rte_tm_error *error); > +/**< @internal Traffic manager node WRED context update */ > + > +typedef int (*rte_tm_node_shared_wred_context_update_t)( > + struct rte_eth_dev *dev, > + uint32_t node_id, > + uint32_t shared_wred_context_id, > + int add, > + struct rte_tm_error *error); > +/**< @internal Traffic manager node WRED context update */ > + > +typedef int (*rte_tm_node_stats_read_t)(struct rte_eth_dev *dev, > + uint32_t node_id, > + struct rte_tm_node_stats *stats, > + uint64_t *stats_mask, > + int clear, > + struct rte_tm_error *error); > +/**< @internal Traffic manager read stats counters for specific node */ > + > +typedef int (*rte_tm_mark_vlan_dei_t)(struct rte_eth_dev *dev, > + int mark_green, > + int mark_yellow, > + int mark_red, > + struct rte_tm_error *error); > +/**< @internal Traffic manager packet marking - VLAN DEI */ > + > +typedef int (*rte_tm_mark_ip_ecn_t)(struct rte_eth_dev *dev, > + int mark_green, > + int mark_yellow, > + int mark_red, > + struct rte_tm_error *error); > +/**< @internal Traffic manager packet marking - IPv4/IPv6 ECN */ > + > +typedef int (*rte_tm_mark_ip_dscp_t)(struct rte_eth_dev *dev, > + int mark_green, > + int mark_yellow, > + int mark_red, > + struct rte_tm_error *error); > +/**< @internal Traffic manager packet marking - IPv4/IPv6 DSCP */ > + > +struct rte_tm_ops { > + /** Traffic manager node type get */ > + rte_tm_node_type_get_t node_type_get; > + > + /** Traffic manager capabilities_get */ > + rte_tm_capabilities_get_t capabilities_get; > + /** Traffic manager level capabilities_get */ > + rte_tm_level_capabilities_get_t level_capabilities_get; > + /** Traffic manager node capabilities get */ > + rte_tm_node_capabilities_get_t node_capabilities_get; > + > + /** Traffic manager WRED profile add */ > + rte_tm_wred_profile_add_t wred_profile_add; > + /** Traffic manager WRED profile delete */ > + rte_tm_wred_profile_delete_t wred_profile_delete; > + /** Traffic manager shared WRED context add/update */ > + rte_tm_shared_wred_context_add_update_t > + shared_wred_context_add_update; > + /** Traffic manager shared WRED context delete */ > + rte_tm_shared_wred_context_delete_t > + shared_wred_context_delete; > + > + /** Traffic manager shaper profile add */ > + rte_tm_shaper_profile_add_t shaper_profile_add; > + /** Traffic manager shaper profile delete */ > + rte_tm_shaper_profile_delete_t shaper_profile_delete; > + /** Traffic manager shared shaper add/update */ > + rte_tm_shared_shaper_add_update_t shared_shaper_add_update; > + /** Traffic manager shared shaper delete */ > + rte_tm_shared_shaper_delete_t shared_shaper_delete; > + > + /** Traffic manager node add */ > + rte_tm_node_add_t node_add; > + /** Traffic manager node delete */ > + rte_tm_node_delete_t node_delete; > + /** Traffic manager node suspend */ > + rte_tm_node_suspend_t node_suspend; > + /** Traffic manager node resume */ > + rte_tm_node_resume_t node_resume; > + /** Traffic manager hierarchy set */ > + rte_tm_hierarchy_set_t hierarchy_set; > + > + /** Traffic manager node parent update */ > + rte_tm_node_parent_update_t node_parent_update; > + /** Traffic manager node shaper update */ > + rte_tm_node_shaper_update_t node_shaper_update; > + /** Traffic manager node shared shaper update */ > + rte_tm_node_shared_shaper_update_t node_shared_shaper_update; > + /** Traffic manager node stats update */ > + rte_tm_node_stats_update_t node_stats_update; > + /** Traffic manager node scheduling mode update */ > + rte_tm_node_scheduling_mode_update_t node_scheduling_mode_update; > + /** Traffic manager node congestion management mode update */ > + rte_tm_node_cman_update_t node_cman_update; > + /** Traffic manager node WRED context update */ > + rte_tm_node_wred_context_update_t node_wred_context_update; > + /** Traffic manager node shared WRED context update */ > + rte_tm_node_shared_wred_context_update_t > + node_shared_wred_context_update; > + /** Traffic manager read statistics counters for current node */ > + rte_tm_node_stats_read_t node_stats_read; > + > + /** Traffic manager packet marking - VLAN DEI */ > + rte_tm_mark_vlan_dei_t mark_vlan_dei; > + /** Traffic manager packet marking - IPv4/IPv6 ECN */ > + rte_tm_mark_ip_ecn_t mark_ip_ecn; > + /** Traffic manager packet marking - IPv4/IPv6 DSCP */ > + rte_tm_mark_ip_dscp_t mark_ip_dscp; > +}; > + > +/** > + * Initialize generic error structure. > + * > + * This function also sets rte_errno to a given value. > + * > + * @param error > + * Pointer to error structure (may be NULL). > + * @param code > + * Related error code (rte_errno). > + * @param type > + * Cause field and error type. > + * @param cause > + * Object responsible for the error. > + * @param message > + * Human-readable error message. > + * > + * @return > + * Error code. > + */ > +static inline int > +rte_tm_error_set(struct rte_tm_error *error, > + int code, > + enum rte_tm_error_type type, > + const void *cause, > + const char *message) > +{ > + if (error) { > + *error = (struct rte_tm_error){ > + .type = type, > + .cause = cause, > + .message = message, > + }; > + } > + rte_errno = code; > + return code; > +} > + > +/** > + * Get generic traffic manager operations structure from a port > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param error > + * Error details > + * > + * @return > + * The traffic manager operations structure associated with port_id on > + * success, NULL otherwise. > + */ > +const struct rte_tm_ops * > +rte_tm_ops_get(uint8_t port_id, struct rte_tm_error *error); > + > +#ifdef __cplusplus > +} > +#endif > + > +#endif /* __INCLUDE_RTE_TM_DRIVER_H__ */ >