DPDK patches and discussions
 help / color / mirror / Atom feed
From: Vipin Varghese <vipin.varghese@intel.com>
To: dev@dpdk.org, stephen@networkplumber.org,
	maryam.tahhan@intel.com, reshma.pattan@intel.com
Cc: amol.patel@intel.com, sivaprasad.tummala@intel.com,
	stephen1.byrne@intel.com, michael.j.glynn@intel.com,
	Vipin Varghese <vipin.varghese@intel.com>
Subject: [dpdk-dev] [PATCH v2 5/9] app/procinfo: add code for debug tm
Date: Wed, 24 Oct 2018 12:18:01 +0530	[thread overview]
Message-ID: <20181024064805.23197-5-vipin.varghese@intel.com> (raw)
In-Reply-To: <20181024064805.23197-1-vipin.varghese@intel.com>

Function debug_tm is used for displaying the tm PMD under the
primary process. This covers basic and per node|level details.

Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
---
 app/proc-info/main.c | 247 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 246 insertions(+), 1 deletion(-)

diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index 5c75764a1..f518935a2 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -32,6 +32,7 @@
 #include <rte_cycles.h>
 #include <rte_security.h>
 #include <rte_cryptodev.h>
+#include <rte_tm.h>
 
 /* Maximum long option length for option parsing. */
 #define MAX_LONG_OPT_SZ 64
@@ -748,7 +749,251 @@ debug_port(void)
 static void
 debug_tm(void)
 {
-	printf(" tm");
+	int ret = 0, is_leaf = 0;
+	unsigned int j, k;
+	uint16_t i = 0;
+
+	snprintf(bdr_str, 100, "debug - TM PMD %"PRIu64, rte_get_tsc_hz());
+	STATS_BDR_STR(10, bdr_str);
+
+	RTE_ETH_FOREACH_DEV(i) {
+		struct rte_eth_dev_info dev_info = {0};
+		struct rte_tm_capabilities cap = {0};
+		struct rte_tm_error error = {0};
+		struct rte_tm_node_capabilities	capnode = {0};
+		struct rte_tm_level_capabilities caplevel = {0};
+		uint32_t n_leaf_nodes = 0;
+
+		snprintf(bdr_str, 100, " TM for port (%u) ", i);
+		STATS_BDR_STR(5, bdr_str);
+
+		rte_eth_dev_info_get(i, &dev_info);
+		printf("  - Generic\n"
+		       "\t  -- driver name %s\n"
+		       "\t  -- max vf (%u)\n"
+		       "\t  -- max tx queues (%u)\n"
+		       "\t  -- number of tx queues (%u)\n",
+		       dev_info.driver_name,
+		       dev_info.max_vfs,
+		       dev_info.max_tx_queues,
+		       dev_info.nb_tx_queues);
+
+		ret = rte_tm_get_number_of_leaf_nodes(i, &n_leaf_nodes, &error);
+		if (ret == 0)
+			printf("  - leaf nodes (%u)\n", n_leaf_nodes);
+
+		ret = rte_tm_capabilities_get(i, &cap, &error);
+		if (ret)
+			continue;
+
+		printf("  - MAX:"
+		       " nodes (%u)"
+		       " levels (%u)"
+		       " children (%u)\n",
+		       cap.n_nodes_max,
+		       cap.n_levels_max,
+		       cap.sched_n_children_max);
+
+		printf("  - identical nodes:"
+		       "  non leaf (%d) leaf (%d)\n",
+		       cap.non_leaf_nodes_identical,
+		       cap.leaf_nodes_identical);
+
+		printf("  - Shaper MAX:\n"
+		       "\t  -- total (%u)\n"
+		       "\t  -- private (%u) private dual (%d)\n"
+		       "\t  -- shared (%u) shared dual (%u)\n",
+		       cap.shaper_n_max,
+		       cap.shaper_private_n_max,
+		       cap.shaper_private_dual_rate_n_max,
+		       cap.shaper_shared_n_max,
+		       cap.shaper_shared_dual_rate_n_max);
+
+		printf("  - mark support:\n");
+		printf("\t  -- vlan dei: GREEN (%d) YELLOW (%d) RED (%d)\n",
+		       cap.mark_vlan_dei_supported[RTE_TM_GREEN],
+		       cap.mark_vlan_dei_supported[RTE_TM_YELLOW],
+		       cap.mark_vlan_dei_supported[RTE_TM_RED]);
+		printf("\t  -- ip ecn tcp: GREEN (%d) YELLOW (%d) RED (%d)\n",
+		       cap.mark_ip_ecn_tcp_supported[RTE_TM_GREEN],
+		       cap.mark_ip_ecn_tcp_supported[RTE_TM_YELLOW],
+		       cap.mark_ip_ecn_tcp_supported[RTE_TM_RED]);
+		printf("\t  -- ip ecn sctp: GREEN (%d) YELLOW (%d) RED (%d)\n",
+		       cap.mark_ip_ecn_sctp_supported[RTE_TM_GREEN],
+		       cap.mark_ip_ecn_sctp_supported[RTE_TM_YELLOW],
+		       cap.mark_ip_ecn_sctp_supported[RTE_TM_RED]);
+		printf("\t  -- ip dscp: GREEN (%d) YELLOW (%d) RED (%d)\n",
+		       cap.mark_ip_dscp_supported[RTE_TM_GREEN],
+		       cap.mark_ip_dscp_supported[RTE_TM_YELLOW],
+		       cap.mark_ip_dscp_supported[RTE_TM_RED]);
+
+		printf("  - mask stats (0x%"PRIx64")"
+		       " dynamic update (0x%"PRIx64")\n",
+		       cap.stats_mask,
+		       cap.dynamic_update_mask);
+
+		printf("  - sched MAX:\n"
+		       "\t  -- total (%u)\n"
+		       "\t  -- sp levels (%u)\n"
+		       "\t  -- wfq children per group (%u)\n"
+		       "\t  -- wfq groups (%u)\n"
+		       "\t  -- wfq weight (%u)\n",
+		       cap.sched_sp_n_priorities_max,
+		       cap.sched_sp_n_priorities_max,
+		       cap.sched_wfq_n_children_per_group_max,
+		       cap.sched_wfq_n_groups_max,
+		       cap.sched_wfq_weight_max);
+
+		printf("  - CMAN support:\n"
+		       "\t  -- WRED mode: pkt (%d) byte (%d)\n"
+		       "\t  -- head drop (%d)\n",
+		       cap.cman_wred_packet_mode_supported,
+		       cap.cman_wred_byte_mode_supported,
+		       cap.cman_head_drop_supported);
+		printf("\t  -- MAX WRED CONTEXT:"
+		       " total (%u) private (%u) shared (%u)\n",
+		       cap.cman_wred_context_n_max,
+		       cap.cman_wred_context_private_n_max,
+		       cap.cman_wred_context_shared_n_max);
+
+		for (j = 0; j < cap.n_nodes_max; j++) {
+			ret = rte_tm_node_capabilities_get(i, j,
+				&capnode, &error);
+			if (ret)
+				continue;
+
+			printf("  NODE %u\n", j);
+			printf("\t  - shaper private: (%d) dual rate (%d)\n",
+			       capnode.shaper_private_supported,
+			       capnode.shaper_private_dual_rate_supported);
+			printf("\t  - shaper shared max: (%u)\n",
+			       capnode.shaper_shared_n_max);
+			printf("\t  - stats mask %"PRIx64"\n",
+			       capnode.stats_mask);
+
+			ret = rte_tm_node_type_get(i, j, &is_leaf, &error);
+			if (ret)
+				continue;
+
+			if (!is_leaf) {
+#define DSP_CAP_NODE_NON_LEAF(x) printf("\t  -- nonleaf sched max:" \
+" children (%u) sp priorities (%u) " \
+" wfq children per group (%u) wfq groups (%u) wfq weight (%u)\n", \
+x.sched_n_children_max, x.sched_sp_n_priorities_max, \
+x.sched_wfq_n_children_per_group_max, x.sched_wfq_n_groups_max, \
+x.sched_wfq_weight_max)
+				DSP_CAP_NODE_NON_LEAF(capnode.nonleaf);
+			} else {
+#define DSP_CAP_NODE_LEAF(x) printf("\t  -- leaf cman support:" \
+" wred pkt mode (%d) wred byte mode (%d) head drop (%d)" \
+" wred context private (%d) wred context shared (%u)\n", \
+x.cman_wred_packet_mode_supported, x.cman_wred_byte_mode_supported, \
+x.cman_head_drop_supported, x.cman_wred_context_private_supported, \
+x.cman_wred_context_shared_n_max)
+				DSP_CAP_NODE_LEAF(capnode.leaf);
+			}
+		}
+
+		for (j = 0; j < cap.n_levels_max; j++) {
+			ret = rte_tm_level_capabilities_get(i, j,
+				&caplevel, &error);
+			if (ret)
+				continue;
+
+			printf("  - Level %u\n", j);
+			printf("\t  -- node MAX: %u"
+			       " non leaf %u"
+			       " leaf %u\n",
+			       caplevel.n_nodes_max,
+			       caplevel.n_nodes_nonleaf_max,
+			       caplevel.n_nodes_leaf_max);
+			printf("\t  -- indetical:"
+			       " non leaf %u"
+			       " leaf %u\n",
+			       caplevel.non_leaf_nodes_identical,
+			       caplevel.leaf_nodes_identical);
+
+			for (k = 0; k < caplevel.n_nodes_max; k++) {
+				ret = rte_tm_node_type_get(i, k,
+					&is_leaf, &error);
+				if (ret)
+					continue;
+
+				if (!is_leaf) {
+#define DSP_CAP_LVL_NON_LEAF(x) do { \
+printf("\t  - shaper private:" \
+" (%d) dual rate (%d)\n", x.shaper_private_supported, \
+x.shaper_private_dual_rate_supported); \
+printf("\t  - shaper share: (%u)\n", \
+x.shaper_shared_n_max); \
+printf("\t  - non leaf sched MAX:" \
+" children (%u) sp (%u)" \
+" wfq children per group (%u)" \
+" wfq groups (%u) wfq weight (%u)\n", \
+x.sched_n_children_max, x.sched_sp_n_priorities_max, \
+x.sched_wfq_n_children_per_group_max, \
+x.sched_wfq_n_groups_max, x.sched_wfq_weight_max); \
+} while (0)
+					DSP_CAP_LVL_NON_LEAF(caplevel.nonleaf);
+				} else {
+#define DSP_CAP_LVL_LEAF(x) do { \
+printf("\t  - shaper private: (%d) dual rate (%d)\n", \
+x.shaper_private_supported, x.shaper_private_dual_rate_supported); \
+printf("\t - shaper share: (%u)\n", x.shaper_shared_n_max); \
+printf("  -- leaf cman support: wred pkt mode (%d)" \
+" wred byte mode (%d) head drop (%d)" \
+" wred context private (%d) wred context shared (%u)\n", \
+x.cman_wred_packet_mode_supported, x.cman_wred_byte_mode_supported, \
+x.cman_head_drop_supported, x.cman_wred_context_private_supported, \
+x.cman_wred_context_shared_n_max); \
+} while (0)
+
+					DSP_CAP_LVL_LEAF(caplevel.leaf);
+				}
+			}
+		}
+
+		for (j = 0; j < n_leaf_nodes; j++) {
+			struct rte_tm_node_stats stats = {0};
+
+			ret = rte_tm_node_stats_read(i, j,
+				&stats, &cap.stats_mask, 0, &error);
+			if (ret)
+				continue;
+
+			printf("  - STATS for node (%u)\n", j);
+			printf("  -- pkts (%"PRIu64") bytes (%"PRIu64")\n",
+				stats.n_pkts, stats.n_bytes);
+
+			ret = rte_tm_node_type_get(i, j, &is_leaf, &error);
+			if ((ret) | (!is_leaf))
+				continue;
+
+			printf("  -- leaf queued:"
+				" pkts (%"PRIu64")"
+				" bytes (%"PRIu64")\n",
+				stats.leaf.n_pkts_queued,
+				stats.leaf.n_bytes_queued);
+			printf("  - dropped:\n"
+			       "\t  -- GREEN:"
+			       " pkts (%"PRIu64")"
+			       " bytes (%"PRIu64")\n"
+			       "\t  -- YELLOW:"
+			       " pkts (%"PRIu64")"
+			       " bytes (%"PRIu64")\n"
+			       "\t  -- RED:"
+			       " pkts (%"PRIu64")"
+			       " bytes (%"PRIu64")\n",
+			       stats.leaf.n_pkts_dropped[RTE_TM_GREEN],
+			       stats.leaf.n_bytes_dropped[RTE_TM_GREEN],
+			       stats.leaf.n_pkts_dropped[RTE_TM_YELLOW],
+			       stats.leaf.n_bytes_dropped[RTE_TM_YELLOW],
+			       stats.leaf.n_pkts_dropped[RTE_TM_RED],
+			       stats.leaf.n_bytes_dropped[RTE_TM_RED]);
+		}
+	}
+
+	STATS_BDR_STR(50, "");
 }
 
 static void
-- 
2.17.1

  parent reply	other threads:[~2018-10-24  6:52 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-23 13:57 [dpdk-dev] [PATCH v1 1/9] app/procinfo: add usage for new debug Vipin Varghese
2018-10-23 13:57 ` [dpdk-dev] [PATCH v1 2/9] app/procinfo: add compare for new options Vipin Varghese
2018-10-25 15:18   ` Pattan, Reshma
2018-10-27  7:17     ` Varghese, Vipin
2018-10-23 13:57 ` [dpdk-dev] [PATCH v1 3/9] app/procinfo: add prototype for debug instances Vipin Varghese
2018-10-23 13:57 ` [dpdk-dev] [PATCH v1 4/9] app/procinfo: add code for debug port Vipin Varghese
2018-10-25 15:38   ` Pattan, Reshma
2018-10-27  7:09     ` Varghese, Vipin
2018-10-25 15:46   ` Pattan, Reshma
2018-10-27  4:47     ` Varghese, Vipin
2018-10-23 13:57 ` [dpdk-dev] [PATCH v1 5/9] app/procinfo: add code for debug tm Vipin Varghese
2018-10-23 13:57 ` [dpdk-dev] [PATCH v1 6/9] app/procinfo: add code for debug crypto Vipin Varghese
2018-10-23 13:57 ` [dpdk-dev] [PATCH v1 7/9] app/procinfo: add code for debug ring Vipin Varghese
2018-10-23 13:57 ` [dpdk-dev] [PATCH v1 8/9] app/procinfo: add code for debug mempool Vipin Varghese
2018-10-23 13:57 ` [dpdk-dev] [PATCH v1 9/9] doc/proc_info: add information for debug options Vipin Varghese
2018-10-23 15:19 ` [dpdk-dev] [PATCH v1 1/9] app/procinfo: add usage for new debug Stephen Hemminger
2018-10-24  5:41   ` Varghese, Vipin
2018-10-24 15:56     ` Stephen Hemminger
2018-10-24  6:47 ` [dpdk-dev] [PATCH v2 " Vipin Varghese
2018-10-24  6:47   ` [dpdk-dev] [PATCH v2 2/9] app/procinfo: add compare for new options Vipin Varghese
2018-10-24  6:47   ` [dpdk-dev] [PATCH v2 3/9] app/procinfo: add prototype for debug instances Vipin Varghese
2018-10-24  6:48   ` [dpdk-dev] [PATCH v2 4/9] app/procinfo: add code for debug port Vipin Varghese
2018-10-25 16:20     ` Pattan, Reshma
2018-10-27  4:45       ` Varghese, Vipin
2018-11-05 11:39         ` Thomas Monjalon
2018-11-05 15:31           ` Varghese, Vipin
2018-10-24  6:48   ` Vipin Varghese [this message]
2018-10-24  6:48   ` [dpdk-dev] [PATCH v2 6/9] app/procinfo: add code for debug crypto Vipin Varghese
2018-10-26 13:01     ` Pattan, Reshma
2018-10-27  4:42       ` Varghese, Vipin
2018-10-28 15:29         ` Stephen Hemminger
2018-10-29 14:29           ` Varghese, Vipin
2018-10-26 13:16     ` Pattan, Reshma
2018-10-27  4:37       ` Varghese, Vipin
2018-10-24  6:48   ` [dpdk-dev] [PATCH v2 7/9] app/procinfo: add code for debug ring Vipin Varghese
2018-10-24  6:48   ` [dpdk-dev] [PATCH v2 8/9] app/procinfo: add code for debug mempool Vipin Varghese
2018-10-24  6:48   ` [dpdk-dev] [PATCH v2 9/9] doc/procinfo: add information for debug options Vipin Varghese
2018-10-25 15:11     ` Varghese, Vipin
2018-11-05 17:51     ` [dpdk-dev] [PATCH v3 1/9] app/procinfo: add usage for new debug Vipin Varghese
2018-11-05 17:51       ` [dpdk-dev] [PATCH v3 2/9] app/procinfo: add compare for new options Vipin Varghese
2018-11-05 17:51       ` [dpdk-dev] [PATCH v3 3/9] app/procinfo: add prototype for debug instances Vipin Varghese
2018-11-05 17:51       ` [dpdk-dev] [PATCH v3 4/9] app/procinfo: add support for show port Vipin Varghese
2018-11-05 17:51       ` [dpdk-dev] [PATCH v3 5/9] app/procinfo: add support for show tm Vipin Varghese
2018-11-05 17:51       ` [dpdk-dev] [PATCH v3 6/9] app/procinfo: add support for show crypto Vipin Varghese
2018-11-05 18:08         ` [dpdk-dev] [PATCH " Vipin Varghese
2018-11-05 18:08         ` [dpdk-dev] [PATCH v3 " Varghese, Vipin
2018-11-05 18:17         ` [dpdk-dev] [PATCH " Vipin Varghese
2018-11-05 17:51       ` [dpdk-dev] [PATCH v3 7/9] app/procinfo: add support for debug ring Vipin Varghese
2018-11-05 17:51       ` [dpdk-dev] [PATCH v3 8/9] app/procinfo: add support for show mempool Vipin Varghese
2018-11-05 18:06         ` [dpdk-dev] [PATCH " Vipin Varghese
2018-11-05 18:09         ` [dpdk-dev] [PATCH v3 " Varghese, Vipin
2018-11-05 18:18         ` [dpdk-dev] [PATCH " Vipin Varghese
2018-11-05 18:22         ` Vipin Varghese
2018-11-06  2:24         ` [dpdk-dev] [PATCH v4 " Vipin Varghese
2018-11-06  2:25         ` Vipin Varghese
2018-11-06  2:31         ` [dpdk-dev] [PATCH v5 1/9] app/procinfo: add usage for new debug Vipin Varghese
2018-11-06  2:31           ` [dpdk-dev] [PATCH v5 2/9] app/procinfo: add compare for new options Vipin Varghese
2018-11-06  2:31           ` [dpdk-dev] [PATCH v5 3/9] app/procinfo: add prototype for debug instances Vipin Varghese
2018-11-06  2:31           ` [dpdk-dev] [PATCH v5 4/9] app/procinfo: add support for show port Vipin Varghese
2018-11-06  2:31           ` [dpdk-dev] [PATCH v5 5/9] app/procinfo: add support for show tm Vipin Varghese
2018-11-06  2:31           ` [dpdk-dev] [PATCH v5 6/9] app/procinfo: add support for show crypto Vipin Varghese
2018-11-06  2:31           ` [dpdk-dev] [PATCH v5 7/9] app/procinfo: add support for debug ring Vipin Varghese
2018-11-06  2:31           ` [dpdk-dev] [PATCH v5 8/9] app/procinfo: add support for show mempool Vipin Varghese
2018-11-06  2:31           ` [dpdk-dev] [PATCH v5 9/9] doc/procinfo: add information for debug options Vipin Varghese
2018-11-05 17:51       ` [dpdk-dev] [PATCH v3 " Vipin Varghese

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181024064805.23197-5-vipin.varghese@intel.com \
    --to=vipin.varghese@intel.com \
    --cc=amol.patel@intel.com \
    --cc=dev@dpdk.org \
    --cc=maryam.tahhan@intel.com \
    --cc=michael.j.glynn@intel.com \
    --cc=reshma.pattan@intel.com \
    --cc=sivaprasad.tummala@intel.com \
    --cc=stephen1.byrne@intel.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).