From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ivan.boule@6wind.com>
Received: from smtp-ft6.fr.colt.net (smtp-ft6.fr.colt.net [213.41.78.198])
 by dpdk.org (Postfix) with ESMTP id 7B39DB0B9
 for <dev@dpdk.org>; Fri, 16 May 2014 10:58:42 +0200 (CEST)
Received: from smtp-ex6.fr.colt.net (smtp-ex6.fr.colt.net [213.41.78.122])
 by smtp-ft6.fr.colt.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id
 s4G8wnQo032528 for <dev@dpdk.org>; Fri, 16 May 2014 10:58:49 +0200
Received: from 33.106-14-84.ripe.coltfrance.com ([84.14.106.33]
 helo=proxy.6wind.com) by smtp-ex6.fr.colt.net with esmtp (Exim)
 (envelope-from <ivan.boule@6wind.com>) id 1WlDyc-00059w-2l
 for <dev@dpdk.org>; Fri, 16 May 2014 10:58:51 +0200
Received: from 6wind.com (unknown [10.16.0.189])
 by proxy.6wind.com (Postfix) with SMTP id 59D805AE8E;
 Fri, 16 May 2014 10:58:49 +0200 (CEST)
Received: by 6wind.com (sSMTP sendmail emulation);
 Fri, 16 May 2014 10:58:48 +0200
From: Ivan Boule <ivan.boule@6wind.com>
To: dev@dpdk.org
Date: Fri, 16 May 2014 10:58:41 +0200
Message-Id: <1400230723-2830-4-git-send-email-ivan.boule@6wind.com>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1400230723-2830-1-git-send-email-ivan.boule@6wind.com>
References: <1400230723-2830-1-git-send-email-ivan.boule@6wind.com>
X-ACL-Warn: 1/1 recipients OK.
Subject: [dpdk-dev] [PATCH v2 3/5] app/testpmd: configure RSS without restart
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://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: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 16 May 2014 08:58:43 -0000

The function cmd_config_rss_parsed() associated with the command
"port config rss all" required to first stop all ports, in order to
then entirely re-configure all ports with the new RSS hash computation
parameters.
Use now the new function rte_eth_dev_rss_hash_conf_update() that dynamically
only changes the RSS hash computation parameters of a port, without needing
to previously stop the port.

Signed-off-by: Ivan Boule <ivan.boule@6wind.com>
---
 app/test-pmd/cmdline.c |   20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 9cc680f..407a2b9 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1145,26 +1145,22 @@ cmd_config_rss_parsed(void *parsed_result,
 			__attribute__((unused)) void *data)
 {
 	struct cmd_config_rss *res = parsed_result;
-
-	if (!all_ports_stopped()) {
-		printf("Please stop all ports first\n");
-		return;
-	}
+	struct rte_eth_rss_conf rss_conf;
+	uint8_t i;
 
 	if (!strcmp(res->value, "ip"))
-		rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6;
+		rss_conf.rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6;
 	else if (!strcmp(res->value, "udp"))
-		rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6 | ETH_RSS_IPV4_UDP;
+		rss_conf.rss_hf = ETH_RSS_IPV4_UDP | ETH_RSS_IPV6_UDP;
 	else if (!strcmp(res->value, "none"))
-		rss_hf = 0;
+		rss_conf.rss_hf = 0;
 	else {
 		printf("Unknown parameter\n");
 		return;
 	}
-
-	init_port_config();
-
-	cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1);
+	rss_conf.rss_key = NULL;
+	for (i = 0; i < rte_eth_dev_count(); i++)
+		rte_eth_dev_rss_hash_update(i, &rss_conf);
 }
 
 cmdline_parse_token_string_t cmd_config_rss_port =
-- 
1.7.10.4