DPDK patches and discussions
 help / color / mirror / Atom feed
From: simei <simei.su@intel.com>
To: qi.z.zhang@intel.com, jingjing.wu@intel.com, adrien.mazarguil@6wind.com
Cc: dev@dpdk.org, simei.su@intel.com
Subject: [dpdk-dev] [PATCH v2 2/2] app/testpmd: add symmetric toeplitz hash support
Date: Fri, 26 Jul 2019 08:55:11 +0800	[thread overview]
Message-ID: <1564102511-99609-3-git-send-email-simei.su@intel.com> (raw)
In-Reply-To: <1564102511-99609-1-git-send-email-simei.su@intel.com>

From: Simei Su <simei.su@intel.com>

This patch adds command line support for Symmetric Toeplitz
hash configuration.

Signed-off-by: Simei Su <simei.su@intel.com>
---
 app/test-pmd/cmdline.c                      | 12 +++++++++---
 app/test-pmd/cmdline_flow.c                 | 12 +++++++++++-
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  2 +-
 3 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index a28362d..60c159f 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1055,7 +1055,7 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"get_hash_global_config (port_id)\n"
 			"    Get the global configurations of hash filters.\n\n"
 
-			"set_hash_global_config (port_id) (toeplitz|simple_xor|default)"
+			"set_hash_global_config (port_id) (toeplitz|simple_xor|symmetric_toeplitz|default)"
 			" (ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|ipv6|"
 			"ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|l2_payload)"
 			" (enable|disable)\n"
@@ -12258,6 +12258,9 @@ struct cmd_get_hash_global_config_result {
 	case RTE_ETH_HASH_FUNCTION_SIMPLE_XOR:
 		printf("Hash function is Simple XOR\n");
 		break;
+	case RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ:
+		printf("Hash function is Symmetric Toeplitz\n");
+		break;
 	default:
 		printf("Unknown hash function\n");
 		break;
@@ -12331,6 +12334,9 @@ struct cmd_set_hash_global_config_result {
 	else if (!strcmp(res->hash_func, "simple_xor"))
 		info.info.global_conf.hash_func =
 			RTE_ETH_HASH_FUNCTION_SIMPLE_XOR;
+	else if	(!strcmp(res->hash_func, "symmetric_toeplitz"))
+		info.info.global_conf.hash_func =
+			RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ;
 	else if (!strcmp(res->hash_func, "default"))
 		info.info.global_conf.hash_func =
 			RTE_ETH_HASH_FUNCTION_DEFAULT;
@@ -12360,7 +12366,7 @@ struct cmd_set_hash_global_config_result {
 		port_id, UINT16);
 cmdline_parse_token_string_t cmd_set_hash_global_config_hash_func =
 	TOKEN_STRING_INITIALIZER(struct cmd_set_hash_global_config_result,
-		hash_func, "toeplitz#simple_xor#default");
+		hash_func, "toeplitz#simple_xor#symmetric_toeplitz#default");
 cmdline_parse_token_string_t cmd_set_hash_global_config_flow_type =
 	TOKEN_STRING_INITIALIZER(struct cmd_set_hash_global_config_result,
 		flow_type,
@@ -12374,7 +12380,7 @@ struct cmd_set_hash_global_config_result {
 	.f = cmd_set_hash_global_config_parsed,
 	.data = NULL,
 	.help_str = "set_hash_global_config <port_id> "
-		"toeplitz|simple_xor|default "
+		"toeplitz|simple_xor|symmetric_toeplitz|default "
 		"ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|"
 		"ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|"
 		"l2_payload enable|disable",
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 4958713..4968df9 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -220,6 +220,7 @@ enum index {
 	ACTION_RSS_FUNC_DEFAULT,
 	ACTION_RSS_FUNC_TOEPLITZ,
 	ACTION_RSS_FUNC_SIMPLE_XOR,
+	ACTION_RSS_FUNC_SYMMETRIC_TOEPLITZ,
 	ACTION_RSS_TYPES,
 	ACTION_RSS_TYPE,
 	ACTION_RSS_KEY,
@@ -2457,7 +2458,8 @@ static int comp_vc_action_rss_queue(struct context *, const struct token *,
 		.next = NEXT(action_rss,
 			     NEXT_ENTRY(ACTION_RSS_FUNC_DEFAULT,
 					ACTION_RSS_FUNC_TOEPLITZ,
-					ACTION_RSS_FUNC_SIMPLE_XOR)),
+					ACTION_RSS_FUNC_SIMPLE_XOR,
+					ACTION_RSS_FUNC_SYMMETRIC_TOEPLITZ)),
 	},
 	[ACTION_RSS_FUNC_DEFAULT] = {
 		.name = "default",
@@ -2474,6 +2476,11 @@ static int comp_vc_action_rss_queue(struct context *, const struct token *,
 		.help = "simple XOR hash function",
 		.call = parse_vc_action_rss_func,
 	},
+	[ACTION_RSS_FUNC_SYMMETRIC_TOEPLITZ] = {
+		.name = "symmetric_toeplitz",
+		.help = "Symmetric Toeplitz hash function",
+		.call = parse_vc_action_rss_func,
+	},
 	[ACTION_RSS_LEVEL] = {
 		.name = "level",
 		.help = "encapsulation level for \"types\"",
@@ -3588,6 +3595,9 @@ static int comp_vc_action_rss_queue(struct context *, const struct token *,
 	case ACTION_RSS_FUNC_SIMPLE_XOR:
 		func = RTE_ETH_HASH_FUNCTION_SIMPLE_XOR;
 		break;
+	case ACTION_RSS_FUNC_SYMMETRIC_TOEPLITZ:
+		func = RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ;
+		break;
 	default:
 		return -1;
 	}
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 313e070..6343638 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -3471,7 +3471,7 @@ set_hash_global_config
 
 Set the global configurations of hash filters::
 
-   set_hash_global_config (port_id) (toeplitz|simple_xor|default) \
+   set_hash_global_config (port_id) (toeplitz|simple_xor|symmetric_toeplitz|default) \
    (ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|ipv6|ipv6-frag| \
    ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|l2_payload|<flow_id>) \
    (enable|disable)
-- 
1.8.3.1


  parent reply	other threads:[~2019-07-26  1:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-25  4:57 [dpdk-dev] [PATCH 0/2] " simei
2019-07-25  4:57 ` [dpdk-dev] [PATCH 1/2] ethdev: " simei
2019-07-31 12:08   ` Andrew Rybchenko
2019-07-31 12:30     ` Adrien Mazarguil
2019-07-31 13:03       ` Andrew Rybchenko
2019-07-31 13:43       ` Shahaf Shuler
2019-09-29 11:51         ` Andrew Rybchenko
2019-09-30  3:12           ` Su, Simei
2019-09-30  6:14             ` Andrew Rybchenko
2019-09-30  6:34               ` Su, Simei
2019-09-30  7:49                 ` Zhang, Qi Z
2019-07-25  4:57 ` [dpdk-dev] [PATCH 2/2] app/testpmd: " simei
2019-07-26  0:55 ` [dpdk-dev] [PATCH v2 0/2] " simei
2019-07-26  0:55   ` [dpdk-dev] [PATCH v2 1/2] ethdev: " simei
2019-09-28 18:32     ` Ori Kam
2019-07-26  0:55   ` simei [this message]
2019-09-28 18:39     ` [dpdk-dev] [PATCH v2 2/2] app/testpmd: " Ori Kam
2019-09-24  5:30   ` [dpdk-dev] [PATCH v2 0/2] " Zhang, Qi Z
2019-10-01  9:22   ` [dpdk-dev] [PATCH v3 " Simei Su
2019-10-01  9:22     ` [dpdk-dev] [PATCH v3 1/2] ethdev: " Simei Su
2019-10-01 13:36       ` Andrew Rybchenko
2019-10-01  9:22     ` [dpdk-dev] [PATCH v3 2/2] app/testpmd: " Simei Su
2019-10-01 15:06     ` [dpdk-dev] [PATCH v3 0/2] " Ferruh Yigit
2019-09-23 23:11 ` [dpdk-dev] [PATCH " Zhang, Qi Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1564102511-99609-3-git-send-email-simei.su@intel.com \
    --to=simei.su@intel.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=qi.z.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).