summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorSimei Su <simei.su@intel.com>2019-10-01 17:22:13 +0800
committerFerruh Yigit <ferruh.yigit@intel.com>2019-10-07 15:00:58 +0200
commit1286c035673419dac254f596f51a33efdc19d908 (patch)
treed017439b550b8825fb41867e58e7db79eb99853e /app
parentd172886440996b13ac0d681379fff8fc11873506 (diff)
downloaddpdk-1286c035673419dac254f596f51a33efdc19d908.zip
dpdk-1286c035673419dac254f596f51a33efdc19d908.tar.gz
dpdk-1286c035673419dac254f596f51a33efdc19d908.tar.xz
app/testpmd: support symmetric Toeplitz hash
This patch adds command line support for Symmetric Toeplitz hash configuration. Signed-off-by: Simei Su <simei.su@intel.com> Reviewed-by: Qi Zhang <qi.z.zhang@intel.com> Acked-by: Ori Kam <orika@mellanox.com>
Diffstat (limited to 'app')
-rw-r--r--app/test-pmd/cmdline.c12
-rw-r--r--app/test-pmd/cmdline_flow.c12
2 files changed, 20 insertions, 4 deletions
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index def471d..ded56bf 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1056,7 +1056,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"
@@ -12196,6 +12196,9 @@ cmd_get_hash_global_config_parsed(void *parsed_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;
@@ -12269,6 +12272,9 @@ cmd_set_hash_global_config_parsed(void *parsed_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;
@@ -12298,7 +12304,7 @@ cmdline_parse_token_num_t cmd_set_hash_global_config_port_id =
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,
@@ -12312,7 +12318,7 @@ cmdline_parse_inst_t cmd_set_hash_global_config = {
.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 ddb49bc..b26b8bf 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -227,6 +227,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,
@@ -2543,7 +2544,8 @@ static const struct token token_list[] = {
.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",
@@ -2560,6 +2562,11 @@ static const struct token token_list[] = {
.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\"",
@@ -3678,6 +3685,9 @@ parse_vc_action_rss_func(struct context *ctx, const struct token *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;
}