From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 104ACAAC5 for ; Thu, 19 Apr 2018 17:49:00 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from xuemingl@mellanox.com) with ESMTPS (AES256-SHA encrypted); 19 Apr 2018 18:50:17 +0300 Received: from dev-r630-06.mtbc.labs.mlnx (dev-r630-06.mtbc.labs.mlnx [10.12.205.180]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id w3JFmtVf004513; Thu, 19 Apr 2018 18:48:56 +0300 Received: from dev-r630-06.mtbc.labs.mlnx (localhost [127.0.0.1]) by dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7) with ESMTP id w3JFmtwL080064; Thu, 19 Apr 2018 23:48:55 +0800 Received: (from xuemingl@localhost) by dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7/Submit) id w3JFmtJ0080063; Thu, 19 Apr 2018 23:48:55 +0800 From: Xueming Li To: Shahaf Shuler , Nelio Laranjeiro , Wenzhuo Lu , Jingjing Wu , Thomas Monjalon , Adrien Mazarguil Cc: Xueming Li , dev@dpdk.org Date: Thu, 19 Apr 2018 23:48:40 +0800 Message-Id: <20180419154840.80006-2-xuemingl@mellanox.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20180419154840.80006-1-xuemingl@mellanox.com> References: <20180419154840.80006-1-xuemingl@mellanox.com> In-Reply-To: <20180409121035.148813-1-xuemingl@mellanox.com> References: <20180409121035.148813-1-xuemingl@mellanox.com> Subject: [dpdk-dev] [PATCH v4 2/2] app/testpmd: new parameter for port config all rss command X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 15:49:01 -0000 This patches add "default" parameter to "port config all rss" command. "default" means all supported hash types reported by device info. Signed-off-by: Xueming Li --- app/test-pmd/cmdline.c | 13 +++++++++---- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 +++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 512e3b55e..77068129e 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -821,8 +821,8 @@ static void cmd_help_long_parsed(void *parsed_result, " Set crc-strip/scatter/rx-checksum/hardware-vlan/drop_en" " for ports.\n\n" - "port config all rss (all|ip|tcp|udp|sctp|ether|port|vxlan|" - "geneve|nvgre|none|)\n" + "port config all rss (all|default|ip|tcp|udp|sctp|" + "ether|port|vxlan|geneve|nvgre|none|)\n" " Set the RSS mode.\n\n" "port config port-id rss reta (hash,queue)[,(hash,queue)]\n" @@ -1998,6 +1998,7 @@ cmd_config_rss_parsed(void *parsed_result, { struct cmd_config_rss *res = parsed_result; struct rte_eth_rss_conf rss_conf = { .rss_key_len = 0, }; + struct rte_eth_dev_info dev_info = { .flow_type_rss_offloads = 0, }; int diag; uint8_t i; @@ -2023,7 +2024,7 @@ cmd_config_rss_parsed(void *parsed_result, rss_conf.rss_hf = ETH_RSS_GENEVE; else if (!strcmp(res->value, "nvgre")) rss_conf.rss_hf = ETH_RSS_NVGRE; - else if (!strcmp(res->value, "none")) + else if (!strcmp(res->value, "none") || !strcmp(res->value, "default")) rss_conf.rss_hf = 0; else if (isdigit(res->value[0]) && atoi(res->value) > 0 && atoi(res->value) < 64) @@ -2034,6 +2035,10 @@ cmd_config_rss_parsed(void *parsed_result, } rss_conf.rss_key = NULL; for (i = 0; i < rte_eth_dev_count(); i++) { + if (!strcmp(res->value, "default")) { + rte_eth_dev_info_get(i, &dev_info); + rss_conf.rss_hf = dev_info.flow_type_rss_offloads; + } diag = rte_eth_dev_rss_hash_update(i, &rss_conf); if (diag < 0) printf("Configuration of RSS hash at ethernet port %d " @@ -2057,7 +2062,7 @@ cmdline_parse_inst_t cmd_config_rss = { .f = cmd_config_rss_parsed, .data = NULL, .help_str = "port config all rss " - "all|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|none|", + "all|default|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|none|", .tokens = { (void *)&cmd_config_rss_port, (void *)&cmd_config_rss_keyword, diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index a766ac795..0e1719d9a 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -1751,10 +1751,12 @@ port config - RSS Set the RSS (Receive Side Scaling) mode on or off:: - testpmd> port config all rss (all|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|none) + testpmd> port config all rss (all|default|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|none) RSS is on by default. +The ``all`` option is equivalent to ip|tcp|udp|sctp|ether. +The ``default`` option enables all supported RSS types reported by device info. The ``none`` option is equivalent to the ``--disable-rss`` command-line option. port config - RSS Reta -- 2.13.3