DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Wenzhuo Lu <wenzhuo.lu@intel.com>,
	Xiaoyun Li <xiaoyun.li@intel.com>,
	Bernard Iremonger <bernard.iremonger@intel.com>
Cc: Ferruh Yigit <ferruh.yigit@intel.com>, dev@dpdk.org
Subject: [dpdk-dev] [PATCH] app/testpmd: remove duplicated offload display
Date: Fri,  5 Feb 2021 14:26:50 +0000	[thread overview]
Message-ID: <20210205142650.1106807-1-ferruh.yigit@intel.com> (raw)

"show port cap all|<port_id>" was to display offload configuration of
port(s).

But later two other commands added to show same information in more
accurate way:
 show port (port_id) rx_offload configuration
 show port (port_id) tx_offload configuration

These new commands can both show port and queue level configuration,
also with their capabilities counterparts easier to see offload
capability and configuration of the port in similar syntax.

So the functionality is duplicated and removing this version, to favor
the new commands.

Another problem with this command is it requires each new offload to be
added into the function to display them, and there were missing offloads
that are not displayed, this requirement for sure will create gaps by
time as new offloads added.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 app/test-pmd/cmdline.c                      |  15 +-
 app/test-pmd/config.c                       | 289 --------------------
 app/test-pmd/testpmd.h                      |   1 -
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  12 +-
 4 files changed, 10 insertions(+), 307 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 59722d268bc3..7eb02b8b7d6b 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -163,7 +163,7 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"Display:\n"
 			"--------\n\n"
 
-			"show port (info|stats|summary|xstats|fdir|dcb_tc|cap) (port_id|all)\n"
+			"show port (info|stats|summary|xstats|fdir|dcb_tc) (port_id|all)\n"
 			"    Display information for port_id, or all.\n\n"
 
 			"show port port_id (module_eeprom|eeprom)\n"
@@ -7569,9 +7569,6 @@ static void cmd_showportall_parsed(void *parsed_result,
 	else if (!strcmp(res->what, "dcb_tc"))
 		RTE_ETH_FOREACH_DEV(i)
 			port_dcb_info_display(i);
-	else if (!strcmp(res->what, "cap"))
-		RTE_ETH_FOREACH_DEV(i)
-			port_offload_cap_display(i);
 }
 
 cmdline_parse_token_string_t cmd_showportall_show =
@@ -7581,14 +7578,14 @@ 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#summary#stats#xstats#fdir#dcb_tc#cap");
+				 "info#summary#stats#xstats#fdir#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|summary|stats|xstats|fdir|dcb_tc|cap all",
+		"info|summary|stats|xstats|fdir|dcb_tc all",
 	.tokens = {
 		(void *)&cmd_showportall_show,
 		(void *)&cmd_showportall_port,
@@ -7632,8 +7629,6 @@ static void cmd_showport_parsed(void *parsed_result,
 #endif
 	else if (!strcmp(res->what, "dcb_tc"))
 		port_dcb_info_display(res->portnum);
-	else if (!strcmp(res->what, "cap"))
-		port_offload_cap_display(res->portnum);
 }
 
 cmdline_parse_token_string_t cmd_showport_show =
@@ -7643,7 +7638,7 @@ 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#summary#stats#xstats#fdir#dcb_tc#cap");
+				 "info#summary#stats#xstats#fdir#dcb_tc");
 cmdline_parse_token_num_t cmd_showport_portnum =
 	TOKEN_NUM_INITIALIZER(struct cmd_showport_result, portnum, RTE_UINT16);
 
@@ -7651,7 +7646,7 @@ cmdline_parse_inst_t cmd_showport = {
 	.f = cmd_showport_parsed,
 	.data = NULL,
 	.help_str = "show|clear port "
-		"info|summary|stats|xstats|fdir|dcb_tc|cap "
+		"info|summary|stats|xstats|fdir|dcb_tc "
 		"<port_id>",
 	.tokens = {
 		(void *)&cmd_showport_show,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index dab8afe5dd6f..576d5acab54a 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -884,295 +884,6 @@ port_module_eeprom_display(portid_t port_id)
 	printf("Finish -- Port: %d MODULE EEPROM length: %d bytes\n", port_id, einfo.length);
 }
 
-void
-port_offload_cap_display(portid_t port_id)
-{
-	struct rte_eth_dev_info dev_info;
-	static const char *info_border = "************";
-	int ret;
-
-	if (port_id_is_invalid(port_id, ENABLED_WARN))
-		return;
-
-	ret = eth_dev_info_get_print_err(port_id, &dev_info);
-	if (ret != 0)
-		return;
-
-	printf("\n%s Port %d supported offload features: %s\n",
-		info_border, port_id, info_border);
-
-	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_VLAN_STRIP) {
-		printf("VLAN stripped:                 ");
-		if (ports[port_id].dev_conf.rxmode.offloads &
-		    DEV_RX_OFFLOAD_VLAN_STRIP)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_QINQ_STRIP) {
-		printf("Double VLANs stripped:         ");
-		if (ports[port_id].dev_conf.rxmode.offloads &
-		    DEV_RX_OFFLOAD_QINQ_STRIP)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_IPV4_CKSUM) {
-		printf("RX IPv4 checksum:              ");
-		if (ports[port_id].dev_conf.rxmode.offloads &
-		    DEV_RX_OFFLOAD_IPV4_CKSUM)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_UDP_CKSUM) {
-		printf("RX UDP checksum:               ");
-		if (ports[port_id].dev_conf.rxmode.offloads &
-		    DEV_RX_OFFLOAD_UDP_CKSUM)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_CKSUM) {
-		printf("RX TCP checksum:               ");
-		if (ports[port_id].dev_conf.rxmode.offloads &
-		    DEV_RX_OFFLOAD_TCP_CKSUM)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_SCTP_CKSUM) {
-		printf("RX SCTP checksum:              ");
-		if (ports[port_id].dev_conf.rxmode.offloads &
-		    DEV_RX_OFFLOAD_SCTP_CKSUM)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM) {
-		printf("RX Outer IPv4 checksum:        ");
-		if (ports[port_id].dev_conf.rxmode.offloads &
-		    DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_OUTER_UDP_CKSUM) {
-		printf("RX Outer UDP checksum:         ");
-		if (ports[port_id].dev_conf.rxmode.offloads &
-		    DEV_RX_OFFLOAD_OUTER_UDP_CKSUM)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_LRO) {
-		printf("Large receive offload:         ");
-		if (ports[port_id].dev_conf.rxmode.offloads &
-		    DEV_RX_OFFLOAD_TCP_LRO)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TIMESTAMP) {
-		printf("HW timestamp:                  ");
-		if (ports[port_id].dev_conf.rxmode.offloads &
-		    DEV_RX_OFFLOAD_TIMESTAMP)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_KEEP_CRC) {
-		printf("Rx Keep CRC:                   ");
-		if (ports[port_id].dev_conf.rxmode.offloads &
-		    DEV_RX_OFFLOAD_KEEP_CRC)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_SECURITY) {
-		printf("RX offload security:           ");
-		if (ports[port_id].dev_conf.rxmode.offloads &
-		    DEV_RX_OFFLOAD_SECURITY)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.rx_offload_capa & RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT) {
-		printf("RX offload buffer split:       ");
-		if (ports[port_id].dev_conf.rxmode.offloads &
-		    RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_VLAN_INSERT) {
-		printf("VLAN insert:                   ");
-		if (ports[port_id].dev_conf.txmode.offloads &
-		    DEV_TX_OFFLOAD_VLAN_INSERT)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_QINQ_INSERT) {
-		printf("Double VLANs insert:           ");
-		if (ports[port_id].dev_conf.txmode.offloads &
-		    DEV_TX_OFFLOAD_QINQ_INSERT)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_IPV4_CKSUM) {
-		printf("TX IPv4 checksum:              ");
-		if (ports[port_id].dev_conf.txmode.offloads &
-		    DEV_TX_OFFLOAD_IPV4_CKSUM)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_UDP_CKSUM) {
-		printf("TX UDP checksum:               ");
-		if (ports[port_id].dev_conf.txmode.offloads &
-		    DEV_TX_OFFLOAD_UDP_CKSUM)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_CKSUM) {
-		printf("TX TCP checksum:               ");
-		if (ports[port_id].dev_conf.txmode.offloads &
-		    DEV_TX_OFFLOAD_TCP_CKSUM)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_SCTP_CKSUM) {
-		printf("TX SCTP checksum:              ");
-		if (ports[port_id].dev_conf.txmode.offloads &
-		    DEV_TX_OFFLOAD_SCTP_CKSUM)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) {
-		printf("TX Outer IPv4 checksum:        ");
-		if (ports[port_id].dev_conf.txmode.offloads &
-		    DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_TSO) {
-		printf("TX TCP segmentation:           ");
-		if (ports[port_id].dev_conf.txmode.offloads &
-		    DEV_TX_OFFLOAD_TCP_TSO)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_UDP_TSO) {
-		printf("TX UDP segmentation:           ");
-		if (ports[port_id].dev_conf.txmode.offloads &
-		    DEV_TX_OFFLOAD_UDP_TSO)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_VXLAN_TNL_TSO) {
-		printf("TSO for VXLAN tunnel packet:   ");
-		if (ports[port_id].dev_conf.txmode.offloads &
-		    DEV_TX_OFFLOAD_VXLAN_TNL_TSO)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_GRE_TNL_TSO) {
-		printf("TSO for GRE tunnel packet:     ");
-		if (ports[port_id].dev_conf.txmode.offloads &
-		    DEV_TX_OFFLOAD_GRE_TNL_TSO)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_IPIP_TNL_TSO) {
-		printf("TSO for IPIP tunnel packet:    ");
-		if (ports[port_id].dev_conf.txmode.offloads &
-		    DEV_TX_OFFLOAD_IPIP_TNL_TSO)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_GENEVE_TNL_TSO) {
-		printf("TSO for GENEVE tunnel packet:  ");
-		if (ports[port_id].dev_conf.txmode.offloads &
-		    DEV_TX_OFFLOAD_GENEVE_TNL_TSO)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_IP_TNL_TSO) {
-		printf("IP tunnel TSO:  ");
-		if (ports[port_id].dev_conf.txmode.offloads &
-		    DEV_TX_OFFLOAD_IP_TNL_TSO)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_UDP_TNL_TSO) {
-		printf("UDP tunnel TSO:  ");
-		if (ports[port_id].dev_conf.txmode.offloads &
-		    DEV_TX_OFFLOAD_UDP_TNL_TSO)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) {
-		printf("TX Outer UDP checksum:         ");
-		if (ports[port_id].dev_conf.txmode.offloads &
-		    DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_SEND_ON_TIMESTAMP) {
-		printf("Tx scheduling on timestamp:    ");
-		if (ports[port_id].dev_conf.txmode.offloads &
-		    DEV_TX_OFFLOAD_SEND_ON_TIMESTAMP)
-			printf("on\n");
-		else
-			printf("off\n");
-	}
-
-}
-
 int
 port_id_is_invalid(portid_t port_id, enum print_warning warning)
 {
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 4aca52285957..82ef95cd8022 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -776,7 +776,6 @@ void port_summary_display(portid_t port_id);
 void port_eeprom_display(portid_t port_id);
 void port_module_eeprom_display(portid_t port_id);
 void port_summary_header_display(void);
-void port_offload_cap_display(portid_t port_id);
 void rx_queue_infos_display(portid_t port_idi, uint16_t queue_id);
 void tx_queue_infos_display(portid_t port_idi, uint16_t queue_id);
 void fwd_lcores_config_display(void);
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index a45910b81e2a..7fc119be0f92 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -24,10 +24,10 @@ If you type a partial command and hit ``<TAB>`` you get a list of the available
 
    testpmd> show port <TAB>
 
-       info [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc|cap X
-       info [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc|cap all
-       stats [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc|cap X
-       stats [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc|cap all
+       info [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc X
+       info [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc all
+       stats [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc X
+       stats [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc all
        ...
 
 
@@ -159,7 +159,7 @@ show port
 
 Display information for a given port or all ports::
 
-   testpmd> show port (info|summary|stats|xstats|fdir|stat_qmap|dcb_tc|cap) (port_id|all)
+   testpmd> show port (info|summary|stats|xstats|fdir|stat_qmap|dcb_tc) (port_id|all)
 
 The available information categories are:
 
@@ -177,8 +177,6 @@ The available information categories are:
 
 * ``dcb_tc``: DCB information such as TC mapping.
 
-* ``cap``: Supported offload capabilities.
-
 For example:
 
 .. code-block:: console
-- 
2.29.2


             reply	other threads:[~2021-02-05 14:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-05 14:26 Ferruh Yigit [this message]
2021-02-05 16:40 ` Lance Richardson
2021-02-07  1:47 ` Li, Xiaoyun
2021-02-07  1:58 ` Li, Xiaoyun
2021-02-24 12:29   ` Ferruh Yigit

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=20210205142650.1106807-1-ferruh.yigit@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=wenzhuo.lu@intel.com \
    --cc=xiaoyun.li@intel.com \
    /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).