DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] doc: deprecation notice to add new hash function
@ 2023-05-24 11:38 Xueming Li
  2023-05-24 12:50 ` Ori Kam
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Xueming Li @ 2023-05-24 11:38 UTC (permalink / raw)
  To: Ori Kam; +Cc: xuemingl, dev, stable

Deprecation notice to annouce new RSS hash function type.
The new symmetric hash function sort L3 address and L4 ports
before Toeplitz calculation.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
---
 doc/guides/rel_notes/deprecation.rst | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index dcc1ca1696..fc988c3bfe 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -163,3 +163,7 @@ Deprecation Notices
   The new port library API (functions rte_swx_port_*)
   will gradually transition from experimental to stable status
   starting with DPDK 23.07 release.
+
+* ethdev: The enum ``rte_eth_hash_function`` will be extended to add
+  new subtype value ``RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT`` in
+  DPDK 23.11.
-- 
2.25.1


^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [PATCH] doc: deprecation notice to add new hash function
  2023-05-24 11:38 [PATCH] doc: deprecation notice to add new hash function Xueming Li
@ 2023-05-24 12:50 ` Ori Kam
  2023-05-24 14:49 ` Stephen Hemminger
  2023-08-07 11:54 ` [PATCH] ethdev: add new symmetric " Xueming Li
  2 siblings, 0 replies; 23+ messages in thread
From: Ori Kam @ 2023-05-24 12:50 UTC (permalink / raw)
  To: Xueming(Steven) Li; +Cc: dev, stable

Hi Xueming,

> -----Original Message-----
> From: Xueming(Steven) Li <xuemingl@nvidia.com>
> Sent: Wednesday, May 24, 2023 2:38 PM
> 
> Deprecation notice to annouce new RSS hash function type.
> The new symmetric hash function sort L3 address and L4 ports
> before Toeplitz calculation.
> 
> Signed-off-by: Xueming Li <xuemingl@nvidia.com>
> ---
>  doc/guides/rel_notes/deprecation.rst | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/doc/guides/rel_notes/deprecation.rst
> b/doc/guides/rel_notes/deprecation.rst
> index dcc1ca1696..fc988c3bfe 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -163,3 +163,7 @@ Deprecation Notices
>    The new port library API (functions rte_swx_port_*)
>    will gradually transition from experimental to stable status
>    starting with DPDK 23.07 release.
> +
> +* ethdev: The enum ``rte_eth_hash_function`` will be extended to add
> +  new subtype value
> ``RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT`` in
> +  DPDK 23.11.
> --
> 2.25.1

Acked-by: Ori Kam <orika@nvidia.com>
Best,
Ori

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] doc: deprecation notice to add new hash function
  2023-05-24 11:38 [PATCH] doc: deprecation notice to add new hash function Xueming Li
  2023-05-24 12:50 ` Ori Kam
@ 2023-05-24 14:49 ` Stephen Hemminger
  2023-07-28 15:10   ` Thomas Monjalon
  2023-08-07 11:54 ` [PATCH] ethdev: add new symmetric " Xueming Li
  2 siblings, 1 reply; 23+ messages in thread
From: Stephen Hemminger @ 2023-05-24 14:49 UTC (permalink / raw)
  To: Xueming Li; +Cc: Ori Kam, dev, stable

On Wed, 24 May 2023 19:38:27 +0800
Xueming Li <xuemingl@nvidia.com> wrote:

> +
> +* ethdev: The enum ``rte_eth_hash_function`` will be extended to add
> +  new subtype value ``RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT`` in
> +  DPDK 23.11.

Simple new additions like this don't need to clutter the deprecation
part of the release notes. This is for changes which would break applications.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] doc: deprecation notice to add new hash function
  2023-05-24 14:49 ` Stephen Hemminger
@ 2023-07-28 15:10   ` Thomas Monjalon
  0 siblings, 0 replies; 23+ messages in thread
From: Thomas Monjalon @ 2023-07-28 15:10 UTC (permalink / raw)
  To: Xueming Li, Stephen Hemminger; +Cc: dev, Ori Kam

24/05/2023 16:49, Stephen Hemminger:
> On Wed, 24 May 2023 19:38:27 +0800
> Xueming Li <xuemingl@nvidia.com> wrote:
> 
> > +
> > +* ethdev: The enum ``rte_eth_hash_function`` will be extended to add
> > +  new subtype value ``RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT`` in
> > +  DPDK 23.11.
> 
> Simple new additions like this don't need to clutter the deprecation
> part of the release notes. This is for changes which would break applications.

Marking this patch as superseded.
My patch is mentioning such case: adding an enum field.
https://patches.dpdk.org/project/dpdk/patch/20230728142946.1201459-1-thomas@monjalon.net/




^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH] ethdev: add new symmetric hash function
  2023-05-24 11:38 [PATCH] doc: deprecation notice to add new hash function Xueming Li
  2023-05-24 12:50 ` Ori Kam
  2023-05-24 14:49 ` Stephen Hemminger
@ 2023-08-07 11:54 ` Xueming Li
  2023-08-07 12:33   ` Ori Kam
                     ` (3 more replies)
  2 siblings, 4 replies; 23+ messages in thread
From: Xueming Li @ 2023-08-07 11:54 UTC (permalink / raw)
  To: Ori Kam; +Cc: dev, xuemingl

The new symmetric hash function swap src/dst L3 address and
L4 ports automatically by sorting.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
---
 lib/ethdev/rte_flow.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 86ed98c562..ec6dd170b5 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -3204,6 +3204,11 @@ enum rte_eth_hash_function {
 	 * src or dst address will xor with zero pair.
 	 */
 	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
+	/**
+	 * Symmetric Toeplitz: src, dst will be swapped
+	 * automatically by sorting.
+	 */
+	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
 	RTE_ETH_HASH_FUNCTION_MAX,
 };
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [PATCH] ethdev: add new symmetric hash function
  2023-08-07 11:54 ` [PATCH] ethdev: add new symmetric " Xueming Li
@ 2023-08-07 12:33   ` Ori Kam
  2023-08-07 22:32   ` Ivan Malov
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 23+ messages in thread
From: Ori Kam @ 2023-08-07 12:33 UTC (permalink / raw)
  To: Xueming(Steven) Li; +Cc: dev

Hi Xueming,


> -----Original Message-----
> From: Xueming(Steven) Li <xuemingl@nvidia.com>
> Sent: Monday, August 7, 2023 2:55 PM
> 
> The new symmetric hash function swap src/dst L3 address and
> L4 ports automatically by sorting.
> 
> Signed-off-by: Xueming Li <xuemingl@nvidia.com>
> ---

Acked-by: Ori Kam <orika@nvidia.com>
Best,
Ori

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] ethdev: add new symmetric hash function
  2023-08-07 11:54 ` [PATCH] ethdev: add new symmetric " Xueming Li
  2023-08-07 12:33   ` Ori Kam
@ 2023-08-07 22:32   ` Ivan Malov
  2023-08-08  1:43     ` fengchengwen
  2023-08-27  8:17   ` [PATCH v2 1/2] " Xueming Li
  2023-08-27  8:17   ` [PATCH v2 2/2] net/mlx5: support new RSS " Xueming Li
  3 siblings, 1 reply; 23+ messages in thread
From: Ivan Malov @ 2023-08-07 22:32 UTC (permalink / raw)
  To: Xueming Li; +Cc: Ori Kam, dev

Hi,

Please see my notes below.

On Mon, 7 Aug 2023, Xueming Li wrote:

> The new symmetric hash function swap src/dst L3 address and
> L4 ports automatically by sorting.
>
> Signed-off-by: Xueming Li <xuemingl@nvidia.com>
> ---
> lib/ethdev/rte_flow.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
> index 86ed98c562..ec6dd170b5 100644
> --- a/lib/ethdev/rte_flow.h
> +++ b/lib/ethdev/rte_flow.h
> @@ -3204,6 +3204,11 @@ enum rte_eth_hash_function {
> 	 * src or dst address will xor with zero pair.
> 	 */
> 	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
> +	/**
> +	 * Symmetric Toeplitz: src, dst will be swapped
> +	 * automatically by sorting.

This is very vague. Consider:

For symmetric Toeplitz, four inputs are prepared as follows:
- src_addr | dst_addr
- src_addr ^ dst_addr
- src_port | dst_port
- src_port ^ dst_port
and then passed to the regular Toeplitz function.

It is important to be as specific as possible
so that readers don't have to guess.

Thank you.

> +	 */
> +	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
> 	RTE_ETH_HASH_FUNCTION_MAX,
> };
>
> -- 
> 2.25.1
>
>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] ethdev: add new symmetric hash function
  2023-08-07 22:32   ` Ivan Malov
@ 2023-08-08  1:43     ` fengchengwen
  2023-08-09 12:00       ` Xueming(Steven) Li
  0 siblings, 1 reply; 23+ messages in thread
From: fengchengwen @ 2023-08-08  1:43 UTC (permalink / raw)
  To: Ivan Malov, Xueming Li; +Cc: Ori Kam, dev

On 2023/8/8 6:32, Ivan Malov wrote:
> Hi,
> 
> Please see my notes below.
> 
> On Mon, 7 Aug 2023, Xueming Li wrote:
> 
>> The new symmetric hash function swap src/dst L3 address and
>> L4 ports automatically by sorting.
>>
>> Signed-off-by: Xueming Li <xuemingl@nvidia.com>
>> ---
>> lib/ethdev/rte_flow.h | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
>> index 86ed98c562..ec6dd170b5 100644
>> --- a/lib/ethdev/rte_flow.h
>> +++ b/lib/ethdev/rte_flow.h
>> @@ -3204,6 +3204,11 @@ enum rte_eth_hash_function {
>>      * src or dst address will xor with zero pair.
>>      */
>>     RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
>> +    /**
>> +     * Symmetric Toeplitz: src, dst will be swapped
>> +     * automatically by sorting.
> 
> This is very vague. Consider:
> 
> For symmetric Toeplitz, four inputs are prepared as follows:
> - src_addr | dst_addr
> - src_addr ^ dst_addr
> - src_port | dst_port
> - src_port ^ dst_port
> and then passed to the regular Toeplitz function.
> 
> It is important to be as specific as possible
> so that readers don't have to guess.

+1 for this, I try to understand and google it, but can't find useful info.

Also, how this new algo with src/dst only ?

> 
> Thank you.
> 
>> +     */
>> +    RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
>>     RTE_ETH_HASH_FUNCTION_MAX,

The new value will break the definition of MAX (maybe ABI compatible).
but I found only hns3 drivers use RTE_ETH_HASH_FUNCTION_MAX, not sure the application will use it.

>> };
>>
>> -- 
>> 2.25.1
>>
>>
> 
> .

^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [PATCH] ethdev: add new symmetric hash function
  2023-08-08  1:43     ` fengchengwen
@ 2023-08-09 12:00       ` Xueming(Steven) Li
  0 siblings, 0 replies; 23+ messages in thread
From: Xueming(Steven) Li @ 2023-08-09 12:00 UTC (permalink / raw)
  To: fengchengwen, Ivan Malov; +Cc: Ori Kam, dev



> -----Original Message-----
> From: fengchengwen <fengchengwen@huawei.com>
> Sent: 8/8/2023 9:43
> To: Ivan Malov <ivan.malov@arknetworks.am>; Xueming(Steven) Li
> <xuemingl@nvidia.com>
> Cc: Ori Kam <orika@nvidia.com>; dev@dpdk.org
> Subject: Re: [PATCH] ethdev: add new symmetric hash function
> 
> On 2023/8/8 6:32, Ivan Malov wrote:
> > Hi,
> >
> > Please see my notes below.
> >
> > On Mon, 7 Aug 2023, Xueming Li wrote:
> >
> >> The new symmetric hash function swap src/dst L3 address and
> >> L4 ports automatically by sorting.
> >>
> >> Signed-off-by: Xueming Li <xuemingl@nvidia.com>
> >> ---
> >> lib/ethdev/rte_flow.h | 5 +++++
> >> 1 file changed, 5 insertions(+)
> >>
> >> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index
> >> 86ed98c562..ec6dd170b5 100644
> >> --- a/lib/ethdev/rte_flow.h
> >> +++ b/lib/ethdev/rte_flow.h
> >> @@ -3204,6 +3204,11 @@ enum rte_eth_hash_function {
> >>      * src or dst address will xor with zero pair.
> >>      */
> >>     RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
> >> +    /**
> >> +     * Symmetric Toeplitz: src, dst will be swapped
> >> +     * automatically by sorting.
> >
> > This is very vague. Consider:
> >
> > For symmetric Toeplitz, four inputs are prepared as follows:
> > - src_addr | dst_addr
> > - src_addr ^ dst_addr
> > - src_port | dst_port
> > - src_port ^ dst_port
> > and then passed to the regular Toeplitz function.
> >
> > It is important to be as specific as possible so that readers don't
> > have to guess.
> 
> +1 for this, I try to understand and google it, but can't find useful info.
> 
> Also, how this new algo with src/dst only ?
> 

Thanks for taking care of this. 
When set the L3 and the L4 fields are sorted prior to the hash function.
  If src_ip > dst_ip, swap src_ip and dst_ip.
  If src_port > dst_port, swap src_port and dst_port.

> >
> > Thank you.
> >
> >> +     */
> >> +    RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
> >>     RTE_ETH_HASH_FUNCTION_MAX,
> 
> The new value will break the definition of MAX (maybe ABI compatible).
> but I found only hns3 drivers use RTE_ETH_HASH_FUNCTION_MAX, not sure
> the application will use it.
> 
> >> };
> >>
> >> --
> >> 2.25.1
> >>
> >>
> >
> > .

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v2 1/2] ethdev: add new symmetric hash function
  2023-08-07 11:54 ` [PATCH] ethdev: add new symmetric " Xueming Li
  2023-08-07 12:33   ` Ori Kam
  2023-08-07 22:32   ` Ivan Malov
@ 2023-08-27  8:17   ` Xueming Li
  2023-08-30  6:55     ` Ori Kam
  2023-08-30  7:50     ` lihuisong (C)
  2023-08-27  8:17   ` [PATCH v2 2/2] net/mlx5: support new RSS " Xueming Li
  3 siblings, 2 replies; 23+ messages in thread
From: Xueming Li @ 2023-08-27  8:17 UTC (permalink / raw)
  To: Ori Kam; +Cc: xuemingl, dev, fengchengwen, Ivan Malov

The new symmetric hash function swap src/dst L3 address and
L4 ports automatically by sorting.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
---
 lib/ethdev/rte_flow.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 2ebb76dbc0..4f4421ca50 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -3196,6 +3196,13 @@ enum rte_eth_hash_function {
 	 * src or dst address will xor with zero pair.
 	 */
 	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
+	/**
+	 * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
+	 * the hash function.
+	 *  If src_ip > dst_ip, swap src_ip and dst_ip.
+	 *  If src_port > dst_port, swap src_port and dst_port.
+	 */
+	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
 	RTE_ETH_HASH_FUNCTION_MAX,
 };
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v2 2/2] net/mlx5: support new RSS symmetric hash function
  2023-08-07 11:54 ` [PATCH] ethdev: add new symmetric " Xueming Li
                     ` (2 preceding siblings ...)
  2023-08-27  8:17   ` [PATCH v2 1/2] " Xueming Li
@ 2023-08-27  8:17   ` Xueming Li
  2023-10-29 15:53     ` Ori Kam
  2023-10-30 17:08     ` Raslan Darawsheh
  3 siblings, 2 replies; 23+ messages in thread
From: Xueming Li @ 2023-08-27  8:17 UTC (permalink / raw)
  To: Ori Kam; +Cc: xuemingl, dev, fengchengwen, Ivan Malov

This patch supports the new RSS symmetric hash function:
RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT

The new hash function makes symmetric hash result by swapping
the source and destination IP and L4 port automatically.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
index 3a97975d69..e162baa7da 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -1456,8 +1456,8 @@ struct rte_flow_template_table {
 #define MLX5_RSS_HASH_NONE 0ULL
 
 #define MLX5_RSS_IS_SYMM(func) \
-		((func) == RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ)
-
+		(((func) == RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ) || \
+		 ((func) == RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT))
 
 /* extract next protocol type from Ethernet & VLAN headers */
 #define MLX5_ETHER_TYPE_FROM_HEADER(_s, _m, _itm, _prt) do { \
-- 
2.25.1


^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [PATCH v2 1/2] ethdev: add new symmetric hash function
  2023-08-27  8:17   ` [PATCH v2 1/2] " Xueming Li
@ 2023-08-30  6:55     ` Ori Kam
  2023-09-21 15:49       ` Ferruh Yigit
  2023-08-30  7:50     ` lihuisong (C)
  1 sibling, 1 reply; 23+ messages in thread
From: Ori Kam @ 2023-08-30  6:55 UTC (permalink / raw)
  To: Xueming(Steven) Li; +Cc: dev, fengchengwen, Ivan Malov

Hi Xueming,

> -----Original Message-----
> From: Xueming(Steven) Li <xuemingl@nvidia.com>
> Sent: Sunday, August 27, 2023 11:18 AM
> 
> The new symmetric hash function swap src/dst L3 address and
> L4 ports automatically by sorting.
> 
> Signed-off-by: Xueming Li <xuemingl@nvidia.com>
> ---
>  lib/ethdev/rte_flow.h | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
> index 2ebb76dbc0..4f4421ca50 100644
> --- a/lib/ethdev/rte_flow.h
> +++ b/lib/ethdev/rte_flow.h
> @@ -3196,6 +3196,13 @@ enum rte_eth_hash_function {
>  	 * src or dst address will xor with zero pair.
>  	 */
>  	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
> +	/**
> +	 * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
> +	 * the hash function.
> +	 *  If src_ip > dst_ip, swap src_ip and dst_ip.
> +	 *  If src_port > dst_port, swap src_port and dst_port.
> +	 */
> +	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
>  	RTE_ETH_HASH_FUNCTION_MAX,
>  };
> 
> --
> 2.25.1

Acked-by: Ori Kam <orika@nvidia.com>
Best,
Ori


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 1/2] ethdev: add new symmetric hash function
  2023-08-27  8:17   ` [PATCH v2 1/2] " Xueming Li
  2023-08-30  6:55     ` Ori Kam
@ 2023-08-30  7:50     ` lihuisong (C)
  2023-08-30  8:38       ` Xueming(Steven) Li
  1 sibling, 1 reply; 23+ messages in thread
From: lihuisong (C) @ 2023-08-30  7:50 UTC (permalink / raw)
  To: Xueming Li, Ori Kam; +Cc: dev, fengchengwen, Ivan Malov

Hi Xueming,

在 2023/8/27 16:17, Xueming Li 写道:
> The new symmetric hash function swap src/dst L3 address and
> L4 ports automatically by sorting.
>
> Signed-off-by: Xueming Li <xuemingl@nvidia.com>
> ---
>   lib/ethdev/rte_flow.h | 7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
> index 2ebb76dbc0..4f4421ca50 100644
> --- a/lib/ethdev/rte_flow.h
> +++ b/lib/ethdev/rte_flow.h
> @@ -3196,6 +3196,13 @@ enum rte_eth_hash_function {
>   	 * src or dst address will xor with zero pair.
>   	 */
>   	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
> +	/**
> +	 * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
> +	 * the hash function.
> +	 *  If src_ip > dst_ip, swap src_ip and dst_ip.
> +	 *  If src_port > dst_port, swap src_port and dst_port.
> +	 */
If hash result are computed by the order: "src_ip+dst_ip+src_port+dst_port"
How to obtain the value of every L3 and L4 field obove?
I still cannot understand how to swap and set these values for these 
fields?
> +	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
>   	RTE_ETH_HASH_FUNCTION_MAX,
>   };
>   

^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [PATCH v2 1/2] ethdev: add new symmetric hash function
  2023-08-30  7:50     ` lihuisong (C)
@ 2023-08-30  8:38       ` Xueming(Steven) Li
  2023-08-30 12:42         ` lihuisong (C)
  0 siblings, 1 reply; 23+ messages in thread
From: Xueming(Steven) Li @ 2023-08-30  8:38 UTC (permalink / raw)
  To: lihuisong (C), Ori Kam; +Cc: dev, fengchengwen, Ivan Malov



> -----Original Message-----
> From: lihuisong (C) <lihuisong@huawei.com>
> Sent: 8/30/2023 15:51
> To: Xueming(Steven) Li <xuemingl@nvidia.com>; Ori Kam <orika@nvidia.com>
> Cc: dev@dpdk.org; fengchengwen@huawei.com; Ivan Malov
> <ivan.malov@arknetworks.am>
> Subject: Re: [PATCH v2 1/2] ethdev: add new symmetric hash function
> 
> Hi Xueming,
> 
> 在 2023/8/27 16:17, Xueming Li 写道:
> > The new symmetric hash function swap src/dst L3 address and
> > L4 ports automatically by sorting.
> >
> > Signed-off-by: Xueming Li <xuemingl@nvidia.com>
> > ---
> >   lib/ethdev/rte_flow.h | 7 +++++++
> >   1 file changed, 7 insertions(+)
> >
> > diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index
> > 2ebb76dbc0..4f4421ca50 100644
> > --- a/lib/ethdev/rte_flow.h
> > +++ b/lib/ethdev/rte_flow.h
> > @@ -3196,6 +3196,13 @@ enum rte_eth_hash_function {
> >   	 * src or dst address will xor with zero pair.
> >   	 */
> >   	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
> > +	/**
> > +	 * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
> > +	 * the hash function.
> > +	 *  If src_ip > dst_ip, swap src_ip and dst_ip.
> > +	 *  If src_port > dst_port, swap src_port and dst_port.
> > +	 */
> If hash result are computed by the order: "src_ip+dst_ip+src_port+dst_port"
> How to obtain the value of every L3 and L4 field obove?
> I still cannot understand how to swap and set these values for these fields?

Hash result is computed by order ""src_ip+dst_ip+src_port+dst_port"
Here is a detailed explanation of standard hash and symmetric hash by key:
  https://www.ndsl.kaist.edu/~kyoungsoo/papers/TR-symRSS.pdf

If src_ip > dst_ip, swap them, then the input becomes:
  "dst_ip+src_ip+src_port+dst_port" // please note src and dst IP are swapped.
Same for L4 ports.

> > +	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
> >   	RTE_ETH_HASH_FUNCTION_MAX,
> >   };
> >

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 1/2] ethdev: add new symmetric hash function
  2023-08-30  8:38       ` Xueming(Steven) Li
@ 2023-08-30 12:42         ` lihuisong (C)
  2023-08-30 13:09           ` Xueming(Steven) Li
  0 siblings, 1 reply; 23+ messages in thread
From: lihuisong (C) @ 2023-08-30 12:42 UTC (permalink / raw)
  To: Xueming(Steven) Li, Ori Kam; +Cc: dev, fengchengwen, Ivan Malov


在 2023/8/30 16:38, Xueming(Steven) Li 写道:
>
>> -----Original Message-----
>> From: lihuisong (C) <lihuisong@huawei.com>
>> Sent: 8/30/2023 15:51
>> To: Xueming(Steven) Li <xuemingl@nvidia.com>; Ori Kam <orika@nvidia.com>
>> Cc: dev@dpdk.org; fengchengwen@huawei.com; Ivan Malov
>> <ivan.malov@arknetworks.am>
>> Subject: Re: [PATCH v2 1/2] ethdev: add new symmetric hash function
>>
>> Hi Xueming,
>>
>> 在 2023/8/27 16:17, Xueming Li 写道:
>>> The new symmetric hash function swap src/dst L3 address and
>>> L4 ports automatically by sorting.
>>>
>>> Signed-off-by: Xueming Li <xuemingl@nvidia.com>
>>> ---
>>>    lib/ethdev/rte_flow.h | 7 +++++++
>>>    1 file changed, 7 insertions(+)
>>>
>>> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index
>>> 2ebb76dbc0..4f4421ca50 100644
>>> --- a/lib/ethdev/rte_flow.h
>>> +++ b/lib/ethdev/rte_flow.h
>>> @@ -3196,6 +3196,13 @@ enum rte_eth_hash_function {
>>>    	 * src or dst address will xor with zero pair.
>>>    	 */
>>>    	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
>>> +	/**
>>> +	 * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
>>> +	 * the hash function.
>>> +	 *  If src_ip > dst_ip, swap src_ip and dst_ip.
>>> +	 *  If src_port > dst_port, swap src_port and dst_port.
>>> +	 */
>> If hash result are computed by the order: "src_ip+dst_ip+src_port+dst_port"
>> How to obtain the value of every L3 and L4 field obove?
>> I still cannot understand how to swap and set these values for these fields?
> Hash result is computed by order ""src_ip+dst_ip+src_port+dst_port"
> Here is a detailed explanation of standard hash and symmetric hash by key:
>    https://www.ndsl.kaist.edu/~kyoungsoo/papers/TR-symRSS.pdf
>
> If src_ip > dst_ip, swap them, then the input becomes:
>    "dst_ip+src_ip+src_port+dst_port" // please note src and dst IP are swapped.
> Same for L4 ports.
get it.
What are the advantages of the symmetric toeplitz sort?
Or why swap here?
>
>>> +	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
>>>    	RTE_ETH_HASH_FUNCTION_MAX,
>>>    };
>>>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [PATCH v2 1/2] ethdev: add new symmetric hash function
  2023-08-30 12:42         ` lihuisong (C)
@ 2023-08-30 13:09           ` Xueming(Steven) Li
  2023-08-31  1:23             ` lihuisong (C)
  0 siblings, 1 reply; 23+ messages in thread
From: Xueming(Steven) Li @ 2023-08-30 13:09 UTC (permalink / raw)
  To: lihuisong (C), Ori Kam; +Cc: dev, fengchengwen, Ivan Malov



> -----Original Message-----
> From: lihuisong (C) <lihuisong@huawei.com>
> Sent: 8/30/2023 20:42
> To: Xueming(Steven) Li <xuemingl@nvidia.com>; Ori Kam <orika@nvidia.com>
> Cc: dev@dpdk.org; fengchengwen@huawei.com; Ivan Malov
> <ivan.malov@arknetworks.am>
> Subject: Re: [PATCH v2 1/2] ethdev: add new symmetric hash function
> 
> 
> 在 2023/8/30 16:38, Xueming(Steven) Li 写道:
> >
> >> -----Original Message-----
> >> From: lihuisong (C) <lihuisong@huawei.com>
> >> Sent: 8/30/2023 15:51
> >> To: Xueming(Steven) Li <xuemingl@nvidia.com>; Ori Kam
> >> <orika@nvidia.com>
> >> Cc: dev@dpdk.org; fengchengwen@huawei.com; Ivan Malov
> >> <ivan.malov@arknetworks.am>
> >> Subject: Re: [PATCH v2 1/2] ethdev: add new symmetric hash function
> >>
> >> Hi Xueming,
> >>
> >> 在 2023/8/27 16:17, Xueming Li 写道:
> >>> The new symmetric hash function swap src/dst L3 address and
> >>> L4 ports automatically by sorting.
> >>>
> >>> Signed-off-by: Xueming Li <xuemingl@nvidia.com>
> >>> ---
> >>>    lib/ethdev/rte_flow.h | 7 +++++++
> >>>    1 file changed, 7 insertions(+)
> >>>
> >>> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index
> >>> 2ebb76dbc0..4f4421ca50 100644
> >>> --- a/lib/ethdev/rte_flow.h
> >>> +++ b/lib/ethdev/rte_flow.h
> >>> @@ -3196,6 +3196,13 @@ enum rte_eth_hash_function {
> >>>    	 * src or dst address will xor with zero pair.
> >>>    	 */
> >>>    	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
> >>> +	/**
> >>> +	 * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
> >>> +	 * the hash function.
> >>> +	 *  If src_ip > dst_ip, swap src_ip and dst_ip.
> >>> +	 *  If src_port > dst_port, swap src_port and dst_port.
> >>> +	 */
> >> If hash result are computed by the order:
> "src_ip+dst_ip+src_port+dst_port"
> >> How to obtain the value of every L3 and L4 field obove?
> >> I still cannot understand how to swap and set these values for these fields?
> > Hash result is computed by order ""src_ip+dst_ip+src_port+dst_port"
> > Here is a detailed explanation of standard hash and symmetric hash by key:
> >    https://www.ndsl.kaist.edu/~kyoungsoo/papers/TR-symRSS.pdf
> >
> > If src_ip > dst_ip, swap them, then the input becomes:
> >    "dst_ip+src_ip+src_port+dst_port" // please note src and dst IP are
> swapped.
> > Same for L4 ports.
> get it.
> What are the advantages of the symmetric toeplitz sort?
> Or why swap here?

It's a different symmetric hash calculation, hardware can support either/all of them.

From calculation perspective, the hash result distribution is better, the result is more
suitable to be used as hash table key.

> >
> >>> +	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
> >>>    	RTE_ETH_HASH_FUNCTION_MAX,
> >>>    };
> >>>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 1/2] ethdev: add new symmetric hash function
  2023-08-30 13:09           ` Xueming(Steven) Li
@ 2023-08-31  1:23             ` lihuisong (C)
  2023-08-31  6:25               ` Xueming(Steven) Li
  0 siblings, 1 reply; 23+ messages in thread
From: lihuisong (C) @ 2023-08-31  1:23 UTC (permalink / raw)
  To: Xueming(Steven) Li, Ori Kam; +Cc: dev, fengchengwen, Ivan Malov


在 2023/8/30 21:09, Xueming(Steven) Li 写道:
>
>> -----Original Message-----
>> From: lihuisong (C) <lihuisong@huawei.com>
>> Sent: 8/30/2023 20:42
>> To: Xueming(Steven) Li <xuemingl@nvidia.com>; Ori Kam <orika@nvidia.com>
>> Cc: dev@dpdk.org; fengchengwen@huawei.com; Ivan Malov
>> <ivan.malov@arknetworks.am>
>> Subject: Re: [PATCH v2 1/2] ethdev: add new symmetric hash function
>>
>>
>> 在 2023/8/30 16:38, Xueming(Steven) Li 写道:
>>>> -----Original Message-----
>>>> From: lihuisong (C) <lihuisong@huawei.com>
>>>> Sent: 8/30/2023 15:51
>>>> To: Xueming(Steven) Li <xuemingl@nvidia.com>; Ori Kam
>>>> <orika@nvidia.com>
>>>> Cc: dev@dpdk.org; fengchengwen@huawei.com; Ivan Malov
>>>> <ivan.malov@arknetworks.am>
>>>> Subject: Re: [PATCH v2 1/2] ethdev: add new symmetric hash function
>>>>
>>>> Hi Xueming,
>>>>
>>>> 在 2023/8/27 16:17, Xueming Li 写道:
>>>>> The new symmetric hash function swap src/dst L3 address and
>>>>> L4 ports automatically by sorting.
>>>>>
>>>>> Signed-off-by: Xueming Li <xuemingl@nvidia.com>
>>>>> ---
>>>>>     lib/ethdev/rte_flow.h | 7 +++++++
>>>>>     1 file changed, 7 insertions(+)
>>>>>
>>>>> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index
>>>>> 2ebb76dbc0..4f4421ca50 100644
>>>>> --- a/lib/ethdev/rte_flow.h
>>>>> +++ b/lib/ethdev/rte_flow.h
>>>>> @@ -3196,6 +3196,13 @@ enum rte_eth_hash_function {
>>>>>     	 * src or dst address will xor with zero pair.
>>>>>     	 */
>>>>>     	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
>>>>> +	/**
>>>>> +	 * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
>>>>> +	 * the hash function.
>>>>> +	 *  If src_ip > dst_ip, swap src_ip and dst_ip.
>>>>> +	 *  If src_port > dst_port, swap src_port and dst_port.
>>>>> +	 */
>>>> If hash result are computed by the order:
>> "src_ip+dst_ip+src_port+dst_port"
>>>> How to obtain the value of every L3 and L4 field obove?
>>>> I still cannot understand how to swap and set these values for these fields?
>>> Hash result is computed by order ""src_ip+dst_ip+src_port+dst_port"
>>> Here is a detailed explanation of standard hash and symmetric hash by key:
>>>     https://www.ndsl.kaist.edu/~kyoungsoo/papers/TR-symRSS.pdf
>>>
>>> If src_ip > dst_ip, swap them, then the input becomes:
>>>     "dst_ip+src_ip+src_port+dst_port" // please note src and dst IP are
>> swapped.
>>> Same for L4 ports.
>> get it.
>> What are the advantages of the symmetric toeplitz sort?
>> Or why swap here?
> It's a different symmetric hash calculation, hardware can support either/all of them.
>
>  From calculation perspective, the hash result distribution is better, the result is more
> suitable to be used as hash table key.
I get it now.
but I have a question.
why not is that if src_ip < dst_ip, then swap src_ip and dst_ip?
I guess this is going to have the same effect as you said, right?
The symmetric toeplitz sort is not a standard algorithm, is just to 
enhance the hash result distribution.
If what I understand is right,
it is better that the new RSS algorithm should works on the one of them 
("src_ip > dst_ip" or "src_ip < dst_ip").
>
>>>>> +	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
>>>>>     	RTE_ETH_HASH_FUNCTION_MAX,
>>>>>     };
>>>>>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [PATCH v2 1/2] ethdev: add new symmetric hash function
  2023-08-31  1:23             ` lihuisong (C)
@ 2023-08-31  6:25               ` Xueming(Steven) Li
  2023-08-31 11:29                 ` lihuisong (C)
  0 siblings, 1 reply; 23+ messages in thread
From: Xueming(Steven) Li @ 2023-08-31  6:25 UTC (permalink / raw)
  To: lihuisong (C), Ori Kam; +Cc: dev, fengchengwen, Ivan Malov



> -----Original Message-----
> From: lihuisong (C) <lihuisong@huawei.com>
> Sent: 8/31/2023 9:24
> To: Xueming(Steven) Li <xuemingl@nvidia.com>; Ori Kam <orika@nvidia.com>
> Cc: dev@dpdk.org; fengchengwen@huawei.com; Ivan Malov
> <ivan.malov@arknetworks.am>
> Subject: Re: [PATCH v2 1/2] ethdev: add new symmetric hash function
> 
> 
> 在 2023/8/30 21:09, Xueming(Steven) Li 写道:
> >
> >> -----Original Message-----
> >> From: lihuisong (C) <lihuisong@huawei.com>
> >> Sent: 8/30/2023 20:42
> >> To: Xueming(Steven) Li <xuemingl@nvidia.com>; Ori Kam
> >> <orika@nvidia.com>
> >> Cc: dev@dpdk.org; fengchengwen@huawei.com; Ivan Malov
> >> <ivan.malov@arknetworks.am>
> >> Subject: Re: [PATCH v2 1/2] ethdev: add new symmetric hash function
> >>
> >>
> >> 在 2023/8/30 16:38, Xueming(Steven) Li 写道:
> >>>> -----Original Message-----
> >>>> From: lihuisong (C) <lihuisong@huawei.com>
> >>>> Sent: 8/30/2023 15:51
> >>>> To: Xueming(Steven) Li <xuemingl@nvidia.com>; Ori Kam
> >>>> <orika@nvidia.com>
> >>>> Cc: dev@dpdk.org; fengchengwen@huawei.com; Ivan Malov
> >>>> <ivan.malov@arknetworks.am>
> >>>> Subject: Re: [PATCH v2 1/2] ethdev: add new symmetric hash function
> >>>>
> >>>> Hi Xueming,
> >>>>
> >>>> 在 2023/8/27 16:17, Xueming Li 写道:
> >>>>> The new symmetric hash function swap src/dst L3 address and
> >>>>> L4 ports automatically by sorting.
> >>>>>
> >>>>> Signed-off-by: Xueming Li <xuemingl@nvidia.com>
> >>>>> ---
> >>>>>     lib/ethdev/rte_flow.h | 7 +++++++
> >>>>>     1 file changed, 7 insertions(+)
> >>>>>
> >>>>> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index
> >>>>> 2ebb76dbc0..4f4421ca50 100644
> >>>>> --- a/lib/ethdev/rte_flow.h
> >>>>> +++ b/lib/ethdev/rte_flow.h
> >>>>> @@ -3196,6 +3196,13 @@ enum rte_eth_hash_function {
> >>>>>     	 * src or dst address will xor with zero pair.
> >>>>>     	 */
> >>>>>     	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
> >>>>> +	/**
> >>>>> +	 * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
> >>>>> +	 * the hash function.
> >>>>> +	 *  If src_ip > dst_ip, swap src_ip and dst_ip.
> >>>>> +	 *  If src_port > dst_port, swap src_port and dst_port.
> >>>>> +	 */
> >>>> If hash result are computed by the order:
> >> "src_ip+dst_ip+src_port+dst_port"
> >>>> How to obtain the value of every L3 and L4 field obove?
> >>>> I still cannot understand how to swap and set these values for these
> fields?
> >>> Hash result is computed by order ""src_ip+dst_ip+src_port+dst_port"
> >>> Here is a detailed explanation of standard hash and symmetric hash by
> key:
> >>>     https://www.ndsl.kaist.edu/~kyoungsoo/papers/TR-symRSS.pdf
> >>>
> >>> If src_ip > dst_ip, swap them, then the input becomes:
> >>>     "dst_ip+src_ip+src_port+dst_port" // please note src and dst IP
> >>> are
> >> swapped.
> >>> Same for L4 ports.
> >> get it.
> >> What are the advantages of the symmetric toeplitz sort?
> >> Or why swap here?
> > It's a different symmetric hash calculation, hardware can support either/all
> of them.
> >
> >  From calculation perspective, the hash result distribution is better,
> > the result is more suitable to be used as hash table key.
> I get it now.
> but I have a question.
> why not is that if src_ip < dst_ip, then swap src_ip and dst_ip?
> I guess this is going to have the same effect as you said, right?
> The symmetric toeplitz sort is not a standard algorithm, is just to enhance the
> hash result distribution.
> If what I understand is right,
> it is better that the new RSS algorithm should works on the one of them
> ("src_ip > dst_ip" or "src_ip < dst_ip").

Any special reason to introduce the descending sort?
I personally prefer to keep the enum clean unless some new hw or new algorithm introduced.

> >
> >>>>> +	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
> >>>>>     	RTE_ETH_HASH_FUNCTION_MAX,
> >>>>>     };
> >>>>>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 1/2] ethdev: add new symmetric hash function
  2023-08-31  6:25               ` Xueming(Steven) Li
@ 2023-08-31 11:29                 ` lihuisong (C)
  0 siblings, 0 replies; 23+ messages in thread
From: lihuisong (C) @ 2023-08-31 11:29 UTC (permalink / raw)
  To: Xueming(Steven) Li, Ori Kam; +Cc: dev, fengchengwen, Ivan Malov


在 2023/8/31 14:25, Xueming(Steven) Li 写道:
>
>> -----Original Message-----
>> From: lihuisong (C) <lihuisong@huawei.com>
>> Sent: 8/31/2023 9:24
>> To: Xueming(Steven) Li <xuemingl@nvidia.com>; Ori Kam <orika@nvidia.com>
>> Cc: dev@dpdk.org; fengchengwen@huawei.com; Ivan Malov
>> <ivan.malov@arknetworks.am>
>> Subject: Re: [PATCH v2 1/2] ethdev: add new symmetric hash function
>>
>>
>> 在 2023/8/30 21:09, Xueming(Steven) Li 写道:
>>>> -----Original Message-----
>>>> From: lihuisong (C) <lihuisong@huawei.com>
>>>> Sent: 8/30/2023 20:42
>>>> To: Xueming(Steven) Li <xuemingl@nvidia.com>; Ori Kam
>>>> <orika@nvidia.com>
>>>> Cc: dev@dpdk.org; fengchengwen@huawei.com; Ivan Malov
>>>> <ivan.malov@arknetworks.am>
>>>> Subject: Re: [PATCH v2 1/2] ethdev: add new symmetric hash function
>>>>
>>>>
>>>> 在 2023/8/30 16:38, Xueming(Steven) Li 写道:
>>>>>> -----Original Message-----
>>>>>> From: lihuisong (C) <lihuisong@huawei.com>
>>>>>> Sent: 8/30/2023 15:51
>>>>>> To: Xueming(Steven) Li <xuemingl@nvidia.com>; Ori Kam
>>>>>> <orika@nvidia.com>
>>>>>> Cc: dev@dpdk.org; fengchengwen@huawei.com; Ivan Malov
>>>>>> <ivan.malov@arknetworks.am>
>>>>>> Subject: Re: [PATCH v2 1/2] ethdev: add new symmetric hash function
>>>>>>
>>>>>> Hi Xueming,
>>>>>>
>>>>>> 在 2023/8/27 16:17, Xueming Li 写道:
>>>>>>> The new symmetric hash function swap src/dst L3 address and
>>>>>>> L4 ports automatically by sorting.
>>>>>>>
>>>>>>> Signed-off-by: Xueming Li <xuemingl@nvidia.com>
>>>>>>> ---
>>>>>>>      lib/ethdev/rte_flow.h | 7 +++++++
>>>>>>>      1 file changed, 7 insertions(+)
>>>>>>>
>>>>>>> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index
>>>>>>> 2ebb76dbc0..4f4421ca50 100644
>>>>>>> --- a/lib/ethdev/rte_flow.h
>>>>>>> +++ b/lib/ethdev/rte_flow.h
>>>>>>> @@ -3196,6 +3196,13 @@ enum rte_eth_hash_function {
>>>>>>>      	 * src or dst address will xor with zero pair.
>>>>>>>      	 */
>>>>>>>      	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
>>>>>>> +	/**
>>>>>>> +	 * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
>>>>>>> +	 * the hash function.
>>>>>>> +	 *  If src_ip > dst_ip, swap src_ip and dst_ip.
>>>>>>> +	 *  If src_port > dst_port, swap src_port and dst_port.
>>>>>>> +	 */
>>>>>> If hash result are computed by the order:
>>>> "src_ip+dst_ip+src_port+dst_port"
>>>>>> How to obtain the value of every L3 and L4 field obove?
>>>>>> I still cannot understand how to swap and set these values for these
>> fields?
>>>>> Hash result is computed by order ""src_ip+dst_ip+src_port+dst_port"
>>>>> Here is a detailed explanation of standard hash and symmetric hash by
>> key:
>>>>>      https://www.ndsl.kaist.edu/~kyoungsoo/papers/TR-symRSS.pdf
>>>>>
>>>>> If src_ip > dst_ip, swap them, then the input becomes:
>>>>>      "dst_ip+src_ip+src_port+dst_port" // please note src and dst IP
>>>>> are
>>>> swapped.
>>>>> Same for L4 ports.
>>>> get it.
>>>> What are the advantages of the symmetric toeplitz sort?
>>>> Or why swap here?
>>> It's a different symmetric hash calculation, hardware can support either/all
>> of them.
>>>   From calculation perspective, the hash result distribution is better,
>>> the result is more suitable to be used as hash table key.
>> I get it now.
>> but I have a question.
>> why not is that if src_ip < dst_ip, then swap src_ip and dst_ip?
>> I guess this is going to have the same effect as you said, right?
>> The symmetric toeplitz sort is not a standard algorithm, is just to enhance the
>> hash result distribution.
>> If what I understand is right,
>> it is better that the new RSS algorithm should works on the one of them
>> ("src_ip > dst_ip" or "src_ip < dst_ip").
> Any special reason to introduce the descending sort?
Because the descending sort also can achieve the goal.
After all, this doesn't seem like a standard algorithm.

> I personally prefer to keep the enum clean unless some new hw or new algorithm introduced.

Agree with you. But this new enum cannot reveal ascending or descending 
sort.

>
>>>>>>> +	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
>>>>>>>      	RTE_ETH_HASH_FUNCTION_MAX,
>>>>>>>      };
>>>>>>>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 1/2] ethdev: add new symmetric hash function
  2023-08-30  6:55     ` Ori Kam
@ 2023-09-21 15:49       ` Ferruh Yigit
  2023-09-22  6:57         ` Xueming(Steven) Li
  0 siblings, 1 reply; 23+ messages in thread
From: Ferruh Yigit @ 2023-09-21 15:49 UTC (permalink / raw)
  To: Ori Kam, Xueming(Steven) Li
  Cc: dev, fengchengwen, Ivan Malov, Raslan Darawsheh

On 8/30/2023 7:55 AM, Ori Kam wrote:
>> -----Original Message-----
>> From: Xueming(Steven) Li <xuemingl@nvidia.com>
>> Sent: Sunday, August 27, 2023 11:18 AM
>>
>> The new symmetric hash function swap src/dst L3 address and
>> L4 ports automatically by sorting.
>>
>> Signed-off-by: Xueming Li <xuemingl@nvidia.com>
> 
> Acked-by: Ori Kam <orika@nvidia.com>
> 

Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>

Updated commit log with information provided in this mail thread.

Applied to dpdk-next-net/main, thanks.


Note only ethdev patch applied, not series, mlx5 patch delegated to Raslan.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [PATCH v2 1/2] ethdev: add new symmetric hash function
  2023-09-21 15:49       ` Ferruh Yigit
@ 2023-09-22  6:57         ` Xueming(Steven) Li
  0 siblings, 0 replies; 23+ messages in thread
From: Xueming(Steven) Li @ 2023-09-22  6:57 UTC (permalink / raw)
  To: Ferruh Yigit, Ori Kam; +Cc: dev, fengchengwen, Ivan Malov, Raslan Darawsheh

> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@amd.com>
> Sent: 9/21/2023 23:50
> To: Ori Kam <orika@nvidia.com>; Xueming(Steven) Li <xuemingl@nvidia.com>
> Cc: dev@dpdk.org; fengchengwen@huawei.com; Ivan Malov
> <ivan.malov@arknetworks.am>; Raslan Darawsheh <rasland@nvidia.com>
> Subject: Re: [PATCH v2 1/2] ethdev: add new symmetric hash function
> 
> On 8/30/2023 7:55 AM, Ori Kam wrote:
> >> -----Original Message-----
> >> From: Xueming(Steven) Li <xuemingl@nvidia.com>
> >> Sent: Sunday, August 27, 2023 11:18 AM
> >>
> >> The new symmetric hash function swap src/dst L3 address and
> >> L4 ports automatically by sorting.
> >>
> >> Signed-off-by: Xueming Li <xuemingl@nvidia.com>
> >
> > Acked-by: Ori Kam <orika@nvidia.com>
> >
> 
> Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
> 
> Updated commit log with information provided in this mail thread.

Thanks very much!

> 
> Applied to dpdk-next-net/main, thanks.
> 
> 
> Note only ethdev patch applied, not series, mlx5 patch delegated to Raslan.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [PATCH v2 2/2] net/mlx5: support new RSS symmetric hash function
  2023-08-27  8:17   ` [PATCH v2 2/2] net/mlx5: support new RSS " Xueming Li
@ 2023-10-29 15:53     ` Ori Kam
  2023-10-30 17:08     ` Raslan Darawsheh
  1 sibling, 0 replies; 23+ messages in thread
From: Ori Kam @ 2023-10-29 15:53 UTC (permalink / raw)
  To: Xueming(Steven) Li; +Cc: dev, fengchengwen, Ivan Malov



> -----Original Message-----
> From: Xueming(Steven) Li <xuemingl@nvidia.com>
> Sent: Sunday, August 27, 2023 11:18 AM
> 
> This patch supports the new RSS symmetric hash function:
> RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT
> 
> The new hash function makes symmetric hash result by swapping
> the source and destination IP and L4 port automatically.
> 
> Signed-off-by: Xueming Li <xuemingl@nvidia.com>
> ---


Acked-by: Ori Kam <orika@nvidia.com>
Best,
Ori

^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [PATCH v2 2/2] net/mlx5: support new RSS symmetric hash function
  2023-08-27  8:17   ` [PATCH v2 2/2] net/mlx5: support new RSS " Xueming Li
  2023-10-29 15:53     ` Ori Kam
@ 2023-10-30 17:08     ` Raslan Darawsheh
  1 sibling, 0 replies; 23+ messages in thread
From: Raslan Darawsheh @ 2023-10-30 17:08 UTC (permalink / raw)
  To: Xueming(Steven) Li, Ori Kam
  Cc: Xueming(Steven) Li, dev, fengchengwen, Ivan Malov

[-- Attachment #1: Type: text/plain, Size: 729 bytes --]

Hi,

> -----Original Message-----
> From: Xueming Li <xuemingl@nvidia.com>
> Sent: Sunday, August 27, 2023 11:18 AM
> To: Ori Kam <orika@nvidia.com>
> Cc: Xueming(Steven) Li <xuemingl@nvidia.com>; dev@dpdk.org;
> fengchengwen@huawei.com; Ivan Malov <ivan.malov@arknetworks.am>
> Subject: [PATCH v2 2/2] net/mlx5: support new RSS symmetric hash function
> 
> This patch supports the new RSS symmetric hash function:
> RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT
> 
> The new hash function makes symmetric hash result by swapping the source
> and destination IP and L4 port automatically.
> 
> Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 15245 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2023-10-30 17:08 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-24 11:38 [PATCH] doc: deprecation notice to add new hash function Xueming Li
2023-05-24 12:50 ` Ori Kam
2023-05-24 14:49 ` Stephen Hemminger
2023-07-28 15:10   ` Thomas Monjalon
2023-08-07 11:54 ` [PATCH] ethdev: add new symmetric " Xueming Li
2023-08-07 12:33   ` Ori Kam
2023-08-07 22:32   ` Ivan Malov
2023-08-08  1:43     ` fengchengwen
2023-08-09 12:00       ` Xueming(Steven) Li
2023-08-27  8:17   ` [PATCH v2 1/2] " Xueming Li
2023-08-30  6:55     ` Ori Kam
2023-09-21 15:49       ` Ferruh Yigit
2023-09-22  6:57         ` Xueming(Steven) Li
2023-08-30  7:50     ` lihuisong (C)
2023-08-30  8:38       ` Xueming(Steven) Li
2023-08-30 12:42         ` lihuisong (C)
2023-08-30 13:09           ` Xueming(Steven) Li
2023-08-31  1:23             ` lihuisong (C)
2023-08-31  6:25               ` Xueming(Steven) Li
2023-08-31 11:29                 ` lihuisong (C)
2023-08-27  8:17   ` [PATCH v2 2/2] net/mlx5: support new RSS " Xueming Li
2023-10-29 15:53     ` Ori Kam
2023-10-30 17:08     ` Raslan Darawsheh

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).