app/testpmd: print RSS hash update error
authorSlawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Wed, 15 Jun 2016 10:33:42 +0000 (12:33 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 16 Jun 2016 14:46:38 +0000 (16:46 +0200)
Calling rte_eth_dev_rss_hash_update without checking return value.
Fixed by handle return value and print out error status.

Coverity issue: 119251
Fixes: ce8d561418d4 ("app/testpmd: add port configuration settings")

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
app/test-pmd/cmdline.c

index 030beec..9d3e4e8 100644 (file)
@@ -1535,6 +1535,7 @@ cmd_config_rss_parsed(void *parsed_result,
 {
        struct cmd_config_rss *res = parsed_result;
        struct rte_eth_rss_conf rss_conf;
+       int diag;
        uint8_t i;
 
        if (!strcmp(res->value, "all"))
@@ -1558,8 +1559,13 @@ cmd_config_rss_parsed(void *parsed_result,
                return;
        }
        rss_conf.rss_key = NULL;
-       for (i = 0; i < rte_eth_dev_count(); i++)
-               rte_eth_dev_rss_hash_update(i, &rss_conf);
+       for (i = 0; i < rte_eth_dev_count(); i++) {
+               diag = rte_eth_dev_rss_hash_update(i, &rss_conf);
+               if (diag < 0)
+                       printf("Configuration of RSS hash at ethernet port %d "
+                               "failed with error (%d): %s.\n",
+                               i, -diag, strerror(-diag));
+       }
 }
 
 cmdline_parse_token_string_t cmd_config_rss_port =