add support for querying ethdev TM nodes
cover add support for querying ethdev TM nodes
Add support for an ethdev TM query function to allow apps to get details of the TM nodes they previously configured. This patchset includes:
* ethdev changes to add the API
* implementation of the function in "ice" pmd
* testpmd command to allow testing the function
Bruce Richardson (3):
ethdev: add traffic manager query function net/ice: add traffic management node query function app/testpmd: add support for querying TM nodes
app/test-pmd/cmdline.c | 1 + app/test-pmd/cmdline_tm.c | 90 ++++++++++++++++++++++++++++++++ app/test-pmd/cmdline_tm.h | 1 + drivers/net/ice/ice_tm.c | 52 ++++++++++++++++++ lib/ethdev/ethdev_trace.h | 16 ++++++ lib/ethdev/ethdev_trace_points.c | 3 ++ lib/ethdev/rte_tm.c | 25 +++++++++ lib/ethdev/rte_tm.h | 50 ++++++++++++++++++ lib/ethdev/rte_tm_driver.h | 12 +++++ lib/ethdev/version.map | 3 ++ 10 files changed, 253 insertions(+)
--
2.43.0
PATCH 1/3 ethdev: add traffic manager query function
Add function to allow querying a node in the scheduler tree. Returns the parameters as were given to the add function. Adding this function allows apps to just query the hierarchy rather than having to maintain their own copies of it internally.
--- lib/ethdev/ethdev_trace.h | 16 ++++++++++ lib/ethdev/ethdev_trace_points.c | 3 ++ lib/ethdev/rte_tm.c | 25 ++++++++++++++++ lib/ethdev/rte_tm.h | 50 ++++++++++++++++++++++++++++++++ lib/ethdev/rte_tm_driver.h | 12 ++++++++ lib/ethdev/version.map | 3 ++ 6 files changed, 109 insertions(+)
lib/ethdev/ethdev_trace.h +16 -0
@@ -1903,6 +1903,22 @@ RTE_TRACE_POINT(rte_trace_point_emit_int (ret); ) +RTE_TRACE_POINT ( + rte_tm_trace_node_query, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + uint32_t *parent_node_id, uint32_t *priority, + uint32_t *weight, uint32_t *level_id, + struct rte_tm_node_params *params, int ret), + rte_trace_point_emit_u16(port_id); +rte_trace_point_emit_u32 (node_id); +rte_trace_point_emit_ptr (parent_node_id); +rte_trace_point_emit_ptr (priority); +rte_trace_point_emit_ptr (weight); +rte_trace_point_emit_ptr (level_id); +rte_trace_point_emit_ptr (params); +rte_trace_point_emit_int (ret); +) + RTE_TRACE_POINT( rte_tm_trace_node_delete, RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, int ret),
lib/ethdev/ethdev_trace_points.c +3 -0
@@ -694,6 +694,9 @@ RTE_TRACE_POINT_REGISTER(rte_tm_trace_mark_vlan_dei,RTE_TRACE_POINT_REGISTER (rte_tm_trace_node_add, lib.ethdev.tm.node_add) +RTE_TRACE_POINT_REGISTER (rte_tm_trace_node_query, + lib.ethdev.tm.node_query) +RTE_TRACE_POINT_REGISTER (rte_tm_trace_node_capabilities_get, lib.ethdev.tm.node_capabilities_get)
lib/ethdev/rte_tm.c +25 -0
@@ -301,6 +301,31 @@ int rte_tm_node_add(uint16_t port_id,return ret; } +int rte_tm_node_query (uint16_t port_id, +uint32_t node_id, +uint32_t *parent_node_id, +uint32_t *priority, +uint32_t *weight, +uint32_t *level_id, +struct rte_tm_node_params *params, +struct rte_tm_error *error) +{ +struct rte_eth_dev *dev = &rte_eth_devices[port_id]; +int ret; + +if (dev ==NULL ) +return -EINVAL ; + + ret =RTE_TM_FUNC (port_id, node_query)(dev, + node_id, parent_node_id, priority, weight, level_id, + params, error); + +rte_tm_trace_node_query (port_id, node_id, parent_node_id, priority, + weight, level_id, params, ret); + +return ret; +} +/* Delete node from traffic manager hierarchy */ int rte_tm_node_delete(uint16_t port_id, uint32_t node_id,
lib/ethdev/rte_tm.h +50 -0
62 lines not on this page · raw message
lib/ethdev/rte_tm_driver.h +12 -0
@@ -119,6 +119,16 @@ 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 query */ +typedef int (*rte_tm_node_query_t )(const struct rte_eth_dev *dev, +uint32_t node_id, +uint32_t *parent_node_id, +uint32_t *priority, +uint32_t *weight, +uint32_t *level_id, +struct rte_tm_node_params *params, +struct rte_tm_error *error); +/** @internal Traffic manager hierarchy commit */ typedef int (*rte_tm_hierarchy_commit_t)(struct rte_eth_dev *dev, int clear_on_fail,
@@ -248,6 +258,8 @@ struct rte_tm_ops {rte_tm_node_suspend_t node_suspend;/** Traffic manager node resume */ rte_tm_node_resume_t node_resume; +/** Traffic manager node resume */ +rte_tm_node_query_t node_query;/** Traffic manager hierarchy commit */ rte_tm_hierarchy_commit_t hierarchy_commit;
lib/ethdev/version.map +3 -0
@@ -325,6 +325,9 @@ EXPERIMENTAL { rte_flow_template_table_resizable; rte_flow_template_table_resize; rte_flow_template_table_resize_complete; + + # added in 24.11 + rte_tm_node_query; }; INTERNAL {
Signature · 1 line
2.43.0
PATCH 2/3 net/ice: add traffic management node query function
In reply to Bruce RichardsonImplement the new node querying function for the "ice" net driver.
--- drivers/net/ice/ice_tm.c | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+)
drivers/net/ice/ice_tm.c +52 -0
@@ -17,6 +17,11 @@ static int ice_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id, uint32_t weight, uint32_t level_id, const struct rte_tm_node_params *params, struct rte_tm_error *error); +static int ice_node_query (const struct rte_eth_dev *dev,uint32_t node_id, +uint32_t *parent_node_id,uint32_t *priority, +uint32_t *weight,uint32_t *level_id, +struct rte_tm_node_params *params, +struct rte_tm_error *error);static int ice_tm_node_delete (struct rte_eth_dev *dev,uint32_t node_id,struct rte_tm_error *error); static int ice_node_type_get(struct rte_eth_dev *dev, uint32_t node_id,
@@ -35,6 +40,7 @@ const struct rte_tm_ops ice_tm_ops = { .node_add = ice_tm_node_add, .node_delete = ice_tm_node_delete, .node_type_get = ice_node_type_get, + .node_query = ice_node_query, .hierarchy_commit = ice_hierarchy_commit, };
@@ -219,6 +225,52 @@ ice_node_type_get(struct rte_eth_dev *dev, uint32_t node_id,return 0 ; } +static int +ice_node_query (const struct rte_eth_dev *dev,uint32_t node_id, +uint32_t *parent_node_id,uint32_t *priority, +uint32_t *weight,uint32_t *level_id, +struct rte_tm_node_params *params, +struct rte_tm_error *error) +{ +struct ice_pf *pf =ICE_DEV_PRIVATE_TO_PF (dev->data->dev_private); +struct ice_tm_node *tm_node; + +if (node_id ==RTE_TM_NODE_ID_NULL ) { + error->type =RTE_TM_ERROR_TYPE_NODE_ID ; + error->message ="invalid node id" ; +return -EINVAL ; + } + +/* check if the node id exists */ + tm_node =find_node (pf->tm_conf.root, node_id); +if (!tm_node) { + error->type =RTE_TM_ERROR_TYPE_NODE_ID ; + error->message ="no such node" ; +return -EEXIST ; + } + +if (parent_node_id !=NULL ) { +if (tm_node->parent !=NULL ) + *parent_node_id = tm_node->parent->id; +else + *parent_node_id =RTE_TM_NODE_ID_NULL ; + } + +if (priority !=NULL ) + *priority = tm_node->priority; + +if (weight !=NULL ) + *weight = tm_node->weight; + +if (level_id !=NULL ) + *level_id = tm_node->level; + +if (params !=NULL ) + *params = tm_node->params; + +return 0 ; +} +static inline struct ice_tm_shaper_profile *ice_shaper_profile_search (struct rte_eth_dev *dev,uint32_t shaper_profile_id)
Signature · 1 line
2.43.0
PATCH 3/3 app/testpmd: add support for querying TM nodes
In reply to Bruce RichardsonSupport use of the rte_tm_node_query API to print out details about previously added TM nodes in testpmd.
Example output, configuring three nodes, and then printing the details:
testpmd> add port tm nonleaf node 0 100 -1 0 1 0 -1 1 0 0 testpmd> add port tm nonleaf node 0 90 100 0 1 1 -1 1 0 0
testpmd> add port tm leaf node 0 0 90 0 1 2 -1 0 0xffffffff 0 0
testpmd>
testpmd> show port tm node 0 100
Port 0 TM Node 100
Parent Node ID: <NULL>
Level ID: 0
Priority: 0
Weight: 0
Shaper Profile ID: <none>
Shared Shaper IDs: <none>
Stats Mask: 0
Nonleaf Node Parameters
Num Strict Priorities: 1
WFQ Weights Mode: WFQ
testpmd> show port tm node 0 90
Port 0 TM Node 90
Parent Node ID: 100
Level ID: 1
Priority: 0
Weight: 1
Shaper Profile ID: <none>
Shared Shaper IDs: <none>
Stats Mask: 0
Nonleaf Node Parameters
Num Strict Priorities: 1
WFQ Weights Mode: WFQ
testpmd> show port tm node 0 0
Port 0 TM Node 0
Parent Node ID: 90
Level ID: 2
Priority: 0
Weight: 1
Shaper Profile ID: <none>
Shared Shaper IDs: <none>
Stats Mask: 0
Leaf Node Parameters
CMAN Mode: Tail Drop
WRED Profile ID: <none>
Shared WRED Context Ids: <none>
--- app/test-pmd/cmdline.c | 1 + app/test-pmd/cmdline_tm.c | 131 ++++++++++++++++++++++++++++++++++++++ app/test-pmd/cmdline_tm.h | 1 + 3 files changed, 133 insertions(+)
app/test-pmd/cmdline.c +1 -0
@@ -13327,6 +13327,7 @@ static cmdline_parse_ctx_t builtin_ctx[] = { (cmdline_parse_inst_t *)&cmd_set_port_ptypes, (cmdline_parse_inst_t *)&cmd_show_port_tm_cap, (cmdline_parse_inst_t *)&cmd_show_port_tm_level_cap, + (cmdline_parse_inst_t *)&cmd_show_port_tm_node, (cmdline_parse_inst_t *)&cmd_show_port_tm_node_cap, (cmdline_parse_inst_t *)&cmd_show_port_tm_node_type, (cmdline_parse_inst_t *)&cmd_show_port_tm_node_stats,
app/test-pmd/cmdline_tm.c +131 -0
137 lines not on this page · raw message
app/test-pmd/cmdline_tm.h +1 -0
@@ -9,6 +9,7 @@extern cmdline_parse_inst_t cmd_show_port_tm_cap;extern cmdline_parse_inst_t cmd_show_port_tm_level_cap;extern cmdline_parse_inst_t cmd_show_port_tm_node_cap; +extern cmdline_parse_inst_t cmd_show_port_tm_node;extern cmdline_parse_inst_t cmd_show_port_tm_node_type;extern cmdline_parse_inst_t cmd_show_port_tm_node_stats;extern cmdline_parse_inst_t cmd_add_port_tm_node_shaper_profile;
Signature · 1 line
2.43.0
v2 cover add support for querying ethdev TM nodes
In reply to Bruce RichardsonAdd support for an ethdev TM query function to allow apps to get details of the TM nodes they previously configured. This patchset includes:
* ethdev changes to add the API
* implementation of the function in "ice" pmd
* testpmd command to allow testing the function
V2: rebase to the head of next-net tree
Bruce Richardson (3):
ethdev: add traffic manager query function net/ice: add traffic management node query function app/testpmd: add support for querying TM nodes
app/test-pmd/cmdline.c | 1 + app/test-pmd/cmdline_tm.c | 131 +++++++++++++++++++++++++++++++ app/test-pmd/cmdline_tm.h | 1 + drivers/net/ice/ice_tm.c | 52 ++++++++++++ lib/ethdev/ethdev_trace.h | 16 ++++ lib/ethdev/ethdev_trace_points.c | 3 + lib/ethdev/rte_tm.c | 25 ++++++ lib/ethdev/rte_tm.h | 50 ++++++++++++ lib/ethdev/rte_tm_driver.h | 12 +++ lib/ethdev/version.map | 1 + 10 files changed, 292 insertions(+)
--
2.43.0
PATCH v2 1/3 ethdev: add traffic manager query function
Add function to allow querying a node in the scheduler tree. Returns the parameters as were given to the add function. Adding this function allows apps to just query the hierarchy rather than having to maintain their own copies of it internally.
--- lib/ethdev/ethdev_trace.h | 16 ++++++++++ lib/ethdev/ethdev_trace_points.c | 3 ++ lib/ethdev/rte_tm.c | 25 ++++++++++++++++ lib/ethdev/rte_tm.h | 50 ++++++++++++++++++++++++++++++++ lib/ethdev/rte_tm_driver.h | 12 ++++++++ lib/ethdev/version.map | 1 + 6 files changed, 107 insertions(+)
lib/ethdev/ethdev_trace.h +16 -0
@@ -1905,6 +1905,22 @@ RTE_TRACE_POINT(rte_trace_point_emit_int (ret); ) +RTE_TRACE_POINT ( + rte_tm_trace_node_query, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + uint32_t *parent_node_id, uint32_t *priority, + uint32_t *weight, uint32_t *level_id, + struct rte_tm_node_params *params, int ret), + rte_trace_point_emit_u16(port_id); +rte_trace_point_emit_u32 (node_id); +rte_trace_point_emit_ptr (parent_node_id); +rte_trace_point_emit_ptr (priority); +rte_trace_point_emit_ptr (weight); +rte_trace_point_emit_ptr (level_id); +rte_trace_point_emit_ptr (params); +rte_trace_point_emit_int (ret); +) + RTE_TRACE_POINT( rte_tm_trace_node_delete, RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, int ret),
lib/ethdev/ethdev_trace_points.c +3 -0
@@ -706,6 +706,9 @@ RTE_TRACE_POINT_REGISTER(rte_tm_trace_mark_vlan_dei,RTE_TRACE_POINT_REGISTER (rte_tm_trace_node_add, lib.ethdev.tm.node_add) +RTE_TRACE_POINT_REGISTER (rte_tm_trace_node_query, + lib.ethdev.tm.node_query) +RTE_TRACE_POINT_REGISTER (rte_tm_trace_node_capabilities_get, lib.ethdev.tm.node_capabilities_get)
lib/ethdev/rte_tm.c +25 -0
@@ -301,6 +301,31 @@ int rte_tm_node_add(uint16_t port_id,return ret; } +int rte_tm_node_query (uint16_t port_id, +uint32_t node_id, +uint32_t *parent_node_id, +uint32_t *priority, +uint32_t *weight, +uint32_t *level_id, +struct rte_tm_node_params *params, +struct rte_tm_error *error) +{ +struct rte_eth_dev *dev = &rte_eth_devices[port_id]; +int ret; + +if (dev ==NULL ) +return -EINVAL ; + + ret =RTE_TM_FUNC (port_id, node_query)(dev, + node_id, parent_node_id, priority, weight, level_id, + params, error); + +rte_tm_trace_node_query (port_id, node_id, parent_node_id, priority, + weight, level_id, params, ret); + +return ret; +} +/* Delete node from traffic manager hierarchy */ int rte_tm_node_delete(uint16_t port_id, uint32_t node_id,
lib/ethdev/rte_tm.h +50 -0
62 lines not on this page · raw message
lib/ethdev/rte_tm_driver.h +12 -0
@@ -119,6 +119,16 @@ 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 query */ +typedef int (*rte_tm_node_query_t )(const struct rte_eth_dev *dev, +uint32_t node_id, +uint32_t *parent_node_id, +uint32_t *priority, +uint32_t *weight, +uint32_t *level_id, +struct rte_tm_node_params *params, +struct rte_tm_error *error); +/** @internal Traffic manager hierarchy commit */ typedef int (*rte_tm_hierarchy_commit_t)(struct rte_eth_dev *dev, int clear_on_fail,
@@ -248,6 +258,8 @@ struct rte_tm_ops {rte_tm_node_suspend_t node_suspend;/** Traffic manager node resume */ rte_tm_node_resume_t node_resume; +/** Traffic manager node resume */ +rte_tm_node_query_t node_query;/** Traffic manager hierarchy commit */ rte_tm_hierarchy_commit_t hierarchy_commit;
lib/ethdev/version.map +1 -0
@@ -335,6 +335,7 @@ EXPERIMENTAL { rte_eth_speed_lanes_get_capability; rte_eth_speed_lanes_set; rte_flow_async_create_by_index_with_pattern; + rte_tm_node_query; }; INTERNAL {
Signature · 1 line
2.43.0
Re: [PATCH v2 1/3] ethdev: add traffic manager query function
Quoted 68 lines · Bruce Richardson
Add function to allow querying a node in the scheduler tree. Returns the parameters as were given to the add function. Adding this function allows apps to just query the hierarchy rather than having to maintain their own copies of it internally.
Signed-off-by Bruce Richardson <[email protected]>--- lib/ethdev/ethdev_trace.h | 16 ++++++++++ lib/ethdev/ethdev_trace_points.c | 3 ++ lib/ethdev/rte_tm.c | 25 ++++++++++++++++ lib/ethdev/rte_tm.h | 50 ++++++++++++++++++++++++++++++++ lib/ethdev/rte_tm_driver.h | 12 ++++++++ lib/ethdev/version.map | 1 + 6 files changed, 107 insertions(+)lib/ethdev/ethdev_trace.h +16
-0@@ -1905,6 +1905,22 @@ RTE_TRACE_POINT(rte_trace_point_emit_int (ret); ) +RTE_TRACE_POINT ( + rte_tm_trace_node_query, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + uint32_t *parent_node_id, uint32_t *priority, + uint32_t *weight, uint32_t *level_id, + struct rte_tm_node_params *params, int ret), + rte_trace_point_emit_u16(port_id); +rte_trace_point_emit_u32 (node_id); +rte_trace_point_emit_ptr (parent_node_id); +rte_trace_point_emit_ptr (priority); +rte_trace_point_emit_ptr (weight); +rte_trace_point_emit_ptr (level_id); +rte_trace_point_emit_ptr (params); +rte_trace_point_emit_int (ret); +) + RTE_TRACE_POINT( rte_tm_trace_node_delete, RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, int ret),lib/ethdev/ethdev_trace_points.c +3
-0@@ -706,6 +706,9 @@ RTE_TRACE_POINT_REGISTER(rte_tm_trace_mark_vlan_dei,RTE_TRACE_POINT_REGISTER (rte_tm_trace_node_add, lib.ethdev.tm.node_add) +RTE_TRACE_POINT_REGISTER (rte_tm_trace_node_query, + lib.ethdev.tm.node_query) +RTE_TRACE_POINT_REGISTER (rte_tm_trace_node_capabilities_get, lib.ethdev.tm.node_capabilities_get)lib/ethdev/rte_tm.c +4
-0@@ -301,6 +301,31 @@ int rte_tm_node_add(uint16_t port_id,return ret; } +int rte_tm_node_query(uint16_t port_id, + uint32_t node_id, + uint32_t *parent_node_id, + uint32_t *priority,
lib/ethdev/rte_tm.c int rte_tm_node_add(uint16_t port_id, · line 317
Quoted 10 lines
lib/ethdev/rte_tm.c +10
-0+uint32_t *weight, + uint32_t *level_id, + struct rte_tm_node_params *params, + struct rte_tm_error *error) +{ + struct rte_eth_dev *dev = &rte_eth_devices[port_id]; +int ret; + +if (dev ==NULL ) +return -EINVAL ;
The RTE_TM_FUNC will check it, so no need do above judgement.
Quoted 53 lines
lib/ethdev/rte_tm.c +11
-0+ + ret =RTE_TM_FUNC (port_id, node_query)(dev, + node_id, parent_node_id, priority, weight, level_id, + params, error); + +rte_tm_trace_node_query (port_id, node_id, parent_node_id, priority, + weight, level_id, params, ret); + +return ret; +} +/* Delete node from traffic manager hierarchy */ int rte_tm_node_delete(uint16_t port_id, uint32_t node_id,lib/ethdev/rte_tm.h +24
-0@@ -20,6 +20,7 @@#include <rte_common.h> #include <rte_meter.h> +#include <rte_compat.h> #ifdef __cplusplusextern "C" {@@ -1599,6 +1600,55 @@ rte_tm_node_add(uint16_t port_id,struct rte_tm_node_params *params, struct rte_tm_error *error); +/** +* Return information about a traffic management node +* +* Return information about a hierarchy node, using the same format of parameters +* as was passed to the rte_rm_node_add() function. +* Each of the "out" parameters pointers (except error) may be passed as NULL if the +* information is not needed by the caller. For example, to one may check if a node id +* is in use by: +* +* struct rte_tm_error error; +* int ret = rte_tm_node_query(port, node_id, NULL, NULL, NULL, NULL, NULL, &error); +* if (ret == ENOENT) ... +* +* @param[in] port_id +* The port identifier of the Ethernet device. +* @param[in] node_id +* Node ID. Should be a valid node id. +* @param[out] parent_node_id +* Parent node ID. +* @param[out] 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[out] weight
lib/ethdev/rte_tm.h rte_tm_node_add(uint16_t port_id, · line 1635
Quoted 10 lines
lib/ethdev/rte_tm.h +10
-0+* 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 +* algorithm running on the parent of the current node for scheduling this +* child node. +* @param[out] level_id +* The node level in the scheduler hierarchy. +* @param[out] params +* Node parameters, as would be used when creating the node. +* @param[out] error +* Error details. Filled in only on error, when not NULL.
This parameter should not be NULL, as said before:
Each of the "out" parameters pointers (except error) may be passed as NULL if the
lib/ethdev/rte_tm.h rte_tm_node_add(uint16_t port_id, · line 1639
Quoted 4 lines
lib/ethdev/rte_tm.h +4
-0+* @return +* 0 on success, non-zero error code otherwise. +* -EINVAL - port or node id value is invalid +* -ENOENT - no node exists with the provided id
id -> port
no node exists with the provided port
lib/ethdev/rte_tm.h rte_tm_node_add(uint16_t port_id, · line 1651
Quoted 12 lines
lib/ethdev/rte_tm.h +12
-0+*/ +__rte_experimental +int +rte_tm_node_query (uint16_t port_id, +uint32_t node_id, +uint32_t *parent_node_id, +uint32_t *priority, +uint32_t *weight, +uint32_t *level_id, +struct rte_tm_node_params *params, +struct rte_tm_error *error); +
Suggest this new function place after node_resume in header/impl.c(e.g. source or trace), keep them consisteny
Quoted 25 lines
lib/ethdev/rte_tm.h +0
-0/** * Traffic manager node delete * lib/ethdev/rte_tm_driver.h +10
-0@@ -119,6 +119,16 @@ 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 query */ +typedef int (*rte_tm_node_query_t )(const struct rte_eth_dev *dev, +uint32_t node_id, +uint32_t *parent_node_id, +uint32_t *priority, +uint32_t *weight, +uint32_t *level_id, +struct rte_tm_node_params *params, +struct rte_tm_error *error); +/** @internal Traffic manager hierarchy commit */ typedef int (*rte_tm_hierarchy_commit_t)(struct rte_eth_dev *dev, int clear_on_fail,
lib/ethdev/rte_tm_driver.h struct rte_tm_ops { · line 261
Quoted 4 lines
lib/ethdev/rte_tm_driver.h +1
-0@@ -248,6 +258,8 @@ struct rte_tm_ops {rte_tm_node_suspend_t node_suspend;/** Traffic manager node resume */ rte_tm_node_resume_t node_resume; +/** Traffic manager node resume */
Should be node query
Quoted 16 lines
lib/ethdev/rte_tm_driver.h +1
-0+rte_tm_node_query_t node_query;/** Traffic manager hierarchy commit */ rte_tm_hierarchy_commit_t hierarchy_commit;lib/ethdev/version.map +1
-0@@ -335,6 +335,7 @@ EXPERIMENTAL { rte_eth_speed_lanes_get_capability; rte_eth_speed_lanes_set; rte_flow_async_create_by_index_with_pattern; + rte_tm_node_query; }; INTERNAL {
Re: [PATCH v2 1/3] ethdev: add traffic manager query function
Quoted 8 lines · fengchengwen
Quoted 7 lines · Bruce Richardson
Add function to allow querying a node in the scheduler tree. Returns the parameters as were given to the add function. Adding this function allows apps to just query the hierarchy rather than having to maintain their own copies of it internally.
Signed-off-by Bruce Richardson <[email protected]>---
Hi,
thanks for the detailed review. Most comments are fine and will fix. One reply below for just one of them though.
/Bruce
<snip>
Quoted 6 lines
Quoted 6 lines
+ */
lib/ethdev/rte_tm.h +5
-0+__rte_experimental +int +rte_tm_node_query(uint16_t port_id, + uint32_t node_id, + uint32_t *parent_node_id,
Quoted 8 lines
lib/ethdev/rte_tm.h rte_tm_node_add(uint16_t port_id, · line 1651
Quoted 6 lines
lib/ethdev/rte_tm.h +6
-0+uint32_t *priority, + uint32_t *weight, + uint32_t *level_id, + struct rte_tm_node_params *params, + struct rte_tm_error *error); +Suggest this new function place after
node_resumein header/impl.c(e.g. source or trace), keep them consistency
Why do you think it should go after node resume? I deliberately placed it after node_add function since the parameters are matching each other, whatever parameters you provided on add, you get returned to you on query.
Re: [PATCH v2 1/3] ethdev: add traffic manager query function
Quoted 33 lines · Bruce Richardson
Quoted 8 lines · fengchengwen
Quoted 7 lines · Bruce Richardson
Add function to allow querying a node in the scheduler tree. Returns the parameters as were given to the add function. Adding this function allows apps to just query the hierarchy rather than having to maintain their own copies of it internally.
Signed-off-by Bruce Richardson <[email protected]>---
Hi,
thanks for the detailed review. Most comments are fine and will fix. One reply below for just one of them though.
/Bruce
<snip>
Quoted 6 lines
Quoted 6 lines
+ */
lib/ethdev/rte_tm.h +5
-0+__rte_experimental +int +rte_tm_node_query(uint16_t port_id, + uint32_t node_id, + uint32_t *parent_node_id,Quoted 8 lines
lib/ethdev/rte_tm.h rte_tm_node_add(uint16_t port_id, · line 1651
Quoted 6 lines
lib/ethdev/rte_tm.h +6
-0+uint32_t *priority, + uint32_t *weight, + uint32_t *level_id, + struct rte_tm_node_params *params, + struct rte_tm_error *error); +Suggest this new function place after
node_resumein header/impl.c(e.g. source or trace), keep them consistency
Quoted 3 lines
Why do you think it should go after node resume? I deliberately placed it after
node_addfunction since the parameters are matching each other, whatever parameters you provided on add, you get returned to you on query.
To one object, we may have four basic operation: add/del/modify/query, I always keep this order in .c/.h file. As for the tm node case, we could treat node_suspend/node_resume as the modify operation.
It is just a personal coding style. From my point of view, it's fine in that order.
Quoted 2 lines
PATCH v2 2/3 net/ice: add traffic management node query function
In reply to Bruce RichardsonImplement the new node querying function for the "ice" net driver.
--- drivers/net/ice/ice_tm.c | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+)
drivers/net/ice/ice_tm.c +52 -0
@@ -17,6 +17,11 @@ static int ice_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id, uint32_t weight, uint32_t level_id, struct rte_tm_node_params *params, struct rte_tm_error *error); +static int ice_node_query (const struct rte_eth_dev *dev,uint32_t node_id, +uint32_t *parent_node_id,uint32_t *priority, +uint32_t *weight,uint32_t *level_id, +struct rte_tm_node_params *params, +struct rte_tm_error *error);static int ice_tm_node_delete (struct rte_eth_dev *dev,uint32_t node_id,struct rte_tm_error *error); static int ice_node_type_get(struct rte_eth_dev *dev, uint32_t node_id,
@@ -35,6 +40,7 @@ const struct rte_tm_ops ice_tm_ops = { .node_add = ice_tm_node_add, .node_delete = ice_tm_node_delete, .node_type_get = ice_node_type_get, + .node_query = ice_node_query, .hierarchy_commit = ice_hierarchy_commit, };
@@ -219,6 +225,52 @@ ice_node_type_get(struct rte_eth_dev *dev, uint32_t node_id,return 0 ; } +static int +ice_node_query (const struct rte_eth_dev *dev,uint32_t node_id, +uint32_t *parent_node_id,uint32_t *priority, +uint32_t *weight,uint32_t *level_id, +struct rte_tm_node_params *params, +struct rte_tm_error *error) +{ +struct ice_pf *pf =ICE_DEV_PRIVATE_TO_PF (dev->data->dev_private); +struct ice_tm_node *tm_node; + +if (node_id ==RTE_TM_NODE_ID_NULL ) { + error->type =RTE_TM_ERROR_TYPE_NODE_ID ; + error->message ="invalid node id" ; +return -EINVAL ; + } + +/* check if the node id exists */ + tm_node =find_node (pf->tm_conf.root, node_id); +if (!tm_node) { + error->type =RTE_TM_ERROR_TYPE_NODE_ID ; + error->message ="no such node" ; +return -EEXIST ; + } + +if (parent_node_id !=NULL ) { +if (tm_node->parent !=NULL ) + *parent_node_id = tm_node->parent->id; +else + *parent_node_id =RTE_TM_NODE_ID_NULL ; + } + +if (priority !=NULL ) + *priority = tm_node->priority; + +if (weight !=NULL ) + *weight = tm_node->weight; + +if (level_id !=NULL ) + *level_id = tm_node->level; + +if (params !=NULL ) + *params = tm_node->params; + +return 0 ; +} +static inline struct ice_tm_shaper_profile *ice_shaper_profile_search (struct rte_eth_dev *dev,uint32_t shaper_profile_id)
Signature · 1 line
2.43.0
PATCH v2 3/3 app/testpmd: add support for querying TM nodes
In reply to Bruce RichardsonSupport use of the rte_tm_node_query API to print out details about previously added TM nodes in testpmd.
Example output, configuring three nodes, and then printing the details:
testpmd> add port tm nonleaf node 0 100 -1 0 1 0 -1 1 0 0 testpmd> add port tm nonleaf node 0 90 100 0 1 1 -1 1 0 0
testpmd> add port tm leaf node 0 0 90 0 1 2 -1 0 0xffffffff 0 0
testpmd>
testpmd> show port tm node 0 100
Port 0 TM Node 100
Parent Node ID: <NULL>
Level ID: 0
Priority: 0
Weight: 0
Shaper Profile ID: <none>
Shared Shaper IDs: <none>
Stats Mask: 0
Nonleaf Node Parameters
Num Strict Priorities: 1
WFQ Weights Mode: WFQ
testpmd> show port tm node 0 90
Port 0 TM Node 90
Parent Node ID: 100
Level ID: 1
Priority: 0
Weight: 1
Shaper Profile ID: <none>
Shared Shaper IDs: <none>
Stats Mask: 0
Nonleaf Node Parameters
Num Strict Priorities: 1
WFQ Weights Mode: WFQ
testpmd> show port tm node 0 0
Port 0 TM Node 0
Parent Node ID: 90
Level ID: 2
Priority: 0
Weight: 1
Shaper Profile ID: <none>
Shared Shaper IDs: <none>
Stats Mask: 0
Leaf Node Parameters
CMAN Mode: Tail Drop
WRED Profile ID: <none>
Shared WRED Context Ids: <none>
--- app/test-pmd/cmdline.c | 1 + app/test-pmd/cmdline_tm.c | 131 ++++++++++++++++++++++++++++++++++++++ app/test-pmd/cmdline_tm.h | 1 + 3 files changed, 133 insertions(+)
app/test-pmd/cmdline.c +1 -0
@@ -13573,6 +13573,7 @@ static cmdline_parse_ctx_t builtin_ctx[] = { &cmd_set_port_ptypes, &cmd_show_port_tm_cap, &cmd_show_port_tm_level_cap, + &cmd_show_port_tm_node, &cmd_show_port_tm_node_cap, &cmd_show_port_tm_node_type, &cmd_show_port_tm_node_stats,
app/test-pmd/cmdline_tm.c +131 -0
137 lines not on this page · raw message
app/test-pmd/cmdline_tm.h +1 -0
@@ -9,6 +9,7 @@extern cmdline_parse_inst_t cmd_show_port_tm_cap;extern cmdline_parse_inst_t cmd_show_port_tm_level_cap;extern cmdline_parse_inst_t cmd_show_port_tm_node_cap; +extern cmdline_parse_inst_t cmd_show_port_tm_node;extern cmdline_parse_inst_t cmd_show_port_tm_node_type;extern cmdline_parse_inst_t cmd_show_port_tm_node_stats;extern cmdline_parse_inst_t cmd_add_port_tm_node_shaper_profile;
Signature · 1 line
2.43.0
Re: [PATCH v2 3/3] app/testpmd: add support for querying TM nodes
Please update the testpmd doc, with that added,
Quoted 54 lines · Bruce Richardson
Support use of the
rte_tm_node_queryAPI to print out details about previously added TM nodes in testpmd.Example output, configuring three nodes, and then printing the details:
testpmd> add port tm nonleaf node 0 100 -1 0 1 0 -1 1 0 0 testpmd> add port tm nonleaf node 0 90 100 0 1 1 -1 1 0 0
testpmd> add port tm leaf node 0 0 90 0 1 2 -1 00xffffffff0 0
testpmd>
testpmd> show port tm node 0 100
Port 0 TM Node 100
Parent Node ID: <NULL>
Level ID: 0
Priority: 0
Weight: 0
Shaper Profile ID: <none>
Shared Shaper IDs: <none>
Stats Mask: 0
Nonleaf Node Parameters
Num Strict Priorities: 1
WFQ Weights Mode: WFQ
testpmd> show port tm node 0 90
Port 0 TM Node 90
Parent Node ID: 100
Level ID: 1
Priority: 0
Weight: 1
Shaper Profile ID: <none>
Shared Shaper IDs: <none>
Stats Mask: 0
Nonleaf Node Parameters
Num Strict Priorities: 1
WFQ Weights Mode: WFQ
testpmd> show port tm node 0 0
Port 0 TM Node 0
Parent Node ID: 90
Level ID: 2
Priority: 0
Weight: 1
Shaper Profile ID: <none>
Shared Shaper IDs: <none>
Stats Mask: 0
Leaf Node Parameters
CMAN Mode: Tail Drop
WRED Profile ID: <none>
Shared WRED Context Ids: <none>Signed-off-by Bruce Richardson <[email protected]>--- app/test-pmd/cmdline.c | 1 + app/test-pmd/cmdline_tm.c | 131 ++++++++++++++++++++++++++++++++++++++ app/test-pmd/cmdline_tm.h | 1 + 3 files changed, 133 insertions(+)
...
Re: [PATCH v2 3/3] app/testpmd: add support for querying TM nodes
Quoted 3 lines · fengchengwen
Please update the testpmd doc, with that added,
Acked-by Chengwen Feng <[email protected]>
Thanks. Doc added to V3 patchset.
/Bruce
v3 cover add support for querying ethdev TM nodes
In reply to Bruce RichardsonAdd support for an ethdev TM query function to allow apps to get details of the TM nodes they previously configured. This patchset includes:
* ethdev changes to add the API
* implementation of the function in "ice" pmd
* testpmd command to allow testing the function
v3: updated comments and removed null check on patch 1.
Added doc to patch 3.
V2: rebase to the head of next-net tree
Bruce Richardson (3):
ethdev: add traffic manager query function net/ice: add traffic management node query function app/testpmd: add support for querying TM nodes
app/test-pmd/cmdline.c | 1 + app/test-pmd/cmdline_tm.c | 131 ++++++++++++++++++++ app/test-pmd/cmdline_tm.h | 1 + doc/guides/testpmd_app_ug/testpmd_funcs.rst | 27 ++++ drivers/net/ice/ice_tm.c | 52 ++++++++ lib/ethdev/ethdev_trace.h | 16 +++ lib/ethdev/ethdev_trace_points.c | 3 + lib/ethdev/rte_tm.c | 22 ++++ lib/ethdev/rte_tm.h | 50 ++++++++ lib/ethdev/rte_tm_driver.h | 12 ++ lib/ethdev/version.map | 1 + 11 files changed, 316 insertions(+)
--
2.43.0
PATCH v3 1/3 ethdev: add traffic manager query function
Add function to allow querying a node in the scheduler tree. Returns the parameters as were given to the add function. Adding this function allows apps to just query the hierarchy rather than having to maintain their own copies of it internally.
---
v2: address feedback
* dropped unnecessary NULL check
* corrected comments
--- lib/ethdev/ethdev_trace.h | 16 ++++++++++ lib/ethdev/ethdev_trace_points.c | 3 ++ lib/ethdev/rte_tm.c | 22 ++++++++++++++ lib/ethdev/rte_tm.h | 50 ++++++++++++++++++++++++++++++++ lib/ethdev/rte_tm_driver.h | 12 ++++++++ lib/ethdev/version.map | 1 + 6 files changed, 104 insertions(+)
lib/ethdev/ethdev_trace.h +16 -0
@@ -1905,6 +1905,22 @@ RTE_TRACE_POINT(rte_trace_point_emit_int (ret); ) +RTE_TRACE_POINT ( + rte_tm_trace_node_query, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + uint32_t *parent_node_id, uint32_t *priority, + uint32_t *weight, uint32_t *level_id, + struct rte_tm_node_params *params, int ret), + rte_trace_point_emit_u16(port_id); +rte_trace_point_emit_u32 (node_id); +rte_trace_point_emit_ptr (parent_node_id); +rte_trace_point_emit_ptr (priority); +rte_trace_point_emit_ptr (weight); +rte_trace_point_emit_ptr (level_id); +rte_trace_point_emit_ptr (params); +rte_trace_point_emit_int (ret); +) + RTE_TRACE_POINT( rte_tm_trace_node_delete, RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, int ret),
lib/ethdev/ethdev_trace_points.c +3 -0
@@ -706,6 +706,9 @@ RTE_TRACE_POINT_REGISTER(rte_tm_trace_mark_vlan_dei,RTE_TRACE_POINT_REGISTER (rte_tm_trace_node_add, lib.ethdev.tm.node_add) +RTE_TRACE_POINT_REGISTER (rte_tm_trace_node_query, + lib.ethdev.tm.node_query) +RTE_TRACE_POINT_REGISTER (rte_tm_trace_node_capabilities_get, lib.ethdev.tm.node_capabilities_get)
lib/ethdev/rte_tm.c +22 -0
@@ -301,6 +301,28 @@ int rte_tm_node_add(uint16_t port_id,return ret; } +int rte_tm_node_query (uint16_t port_id, +uint32_t node_id, +uint32_t *parent_node_id, +uint32_t *priority, +uint32_t *weight, +uint32_t *level_id, +struct rte_tm_node_params *params, +struct rte_tm_error *error) +{ +struct rte_eth_dev *dev = &rte_eth_devices[port_id]; +int ret; + + ret =RTE_TM_FUNC (port_id, node_query)(dev, + node_id, parent_node_id, priority, weight, level_id, + params, error); + +rte_tm_trace_node_query (port_id, node_id, parent_node_id, priority, + weight, level_id, params, ret); + +return ret; +} +/* Delete node from traffic manager hierarchy */ int rte_tm_node_delete(uint16_t port_id, uint32_t node_id,
lib/ethdev/rte_tm.h +50 -0
62 lines not on this page · raw message
lib/ethdev/rte_tm_driver.h +12 -0
@@ -119,6 +119,16 @@ 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 query */ +typedef int (*rte_tm_node_query_t )(const struct rte_eth_dev *dev, +uint32_t node_id, +uint32_t *parent_node_id, +uint32_t *priority, +uint32_t *weight, +uint32_t *level_id, +struct rte_tm_node_params *params, +struct rte_tm_error *error); +/** @internal Traffic manager hierarchy commit */ typedef int (*rte_tm_hierarchy_commit_t)(struct rte_eth_dev *dev, int clear_on_fail,
@@ -248,6 +258,8 @@ struct rte_tm_ops {rte_tm_node_suspend_t node_suspend;/** Traffic manager node resume */ rte_tm_node_resume_t node_resume; +/** Traffic manager node query */ +rte_tm_node_query_t node_query;/** Traffic manager hierarchy commit */ rte_tm_hierarchy_commit_t hierarchy_commit;
lib/ethdev/version.map +1 -0
@@ -335,6 +335,7 @@ EXPERIMENTAL { rte_eth_speed_lanes_get_capability; rte_eth_speed_lanes_set; rte_flow_async_create_by_index_with_pattern; + rte_tm_node_query; }; INTERNAL {
Signature · 1 line
2.43.0
Re: [PATCH v3 1/3] ethdev: add traffic manager query function
Quoted 7 lines · Bruce Richardson
Add function to allow querying a node in the scheduler tree. Returns the parameters as were given to the add function. Adding this function allows apps to just query the hierarchy rather than having to maintain their own copies of it internally.
Signed-off-by Bruce Richardson <[email protected]>
+Cristian, TM API maintainer.
Re: [PATCH v3 1/3] ethdev: add traffic manager query function
In reply to Bruce RichardsonQuoted 7 lines · Bruce Richardson
Add function to allow querying a node in the scheduler tree. Returns the parameters as were given to the add function. Adding this function allows apps to just query the hierarchy rather than having to maintain their own copies of it internally.
Signed-off-by Bruce Richardson <[email protected]>
PATCH v3 2/3 net/ice: add traffic management node query function
In reply to Bruce RichardsonImplement the new node querying function for the "ice" net driver.
--- drivers/net/ice/ice_tm.c | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+)
drivers/net/ice/ice_tm.c +52 -0
@@ -17,6 +17,11 @@ static int ice_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id, uint32_t weight, uint32_t level_id, struct rte_tm_node_params *params, struct rte_tm_error *error); +static int ice_node_query (const struct rte_eth_dev *dev,uint32_t node_id, +uint32_t *parent_node_id,uint32_t *priority, +uint32_t *weight,uint32_t *level_id, +struct rte_tm_node_params *params, +struct rte_tm_error *error);static int ice_tm_node_delete (struct rte_eth_dev *dev,uint32_t node_id,struct rte_tm_error *error); static int ice_node_type_get(struct rte_eth_dev *dev, uint32_t node_id,
@@ -35,6 +40,7 @@ const struct rte_tm_ops ice_tm_ops = { .node_add = ice_tm_node_add, .node_delete = ice_tm_node_delete, .node_type_get = ice_node_type_get, + .node_query = ice_node_query, .hierarchy_commit = ice_hierarchy_commit, };
@@ -219,6 +225,52 @@ ice_node_type_get(struct rte_eth_dev *dev, uint32_t node_id,return 0 ; } +static int +ice_node_query (const struct rte_eth_dev *dev,uint32_t node_id, +uint32_t *parent_node_id,uint32_t *priority, +uint32_t *weight,uint32_t *level_id, +struct rte_tm_node_params *params, +struct rte_tm_error *error) +{ +struct ice_pf *pf =ICE_DEV_PRIVATE_TO_PF (dev->data->dev_private); +struct ice_tm_node *tm_node; + +if (node_id ==RTE_TM_NODE_ID_NULL ) { + error->type =RTE_TM_ERROR_TYPE_NODE_ID ; + error->message ="invalid node id" ; +return -EINVAL ; + } + +/* check if the node id exists */ + tm_node =find_node (pf->tm_conf.root, node_id); +if (!tm_node) { + error->type =RTE_TM_ERROR_TYPE_NODE_ID ; + error->message ="no such node" ; +return -EEXIST ; + } + +if (parent_node_id !=NULL ) { +if (tm_node->parent !=NULL ) + *parent_node_id = tm_node->parent->id; +else + *parent_node_id =RTE_TM_NODE_ID_NULL ; + } + +if (priority !=NULL ) + *priority = tm_node->priority; + +if (weight !=NULL ) + *weight = tm_node->weight; + +if (level_id !=NULL ) + *level_id = tm_node->level; + +if (params !=NULL ) + *params = tm_node->params; + +return 0 ; +} +static inline struct ice_tm_shaper_profile *ice_shaper_profile_search (struct rte_eth_dev *dev,uint32_t shaper_profile_id)
Signature · 1 line
2.43.0
PATCH v3 3/3 app/testpmd: add support for querying TM nodes
In reply to Bruce RichardsonSupport use of the rte_tm_node_query API to print out details about previously added TM nodes in testpmd.
Example output, configuring three nodes, and then printing the details:
testpmd> add port tm nonleaf node 0 100 -1 0 1 0 -1 1 0 0 testpmd> add port tm nonleaf node 0 90 100 0 1 1 -1 1 0 0
testpmd> add port tm leaf node 0 0 90 0 1 2 -1 0 0xffffffff 0 0
testpmd>
testpmd> show port tm node 0 100
Port 0 TM Node 100
Parent Node ID: <NULL>
Level ID: 0
Priority: 0
Weight: 0
Shaper Profile ID: <none>
Shared Shaper IDs: <none>
Stats Mask: 0
Nonleaf Node Parameters
Num Strict Priorities: 1
WFQ Weights Mode: WFQ
testpmd> show port tm node 0 90
Port 0 TM Node 90
Parent Node ID: 100
Level ID: 1
Priority: 0
Weight: 1
Shaper Profile ID: <none>
Shared Shaper IDs: <none>
Stats Mask: 0
Nonleaf Node Parameters
Num Strict Priorities: 1
WFQ Weights Mode: WFQ
testpmd> show port tm node 0 0
Port 0 TM Node 0
Parent Node ID: 90
Level ID: 2
Priority: 0
Weight: 1
Shaper Profile ID: <none>
Shared Shaper IDs: <none>
Stats Mask: 0
Leaf Node Parameters
CMAN Mode: Tail Drop
WRED Profile ID: <none>
Shared WRED Context Ids: <none>
---
v2: added new command to testpmd documentation
--- app/test-pmd/cmdline.c | 1 + app/test-pmd/cmdline_tm.c | 131 ++++++++++++++++++++ app/test-pmd/cmdline_tm.h | 1 + doc/guides/testpmd_app_ug/testpmd_funcs.rst | 27 ++++ 4 files changed, 160 insertions(+)
app/test-pmd/cmdline.c +1 -0
@@ -13573,6 +13573,7 @@ static cmdline_parse_ctx_t builtin_ctx[] = { &cmd_set_port_ptypes, &cmd_show_port_tm_cap, &cmd_show_port_tm_level_cap, + &cmd_show_port_tm_node, &cmd_show_port_tm_node_cap, &cmd_show_port_tm_node_type, &cmd_show_port_tm_node_stats,
app/test-pmd/cmdline_tm.c +131 -0
137 lines not on this page · raw message
app/test-pmd/cmdline_tm.h +1 -0
@@ -9,6 +9,7 @@extern cmdline_parse_inst_t cmd_show_port_tm_cap;extern cmdline_parse_inst_t cmd_show_port_tm_level_cap;extern cmdline_parse_inst_t cmd_show_port_tm_node_cap; +extern cmdline_parse_inst_t cmd_show_port_tm_node;extern cmdline_parse_inst_t cmd_show_port_tm_node_type;extern cmdline_parse_inst_t cmd_show_port_tm_node_stats;extern cmdline_parse_inst_t cmd_add_port_tm_node_shaper_profile;
doc/guides/testpmd_app_ug/testpmd_funcs.rst +27 -0
@@ -2790,6 +2790,33 @@ where: * ``n_shared_shapers``: Number of shared shapers. * ``shared_shaper_id``: Shared shaper id. +Query port traffic management hierarchy node +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +An added traffic management hierarchy node, whether leaf of non-leaf, +can be queried using:: + + testpmd> show port tm node (port_id) (node_id) + +where ``port_id`` and ``node_id`` are the numeric identifiers of the ethernet port +and the previously added traffic management node, respectively. +The output of this command are the parameters previously provided to the add call, +printed with appropriate labels. +For example:: + + testpmd> show port tm node 0 90 + Port 0 TM Node 90 + Parent Node ID: 100 + Level ID: 1 + Priority: 0 + Weight: 1 + Shaper Profile ID: <none> + Shared Shaper IDs: <none> + Stats Mask: 0 + Nonleaf Node Parameters + Num Strict Priorities: 1 + WFQ Weights Mode: WFQ + Delete port traffic management hierarchy node ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signature · 1 line
2.43.0
Quoted 12 lines · Bruce Richardson
Add support for an ethdev TM query function to allow apps to get details of the TM nodes they previously configured. This patchset includes:
* ethdev changes to add the API
* implementation of the function in "ice" pmd
* testpmd command to allow testing the functionv3: updated comments and removed null check on patch 1.
Added doc to patch 3.
V2: rebase to the head of next-net tree
Quoted 5 lines
Bruce Richardson (3):
ethdev: add traffic manager query function net/ice: add traffic management node query function app/testpmd: add support for querying TM nodes
Series applied to dpdk-next-net/main, thanks.