Adds trace points for rte_tm specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwiv...@marvell.com> --- lib/ethdev/ethdev_trace_points.c | 90 +++++++++++ lib/ethdev/rte_ethdev_trace.h | 141 ++++++++++++++++++ lib/ethdev/rte_ethdev_trace_fp.h | 171 +++++++++++++++++++++ lib/ethdev/rte_tm.c | 247 +++++++++++++++++++++++++++---- lib/ethdev/version.map | 30 ++++ 5 files changed, 650 insertions(+), 29 deletions(-)
diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 067e5fdab4..af66a139df 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -654,3 +654,93 @@ RTE_TRACE_POINT_REGISTER(rte_mtr_trace_color_in_protocol_priority_get, RTE_TRACE_POINT_REGISTER(rte_mtr_trace_color_in_protocol_set, lib.ethdev.mtr.color_in_protocol_set) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_capabilities_get, + lib.ethdev.tm.capabilities_get) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_get_number_of_leaf_nodes, + lib.ethdev.tm.get_number_of_leaf_nodes) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_hierarchy_commit, + lib.ethdev.tm.hierarchy_commit) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_level_capabilities_get, + lib.ethdev.tm.level_capabilities_get) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_mark_ip_dscp, + lib.ethdev.tm.mark_ip_dscp) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_mark_ip_ecn, + lib.ethdev.tm.mark_ip_ecn) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_mark_vlan_dei, + lib.ethdev.tm.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_capabilities_get, + lib.ethdev.tm.node_capabilities_get) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_cman_update, + lib.ethdev.tm.node_cman_update) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_delete, + lib.ethdev.tm.node_delete) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_parent_update, + lib.ethdev.tm.node_parent_update) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_resume, + lib.ethdev.tm.node_resume) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_shaper_update, + lib.ethdev.tm.node_shaper_update) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_shared_shaper_update, + lib.ethdev.tm.node_shared_shaper_update) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_shared_wred_context_update, + lib.ethdev.tm.node_shared_wred_context_update) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_stats_read, + lib.ethdev.tm.node_stats_read) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_stats_update, + lib.ethdev.tm.node_stats_update) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_suspend, + lib.ethdev.tm.node_suspend) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_type_get, + lib.ethdev.tm.node_type_get) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_wfq_weight_mode_update, + lib.ethdev.tm.node_wfq_weight_mode_update) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_wred_context_update, + lib.ethdev.tm.node_wred_context_update) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_shaper_profile_add, + lib.ethdev.tm.shaper_profile_add) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_shaper_profile_delete, + lib.ethdev.tm.shaper_profile_delete) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_shared_shaper_add_update, + lib.ethdev.tm.shared_shaper_add_update) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_shared_shaper_delete, + lib.ethdev.tm.shared_shaper_delete) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_shared_wred_context_add_update, + lib.ethdev.tm.shared_wred_context_add_update) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_shared_wred_context_delete, + lib.ethdev.tm.shared_wred_context_delete) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_wred_profile_add, + lib.ethdev.tm.wred_profile_add) + +RTE_TRACE_POINT_REGISTER(rte_tm_trace_wred_profile_delete, + lib.ethdev.tm.wred_profile_delete) diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index 2a0516e10d..694ab0c731 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -19,6 +19,7 @@ extern "C" { #include "rte_ethdev.h" #include "rte_mtr.h" +#include "rte_tm.h" RTE_TRACE_POINT( rte_ethdev_trace_configure, @@ -1397,6 +1398,146 @@ RTE_TRACE_POINT( rte_trace_point_emit_int(ret); ) +RTE_TRACE_POINT( + rte_tm_trace_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_tm_capabilities *cap, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(cap); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_tm_trace_hierarchy_commit, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int clear_on_fail, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(clear_on_fail); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_tm_trace_level_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t level_id, + struct rte_tm_level_capabilities *cap, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(level_id); + rte_trace_point_emit_ptr(cap); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_tm_trace_node_add, + 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_u32(parent_node_id); + rte_trace_point_emit_u32(priority); + rte_trace_point_emit_u32(weight); + rte_trace_point_emit_u32(level_id); + rte_trace_point_emit_ptr(params); + rte_trace_point_emit_u32(params->shaper_profile_id); + rte_trace_point_emit_u32(params->n_shared_shapers); + rte_trace_point_emit_u64(params->stats_mask); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_tm_trace_node_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + struct rte_tm_node_capabilities *cap, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_ptr(cap); + 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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_tm_trace_node_resume, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_tm_trace_node_suspend, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_tm_trace_shaper_profile_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shaper_profile_id, + struct rte_tm_shaper_params *profile, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(shaper_profile_id); + rte_trace_point_emit_ptr(profile); + rte_trace_point_emit_u64(profile->committed.rate); + rte_trace_point_emit_u64(profile->committed.size); + rte_trace_point_emit_u64(profile->peak.rate); + rte_trace_point_emit_u64(profile->peak.size); + rte_trace_point_emit_i32(profile->pkt_length_adjust); + rte_trace_point_emit_int(profile->packet_mode); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_tm_trace_shaper_profile_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shaper_profile_id, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(shaper_profile_id); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_tm_trace_shared_shaper_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shared_shaper_id, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(shared_shaper_id); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_tm_trace_shared_wred_context_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shared_wred_context_id, + int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(shared_wred_context_id); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_tm_trace_wred_profile_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t wred_profile_id, + struct rte_tm_wred_params *profile, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(wred_profile_id); + rte_trace_point_emit_ptr(profile); + rte_trace_point_emit_int(profile->packet_mode); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_tm_trace_wred_profile_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t wred_profile_id, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(wred_profile_id); + rte_trace_point_emit_int(ret); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_ethdev_trace_fp.h b/lib/ethdev/rte_ethdev_trace_fp.h index a57a4d1dbf..f1cba5cedf 100644 --- a/lib/ethdev/rte_ethdev_trace_fp.h +++ b/lib/ethdev/rte_ethdev_trace_fp.h @@ -19,6 +19,7 @@ extern "C" { #include "rte_ethdev.h" #include "rte_mtr.h" +#include "rte_tm.h" RTE_TRACE_POINT_FP( rte_eth_trace_call_rx_callbacks, @@ -859,6 +860,176 @@ RTE_TRACE_POINT_FP( rte_trace_point_emit_int(ret); ) +RTE_TRACE_POINT_FP( + rte_tm_trace_get_number_of_leaf_nodes, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t n_leaf_nodes), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(n_leaf_nodes); +) + +RTE_TRACE_POINT_FP( + rte_tm_trace_node_type_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + int *is_leaf, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_ptr(is_leaf); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_tm_trace_shared_wred_context_add_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shared_wred_context_id, + uint32_t wred_profile_id, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(shared_wred_context_id); + rte_trace_point_emit_u32(wred_profile_id); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_tm_trace_shared_shaper_add_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shared_shaper_id, + uint32_t shaper_profile_id, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(shared_shaper_id); + rte_trace_point_emit_u32(shaper_profile_id); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_tm_trace_node_parent_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + uint32_t parent_node_id, uint32_t priority, + uint32_t weight, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_u32(parent_node_id); + rte_trace_point_emit_u32(priority); + rte_trace_point_emit_u32(weight); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_tm_trace_node_shaper_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + uint32_t shaper_profile_id, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_u32(shaper_profile_id); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_tm_trace_node_shared_shaper_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + uint32_t shared_shaper_id, int add, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_u32(shared_shaper_id); + rte_trace_point_emit_int(add); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_tm_trace_node_shared_wred_context_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + uint32_t shared_wred_context_id, int add, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_u32(shared_wred_context_id); + rte_trace_point_emit_int(add); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_tm_trace_node_stats_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + uint64_t stats_mask, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_u64(stats_mask); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_tm_trace_node_wfq_weight_mode_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + int *wfq_weight_mode, uint32_t n_sp_priorities, + int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_ptr(wfq_weight_mode); + rte_trace_point_emit_u32(n_sp_priorities); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_tm_trace_node_wred_context_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + uint32_t wred_profile_id, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_u32(wred_profile_id); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_tm_trace_node_cman_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + enum rte_tm_cman_mode cman, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_int(cman); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_tm_trace_node_stats_read, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + struct rte_tm_node_stats *stats, + uint64_t *stats_mask, int clear, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_ptr(stats); + rte_trace_point_emit_ptr(stats_mask); + rte_trace_point_emit_int(clear); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_tm_trace_mark_vlan_dei, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int mark_green, + int mark_yellow, int mark_red, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(mark_green); + rte_trace_point_emit_int(mark_yellow); + rte_trace_point_emit_int(mark_red); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_tm_trace_mark_ip_ecn, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int mark_green, + int mark_yellow, int mark_red, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(mark_green); + rte_trace_point_emit_int(mark_yellow); + rte_trace_point_emit_int(mark_red); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_tm_trace_mark_ip_dscp, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int mark_green, + int mark_yellow, int mark_red, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(mark_green); + rte_trace_point_emit_int(mark_yellow); + rte_trace_point_emit_int(mark_red); + rte_trace_point_emit_int(ret); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_tm.c b/lib/ethdev/rte_tm.c index 9709454f35..eb4c8f103f 100644 --- a/lib/ethdev/rte_tm.c +++ b/lib/ethdev/rte_tm.c @@ -6,6 +6,8 @@ #include <rte_errno.h> #include "rte_ethdev.h" +#include "rte_ethdev_trace.h" +#include "rte_ethdev_trace_fp.h" #include "rte_tm_driver.h" #include "rte_tm.h" @@ -79,6 +81,9 @@ rte_tm_get_number_of_leaf_nodes(uint16_t port_id, } *n_leaf_nodes = dev->data->nb_tx_queues; + + rte_tm_trace_get_number_of_leaf_nodes(port_id, *n_leaf_nodes); + return 0; } @@ -90,8 +95,14 @@ rte_tm_node_type_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_type_get)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_type_get)(dev, node_id, is_leaf, error); + + rte_tm_trace_node_type_get(port_id, node_id, is_leaf, ret); + + return ret; } /* Get capabilities */ @@ -100,8 +111,14 @@ int rte_tm_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, capabilities_get)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, capabilities_get)(dev, cap, error); + + rte_tm_trace_capabilities_get(port_id, cap, ret); + + return ret; } /* Get level capabilities */ @@ -111,8 +128,14 @@ int rte_tm_level_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, level_capabilities_get)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, level_capabilities_get)(dev, level_id, cap, error); + + rte_tm_trace_level_capabilities_get(port_id, level_id, cap, ret); + + return ret; } /* Get node capabilities */ @@ -122,8 +145,14 @@ int rte_tm_node_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_capabilities_get)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_capabilities_get)(dev, node_id, cap, error); + + rte_tm_trace_node_capabilities_get(port_id, node_id, cap, ret); + + return ret; } /* Add WRED profile */ @@ -133,8 +162,14 @@ int rte_tm_wred_profile_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, wred_profile_add)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, wred_profile_add)(dev, wred_profile_id, profile, error); + + rte_tm_trace_wred_profile_add(port_id, wred_profile_id, profile, ret); + + return ret; } /* Delete WRED profile */ @@ -143,8 +178,14 @@ int rte_tm_wred_profile_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, wred_profile_delete)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, wred_profile_delete)(dev, wred_profile_id, error); + + rte_tm_trace_wred_profile_delete(port_id, wred_profile_id, ret); + + return ret; } /* Add/update shared WRED context */ @@ -154,8 +195,15 @@ int rte_tm_shared_wred_context_add_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_wred_context_add_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, shared_wred_context_add_update)(dev, shared_wred_context_id, wred_profile_id, error); + + rte_tm_trace_shared_wred_context_add_update(port_id, shared_wred_context_id, + wred_profile_id, ret); + + return ret; } /* Delete shared WRED context */ @@ -164,8 +212,14 @@ int rte_tm_shared_wred_context_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_wred_context_delete)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, shared_wred_context_delete)(dev, shared_wred_context_id, error); + + rte_tm_trace_shared_wred_context_delete(port_id, shared_wred_context_id, ret); + + return ret; } /* Add shaper profile */ @@ -175,8 +229,14 @@ int rte_tm_shaper_profile_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shaper_profile_add)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, shaper_profile_add)(dev, shaper_profile_id, profile, error); + + rte_tm_trace_shaper_profile_add(port_id, shaper_profile_id, profile, ret); + + return ret; } /* Delete WRED profile */ @@ -185,8 +245,14 @@ int rte_tm_shaper_profile_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shaper_profile_delete)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, shaper_profile_delete)(dev, shaper_profile_id, error); + + rte_tm_trace_shaper_profile_delete(port_id, shaper_profile_id, ret); + + return ret; } /* Add shared shaper */ @@ -196,8 +262,15 @@ int rte_tm_shared_shaper_add_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_shaper_add_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, shared_shaper_add_update)(dev, shared_shaper_id, shaper_profile_id, error); + + rte_tm_trace_shared_shaper_add_update(port_id, shared_shaper_id, + shaper_profile_id, ret); + + return ret; } /* Delete shared shaper */ @@ -206,8 +279,14 @@ int rte_tm_shared_shaper_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_shaper_delete)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, shared_shaper_delete)(dev, shared_shaper_id, error); + + rte_tm_trace_shared_shaper_delete(port_id, shared_shaper_id, ret); + + return ret; } /* Add node to port traffic manager hierarchy */ @@ -221,9 +300,16 @@ int rte_tm_node_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_add)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_add)(dev, node_id, parent_node_id, priority, weight, level_id, params, error); + + rte_tm_trace_node_add(port_id, node_id, parent_node_id, priority, + weight, level_id, params, ret); + + return ret; } /* Delete node from traffic manager hierarchy */ @@ -232,8 +318,14 @@ int rte_tm_node_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_delete)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_delete)(dev, node_id, error); + + rte_tm_trace_node_delete(port_id, node_id, ret); + + return ret; } /* Suspend node */ @@ -242,8 +334,14 @@ int rte_tm_node_suspend(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_suspend)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_suspend)(dev, node_id, error); + + rte_tm_trace_node_suspend(port_id, node_id, ret); + + return ret; } /* Resume node */ @@ -252,8 +350,14 @@ int rte_tm_node_resume(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_resume)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_resume)(dev, node_id, error); + + rte_tm_trace_node_resume(port_id, node_id, ret); + + return ret; } /* Commit the initial port traffic manager hierarchy */ @@ -262,8 +366,14 @@ int rte_tm_hierarchy_commit(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, hierarchy_commit)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, hierarchy_commit)(dev, clear_on_fail, error); + + rte_tm_trace_hierarchy_commit(port_id, clear_on_fail, ret); + + return ret; } /* Update node parent */ @@ -275,8 +385,15 @@ int rte_tm_node_parent_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_parent_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_parent_update)(dev, node_id, parent_node_id, priority, weight, error); + + rte_tm_trace_node_parent_update(port_id, node_id, parent_node_id, + priority, weight, ret); + + return ret; } /* Update node private shaper */ @@ -286,8 +403,14 @@ int rte_tm_node_shaper_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_shaper_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_shaper_update)(dev, node_id, shaper_profile_id, error); + + rte_tm_trace_node_shaper_update(port_id, node_id, shaper_profile_id, ret); + + return ret; } /* Update node shared shapers */ @@ -298,8 +421,15 @@ int rte_tm_node_shared_shaper_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_shared_shaper_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_shared_shaper_update)(dev, node_id, shared_shaper_id, add, error); + + rte_tm_trace_node_shared_shaper_update(port_id, node_id, shared_shaper_id, + add, ret); + + return ret; } /* Update node stats */ @@ -309,8 +439,14 @@ int rte_tm_node_stats_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_stats_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_stats_update)(dev, node_id, stats_mask, error); + + rte_tm_trace_node_stats_update(port_id, node_id, stats_mask, ret); + + return ret; } /* Update WFQ weight mode */ @@ -321,8 +457,15 @@ int rte_tm_node_wfq_weight_mode_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_wfq_weight_mode_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_wfq_weight_mode_update)(dev, node_id, wfq_weight_mode, n_sp_priorities, error); + + rte_tm_trace_node_wfq_weight_mode_update(port_id, node_id, wfq_weight_mode, + n_sp_priorities, ret); + + return ret; } /* Update node congestion management mode */ @@ -332,8 +475,14 @@ int rte_tm_node_cman_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_cman_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_cman_update)(dev, node_id, cman, error); + + rte_tm_trace_node_cman_update(port_id, node_id, cman, ret); + + return ret; } /* Update node private WRED context */ @@ -343,8 +492,15 @@ int rte_tm_node_wred_context_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_wred_context_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_wred_context_update)(dev, node_id, wred_profile_id, error); + + rte_tm_trace_node_wred_context_update(port_id, node_id, wred_profile_id, + ret); + + return ret; } /* Update node shared WRED context */ @@ -355,8 +511,16 @@ int rte_tm_node_shared_wred_context_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_shared_wred_context_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_shared_wred_context_update)(dev, node_id, shared_wred_context_id, add, error); + + rte_tm_trace_node_shared_wred_context_update(port_id, node_id, + shared_wred_context_id, + add, ret); + + return ret; } /* Read and/or clear stats counters for specific node */ @@ -368,8 +532,15 @@ int rte_tm_node_stats_read(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_stats_read)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_stats_read)(dev, node_id, stats, stats_mask, clear, error); + + rte_tm_trace_node_stats_read(port_id, node_id, stats, stats_mask, + clear, ret); + + return ret; } /* Packet marking - VLAN DEI */ @@ -380,8 +551,14 @@ int rte_tm_mark_vlan_dei(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, mark_vlan_dei)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, mark_vlan_dei)(dev, mark_green, mark_yellow, mark_red, error); + + rte_tm_trace_mark_vlan_dei(port_id, mark_green, mark_yellow, mark_red, ret); + + return ret; } /* Packet marking - IPv4/IPv6 ECN */ @@ -392,8 +569,14 @@ int rte_tm_mark_ip_ecn(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, mark_ip_ecn)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, mark_ip_ecn)(dev, mark_green, mark_yellow, mark_red, error); + + rte_tm_trace_mark_ip_ecn(port_id, mark_green, mark_yellow, mark_red, ret); + + return ret; } /* Packet marking - IPv4/IPv6 DSCP */ @@ -404,6 +587,12 @@ int rte_tm_mark_ip_dscp(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, mark_ip_dscp)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, mark_ip_dscp)(dev, mark_green, mark_yellow, mark_red, error); + + rte_tm_trace_mark_ip_dscp(port_id, mark_green, mark_yellow, mark_red, ret); + + return ret; } diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index c1a6e4d30a..112b2b1039 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -503,6 +503,36 @@ EXPERIMENTAL { __rte_mtr_trace_meter_vlan_table_update; __rte_mtr_trace_stats_read; __rte_mtr_trace_stats_update; + __rte_tm_trace_capabilities_get; + __rte_tm_trace_get_number_of_leaf_nodes; + __rte_tm_trace_hierarchy_commit; + __rte_tm_trace_level_capabilities_get; + __rte_tm_trace_mark_ip_dscp; + __rte_tm_trace_mark_ip_ecn; + __rte_tm_trace_mark_vlan_dei; + __rte_tm_trace_node_add; + __rte_tm_trace_node_capabilities_get; + __rte_tm_trace_node_cman_update; + __rte_tm_trace_node_delete; + __rte_tm_trace_node_parent_update; + __rte_tm_trace_node_resume; + __rte_tm_trace_node_shaper_update; + __rte_tm_trace_node_shared_shaper_update; + __rte_tm_trace_node_shared_wred_context_update; + __rte_tm_trace_node_stats_read; + __rte_tm_trace_node_stats_update; + __rte_tm_trace_node_suspend; + __rte_tm_trace_node_type_get; + __rte_tm_trace_node_wfq_weight_mode_update; + __rte_tm_trace_node_wred_context_update; + __rte_tm_trace_shaper_profile_add; + __rte_tm_trace_shaper_profile_delete; + __rte_tm_trace_shared_shaper_add_update; + __rte_tm_trace_shared_shaper_delete; + __rte_tm_trace_shared_wred_context_add_update; + __rte_tm_trace_shared_wred_context_delete; + __rte_tm_trace_wred_profile_add; + __rte_tm_trace_wred_profile_delete; }; INTERNAL { -- 2.25.1