From patchwork Fri Jul 26 00:55:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simei Su X-Patchwork-Id: 57137 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 389511C3B6; Fri, 26 Jul 2019 03:38:10 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 1A9E51C3AA for ; Fri, 26 Jul 2019 03:38:06 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jul 2019 18:38:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,308,1559545200"; d="scan'208";a="181719691" Received: from npg-dpdk-cvl-simeisu-116d153.sh.intel.com ([10.67.116.153]) by orsmga002.jf.intel.com with ESMTP; 25 Jul 2019 18:38:05 -0700 From: simei To: qi.z.zhang@intel.com, jingjing.wu@intel.com, adrien.mazarguil@6wind.com Cc: dev@dpdk.org, simei.su@intel.com Date: Fri, 26 Jul 2019 08:55:10 +0800 Message-Id: <1564102511-99609-2-git-send-email-simei.su@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1564102511-99609-1-git-send-email-simei.su@intel.com> References: <1564030646-73951-1-git-send-email-simei.su@intel.com> <1564102511-99609-1-git-send-email-simei.su@intel.com> Subject: [dpdk-dev] [PATCH v2 1/2] ethdev: add symmetric toeplitz hash support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Simei Su Currently, there are DEFAULT,TOEPLITZ and SIMPLE_XOR hash function. To support symmetric hash by rte_flow RSS action, this patch adds new hash function "Symmetric Toeplitz" which is supported by some hardware. Signed-off-by: Simei Su Acked-by: Ori Kam --- lib/librte_ethdev/rte_flow.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h index b66bf14..77a0c52 100644 --- a/lib/librte_ethdev/rte_flow.h +++ b/lib/librte_ethdev/rte_flow.h @@ -1814,6 +1814,7 @@ enum rte_eth_hash_function { RTE_ETH_HASH_FUNCTION_DEFAULT = 0, RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */ RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */ + RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ, /**< Symmetric Toeplitz */ RTE_ETH_HASH_FUNCTION_MAX, }; From patchwork Fri Jul 26 00:55:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simei Su X-Patchwork-Id: 57138 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E47D61C3BA; Fri, 26 Jul 2019 03:38:13 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 71FA41C3B3 for ; Fri, 26 Jul 2019 03:38:09 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jul 2019 18:38:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,308,1559545200"; d="scan'208";a="181719695" Received: from npg-dpdk-cvl-simeisu-116d153.sh.intel.com ([10.67.116.153]) by orsmga002.jf.intel.com with ESMTP; 25 Jul 2019 18:38:07 -0700 From: simei To: qi.z.zhang@intel.com, jingjing.wu@intel.com, adrien.mazarguil@6wind.com Cc: dev@dpdk.org, simei.su@intel.com Date: Fri, 26 Jul 2019 08:55:11 +0800 Message-Id: <1564102511-99609-3-git-send-email-simei.su@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1564102511-99609-1-git-send-email-simei.su@intel.com> References: <1564030646-73951-1-git-send-email-simei.su@intel.com> <1564102511-99609-1-git-send-email-simei.su@intel.com> Subject: [dpdk-dev] [PATCH v2 2/2] app/testpmd: add symmetric toeplitz hash support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Simei Su This patch adds command line support for Symmetric Toeplitz hash configuration. Signed-off-by: Simei Su Acked-by: Ori Kam --- 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 " - "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|) \ (enable|disable)