From patchwork Fri Feb 5 14:26:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 87800 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 41047A0524; Fri, 5 Feb 2021 15:26:57 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EDA6D40682; Fri, 5 Feb 2021 15:26:56 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 6B2FB4067B for ; Fri, 5 Feb 2021 15:26:55 +0100 (CET) IronPort-SDR: 3InEAf45Ru0Nj1IVrlXUiSAAn+gMITplhiqSiGmHEB10Q739AywpsRznpQKCqArFZN9INZX8K7 q6QgU+/+q7aw== X-IronPort-AV: E=McAfee;i="6000,8403,9885"; a="160596316" X-IronPort-AV: E=Sophos;i="5.81,155,1610438400"; d="scan'208";a="160596316" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2021 06:26:54 -0800 IronPort-SDR: GiVH06hcANbvbf1FWeB2NfNeXZbNvysAVjE020+8185qmiom5dxh7uguGaYFFlSZquKDXdhrcv ST6R+epjXU/w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,155,1610438400"; d="scan'208";a="434483091" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.27]) by orsmga001.jf.intel.com with ESMTP; 05 Feb 2021 06:26:52 -0800 From: Ferruh Yigit To: Wenzhuo Lu , Xiaoyun Li , Bernard Iremonger Cc: Ferruh Yigit , dev@dpdk.org Date: Fri, 5 Feb 2021 14:26:50 +0000 Message-Id: <20210205142650.1106807-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] app/testpmd: remove duplicated offload display 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 Sender: "dev" "show port cap all|" 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 Acked-by: Lance Richardson Acked-by: Xiaoyun Li --- 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 " "", .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 ```` you get a list of the available testpmd> show port - 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