From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id E26D68E67 for ; Wed, 18 Apr 2018 13:07:00 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from xuemingl@mellanox.com) with ESMTPS (AES256-SHA encrypted); 18 Apr 2018 14:08:15 +0300 Received: from dev-r630-06.mtbc.labs.mlnx (dev-r630-06.mtbc.labs.mlnx [10.12.205.180]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id w3IB6tN8017232; Wed, 18 Apr 2018 14:06:56 +0300 Received: from dev-r630-06.mtbc.labs.mlnx (localhost [127.0.0.1]) by dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7) with ESMTP id w3IB6tk6022941; Wed, 18 Apr 2018 19:06:55 +0800 Received: (from xuemingl@localhost) by dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7/Submit) id w3IB6thk022940; Wed, 18 Apr 2018 19:06:55 +0800 From: Xueming Li To: Shahaf Shuler , Nelio Laranjeiro , Wenzhuo Lu , Jingjing Wu , Thomas Monjalon Cc: Xueming Li , dev@dpdk.org Date: Wed, 18 Apr 2018 19:06:48 +0800 Message-Id: <20180418110648.22883-2-xuemingl@mellanox.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20180418110648.22883-1-xuemingl@mellanox.com> References: <20180418110648.22883-1-xuemingl@mellanox.com> In-Reply-To: <20180409121035.148813-1-xuemingl@mellanox.com> References: <20180409121035.148813-1-xuemingl@mellanox.com> Subject: [dpdk-dev] [PATCH v3 2/2] app/testpmd: only config supported RSS hash types 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: , X-List-Received-Date: Wed, 18 Apr 2018 11:07:01 -0000 "port config all rss all" command will fail on PMD that not support any of hard coding RSS hash types. This patch changed hard coding hash types to supported types retrieved from device info. Signed-off-by: Xueming Li --- app/test-pmd/cmdline.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 512e3b55e..d357de7e6 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -1998,6 +1998,7 @@ cmd_config_rss_parsed(void *parsed_result, { struct cmd_config_rss *res = parsed_result; struct rte_eth_rss_conf rss_conf = { .rss_key_len = 0, }; + struct rte_eth_dev_info dev_info = {0}; int diag; uint8_t i; @@ -2034,6 +2035,12 @@ cmd_config_rss_parsed(void *parsed_result, } rss_conf.rss_key = NULL; for (i = 0; i < rte_eth_dev_count(); i++) { + if (!strcmp(res->value, "all")) { + rte_eth_dev_info_get(i, &dev_info); + if (dev_info.flow_type_rss_offloads) + rss_conf.rss_hf = + dev_info.flow_type_rss_offloads; + } diag = rte_eth_dev_rss_hash_update(i, &rss_conf); if (diag < 0) printf("Configuration of RSS hash at ethernet port %d " -- 2.13.3