DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jingjing Wu <jingjing.wu@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v2 09/10] app/testpmd: add command to display DCB info
Date: Thu, 29 Oct 2015 16:53:46 +0800	[thread overview]
Message-ID: <1446108827-7907-10-git-send-email-jingjing.wu@intel.com> (raw)
In-Reply-To: <1446108827-7907-1-git-send-email-jingjing.wu@intel.com>

This patch adds a command to display DCB info in ports.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
---
 app/test-pmd/cmdline.c | 15 ++++++++++-----
 app/test-pmd/config.c  | 43 +++++++++++++++++++++++++++++++++++++++++++
 app/test-pmd/testpmd.h |  1 +
 3 files changed, 54 insertions(+), 5 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 2ec855f..bf6b3e4 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -182,7 +182,7 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"Display:\n"
 			"--------\n\n"
 
-			"show port (info|stats|xstats|fdir|stat_qmap) (port_id|all)\n"
+			"show port (info|stats|xstats|fdir|stat_qmap|dcb_tc) (port_id|all)\n"
 			"    Display information for port_id, or all.\n\n"
 
 			"show port X rss reta (size) (mask0,mask1,...)\n"
@@ -5235,6 +5235,9 @@ static void cmd_showportall_parsed(void *parsed_result,
 	else if (!strcmp(res->what, "stat_qmap"))
 		FOREACH_PORT(i, ports)
 			nic_stats_mapping_display(i);
+	else if (!strcmp(res->what, "dcb_tc"))
+		FOREACH_PORT(i, ports)
+			port_dcb_info_display(i);
 }
 
 cmdline_parse_token_string_t cmd_showportall_show =
@@ -5244,13 +5247,13 @@ cmdline_parse_token_string_t cmd_showportall_port =
 	TOKEN_STRING_INITIALIZER(struct cmd_showportall_result, port, "port");
 cmdline_parse_token_string_t cmd_showportall_what =
 	TOKEN_STRING_INITIALIZER(struct cmd_showportall_result, what,
-				 "info#stats#xstats#fdir#stat_qmap");
+				 "info#stats#xstats#fdir#stat_qmap#dcb_tc");
 cmdline_parse_token_string_t cmd_showportall_all =
 	TOKEN_STRING_INITIALIZER(struct cmd_showportall_result, all, "all");
 cmdline_parse_inst_t cmd_showportall = {
 	.f = cmd_showportall_parsed,
 	.data = NULL,
-	.help_str = "show|clear port info|stats|xstats|fdir|stat_qmap all",
+	.help_str = "show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc all",
 	.tokens = {
 		(void *)&cmd_showportall_show,
 		(void *)&cmd_showportall_port,
@@ -5288,6 +5291,8 @@ static void cmd_showport_parsed(void *parsed_result,
 		 fdir_get_infos(res->portnum);
 	else if (!strcmp(res->what, "stat_qmap"))
 		nic_stats_mapping_display(res->portnum);
+	else if (!strcmp(res->what, "dcb_tc"))
+		port_dcb_info_display(res->portnum);
 }
 
 cmdline_parse_token_string_t cmd_showport_show =
@@ -5297,14 +5302,14 @@ cmdline_parse_token_string_t cmd_showport_port =
 	TOKEN_STRING_INITIALIZER(struct cmd_showport_result, port, "port");
 cmdline_parse_token_string_t cmd_showport_what =
 	TOKEN_STRING_INITIALIZER(struct cmd_showport_result, what,
-				 "info#stats#xstats#fdir#stat_qmap");
+				 "info#stats#xstats#fdir#stat_qmap#dcb_tc");
 cmdline_parse_token_num_t cmd_showport_portnum =
 	TOKEN_NUM_INITIALIZER(struct cmd_showport_result, portnum, UINT8);
 
 cmdline_parse_inst_t cmd_showport = {
 	.f = cmd_showport_parsed,
 	.data = NULL,
-	.help_str = "show|clear port info|stats|xstats|fdir|stat_qmap X (X = port number)",
+	.help_str = "show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc X (X = port number)",
 	.tokens = {
 		(void *)&cmd_showport_show,
 		(void *)&cmd_showport_port,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 11136aa..6d5820a 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -2268,3 +2268,46 @@ mcast_addr_remove(uint8_t port_id, struct ether_addr *mc_addr)
 	mcast_addr_pool_remove(port, i);
 	eth_port_multicast_addr_list_set(port_id);
 }
+
+void
+port_dcb_info_display(uint8_t port_id)
+{
+	struct rte_eth_dcb_info dcb_info;
+	uint16_t i;
+	int ret;
+	static const char *border = "================";
+
+	if (port_id_is_invalid(port_id, ENABLED_WARN))
+		return;
+
+	ret = rte_eth_dev_get_dcb_info(port_id, &dcb_info);
+	if (ret) {
+		printf("\n Failed to get dcb infos on port %-2d\n",
+			port_id);
+		return;
+	}
+	printf("\n  %s DCB infos for port %-2d  %s\n", border, port_id, border);
+	printf("  TC NUMBER: %d\n", dcb_info.nb_tcs);
+	printf("\n  TC :        ");
+	for (i = 0; i < dcb_info.nb_tcs; i++)
+		printf("\t%4d", i);
+	printf("\n  Priority :  ");
+	for (i = 0; i < dcb_info.nb_tcs; i++)
+		printf("\t%4d", dcb_info.prio_tc[i]);
+	printf("\n  BW percent :");
+	for (i = 0; i < dcb_info.nb_tcs; i++)
+		printf("\t%4d%%", dcb_info.tc_bws[i]);
+	printf("\n  RXQ base :  ");
+	for (i = 0; i < dcb_info.nb_tcs; i++)
+		printf("\t%4d", dcb_info.tc_queue.tc_rxq[0][i].base);
+	printf("\n  RXQ number :");
+	for (i = 0; i < dcb_info.nb_tcs; i++)
+		printf("\t%4d", dcb_info.tc_queue.tc_rxq[0][i].nb_queue);
+	printf("\n  TXQ base :  ");
+	for (i = 0; i < dcb_info.nb_tcs; i++)
+		printf("\t%4d", dcb_info.tc_queue.tc_txq[0][i].base);
+	printf("\n  TXQ number :");
+	for (i = 0; i < dcb_info.nb_tcs; i++)
+		printf("\t%4d", dcb_info.tc_queue.tc_txq[0][i].nb_queue);
+	printf("\n");
+}
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 3661755..ecb411d 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -557,6 +557,7 @@ int tx_queue_id_is_invalid(queueid_t txq_id);
 /* Functions to manage the set of filtered Multicast MAC addresses */
 void mcast_addr_add(uint8_t port_id, struct ether_addr *mc_addr);
 void mcast_addr_remove(uint8_t port_id, struct ether_addr *mc_addr);
+void port_dcb_info_display(uint8_t port_id);
 
 enum print_warning {
 	ENABLED_WARN = 0,
-- 
2.4.0

  parent reply	other threads:[~2015-10-29  8:54 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-24  6:03 [dpdk-dev] [PATCH 0/8] enable DCB feature on Intel XL710/X710 NIC Jingjing Wu
2015-09-24  6:03 ` [dpdk-dev] [PATCH 1/8] ethdev: rename dcb_queue to dcb_tc in dcb config struct Jingjing Wu
2015-09-24  6:03 ` [dpdk-dev] [PATCH 2/8] ethdev: move the multi-queue checking to specific drivers Jingjing Wu
2015-09-24  6:03 ` [dpdk-dev] [PATCH 3/8] i40e: enable DCB feature on FVL Jingjing Wu
2015-09-24  6:03 ` [dpdk-dev] [PATCH 4/8] ixgbe: enable DCB+RSS multi-queue mode Jingjing Wu
2015-09-24  6:03 ` [dpdk-dev] [PATCH 5/8] ethdev: new API to get dcb related information Jingjing Wu
2015-09-24  6:03 ` [dpdk-dev] [PATCH 6/8] ixgbe: get_dcb_info ops implement Jingjing Wu
2015-09-24  6:03 ` [dpdk-dev] [PATCH 7/8] i40e: " Jingjing Wu
2015-10-22  7:10   ` Liu, Jijiang
2015-10-26  7:38     ` Wu, Jingjing
2015-09-24  6:03 ` [dpdk-dev] [PATCH 8/8] app/testpmd: set up DCB forwarding based on traffic class Jingjing Wu
2015-10-28  1:46   ` Liu, Jijiang
2015-10-28  2:04     ` Wu, Jingjing
2015-10-29  8:53 ` [dpdk-dev] [PATCH v2 00/10] enable DCB feature on Intel XL710/X710 NIC Jingjing Wu
2015-10-29  8:53   ` [dpdk-dev] [PATCH v2 01/10] ethdev: rename dcb_queue to dcb_tc in dcb config struct Jingjing Wu
2015-10-30 10:22     ` Thomas Monjalon
2015-10-29  8:53   ` [dpdk-dev] [PATCH v2 02/10] ethdev: move the multi-queue checking to specific drivers Jingjing Wu
2015-10-29  8:53   ` [dpdk-dev] [PATCH v2 03/10] i40e: enable DCB feature on FVL Jingjing Wu
2015-10-29  8:53   ` [dpdk-dev] [PATCH v2 04/10] ixgbe: enable DCB+RSS multi-queue mode Jingjing Wu
2015-10-29  8:53   ` [dpdk-dev] [PATCH v2 05/10] ethdev: new API to get dcb related information Jingjing Wu
2015-10-30 11:16     ` Thomas Monjalon
2015-10-29  8:53   ` [dpdk-dev] [PATCH v2 06/10] ixgbe: get_dcb_info ops implement Jingjing Wu
2015-10-29  8:53   ` [dpdk-dev] [PATCH v2 07/10] i40e: " Jingjing Wu
2015-10-29  8:53   ` [dpdk-dev] [PATCH v2 08/10] app/testpmd: set up DCB forwarding based on traffic class Jingjing Wu
2015-10-29  8:53   ` Jingjing Wu [this message]
2015-10-29  8:53   ` [dpdk-dev] [PATCH v2 10/10] doc: update testpmd guide and release note Jingjing Wu
2015-10-30 10:26     ` Thomas Monjalon
2015-10-30  1:29   ` [dpdk-dev] [PATCH v2 00/10] enable DCB feature on Intel XL710/X710 NIC Liu, Jijiang
2015-10-30  2:21   ` Zhang, Helin
2015-10-31 15:57   ` [dpdk-dev] [PATCH v3 0/9] " Jingjing Wu
2015-10-31 15:57     ` [dpdk-dev] [PATCH v3 1/9] ethdev: rename dcb_queue to dcb_tc in dcb config struct Jingjing Wu
2015-10-31 15:57     ` [dpdk-dev] [PATCH v3 2/9] ethdev: move the multi-queue checking to specific drivers Jingjing Wu
2015-10-31 15:57     ` [dpdk-dev] [PATCH v3 3/9] i40e: enable DCB feature on FVL Jingjing Wu
2015-10-31 15:57     ` [dpdk-dev] [PATCH v3 4/9] ixgbe: enable DCB+RSS multi-queue mode Jingjing Wu
2015-10-31 15:57     ` [dpdk-dev] [PATCH v3 5/9] ethdev: new API to get dcb related information Jingjing Wu
2015-10-31 15:57     ` [dpdk-dev] [PATCH v3 6/9] ixgbe: get_dcb_info ops implement Jingjing Wu
2015-10-31 15:57     ` [dpdk-dev] [PATCH v3 7/9] i40e: " Jingjing Wu
2015-10-31 15:57     ` [dpdk-dev] [PATCH v3 8/9] app/testpmd: set up DCB forwarding based on traffic class Jingjing Wu
2015-10-31 15:57     ` [dpdk-dev] [PATCH v3 9/9] app/testpmd: add command to display DCB info Jingjing Wu
2015-11-01 13:53     ` [dpdk-dev] [PATCH v3 0/9] enable DCB feature on Intel XL710/X710 NIC Thomas Monjalon

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=1446108827-7907-10-git-send-email-jingjing.wu@intel.com \
    --to=jingjing.wu@intel.com \
    --cc=dev@dpdk.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).