From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <xuemingl@mellanox.com>
Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])
 by dpdk.org (Postfix) with ESMTP id A92C71B7FD
 for <dev@dpdk.org>; Mon,  9 Apr 2018 14:30:01 +0200 (CEST)
Received: from Internal Mail-Server by MTLPINE1 (envelope-from
 xuemingl@mellanox.com)
 with ESMTPS (AES256-SHA encrypted); 9 Apr 2018 15:12:10 +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 w39CB1Lw018806;
 Mon, 9 Apr 2018 15:11:02 +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 w39CB1rA148864;
 Mon, 9 Apr 2018 20:11:01 +0800
Received: (from xuemingl@localhost)
 by dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7/Submit) id w39CB18n148863;
 Mon, 9 Apr 2018 20:11:01 +0800
From: Xueming Li <xuemingl@mellanox.com>
To: Shahaf Shuler <shahafs@mellanox.com>,
 Nelio Laranjeiro <notifications@github.com>,
 Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,
 Thomas Monjalon <thomas@monjalon.net>
Cc: Xueming Li <xuemingl@mellanox.com>, dev@dpdk.org
Date: Mon,  9 Apr 2018 20:10:35 +0800
Message-Id: <20180409121035.148813-2-xuemingl@mellanox.com>
X-Mailer: git-send-email 2.13.3
In-Reply-To: <20180409121035.148813-1-xuemingl@mellanox.com>
References: <20180409121035.148813-1-xuemingl@mellanox.com>
In-Reply-To: <20180318073720.84176-1-xuemingl@mellanox.com>
References: <20180318073720.84176-1-xuemingl@mellanox.com>
Subject: [dpdk-dev] [PATCH v1 2/2] app/testpmd: config all supported RSS
	functions
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Apr 2018 12:30:02 -0000

Only configure RSS hash functions supported by the device.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
 app/test-pmd/cmdline.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 40b31ad7e..c41dd71ce 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1879,6 +1879,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;
 
@@ -1915,6 +1916,11 @@ 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