app/testpmd: configure RSS without restart
authorIvan Boule <ivan.boule@6wind.com>
Fri, 16 May 2014 08:58:41 +0000 (10:58 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 27 May 2014 16:42:05 +0000 (18:42 +0200)
The function cmd_config_rss_parsed() associated with the command
"port config rss all" required to first stop all ports, in order to
then entirely re-configure all ports with the new RSS hash computation
parameters.
Use now the new function rte_eth_dev_rss_hash_conf_update() that dynamically
only changes the RSS hash computation parameters of a port, without needing
to previously stop the port.

Signed-off-by: Ivan Boule <ivan.boule@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
app/test-pmd/cmdline.c

index b3824f9..6a79d6c 100644 (file)
@@ -1124,26 +1124,22 @@ cmd_config_rss_parsed(void *parsed_result,
                        __attribute__((unused)) void *data)
 {
        struct cmd_config_rss *res = parsed_result;
-
-       if (!all_ports_stopped()) {
-               printf("Please stop all ports first\n");
-               return;
-       }
+       struct rte_eth_rss_conf rss_conf;
+       uint8_t i;
 
        if (!strcmp(res->value, "ip"))
-               rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6;
+               rss_conf.rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6;
        else if (!strcmp(res->value, "udp"))
-               rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6 | ETH_RSS_IPV4_UDP;
+               rss_conf.rss_hf = ETH_RSS_IPV4_UDP | ETH_RSS_IPV6_UDP;
        else if (!strcmp(res->value, "none"))
-               rss_hf = 0;
+               rss_conf.rss_hf = 0;
        else {
                printf("Unknown parameter\n");
                return;
        }
-
-       init_port_config();
-
-       cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1);
+       rss_conf.rss_key = NULL;
+       for (i = 0; i < rte_eth_dev_count(); i++)
+               rte_eth_dev_rss_hash_update(i, &rss_conf);
 }
 
 cmdline_parse_token_string_t cmd_config_rss_port =