From d9aa619c60b67131d0f8d0ad308576ca72ce7c90 Mon Sep 17 00:00:00 2001 From: Xueming Li Date: Fri, 20 Apr 2018 22:30:23 +0800 Subject: [PATCH] app/testpmd: new parameter for port config all RSS command 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 Acked-by: Adrien Mazarguil --- 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 f2cddd8487..2a1027828e 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; uint16_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) @@ -2036,6 +2037,10 @@ cmd_config_rss_parsed(void *parsed_result, /* Update global configuration for RSS types. */ rss_hf = rss_conf.rss_hf; RTE_ETH_FOREACH_DEV(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 " @@ -2059,7 +2064,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 cb6f201e1e..593b13a3da 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.20.1