From: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
To: pablo.de.lara.guarch@intel.com
Cc: dev@dpdk.org, Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Subject: [dpdk-dev] [PATCH] app/testpmd: unchecked return value
Date: Wed, 15 Jun 2016 12:33:42 +0200 [thread overview]
Message-ID: <1465986822-22243-1-git-send-email-slawomirx.mrozowicz@intel.com> (raw)
Calling rte_eth_dev_rss_hash_update without checking return value.
Fixed by handle return value and print out error status.
Fixes: ce8d561418d4 ("app/testpmd: add port configuration settings")
Coverity ID 119251
Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
---
app/test-pmd/cmdline.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index c5b9479..9616790 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1524,6 +1524,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"))
@@ -1547,8 +1548,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 =
--
1.9.1
next reply other threads:[~2016-06-15 9:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-15 10:33 Slawomir Mrozowicz [this message]
2016-06-16 8:43 ` De Lara Guarch, Pablo
2016-06-16 14:48 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1465986822-22243-1-git-send-email-slawomirx.mrozowicz@intel.com \
--to=slawomirx.mrozowicz@intel.com \
--cc=dev@dpdk.org \
--cc=pablo.de.lara.guarch@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).