From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 6D1AAC3E2 for ; Wed, 15 Jun 2016 11:35:58 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 15 Jun 2016 02:35:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,475,1459839600"; d="scan'208";a="998015952" Received: from gklab-246-019.igk.intel.com (HELO intel.com) ([10.217.246.19]) by orsmga002.jf.intel.com with SMTP; 15 Jun 2016 02:35:54 -0700 Received: by intel.com (sSMTP sendmail emulation); Wed, 15 Jun 2016 12:33:56 +0200 From: Slawomir Mrozowicz To: pablo.de.lara.guarch@intel.com Cc: dev@dpdk.org, Slawomir Mrozowicz Date: Wed, 15 Jun 2016 12:33:42 +0200 Message-Id: <1465986822-22243-1-git-send-email-slawomirx.mrozowicz@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH] app/testpmd: unchecked return value X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 09:35:58 -0000 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 --- 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