[dpdk-dev,v4,2/2] app/testpmd: new parameter for port config all rss command
Checks
Commit Message
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 <xuemingl@mellanox.com>
---
app/test-pmd/cmdline.c | 13 +++++++++----
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 +++-
2 files changed, 12 insertions(+), 5 deletions(-)
Comments
On Thu, Apr 19, 2018 at 11:48:40PM +0800, Xueming Li wrote:
> 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 <xuemingl@mellanox.com>
Looks good, thanks.
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
@@ -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|<flowtype_id>)\n"
+ "port config all rss (all|default|ip|tcp|udp|sctp|"
+ "ether|port|vxlan|geneve|nvgre|none|<flowtype_id>)\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|<flowtype_id>",
+ "all|default|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|none|<flowtype_id>",
.tokens = {
(void *)&cmd_config_rss_port,
(void *)&cmd_config_rss_keyword,
@@ -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