diff mbox

[dpdk-dev,RFC,7/7] app/testpmd: support new rss offloads

Message ID 1418974005-15536-8-git-send-email-helin.zhang@intel.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Helin Zhang Dec. 19, 2014, 7:26 a.m. UTC
RSS offloads supported 'ip' and 'udp' only, which did not
demonstrate all of the hardware capabilities. The modifications
adds support of new RSS offloads of 'tcp', 'sctp' and 'all'.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
---
 app/test-pmd/cmdline.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index e7bab0c..cd321e9 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -588,7 +588,7 @@  static void cmd_help_long_parsed(void *parsed_result,
 			"    Set crc-strip/rx-checksum/hardware-vlan/drop_en"
 			" for ports.\n\n"
 
-			"port config all rss (ip|udp|none)\n"
+			"port config all rss (all|ip|tcp|udp|sctp|none)\n"
 			"    Set the RSS mode.\n\n"
 
 			"port config port-id rss reta (hash,queue)[,(hash,queue)]\n"
@@ -1382,10 +1382,17 @@  cmd_config_rss_parsed(void *parsed_result,
 	struct rte_eth_rss_conf rss_conf;
 	uint8_t i;
 
-	if (!strcmp(res->value, "ip"))
+	if (!strcmp(res->value, "all"))
+		rss_conf.rss_hf = ETH_RSS_IP | ETH_RSS_TCP |
+				ETH_RSS_UDP | ETH_RSS_SCTP;
+	else if (!strcmp(res->value, "ip"))
 		rss_conf.rss_hf = ETH_RSS_IP;
 	else if (!strcmp(res->value, "udp"))
 		rss_conf.rss_hf = ETH_RSS_UDP;
+	else if (!strcmp(res->value, "tcp"))
+		rss_conf.rss_hf = ETH_RSS_TCP;
+	else if (!strcmp(res->value, "sctp"))
+		rss_conf.rss_hf = ETH_RSS_SCTP;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else {
@@ -1406,12 +1413,13 @@  cmdline_parse_token_string_t cmd_config_rss_all =
 cmdline_parse_token_string_t cmd_config_rss_name =
 	TOKEN_STRING_INITIALIZER(struct cmd_config_rss, name, "rss");
 cmdline_parse_token_string_t cmd_config_rss_value =
-	TOKEN_STRING_INITIALIZER(struct cmd_config_rss, value, "ip#udp#none");
+	TOKEN_STRING_INITIALIZER(struct cmd_config_rss, value,
+		"all#ip#tcp#udp#sctp#none");
 
 cmdline_parse_inst_t cmd_config_rss = {
 	.f = cmd_config_rss_parsed,
 	.data = NULL,
-	.help_str = "port config all rss ip|udp|none",
+	.help_str = "port config all rss all|ip|tcp|udp|sctp|none",
 	.tokens = {
 		(void *)&cmd_config_rss_port,
 		(void *)&cmd_config_rss_keyword,