Adds trace points for rte_tm specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwiv...@marvell.com> --- lib/ethdev/ethdev_trace.h | 332 +++++++++++++++++++++++++++++++ lib/ethdev/ethdev_trace_points.c | 90 +++++++++ lib/ethdev/rte_tm.c | 225 ++++++++++++++++++--- 3 files changed, 618 insertions(+), 29 deletions(-)
diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h index 5285a04c67..ffad9fd872 100644 --- a/lib/ethdev/ethdev_trace.h +++ b/lib/ethdev/ethdev_trace.h @@ -20,6 +20,7 @@ extern "C" { #include "rte_ethdev.h" #include "rte_mtr.h" +#include "rte_tm.h" RTE_TRACE_POINT( rte_ethdev_trace_configure, @@ -1859,6 +1860,337 @@ RTE_TRACE_POINT( rte_trace_point_emit_int(ret); ) +RTE_TRACE_POINT( + 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( + 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_int(is_leaf); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_tm_trace_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + const struct rte_tm_capabilities *cap, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(cap); + rte_trace_point_emit_u32(cap->n_nodes_max); + rte_trace_point_emit_u32(cap->n_levels_max); + rte_trace_point_emit_int(cap->non_leaf_nodes_identical); + rte_trace_point_emit_int(cap->leaf_nodes_identical); + rte_trace_point_emit_u32(cap->shaper_n_max); + 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, + const 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_u32(cap->n_nodes_max); + rte_trace_point_emit_u32(cap->n_nodes_nonleaf_max); + rte_trace_point_emit_u32(cap->n_nodes_leaf_max); + rte_trace_point_emit_u32(cap->non_leaf_nodes_identical); + rte_trace_point_emit_u32(cap->leaf_nodes_identical); + 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, + const 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(cap->shaper_private_supported); + rte_trace_point_emit_int(cap->shaper_private_dual_rate_supported); + rte_trace_point_emit_int(cap->shaper_private_packet_mode_supported); + rte_trace_point_emit_int(cap->shaper_private_byte_mode_supported); + rte_trace_point_emit_u32(cap->shaper_shared_n_max); + rte_trace_point_emit_u64(cap->stats_mask); + 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, + const 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); +) + +RTE_TRACE_POINT( + 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( + 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_shaper_profile_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shaper_profile_id, + const 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_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( + 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_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, + const 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_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_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_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_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_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( + 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( + 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( + 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( + rte_tm_trace_node_wfq_weight_mode_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + const 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( + 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( + 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( + 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( + rte_tm_trace_node_stats_read, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + const 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_u64(stats->n_pkts); + rte_trace_point_emit_u64(stats->n_bytes); + rte_trace_point_emit_u64(stats_mask); + rte_trace_point_emit_int(clear); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + 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( + 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( + 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); +) + /* Fast path trace points */ /* Called in loop in examples/qos_sched and examples/distributor */ diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index c34c06941c..34d12e2859 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_tm.c b/lib/ethdev/rte_tm.c index 9709454f35..2d08141133 100644 --- a/lib/ethdev/rte_tm.c +++ b/lib/ethdev/rte_tm.c @@ -5,6 +5,7 @@ #include <stdint.h> #include <rte_errno.h> +#include "ethdev_trace.h" #include "rte_ethdev.h" #include "rte_tm_driver.h" #include "rte_tm.h" @@ -79,6 +80,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 +94,13 @@ 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 +109,13 @@ 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 +125,13 @@ 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 +141,13 @@ 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 +157,13 @@ 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 +172,13 @@ 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 +188,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 +205,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 +222,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 +238,13 @@ 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 +254,14 @@ 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 +270,13 @@ 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 +290,15 @@ 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 +307,13 @@ 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 +322,13 @@ 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 +337,13 @@ 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 +352,13 @@ 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 +370,14 @@ 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 +387,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 +405,14 @@ 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 +422,13 @@ 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 +439,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 +457,13 @@ 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 +473,14 @@ 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 +491,15 @@ 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 +511,14 @@ 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 +529,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 +547,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 +565,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; } -- 2.25.1