From patchwork Sun Sep 29 03:22:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zhang X-Patchwork-Id: 60091 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7F2D52B88; Sun, 29 Sep 2019 05:19:19 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 3D501DE3 for ; Sun, 29 Sep 2019 05:19:16 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Sep 2019 20:19:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,561,1559545200"; d="scan'208";a="342255912" Received: from dpdk51.sh.intel.com ([10.67.110.245]) by orsmga004.jf.intel.com with ESMTP; 28 Sep 2019 20:19:14 -0700 From: Qi Zhang To: ivan.ilchenko@oktetlabs.com, arybchenko@solarflare.com, bernard.iremonger@intel.com Cc: xiaolong.ye@intel.com, simei.su@intel.com, dev@dpdk.org, Qi Zhang Date: Sun, 29 Sep 2019 11:22:09 +0800 Message-Id: <20190929032209.23407-1-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 Subject: [dpdk-dev] [PATCH] app/testpmd: fix wrong return value X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The patch fix the issue that return value in parse_vc_action_rss be overwritten unexpectly. That cause an rte_flow creation command with rss action does not work. For example: testpmd> flow create 0 ingress pattern eth / ipv4 / end \ actions rss types ipv4 end / end We will get error "Bad Agument" Fixes: f5267e485a2a ("app/testpmd: check status of getting ethdev info") Reported-by: Simei Su Signed-off-by: Qi Zhang Reviewed-by: Xiaolong Ye --- app/test-pmd/cmdline_flow.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 369426cbd..932bdb98e 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -3549,10 +3549,11 @@ parse_vc_action_rss(struct context *ctx, const struct token *token, if (!port_id_is_invalid(ctx->port, DISABLED_WARN) && ctx->port != (portid_t)RTE_PORT_ALL) { struct rte_eth_dev_info info; + int ret2; - ret = rte_eth_dev_info_get(ctx->port, &info); - if (ret != 0) - return ret; + ret2 = rte_eth_dev_info_get(ctx->port, &info); + if (ret2 != 0) + return ret2; action_rss_data->conf.key_len = RTE_MIN(sizeof(action_rss_data->key),