From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0E0ED41C40; Wed, 8 Feb 2023 14:34:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EB10F4014F; Wed, 8 Feb 2023 14:34:03 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 90C3640141 for ; Wed, 8 Feb 2023 14:34:01 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 318DUR3b009409; Wed, 8 Feb 2023 05:31:31 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=0aUE8IG4cNCm2DzXQSNaKQlbaJmYsSp5UH+ikK2NjeU=; b=DyOdgATUjz0jx+oKONZW6Ai6rzvhil4TqME+GdexXi4Yn1Nd7McSD+f5RP6PzDCV50zT 69kMjfL3ixZlfcYCLRqTGGGiuEu8fwm9uBRNqDY7zh0fXQxD0D6dG0TGOeVU7+DNfZh1 pfM8c4ZJ6Dh8royRwBqVv+R8+9xYNzkP3r3bOIuhxjxAmVAwDJavbzA1CzHGdW2khzxu AWCgc78P2zR0PJq1nQjN0ro0INN/ii2gbaritncewy23B3AE/YMnvRPAbH5a7qOjJq1E RVwVI3TG4B3hKYyEcnEF5/1SYmaf5FeDvlFjOlsDiw20pCgtcCJvzm4Uk/71XpmLRo4G 1A== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3nkdyrw57j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 08 Feb 2023 05:31:30 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 8 Feb 2023 05:31:29 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Wed, 8 Feb 2023 05:31:29 -0800 Received: from localhost.localdomain (unknown [10.28.36.185]) by maili.marvell.com (Postfix) with ESMTP id 77ADD3F7099; Wed, 8 Feb 2023 05:31:07 -0800 (PST) From: Ankur Dwivedi To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Ankur Dwivedi Subject: [PATCH v10 6/6] ethdev: add trace points for tm Date: Wed, 8 Feb 2023 18:58:24 +0530 Message-ID: <20230208132824.775985-7-adwivedi@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230208132824.775985-1-adwivedi@marvell.com> References: <20230207063254.401538-1-adwivedi@marvell.com> <20230208132824.775985-1-adwivedi@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: GPkKv9nBvo7bBGZBCO73bxCzoThLXCto X-Proofpoint-GUID: GPkKv9nBvo7bBGZBCO73bxCzoThLXCto X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-08_05,2023-02-08_02,2022-06-22_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Adds trace points for rte_tm specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi --- lib/ethdev/ethdev_trace.h | 304 +++++++++++++++++++++++++++++++ lib/ethdev/ethdev_trace_points.c | 90 +++++++++ lib/ethdev/rte_tm.c | 225 ++++++++++++++++++++--- 3 files changed, 590 insertions(+), 29 deletions(-) diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h index 973e2ac6d4..0b0a791aeb 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, @@ -1831,6 +1832,309 @@ 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_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_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(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(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_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_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_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 #include +#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