[v3,1/2] ethdev: add symmetric toeplitz hash support

Message ID 1569921733-10631-2-git-send-email-simei.su@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series add symmetric toeplitz hash support |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-compilation success Compile Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

Simei Su Oct. 1, 2019, 9:22 a.m. UTC
  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 <simei.su@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Ori Kam <orika@mellanox.com>
---
 lib/librte_ethdev/rte_flow.h | 6 ++++++
 1 file changed, 6 insertions(+)
  

Comments

Andrew Rybchenko Oct. 1, 2019, 1:36 p.m. UTC | #1
On 10/1/19 12:22 PM, Simei Su wrote:
> 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 <simei.su@intel.com>
> Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
> Acked-by: Ori Kam <orika@mellanox.com>

Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>

> ---
>   lib/librte_ethdev/rte_flow.h | 6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
> index 354cb1d..ca4e868 100644
> --- a/lib/librte_ethdev/rte_flow.h
> +++ b/lib/librte_ethdev/rte_flow.h
> @@ -1814,6 +1814,12 @@ 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 */
> +	/**
> +	 * Symmetric Toeplitz: src, dst will be replaced by
> +	 * xor(src, dst). For the case with src/dst only,
> +	 * src or dst address will xor with zero pair.
> +	 */
> +	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
>   	RTE_ETH_HASH_FUNCTION_MAX,
>   };

It looks like symmetric does not make sense in the case of src/dst only.
The goal of symmetric function is to make it the same for both directions.
  

Patch

diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index 354cb1d..ca4e868 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -1814,6 +1814,12 @@  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 */
+	/**
+	 * Symmetric Toeplitz: src, dst will be replaced by
+	 * xor(src, dst). For the case with src/dst only,
+	 * src or dst address will xor with zero pair.
+	 */
+	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
 	RTE_ETH_HASH_FUNCTION_MAX,
 };