DPDK-dev Archive on lore.kernel.org
 help / color / Atom feed
* [dpdk-dev] [PATCH 0/2] extend RSS offload types
@ 2019-08-09  5:35 simei
  2019-08-09  5:35 ` [dpdk-dev] [PATCH 1/2] ethdev: " simei
                   ` (2 more replies)
  0 siblings, 3 replies; 97+ messages in thread
From: simei @ 2019-08-09  5:35 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, beilei.xing, adrien.mazarguil, ferruh.yigit
  Cc: dev, simei.su

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

[PATCH 1/2] ethdev: add several bits for extending rss offload types.
[PATCH 2/2] app/testpmd: add cmdline support for extending rss types.

Simei Su (2):
  ethdev: extend RSS offload types
  app/testpmd: add RSS offload types extending support

 app/test-pmd/config.c          |  6 ++++
 lib/librte_ethdev/rte_ethdev.h | 62 ++++++++++++++++++++++++------------------
 2 files changed, 42 insertions(+), 26 deletions(-)

-- 
1.8.3.1


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

* [dpdk-dev] [PATCH 1/2] ethdev: extend RSS offload types
  2019-08-09  5:35 [dpdk-dev] [PATCH 0/2] extend RSS offload types simei
@ 2019-08-09  5:35 ` " simei
  2019-08-09  5:35 ` [dpdk-dev] [PATCH 2/2] app/testpmd: add RSS offload types extending support simei
  2019-09-23 14:05 ` [dpdk-dev] [PATCH v2 0/2] extend RSS offload types Simei Su
  2 siblings, 0 replies; 97+ messages in thread
From: simei @ 2019-08-09  5:35 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, beilei.xing, adrien.mazarguil, ferruh.yigit
  Cc: dev, simei.su

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

This patch cover two aspects:
   (1)decouple RTE_ETH_FLOW_* and ETH_RSS_*. Because both serve
      different purposes.

   (2)reserve several bits as input set selection from bottom
      of the 64 bits. It is combined with exisitingi ETH_RSS_* to
      represent rss types.

   for example:
      ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY: hash on src ip address only
      ETH_RSS_IPV4_UDP | ETH_RSS_L4_DST_ONLY: hash on src/dst IP and
                                               dst UDP port
      ETH_RSS_L2_PAYLOAD | ETH_RSS_L2_DST_ONLY: hash on dst mac address

Signed-off-by: Simei Su <simei.su@intel.com>
---
 lib/librte_ethdev/rte_ethdev.h | 62 ++++++++++++++++++++++++------------------
 1 file changed, 36 insertions(+), 26 deletions(-)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index dc6596b..d47f7e9 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -481,32 +481,42 @@ struct rte_eth_rss_conf {
 #define RTE_ETH_FLOW_VXLAN_GPE          22 /**< VXLAN-GPE protocol based flow */
 #define RTE_ETH_FLOW_MAX                23
 
-/*
- * The RSS offload types are defined based on flow types.
- * Different NIC hardware may support different RSS offload
- * types. The supported flow types or RSS offload types can be queried by
- * rte_eth_dev_info_get().
- */
-#define ETH_RSS_IPV4               (1ULL << RTE_ETH_FLOW_IPV4)
-#define ETH_RSS_FRAG_IPV4          (1ULL << RTE_ETH_FLOW_FRAG_IPV4)
-#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
-#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
-#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP)
-#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
-#define ETH_RSS_IPV6               (1ULL << RTE_ETH_FLOW_IPV6)
-#define ETH_RSS_FRAG_IPV6          (1ULL << RTE_ETH_FLOW_FRAG_IPV6)
-#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
-#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
-#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP)
-#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
-#define ETH_RSS_L2_PAYLOAD         (1ULL << RTE_ETH_FLOW_L2_PAYLOAD)
-#define ETH_RSS_IPV6_EX            (1ULL << RTE_ETH_FLOW_IPV6_EX)
-#define ETH_RSS_IPV6_TCP_EX        (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
-#define ETH_RSS_IPV6_UDP_EX        (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
-#define ETH_RSS_PORT               (1ULL << RTE_ETH_FLOW_PORT)
-#define ETH_RSS_VXLAN              (1ULL << RTE_ETH_FLOW_VXLAN)
-#define ETH_RSS_GENEVE             (1ULL << RTE_ETH_FLOW_GENEVE)
-#define ETH_RSS_NVGRE              (1ULL << RTE_ETH_FLOW_NVGRE)
+/* Here, we decouple RTE_ETH_FLOW_* and ETH_RSS_*. The following macros only
+ * make sense for RSS.
+ */
+#define ETH_RSS_IPV4               (1ULL << 2)
+#define ETH_RSS_FRAG_IPV4          (1ULL << 3)
+#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << 4)
+#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << 5)
+#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << 6)
+#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << 7)
+#define ETH_RSS_IPV6               (1ULL << 8)
+#define ETH_RSS_FRAG_IPV6          (1ULL << 9)
+#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << 10)
+#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << 11)
+#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << 12)
+#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << 13)
+#define ETH_RSS_L2_PAYLOAD         (1ULL << 14)
+#define ETH_RSS_IPV6_EX            (1ULL << 15)
+#define ETH_RSS_IPV6_TCP_EX        (1ULL << 16)
+#define ETH_RSS_IPV6_UDP_EX        (1ULL << 17)
+#define ETH_RSS_PORT               (1ULL << 18)
+#define ETH_RSS_VXLAN              (1ULL << 19)
+#define ETH_RSS_GENEVE             (1ULL << 20)
+#define ETH_RSS_NVGRE              (1ULL << 21)
+
+/* The following six macros are used combined with ETH_RSS_* to
+ * represent rss types. The structure rte_flow_action_rss.types is
+ * 64-bit wide and we reserve couple bits here for input set selection
+ * from bottom of the 64 bits so that it doesn't impact future
+ * ETH_RSS_* definitions.
+ */
+#define	ETH_RSS_L2_SRC_ONLY		(1ULL << 63)
+#define	ETH_RSS_L2_DST_ONLY		(1ULL << 62)
+#define	ETH_RSS_L3_SRC_ONLY		(1ULL << 61)
+#define	ETH_RSS_L3_DST_ONLY		(1ULL << 60)
+#define	ETH_RSS_L4_SRC_ONLY		(1ULL << 59)
+#define	ETH_RSS_L4_DST_ONLY		(1ULL << 58)
 
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH 2/2] app/testpmd: add RSS offload types extending support
  2019-08-09  5:35 [dpdk-dev] [PATCH 0/2] extend RSS offload types simei
  2019-08-09  5:35 ` [dpdk-dev] [PATCH 1/2] ethdev: " simei
@ 2019-08-09  5:35 ` simei
  2019-09-23 14:05 ` [dpdk-dev] [PATCH v2 0/2] extend RSS offload types Simei Su
  2 siblings, 0 replies; 97+ messages in thread
From: simei @ 2019-08-09  5:35 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, beilei.xing, adrien.mazarguil, ferruh.yigit
  Cc: dev, simei.su

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

This patch adds cmdline support for extended rss types configuration.

Signed-off-by: Simei Su <simei.su@intel.com>
---
 app/test-pmd/config.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 1a5a5c1..b95bd43 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -103,6 +103,12 @@
 	{ "tcp", ETH_RSS_TCP },
 	{ "sctp", ETH_RSS_SCTP },
 	{ "tunnel", ETH_RSS_TUNNEL },
+	{ "l2-src-only", ETH_RSS_L2_SRC_ONLY },
+	{ "l2-dst-only", ETH_RSS_L2_DST_ONLY },
+	{ "l3-src-only", ETH_RSS_L3_SRC_ONLY },
+	{ "l3-dst-only", ETH_RSS_L3_DST_ONLY },
+	{ "l4-src-only", ETH_RSS_L4_SRC_ONLY },
+	{ "l4-dst-only", ETH_RSS_L4_DST_ONLY },
 	{ NULL, 0 },
 };
 
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v2 0/2] extend RSS offload types
  2019-08-09  5:35 [dpdk-dev] [PATCH 0/2] extend RSS offload types simei
  2019-08-09  5:35 ` [dpdk-dev] [PATCH 1/2] ethdev: " simei
  2019-08-09  5:35 ` [dpdk-dev] [PATCH 2/2] app/testpmd: add RSS offload types extending support simei
@ 2019-09-23 14:05 ` Simei Su
  2019-09-23 14:05   ` [dpdk-dev] [PATCH v2 1/2] ethdev: " Simei Su
                     ` (3 more replies)
  2 siblings, 4 replies; 97+ messages in thread
From: Simei Su @ 2019-09-23 14:05 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, xiaolong.ye; +Cc: dev, simei.su

[PATCH v2 1/2] ethdev: add several bits for extending rss offload types.
[PATCH v2 2/2] app/testpmd: add cmdline support for extending rss types.

v2:
- revise annotation.

Simei Su (2):
  ethdev: extend RSS offload types
  app/testpmd: add RSS offload types extending support

 app/test-pmd/config.c          |  6 +++++
 lib/librte_ethdev/rte_ethdev.h | 60 ++++++++++++++++++++++++------------------
 2 files changed, 41 insertions(+), 25 deletions(-)

-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v2 1/2] ethdev: extend RSS offload types
  2019-09-23 14:05 ` [dpdk-dev] [PATCH v2 0/2] extend RSS offload types Simei Su
@ 2019-09-23 14:05   ` " Simei Su
  2019-09-25 10:27     ` Ye Xiaolong
  2019-09-25 10:49     ` Ye Xiaolong
  2019-09-23 14:05   ` [dpdk-dev] [PATCH v2 2/2] app/testpmd: add RSS offload types extending support Simei Su
                     ` (2 subsequent siblings)
  3 siblings, 2 replies; 97+ messages in thread
From: Simei Su @ 2019-09-23 14:05 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, xiaolong.ye; +Cc: dev, simei.su

This patch cover two aspects:
  (1)decouple RTE_ETH_FLOW_* and ETH_RSS_*. Because both serve
     different purposes.

  (2)reserve several bits as input set selection from bottom
     of the 64 bits. It is combined with exisiting ETH_RSS_* to
     represent rss types.

  for example:
    ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY: hash on src ip address only
    ETH_RSS_IPV4_UDP | ETH_RSS_L4_DST_ONLY: hash on src/dst IP and
                                            dst UDP port
    ETH_RSS_L2_PAYLOAD | ETH_RSS_L2_DST_ONLY: hash on dst mac address

Signed-off-by: Simei Su <simei.su@intel.com>
---
 lib/librte_ethdev/rte_ethdev.h | 60 ++++++++++++++++++++++++------------------
 1 file changed, 35 insertions(+), 25 deletions(-)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d987178..7e6530d 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -482,31 +482,41 @@ struct rte_eth_rss_conf {
 #define RTE_ETH_FLOW_MAX                23
 
 /*
- * The RSS offload types are defined based on flow types.
- * Different NIC hardware may support different RSS offload
- * types. The supported flow types or RSS offload types can be queried by
- * rte_eth_dev_info_get().
- */
-#define ETH_RSS_IPV4               (1ULL << RTE_ETH_FLOW_IPV4)
-#define ETH_RSS_FRAG_IPV4          (1ULL << RTE_ETH_FLOW_FRAG_IPV4)
-#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
-#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
-#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP)
-#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
-#define ETH_RSS_IPV6               (1ULL << RTE_ETH_FLOW_IPV6)
-#define ETH_RSS_FRAG_IPV6          (1ULL << RTE_ETH_FLOW_FRAG_IPV6)
-#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
-#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
-#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP)
-#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
-#define ETH_RSS_L2_PAYLOAD         (1ULL << RTE_ETH_FLOW_L2_PAYLOAD)
-#define ETH_RSS_IPV6_EX            (1ULL << RTE_ETH_FLOW_IPV6_EX)
-#define ETH_RSS_IPV6_TCP_EX        (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
-#define ETH_RSS_IPV6_UDP_EX        (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
-#define ETH_RSS_PORT               (1ULL << RTE_ETH_FLOW_PORT)
-#define ETH_RSS_VXLAN              (1ULL << RTE_ETH_FLOW_VXLAN)
-#define ETH_RSS_GENEVE             (1ULL << RTE_ETH_FLOW_GENEVE)
-#define ETH_RSS_NVGRE              (1ULL << RTE_ETH_FLOW_NVGRE)
+ * Below macros are defined for RSS offload types, they can be used to
+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
+ */
+#define ETH_RSS_IPV4               (1ULL << 2)
+#define ETH_RSS_FRAG_IPV4          (1ULL << 3)
+#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << 4)
+#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << 5)
+#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << 6)
+#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << 7)
+#define ETH_RSS_IPV6               (1ULL << 8)
+#define ETH_RSS_FRAG_IPV6          (1ULL << 9)
+#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << 10)
+#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << 11)
+#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << 12)
+#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << 13)
+#define ETH_RSS_L2_PAYLOAD         (1ULL << 14)
+#define ETH_RSS_IPV6_EX            (1ULL << 15)
+#define ETH_RSS_IPV6_TCP_EX        (1ULL << 16)
+#define ETH_RSS_IPV6_UDP_EX        (1ULL << 17)
+#define ETH_RSS_PORT               (1ULL << 18)
+#define ETH_RSS_VXLAN              (1ULL << 19)
+#define ETH_RSS_GENEVE             (1ULL << 20)
+#define ETH_RSS_NVGRE              (1ULL << 21)
+
+/*
+ * We use the following macros to combine with above ETH_RSS_* for
+ * more specific input set selection. These bits are defined starting
+ * from the bottom of the 64 bits.
+ */
+#define	ETH_RSS_L2_SRC_ONLY	   (1ULL << 63)
+#define	ETH_RSS_L2_DST_ONLY	   (1ULL << 62)
+#define	ETH_RSS_L3_SRC_ONLY	   (1ULL << 61)
+#define	ETH_RSS_L3_DST_ONLY	   (1ULL << 60)
+#define	ETH_RSS_L4_SRC_ONLY	   (1ULL << 59)
+#define	ETH_RSS_L4_DST_ONLY	   (1ULL << 58)
 
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v2 2/2] app/testpmd: add RSS offload types extending support
  2019-09-23 14:05 ` [dpdk-dev] [PATCH v2 0/2] extend RSS offload types Simei Su
  2019-09-23 14:05   ` [dpdk-dev] [PATCH v2 1/2] ethdev: " Simei Su
@ 2019-09-23 14:05   ` Simei Su
  2019-09-24  5:32   ` [dpdk-dev] [PATCH v2 0/2] extend RSS offload types Zhang, Qi Z
  2019-09-25 14:06   ` [dpdk-dev] [PATCH v3 " Simei Su
  3 siblings, 0 replies; 97+ messages in thread
From: Simei Su @ 2019-09-23 14:05 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, xiaolong.ye; +Cc: dev, simei.su

This patch adds cmdline support for extended rss types configuration.

Signed-off-by: Simei Su <simei.su@intel.com>
---
 app/test-pmd/config.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 1a5a5c1..b95bd43 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -103,6 +103,12 @@
 	{ "tcp", ETH_RSS_TCP },
 	{ "sctp", ETH_RSS_SCTP },
 	{ "tunnel", ETH_RSS_TUNNEL },
+	{ "l2-src-only", ETH_RSS_L2_SRC_ONLY },
+	{ "l2-dst-only", ETH_RSS_L2_DST_ONLY },
+	{ "l3-src-only", ETH_RSS_L3_SRC_ONLY },
+	{ "l3-dst-only", ETH_RSS_L3_DST_ONLY },
+	{ "l4-src-only", ETH_RSS_L4_SRC_ONLY },
+	{ "l4-dst-only", ETH_RSS_L4_DST_ONLY },
 	{ NULL, 0 },
 };
 
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH v2 0/2] extend RSS offload types
  2019-09-23 14:05 ` [dpdk-dev] [PATCH v2 0/2] extend RSS offload types Simei Su
  2019-09-23 14:05   ` [dpdk-dev] [PATCH v2 1/2] ethdev: " Simei Su
  2019-09-23 14:05   ` [dpdk-dev] [PATCH v2 2/2] app/testpmd: add RSS offload types extending support Simei Su
@ 2019-09-24  5:32   ` Zhang, Qi Z
  2019-09-25 14:06   ` [dpdk-dev] [PATCH v3 " Simei Su
  3 siblings, 0 replies; 97+ messages in thread
From: Zhang, Qi Z @ 2019-09-24  5:32 UTC (permalink / raw)
  To: Su, Simei, Wu, Jingjing, Ye, Xiaolong; +Cc: dev



> -----Original Message-----
> From: Su, Simei
> Sent: Monday, September 23, 2019 10:06 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>
> Cc: dev@dpdk.org; Su, Simei <simei.su@intel.com>
> Subject: [PATCH v2 0/2] extend RSS offload types
> 
> [PATCH v2 1/2] ethdev: add several bits for extending rss offload types.
> [PATCH v2 2/2] app/testpmd: add cmdline support for extending rss types.
> 
> v2:
> - revise annotation.
> 
> Simei Su (2):
>   ethdev: extend RSS offload types
>   app/testpmd: add RSS offload types extending support
> 
>  app/test-pmd/config.c          |  6 +++++
>  lib/librte_ethdev/rte_ethdev.h | 60
> ++++++++++++++++++++++++------------------
>  2 files changed, 41 insertions(+), 25 deletions(-)
> 
> --
> 1.8.3.1

Reviewed by: Qi Zhang <qi.z.zhang@intel.com>


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

* Re: [dpdk-dev] [PATCH v2 1/2] ethdev: extend RSS offload types
  2019-09-23 14:05   ` [dpdk-dev] [PATCH v2 1/2] ethdev: " Simei Su
@ 2019-09-25 10:27     ` Ye Xiaolong
  2019-09-25 12:04       ` Su, Simei
  2019-09-25 10:49     ` Ye Xiaolong
  1 sibling, 1 reply; 97+ messages in thread
From: Ye Xiaolong @ 2019-09-25 10:27 UTC (permalink / raw)
  To: Simei Su; +Cc: qi.z.zhang, jingjing.wu, dev

On 09/23, Simei Su wrote:
>This patch cover two aspects:
>  (1)decouple RTE_ETH_FLOW_* and ETH_RSS_*. Because both serve
>     different purposes.

I saw in the comment of flow types definition 

"Note that the flow types are used to define RSS offload types".

We need to remove it if we do the decouple to avoid confusion.

>
>  (2)reserve several bits as input set selection from bottom
>     of the 64 bits. It is combined with exisiting ETH_RSS_* to
>     represent rss types.
>
>  for example:
>    ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY: hash on src ip address only
>    ETH_RSS_IPV4_UDP | ETH_RSS_L4_DST_ONLY: hash on src/dst IP and
>                                            dst UDP port
>    ETH_RSS_L2_PAYLOAD | ETH_RSS_L2_DST_ONLY: hash on dst mac address
>
>Signed-off-by: Simei Su <simei.su@intel.com>
>---
> lib/librte_ethdev/rte_ethdev.h | 60 ++++++++++++++++++++++++------------------
> 1 file changed, 35 insertions(+), 25 deletions(-)
>
>diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
>index d987178..7e6530d 100644
>--- a/lib/librte_ethdev/rte_ethdev.h
>+++ b/lib/librte_ethdev/rte_ethdev.h
>@@ -482,31 +482,41 @@ struct rte_eth_rss_conf {
> #define RTE_ETH_FLOW_MAX                23
> 
> /*
>- * The RSS offload types are defined based on flow types.
>- * Different NIC hardware may support different RSS offload
>- * types. The supported flow types or RSS offload types can be queried by
>- * rte_eth_dev_info_get().
>- */
>-#define ETH_RSS_IPV4               (1ULL << RTE_ETH_FLOW_IPV4)
>-#define ETH_RSS_FRAG_IPV4          (1ULL << RTE_ETH_FLOW_FRAG_IPV4)
>-#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
>-#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
>-#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP)
>-#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
>-#define ETH_RSS_IPV6               (1ULL << RTE_ETH_FLOW_IPV6)
>-#define ETH_RSS_FRAG_IPV6          (1ULL << RTE_ETH_FLOW_FRAG_IPV6)
>-#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
>-#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
>-#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP)
>-#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
>-#define ETH_RSS_L2_PAYLOAD         (1ULL << RTE_ETH_FLOW_L2_PAYLOAD)
>-#define ETH_RSS_IPV6_EX            (1ULL << RTE_ETH_FLOW_IPV6_EX)
>-#define ETH_RSS_IPV6_TCP_EX        (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
>-#define ETH_RSS_IPV6_UDP_EX        (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
>-#define ETH_RSS_PORT               (1ULL << RTE_ETH_FLOW_PORT)
>-#define ETH_RSS_VXLAN              (1ULL << RTE_ETH_FLOW_VXLAN)
>-#define ETH_RSS_GENEVE             (1ULL << RTE_ETH_FLOW_GENEVE)
>-#define ETH_RSS_NVGRE              (1ULL << RTE_ETH_FLOW_NVGRE)
>+ * Below macros are defined for RSS offload types, they can be used to
>+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
>+ */
>+#define ETH_RSS_IPV4               (1ULL << 2)
>+#define ETH_RSS_FRAG_IPV4          (1ULL << 3)
>+#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << 4)
>+#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << 5)
>+#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << 6)
>+#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << 7)
>+#define ETH_RSS_IPV6               (1ULL << 8)
>+#define ETH_RSS_FRAG_IPV6          (1ULL << 9)
>+#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << 10)
>+#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << 11)
>+#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << 12)
>+#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << 13)
>+#define ETH_RSS_L2_PAYLOAD         (1ULL << 14)
>+#define ETH_RSS_IPV6_EX            (1ULL << 15)
>+#define ETH_RSS_IPV6_TCP_EX        (1ULL << 16)
>+#define ETH_RSS_IPV6_UDP_EX        (1ULL << 17)
>+#define ETH_RSS_PORT               (1ULL << 18)
>+#define ETH_RSS_VXLAN              (1ULL << 19)
>+#define ETH_RSS_GENEVE             (1ULL << 20)
>+#define ETH_RSS_NVGRE              (1ULL << 21)
>+
>+/*
>+ * We use the following macros to combine with above ETH_RSS_* for
>+ * more specific input set selection. These bits are defined starting
>+ * from the bottom of the 64 bits.

s/bottom/high end/

>+ */
>+#define	ETH_RSS_L2_SRC_ONLY	   (1ULL << 63)
>+#define	ETH_RSS_L2_DST_ONLY	   (1ULL << 62)
>+#define	ETH_RSS_L3_SRC_ONLY	   (1ULL << 61)
>+#define	ETH_RSS_L3_DST_ONLY	   (1ULL << 60)
>+#define	ETH_RSS_L4_SRC_ONLY	   (1ULL << 59)
>+#define	ETH_RSS_L4_DST_ONLY	   (1ULL << 58)

Keep one space after #define to be aligned with other MACRO definition.

Thanks,
Xiaolong

> 
> #define ETH_RSS_IP ( \
> 	ETH_RSS_IPV4 | \
>-- 
>1.8.3.1
>

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

* Re: [dpdk-dev] [PATCH v2 1/2] ethdev: extend RSS offload types
  2019-09-23 14:05   ` [dpdk-dev] [PATCH v2 1/2] ethdev: " Simei Su
  2019-09-25 10:27     ` Ye Xiaolong
@ 2019-09-25 10:49     ` Ye Xiaolong
  2019-09-25 12:00       ` Su, Simei
  1 sibling, 1 reply; 97+ messages in thread
From: Ye Xiaolong @ 2019-09-25 10:49 UTC (permalink / raw)
  To: Simei Su; +Cc: qi.z.zhang, jingjing.wu, dev

On 09/23, Simei Su wrote:
>This patch cover two aspects:
>  (1)decouple RTE_ETH_FLOW_* and ETH_RSS_*. Because both serve
>     different purposes.
>
>  (2)reserve several bits as input set selection from bottom
>     of the 64 bits. It is combined with exisiting ETH_RSS_* to
>     represent rss types.
>
>  for example:
>    ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY: hash on src ip address only
>    ETH_RSS_IPV4_UDP | ETH_RSS_L4_DST_ONLY: hash on src/dst IP and
>                                            dst UDP port
>    ETH_RSS_L2_PAYLOAD | ETH_RSS_L2_DST_ONLY: hash on dst mac address

We also need to document well about what happens if users just set ETH_RSS_IPV4,
both both src/dst ip still are taken into account, right? 

Thanks,
Xiaolong


>
>Signed-off-by: Simei Su <simei.su@intel.com>
>---
> lib/librte_ethdev/rte_ethdev.h | 60 ++++++++++++++++++++++++------------------
> 1 file changed, 35 insertions(+), 25 deletions(-)
>
>diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
>index d987178..7e6530d 100644
>--- a/lib/librte_ethdev/rte_ethdev.h
>+++ b/lib/librte_ethdev/rte_ethdev.h
>@@ -482,31 +482,41 @@ struct rte_eth_rss_conf {
> #define RTE_ETH_FLOW_MAX                23
> 
> /*
>- * The RSS offload types are defined based on flow types.
>- * Different NIC hardware may support different RSS offload
>- * types. The supported flow types or RSS offload types can be queried by
>- * rte_eth_dev_info_get().
>- */
>-#define ETH_RSS_IPV4               (1ULL << RTE_ETH_FLOW_IPV4)
>-#define ETH_RSS_FRAG_IPV4          (1ULL << RTE_ETH_FLOW_FRAG_IPV4)
>-#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
>-#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
>-#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP)
>-#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
>-#define ETH_RSS_IPV6               (1ULL << RTE_ETH_FLOW_IPV6)
>-#define ETH_RSS_FRAG_IPV6          (1ULL << RTE_ETH_FLOW_FRAG_IPV6)
>-#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
>-#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
>-#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP)
>-#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
>-#define ETH_RSS_L2_PAYLOAD         (1ULL << RTE_ETH_FLOW_L2_PAYLOAD)
>-#define ETH_RSS_IPV6_EX            (1ULL << RTE_ETH_FLOW_IPV6_EX)
>-#define ETH_RSS_IPV6_TCP_EX        (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
>-#define ETH_RSS_IPV6_UDP_EX        (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
>-#define ETH_RSS_PORT               (1ULL << RTE_ETH_FLOW_PORT)
>-#define ETH_RSS_VXLAN              (1ULL << RTE_ETH_FLOW_VXLAN)
>-#define ETH_RSS_GENEVE             (1ULL << RTE_ETH_FLOW_GENEVE)
>-#define ETH_RSS_NVGRE              (1ULL << RTE_ETH_FLOW_NVGRE)
>+ * Below macros are defined for RSS offload types, they can be used to
>+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
>+ */
>+#define ETH_RSS_IPV4               (1ULL << 2)
>+#define ETH_RSS_FRAG_IPV4          (1ULL << 3)
>+#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << 4)
>+#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << 5)
>+#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << 6)
>+#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << 7)
>+#define ETH_RSS_IPV6               (1ULL << 8)
>+#define ETH_RSS_FRAG_IPV6          (1ULL << 9)
>+#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << 10)
>+#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << 11)
>+#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << 12)
>+#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << 13)
>+#define ETH_RSS_L2_PAYLOAD         (1ULL << 14)
>+#define ETH_RSS_IPV6_EX            (1ULL << 15)
>+#define ETH_RSS_IPV6_TCP_EX        (1ULL << 16)
>+#define ETH_RSS_IPV6_UDP_EX        (1ULL << 17)
>+#define ETH_RSS_PORT               (1ULL << 18)
>+#define ETH_RSS_VXLAN              (1ULL << 19)
>+#define ETH_RSS_GENEVE             (1ULL << 20)
>+#define ETH_RSS_NVGRE              (1ULL << 21)
>+
>+/*
>+ * We use the following macros to combine with above ETH_RSS_* for
>+ * more specific input set selection. These bits are defined starting
>+ * from the bottom of the 64 bits.
>+ */
>+#define	ETH_RSS_L2_SRC_ONLY	   (1ULL << 63)
>+#define	ETH_RSS_L2_DST_ONLY	   (1ULL << 62)
>+#define	ETH_RSS_L3_SRC_ONLY	   (1ULL << 61)
>+#define	ETH_RSS_L3_DST_ONLY	   (1ULL << 60)
>+#define	ETH_RSS_L4_SRC_ONLY	   (1ULL << 59)
>+#define	ETH_RSS_L4_DST_ONLY	   (1ULL << 58)
> 
> #define ETH_RSS_IP ( \
> 	ETH_RSS_IPV4 | \
>-- 
>1.8.3.1
>

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

* Re: [dpdk-dev] [PATCH v2 1/2] ethdev: extend RSS offload types
  2019-09-25 10:49     ` Ye Xiaolong
@ 2019-09-25 12:00       ` Su, Simei
  2019-09-25 12:22         ` Ye Xiaolong
  0 siblings, 1 reply; 97+ messages in thread
From: Su, Simei @ 2019-09-25 12:00 UTC (permalink / raw)
  To: Ye, Xiaolong; +Cc: Zhang, Qi Z, Wu, Jingjing, dev

Hi, xiaolong

> -----Original Message-----
> From: Ye, Xiaolong
> Sent: Wednesday, September 25, 2019 6:50 PM
> To: Su, Simei <simei.su@intel.com>
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> dev@dpdk.org
> Subject: Re: [PATCH v2 1/2] ethdev: extend RSS offload types
> 
> On 09/23, Simei Su wrote:
> >This patch cover two aspects:
> >  (1)decouple RTE_ETH_FLOW_* and ETH_RSS_*. Because both serve
> >     different purposes.
> >
> >  (2)reserve several bits as input set selection from bottom
> >     of the 64 bits. It is combined with exisiting ETH_RSS_* to
> >     represent rss types.
> >
> >  for example:
> >    ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY: hash on src ip address only
> >    ETH_RSS_IPV4_UDP | ETH_RSS_L4_DST_ONLY: hash on src/dst IP and
> >                                            dst UDP port
> >    ETH_RSS_L2_PAYLOAD | ETH_RSS_L2_DST_ONLY: hash on dst mac
> address
> 
> We also need to document well about what happens if users just set
> ETH_RSS_IPV4, both both src/dst ip still are taken into account, right?
> 

  Yes, when users set ETH_RSS_IPV4, both src and dst ip are taken into account.
  I will add this example. Thanks!

> Thanks,
> Xiaolong
> 
> 
> >
> >Signed-off-by: Simei Su <simei.su@intel.com>
> >---
> > lib/librte_ethdev/rte_ethdev.h | 60
> >++++++++++++++++++++++++------------------
> > 1 file changed, 35 insertions(+), 25 deletions(-)
> >
> >diff --git a/lib/librte_ethdev/rte_ethdev.h
> >b/lib/librte_ethdev/rte_ethdev.h index d987178..7e6530d 100644
> >--- a/lib/librte_ethdev/rte_ethdev.h
> >+++ b/lib/librte_ethdev/rte_ethdev.h
> >@@ -482,31 +482,41 @@ struct rte_eth_rss_conf {
> > #define RTE_ETH_FLOW_MAX                23
> >
> > /*
> >- * The RSS offload types are defined based on flow types.
> >- * Different NIC hardware may support different RSS offload
> >- * types. The supported flow types or RSS offload types can be queried
> >by
> >- * rte_eth_dev_info_get().
> >- */
> >-#define ETH_RSS_IPV4               (1ULL << RTE_ETH_FLOW_IPV4)
> >-#define ETH_RSS_FRAG_IPV4          (1ULL <<
> RTE_ETH_FLOW_FRAG_IPV4)
> >-#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL <<
> RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
> >-#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL <<
> RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
> >-#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL <<
> >RTE_ETH_FLOW_NONFRAG_IPV4_SCTP) -#define
> ETH_RSS_NONFRAG_IPV4_OTHER (1ULL <<
> RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
> >-#define ETH_RSS_IPV6               (1ULL << RTE_ETH_FLOW_IPV6)
> >-#define ETH_RSS_FRAG_IPV6          (1ULL <<
> RTE_ETH_FLOW_FRAG_IPV6)
> >-#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL <<
> RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
> >-#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL <<
> RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
> >-#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL <<
> >RTE_ETH_FLOW_NONFRAG_IPV6_SCTP) -#define
> ETH_RSS_NONFRAG_IPV6_OTHER (1ULL <<
> RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
> >-#define ETH_RSS_L2_PAYLOAD         (1ULL <<
> RTE_ETH_FLOW_L2_PAYLOAD)
> >-#define ETH_RSS_IPV6_EX            (1ULL << RTE_ETH_FLOW_IPV6_EX)
> >-#define ETH_RSS_IPV6_TCP_EX        (1ULL <<
> RTE_ETH_FLOW_IPV6_TCP_EX)
> >-#define ETH_RSS_IPV6_UDP_EX        (1ULL <<
> RTE_ETH_FLOW_IPV6_UDP_EX)
> >-#define ETH_RSS_PORT               (1ULL << RTE_ETH_FLOW_PORT)
> >-#define ETH_RSS_VXLAN              (1ULL << RTE_ETH_FLOW_VXLAN)
> >-#define ETH_RSS_GENEVE             (1ULL << RTE_ETH_FLOW_GENEVE)
> >-#define ETH_RSS_NVGRE              (1ULL << RTE_ETH_FLOW_NVGRE)
> >+ * Below macros are defined for RSS offload types, they can be used to
> >+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
> >+ */
> >+#define ETH_RSS_IPV4               (1ULL << 2)
> >+#define ETH_RSS_FRAG_IPV4          (1ULL << 3)
> >+#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << 4)
> >+#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << 5)
> >+#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << 6) #define
> >+ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << 7)
> >+#define ETH_RSS_IPV6               (1ULL << 8)
> >+#define ETH_RSS_FRAG_IPV6          (1ULL << 9)
> >+#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << 10)
> >+#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << 11)
> >+#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << 12) #define
> >+ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << 13)
> >+#define ETH_RSS_L2_PAYLOAD         (1ULL << 14)
> >+#define ETH_RSS_IPV6_EX            (1ULL << 15)
> >+#define ETH_RSS_IPV6_TCP_EX        (1ULL << 16)
> >+#define ETH_RSS_IPV6_UDP_EX        (1ULL << 17)
> >+#define ETH_RSS_PORT               (1ULL << 18)
> >+#define ETH_RSS_VXLAN              (1ULL << 19)
> >+#define ETH_RSS_GENEVE             (1ULL << 20)
> >+#define ETH_RSS_NVGRE              (1ULL << 21)
> >+
> >+/*
> >+ * We use the following macros to combine with above ETH_RSS_* for
> >+ * more specific input set selection. These bits are defined starting
> >+ * from the bottom of the 64 bits.
> >+ */
> >+#define	ETH_RSS_L2_SRC_ONLY	   (1ULL << 63)
> >+#define	ETH_RSS_L2_DST_ONLY	   (1ULL << 62)
> >+#define	ETH_RSS_L3_SRC_ONLY	   (1ULL << 61)
> >+#define	ETH_RSS_L3_DST_ONLY	   (1ULL << 60)
> >+#define	ETH_RSS_L4_SRC_ONLY	   (1ULL << 59)
> >+#define	ETH_RSS_L4_DST_ONLY	   (1ULL << 58)
> >
> > #define ETH_RSS_IP ( \
> > 	ETH_RSS_IPV4 | \
> >--
> >1.8.3.1
> >

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

* Re: [dpdk-dev] [PATCH v2 1/2] ethdev: extend RSS offload types
  2019-09-25 10:27     ` Ye Xiaolong
@ 2019-09-25 12:04       ` Su, Simei
  2019-09-25 12:23         ` Ye Xiaolong
  0 siblings, 1 reply; 97+ messages in thread
From: Su, Simei @ 2019-09-25 12:04 UTC (permalink / raw)
  To: Ye, Xiaolong; +Cc: Zhang, Qi Z, Wu, Jingjing, dev

Hi, xiaolong

> -----Original Message-----
> From: Ye, Xiaolong
> Sent: Wednesday, September 25, 2019 6:28 PM
> To: Su, Simei <simei.su@intel.com>
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> dev@dpdk.org
> Subject: Re: [PATCH v2 1/2] ethdev: extend RSS offload types
> 
> On 09/23, Simei Su wrote:
> >This patch cover two aspects:
> >  (1)decouple RTE_ETH_FLOW_* and ETH_RSS_*. Because both serve
> >     different purposes.
> 
> I saw in the comment of flow types definition
> 
> "Note that the flow types are used to define RSS offload types".
> 
> We need to remove it if we do the decouple to avoid confusion.
> 
  Ok, I will remove it.

> >
> >  (2)reserve several bits as input set selection from bottom
> >     of the 64 bits. It is combined with exisiting ETH_RSS_* to
> >     represent rss types.
> >
> >  for example:
> >    ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY: hash on src ip address only
> >    ETH_RSS_IPV4_UDP | ETH_RSS_L4_DST_ONLY: hash on src/dst IP and
> >                                            dst UDP port
> >    ETH_RSS_L2_PAYLOAD | ETH_RSS_L2_DST_ONLY: hash on dst mac
> address
> >
> >Signed-off-by: Simei Su <simei.su@intel.com>
> >---
> > lib/librte_ethdev/rte_ethdev.h | 60
> >++++++++++++++++++++++++------------------
> > 1 file changed, 35 insertions(+), 25 deletions(-)
> >
> >diff --git a/lib/librte_ethdev/rte_ethdev.h
> >b/lib/librte_ethdev/rte_ethdev.h index d987178..7e6530d 100644
> >--- a/lib/librte_ethdev/rte_ethdev.h
> >+++ b/lib/librte_ethdev/rte_ethdev.h
> >@@ -482,31 +482,41 @@ struct rte_eth_rss_conf {
> > #define RTE_ETH_FLOW_MAX                23
> >
> > /*
> >- * The RSS offload types are defined based on flow types.
> >- * Different NIC hardware may support different RSS offload
> >- * types. The supported flow types or RSS offload types can be queried
> >by
> >- * rte_eth_dev_info_get().
> >- */
> >-#define ETH_RSS_IPV4               (1ULL << RTE_ETH_FLOW_IPV4)
> >-#define ETH_RSS_FRAG_IPV4          (1ULL <<
> RTE_ETH_FLOW_FRAG_IPV4)
> >-#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL <<
> RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
> >-#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL <<
> RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
> >-#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL <<
> >RTE_ETH_FLOW_NONFRAG_IPV4_SCTP) -#define
> ETH_RSS_NONFRAG_IPV4_OTHER (1ULL <<
> RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
> >-#define ETH_RSS_IPV6               (1ULL << RTE_ETH_FLOW_IPV6)
> >-#define ETH_RSS_FRAG_IPV6          (1ULL <<
> RTE_ETH_FLOW_FRAG_IPV6)
> >-#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL <<
> RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
> >-#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL <<
> RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
> >-#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL <<
> >RTE_ETH_FLOW_NONFRAG_IPV6_SCTP) -#define
> ETH_RSS_NONFRAG_IPV6_OTHER (1ULL <<
> RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
> >-#define ETH_RSS_L2_PAYLOAD         (1ULL <<
> RTE_ETH_FLOW_L2_PAYLOAD)
> >-#define ETH_RSS_IPV6_EX            (1ULL << RTE_ETH_FLOW_IPV6_EX)
> >-#define ETH_RSS_IPV6_TCP_EX        (1ULL <<
> RTE_ETH_FLOW_IPV6_TCP_EX)
> >-#define ETH_RSS_IPV6_UDP_EX        (1ULL <<
> RTE_ETH_FLOW_IPV6_UDP_EX)
> >-#define ETH_RSS_PORT               (1ULL << RTE_ETH_FLOW_PORT)
> >-#define ETH_RSS_VXLAN              (1ULL << RTE_ETH_FLOW_VXLAN)
> >-#define ETH_RSS_GENEVE             (1ULL << RTE_ETH_FLOW_GENEVE)
> >-#define ETH_RSS_NVGRE              (1ULL << RTE_ETH_FLOW_NVGRE)
> >+ * Below macros are defined for RSS offload types, they can be used to
> >+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
> >+ */
> >+#define ETH_RSS_IPV4               (1ULL << 2)
> >+#define ETH_RSS_FRAG_IPV4          (1ULL << 3)
> >+#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << 4)
> >+#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << 5)
> >+#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << 6) #define
> >+ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << 7)
> >+#define ETH_RSS_IPV6               (1ULL << 8)
> >+#define ETH_RSS_FRAG_IPV6          (1ULL << 9)
> >+#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << 10)
> >+#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << 11)
> >+#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << 12) #define
> >+ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << 13)
> >+#define ETH_RSS_L2_PAYLOAD         (1ULL << 14)
> >+#define ETH_RSS_IPV6_EX            (1ULL << 15)
> >+#define ETH_RSS_IPV6_TCP_EX        (1ULL << 16)
> >+#define ETH_RSS_IPV6_UDP_EX        (1ULL << 17)
> >+#define ETH_RSS_PORT               (1ULL << 18)
> >+#define ETH_RSS_VXLAN              (1ULL << 19)
> >+#define ETH_RSS_GENEVE             (1ULL << 20)
> >+#define ETH_RSS_NVGRE              (1ULL << 21)
> >+
> >+/*
> >+ * We use the following macros to combine with above ETH_RSS_* for
> >+ * more specific input set selection. These bits are defined starting
> >+ * from the bottom of the 64 bits.
> 
> s/bottom/high end/

 Sorry, what does it mean, I didn't understand it for "s/bottom/high end/".

> 
> >+ */
> >+#define	ETH_RSS_L2_SRC_ONLY	   (1ULL << 63)
> >+#define	ETH_RSS_L2_DST_ONLY	   (1ULL << 62)
> >+#define	ETH_RSS_L3_SRC_ONLY	   (1ULL << 61)
> >+#define	ETH_RSS_L3_DST_ONLY	   (1ULL << 60)
> >+#define	ETH_RSS_L4_SRC_ONLY	   (1ULL << 59)
> >+#define	ETH_RSS_L4_DST_ONLY	   (1ULL << 58)
> 
> Keep one space after #define to be aligned with other MACRO definition.
> 
  Ok, I will modify it.

> Thanks,
> Xiaolong
> 
> >
> > #define ETH_RSS_IP ( \
> > 	ETH_RSS_IPV4 | \
> >--
> >1.8.3.1
> >

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

* Re: [dpdk-dev] [PATCH v2 1/2] ethdev: extend RSS offload types
  2019-09-25 12:00       ` Su, Simei
@ 2019-09-25 12:22         ` Ye Xiaolong
  2019-09-25 12:38           ` Su, Simei
  0 siblings, 1 reply; 97+ messages in thread
From: Ye Xiaolong @ 2019-09-25 12:22 UTC (permalink / raw)
  To: Su, Simei; +Cc: Zhang, Qi Z, Wu, Jingjing, dev

On 09/25, Su, Simei wrote:
>Hi, xiaolong
>
>> -----Original Message-----
>> From: Ye, Xiaolong
>> Sent: Wednesday, September 25, 2019 6:50 PM
>> To: Su, Simei <simei.su@intel.com>
>> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
>> dev@dpdk.org
>> Subject: Re: [PATCH v2 1/2] ethdev: extend RSS offload types
>> 
>> On 09/23, Simei Su wrote:
>> >This patch cover two aspects:
>> >  (1)decouple RTE_ETH_FLOW_* and ETH_RSS_*. Because both serve
>> >     different purposes.
>> >
>> >  (2)reserve several bits as input set selection from bottom
>> >     of the 64 bits. It is combined with exisiting ETH_RSS_* to
>> >     represent rss types.
>> >
>> >  for example:
>> >    ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY: hash on src ip address only
>> >    ETH_RSS_IPV4_UDP | ETH_RSS_L4_DST_ONLY: hash on src/dst IP and
>> >                                            dst UDP port
>> >    ETH_RSS_L2_PAYLOAD | ETH_RSS_L2_DST_ONLY: hash on dst mac
>> address
>> 
>> We also need to document well about what happens if users just set
>> ETH_RSS_IPV4, both both src/dst ip still are taken into account, right?
>> 
>
>  Yes, when users set ETH_RSS_IPV4, both src and dst ip are taken into account.
>  I will add this example. Thanks!

Please add it in the code comments or doc rather than the commit log.

Thanks,
Xiaolong

>
>> Thanks,
>> Xiaolong
>> 
>> 
>> >
>> >Signed-off-by: Simei Su <simei.su@intel.com>
>> >---
>> > lib/librte_ethdev/rte_ethdev.h | 60
>> >++++++++++++++++++++++++------------------
>> > 1 file changed, 35 insertions(+), 25 deletions(-)
>> >
>> >diff --git a/lib/librte_ethdev/rte_ethdev.h
>> >b/lib/librte_ethdev/rte_ethdev.h index d987178..7e6530d 100644
>> >--- a/lib/librte_ethdev/rte_ethdev.h
>> >+++ b/lib/librte_ethdev/rte_ethdev.h
>> >@@ -482,31 +482,41 @@ struct rte_eth_rss_conf {
>> > #define RTE_ETH_FLOW_MAX                23
>> >
>> > /*
>> >- * The RSS offload types are defined based on flow types.
>> >- * Different NIC hardware may support different RSS offload
>> >- * types. The supported flow types or RSS offload types can be queried
>> >by
>> >- * rte_eth_dev_info_get().
>> >- */
>> >-#define ETH_RSS_IPV4               (1ULL << RTE_ETH_FLOW_IPV4)
>> >-#define ETH_RSS_FRAG_IPV4          (1ULL <<
>> RTE_ETH_FLOW_FRAG_IPV4)
>> >-#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL <<
>> RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
>> >-#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL <<
>> RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
>> >-#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL <<
>> >RTE_ETH_FLOW_NONFRAG_IPV4_SCTP) -#define
>> ETH_RSS_NONFRAG_IPV4_OTHER (1ULL <<
>> RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
>> >-#define ETH_RSS_IPV6               (1ULL << RTE_ETH_FLOW_IPV6)
>> >-#define ETH_RSS_FRAG_IPV6          (1ULL <<
>> RTE_ETH_FLOW_FRAG_IPV6)
>> >-#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL <<
>> RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
>> >-#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL <<
>> RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
>> >-#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL <<
>> >RTE_ETH_FLOW_NONFRAG_IPV6_SCTP) -#define
>> ETH_RSS_NONFRAG_IPV6_OTHER (1ULL <<
>> RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
>> >-#define ETH_RSS_L2_PAYLOAD         (1ULL <<
>> RTE_ETH_FLOW_L2_PAYLOAD)
>> >-#define ETH_RSS_IPV6_EX            (1ULL << RTE_ETH_FLOW_IPV6_EX)
>> >-#define ETH_RSS_IPV6_TCP_EX        (1ULL <<
>> RTE_ETH_FLOW_IPV6_TCP_EX)
>> >-#define ETH_RSS_IPV6_UDP_EX        (1ULL <<
>> RTE_ETH_FLOW_IPV6_UDP_EX)
>> >-#define ETH_RSS_PORT               (1ULL << RTE_ETH_FLOW_PORT)
>> >-#define ETH_RSS_VXLAN              (1ULL << RTE_ETH_FLOW_VXLAN)
>> >-#define ETH_RSS_GENEVE             (1ULL << RTE_ETH_FLOW_GENEVE)
>> >-#define ETH_RSS_NVGRE              (1ULL << RTE_ETH_FLOW_NVGRE)
>> >+ * Below macros are defined for RSS offload types, they can be used to
>> >+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
>> >+ */
>> >+#define ETH_RSS_IPV4               (1ULL << 2)
>> >+#define ETH_RSS_FRAG_IPV4          (1ULL << 3)
>> >+#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << 4)
>> >+#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << 5)
>> >+#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << 6) #define
>> >+ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << 7)
>> >+#define ETH_RSS_IPV6               (1ULL << 8)
>> >+#define ETH_RSS_FRAG_IPV6          (1ULL << 9)
>> >+#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << 10)
>> >+#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << 11)
>> >+#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << 12) #define
>> >+ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << 13)
>> >+#define ETH_RSS_L2_PAYLOAD         (1ULL << 14)
>> >+#define ETH_RSS_IPV6_EX            (1ULL << 15)
>> >+#define ETH_RSS_IPV6_TCP_EX        (1ULL << 16)
>> >+#define ETH_RSS_IPV6_UDP_EX        (1ULL << 17)
>> >+#define ETH_RSS_PORT               (1ULL << 18)
>> >+#define ETH_RSS_VXLAN              (1ULL << 19)
>> >+#define ETH_RSS_GENEVE             (1ULL << 20)
>> >+#define ETH_RSS_NVGRE              (1ULL << 21)
>> >+
>> >+/*
>> >+ * We use the following macros to combine with above ETH_RSS_* for
>> >+ * more specific input set selection. These bits are defined starting
>> >+ * from the bottom of the 64 bits.
>> >+ */
>> >+#define	ETH_RSS_L2_SRC_ONLY	   (1ULL << 63)
>> >+#define	ETH_RSS_L2_DST_ONLY	   (1ULL << 62)
>> >+#define	ETH_RSS_L3_SRC_ONLY	   (1ULL << 61)
>> >+#define	ETH_RSS_L3_DST_ONLY	   (1ULL << 60)
>> >+#define	ETH_RSS_L4_SRC_ONLY	   (1ULL << 59)
>> >+#define	ETH_RSS_L4_DST_ONLY	   (1ULL << 58)
>> >
>> > #define ETH_RSS_IP ( \
>> > 	ETH_RSS_IPV4 | \
>> >--
>> >1.8.3.1
>> >

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

* Re: [dpdk-dev] [PATCH v2 1/2] ethdev: extend RSS offload types
  2019-09-25 12:04       ` Su, Simei
@ 2019-09-25 12:23         ` Ye Xiaolong
  2019-09-25 12:42           ` Su, Simei
  0 siblings, 1 reply; 97+ messages in thread
From: Ye Xiaolong @ 2019-09-25 12:23 UTC (permalink / raw)
  To: Su, Simei; +Cc: Zhang, Qi Z, Wu, Jingjing, dev

On 09/25, Su, Simei wrote:
>> >+/*
>> >+ * We use the following macros to combine with above ETH_RSS_* for
>> >+ * more specific input set selection. These bits are defined starting
>> >+ * from the bottom of the 64 bits.
>> 
>> s/bottom/high end/
>
> Sorry, what does it mean, I didn't understand it for "s/bottom/high end/".
>

I mean change "the bottom of the 64 bits" to "the high end of the 64 bits", what
do you think?

Thanks,
Xiaolong

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

* Re: [dpdk-dev] [PATCH v2 1/2] ethdev: extend RSS offload types
  2019-09-25 12:22         ` Ye Xiaolong
@ 2019-09-25 12:38           ` Su, Simei
  0 siblings, 0 replies; 97+ messages in thread
From: Su, Simei @ 2019-09-25 12:38 UTC (permalink / raw)
  To: Ye, Xiaolong; +Cc: Zhang, Qi Z, Wu, Jingjing, dev



> -----Original Message-----
> From: Ye, Xiaolong
> Sent: Wednesday, September 25, 2019 8:23 PM
> To: Su, Simei <simei.su@intel.com>
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> dev@dpdk.org
> Subject: Re: [PATCH v2 1/2] ethdev: extend RSS offload types
> 
> On 09/25, Su, Simei wrote:
> >Hi, xiaolong
> >
> >> -----Original Message-----
> >> From: Ye, Xiaolong
> >> Sent: Wednesday, September 25, 2019 6:50 PM
> >> To: Su, Simei <simei.su@intel.com>
> >> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing
> >> <jingjing.wu@intel.com>; dev@dpdk.org
> >> Subject: Re: [PATCH v2 1/2] ethdev: extend RSS offload types
> >>
> >> On 09/23, Simei Su wrote:
> >> >This patch cover two aspects:
> >> >  (1)decouple RTE_ETH_FLOW_* and ETH_RSS_*. Because both serve
> >> >     different purposes.
> >> >
> >> >  (2)reserve several bits as input set selection from bottom
> >> >     of the 64 bits. It is combined with exisiting ETH_RSS_* to
> >> >     represent rss types.
> >> >
> >> >  for example:
> >> >    ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY: hash on src ip address only
> >> >    ETH_RSS_IPV4_UDP | ETH_RSS_L4_DST_ONLY: hash on src/dst IP and
> >> >                                            dst UDP port
> >> >    ETH_RSS_L2_PAYLOAD | ETH_RSS_L2_DST_ONLY: hash on dst mac
> >> address
> >>
> >> We also need to document well about what happens if users just set
> >> ETH_RSS_IPV4, both both src/dst ip still are taken into account, right?
> >>
> >
> >  Yes, when users set ETH_RSS_IPV4, both src and dst ip are taken into
> account.
> >  I will add this example. Thanks!
> 
> Please add it in the code comments or doc rather than the commit log.
> 
  Ok, I will add it in the code comments.

> Thanks,
> Xiaolong
> 
> >
> >> Thanks,
> >> Xiaolong
> >>
> >>
> >> >
> >> >Signed-off-by: Simei Su <simei.su@intel.com>
> >> >---
> >> > lib/librte_ethdev/rte_ethdev.h | 60
> >> >++++++++++++++++++++++++------------------
> >> > 1 file changed, 35 insertions(+), 25 deletions(-)
> >> >
> >> >diff --git a/lib/librte_ethdev/rte_ethdev.h
> >> >b/lib/librte_ethdev/rte_ethdev.h index d987178..7e6530d 100644
> >> >--- a/lib/librte_ethdev/rte_ethdev.h
> >> >+++ b/lib/librte_ethdev/rte_ethdev.h
> >> >@@ -482,31 +482,41 @@ struct rte_eth_rss_conf {
> >> > #define RTE_ETH_FLOW_MAX                23
> >> >
> >> > /*
> >> >- * The RSS offload types are defined based on flow types.
> >> >- * Different NIC hardware may support different RSS offload
> >> >- * types. The supported flow types or RSS offload types can be
> >> >queried by
> >> >- * rte_eth_dev_info_get().
> >> >- */
> >> >-#define ETH_RSS_IPV4               (1ULL << RTE_ETH_FLOW_IPV4)
> >> >-#define ETH_RSS_FRAG_IPV4          (1ULL <<
> >> RTE_ETH_FLOW_FRAG_IPV4)
> >> >-#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL <<
> >> RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
> >> >-#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL <<
> >> RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
> >> >-#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL <<
> >> >RTE_ETH_FLOW_NONFRAG_IPV4_SCTP) -#define
> >> ETH_RSS_NONFRAG_IPV4_OTHER (1ULL <<
> >> RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
> >> >-#define ETH_RSS_IPV6               (1ULL << RTE_ETH_FLOW_IPV6)
> >> >-#define ETH_RSS_FRAG_IPV6          (1ULL <<
> >> RTE_ETH_FLOW_FRAG_IPV6)
> >> >-#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL <<
> >> RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
> >> >-#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL <<
> >> RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
> >> >-#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL <<
> >> >RTE_ETH_FLOW_NONFRAG_IPV6_SCTP) -#define
> >> ETH_RSS_NONFRAG_IPV6_OTHER (1ULL <<
> >> RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
> >> >-#define ETH_RSS_L2_PAYLOAD         (1ULL <<
> >> RTE_ETH_FLOW_L2_PAYLOAD)
> >> >-#define ETH_RSS_IPV6_EX            (1ULL <<
> RTE_ETH_FLOW_IPV6_EX)
> >> >-#define ETH_RSS_IPV6_TCP_EX        (1ULL <<
> >> RTE_ETH_FLOW_IPV6_TCP_EX)
> >> >-#define ETH_RSS_IPV6_UDP_EX        (1ULL <<
> >> RTE_ETH_FLOW_IPV6_UDP_EX)
> >> >-#define ETH_RSS_PORT               (1ULL << RTE_ETH_FLOW_PORT)
> >> >-#define ETH_RSS_VXLAN              (1ULL <<
> RTE_ETH_FLOW_VXLAN)
> >> >-#define ETH_RSS_GENEVE             (1ULL <<
> RTE_ETH_FLOW_GENEVE)
> >> >-#define ETH_RSS_NVGRE              (1ULL <<
> RTE_ETH_FLOW_NVGRE)
> >> >+ * Below macros are defined for RSS offload types, they can be used
> >> >+to
> >> >+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
> >> >+ */
> >> >+#define ETH_RSS_IPV4               (1ULL << 2)
> >> >+#define ETH_RSS_FRAG_IPV4          (1ULL << 3)
> >> >+#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << 4)
> >> >+#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << 5)
> >> >+#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << 6) #define
> >> >+ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << 7)
> >> >+#define ETH_RSS_IPV6               (1ULL << 8)
> >> >+#define ETH_RSS_FRAG_IPV6          (1ULL << 9)
> >> >+#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << 10)
> >> >+#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << 11)
> >> >+#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << 12) #define
> >> >+ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << 13)
> >> >+#define ETH_RSS_L2_PAYLOAD         (1ULL << 14)
> >> >+#define ETH_RSS_IPV6_EX            (1ULL << 15)
> >> >+#define ETH_RSS_IPV6_TCP_EX        (1ULL << 16)
> >> >+#define ETH_RSS_IPV6_UDP_EX        (1ULL << 17)
> >> >+#define ETH_RSS_PORT               (1ULL << 18)
> >> >+#define ETH_RSS_VXLAN              (1ULL << 19)
> >> >+#define ETH_RSS_GENEVE             (1ULL << 20)
> >> >+#define ETH_RSS_NVGRE              (1ULL << 21)
> >> >+
> >> >+/*
> >> >+ * We use the following macros to combine with above ETH_RSS_* for
> >> >+ * more specific input set selection. These bits are defined
> >> >+starting
> >> >+ * from the bottom of the 64 bits.
> >> >+ */
> >> >+#define	ETH_RSS_L2_SRC_ONLY	   (1ULL << 63)
> >> >+#define	ETH_RSS_L2_DST_ONLY	   (1ULL << 62)
> >> >+#define	ETH_RSS_L3_SRC_ONLY	   (1ULL << 61)
> >> >+#define	ETH_RSS_L3_DST_ONLY	   (1ULL << 60)
> >> >+#define	ETH_RSS_L4_SRC_ONLY	   (1ULL << 59)
> >> >+#define	ETH_RSS_L4_DST_ONLY	   (1ULL << 58)
> >> >
> >> > #define ETH_RSS_IP ( \
> >> > 	ETH_RSS_IPV4 | \
> >> >--
> >> >1.8.3.1
> >> >

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

* Re: [dpdk-dev] [PATCH v2 1/2] ethdev: extend RSS offload types
  2019-09-25 12:23         ` Ye Xiaolong
@ 2019-09-25 12:42           ` Su, Simei
  0 siblings, 0 replies; 97+ messages in thread
From: Su, Simei @ 2019-09-25 12:42 UTC (permalink / raw)
  To: Ye, Xiaolong; +Cc: Zhang, Qi Z, Wu, Jingjing, dev



> -----Original Message-----
> From: Ye, Xiaolong
> Sent: Wednesday, September 25, 2019 8:24 PM
> To: Su, Simei <simei.su@intel.com>
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> dev@dpdk.org
> Subject: Re: [PATCH v2 1/2] ethdev: extend RSS offload types
> 
> On 09/25, Su, Simei wrote:
> >> >+/*
> >> >+ * We use the following macros to combine with above ETH_RSS_* for
> >> >+ * more specific input set selection. These bits are defined
> >> >+starting
> >> >+ * from the bottom of the 64 bits.
> >>
> >> s/bottom/high end/
> >
> > Sorry, what does it mean, I didn't understand it for "s/bottom/high end/".
> >
> 
> I mean change "the bottom of the 64 bits" to "the high end of the 64 bits", what
> do you think?
> 
 Yes, "the high end of the 64 bits" seems better to avoid confusion. I will modify it in v3. Thanks!

> Thanks,
> Xiaolong

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

* [dpdk-dev] [PATCH v3 0/2] extend RSS offload types
  2019-09-23 14:05 ` [dpdk-dev] [PATCH v2 0/2] extend RSS offload types Simei Su
                     ` (2 preceding siblings ...)
  2019-09-24  5:32   ` [dpdk-dev] [PATCH v2 0/2] extend RSS offload types Zhang, Qi Z
@ 2019-09-25 14:06   ` " Simei Su
  2019-09-25 14:06     ` [dpdk-dev] [PATCH v3 1/2] ethdev: " Simei Su
                       ` (2 more replies)
  3 siblings, 3 replies; 97+ messages in thread
From: Simei Su @ 2019-09-25 14:06 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, xiaolong.ye; +Cc: dev, simei.su

[PATCH v3 1/2] ethdev: add several bits for extending rss offload types.
[PATCH v3 2/2] app/testpmd: add cmdline support for extending rss types.

v3:
* update code comments and code style.

v2:
* Revise annotation.

Simei Su (2):
  ethdev: extend RSS offload types
  app/testpmd: add RSS offload types extending support

 app/test-pmd/config.c          |  6 ++++
 lib/librte_ethdev/rte_ethdev.h | 63 +++++++++++++++++++++++++-----------------
 2 files changed, 43 insertions(+), 26 deletions(-)

-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v3 1/2] ethdev: extend RSS offload types
  2019-09-25 14:06   ` [dpdk-dev] [PATCH v3 " Simei Su
@ 2019-09-25 14:06     ` " Simei Su
  2019-09-26  9:16       ` Andrew Rybchenko
  2019-09-25 14:06     ` [dpdk-dev] [PATCH v3 2/2] app/testpmd: add RSS offload types extending support Simei Su
  2019-09-27  8:54     ` [dpdk-dev] [PATCH v4 0/3] extend RSS offload types Simei Su
  2 siblings, 1 reply; 97+ messages in thread
From: Simei Su @ 2019-09-25 14:06 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, xiaolong.ye; +Cc: dev, simei.su

This patch cover two aspects:
  (1)decouple RTE_ETH_FLOW_* and ETH_RSS_*. Because both serve
     different purposes.
  (2)reserve several bits as input set selection from the high
     end of the 64 bits. It is combined with exisiting ETH_RSS_*
     to represent rss types.

  for example:
     ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY: hash on src ip address only
     ETH_RSS_IPV4_UDP | ETH_RSS_L4_DST_ONLY: hash on src/dst IP and
                                             dst UDP port
     ETH_RSS_L2_PAYLOAD | ETH_RSS_L2_DST_ONLY: hash on dst mac address

Signed-off-by: Simei Su <simei.su@intel.com>
---
 lib/librte_ethdev/rte_ethdev.h | 63 +++++++++++++++++++++++++-----------------
 1 file changed, 37 insertions(+), 26 deletions(-)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d987178..9b5342d 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -453,7 +453,6 @@ struct rte_eth_rss_conf {
  * possible, and exclusively. For example, if a packet is identified as
  * 'RTE_ETH_FLOW_NONFRAG_IPV4_TCP', it will not be any of other flow types,
  * though it is an actual IPV4 packet.
- * Note that the flow types are used to define RSS offload types.
  */
 #define RTE_ETH_FLOW_UNKNOWN             0
 #define RTE_ETH_FLOW_RAW                 1
@@ -482,31 +481,43 @@ struct rte_eth_rss_conf {
 #define RTE_ETH_FLOW_MAX                23
 
 /*
- * The RSS offload types are defined based on flow types.
- * Different NIC hardware may support different RSS offload
- * types. The supported flow types or RSS offload types can be queried by
- * rte_eth_dev_info_get().
- */
-#define ETH_RSS_IPV4               (1ULL << RTE_ETH_FLOW_IPV4)
-#define ETH_RSS_FRAG_IPV4          (1ULL << RTE_ETH_FLOW_FRAG_IPV4)
-#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
-#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
-#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP)
-#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
-#define ETH_RSS_IPV6               (1ULL << RTE_ETH_FLOW_IPV6)
-#define ETH_RSS_FRAG_IPV6          (1ULL << RTE_ETH_FLOW_FRAG_IPV6)
-#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
-#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
-#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP)
-#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
-#define ETH_RSS_L2_PAYLOAD         (1ULL << RTE_ETH_FLOW_L2_PAYLOAD)
-#define ETH_RSS_IPV6_EX            (1ULL << RTE_ETH_FLOW_IPV6_EX)
-#define ETH_RSS_IPV6_TCP_EX        (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
-#define ETH_RSS_IPV6_UDP_EX        (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
-#define ETH_RSS_PORT               (1ULL << RTE_ETH_FLOW_PORT)
-#define ETH_RSS_VXLAN              (1ULL << RTE_ETH_FLOW_VXLAN)
-#define ETH_RSS_GENEVE             (1ULL << RTE_ETH_FLOW_GENEVE)
-#define ETH_RSS_NVGRE              (1ULL << RTE_ETH_FLOW_NVGRE)
+ * Below macros are defined for RSS offload types, they can be used to
+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
+ */
+#define ETH_RSS_IPV4               (1ULL << 2)
+#define ETH_RSS_FRAG_IPV4          (1ULL << 3)
+#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << 4)
+#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << 5)
+#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << 6)
+#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << 7)
+#define ETH_RSS_IPV6               (1ULL << 8)
+#define ETH_RSS_FRAG_IPV6          (1ULL << 9)
+#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << 10)
+#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << 11)
+#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << 12)
+#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << 13)
+#define ETH_RSS_L2_PAYLOAD         (1ULL << 14)
+#define ETH_RSS_IPV6_EX            (1ULL << 15)
+#define ETH_RSS_IPV6_TCP_EX        (1ULL << 16)
+#define ETH_RSS_IPV6_UDP_EX        (1ULL << 17)
+#define ETH_RSS_PORT               (1ULL << 18)
+#define ETH_RSS_VXLAN              (1ULL << 19)
+#define ETH_RSS_GENEVE             (1ULL << 20)
+#define ETH_RSS_NVGRE              (1ULL << 21)
+
+/*
+ * We use the following macros to combine with above ETH_RSS_* for
+ * more specific input set selection. These bits are defined starting
+ * from the high end of the 64 bits.
+ * Note: if use above ETH_RSS_* without SRC/DST_ONLY, it represents
+ * both SRC and DST are taken into account.
+ */
+#define ETH_RSS_L2_SRC_ONLY        (1ULL << 63)
+#define ETH_RSS_L2_DST_ONLY        (1ULL << 62)
+#define ETH_RSS_L3_SRC_ONLY        (1ULL << 61)
+#define ETH_RSS_L3_DST_ONLY        (1ULL << 60)
+#define ETH_RSS_L4_SRC_ONLY        (1ULL << 59)
+#define ETH_RSS_L4_DST_ONLY        (1ULL << 58)
 
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v3 2/2] app/testpmd: add RSS offload types extending support
  2019-09-25 14:06   ` [dpdk-dev] [PATCH v3 " Simei Su
  2019-09-25 14:06     ` [dpdk-dev] [PATCH v3 1/2] ethdev: " Simei Su
@ 2019-09-25 14:06     ` Simei Su
  2019-09-27  8:54     ` [dpdk-dev] [PATCH v4 0/3] extend RSS offload types Simei Su
  2 siblings, 0 replies; 97+ messages in thread
From: Simei Su @ 2019-09-25 14:06 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, xiaolong.ye; +Cc: dev, simei.su

This patch adds cmdline support for extended rss types configuration.

Signed-off-by: Simei Su <simei.su@intel.com>
---
 app/test-pmd/config.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 1a5a5c1..b95bd43 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -103,6 +103,12 @@
 	{ "tcp", ETH_RSS_TCP },
 	{ "sctp", ETH_RSS_SCTP },
 	{ "tunnel", ETH_RSS_TUNNEL },
+	{ "l2-src-only", ETH_RSS_L2_SRC_ONLY },
+	{ "l2-dst-only", ETH_RSS_L2_DST_ONLY },
+	{ "l3-src-only", ETH_RSS_L3_SRC_ONLY },
+	{ "l3-dst-only", ETH_RSS_L3_DST_ONLY },
+	{ "l4-src-only", ETH_RSS_L4_SRC_ONLY },
+	{ "l4-dst-only", ETH_RSS_L4_DST_ONLY },
 	{ NULL, 0 },
 };
 
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH v3 1/2] ethdev: extend RSS offload types
  2019-09-25 14:06     ` [dpdk-dev] [PATCH v3 1/2] ethdev: " Simei Su
@ 2019-09-26  9:16       ` Andrew Rybchenko
  2019-09-27  5:54         ` Zhang, Qi Z
  0 siblings, 1 reply; 97+ messages in thread
From: Andrew Rybchenko @ 2019-09-26  9:16 UTC (permalink / raw)
  To: Simei Su, qi.z.zhang, jingjing.wu, xiaolong.ye; +Cc: dev

On 9/25/19 5:06 PM, Simei Su wrote:
> This patch cover two aspects:
>    (1)decouple RTE_ETH_FLOW_* and ETH_RSS_*. Because both serve
>       different purposes.
>    (2)reserve several bits as input set selection from the high
>       end of the 64 bits. It is combined with exisiting ETH_RSS_*
>       to represent rss types.

If the patch covers two aspects why it is one patch instead of two?
It would be useful to motivate decouple a bit getter and provide
details since "different purposes" are hardly very useful. Which
purposes?

>    for example:
>       ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY: hash on src ip address only

Is  (ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY)
valid and an equivalent to ETH_RSS_IPV4 only?
If yes, shouldn't generic API care about it or each driver should do it?
Similar question is applicable to L4.

>       ETH_RSS_IPV4_UDP | ETH_RSS_L4_DST_ONLY: hash on src/dst IP and
>                                               dst UDP port
>       ETH_RSS_L2_PAYLOAD | ETH_RSS_L2_DST_ONLY: hash on dst mac address

I'm a bit confused by L2_PAYLOAD | L2_DST_ONLY. Does L2_PAYLOAD
mean entire L2 frame including header and payload?

> Signed-off-by: Simei Su <simei.su@intel.com>

[snip]


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

* Re: [dpdk-dev] [PATCH v3 1/2] ethdev: extend RSS offload types
  2019-09-26  9:16       ` Andrew Rybchenko
@ 2019-09-27  5:54         ` Zhang, Qi Z
  0 siblings, 0 replies; 97+ messages in thread
From: Zhang, Qi Z @ 2019-09-27  5:54 UTC (permalink / raw)
  To: Andrew Rybchenko, Su, Simei, Wu, Jingjing, Ye, Xiaolong; +Cc: dev



From: Andrew Rybchenko [mailto:arybchenko@solarflare.com] 
Sent: Thursday, September 26, 2019 5:16 PM
To: Su, Simei <simei.su@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v3 1/2] ethdev: extend RSS offload types

On 9/25/19 5:06 PM, Simei Su wrote:
This patch cover two aspects:
  (1)decouple RTE_ETH_FLOW_* and ETH_RSS_*. Because both serve
     different purposes.
  (2)reserve several bits as input set selection from the high
     end of the 64 bits. It is combined with exisiting ETH_RSS_*
     to represent rss types.

If the patch covers two aspects why it is one patch instead of two?
It would be useful to motivate decouple a bit getter and provide
details since "different purposes" are hardly very useful. Which
purposes?


[Qi: ]Though the second purpose depends on the first one, but I agree, it’s better to separate them in two patches



  for example:
     ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY: hash on src ip address only

Is  (ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY)
valid and an equivalent to ETH_RSS_IPV4 only?

[Qi:] The word “only” should be an exclusive attribute , so I don’t  think ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY is a valid case, 
Such configure should be rejected by all PMD ( better be handled in  generic API, but I did see a good place to add so far)
But I guess that should not be a problem, since nobody will intend to use with that way, also exist PMD may reject any new bit it don't know.


If yes, shouldn't generic API care about it or each driver should do it?
Similar question is applicable to L4.





     ETH_RSS_IPV4_UDP | ETH_RSS_L4_DST_ONLY: hash on src/dst IP and
                                             dst UDP port
     ETH_RSS_L2_PAYLOAD | ETH_RSS_L2_DST_ONLY: hash on dst mac address

I'm a bit confused by L2_PAYLOAD | L2_DST_ONLY. Does L2_PAYLOAD
mean entire L2 frame including header and payload?

[Qi:] yes, seems we are missing L2_RSS_ETH.

Regards
Qi

Signed-off-by: Simei Su <simei.su@intel.com>

[snip]

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

* [dpdk-dev] [PATCH v4 0/3] extend RSS offload types
  2019-09-25 14:06   ` [dpdk-dev] [PATCH v3 " Simei Su
  2019-09-25 14:06     ` [dpdk-dev] [PATCH v3 1/2] ethdev: " Simei Su
  2019-09-25 14:06     ` [dpdk-dev] [PATCH v3 2/2] app/testpmd: add RSS offload types extending support Simei Su
@ 2019-09-27  8:54     ` Simei Su
  2019-09-27  8:54       ` [dpdk-dev] [PATCH v4 1/3] ethdev: decouple flow types and " Simei Su
                         ` (3 more replies)
  2 siblings, 4 replies; 97+ messages in thread
From: Simei Su @ 2019-09-27  8:54 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, xiaolong.ye; +Cc: dev, simei.su

[PATCH v4 1/3] ethdev: decouple flow types and RSS offload types.
[PATCH v4 2/3] ethdev: add several bits for extending rss offload types.
[PATCH v4 3/3] app/testpmd: add cmdline support for extending rss types.

v4:
* divide one patch into two patches.
* delete ETH_RSS_L2_SRC/DST_ONLY.

v3:
* update code comments and code style.

v2:
* update code comments.

Simei Su (3):
  ethdev: decouple flow types and RSS offload types
  ethdev: extend RSS offload types
  app/testpmd: add RSS offload types extending support

 app/test-pmd/config.c          |  4 +++
 lib/librte_ethdev/rte_ethdev.h | 62 ++++++++++++++++++++++++------------------
 2 files changed, 40 insertions(+), 26 deletions(-)

-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v4 1/3] ethdev: decouple flow types and RSS offload types
  2019-09-27  8:54     ` [dpdk-dev] [PATCH v4 0/3] extend RSS offload types Simei Su
@ 2019-09-27  8:54       ` " Simei Su
  2019-09-29 11:32         ` Andrew Rybchenko
  2019-09-27  8:54       ` [dpdk-dev] [PATCH v4 2/3] ethdev: extend " Simei Su
                         ` (2 subsequent siblings)
  3 siblings, 1 reply; 97+ messages in thread
From: Simei Su @ 2019-09-27  8:54 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, xiaolong.ye; +Cc: dev, simei.su

This patch decouples RTE_ETH_FLOW_* and ETH_RSS_*. Both serves
different purposes. The former defines flow types. The later
defines RSS offload types.

Signed-off-by: Simei Su <simei.su@intel.com>
---
 lib/librte_ethdev/rte_ethdev.h | 49 ++++++++++++++++++++----------------------
 1 file changed, 23 insertions(+), 26 deletions(-)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d987178..1605467 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -453,7 +453,6 @@ struct rte_eth_rss_conf {
  * possible, and exclusively. For example, if a packet is identified as
  * 'RTE_ETH_FLOW_NONFRAG_IPV4_TCP', it will not be any of other flow types,
  * though it is an actual IPV4 packet.
- * Note that the flow types are used to define RSS offload types.
  */
 #define RTE_ETH_FLOW_UNKNOWN             0
 #define RTE_ETH_FLOW_RAW                 1
@@ -482,31 +481,29 @@ struct rte_eth_rss_conf {
 #define RTE_ETH_FLOW_MAX                23
 
 /*
- * The RSS offload types are defined based on flow types.
- * Different NIC hardware may support different RSS offload
- * types. The supported flow types or RSS offload types can be queried by
- * rte_eth_dev_info_get().
- */
-#define ETH_RSS_IPV4               (1ULL << RTE_ETH_FLOW_IPV4)
-#define ETH_RSS_FRAG_IPV4          (1ULL << RTE_ETH_FLOW_FRAG_IPV4)
-#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
-#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
-#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP)
-#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
-#define ETH_RSS_IPV6               (1ULL << RTE_ETH_FLOW_IPV6)
-#define ETH_RSS_FRAG_IPV6          (1ULL << RTE_ETH_FLOW_FRAG_IPV6)
-#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
-#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
-#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP)
-#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
-#define ETH_RSS_L2_PAYLOAD         (1ULL << RTE_ETH_FLOW_L2_PAYLOAD)
-#define ETH_RSS_IPV6_EX            (1ULL << RTE_ETH_FLOW_IPV6_EX)
-#define ETH_RSS_IPV6_TCP_EX        (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
-#define ETH_RSS_IPV6_UDP_EX        (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
-#define ETH_RSS_PORT               (1ULL << RTE_ETH_FLOW_PORT)
-#define ETH_RSS_VXLAN              (1ULL << RTE_ETH_FLOW_VXLAN)
-#define ETH_RSS_GENEVE             (1ULL << RTE_ETH_FLOW_GENEVE)
-#define ETH_RSS_NVGRE              (1ULL << RTE_ETH_FLOW_NVGRE)
+ * Below macros are defined for RSS offload types, they can be used to
+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
+ */
+#define ETH_RSS_IPV4               (1ULL << 2)
+#define ETH_RSS_FRAG_IPV4          (1ULL << 3)
+#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << 4)
+#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << 5)
+#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << 6)
+#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << 7)
+#define ETH_RSS_IPV6               (1ULL << 8)
+#define ETH_RSS_FRAG_IPV6          (1ULL << 9)
+#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << 10)
+#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << 11)
+#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << 12)
+#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << 13)
+#define ETH_RSS_L2_PAYLOAD         (1ULL << 14)
+#define ETH_RSS_IPV6_EX            (1ULL << 15)
+#define ETH_RSS_IPV6_TCP_EX        (1ULL << 16)
+#define ETH_RSS_IPV6_UDP_EX        (1ULL << 17)
+#define ETH_RSS_PORT               (1ULL << 18)
+#define ETH_RSS_VXLAN              (1ULL << 19)
+#define ETH_RSS_GENEVE             (1ULL << 20)
+#define ETH_RSS_NVGRE              (1ULL << 21)
 
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v4 2/3] ethdev: extend RSS offload types
  2019-09-27  8:54     ` [dpdk-dev] [PATCH v4 0/3] extend RSS offload types Simei Su
  2019-09-27  8:54       ` [dpdk-dev] [PATCH v4 1/3] ethdev: decouple flow types and " Simei Su
@ 2019-09-27  8:54       ` " Simei Su
  2019-09-28  1:03         ` Zhang, Qi Z
  2019-09-27  8:54       ` [dpdk-dev] [PATCH v4 3/3] app/testpmd: add RSS offload types extending support Simei Su
  2019-09-28  2:29       ` [dpdk-dev] [PATCH v5 0/3] extend RSS offload types Simei Su
  3 siblings, 1 reply; 97+ messages in thread
From: Simei Su @ 2019-09-27  8:54 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, xiaolong.ye; +Cc: dev, simei.su

This patch reserves several bits as input set selection from the
high end of the 64 bits. It is combined with exisiting ETH_RSS_*
to represent rss types.

for example:
  ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY: hash on src ip address only
  ETH_RSS_IPV4_UDP | ETH_RSS_L4_DST_ONLY: hash on src/dst IP and
                                          dst UDP port

Signed-off-by: Simei Su <simei.su@intel.com>
---
 lib/librte_ethdev/rte_ethdev.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 1605467..106b67f 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -505,6 +505,19 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_GENEVE             (1ULL << 20)
 #define ETH_RSS_NVGRE              (1ULL << 21)
 
+/*
+ * We use the following macros to combine with above ETH_RSS_* for
+ * more specific input set selection. These bits are defined starting
+ * from the high end of the 64 bits.
+ * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it represents
+ * both SRC and DST are taken into account. SRC_ONLY and DST_ONLY can't
+ * be used simultaneously.
+ */
+#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
+#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
+#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
+#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
+
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
 	ETH_RSS_FRAG_IPV4 | \
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v4 3/3] app/testpmd: add RSS offload types extending support
  2019-09-27  8:54     ` [dpdk-dev] [PATCH v4 0/3] extend RSS offload types Simei Su
  2019-09-27  8:54       ` [dpdk-dev] [PATCH v4 1/3] ethdev: decouple flow types and " Simei Su
  2019-09-27  8:54       ` [dpdk-dev] [PATCH v4 2/3] ethdev: extend " Simei Su
@ 2019-09-27  8:54       ` Simei Su
  2019-09-28 16:49         ` Ori Kam
  2019-09-28  2:29       ` [dpdk-dev] [PATCH v5 0/3] extend RSS offload types Simei Su
  3 siblings, 1 reply; 97+ messages in thread
From: Simei Su @ 2019-09-27  8:54 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, xiaolong.ye; +Cc: dev, simei.su

This patch adds cmdline support for extended rss types configuration.

Signed-off-by: Simei Su <simei.su@intel.com>
---
 app/test-pmd/config.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 1a5a5c1..a59a69e 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -103,6 +103,10 @@
 	{ "tcp", ETH_RSS_TCP },
 	{ "sctp", ETH_RSS_SCTP },
 	{ "tunnel", ETH_RSS_TUNNEL },
+	{ "l3-src-only", ETH_RSS_L3_SRC_ONLY },
+	{ "l3-dst-only", ETH_RSS_L3_DST_ONLY },
+	{ "l4-src-only", ETH_RSS_L4_SRC_ONLY },
+	{ "l4-dst-only", ETH_RSS_L4_DST_ONLY },
 	{ NULL, 0 },
 };
 
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH v4 2/3] ethdev: extend RSS offload types
  2019-09-27  8:54       ` [dpdk-dev] [PATCH v4 2/3] ethdev: extend " Simei Su
@ 2019-09-28  1:03         ` Zhang, Qi Z
  2019-09-28  1:39           ` Su, Simei
  0 siblings, 1 reply; 97+ messages in thread
From: Zhang, Qi Z @ 2019-09-28  1:03 UTC (permalink / raw)
  To: Su, Simei, Wu, Jingjing, Ye, Xiaolong; +Cc: dev



> -----Original Message-----
> From: Su, Simei
> Sent: Friday, September 27, 2019 4:54 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> Ye, Xiaolong <xiaolong.ye@intel.com>
> Cc: dev@dpdk.org; Su, Simei <simei.su@intel.com>
> Subject: [PATCH v4 2/3] ethdev: extend RSS offload types
> 
> This patch reserves several bits as input set selection from the high end of the
> 64 bits. It is combined with exisiting ETH_RSS_* to represent rss types.
> 
> for example:
>   ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY: hash on src ip address only
>   ETH_RSS_IPV4_UDP | ETH_RSS_L4_DST_ONLY: hash on src/dst IP and
>                                           dst UDP port
> 
> Signed-off-by: Simei Su <simei.su@intel.com>
> ---
>  lib/librte_ethdev/rte_ethdev.h | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> index 1605467..106b67f 100644
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -505,6 +505,19 @@ struct rte_eth_rss_conf {
>  #define ETH_RSS_GENEVE             (1ULL << 20)
>  #define ETH_RSS_NVGRE              (1ULL << 21)
> 
> +/*
> + * We use the following macros to combine with above ETH_RSS_* for
> + * more specific input set selection. These bits are defined starting
> + * from the high end of the 64 bits.
> + * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it represents
> + * both SRC and DST are taken into account. SRC_ONLY and DST_ONLY can't

To be more accurate, should be SRC_ONLY and DST_ONLY of the same level can't be used simultaneously.

> + * be used simultaneously.
> + */
> +#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
> +#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
> +#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
> +#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
> +
>  #define ETH_RSS_IP ( \
>  	ETH_RSS_IPV4 | \
>  	ETH_RSS_FRAG_IPV4 | \
> --
> 1.8.3.1


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

* Re: [dpdk-dev] [PATCH v4 2/3] ethdev: extend RSS offload types
  2019-09-28  1:03         ` Zhang, Qi Z
@ 2019-09-28  1:39           ` Su, Simei
  0 siblings, 0 replies; 97+ messages in thread
From: Su, Simei @ 2019-09-28  1:39 UTC (permalink / raw)
  To: Zhang, Qi Z, Wu, Jingjing, Ye, Xiaolong; +Cc: dev

Hi, Zhangqi

> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Saturday, September 28, 2019 9:04 AM
> To: Su, Simei <simei.su@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Ye,
> Xiaolong <xiaolong.ye@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH v4 2/3] ethdev: extend RSS offload types
> 
> 
> 
> > -----Original Message-----
> > From: Su, Simei
> > Sent: Friday, September 27, 2019 4:54 PM
> > To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing
> > <jingjing.wu@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>
> > Cc: dev@dpdk.org; Su, Simei <simei.su@intel.com>
> > Subject: [PATCH v4 2/3] ethdev: extend RSS offload types
> >
> > This patch reserves several bits as input set selection from the high
> > end of the
> > 64 bits. It is combined with exisiting ETH_RSS_* to represent rss types.
> >
> > for example:
> >   ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY: hash on src ip address only
> >   ETH_RSS_IPV4_UDP | ETH_RSS_L4_DST_ONLY: hash on src/dst IP and
> >                                           dst UDP port
> >
> > Signed-off-by: Simei Su <simei.su@intel.com>
> > ---
> >  lib/librte_ethdev/rte_ethdev.h | 13 +++++++++++++
> >  1 file changed, 13 insertions(+)
> >
> > diff --git a/lib/librte_ethdev/rte_ethdev.h
> > b/lib/librte_ethdev/rte_ethdev.h index 1605467..106b67f 100644
> > --- a/lib/librte_ethdev/rte_ethdev.h
> > +++ b/lib/librte_ethdev/rte_ethdev.h
> > @@ -505,6 +505,19 @@ struct rte_eth_rss_conf {
> >  #define ETH_RSS_GENEVE             (1ULL << 20)
> >  #define ETH_RSS_NVGRE              (1ULL << 21)
> >
> > +/*
> > + * We use the following macros to combine with above ETH_RSS_* for
> > + * more specific input set selection. These bits are defined starting
> > + * from the high end of the 64 bits.
> > + * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it
> > +represents
> > + * both SRC and DST are taken into account. SRC_ONLY and DST_ONLY
> > +can't
> 
> To be more accurate, should be SRC_ONLY and DST_ONLY of the same level can't
> be used simultaneously.

 Ok, I will modify it in v5. Thanks.

> 
> > + * be used simultaneously.
> > + */
> > +#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
> > +#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
> > +#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
> > +#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
> > +
> >  #define ETH_RSS_IP ( \
> >  	ETH_RSS_IPV4 | \
> >  	ETH_RSS_FRAG_IPV4 | \
> > --
> > 1.8.3.1


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

* [dpdk-dev] [PATCH v5 0/3] extend RSS offload types
  2019-09-27  8:54     ` [dpdk-dev] [PATCH v4 0/3] extend RSS offload types Simei Su
                         ` (2 preceding siblings ...)
  2019-09-27  8:54       ` [dpdk-dev] [PATCH v4 3/3] app/testpmd: add RSS offload types extending support Simei Su
@ 2019-09-28  2:29       ` Simei Su
  2019-09-28  2:29         ` [dpdk-dev] [PATCH v5 1/3] ethdev: decouple flow types and " Simei Su
                           ` (3 more replies)
  3 siblings, 4 replies; 97+ messages in thread
From: Simei Su @ 2019-09-28  2:29 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, xiaolong.ye; +Cc: dev, simei.su

[PATCH v5 1/3] ethdev: decouple flow types and RSS offload types.
[PATCH v5 2/3] ethdev: add several bits for extending rss offload types.
[PATCH v5 3/3] app/testpmd: add cmdline support for extending rss types.

v5:
* Update code comments.

v4:
* Divide one patch into two patches.
* Delete ETH_RSS_L2_SRC/DST_ONLY.

v3:
* Update code comments and code style.

v2:
* Update code comments.

Simei Su (3):
  ethdev: decouple flow types and RSS offload types
  ethdev: extend RSS offload types
  app/testpmd: add RSS offload types extending support

 app/test-pmd/config.c          |  4 +++
 lib/librte_ethdev/rte_ethdev.h | 62 ++++++++++++++++++++++++------------------
 2 files changed, 40 insertions(+), 26 deletions(-)

-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v5 1/3] ethdev: decouple flow types and RSS offload types
  2019-09-28  2:29       ` [dpdk-dev] [PATCH v5 0/3] extend RSS offload types Simei Su
@ 2019-09-28  2:29         ` " Simei Su
  2019-09-28 16:23           ` Ori Kam
  2019-09-28  2:29         ` [dpdk-dev] [PATCH v5 2/3] ethdev: extend " Simei Su
                           ` (2 subsequent siblings)
  3 siblings, 1 reply; 97+ messages in thread
From: Simei Su @ 2019-09-28  2:29 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, xiaolong.ye; +Cc: dev, simei.su

This patch decouples RTE_ETH_FLOW_* and ETH_RSS_*. Both serves
different purposes. The former defines flow types. The later
defines RSS offload types.

Signed-off-by: Simei Su <simei.su@intel.com>
---
 lib/librte_ethdev/rte_ethdev.h | 49 ++++++++++++++++++++----------------------
 1 file changed, 23 insertions(+), 26 deletions(-)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d987178..1605467 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -453,7 +453,6 @@ struct rte_eth_rss_conf {
  * possible, and exclusively. For example, if a packet is identified as
  * 'RTE_ETH_FLOW_NONFRAG_IPV4_TCP', it will not be any of other flow types,
  * though it is an actual IPV4 packet.
- * Note that the flow types are used to define RSS offload types.
  */
 #define RTE_ETH_FLOW_UNKNOWN             0
 #define RTE_ETH_FLOW_RAW                 1
@@ -482,31 +481,29 @@ struct rte_eth_rss_conf {
 #define RTE_ETH_FLOW_MAX                23
 
 /*
- * The RSS offload types are defined based on flow types.
- * Different NIC hardware may support different RSS offload
- * types. The supported flow types or RSS offload types can be queried by
- * rte_eth_dev_info_get().
- */
-#define ETH_RSS_IPV4               (1ULL << RTE_ETH_FLOW_IPV4)
-#define ETH_RSS_FRAG_IPV4          (1ULL << RTE_ETH_FLOW_FRAG_IPV4)
-#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
-#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
-#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP)
-#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
-#define ETH_RSS_IPV6               (1ULL << RTE_ETH_FLOW_IPV6)
-#define ETH_RSS_FRAG_IPV6          (1ULL << RTE_ETH_FLOW_FRAG_IPV6)
-#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
-#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
-#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP)
-#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
-#define ETH_RSS_L2_PAYLOAD         (1ULL << RTE_ETH_FLOW_L2_PAYLOAD)
-#define ETH_RSS_IPV6_EX            (1ULL << RTE_ETH_FLOW_IPV6_EX)
-#define ETH_RSS_IPV6_TCP_EX        (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
-#define ETH_RSS_IPV6_UDP_EX        (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
-#define ETH_RSS_PORT               (1ULL << RTE_ETH_FLOW_PORT)
-#define ETH_RSS_VXLAN              (1ULL << RTE_ETH_FLOW_VXLAN)
-#define ETH_RSS_GENEVE             (1ULL << RTE_ETH_FLOW_GENEVE)
-#define ETH_RSS_NVGRE              (1ULL << RTE_ETH_FLOW_NVGRE)
+ * Below macros are defined for RSS offload types, they can be used to
+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
+ */
+#define ETH_RSS_IPV4               (1ULL << 2)
+#define ETH_RSS_FRAG_IPV4          (1ULL << 3)
+#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << 4)
+#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << 5)
+#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << 6)
+#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << 7)
+#define ETH_RSS_IPV6               (1ULL << 8)
+#define ETH_RSS_FRAG_IPV6          (1ULL << 9)
+#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << 10)
+#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << 11)
+#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << 12)
+#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << 13)
+#define ETH_RSS_L2_PAYLOAD         (1ULL << 14)
+#define ETH_RSS_IPV6_EX            (1ULL << 15)
+#define ETH_RSS_IPV6_TCP_EX        (1ULL << 16)
+#define ETH_RSS_IPV6_UDP_EX        (1ULL << 17)
+#define ETH_RSS_PORT               (1ULL << 18)
+#define ETH_RSS_VXLAN              (1ULL << 19)
+#define ETH_RSS_GENEVE             (1ULL << 20)
+#define ETH_RSS_NVGRE              (1ULL << 21)
 
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v5 2/3] ethdev: extend RSS offload types
  2019-09-28  2:29       ` [dpdk-dev] [PATCH v5 0/3] extend RSS offload types Simei Su
  2019-09-28  2:29         ` [dpdk-dev] [PATCH v5 1/3] ethdev: decouple flow types and " Simei Su
@ 2019-09-28  2:29         ` " Simei Su
  2019-09-28 16:26           ` Ori Kam
  2019-09-28  2:29         ` [dpdk-dev] [PATCH v5 3/3] app/testpmd: add RSS offload types extending support Simei Su
  2019-09-29  5:11         ` [dpdk-dev] [PATCH v6 0/3] extend RSS offload types Simei Su
  3 siblings, 1 reply; 97+ messages in thread
From: Simei Su @ 2019-09-28  2:29 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, xiaolong.ye; +Cc: dev, simei.su

This patch reserves several bits as input set selection from the
high end of the 64 bits. It is combined with exisiting ETH_RSS_*
to represent rss types.

for example:
  ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY: hash on src ip address only
  ETH_RSS_IPV4_UDP | ETH_RSS_L4_DST_ONLY: hash on src/dst IP and
                                          dst UDP port

Signed-off-by: Simei Su <simei.su@intel.com>
---
 lib/librte_ethdev/rte_ethdev.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 1605467..53fe884 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -505,6 +505,19 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_GENEVE             (1ULL << 20)
 #define ETH_RSS_NVGRE              (1ULL << 21)
 
+/*
+ * We use the following macros to combine with above ETH_RSS_* for
+ * more specific input set selection. These bits are defined starting
+ * from the high end of the 64 bits.
+ * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it represents
+ * both SRC and DST are taken into account. SRC_ONLY and DST_ONLY of
+ * the same level can't be used simultaneously.
+ */
+#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
+#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
+#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
+#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
+
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
 	ETH_RSS_FRAG_IPV4 | \
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v5 3/3] app/testpmd: add RSS offload types extending support
  2019-09-28  2:29       ` [dpdk-dev] [PATCH v5 0/3] extend RSS offload types Simei Su
  2019-09-28  2:29         ` [dpdk-dev] [PATCH v5 1/3] ethdev: decouple flow types and " Simei Su
  2019-09-28  2:29         ` [dpdk-dev] [PATCH v5 2/3] ethdev: extend " Simei Su
@ 2019-09-28  2:29         ` Simei Su
  2019-09-29  5:11         ` [dpdk-dev] [PATCH v6 0/3] extend RSS offload types Simei Su
  3 siblings, 0 replies; 97+ messages in thread
From: Simei Su @ 2019-09-28  2:29 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, xiaolong.ye; +Cc: dev, simei.su

This patch adds cmdline support for extended rss types configuration.

Signed-off-by: Simei Su <simei.su@intel.com>
---
 app/test-pmd/config.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 1a5a5c1..a59a69e 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -103,6 +103,10 @@
 	{ "tcp", ETH_RSS_TCP },
 	{ "sctp", ETH_RSS_SCTP },
 	{ "tunnel", ETH_RSS_TUNNEL },
+	{ "l3-src-only", ETH_RSS_L3_SRC_ONLY },
+	{ "l3-dst-only", ETH_RSS_L3_DST_ONLY },
+	{ "l4-src-only", ETH_RSS_L4_SRC_ONLY },
+	{ "l4-dst-only", ETH_RSS_L4_DST_ONLY },
 	{ NULL, 0 },
 };
 
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH v5 1/3] ethdev: decouple flow types and RSS offload types
  2019-09-28  2:29         ` [dpdk-dev] [PATCH v5 1/3] ethdev: decouple flow types and " Simei Su
@ 2019-09-28 16:23           ` Ori Kam
  0 siblings, 0 replies; 97+ messages in thread
From: Ori Kam @ 2019-09-28 16:23 UTC (permalink / raw)
  To: Simei Su, qi.z.zhang, jingjing.wu, xiaolong.ye; +Cc: dev



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Simei Su
> Sent: Saturday, September 28, 2019 5:29 AM
> To: qi.z.zhang@intel.com; jingjing.wu@intel.com; xiaolong.ye@intel.com
> Cc: dev@dpdk.org; simei.su@intel.com
> Subject: [dpdk-dev] [PATCH v5 1/3] ethdev: decouple flow types and RSS offload
> types
> 
> This patch decouples RTE_ETH_FLOW_* and ETH_RSS_*. Both serves
> different purposes. The former defines flow types. The later
> defines RSS offload types.
> 
> Signed-off-by: Simei Su <simei.su@intel.com>
> ---

Acked-by: Ori Kam <orika@mellanox.com>
Thanks,
Ori

>  lib/librte_ethdev/rte_ethdev.h | 49 ++++++++++++++++++++----------------------
>  1 file changed, 23 insertions(+), 26 deletions(-)
> 
> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> index d987178..1605467 100644
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -453,7 +453,6 @@ struct rte_eth_rss_conf {
>   * possible, and exclusively. For example, if a packet is identified as
>   * 'RTE_ETH_FLOW_NONFRAG_IPV4_TCP', it will not be any of other flow
> types,
>   * though it is an actual IPV4 packet.
> - * Note that the flow types are used to define RSS offload types.
>   */
>  #define RTE_ETH_FLOW_UNKNOWN             0
>  #define RTE_ETH_FLOW_RAW                 1
> @@ -482,31 +481,29 @@ struct rte_eth_rss_conf {
>  #define RTE_ETH_FLOW_MAX                23
> 
>  /*
> - * The RSS offload types are defined based on flow types.
> - * Different NIC hardware may support different RSS offload
> - * types. The supported flow types or RSS offload types can be queried by
> - * rte_eth_dev_info_get().
> - */
> -#define ETH_RSS_IPV4               (1ULL << RTE_ETH_FLOW_IPV4)
> -#define ETH_RSS_FRAG_IPV4          (1ULL << RTE_ETH_FLOW_FRAG_IPV4)
> -#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL <<
> RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
> -#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL <<
> RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
> -#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL <<
> RTE_ETH_FLOW_NONFRAG_IPV4_SCTP)
> -#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL <<
> RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
> -#define ETH_RSS_IPV6               (1ULL << RTE_ETH_FLOW_IPV6)
> -#define ETH_RSS_FRAG_IPV6          (1ULL << RTE_ETH_FLOW_FRAG_IPV6)
> -#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL <<
> RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
> -#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL <<
> RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
> -#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL <<
> RTE_ETH_FLOW_NONFRAG_IPV6_SCTP)
> -#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL <<
> RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
> -#define ETH_RSS_L2_PAYLOAD         (1ULL << RTE_ETH_FLOW_L2_PAYLOAD)
> -#define ETH_RSS_IPV6_EX            (1ULL << RTE_ETH_FLOW_IPV6_EX)
> -#define ETH_RSS_IPV6_TCP_EX        (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
> -#define ETH_RSS_IPV6_UDP_EX        (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
> -#define ETH_RSS_PORT               (1ULL << RTE_ETH_FLOW_PORT)
> -#define ETH_RSS_VXLAN              (1ULL << RTE_ETH_FLOW_VXLAN)
> -#define ETH_RSS_GENEVE             (1ULL << RTE_ETH_FLOW_GENEVE)
> -#define ETH_RSS_NVGRE              (1ULL << RTE_ETH_FLOW_NVGRE)
> + * Below macros are defined for RSS offload types, they can be used to
> + * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
> + */
> +#define ETH_RSS_IPV4               (1ULL << 2)
> +#define ETH_RSS_FRAG_IPV4          (1ULL << 3)
> +#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << 4)
> +#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << 5)
> +#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << 6)
> +#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << 7)
> +#define ETH_RSS_IPV6               (1ULL << 8)
> +#define ETH_RSS_FRAG_IPV6          (1ULL << 9)
> +#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << 10)
> +#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << 11)
> +#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << 12)
> +#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << 13)
> +#define ETH_RSS_L2_PAYLOAD         (1ULL << 14)
> +#define ETH_RSS_IPV6_EX            (1ULL << 15)
> +#define ETH_RSS_IPV6_TCP_EX        (1ULL << 16)
> +#define ETH_RSS_IPV6_UDP_EX        (1ULL << 17)
> +#define ETH_RSS_PORT               (1ULL << 18)
> +#define ETH_RSS_VXLAN              (1ULL << 19)
> +#define ETH_RSS_GENEVE             (1ULL << 20)
> +#define ETH_RSS_NVGRE              (1ULL << 21)
> 
>  #define ETH_RSS_IP ( \
>  	ETH_RSS_IPV4 | \
> --
> 1.8.3.1


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

* Re: [dpdk-dev] [PATCH v5 2/3] ethdev: extend RSS offload types
  2019-09-28  2:29         ` [dpdk-dev] [PATCH v5 2/3] ethdev: extend " Simei Su
@ 2019-09-28 16:26           ` Ori Kam
  0 siblings, 0 replies; 97+ messages in thread
From: Ori Kam @ 2019-09-28 16:26 UTC (permalink / raw)
  To: Simei Su, qi.z.zhang, jingjing.wu, xiaolong.ye; +Cc: dev



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Simei Su
> Sent: Saturday, September 28, 2019 5:29 AM
> To: qi.z.zhang@intel.com; jingjing.wu@intel.com; xiaolong.ye@intel.com
> Cc: dev@dpdk.org; simei.su@intel.com
> Subject: [dpdk-dev] [PATCH v5 2/3] ethdev: extend RSS offload types
> 
> This patch reserves several bits as input set selection from the
> high end of the 64 bits. It is combined with exisiting ETH_RSS_*
> to represent rss types.
> 
> for example:
>   ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY: hash on src ip address only
>   ETH_RSS_IPV4_UDP | ETH_RSS_L4_DST_ONLY: hash on src/dst IP and
>                                           dst UDP port
> 
> Signed-off-by: Simei Su <simei.su@intel.com>
> ---


Acked-by: Ori Kam <orika@mellanox.com>
Thanks,
Ori Kam

>  lib/librte_ethdev/rte_ethdev.h | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> index 1605467..53fe884 100644
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -505,6 +505,19 @@ struct rte_eth_rss_conf {
>  #define ETH_RSS_GENEVE             (1ULL << 20)
>  #define ETH_RSS_NVGRE              (1ULL << 21)
> 
> +/*
> + * We use the following macros to combine with above ETH_RSS_* for
> + * more specific input set selection. These bits are defined starting
> + * from the high end of the 64 bits.
> + * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it represents
> + * both SRC and DST are taken into account. SRC_ONLY and DST_ONLY of
> + * the same level can't be used simultaneously.
> + */
> +#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
> +#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
> +#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
> +#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
> +
>  #define ETH_RSS_IP ( \
>  	ETH_RSS_IPV4 | \
>  	ETH_RSS_FRAG_IPV4 | \
> --
> 1.8.3.1


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

* Re: [dpdk-dev] [PATCH v4 3/3] app/testpmd: add RSS offload types extending support
  2019-09-27  8:54       ` [dpdk-dev] [PATCH v4 3/3] app/testpmd: add RSS offload types extending support Simei Su
@ 2019-09-28 16:49         ` Ori Kam
  2019-09-29  6:46           ` Su, Simei
  0 siblings, 1 reply; 97+ messages in thread
From: Ori Kam @ 2019-09-28 16:49 UTC (permalink / raw)
  To: Simei Su, qi.z.zhang, jingjing.wu, xiaolong.ye; +Cc: dev

Hi Simei,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Simei Su
> Sent: Friday, September 27, 2019 11:54 AM
> To: qi.z.zhang@intel.com; jingjing.wu@intel.com; xiaolong.ye@intel.com
> Cc: dev@dpdk.org; simei.su@intel.com
> Subject: [dpdk-dev] [PATCH v4 3/3] app/testpmd: add RSS offload types
> extending support
> 
> This patch adds cmdline support for extended rss types configuration.
> 
> Signed-off-by: Simei Su <simei.su@intel.com>
> ---
>  app/test-pmd/config.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 1a5a5c1..a59a69e 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -103,6 +103,10 @@
>  	{ "tcp", ETH_RSS_TCP },
>  	{ "sctp", ETH_RSS_SCTP },
>  	{ "tunnel", ETH_RSS_TUNNEL },
> +	{ "l3-src-only", ETH_RSS_L3_SRC_ONLY },
> +	{ "l3-dst-only", ETH_RSS_L3_DST_ONLY },
> +	{ "l4-src-only", ETH_RSS_L4_SRC_ONLY },
> +	{ "l4-dst-only", ETH_RSS_L4_DST_ONLY },
>  	{ NULL, 0 },
>  };
> 

You must also add the new flags in app/test-pmd/cmdline.c
So they can be used when creating rte_flow.

Thanks,
Ori Kam

> --
> 1.8.3.1


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

* [dpdk-dev] [PATCH v6 0/3] extend RSS offload types
  2019-09-28  2:29       ` [dpdk-dev] [PATCH v5 0/3] extend RSS offload types Simei Su
                           ` (2 preceding siblings ...)
  2019-09-28  2:29         ` [dpdk-dev] [PATCH v5 3/3] app/testpmd: add RSS offload types extending support Simei Su
@ 2019-09-29  5:11         ` Simei Su
  2019-09-29  5:11           ` [dpdk-dev] [PATCH v6 1/3] ethdev: decouple flow types and " Simei Su
                             ` (3 more replies)
  3 siblings, 4 replies; 97+ messages in thread
From: Simei Su @ 2019-09-29  5:11 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

[PATCH v6 1/3] ethdev: decouple flow types and RSS offload types.
[PATCH v6 2/3] ethdev: add several bits for extending rss offload types.
[PATCH v6 3/3] app/testpmd: add cmdline support for extending rss types.

v6:
* Add the new flag in app/test-pmd/cmdline.c.

v5:
* Update code comments.

v4:
* Divide one patch into two patches.
* Delete ETH_RSS_L2_SRC/DST_ONLY.

v3:
* Update code comments and code style.

v2:
* Update code comments.

Simei Su (3):
  ethdev: decouple flow types and RSS offload types
  ethdev: extend RSS offload types
  app/testpmd: add RSS offload types extending support

 app/test-pmd/cmdline.c         |  6 ++--
 app/test-pmd/config.c          |  4 +++
 lib/librte_ethdev/rte_ethdev.h | 62 ++++++++++++++++++++++++------------------
 3 files changed, 44 insertions(+), 28 deletions(-)

-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v6 1/3] ethdev: decouple flow types and RSS offload types
  2019-09-29  5:11         ` [dpdk-dev] [PATCH v6 0/3] extend RSS offload types Simei Su
@ 2019-09-29  5:11           ` " Simei Su
  2019-09-29  5:11           ` [dpdk-dev] [PATCH v6 2/3] ethdev: extend " Simei Su
                             ` (2 subsequent siblings)
  3 siblings, 0 replies; 97+ messages in thread
From: Simei Su @ 2019-09-29  5:11 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch decouples RTE_ETH_FLOW_* and ETH_RSS_*. Both serves
different purposes. The former defines flow types. The later\
defines RSS offload types.

Signed-off-by: Simei Su <simei.su@intel.com>
---
 lib/librte_ethdev/rte_ethdev.h | 49 ++++++++++++++++++++----------------------
 1 file changed, 23 insertions(+), 26 deletions(-)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d937fb4..7722f70 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -453,7 +453,6 @@ struct rte_eth_rss_conf {
  * possible, and exclusively. For example, if a packet is identified as
  * 'RTE_ETH_FLOW_NONFRAG_IPV4_TCP', it will not be any of other flow types,
  * though it is an actual IPV4 packet.
- * Note that the flow types are used to define RSS offload types.
  */
 #define RTE_ETH_FLOW_UNKNOWN             0
 #define RTE_ETH_FLOW_RAW                 1
@@ -482,31 +481,29 @@ struct rte_eth_rss_conf {
 #define RTE_ETH_FLOW_MAX                23
 
 /*
- * The RSS offload types are defined based on flow types.
- * Different NIC hardware may support different RSS offload
- * types. The supported flow types or RSS offload types can be queried by
- * rte_eth_dev_info_get().
- */
-#define ETH_RSS_IPV4               (1ULL << RTE_ETH_FLOW_IPV4)
-#define ETH_RSS_FRAG_IPV4          (1ULL << RTE_ETH_FLOW_FRAG_IPV4)
-#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
-#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
-#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP)
-#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
-#define ETH_RSS_IPV6               (1ULL << RTE_ETH_FLOW_IPV6)
-#define ETH_RSS_FRAG_IPV6          (1ULL << RTE_ETH_FLOW_FRAG_IPV6)
-#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
-#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
-#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP)
-#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
-#define ETH_RSS_L2_PAYLOAD         (1ULL << RTE_ETH_FLOW_L2_PAYLOAD)
-#define ETH_RSS_IPV6_EX            (1ULL << RTE_ETH_FLOW_IPV6_EX)
-#define ETH_RSS_IPV6_TCP_EX        (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
-#define ETH_RSS_IPV6_UDP_EX        (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
-#define ETH_RSS_PORT               (1ULL << RTE_ETH_FLOW_PORT)
-#define ETH_RSS_VXLAN              (1ULL << RTE_ETH_FLOW_VXLAN)
-#define ETH_RSS_GENEVE             (1ULL << RTE_ETH_FLOW_GENEVE)
-#define ETH_RSS_NVGRE              (1ULL << RTE_ETH_FLOW_NVGRE)
+ * Below macros are defined for RSS offload types, they can be used to
+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
+ */
+#define ETH_RSS_IPV4               (1ULL << 2)
+#define ETH_RSS_FRAG_IPV4          (1ULL << 3)
+#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << 4)
+#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << 5)
+#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << 6)
+#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << 7)
+#define ETH_RSS_IPV6               (1ULL << 8)
+#define ETH_RSS_FRAG_IPV6          (1ULL << 9)
+#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << 10)
+#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << 11)
+#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << 12)
+#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << 13)
+#define ETH_RSS_L2_PAYLOAD         (1ULL << 14)
+#define ETH_RSS_IPV6_EX            (1ULL << 15)
+#define ETH_RSS_IPV6_TCP_EX        (1ULL << 16)
+#define ETH_RSS_IPV6_UDP_EX        (1ULL << 17)
+#define ETH_RSS_PORT               (1ULL << 18)
+#define ETH_RSS_VXLAN              (1ULL << 19)
+#define ETH_RSS_GENEVE             (1ULL << 20)
+#define ETH_RSS_NVGRE              (1ULL << 21)
 
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v6 2/3] ethdev: extend RSS offload types
  2019-09-29  5:11         ` [dpdk-dev] [PATCH v6 0/3] extend RSS offload types Simei Su
  2019-09-29  5:11           ` [dpdk-dev] [PATCH v6 1/3] ethdev: decouple flow types and " Simei Su
@ 2019-09-29  5:11           ` " Simei Su
  2019-09-29 11:40             ` Andrew Rybchenko
  2019-09-29  5:11           ` [dpdk-dev] [PATCH v6 3/3] app/testpmd: add RSS offload types extending support Simei Su
  2019-09-29  7:09           ` [dpdk-dev] [PATCH v7 0/3] extend RSS offload types Simei Su
  3 siblings, 1 reply; 97+ messages in thread
From: Simei Su @ 2019-09-29  5:11 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch reserves several bits as input set selection from the
high end of the 64 bits. It is combined with exisiting ETH_RSS_*
to represent rss types.

for example:
  ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY: hash on src ip address only
  ETH_RSS_IPV4_UDP | ETH_RSS_L4_DST_ONLY: hash on src/dst IP and
                                          dst UDP port

Signed-off-by: Simei Su <simei.su@intel.com>
---
 lib/librte_ethdev/rte_ethdev.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 7722f70..e68bca8 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -505,6 +505,19 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_GENEVE             (1ULL << 20)
 #define ETH_RSS_NVGRE              (1ULL << 21)
 
+/*
+ * We use the following macros to combine with above ETH_RSS_* for
+ * more specific input set selection. These bits are defined starting
+ * from the high end of the 64 bits.
+ * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it represents
+ * both SRC and DST are taken into account. SRC_ONLY and DST_ONLY of
+ * the same level can't be used simultaneously.
+ */
+#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
+#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
+#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
+#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
+
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
 	ETH_RSS_FRAG_IPV4 | \
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v6 3/3] app/testpmd: add RSS offload types extending support
  2019-09-29  5:11         ` [dpdk-dev] [PATCH v6 0/3] extend RSS offload types Simei Su
  2019-09-29  5:11           ` [dpdk-dev] [PATCH v6 1/3] ethdev: decouple flow types and " Simei Su
  2019-09-29  5:11           ` [dpdk-dev] [PATCH v6 2/3] ethdev: extend " Simei Su
@ 2019-09-29  5:11           ` Simei Su
  2019-09-29  7:09           ` [dpdk-dev] [PATCH v7 0/3] extend RSS offload types Simei Su
  3 siblings, 0 replies; 97+ messages in thread
From: Simei Su @ 2019-09-29  5:11 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch adds cmdline support for extended rss types configuration.

Signed-off-by: Simei Su <simei.su@intel.com>
---
 app/test-pmd/cmdline.c | 6 ++++--
 app/test-pmd/config.c  | 4 ++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index def471d..354f3c0 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2375,7 +2375,8 @@ struct cmd_config_rss_hash_key {
 				 "ipv4#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#"
 				 "ipv4-other#ipv6#ipv6-frag#ipv6-tcp#ipv6-udp#"
 				 "ipv6-sctp#ipv6-other#l2-payload#ipv6-ex#"
-				 "ipv6-tcp-ex#ipv6-udp-ex");
+				 "ipv6-tcp-ex#ipv6-udp-ex#"
+				 "l3-src-only#l3-dst-only#l4-src-only#l4-dst-only");
 cmdline_parse_token_string_t cmd_config_rss_hash_key_value =
 	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);
 
@@ -2385,7 +2386,8 @@ struct cmd_config_rss_hash_key {
 	.help_str = "port config <port_id> rss-hash-key "
 		"ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|"
 		"ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|"
-		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex "
+		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
+		"l3-src-only|l3-dst-only|l4-src-only|l4-dst-only "
 		"<string of hex digits (variable length, NIC dependent)>",
 	.tokens = {
 		(void *)&cmd_config_rss_hash_key_port,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index a3b6cbd..5022d42 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -103,6 +103,10 @@
 	{ "tcp", ETH_RSS_TCP },
 	{ "sctp", ETH_RSS_SCTP },
 	{ "tunnel", ETH_RSS_TUNNEL },
+	{ "l3-src-only", ETH_RSS_L3_SRC_ONLY },
+	{ "l3-dst-only", ETH_RSS_L3_DST_ONLY },
+	{ "l4-src-only", ETH_RSS_L4_SRC_ONLY },
+	{ "l4-dst-only", ETH_RSS_L4_DST_ONLY },
 	{ NULL, 0 },
 };
 
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH v4 3/3] app/testpmd: add RSS offload types extending support
  2019-09-28 16:49         ` Ori Kam
@ 2019-09-29  6:46           ` Su, Simei
  2019-09-29  7:21             ` Su, Simei
  0 siblings, 1 reply; 97+ messages in thread
From: Su, Simei @ 2019-09-29  6:46 UTC (permalink / raw)
  To: Ori Kam, Zhang, Qi Z, Wu, Jingjing, Ye, Xiaolong; +Cc: dev

Hi, Ori Kam,

> -----Original Message-----
> From: Ori Kam [mailto:orika@mellanox.com]
> Sent: Sunday, September 29, 2019 12:49 AM
> To: Su, Simei <simei.su@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Wu,
> Jingjing <jingjing.wu@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH v4 3/3] app/testpmd: add RSS offload types
> extending support
> 
> Hi Simei,
> 
> > -----Original Message-----
> > From: dev <dev-bounces@dpdk.org> On Behalf Of Simei Su
> > Sent: Friday, September 27, 2019 11:54 AM
> > To: qi.z.zhang@intel.com; jingjing.wu@intel.com; xiaolong.ye@intel.com
> > Cc: dev@dpdk.org; simei.su@intel.com
> > Subject: [dpdk-dev] [PATCH v4 3/3] app/testpmd: add RSS offload types
> > extending support
> >
> > This patch adds cmdline support for extended rss types configuration.
> >
> > Signed-off-by: Simei Su <simei.su@intel.com>
> > ---
> >  app/test-pmd/config.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index
> > 1a5a5c1..a59a69e 100644
> > --- a/app/test-pmd/config.c
> > +++ b/app/test-pmd/config.c
> > @@ -103,6 +103,10 @@
> >  	{ "tcp", ETH_RSS_TCP },
> >  	{ "sctp", ETH_RSS_SCTP },
> >  	{ "tunnel", ETH_RSS_TUNNEL },
> > +	{ "l3-src-only", ETH_RSS_L3_SRC_ONLY },
> > +	{ "l3-dst-only", ETH_RSS_L3_DST_ONLY },
> > +	{ "l4-src-only", ETH_RSS_L4_SRC_ONLY },
> > +	{ "l4-dst-only", ETH_RSS_L4_DST_ONLY },
> >  	{ NULL, 0 },
> >  };
> >
> 
> You must also add the new flags in app/test-pmd/cmdline.c So they can be used
> when creating rte_flow.

  If nothing added in app/test-pmd/cmdline.c, they can also be created successfully when creating rte_flow.
  If still need to add the new flag in app/test-pmd/cmdline.c, I will add related code in next patch.

Br
Simei

> 
> Thanks,
> Ori Kam
> 
> > --
> > 1.8.3.1


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

* [dpdk-dev] [PATCH v7 0/3] extend RSS offload types
  2019-09-29  5:11         ` [dpdk-dev] [PATCH v6 0/3] extend RSS offload types Simei Su
                             ` (2 preceding siblings ...)
  2019-09-29  5:11           ` [dpdk-dev] [PATCH v6 3/3] app/testpmd: add RSS offload types extending support Simei Su
@ 2019-09-29  7:09           ` Simei Su
  2019-09-29  7:09             ` [dpdk-dev] [PATCH v7 1/3] ethdev: decouple flow types and " Simei Su
                               ` (3 more replies)
  3 siblings, 4 replies; 97+ messages in thread
From: Simei Su @ 2019-09-29  7:09 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

[PATCH v7 1/3] ethdev: decouple flow types and RSS offload types.
[PATCH v7 2/3] ethdev: add several bits for extending rss offload types.
[PATCH v7 3/3] app/testpmd: add cmdline support for extending rss types.

v7:
* Supplement related configuration for new flag in app/test-pmd/cmdline.c.

v6:
* Add the new flag in app/test-pmd/cmdline.c.

v5:
* Update code comments.

v4:
* Divide one patch into two patches.
* Delete ETH_RSS_L2_SRC/DST_ONLY.

v3:
* Update code comments and code style.

v2:
* Update code comments.

Simei Su (3):
  ethdev: decouple flow types and RSS offload types
  ethdev: extend RSS offload types
  app/testpmd: add RSS offload types extending support

 app/test-pmd/cmdline.c         | 18 ++++++++++--
 app/test-pmd/config.c          |  4 +++
 lib/librte_ethdev/rte_ethdev.h | 62 ++++++++++++++++++++++++------------------
 3 files changed, 55 insertions(+), 29 deletions(-)

-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v7 1/3] ethdev: decouple flow types and RSS offload types
  2019-09-29  7:09           ` [dpdk-dev] [PATCH v7 0/3] extend RSS offload types Simei Su
@ 2019-09-29  7:09             ` " Simei Su
  2019-09-29  7:55               ` Yang, Zhiyong
  2019-09-29  7:09             ` [dpdk-dev] [PATCH v7 2/3] ethdev: extend " Simei Su
                               ` (2 subsequent siblings)
  3 siblings, 1 reply; 97+ messages in thread
From: Simei Su @ 2019-09-29  7:09 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch decouples RTE_ETH_FLOW_* and ETH_RSS_*. Both serves
different purposes. The former defines flow types. The later\
defines RSS offload types.

Signed-off-by: Simei Su <simei.su@intel.com>
---
 lib/librte_ethdev/rte_ethdev.h | 49 ++++++++++++++++++++----------------------
 1 file changed, 23 insertions(+), 26 deletions(-)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d937fb4..7722f70 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -453,7 +453,6 @@ struct rte_eth_rss_conf {
  * possible, and exclusively. For example, if a packet is identified as
  * 'RTE_ETH_FLOW_NONFRAG_IPV4_TCP', it will not be any of other flow types,
  * though it is an actual IPV4 packet.
- * Note that the flow types are used to define RSS offload types.
  */
 #define RTE_ETH_FLOW_UNKNOWN             0
 #define RTE_ETH_FLOW_RAW                 1
@@ -482,31 +481,29 @@ struct rte_eth_rss_conf {
 #define RTE_ETH_FLOW_MAX                23
 
 /*
- * The RSS offload types are defined based on flow types.
- * Different NIC hardware may support different RSS offload
- * types. The supported flow types or RSS offload types can be queried by
- * rte_eth_dev_info_get().
- */
-#define ETH_RSS_IPV4               (1ULL << RTE_ETH_FLOW_IPV4)
-#define ETH_RSS_FRAG_IPV4          (1ULL << RTE_ETH_FLOW_FRAG_IPV4)
-#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
-#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
-#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP)
-#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
-#define ETH_RSS_IPV6               (1ULL << RTE_ETH_FLOW_IPV6)
-#define ETH_RSS_FRAG_IPV6          (1ULL << RTE_ETH_FLOW_FRAG_IPV6)
-#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
-#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
-#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP)
-#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
-#define ETH_RSS_L2_PAYLOAD         (1ULL << RTE_ETH_FLOW_L2_PAYLOAD)
-#define ETH_RSS_IPV6_EX            (1ULL << RTE_ETH_FLOW_IPV6_EX)
-#define ETH_RSS_IPV6_TCP_EX        (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
-#define ETH_RSS_IPV6_UDP_EX        (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
-#define ETH_RSS_PORT               (1ULL << RTE_ETH_FLOW_PORT)
-#define ETH_RSS_VXLAN              (1ULL << RTE_ETH_FLOW_VXLAN)
-#define ETH_RSS_GENEVE             (1ULL << RTE_ETH_FLOW_GENEVE)
-#define ETH_RSS_NVGRE              (1ULL << RTE_ETH_FLOW_NVGRE)
+ * Below macros are defined for RSS offload types, they can be used to
+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
+ */
+#define ETH_RSS_IPV4               (1ULL << 2)
+#define ETH_RSS_FRAG_IPV4          (1ULL << 3)
+#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << 4)
+#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << 5)
+#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << 6)
+#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << 7)
+#define ETH_RSS_IPV6               (1ULL << 8)
+#define ETH_RSS_FRAG_IPV6          (1ULL << 9)
+#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << 10)
+#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << 11)
+#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << 12)
+#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << 13)
+#define ETH_RSS_L2_PAYLOAD         (1ULL << 14)
+#define ETH_RSS_IPV6_EX            (1ULL << 15)
+#define ETH_RSS_IPV6_TCP_EX        (1ULL << 16)
+#define ETH_RSS_IPV6_UDP_EX        (1ULL << 17)
+#define ETH_RSS_PORT               (1ULL << 18)
+#define ETH_RSS_VXLAN              (1ULL << 19)
+#define ETH_RSS_GENEVE             (1ULL << 20)
+#define ETH_RSS_NVGRE              (1ULL << 21)
 
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v7 2/3] ethdev: extend RSS offload types
  2019-09-29  7:09           ` [dpdk-dev] [PATCH v7 0/3] extend RSS offload types Simei Su
  2019-09-29  7:09             ` [dpdk-dev] [PATCH v7 1/3] ethdev: decouple flow types and " Simei Su
@ 2019-09-29  7:09             ` " Simei Su
  2019-09-29  8:55               ` Su, Simei
  2019-09-29  7:09             ` [dpdk-dev] [PATCH v7 3/3] app/testpmd: add RSS offload types extending support Simei Su
  2019-10-01 14:36             ` [dpdk-dev] [PATCH v8 0/3] extend RSS offload types Simei Su
  3 siblings, 1 reply; 97+ messages in thread
From: Simei Su @ 2019-09-29  7:09 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch reserves several bits as input set selection from the
high end of the 64 bits. It is combined with exisiting ETH_RSS_*
to represent rss types.

for example:
  ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY: hash on src ip address only
  ETH_RSS_IPV4_UDP | ETH_RSS_L4_DST_ONLY: hash on src/dst IP and
                                          dst UDP port

Signed-off-by: Simei Su <simei.su@intel.com>
---
 lib/librte_ethdev/rte_ethdev.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 7722f70..e68bca8 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -505,6 +505,19 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_GENEVE             (1ULL << 20)
 #define ETH_RSS_NVGRE              (1ULL << 21)
 
+/*
+ * We use the following macros to combine with above ETH_RSS_* for
+ * more specific input set selection. These bits are defined starting
+ * from the high end of the 64 bits.
+ * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it represents
+ * both SRC and DST are taken into account. SRC_ONLY and DST_ONLY of
+ * the same level can't be used simultaneously.
+ */
+#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
+#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
+#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
+#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
+
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
 	ETH_RSS_FRAG_IPV4 | \
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v7 3/3] app/testpmd: add RSS offload types extending support
  2019-09-29  7:09           ` [dpdk-dev] [PATCH v7 0/3] extend RSS offload types Simei Su
  2019-09-29  7:09             ` [dpdk-dev] [PATCH v7 1/3] ethdev: decouple flow types and " Simei Su
  2019-09-29  7:09             ` [dpdk-dev] [PATCH v7 2/3] ethdev: extend " Simei Su
@ 2019-09-29  7:09             ` Simei Su
  2019-10-01 14:36             ` [dpdk-dev] [PATCH v8 0/3] extend RSS offload types Simei Su
  3 siblings, 0 replies; 97+ messages in thread
From: Simei Su @ 2019-09-29  7:09 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch adds cmdline support for extended rss types configuration.

Signed-off-by: Simei Su <simei.su@intel.com>
---
 app/test-pmd/cmdline.c | 18 +++++++++++++++---
 app/test-pmd/config.c  |  4 ++++
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index def471d..f5c0cde 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2189,7 +2189,9 @@ struct cmd_config_rss {
 	if (!strcmp(res->value, "all"))
 		rss_conf.rss_hf = ETH_RSS_IP | ETH_RSS_TCP |
 				ETH_RSS_UDP | ETH_RSS_SCTP |
-					ETH_RSS_L2_PAYLOAD;
+					ETH_RSS_L2_PAYLOAD |
+				ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY |
+				ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY;
 	else if (!strcmp(res->value, "ip"))
 		rss_conf.rss_hf = ETH_RSS_IP;
 	else if (!strcmp(res->value, "udp"))
@@ -2208,6 +2210,14 @@ struct cmd_config_rss {
 		rss_conf.rss_hf = ETH_RSS_GENEVE;
 	else if (!strcmp(res->value, "nvgre"))
 		rss_conf.rss_hf = ETH_RSS_NVGRE;
+	else if (!strcmp(res->value, "l3-src-only"))
+		rss_conf.rss_hf = ETH_RSS_L3_SRC_ONLY;
+	else if (!strcmp(res->value, "l3-dst-only"))
+		rss_conf.rss_hf = ETH_RSS_L3_DST_ONLY;
+	else if (!strcmp(res->value, "l4-src-only"))
+		rss_conf.rss_hf = ETH_RSS_L4_SRC_ONLY;
+	else if (!strcmp(res->value, "l4-dst-only"))
+		rss_conf.rss_hf = ETH_RSS_L4_DST_ONLY;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "default"))
@@ -2375,7 +2385,8 @@ struct cmd_config_rss_hash_key {
 				 "ipv4#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#"
 				 "ipv4-other#ipv6#ipv6-frag#ipv6-tcp#ipv6-udp#"
 				 "ipv6-sctp#ipv6-other#l2-payload#ipv6-ex#"
-				 "ipv6-tcp-ex#ipv6-udp-ex");
+				 "ipv6-tcp-ex#ipv6-udp-ex#"
+				 "l3-src-only#l3-dst-only#l4-src-only#l4-dst-only");
 cmdline_parse_token_string_t cmd_config_rss_hash_key_value =
 	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);
 
@@ -2385,7 +2396,8 @@ struct cmd_config_rss_hash_key {
 	.help_str = "port config <port_id> rss-hash-key "
 		"ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|"
 		"ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|"
-		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex "
+		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
+		"l3-src-only|l3-dst-only|l4-src-only|l4-dst-only "
 		"<string of hex digits (variable length, NIC dependent)>",
 	.tokens = {
 		(void *)&cmd_config_rss_hash_key_port,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index a3b6cbd..5022d42 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -103,6 +103,10 @@
 	{ "tcp", ETH_RSS_TCP },
 	{ "sctp", ETH_RSS_SCTP },
 	{ "tunnel", ETH_RSS_TUNNEL },
+	{ "l3-src-only", ETH_RSS_L3_SRC_ONLY },
+	{ "l3-dst-only", ETH_RSS_L3_DST_ONLY },
+	{ "l4-src-only", ETH_RSS_L4_SRC_ONLY },
+	{ "l4-dst-only", ETH_RSS_L4_DST_ONLY },
 	{ NULL, 0 },
 };
 
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH v4 3/3] app/testpmd: add RSS offload types extending support
  2019-09-29  6:46           ` Su, Simei
@ 2019-09-29  7:21             ` Su, Simei
  0 siblings, 0 replies; 97+ messages in thread
From: Su, Simei @ 2019-09-29  7:21 UTC (permalink / raw)
  To: Su, Simei, Ori Kam, Zhang, Qi Z, Wu, Jingjing, Ye, Xiaolong; +Cc: dev

Hi, Ori Kam,
  I have updated the patch for v7.

Br
Simei

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Su, Simei
> Sent: Sunday, September 29, 2019 2:47 PM
> To: Ori Kam <orika@mellanox.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Wu,
> Jingjing <jingjing.wu@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v4 3/3] app/testpmd: add RSS offload types
> extending support
> 
> Hi, Ori Kam,
> 
> > -----Original Message-----
> > From: Ori Kam [mailto:orika@mellanox.com]
> > Sent: Sunday, September 29, 2019 12:49 AM
> > To: Su, Simei <simei.su@intel.com>; Zhang, Qi Z
> > <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Ye,
> > Xiaolong <xiaolong.ye@intel.com>
> > Cc: dev@dpdk.org
> > Subject: RE: [dpdk-dev] [PATCH v4 3/3] app/testpmd: add RSS offload
> > types extending support
> >
> > Hi Simei,
> >
> > > -----Original Message-----
> > > From: dev <dev-bounces@dpdk.org> On Behalf Of Simei Su
> > > Sent: Friday, September 27, 2019 11:54 AM
> > > To: qi.z.zhang@intel.com; jingjing.wu@intel.com;
> > > xiaolong.ye@intel.com
> > > Cc: dev@dpdk.org; simei.su@intel.com
> > > Subject: [dpdk-dev] [PATCH v4 3/3] app/testpmd: add RSS offload
> > > types extending support
> > >
> > > This patch adds cmdline support for extended rss types configuration.
> > >
> > > Signed-off-by: Simei Su <simei.su@intel.com>
> > > ---
> > >  app/test-pmd/config.c | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > >
> > > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index
> > > 1a5a5c1..a59a69e 100644
> > > --- a/app/test-pmd/config.c
> > > +++ b/app/test-pmd/config.c
> > > @@ -103,6 +103,10 @@
> > >  	{ "tcp", ETH_RSS_TCP },
> > >  	{ "sctp", ETH_RSS_SCTP },
> > >  	{ "tunnel", ETH_RSS_TUNNEL },
> > > +	{ "l3-src-only", ETH_RSS_L3_SRC_ONLY },
> > > +	{ "l3-dst-only", ETH_RSS_L3_DST_ONLY },
> > > +	{ "l4-src-only", ETH_RSS_L4_SRC_ONLY },
> > > +	{ "l4-dst-only", ETH_RSS_L4_DST_ONLY },
> > >  	{ NULL, 0 },
> > >  };
> > >
> >
> > You must also add the new flags in app/test-pmd/cmdline.c So they can
> > be used when creating rte_flow.
> 
>   If nothing added in app/test-pmd/cmdline.c, they can also be created
> successfully when creating rte_flow.
>   If still need to add the new flag in app/test-pmd/cmdline.c, I will add related
> code in next patch.
> 
> Br
> Simei
> 
> >
> > Thanks,
> > Ori Kam
> >
> > > --
> > > 1.8.3.1


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

* Re: [dpdk-dev] [PATCH v7 1/3] ethdev: decouple flow types and RSS offload types
  2019-09-29  7:09             ` [dpdk-dev] [PATCH v7 1/3] ethdev: decouple flow types and " Simei Su
@ 2019-09-29  7:55               ` Yang, Zhiyong
  2019-09-29  8:38                 ` Su, Simei
  0 siblings, 1 reply; 97+ messages in thread
From: Yang, Zhiyong @ 2019-09-29  7:55 UTC (permalink / raw)
  To: Su, Simei, Zhang, Qi Z, Wu, Jingjing, Ye, Xiaolong, Yigit, Ferruh
  Cc: dev, Su, Simei, orika

Hi Simei,

Just one reminder.
It looks that you miss to add the Ori's ack to this patch.
Acked-by: Ori Kam <orika@mellanox.com>

Thanks
Zhiyong

-----Original Message-----
From: dev <dev-bounces@dpdk.org> On Behalf Of Simei Su
Sent: Sunday, September 29, 2019 3:09 PM
To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
Cc: dev@dpdk.org; Su, Simei <simei.su@intel.com>
Subject: [dpdk-dev] [PATCH v7 1/3] ethdev: decouple flow types and RSS offload types

This patch decouples RTE_ETH_FLOW_* and ETH_RSS_*. Both serves different purposes. The former defines flow types. The later\ defines RSS offload types.

Signed-off-by: Simei Su <simei.su@intel.com>
---
.....<snip>......

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

* Re: [dpdk-dev] [PATCH v7 1/3] ethdev: decouple flow types and RSS offload types
  2019-09-29  7:55               ` Yang, Zhiyong
@ 2019-09-29  8:38                 ` Su, Simei
  0 siblings, 0 replies; 97+ messages in thread
From: Su, Simei @ 2019-09-29  8:38 UTC (permalink / raw)
  To: Yang, Zhiyong, Zhang, Qi Z, Wu, Jingjing, Ye, Xiaolong, Yigit, Ferruh
  Cc: dev, orika

Hi, Zhiyong

> -----Original Message-----
> From: Yang, Zhiyong
> Sent: Sunday, September 29, 2019 3:55 PM
> To: Su, Simei <simei.su@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Wu,
> Jingjing <jingjing.wu@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>; Yigit,
> Ferruh <ferruh.yigit@intel.com>
> Cc: dev@dpdk.org; Su, Simei <simei.su@intel.com>; orika@mellanox.com
> Subject: RE: [dpdk-dev] [PATCH v7 1/3] ethdev: decouple flow types and RSS
> offload types
> 
> Hi Simei,
> 
> Just one reminder.
> It looks that you miss to add the Ori's ack to this patch.
> Acked-by: Ori Kam <orika@mellanox.com>
> 
  Thanks a lot for your reminder.

> Thanks
> Zhiyong
> 
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Simei Su
> Sent: Sunday, September 29, 2019 3:09 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> Ye, Xiaolong <xiaolong.ye@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> Cc: dev@dpdk.org; Su, Simei <simei.su@intel.com>
> Subject: [dpdk-dev] [PATCH v7 1/3] ethdev: decouple flow types and RSS offload
> types
> 
> This patch decouples RTE_ETH_FLOW_* and ETH_RSS_*. Both serves different
> purposes. The former defines flow types. The later\ defines RSS offload types.
> 
> Signed-off-by: Simei Su <simei.su@intel.com>
  Acked-by: Ori Kam <orika@mellanox.com>
> ---
> .....<snip>......

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

* Re: [dpdk-dev] [PATCH v7 2/3] ethdev: extend RSS offload types
  2019-09-29  7:09             ` [dpdk-dev] [PATCH v7 2/3] ethdev: extend " Simei Su
@ 2019-09-29  8:55               ` Su, Simei
  2019-09-29  9:15                 ` Su, Simei
  0 siblings, 1 reply; 97+ messages in thread
From: Su, Simei @ 2019-09-29  8:55 UTC (permalink / raw)
  To: Zhang, Qi Z, Wu, Jingjing, Ye, Xiaolong, Yigit, Ferruh; +Cc: dev



> -----Original Message-----
> From: Su, Simei
> Sent: Sunday, September 29, 2019 3:09 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> Ye, Xiaolong <xiaolong.ye@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> Cc: dev@dpdk.org; Su, Simei <simei.su@intel.com>
> Subject: [PATCH v7 2/3] ethdev: extend RSS offload types
> 
> This patch reserves several bits as input set selection from the high end of the 64
> bits. It is combined with exisiting ETH_RSS_* to represent rss types.
> 
> for example:
>   ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY: hash on src ip address only
>   ETH_RSS_IPV4_UDP | ETH_RSS_L4_DST_ONLY: hash on src/dst IP and
>                                           dst UDP port
> 
> Signed-off-by: Simei Su <simei.su@intel.com>
  Acked-by: Ori Kam <orika@mellanox.com>
> ---
>  lib/librte_ethdev/rte_ethdev.h | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index
> 7722f70..e68bca8 100644
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -505,6 +505,19 @@ struct rte_eth_rss_conf {
>  #define ETH_RSS_GENEVE             (1ULL << 20)
>  #define ETH_RSS_NVGRE              (1ULL << 21)
> 
> +/*
> + * We use the following macros to combine with above ETH_RSS_* for
> + * more specific input set selection. These bits are defined starting
> + * from the high end of the 64 bits.
> + * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it represents
> + * both SRC and DST are taken into account. SRC_ONLY and DST_ONLY of
> + * the same level can't be used simultaneously.
> + */
> +#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
> +#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
> +#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
> +#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
> +
>  #define ETH_RSS_IP ( \
>  	ETH_RSS_IPV4 | \
>  	ETH_RSS_FRAG_IPV4 | \
> --
> 1.8.3.1


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

* Re: [dpdk-dev] [PATCH v7 2/3] ethdev: extend RSS offload types
  2019-09-29  8:55               ` Su, Simei
@ 2019-09-29  9:15                 ` Su, Simei
  0 siblings, 0 replies; 97+ messages in thread
From: Su, Simei @ 2019-09-29  9:15 UTC (permalink / raw)
  To: Su, Simei, Zhang, Qi Z, Wu, Jingjing, Ye, Xiaolong, Yigit, Ferruh; +Cc: dev

Sorry to miss to add the Ori's ack to this patch and sorry to add to wrong location. I re-add ack this time.

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Su, Simei
> Sent: Sunday, September 29, 2019 4:56 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> Ye, Xiaolong <xiaolong.ye@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v7 2/3] ethdev: extend RSS offload types
> 
> 
> 
> > -----Original Message-----
> > From: Su, Simei
> > Sent: Sunday, September 29, 2019 3:09 PM
> > To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing
> > <jingjing.wu@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>; Yigit,
> > Ferruh <ferruh.yigit@intel.com>
> > Cc: dev@dpdk.org; Su, Simei <simei.su@intel.com>
> > Subject: [PATCH v7 2/3] ethdev: extend RSS offload types
> >
> > This patch reserves several bits as input set selection from the high
> > end of the 64 bits. It is combined with exisiting ETH_RSS_* to represent rss
> types.
> >
> > for example:
> >   ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY: hash on src ip address only
> >   ETH_RSS_IPV4_UDP | ETH_RSS_L4_DST_ONLY: hash on src/dst IP and
> >                                           dst UDP port
> >
> > Signed-off-by: Simei Su <simei.su@intel.com>
>   Acked-by: Ori Kam <orika@mellanox.com>
> > ---
   Acked-by: Ori Kam <orika@mellanox.com>

> >  lib/librte_ethdev/rte_ethdev.h | 13 +++++++++++++
> >  1 file changed, 13 insertions(+)
> >
> > diff --git a/lib/librte_ethdev/rte_ethdev.h
> > b/lib/librte_ethdev/rte_ethdev.h index
> > 7722f70..e68bca8 100644
> > --- a/lib/librte_ethdev/rte_ethdev.h
> > +++ b/lib/librte_ethdev/rte_ethdev.h
> > @@ -505,6 +505,19 @@ struct rte_eth_rss_conf {
> >  #define ETH_RSS_GENEVE             (1ULL << 20)
> >  #define ETH_RSS_NVGRE              (1ULL << 21)
> >
> > +/*
> > + * We use the following macros to combine with above ETH_RSS_* for
> > + * more specific input set selection. These bits are defined starting
> > + * from the high end of the 64 bits.
> > + * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it
> > +represents
> > + * both SRC and DST are taken into account. SRC_ONLY and DST_ONLY of
> > + * the same level can't be used simultaneously.
> > + */
> > +#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
> > +#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
> > +#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
> > +#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
> > +
> >  #define ETH_RSS_IP ( \
> >  	ETH_RSS_IPV4 | \
> >  	ETH_RSS_FRAG_IPV4 | \
> > --
> > 1.8.3.1


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

* Re: [dpdk-dev] [PATCH v4 1/3] ethdev: decouple flow types and RSS offload types
  2019-09-27  8:54       ` [dpdk-dev] [PATCH v4 1/3] ethdev: decouple flow types and " Simei Su
@ 2019-09-29 11:32         ` Andrew Rybchenko
  0 siblings, 0 replies; 97+ messages in thread
From: Andrew Rybchenko @ 2019-09-29 11:32 UTC (permalink / raw)
  To: Simei Su, qi.z.zhang, jingjing.wu, xiaolong.ye; +Cc: dev

On 9/27/19 11:54 AM, Simei Su wrote:
> This patch decouples RTE_ETH_FLOW_* and ETH_RSS_*. Both serves
> different purposes. The former defines flow types. The later
> defines RSS offload types.
>
> Signed-off-by: Simei Su <simei.su@intel.com>

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

[snip]

> @@ -482,31 +481,29 @@ struct rte_eth_rss_conf {
>   #define RTE_ETH_FLOW_MAX                23
>   
>   /*
> - * The RSS offload types are defined based on flow types.
> - * Different NIC hardware may support different RSS offload
> - * types. The supported flow types or RSS offload types can be queried by
> - * rte_eth_dev_info_get().
> - */
> -#define ETH_RSS_IPV4               (1ULL << RTE_ETH_FLOW_IPV4)
> -#define ETH_RSS_FRAG_IPV4          (1ULL << RTE_ETH_FLOW_FRAG_IPV4)
> -#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
> -#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
> -#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP)
> -#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
> -#define ETH_RSS_IPV6               (1ULL << RTE_ETH_FLOW_IPV6)
> -#define ETH_RSS_FRAG_IPV6          (1ULL << RTE_ETH_FLOW_FRAG_IPV6)
> -#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
> -#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
> -#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP)
> -#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
> -#define ETH_RSS_L2_PAYLOAD         (1ULL << RTE_ETH_FLOW_L2_PAYLOAD)
> -#define ETH_RSS_IPV6_EX            (1ULL << RTE_ETH_FLOW_IPV6_EX)
> -#define ETH_RSS_IPV6_TCP_EX        (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
> -#define ETH_RSS_IPV6_UDP_EX        (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
> -#define ETH_RSS_PORT               (1ULL << RTE_ETH_FLOW_PORT)
> -#define ETH_RSS_VXLAN              (1ULL << RTE_ETH_FLOW_VXLAN)
> -#define ETH_RSS_GENEVE             (1ULL << RTE_ETH_FLOW_GENEVE)
> -#define ETH_RSS_NVGRE              (1ULL << RTE_ETH_FLOW_NVGRE)
> + * Below macros are defined for RSS offload types, they can be used to
> + * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
> + */
> +#define ETH_RSS_IPV4               (1ULL << 2)
> +#define ETH_RSS_FRAG_IPV4          (1ULL << 3)
> +#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << 4)
> +#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << 5)
> +#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << 6)
> +#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << 7)
> +#define ETH_RSS_IPV6               (1ULL << 8)
> +#define ETH_RSS_FRAG_IPV6          (1ULL << 9)
> +#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << 10)
> +#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << 11)
> +#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << 12)
> +#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << 13)
> +#define ETH_RSS_L2_PAYLOAD         (1ULL << 14)
> +#define ETH_RSS_IPV6_EX            (1ULL << 15)
> +#define ETH_RSS_IPV6_TCP_EX        (1ULL << 16)
> +#define ETH_RSS_IPV6_UDP_EX        (1ULL << 17)
> +#define ETH_RSS_PORT               (1ULL << 18)
> +#define ETH_RSS_VXLAN              (1ULL << 19)
> +#define ETH_RSS_GENEVE             (1ULL << 20)
> +#define ETH_RSS_NVGRE              (1ULL << 21)
>   

Yes, it is out of scope of the patch, but: Is VXLAN_GPE skipped 
intentionally in ETH_RSS?
Is it assumed to be covered by ETH_RSS_VXLAN?
What does ETH_RSS_VXLAN mean? What is included in RSS hash in this case?
I think it would be very good to improve the documentation here and
provide answers to these questions.

[snip]


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

* Re: [dpdk-dev] [PATCH v6 2/3] ethdev: extend RSS offload types
  2019-09-29  5:11           ` [dpdk-dev] [PATCH v6 2/3] ethdev: extend " Simei Su
@ 2019-09-29 11:40             ` Andrew Rybchenko
  2019-09-30  7:49               ` Zhang, Qi Z
  0 siblings, 1 reply; 97+ messages in thread
From: Andrew Rybchenko @ 2019-09-29 11:40 UTC (permalink / raw)
  To: Simei Su, qi.z.zhang, jingjing.wu, xiaolong.ye, ferruh.yigit; +Cc: dev

On 9/29/19 8:11 AM, Simei Su wrote:
> This patch reserves several bits as input set selection from the
> high end of the 64 bits. It is combined with exisiting ETH_RSS_*
> to represent rss types.

rss -> RSS

> for example:
>    ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY: hash on src ip address only
>    ETH_RSS_IPV4_UDP | ETH_RSS_L4_DST_ONLY: hash on src/dst IP and
>                                            dst UDP port
>
> Signed-off-by: Simei Su <simei.su@intel.com>
> ---
>   lib/librte_ethdev/rte_ethdev.h | 13 +++++++++++++
>   1 file changed, 13 insertions(+)
>
> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> index 7722f70..e68bca8 100644
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -505,6 +505,19 @@ struct rte_eth_rss_conf {
>   #define ETH_RSS_GENEVE             (1ULL << 20)
>   #define ETH_RSS_NVGRE              (1ULL << 21)
>   
> +/*
> + * We use the following macros to combine with above ETH_RSS_* for
> + * more specific input set selection. These bits are defined starting
> + * from the high end of the 64 bits.
> + * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it represents
> + * both SRC and DST are taken into account. SRC_ONLY and DST_ONLY of
> + * the same level can't be used simultaneously.
> + */
> +#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
> +#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
> +#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
> +#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
> +
>   #define ETH_RSS_IP ( \
>   	ETH_RSS_IPV4 | \
>   	ETH_RSS_FRAG_IPV4 | \

It could be tricky and inconvenient for apps to avoid both ONLY
bits on the same level. E.g. if driver/HW supports both only flags,
it will be reported in caps and if app simply inherits it from caps,
both bits will be set.

Anyway it requires checks in rte_eth_dev_rss_hash_update() and
rte_eth_dev_configure(). If both only flags are not allows, it should
be checked and denied. If both only flags are allows and equal to
no flags at all, it should be simplified automatically to one variant
(I would say no flags at all).


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

* Re: [dpdk-dev] [PATCH v6 2/3] ethdev: extend RSS offload types
  2019-09-29 11:40             ` Andrew Rybchenko
@ 2019-09-30  7:49               ` Zhang, Qi Z
  0 siblings, 0 replies; 97+ messages in thread
From: Zhang, Qi Z @ 2019-09-30  7:49 UTC (permalink / raw)
  To: Andrew Rybchenko, Su, Simei, Wu, Jingjing, Ye, Xiaolong, Yigit, Ferruh
  Cc: dev



> -----Original Message-----
> From: Andrew Rybchenko [mailto:arybchenko@solarflare.com]
> Sent: Sunday, September 29, 2019 7:41 PM
> To: Su, Simei <simei.su@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Wu,
> Jingjing <jingjing.wu@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>; Yigit,
> Ferruh <ferruh.yigit@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v6 2/3] ethdev: extend RSS offload types
> 
> On 9/29/19 8:11 AM, Simei Su wrote:
> > This patch reserves several bits as input set selection from the high
> > end of the 64 bits. It is combined with exisiting ETH_RSS_* to
> > represent rss types.
> 
> rss -> RSS
> 
> > for example:
> >    ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY: hash on src ip address only
> >    ETH_RSS_IPV4_UDP | ETH_RSS_L4_DST_ONLY: hash on src/dst IP and
> >                                            dst UDP port
> >
> > Signed-off-by: Simei Su <simei.su@intel.com>
> > ---
> >   lib/librte_ethdev/rte_ethdev.h | 13 +++++++++++++
> >   1 file changed, 13 insertions(+)
> >
> > diff --git a/lib/librte_ethdev/rte_ethdev.h
> > b/lib/librte_ethdev/rte_ethdev.h index 7722f70..e68bca8 100644
> > --- a/lib/librte_ethdev/rte_ethdev.h
> > +++ b/lib/librte_ethdev/rte_ethdev.h
> > @@ -505,6 +505,19 @@ struct rte_eth_rss_conf {
> >   #define ETH_RSS_GENEVE             (1ULL << 20)
> >   #define ETH_RSS_NVGRE              (1ULL << 21)
> >
> > +/*
> > + * We use the following macros to combine with above ETH_RSS_* for
> > + * more specific input set selection. These bits are defined starting
> > + * from the high end of the 64 bits.
> > + * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it
> > +represents
> > + * both SRC and DST are taken into account. SRC_ONLY and DST_ONLY of
> > + * the same level can't be used simultaneously.
> > + */
> > +#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
> > +#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
> > +#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
> > +#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
> > +
> >   #define ETH_RSS_IP ( \
> >   	ETH_RSS_IPV4 | \
> >   	ETH_RSS_FRAG_IPV4 | \
> 
> It could be tricky and inconvenient for apps to avoid both ONLY bits on the
> same level. E.g. if driver/HW supports both only flags, it will be reported in
> caps and if app simply inherits it from caps, both bits will be set.

> 
> Anyway it requires checks in rte_eth_dev_rss_hash_update() and
> rte_eth_dev_configure(). If both only flags are not allows, it should be checked
> and denied. If both only flags are allows and equal to no flags at all, it should
> be simplified automatically to one variant (I would say no flags at all).

OK, with more consideration, it seems allow both flags equal to no flags make things more easy.


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

* [dpdk-dev] [PATCH v8 0/3] extend RSS offload types
  2019-09-29  7:09           ` [dpdk-dev] [PATCH v7 0/3] extend RSS offload types Simei Su
                               ` (2 preceding siblings ...)
  2019-09-29  7:09             ` [dpdk-dev] [PATCH v7 3/3] app/testpmd: add RSS offload types extending support Simei Su
@ 2019-10-01 14:36             ` Simei Su
  2019-10-01 14:36               ` [dpdk-dev] [PATCH v8 1/3] ethdev: decouple flow types and " Simei Su
                                 ` (3 more replies)
  3 siblings, 4 replies; 97+ messages in thread
From: Simei Su @ 2019-10-01 14:36 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

[PATCH v8 1/3] ethdev: decouple flow types and RSS offload types.
[PATCH v8 2/3] ethdev: add several bits for extending rss offload types.
[PATCH v8 3/3] app/testpmd: add cmdline support for extending rss types.

v8:
* Add to check the simultaneous use of SRC/DST_ONLY of the same level
  in rte_eth_dev_rss_hash_update() and rte_eth_dev_configure().
* Update code comments.

v7:
* Supplement related configuration for new flag in app/test-pmd/cmdline.c.

v6:
* Add the new flag in app/test-pmd/cmdline.c.

v5:
* Update code comments.

v4:
* Divide one patch into two patches.
* Delete ETH_RSS_L2_SRC/DST_ONLY.

v3:
* Update code comments and code style.

v2:
* Update code comments.

Simei Su (3):
  ethdev: decouple flow types and RSS offload types
  ethdev: extend RSS offload types
  app/testpmd: add RSS offload types extending support

 app/test-pmd/cmdline.c         | 18 ++++++++++--
 app/test-pmd/config.c          |  4 +++
 lib/librte_ethdev/rte_ethdev.c | 22 +++++++++++++++
 lib/librte_ethdev/rte_ethdev.h | 63 +++++++++++++++++++++++++-----------------
 4 files changed, 78 insertions(+), 29 deletions(-)

-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v8 1/3] ethdev: decouple flow types and RSS offload types
  2019-10-01 14:36             ` [dpdk-dev] [PATCH v8 0/3] extend RSS offload types Simei Su
@ 2019-10-01 14:36               ` " Simei Su
  2019-10-01 14:36               ` [dpdk-dev] [PATCH v8 2/3] ethdev: extend " Simei Su
                                 ` (2 subsequent siblings)
  3 siblings, 0 replies; 97+ messages in thread
From: Simei Su @ 2019-10-01 14:36 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch decouples RTE_ETH_FLOW_* and ETH_RSS_*. The former defines
flow types and the latter defines RSS offload types.

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_ethdev.h | 49 ++++++++++++++++++++----------------------
 1 file changed, 23 insertions(+), 26 deletions(-)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d937fb4..7722f70 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -453,7 +453,6 @@ struct rte_eth_rss_conf {
  * possible, and exclusively. For example, if a packet is identified as
  * 'RTE_ETH_FLOW_NONFRAG_IPV4_TCP', it will not be any of other flow types,
  * though it is an actual IPV4 packet.
- * Note that the flow types are used to define RSS offload types.
  */
 #define RTE_ETH_FLOW_UNKNOWN             0
 #define RTE_ETH_FLOW_RAW                 1
@@ -482,31 +481,29 @@ struct rte_eth_rss_conf {
 #define RTE_ETH_FLOW_MAX                23
 
 /*
- * The RSS offload types are defined based on flow types.
- * Different NIC hardware may support different RSS offload
- * types. The supported flow types or RSS offload types can be queried by
- * rte_eth_dev_info_get().
- */
-#define ETH_RSS_IPV4               (1ULL << RTE_ETH_FLOW_IPV4)
-#define ETH_RSS_FRAG_IPV4          (1ULL << RTE_ETH_FLOW_FRAG_IPV4)
-#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
-#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
-#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP)
-#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
-#define ETH_RSS_IPV6               (1ULL << RTE_ETH_FLOW_IPV6)
-#define ETH_RSS_FRAG_IPV6          (1ULL << RTE_ETH_FLOW_FRAG_IPV6)
-#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
-#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
-#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP)
-#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
-#define ETH_RSS_L2_PAYLOAD         (1ULL << RTE_ETH_FLOW_L2_PAYLOAD)
-#define ETH_RSS_IPV6_EX            (1ULL << RTE_ETH_FLOW_IPV6_EX)
-#define ETH_RSS_IPV6_TCP_EX        (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
-#define ETH_RSS_IPV6_UDP_EX        (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
-#define ETH_RSS_PORT               (1ULL << RTE_ETH_FLOW_PORT)
-#define ETH_RSS_VXLAN              (1ULL << RTE_ETH_FLOW_VXLAN)
-#define ETH_RSS_GENEVE             (1ULL << RTE_ETH_FLOW_GENEVE)
-#define ETH_RSS_NVGRE              (1ULL << RTE_ETH_FLOW_NVGRE)
+ * Below macros are defined for RSS offload types, they can be used to
+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
+ */
+#define ETH_RSS_IPV4               (1ULL << 2)
+#define ETH_RSS_FRAG_IPV4          (1ULL << 3)
+#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << 4)
+#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << 5)
+#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << 6)
+#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << 7)
+#define ETH_RSS_IPV6               (1ULL << 8)
+#define ETH_RSS_FRAG_IPV6          (1ULL << 9)
+#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << 10)
+#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << 11)
+#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << 12)
+#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << 13)
+#define ETH_RSS_L2_PAYLOAD         (1ULL << 14)
+#define ETH_RSS_IPV6_EX            (1ULL << 15)
+#define ETH_RSS_IPV6_TCP_EX        (1ULL << 16)
+#define ETH_RSS_IPV6_UDP_EX        (1ULL << 17)
+#define ETH_RSS_PORT               (1ULL << 18)
+#define ETH_RSS_VXLAN              (1ULL << 19)
+#define ETH_RSS_GENEVE             (1ULL << 20)
+#define ETH_RSS_NVGRE              (1ULL << 21)
 
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v8 2/3] ethdev: extend RSS offload types
  2019-10-01 14:36             ` [dpdk-dev] [PATCH v8 0/3] extend RSS offload types Simei Su
  2019-10-01 14:36               ` [dpdk-dev] [PATCH v8 1/3] ethdev: decouple flow types and " Simei Su
@ 2019-10-01 14:36               ` " Simei Su
  2019-10-01 14:49                 ` Andrew Rybchenko
  2019-10-01 14:36               ` [dpdk-dev] [PATCH v8 3/3] app/testpmd: add RSS offload types extending support Simei Su
  2019-10-03 11:35               ` [dpdk-dev] [PATCH v9 0/3] extend RSS offload types Simei Su
  3 siblings, 1 reply; 97+ messages in thread
From: Simei Su @ 2019-10-01 14:36 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch reserves several bits as input set selection from the
high end of the 64 bits. It is combined with exisiting ETH_RSS_*
to represent RSS types.

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_ethdev.c | 22 ++++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h | 14 ++++++++++++++
 2 files changed, 36 insertions(+)

diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index af82360..5e5a974 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -1269,6 +1269,17 @@ struct rte_eth_dev *
 		goto rollback;
 	}
 
+	/* simplified the SRC/DST_ONLY RSS offload modificaiton */
+	if (dev_conf->rx_adv_conf.rss_conf.rss_hf & ETH_RSS_L3_SRC_ONLY &&
+		dev_conf->rx_adv_conf.rss_conf.rss_hf & ETH_RSS_L3_DST_ONLY)
+			dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf &=
+				~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY);
+
+	if (dev_conf->rx_adv_conf.rss_conf.rss_hf & ETH_RSS_L4_SRC_ONLY &&
+		dev_conf->rx_adv_conf.rss_conf.rss_hf & ETH_RSS_L4_DST_ONLY)
+			dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf &=
+				~(ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY);
+
 	/* Check that device supports requested rss hash functions. */
 	if ((dev_info.flow_type_rss_offloads |
 	     dev_conf->rx_adv_conf.rss_conf.rss_hf) !=
@@ -3112,6 +3123,17 @@ struct rte_eth_dev *
 	if (ret != 0)
 		return ret;
 
+	/* simplified the SRC/DST_ONLY RSS offload modificaiton */
+	if (rss_conf->rss_hf & ETH_RSS_L3_SRC_ONLY &&
+		rss_conf->rss_hf & ETH_RSS_L3_DST_ONLY)
+			rss_conf->rss_hf &=
+				~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY);
+
+	if (rss_conf->rss_hf & ETH_RSS_L4_SRC_ONLY &&
+		rss_conf->rss_hf & ETH_RSS_L4_DST_ONLY)
+			rss_conf->rss_hf &=
+				~(ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY);
+
 	dev = &rte_eth_devices[port_id];
 	if ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) !=
 	    dev_info.flow_type_rss_offloads) {
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 7722f70..6d61b84 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -505,6 +505,20 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_GENEVE             (1ULL << 20)
 #define ETH_RSS_NVGRE              (1ULL << 21)
 
+/*
+ * We use the following macros to combine with above ETH_RSS_* for
+ * more specific input set selection. These bits are defined starting
+ * from the high end of the 64 bits.
+ * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it represents
+ * both SRC and DST are taken into account. If SRC_ONLY and DST_ONLY of
+ * the same level be used simultaneously, it is the same case as none of
+ * them are added.
+ */
+#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
+#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
+#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
+#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
+
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
 	ETH_RSS_FRAG_IPV4 | \
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v8 3/3] app/testpmd: add RSS offload types extending support
  2019-10-01 14:36             ` [dpdk-dev] [PATCH v8 0/3] extend RSS offload types Simei Su
  2019-10-01 14:36               ` [dpdk-dev] [PATCH v8 1/3] ethdev: decouple flow types and " Simei Su
  2019-10-01 14:36               ` [dpdk-dev] [PATCH v8 2/3] ethdev: extend " Simei Su
@ 2019-10-01 14:36               ` Simei Su
  2019-10-03 11:35               ` [dpdk-dev] [PATCH v9 0/3] extend RSS offload types Simei Su
  3 siblings, 0 replies; 97+ messages in thread
From: Simei Su @ 2019-10-01 14:36 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch adds cmdline support for extended rss types configuration.

Signed-off-by: Simei Su <simei.su@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
---
 app/test-pmd/cmdline.c | 18 +++++++++++++++---
 app/test-pmd/config.c  |  4 ++++
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index def471d..f5c0cde 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2189,7 +2189,9 @@ struct cmd_config_rss {
 	if (!strcmp(res->value, "all"))
 		rss_conf.rss_hf = ETH_RSS_IP | ETH_RSS_TCP |
 				ETH_RSS_UDP | ETH_RSS_SCTP |
-					ETH_RSS_L2_PAYLOAD;
+					ETH_RSS_L2_PAYLOAD |
+				ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY |
+				ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY;
 	else if (!strcmp(res->value, "ip"))
 		rss_conf.rss_hf = ETH_RSS_IP;
 	else if (!strcmp(res->value, "udp"))
@@ -2208,6 +2210,14 @@ struct cmd_config_rss {
 		rss_conf.rss_hf = ETH_RSS_GENEVE;
 	else if (!strcmp(res->value, "nvgre"))
 		rss_conf.rss_hf = ETH_RSS_NVGRE;
+	else if (!strcmp(res->value, "l3-src-only"))
+		rss_conf.rss_hf = ETH_RSS_L3_SRC_ONLY;
+	else if (!strcmp(res->value, "l3-dst-only"))
+		rss_conf.rss_hf = ETH_RSS_L3_DST_ONLY;
+	else if (!strcmp(res->value, "l4-src-only"))
+		rss_conf.rss_hf = ETH_RSS_L4_SRC_ONLY;
+	else if (!strcmp(res->value, "l4-dst-only"))
+		rss_conf.rss_hf = ETH_RSS_L4_DST_ONLY;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "default"))
@@ -2375,7 +2385,8 @@ struct cmd_config_rss_hash_key {
 				 "ipv4#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#"
 				 "ipv4-other#ipv6#ipv6-frag#ipv6-tcp#ipv6-udp#"
 				 "ipv6-sctp#ipv6-other#l2-payload#ipv6-ex#"
-				 "ipv6-tcp-ex#ipv6-udp-ex");
+				 "ipv6-tcp-ex#ipv6-udp-ex#"
+				 "l3-src-only#l3-dst-only#l4-src-only#l4-dst-only");
 cmdline_parse_token_string_t cmd_config_rss_hash_key_value =
 	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);
 
@@ -2385,7 +2396,8 @@ struct cmd_config_rss_hash_key {
 	.help_str = "port config <port_id> rss-hash-key "
 		"ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|"
 		"ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|"
-		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex "
+		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
+		"l3-src-only|l3-dst-only|l4-src-only|l4-dst-only "
 		"<string of hex digits (variable length, NIC dependent)>",
 	.tokens = {
 		(void *)&cmd_config_rss_hash_key_port,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index a3b6cbd..5022d42 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -103,6 +103,10 @@
 	{ "tcp", ETH_RSS_TCP },
 	{ "sctp", ETH_RSS_SCTP },
 	{ "tunnel", ETH_RSS_TUNNEL },
+	{ "l3-src-only", ETH_RSS_L3_SRC_ONLY },
+	{ "l3-dst-only", ETH_RSS_L3_DST_ONLY },
+	{ "l4-src-only", ETH_RSS_L4_SRC_ONLY },
+	{ "l4-dst-only", ETH_RSS_L4_DST_ONLY },
 	{ NULL, 0 },
 };
 
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH v8 2/3] ethdev: extend RSS offload types
  2019-10-01 14:36               ` [dpdk-dev] [PATCH v8 2/3] ethdev: extend " Simei Su
@ 2019-10-01 14:49                 ` Andrew Rybchenko
  2019-10-01 16:02                   ` Iremonger, Bernard
  2019-10-05  4:54                   ` Su, Simei
  0 siblings, 2 replies; 97+ messages in thread
From: Andrew Rybchenko @ 2019-10-01 14:49 UTC (permalink / raw)
  To: Simei Su, qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev

On 10/1/19 5:36 PM, Simei Su wrote:
> This patch reserves several bits as input set selection from the
> high end of the 64 bits. It is combined with exisiting ETH_RSS_*
> to represent RSS types.
>
> 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_ethdev.c | 22 ++++++++++++++++++++++
>   lib/librte_ethdev/rte_ethdev.h | 14 ++++++++++++++
>   2 files changed, 36 insertions(+)
>
> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index af82360..5e5a974 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -1269,6 +1269,17 @@ struct rte_eth_dev *
>   		goto rollback;
>   	}
>   
> +	/* simplified the SRC/DST_ONLY RSS offload modificaiton */
> +	if (dev_conf->rx_adv_conf.rss_conf.rss_hf & ETH_RSS_L3_SRC_ONLY &&
> +		dev_conf->rx_adv_conf.rss_conf.rss_hf & ETH_RSS_L3_DST_ONLY)

I'm afraid some compiler versions could bark about missing parenthesis here.
Consider to use something like:
  (rss_conf->rss_hf & (ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY) ==
   (ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY))
May be parenthesis around & is not required.

> +			dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf &=
> +				~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY);
> +
> +	if (dev_conf->rx_adv_conf.rss_conf.rss_hf & ETH_RSS_L4_SRC_ONLY &&
> +		dev_conf->rx_adv_conf.rss_conf.rss_hf & ETH_RSS_L4_DST_ONLY)
> +			dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf &=
> +				~(ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY);
> +

I think it is wrong to duplicate the logic twice (here and below).
Helper static function should be used to avoid it.

>   	/* Check that device supports requested rss hash functions. */
>   	if ((dev_info.flow_type_rss_offloads |
>   	     dev_conf->rx_adv_conf.rss_conf.rss_hf) !=
> @@ -3112,6 +3123,17 @@ struct rte_eth_dev *
>   	if (ret != 0)
>   		return ret;
>   
> +	/* simplified the SRC/DST_ONLY RSS offload modificaiton */
> +	if (rss_conf->rss_hf & ETH_RSS_L3_SRC_ONLY &&
> +		rss_conf->rss_hf & ETH_RSS_L3_DST_ONLY)
> +			rss_conf->rss_hf &=
> +				~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY);
> +
> +	if (rss_conf->rss_hf & ETH_RSS_L4_SRC_ONLY &&
> +		rss_conf->rss_hf & ETH_RSS_L4_DST_ONLY)
> +			rss_conf->rss_hf &=
> +				~(ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY);
> +
>   	dev = &rte_eth_devices[port_id];
>   	if ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) !=
>   	    dev_info.flow_type_rss_offloads) {
> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> index 7722f70..6d61b84 100644
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -505,6 +505,20 @@ struct rte_eth_rss_conf {
>   #define ETH_RSS_GENEVE             (1ULL << 20)
>   #define ETH_RSS_NVGRE              (1ULL << 21)
>   
> +/*
> + * We use the following macros to combine with above ETH_RSS_* for
> + * more specific input set selection. These bits are defined starting
> + * from the high end of the 64 bits.
> + * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it represents
> + * both SRC and DST are taken into account. If SRC_ONLY and DST_ONLY of
> + * the same level be used simultaneously, it is the same case as none of
> + * them are added.
> + */
> +#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
> +#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
> +#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
> +#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
> +
>   #define ETH_RSS_IP ( \
>   	ETH_RSS_IPV4 | \
>   	ETH_RSS_FRAG_IPV4 | \


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

* Re: [dpdk-dev] [PATCH v8 2/3] ethdev: extend RSS offload types
  2019-10-01 14:49                 ` Andrew Rybchenko
@ 2019-10-01 16:02                   ` Iremonger, Bernard
  2019-10-01 16:45                     ` Ferruh Yigit
  2019-10-05  4:54                   ` Su, Simei
  1 sibling, 1 reply; 97+ messages in thread
From: Iremonger, Bernard @ 2019-10-01 16:02 UTC (permalink / raw)
  To: Andrew Rybchenko, Su, Simei, Zhang, Qi Z, Ye, Xiaolong, Yigit, Ferruh; +Cc: dev

Hi Simei,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Andrew Rybchenko
> Sent: Tuesday, October 1, 2019 3:49 PM
> To: Su, Simei <simei.su@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Ye,
> Xiaolong <xiaolong.ye@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v8 2/3] ethdev: extend RSS offload types
> 
> On 10/1/19 5:36 PM, Simei Su wrote:
> > This patch reserves several bits as input set selection from the high
> > end of the 64 bits. It is combined with exisiting ETH_RSS_* to
> > represent RSS types.
> >
> > 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_ethdev.c | 22 ++++++++++++++++++++++
> >   lib/librte_ethdev/rte_ethdev.h | 14 ++++++++++++++
> >   2 files changed, 36 insertions(+)
> >
> > diff --git a/lib/librte_ethdev/rte_ethdev.c
> > b/lib/librte_ethdev/rte_ethdev.c index af82360..5e5a974 100644
> > --- a/lib/librte_ethdev/rte_ethdev.c
> > +++ b/lib/librte_ethdev/rte_ethdev.c
> > @@ -1269,6 +1269,17 @@ struct rte_eth_dev *
> >   		goto rollback;
> >   	}
> >
> > +	/* simplified the SRC/DST_ONLY RSS offload modificaiton */
> > +	if (dev_conf->rx_adv_conf.rss_conf.rss_hf &
> ETH_RSS_L3_SRC_ONLY &&
> > +		dev_conf->rx_adv_conf.rss_conf.rss_hf &
> ETH_RSS_L3_DST_ONLY)
> 
> I'm afraid some compiler versions could bark about missing parenthesis here.
> Consider to use something like:
>   (rss_conf->rss_hf & (ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY) ==
>    (ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY)) May be parenthesis
> around & is not required.
> 
> > +			dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf
> &=
> > +				~(ETH_RSS_L3_SRC_ONLY |
> ETH_RSS_L3_DST_ONLY);
> > +
> > +	if (dev_conf->rx_adv_conf.rss_conf.rss_hf &
> ETH_RSS_L4_SRC_ONLY &&
> > +		dev_conf->rx_adv_conf.rss_conf.rss_hf &
> ETH_RSS_L4_DST_ONLY)
> > +			dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf
> &=
> > +				~(ETH_RSS_L4_SRC_ONLY |
> ETH_RSS_L4_DST_ONLY);
> > +
> 
> I think it is wrong to duplicate the logic twice (here and below).
> Helper static function should be used to avoid it.
> 
> >   	/* Check that device supports requested rss hash functions. */
> >   	if ((dev_info.flow_type_rss_offloads |
> >   	     dev_conf->rx_adv_conf.rss_conf.rss_hf) != @@ -3112,6 +3123,17
> > @@ struct rte_eth_dev *
> >   	if (ret != 0)
> >   		return ret;
> >
> > +	/* simplified the SRC/DST_ONLY RSS offload modificaiton */
> > +	if (rss_conf->rss_hf & ETH_RSS_L3_SRC_ONLY &&
> > +		rss_conf->rss_hf & ETH_RSS_L3_DST_ONLY)
> > +			rss_conf->rss_hf &=
> > +				~(ETH_RSS_L3_SRC_ONLY |
> ETH_RSS_L3_DST_ONLY);
> > +
> > +	if (rss_conf->rss_hf & ETH_RSS_L4_SRC_ONLY &&
> > +		rss_conf->rss_hf & ETH_RSS_L4_DST_ONLY)
> > +			rss_conf->rss_hf &=
> > +				~(ETH_RSS_L4_SRC_ONLY |
> ETH_RSS_L4_DST_ONLY);
> > +
> >   	dev = &rte_eth_devices[port_id];
> >   	if ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) !=
> >   	    dev_info.flow_type_rss_offloads) { diff --git
> > a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> > index 7722f70..6d61b84 100644
> > --- a/lib/librte_ethdev/rte_ethdev.h
> > +++ b/lib/librte_ethdev/rte_ethdev.h
> > @@ -505,6 +505,20 @@ struct rte_eth_rss_conf {
> >   #define ETH_RSS_GENEVE             (1ULL << 20)
> >   #define ETH_RSS_NVGRE              (1ULL << 21)
> >
> > +/*
> > + * We use the following macros to combine with above ETH_RSS_* for
> > + * more specific input set selection. These bits are defined starting
> > + * from the high end of the 64 bits.
> > + * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it
> > +represents
> > + * both SRC and DST are taken into account. If SRC_ONLY and DST_ONLY
> > +of
> > + * the same level be used simultaneously, it is the same case as none
> > +of
> > + * them are added.
> > + */
> > +#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
> > +#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
> > +#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
> > +#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
> > +
> >   #define ETH_RSS_IP ( \
> >   	ETH_RSS_IPV4 | \
> >   	ETH_RSS_FRAG_IPV4 | \

This patch fails to apply to the latest master branch, a rebase may be needed.

Regards,

Bernard


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

* Re: [dpdk-dev] [PATCH v8 2/3] ethdev: extend RSS offload types
  2019-10-01 16:02                   ` Iremonger, Bernard
@ 2019-10-01 16:45                     ` Ferruh Yigit
  0 siblings, 0 replies; 97+ messages in thread
From: Ferruh Yigit @ 2019-10-01 16:45 UTC (permalink / raw)
  To: Iremonger, Bernard, Andrew Rybchenko, Su, Simei, Zhang, Qi Z, Ye,
	Xiaolong
  Cc: dev

On 10/1/2019 5:02 PM, Iremonger, Bernard wrote:
> Hi Simei,
> 
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Andrew Rybchenko
>> Sent: Tuesday, October 1, 2019 3:49 PM
>> To: Su, Simei <simei.su@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Ye,
>> Xiaolong <xiaolong.ye@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
>> Cc: dev@dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH v8 2/3] ethdev: extend RSS offload types
>>
>> On 10/1/19 5:36 PM, Simei Su wrote:
>>> This patch reserves several bits as input set selection from the high
>>> end of the 64 bits. It is combined with exisiting ETH_RSS_* to
>>> represent RSS types.
>>>
>>> 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_ethdev.c | 22 ++++++++++++++++++++++
>>>   lib/librte_ethdev/rte_ethdev.h | 14 ++++++++++++++
>>>   2 files changed, 36 insertions(+)
>>>
>>> diff --git a/lib/librte_ethdev/rte_ethdev.c
>>> b/lib/librte_ethdev/rte_ethdev.c index af82360..5e5a974 100644
>>> --- a/lib/librte_ethdev/rte_ethdev.c
>>> +++ b/lib/librte_ethdev/rte_ethdev.c
>>> @@ -1269,6 +1269,17 @@ struct rte_eth_dev *
>>>   		goto rollback;
>>>   	}
>>>
>>> +	/* simplified the SRC/DST_ONLY RSS offload modificaiton */
>>> +	if (dev_conf->rx_adv_conf.rss_conf.rss_hf &
>> ETH_RSS_L3_SRC_ONLY &&
>>> +		dev_conf->rx_adv_conf.rss_conf.rss_hf &
>> ETH_RSS_L3_DST_ONLY)
>>
>> I'm afraid some compiler versions could bark about missing parenthesis here.
>> Consider to use something like:
>>   (rss_conf->rss_hf & (ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY) ==
>>    (ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY)) May be parenthesis
>> around & is not required.
>>
>>> +			dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf
>> &=
>>> +				~(ETH_RSS_L3_SRC_ONLY |
>> ETH_RSS_L3_DST_ONLY);
>>> +
>>> +	if (dev_conf->rx_adv_conf.rss_conf.rss_hf &
>> ETH_RSS_L4_SRC_ONLY &&
>>> +		dev_conf->rx_adv_conf.rss_conf.rss_hf &
>> ETH_RSS_L4_DST_ONLY)
>>> +			dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf
>> &=
>>> +				~(ETH_RSS_L4_SRC_ONLY |
>> ETH_RSS_L4_DST_ONLY);
>>> +
>>
>> I think it is wrong to duplicate the logic twice (here and below).
>> Helper static function should be used to avoid it.
>>
>>>   	/* Check that device supports requested rss hash functions. */
>>>   	if ((dev_info.flow_type_rss_offloads |
>>>   	     dev_conf->rx_adv_conf.rss_conf.rss_hf) != @@ -3112,6 +3123,17
>>> @@ struct rte_eth_dev *
>>>   	if (ret != 0)
>>>   		return ret;
>>>
>>> +	/* simplified the SRC/DST_ONLY RSS offload modificaiton */
>>> +	if (rss_conf->rss_hf & ETH_RSS_L3_SRC_ONLY &&
>>> +		rss_conf->rss_hf & ETH_RSS_L3_DST_ONLY)
>>> +			rss_conf->rss_hf &=
>>> +				~(ETH_RSS_L3_SRC_ONLY |
>> ETH_RSS_L3_DST_ONLY);
>>> +
>>> +	if (rss_conf->rss_hf & ETH_RSS_L4_SRC_ONLY &&
>>> +		rss_conf->rss_hf & ETH_RSS_L4_DST_ONLY)
>>> +			rss_conf->rss_hf &=
>>> +				~(ETH_RSS_L4_SRC_ONLY |
>> ETH_RSS_L4_DST_ONLY);
>>> +
>>>   	dev = &rte_eth_devices[port_id];
>>>   	if ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) !=
>>>   	    dev_info.flow_type_rss_offloads) { diff --git
>>> a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
>>> index 7722f70..6d61b84 100644
>>> --- a/lib/librte_ethdev/rte_ethdev.h
>>> +++ b/lib/librte_ethdev/rte_ethdev.h
>>> @@ -505,6 +505,20 @@ struct rte_eth_rss_conf {
>>>   #define ETH_RSS_GENEVE             (1ULL << 20)
>>>   #define ETH_RSS_NVGRE              (1ULL << 21)
>>>
>>> +/*
>>> + * We use the following macros to combine with above ETH_RSS_* for
>>> + * more specific input set selection. These bits are defined starting
>>> + * from the high end of the 64 bits.
>>> + * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it
>>> +represents
>>> + * both SRC and DST are taken into account. If SRC_ONLY and DST_ONLY
>>> +of
>>> + * the same level be used simultaneously, it is the same case as none
>>> +of
>>> + * them are added.
>>> + */
>>> +#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
>>> +#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
>>> +#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
>>> +#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
>>> +
>>>   #define ETH_RSS_IP ( \
>>>   	ETH_RSS_IPV4 | \
>>>   	ETH_RSS_FRAG_IPV4 | \
> 
> This patch fails to apply to the latest master branch, a rebase may be needed.

Patch applies well to next-net, which this patch should be for, no rebase required.

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

* [dpdk-dev] [PATCH v9 0/3] extend RSS offload types
  2019-10-01 14:36             ` [dpdk-dev] [PATCH v8 0/3] extend RSS offload types Simei Su
                                 ` (2 preceding siblings ...)
  2019-10-01 14:36               ` [dpdk-dev] [PATCH v8 3/3] app/testpmd: add RSS offload types extending support Simei Su
@ 2019-10-03 11:35               ` Simei Su
  2019-10-03 11:35                 ` [dpdk-dev] [PATCH v9 1/3] ethdev: decouple flow types and " Simei Su
                                   ` (3 more replies)
  3 siblings, 4 replies; 97+ messages in thread
From: Simei Su @ 2019-10-03 11:35 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

[PATCH v9 1/3] ethdev: decouple flow types and RSS offload types.
[PATCH v9 2/3] ethdev: add several bits for extending rss offload types.
[PATCH v9 3/3] app/testpmd: add cmdline support for extending rss types.

v9:
* Fix code style.
* Delete duplicate logic in rte_eth_dev_configure().

v8:
* Add to check the simultaneous use of SRC/DST_ONLY of the same level
  in rte_eth_dev_rss_hash_update() and rte_eth_dev_configure().
* Update code comments.

v7:
* Supplement related configuration for new flag in app/test-pmd/cmdline.c.

v6:
* Add the new flag in app/test-pmd/cmdline.c.

v5:
* Update code comments.

v4:
* Divide one patch into two patches.
* Delete ETH_RSS_L2_SRC/DST_ONLY.

v3:
* Update code comments and code style.

v2:
* Update code comments.

Simei Su (3):
  ethdev: decouple flow types and RSS offload types
  ethdev: extend RSS offload types
  app/testpmd: add RSS offload types extending support

 app/test-pmd/cmdline.c         | 18 ++++++++++--
 app/test-pmd/config.c          |  4 +++
 lib/librte_ethdev/rte_ethdev.c | 11 ++++++++
 lib/librte_ethdev/rte_ethdev.h | 63 +++++++++++++++++++++++++-----------------
 4 files changed, 67 insertions(+), 29 deletions(-)

-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v9 1/3] ethdev: decouple flow types and RSS offload types
  2019-10-03 11:35               ` [dpdk-dev] [PATCH v9 0/3] extend RSS offload types Simei Su
@ 2019-10-03 11:35                 ` " Simei Su
  2019-10-03 11:35                 ` [dpdk-dev] [PATCH v9 2/3] ethdev: extend " Simei Su
                                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 97+ messages in thread
From: Simei Su @ 2019-10-03 11:35 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch decouples RTE_ETH_FLOW_* and ETH_RSS_*. The former defines
flow types and the latter defines RSS offload types.

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_ethdev.h | 49 ++++++++++++++++++++----------------------
 1 file changed, 23 insertions(+), 26 deletions(-)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d937fb4..7722f70 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -453,7 +453,6 @@ struct rte_eth_rss_conf {
  * possible, and exclusively. For example, if a packet is identified as
  * 'RTE_ETH_FLOW_NONFRAG_IPV4_TCP', it will not be any of other flow types,
  * though it is an actual IPV4 packet.
- * Note that the flow types are used to define RSS offload types.
  */
 #define RTE_ETH_FLOW_UNKNOWN             0
 #define RTE_ETH_FLOW_RAW                 1
@@ -482,31 +481,29 @@ struct rte_eth_rss_conf {
 #define RTE_ETH_FLOW_MAX                23
 
 /*
- * The RSS offload types are defined based on flow types.
- * Different NIC hardware may support different RSS offload
- * types. The supported flow types or RSS offload types can be queried by
- * rte_eth_dev_info_get().
- */
-#define ETH_RSS_IPV4               (1ULL << RTE_ETH_FLOW_IPV4)
-#define ETH_RSS_FRAG_IPV4          (1ULL << RTE_ETH_FLOW_FRAG_IPV4)
-#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
-#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
-#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP)
-#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
-#define ETH_RSS_IPV6               (1ULL << RTE_ETH_FLOW_IPV6)
-#define ETH_RSS_FRAG_IPV6          (1ULL << RTE_ETH_FLOW_FRAG_IPV6)
-#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
-#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
-#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP)
-#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
-#define ETH_RSS_L2_PAYLOAD         (1ULL << RTE_ETH_FLOW_L2_PAYLOAD)
-#define ETH_RSS_IPV6_EX            (1ULL << RTE_ETH_FLOW_IPV6_EX)
-#define ETH_RSS_IPV6_TCP_EX        (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
-#define ETH_RSS_IPV6_UDP_EX        (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
-#define ETH_RSS_PORT               (1ULL << RTE_ETH_FLOW_PORT)
-#define ETH_RSS_VXLAN              (1ULL << RTE_ETH_FLOW_VXLAN)
-#define ETH_RSS_GENEVE             (1ULL << RTE_ETH_FLOW_GENEVE)
-#define ETH_RSS_NVGRE              (1ULL << RTE_ETH_FLOW_NVGRE)
+ * Below macros are defined for RSS offload types, they can be used to
+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
+ */
+#define ETH_RSS_IPV4               (1ULL << 2)
+#define ETH_RSS_FRAG_IPV4          (1ULL << 3)
+#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << 4)
+#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << 5)
+#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << 6)
+#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << 7)
+#define ETH_RSS_IPV6               (1ULL << 8)
+#define ETH_RSS_FRAG_IPV6          (1ULL << 9)
+#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << 10)
+#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << 11)
+#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << 12)
+#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << 13)
+#define ETH_RSS_L2_PAYLOAD         (1ULL << 14)
+#define ETH_RSS_IPV6_EX            (1ULL << 15)
+#define ETH_RSS_IPV6_TCP_EX        (1ULL << 16)
+#define ETH_RSS_IPV6_UDP_EX        (1ULL << 17)
+#define ETH_RSS_PORT               (1ULL << 18)
+#define ETH_RSS_VXLAN              (1ULL << 19)
+#define ETH_RSS_GENEVE             (1ULL << 20)
+#define ETH_RSS_NVGRE              (1ULL << 21)
 
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v9 2/3] ethdev: extend RSS offload types
  2019-10-03 11:35               ` [dpdk-dev] [PATCH v9 0/3] extend RSS offload types Simei Su
  2019-10-03 11:35                 ` [dpdk-dev] [PATCH v9 1/3] ethdev: decouple flow types and " Simei Su
@ 2019-10-03 11:35                 ` " Simei Su
  2019-10-03 11:35                 ` [dpdk-dev] [PATCH v9 3/3] app/testpmd: add RSS offload types extending support Simei Su
  2019-10-04  4:45                 ` [dpdk-dev] [PATCH v10 0/3] extend RSS offload types Simei Su
  3 siblings, 0 replies; 97+ messages in thread
From: Simei Su @ 2019-10-03 11:35 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch reserves several bits as input set selection from the
high end of the 64 bits. It is combined with exisiting ETH_RSS_*
to represent RSS types.

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_ethdev.c | 11 +++++++++++
 lib/librte_ethdev/rte_ethdev.h | 14 ++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index af82360..e483098 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -3112,6 +3112,17 @@ struct rte_eth_dev *
 	if (ret != 0)
 		return ret;
 
+	/* simplified the SRC/DST_ONLY RSS offload modificaiton */
+	if ((rss_conf->rss_hf & ETH_RSS_L3_SRC_ONLY) &&
+		(rss_conf->rss_hf & ETH_RSS_L3_DST_ONLY))
+			rss_conf->rss_hf &=
+				~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY);
+
+	if ((rss_conf->rss_hf & ETH_RSS_L4_SRC_ONLY) &&
+		(rss_conf->rss_hf & ETH_RSS_L4_DST_ONLY))
+			rss_conf->rss_hf &=
+				~(ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY);
+
 	dev = &rte_eth_devices[port_id];
 	if ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) !=
 	    dev_info.flow_type_rss_offloads) {
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 7722f70..6d61b84 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -505,6 +505,20 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_GENEVE             (1ULL << 20)
 #define ETH_RSS_NVGRE              (1ULL << 21)
 
+/*
+ * We use the following macros to combine with above ETH_RSS_* for
+ * more specific input set selection. These bits are defined starting
+ * from the high end of the 64 bits.
+ * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it represents
+ * both SRC and DST are taken into account. If SRC_ONLY and DST_ONLY of
+ * the same level be used simultaneously, it is the same case as none of
+ * them are added.
+ */
+#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
+#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
+#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
+#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
+
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
 	ETH_RSS_FRAG_IPV4 | \
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v9 3/3] app/testpmd: add RSS offload types extending support
  2019-10-03 11:35               ` [dpdk-dev] [PATCH v9 0/3] extend RSS offload types Simei Su
  2019-10-03 11:35                 ` [dpdk-dev] [PATCH v9 1/3] ethdev: decouple flow types and " Simei Su
  2019-10-03 11:35                 ` [dpdk-dev] [PATCH v9 2/3] ethdev: extend " Simei Su
@ 2019-10-03 11:35                 ` Simei Su
  2019-10-04  4:45                 ` [dpdk-dev] [PATCH v10 0/3] extend RSS offload types Simei Su
  3 siblings, 0 replies; 97+ messages in thread
From: Simei Su @ 2019-10-03 11:35 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch adds cmdline support for extended rss types configuration.

Signed-off-by: Simei Su <simei.su@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
---
 app/test-pmd/cmdline.c | 18 +++++++++++++++---
 app/test-pmd/config.c  |  4 ++++
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index def471d..f5c0cde 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2189,7 +2189,9 @@ struct cmd_config_rss {
 	if (!strcmp(res->value, "all"))
 		rss_conf.rss_hf = ETH_RSS_IP | ETH_RSS_TCP |
 				ETH_RSS_UDP | ETH_RSS_SCTP |
-					ETH_RSS_L2_PAYLOAD;
+					ETH_RSS_L2_PAYLOAD |
+				ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY |
+				ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY;
 	else if (!strcmp(res->value, "ip"))
 		rss_conf.rss_hf = ETH_RSS_IP;
 	else if (!strcmp(res->value, "udp"))
@@ -2208,6 +2210,14 @@ struct cmd_config_rss {
 		rss_conf.rss_hf = ETH_RSS_GENEVE;
 	else if (!strcmp(res->value, "nvgre"))
 		rss_conf.rss_hf = ETH_RSS_NVGRE;
+	else if (!strcmp(res->value, "l3-src-only"))
+		rss_conf.rss_hf = ETH_RSS_L3_SRC_ONLY;
+	else if (!strcmp(res->value, "l3-dst-only"))
+		rss_conf.rss_hf = ETH_RSS_L3_DST_ONLY;
+	else if (!strcmp(res->value, "l4-src-only"))
+		rss_conf.rss_hf = ETH_RSS_L4_SRC_ONLY;
+	else if (!strcmp(res->value, "l4-dst-only"))
+		rss_conf.rss_hf = ETH_RSS_L4_DST_ONLY;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "default"))
@@ -2375,7 +2385,8 @@ struct cmd_config_rss_hash_key {
 				 "ipv4#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#"
 				 "ipv4-other#ipv6#ipv6-frag#ipv6-tcp#ipv6-udp#"
 				 "ipv6-sctp#ipv6-other#l2-payload#ipv6-ex#"
-				 "ipv6-tcp-ex#ipv6-udp-ex");
+				 "ipv6-tcp-ex#ipv6-udp-ex#"
+				 "l3-src-only#l3-dst-only#l4-src-only#l4-dst-only");
 cmdline_parse_token_string_t cmd_config_rss_hash_key_value =
 	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);
 
@@ -2385,7 +2396,8 @@ struct cmd_config_rss_hash_key {
 	.help_str = "port config <port_id> rss-hash-key "
 		"ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|"
 		"ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|"
-		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex "
+		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
+		"l3-src-only|l3-dst-only|l4-src-only|l4-dst-only "
 		"<string of hex digits (variable length, NIC dependent)>",
 	.tokens = {
 		(void *)&cmd_config_rss_hash_key_port,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index a3b6cbd..5022d42 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -103,6 +103,10 @@
 	{ "tcp", ETH_RSS_TCP },
 	{ "sctp", ETH_RSS_SCTP },
 	{ "tunnel", ETH_RSS_TUNNEL },
+	{ "l3-src-only", ETH_RSS_L3_SRC_ONLY },
+	{ "l3-dst-only", ETH_RSS_L3_DST_ONLY },
+	{ "l4-src-only", ETH_RSS_L4_SRC_ONLY },
+	{ "l4-dst-only", ETH_RSS_L4_DST_ONLY },
 	{ NULL, 0 },
 };
 
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v10 0/3] extend RSS offload types
  2019-10-03 11:35               ` [dpdk-dev] [PATCH v9 0/3] extend RSS offload types Simei Su
                                   ` (2 preceding siblings ...)
  2019-10-03 11:35                 ` [dpdk-dev] [PATCH v9 3/3] app/testpmd: add RSS offload types extending support Simei Su
@ 2019-10-04  4:45                 ` Simei Su
  2019-10-04  4:46                   ` [dpdk-dev] [PATCH v10 1/3] ethdev: decouple flow types and " Simei Su
                                     ` (3 more replies)
  3 siblings, 4 replies; 97+ messages in thread
From: Simei Su @ 2019-10-04  4:45 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

[PATCH v10 1/3] ethdev: decouple flow types and RSS offload types.
[PATCH v10 2/3] ethdev: add several bits for extending rss offload types.
[PATCH v10 3/3] app/testpmd: add cmdline support for extending rss types.

v10:
* Modify duplicate logic in rte_eth_dev_configure() and
  rte_eth_dev_rss_hash_update().

v9:
* Fix code style.
* Delete duplicate logic in rte_eth_dev_configure().

v8:
* Add to check the simultaneous use of SRC/DST_ONLY of the same level
  in rte_eth_dev_rss_hash_update() and rte_eth_dev_configure().
* Update code comments.

v7:
* Supplement related configuration for new flag in app/test-pmd/cmdline.c.

v6:
* Add the new flag in app/test-pmd/cmdline.c.

v5:
* Update code comments.

v4:
* Divide one patch into two patches.
* Delete ETH_RSS_L2_SRC/DST_ONLY.

v3:
* Update code comments and code style.

v2:
* Update code comments.

Simei Su (3):
  ethdev: decouple flow types and RSS offload types
  ethdev: extend RSS offload types
  app/testpmd: add RSS offload types extending support

 app/test-pmd/cmdline.c         | 14 ++++++++--
 app/test-pmd/config.c          |  4 +++
 lib/librte_ethdev/rte_ethdev.c | 42 ++++++++++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h | 63 +++++++++++++++++++++++++-----------------
 4 files changed, 95 insertions(+), 28 deletions(-)

-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v10 1/3] ethdev: decouple flow types and RSS offload types
  2019-10-04  4:45                 ` [dpdk-dev] [PATCH v10 0/3] extend RSS offload types Simei Su
@ 2019-10-04  4:46                   ` " Simei Su
  2019-10-04  4:46                   ` [dpdk-dev] [PATCH v10 2/3] ethdev: extend " Simei Su
                                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 97+ messages in thread
From: Simei Su @ 2019-10-04  4:46 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch decouples RTE_ETH_FLOW_* and ETH_RSS_*. The former defines
flow types and the latter defines RSS offload types.

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_ethdev.h | 49 ++++++++++++++++++++----------------------
 1 file changed, 23 insertions(+), 26 deletions(-)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d937fb4..7722f70 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -453,7 +453,6 @@ struct rte_eth_rss_conf {
  * possible, and exclusively. For example, if a packet is identified as
  * 'RTE_ETH_FLOW_NONFRAG_IPV4_TCP', it will not be any of other flow types,
  * though it is an actual IPV4 packet.
- * Note that the flow types are used to define RSS offload types.
  */
 #define RTE_ETH_FLOW_UNKNOWN             0
 #define RTE_ETH_FLOW_RAW                 1
@@ -482,31 +481,29 @@ struct rte_eth_rss_conf {
 #define RTE_ETH_FLOW_MAX                23
 
 /*
- * The RSS offload types are defined based on flow types.
- * Different NIC hardware may support different RSS offload
- * types. The supported flow types or RSS offload types can be queried by
- * rte_eth_dev_info_get().
- */
-#define ETH_RSS_IPV4               (1ULL << RTE_ETH_FLOW_IPV4)
-#define ETH_RSS_FRAG_IPV4          (1ULL << RTE_ETH_FLOW_FRAG_IPV4)
-#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
-#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
-#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP)
-#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
-#define ETH_RSS_IPV6               (1ULL << RTE_ETH_FLOW_IPV6)
-#define ETH_RSS_FRAG_IPV6          (1ULL << RTE_ETH_FLOW_FRAG_IPV6)
-#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
-#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
-#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP)
-#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
-#define ETH_RSS_L2_PAYLOAD         (1ULL << RTE_ETH_FLOW_L2_PAYLOAD)
-#define ETH_RSS_IPV6_EX            (1ULL << RTE_ETH_FLOW_IPV6_EX)
-#define ETH_RSS_IPV6_TCP_EX        (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
-#define ETH_RSS_IPV6_UDP_EX        (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
-#define ETH_RSS_PORT               (1ULL << RTE_ETH_FLOW_PORT)
-#define ETH_RSS_VXLAN              (1ULL << RTE_ETH_FLOW_VXLAN)
-#define ETH_RSS_GENEVE             (1ULL << RTE_ETH_FLOW_GENEVE)
-#define ETH_RSS_NVGRE              (1ULL << RTE_ETH_FLOW_NVGRE)
+ * Below macros are defined for RSS offload types, they can be used to
+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
+ */
+#define ETH_RSS_IPV4               (1ULL << 2)
+#define ETH_RSS_FRAG_IPV4          (1ULL << 3)
+#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << 4)
+#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << 5)
+#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << 6)
+#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << 7)
+#define ETH_RSS_IPV6               (1ULL << 8)
+#define ETH_RSS_FRAG_IPV6          (1ULL << 9)
+#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << 10)
+#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << 11)
+#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << 12)
+#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << 13)
+#define ETH_RSS_L2_PAYLOAD         (1ULL << 14)
+#define ETH_RSS_IPV6_EX            (1ULL << 15)
+#define ETH_RSS_IPV6_TCP_EX        (1ULL << 16)
+#define ETH_RSS_IPV6_UDP_EX        (1ULL << 17)
+#define ETH_RSS_PORT               (1ULL << 18)
+#define ETH_RSS_VXLAN              (1ULL << 19)
+#define ETH_RSS_GENEVE             (1ULL << 20)
+#define ETH_RSS_NVGRE              (1ULL << 21)
 
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v10 2/3] ethdev: extend RSS offload types
  2019-10-04  4:45                 ` [dpdk-dev] [PATCH v10 0/3] extend RSS offload types Simei Su
  2019-10-04  4:46                   ` [dpdk-dev] [PATCH v10 1/3] ethdev: decouple flow types and " Simei Su
@ 2019-10-04  4:46                   ` " Simei Su
  2019-10-08 16:45                     ` Andrew Rybchenko
  2019-10-04  4:46                   ` [dpdk-dev] [PATCH v10 3/3] app/testpmd: add RSS offload types extending support Simei Su
  2019-10-09  6:57                   ` [dpdk-dev] [PATCH v11 0/3] extend RSS offload types Simei Su
  3 siblings, 1 reply; 97+ messages in thread
From: Simei Su @ 2019-10-04  4:46 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch reserves several bits as input set selection from the
high end of the 64 bits. It is combined with exisiting ETH_RSS_*
to represent RSS types.

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_ethdev.c | 42 ++++++++++++++++++++++++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h | 14 ++++++++++++++
 2 files changed, 56 insertions(+)

diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index af82360..1666652 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -1115,6 +1115,26 @@ struct rte_eth_dev *
 	return name;
 }
 
+static uint64_t
+strip_out_src_dst_only(uint64_t value, uint64_t layer)
+{
+	uint64_t flag = 0;
+
+	if (layer == 3) {
+		if ((value & ETH_RSS_L3_SRC_ONLY) &&
+			(value & ETH_RSS_L3_DST_ONLY))
+				flag = 1;
+	}
+
+	if (layer == 4) {
+		if ((value & ETH_RSS_L4_SRC_ONLY) &&
+			(value & ETH_RSS_L4_DST_ONLY))
+				flag = 1;
+	}
+
+	return flag;
+}
+
 int
 rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		      const struct rte_eth_conf *dev_conf)
@@ -1124,6 +1144,8 @@ struct rte_eth_dev *
 	struct rte_eth_conf orig_conf;
 	int diag;
 	int ret;
+	uint64_t layer3 = 3;
+	uint64_t layer4 = 4;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
 
@@ -1269,6 +1291,16 @@ struct rte_eth_dev *
 		goto rollback;
 	}
 
+	if (strip_out_src_dst_only(
+		dev_conf->rx_adv_conf.rss_conf.rss_hf, layer3) == 1)
+			dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf &=
+				~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY);
+
+	if (strip_out_src_dst_only(
+		dev_conf->rx_adv_conf.rss_conf.rss_hf, layer4) == 1)
+			dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf &=
+				~(ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY);
+
 	/* Check that device supports requested rss hash functions. */
 	if ((dev_info.flow_type_rss_offloads |
 	     dev_conf->rx_adv_conf.rss_conf.rss_hf) !=
@@ -3105,6 +3137,8 @@ struct rte_eth_dev *
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info = { .flow_type_rss_offloads = 0, };
 	int ret;
+	uint64_t layer3 = 3;
+	uint64_t layer4 = 4;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 
@@ -3112,6 +3146,14 @@ struct rte_eth_dev *
 	if (ret != 0)
 		return ret;
 
+	if (strip_out_src_dst_only(rss_conf->rss_hf, layer3) == 1)
+		rss_conf->rss_hf &=
+			~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY);
+
+	if (strip_out_src_dst_only(rss_conf->rss_hf, layer4) == 1)
+		rss_conf->rss_hf &=
+			~(ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY);
+
 	dev = &rte_eth_devices[port_id];
 	if ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) !=
 	    dev_info.flow_type_rss_offloads) {
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 7722f70..6d61b84 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -505,6 +505,20 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_GENEVE             (1ULL << 20)
 #define ETH_RSS_NVGRE              (1ULL << 21)
 
+/*
+ * We use the following macros to combine with above ETH_RSS_* for
+ * more specific input set selection. These bits are defined starting
+ * from the high end of the 64 bits.
+ * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it represents
+ * both SRC and DST are taken into account. If SRC_ONLY and DST_ONLY of
+ * the same level be used simultaneously, it is the same case as none of
+ * them are added.
+ */
+#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
+#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
+#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
+#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
+
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
 	ETH_RSS_FRAG_IPV4 | \
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v10 3/3] app/testpmd: add RSS offload types extending support
  2019-10-04  4:45                 ` [dpdk-dev] [PATCH v10 0/3] extend RSS offload types Simei Su
  2019-10-04  4:46                   ` [dpdk-dev] [PATCH v10 1/3] ethdev: decouple flow types and " Simei Su
  2019-10-04  4:46                   ` [dpdk-dev] [PATCH v10 2/3] ethdev: extend " Simei Su
@ 2019-10-04  4:46                   ` Simei Su
  2019-10-09  6:57                   ` [dpdk-dev] [PATCH v11 0/3] extend RSS offload types Simei Su
  3 siblings, 0 replies; 97+ messages in thread
From: Simei Su @ 2019-10-04  4:46 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch adds cmdline support for extended rss types configuration.

Signed-off-by: Simei Su <simei.su@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
---
 app/test-pmd/cmdline.c | 14 ++++++++++++--
 app/test-pmd/config.c  |  4 ++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index def471d..dbeb2ee 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2208,6 +2208,14 @@ struct cmd_config_rss {
 		rss_conf.rss_hf = ETH_RSS_GENEVE;
 	else if (!strcmp(res->value, "nvgre"))
 		rss_conf.rss_hf = ETH_RSS_NVGRE;
+	else if (!strcmp(res->value, "l3-src-only"))
+		rss_conf.rss_hf = ETH_RSS_L3_SRC_ONLY;
+	else if (!strcmp(res->value, "l3-dst-only"))
+		rss_conf.rss_hf = ETH_RSS_L3_DST_ONLY;
+	else if (!strcmp(res->value, "l4-src-only"))
+		rss_conf.rss_hf = ETH_RSS_L4_SRC_ONLY;
+	else if (!strcmp(res->value, "l4-dst-only"))
+		rss_conf.rss_hf = ETH_RSS_L4_DST_ONLY;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "default"))
@@ -2375,7 +2383,8 @@ struct cmd_config_rss_hash_key {
 				 "ipv4#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#"
 				 "ipv4-other#ipv6#ipv6-frag#ipv6-tcp#ipv6-udp#"
 				 "ipv6-sctp#ipv6-other#l2-payload#ipv6-ex#"
-				 "ipv6-tcp-ex#ipv6-udp-ex");
+				 "ipv6-tcp-ex#ipv6-udp-ex#"
+				 "l3-src-only#l3-dst-only#l4-src-only#l4-dst-only");
 cmdline_parse_token_string_t cmd_config_rss_hash_key_value =
 	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);
 
@@ -2385,7 +2394,8 @@ struct cmd_config_rss_hash_key {
 	.help_str = "port config <port_id> rss-hash-key "
 		"ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|"
 		"ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|"
-		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex "
+		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
+		"l3-src-only|l3-dst-only|l4-src-only|l4-dst-only "
 		"<string of hex digits (variable length, NIC dependent)>",
 	.tokens = {
 		(void *)&cmd_config_rss_hash_key_port,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index a3b6cbd..5022d42 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -103,6 +103,10 @@
 	{ "tcp", ETH_RSS_TCP },
 	{ "sctp", ETH_RSS_SCTP },
 	{ "tunnel", ETH_RSS_TUNNEL },
+	{ "l3-src-only", ETH_RSS_L3_SRC_ONLY },
+	{ "l3-dst-only", ETH_RSS_L3_DST_ONLY },
+	{ "l4-src-only", ETH_RSS_L4_SRC_ONLY },
+	{ "l4-dst-only", ETH_RSS_L4_DST_ONLY },
 	{ NULL, 0 },
 };
 
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH v8 2/3] ethdev: extend RSS offload types
  2019-10-01 14:49                 ` Andrew Rybchenko
  2019-10-01 16:02                   ` Iremonger, Bernard
@ 2019-10-05  4:54                   ` Su, Simei
  1 sibling, 0 replies; 97+ messages in thread
From: Su, Simei @ 2019-10-05  4:54 UTC (permalink / raw)
  To: Andrew Rybchenko, Zhang, Qi Z, Ye, Xiaolong, Yigit, Ferruh; +Cc: dev

Hi, Andrew

> -----Original Message-----
> From: Andrew Rybchenko [mailto:arybchenko@solarflare.com]
> Sent: Tuesday, October 1, 2019 10:49 PM
> To: Su, Simei <simei.su@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Ye,
> Xiaolong <xiaolong.ye@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v8 2/3] ethdev: extend RSS offload types
> 
> On 10/1/19 5:36 PM, Simei Su wrote:
> > This patch reserves several bits as input set selection from the high
> > end of the 64 bits. It is combined with exisiting ETH_RSS_* to
> > represent RSS types.
> >
> > 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_ethdev.c | 22 ++++++++++++++++++++++
> >   lib/librte_ethdev/rte_ethdev.h | 14 ++++++++++++++
> >   2 files changed, 36 insertions(+)
> >
> > diff --git a/lib/librte_ethdev/rte_ethdev.c
> > b/lib/librte_ethdev/rte_ethdev.c index af82360..5e5a974 100644
> > --- a/lib/librte_ethdev/rte_ethdev.c
> > +++ b/lib/librte_ethdev/rte_ethdev.c
> > @@ -1269,6 +1269,17 @@ struct rte_eth_dev *
> >   		goto rollback;
> >   	}
> >
> > +	/* simplified the SRC/DST_ONLY RSS offload modificaiton */
> > +	if (dev_conf->rx_adv_conf.rss_conf.rss_hf & ETH_RSS_L3_SRC_ONLY &&
> > +		dev_conf->rx_adv_conf.rss_conf.rss_hf & ETH_RSS_L3_DST_ONLY)
> 
> I'm afraid some compiler versions could bark about missing parenthesis here.
> Consider to use something like:
>   (rss_conf->rss_hf & (ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY) ==
>    (ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY)) May be parenthesis
> around & is not required.
> 
> > +			dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf &=
> > +				~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY);
> > +
> > +	if (dev_conf->rx_adv_conf.rss_conf.rss_hf & ETH_RSS_L4_SRC_ONLY &&
> > +		dev_conf->rx_adv_conf.rss_conf.rss_hf & ETH_RSS_L4_DST_ONLY)
> > +			dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf &=
> > +				~(ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY);
> > +
> 
> I think it is wrong to duplicate the logic twice (here and below).
> Helper static function should be used to avoid it.

 I have updated the patch for v10. Thanks!

> 
> >   	/* Check that device supports requested rss hash functions. */
> >   	if ((dev_info.flow_type_rss_offloads |
> >   	     dev_conf->rx_adv_conf.rss_conf.rss_hf) != @@ -3112,6 +3123,17
> > @@ struct rte_eth_dev *
> >   	if (ret != 0)
> >   		return ret;
> >
> > +	/* simplified the SRC/DST_ONLY RSS offload modificaiton */
> > +	if (rss_conf->rss_hf & ETH_RSS_L3_SRC_ONLY &&
> > +		rss_conf->rss_hf & ETH_RSS_L3_DST_ONLY)
> > +			rss_conf->rss_hf &=
> > +				~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY);
> > +
> > +	if (rss_conf->rss_hf & ETH_RSS_L4_SRC_ONLY &&
> > +		rss_conf->rss_hf & ETH_RSS_L4_DST_ONLY)
> > +			rss_conf->rss_hf &=
> > +				~(ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY);
> > +
> >   	dev = &rte_eth_devices[port_id];
> >   	if ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) !=
> >   	    dev_info.flow_type_rss_offloads) { diff --git
> > a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> > index 7722f70..6d61b84 100644
> > --- a/lib/librte_ethdev/rte_ethdev.h
> > +++ b/lib/librte_ethdev/rte_ethdev.h
> > @@ -505,6 +505,20 @@ struct rte_eth_rss_conf {
> >   #define ETH_RSS_GENEVE             (1ULL << 20)
> >   #define ETH_RSS_NVGRE              (1ULL << 21)
> >
> > +/*
> > + * We use the following macros to combine with above ETH_RSS_* for
> > + * more specific input set selection. These bits are defined starting
> > + * from the high end of the 64 bits.
> > + * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it
> > +represents
> > + * both SRC and DST are taken into account. If SRC_ONLY and DST_ONLY
> > +of
> > + * the same level be used simultaneously, it is the same case as none
> > +of
> > + * them are added.
> > + */
> > +#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
> > +#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
> > +#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
> > +#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
> > +
> >   #define ETH_RSS_IP ( \
> >   	ETH_RSS_IPV4 | \
> >   	ETH_RSS_FRAG_IPV4 | \


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

* Re: [dpdk-dev] [PATCH v10 2/3] ethdev: extend RSS offload types
  2019-10-04  4:46                   ` [dpdk-dev] [PATCH v10 2/3] ethdev: extend " Simei Su
@ 2019-10-08 16:45                     ` Andrew Rybchenko
  2019-10-09  7:06                       ` Su, Simei
  0 siblings, 1 reply; 97+ messages in thread
From: Andrew Rybchenko @ 2019-10-08 16:45 UTC (permalink / raw)
  To: Simei Su, qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev

On 10/4/19 7:46 AM, Simei Su wrote:
> This patch reserves several bits as input set selection from the
> high end of the 64 bits. It is combined with exisiting ETH_RSS_*
> to represent RSS types.
>
> 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_ethdev.c | 42 ++++++++++++++++++++++++++++++++++++++++++
>   lib/librte_ethdev/rte_ethdev.h | 14 ++++++++++++++
>   2 files changed, 56 insertions(+)
>
> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index af82360..1666652 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -1115,6 +1115,26 @@ struct rte_eth_dev *
>   	return name;
>   }
>   
> +static uint64_t
> +strip_out_src_dst_only(uint64_t value, uint64_t layer)
> +{
> +	uint64_t flag = 0;
> +
> +	if (layer == 3) {
> +		if ((value & ETH_RSS_L3_SRC_ONLY) &&
> +			(value & ETH_RSS_L3_DST_ONLY))
> +				flag = 1;
> +	}
> +
> +	if (layer == 4) {
> +		if ((value & ETH_RSS_L4_SRC_ONLY) &&
> +			(value & ETH_RSS_L4_DST_ONLY))
> +				flag = 1;
> +	}
> +
> +	return flag;
> +}
> +

I though about something like:

static uint64_t
strip_out_src_dst_only(uint64_t rss_hf)
{
	if ((rss_hf & ETH_RSS_L3_SRC_ONLY) && (rss_hf & ETH_RSS_L3_DST_ONLY))
		rss_hf &= ~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY);

	if ((rss_hf & ETH_RSS_L4_SRC_ONLY) && (rss_hf & ETH_RSS_L4_DST_ONLY))
		rss_hf &= ~(ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY);

	return rss_hf;
}

dev_conf->rx_adv_conf.rss_conf.rss_hf =
	strip_out_src_dst_only(dev_conf->rx_adv_conf.rss_conf.rss_hf);

or void function with uint64_t *rss_hf argument.

>   int
>   rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
>   		      const struct rte_eth_conf *dev_conf)
> @@ -1124,6 +1144,8 @@ struct rte_eth_dev *
>   	struct rte_eth_conf orig_conf;
>   	int diag;
>   	int ret;
> +	uint64_t layer3 = 3;
> +	uint64_t layer4 = 4;
>   
>   	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
>   
> @@ -1269,6 +1291,16 @@ struct rte_eth_dev *
>   		goto rollback;
>   	}
>   
> +	if (strip_out_src_dst_only(
> +		dev_conf->rx_adv_conf.rss_conf.rss_hf, layer3) == 1)
> +			dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf &=
> +				~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY);
> +
> +	if (strip_out_src_dst_only(
> +		dev_conf->rx_adv_conf.rss_conf.rss_hf, layer4) == 1)
> +			dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf &=
> +				~(ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY);
> +
>   	/* Check that device supports requested rss hash functions. */
>   	if ((dev_info.flow_type_rss_offloads |
>   	     dev_conf->rx_adv_conf.rss_conf.rss_hf) !=
> @@ -3105,6 +3137,8 @@ struct rte_eth_dev *
>   	struct rte_eth_dev *dev;
>   	struct rte_eth_dev_info dev_info = { .flow_type_rss_offloads = 0, };
>   	int ret;
> +	uint64_t layer3 = 3;
> +	uint64_t layer4 = 4;
>   
>   	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
>   
> @@ -3112,6 +3146,14 @@ struct rte_eth_dev *
>   	if (ret != 0)
>   		return ret;
>   
> +	if (strip_out_src_dst_only(rss_conf->rss_hf, layer3) == 1)
> +		rss_conf->rss_hf &=
> +			~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY);
> +
> +	if (strip_out_src_dst_only(rss_conf->rss_hf, layer4) == 1)
> +		rss_conf->rss_hf &=
> +			~(ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY);
> +
>   	dev = &rte_eth_devices[port_id];
>   	if ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) !=
>   	    dev_info.flow_type_rss_offloads) {
> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> index 7722f70..6d61b84 100644
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -505,6 +505,20 @@ struct rte_eth_rss_conf {
>   #define ETH_RSS_GENEVE             (1ULL << 20)
>   #define ETH_RSS_NVGRE              (1ULL << 21)
>   
> +/*
> + * We use the following macros to combine with above ETH_RSS_* for
> + * more specific input set selection. These bits are defined starting
> + * from the high end of the 64 bits.
> + * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it represents
> + * both SRC and DST are taken into account. If SRC_ONLY and DST_ONLY of
> + * the same level be used simultaneously, it is the same case as none of
> + * them are added.
> + */
> +#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
> +#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
> +#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
> +#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
> +
>   #define ETH_RSS_IP ( \
>   	ETH_RSS_IPV4 | \
>   	ETH_RSS_FRAG_IPV4 | \


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

* [dpdk-dev] [PATCH v11 0/3] extend RSS offload types
  2019-10-04  4:45                 ` [dpdk-dev] [PATCH v10 0/3] extend RSS offload types Simei Su
                                     ` (2 preceding siblings ...)
  2019-10-04  4:46                   ` [dpdk-dev] [PATCH v10 3/3] app/testpmd: add RSS offload types extending support Simei Su
@ 2019-10-09  6:57                   ` Simei Su
  2019-10-09  6:57                     ` [dpdk-dev] [PATCH v11 1/3] ethdev: decouple flow types and " Simei Su
                                       ` (3 more replies)
  3 siblings, 4 replies; 97+ messages in thread
From: Simei Su @ 2019-10-09  6:57 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

[PATCH v11 1/3] ethdev: decouple flow types and RSS offload types.
[PATCH v11 2/3] ethdev: add several bits for extending rss offload types.
[PATCH v11 3/3] app/testpmd: add cmdline support for extending rss types.

v11:
* Update code logic in rte_eth_dev_configure() and
  rte_eth_dev_rss_hash_update().

v10:
* Modify duplicate logic in rte_eth_dev_configure() and
  rte_eth_dev_rss_hash_update().

v9:
* Fix code style.
* Delete duplicate logic in rte_eth_dev_configure().

v8:
* Add to check the simultaneous use of SRC/DST_ONLY of the same level
  in rte_eth_dev_rss_hash_update() and rte_eth_dev_configure().
* Update code comments.

v7:
* Supplement related configuration for new flag in app/test-pmd/cmdline.c.

v6:
* Add the new flag in app/test-pmd/cmdline.c.

v5:
* Update code comments.

v4:
* Divide one patch into two patches.
* Delete ETH_RSS_L2_SRC/DST_ONLY.

v3:
* Update code comments and code style.

v2:
* Update code comments.

Simei Su (3):
  ethdev: decouple flow types and RSS offload types
  ethdev: extend RSS offload types
  app/testpmd: add RSS offload types extending support

 app/test-pmd/cmdline.c         | 14 ++++++-
 app/test-pmd/config.c          |  4 ++
 lib/librte_ethdev/rte_ethdev.c |  5 +++
 lib/librte_ethdev/rte_ethdev.h | 84 +++++++++++++++++++++++++++++-------------
 4 files changed, 79 insertions(+), 28 deletions(-)

-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v11 1/3] ethdev: decouple flow types and RSS offload types
  2019-10-09  6:57                   ` [dpdk-dev] [PATCH v11 0/3] extend RSS offload types Simei Su
@ 2019-10-09  6:57                     ` " Simei Su
  2019-10-09  6:57                     ` [dpdk-dev] [PATCH v11 2/3] ethdev: extend " Simei Su
                                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 97+ messages in thread
From: Simei Su @ 2019-10-09  6:57 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch decouples RTE_ETH_FLOW_* and ETH_RSS_*. The former defines
flow types and the latter defines RSS offload types.

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_ethdev.h | 49 ++++++++++++++++++++----------------------
 1 file changed, 23 insertions(+), 26 deletions(-)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d937fb4..7722f70 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -453,7 +453,6 @@ struct rte_eth_rss_conf {
  * possible, and exclusively. For example, if a packet is identified as
  * 'RTE_ETH_FLOW_NONFRAG_IPV4_TCP', it will not be any of other flow types,
  * though it is an actual IPV4 packet.
- * Note that the flow types are used to define RSS offload types.
  */
 #define RTE_ETH_FLOW_UNKNOWN             0
 #define RTE_ETH_FLOW_RAW                 1
@@ -482,31 +481,29 @@ struct rte_eth_rss_conf {
 #define RTE_ETH_FLOW_MAX                23
 
 /*
- * The RSS offload types are defined based on flow types.
- * Different NIC hardware may support different RSS offload
- * types. The supported flow types or RSS offload types can be queried by
- * rte_eth_dev_info_get().
- */
-#define ETH_RSS_IPV4               (1ULL << RTE_ETH_FLOW_IPV4)
-#define ETH_RSS_FRAG_IPV4          (1ULL << RTE_ETH_FLOW_FRAG_IPV4)
-#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
-#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
-#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP)
-#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
-#define ETH_RSS_IPV6               (1ULL << RTE_ETH_FLOW_IPV6)
-#define ETH_RSS_FRAG_IPV6          (1ULL << RTE_ETH_FLOW_FRAG_IPV6)
-#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
-#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
-#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP)
-#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
-#define ETH_RSS_L2_PAYLOAD         (1ULL << RTE_ETH_FLOW_L2_PAYLOAD)
-#define ETH_RSS_IPV6_EX            (1ULL << RTE_ETH_FLOW_IPV6_EX)
-#define ETH_RSS_IPV6_TCP_EX        (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
-#define ETH_RSS_IPV6_UDP_EX        (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
-#define ETH_RSS_PORT               (1ULL << RTE_ETH_FLOW_PORT)
-#define ETH_RSS_VXLAN              (1ULL << RTE_ETH_FLOW_VXLAN)
-#define ETH_RSS_GENEVE             (1ULL << RTE_ETH_FLOW_GENEVE)
-#define ETH_RSS_NVGRE              (1ULL << RTE_ETH_FLOW_NVGRE)
+ * Below macros are defined for RSS offload types, they can be used to
+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
+ */
+#define ETH_RSS_IPV4               (1ULL << 2)
+#define ETH_RSS_FRAG_IPV4          (1ULL << 3)
+#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << 4)
+#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << 5)
+#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << 6)
+#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << 7)
+#define ETH_RSS_IPV6               (1ULL << 8)
+#define ETH_RSS_FRAG_IPV6          (1ULL << 9)
+#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << 10)
+#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << 11)
+#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << 12)
+#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << 13)
+#define ETH_RSS_L2_PAYLOAD         (1ULL << 14)
+#define ETH_RSS_IPV6_EX            (1ULL << 15)
+#define ETH_RSS_IPV6_TCP_EX        (1ULL << 16)
+#define ETH_RSS_IPV6_UDP_EX        (1ULL << 17)
+#define ETH_RSS_PORT               (1ULL << 18)
+#define ETH_RSS_VXLAN              (1ULL << 19)
+#define ETH_RSS_GENEVE             (1ULL << 20)
+#define ETH_RSS_NVGRE              (1ULL << 21)
 
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v11 2/3] ethdev: extend RSS offload types
  2019-10-09  6:57                   ` [dpdk-dev] [PATCH v11 0/3] extend RSS offload types Simei Su
  2019-10-09  6:57                     ` [dpdk-dev] [PATCH v11 1/3] ethdev: decouple flow types and " Simei Su
@ 2019-10-09  6:57                     ` " Simei Su
  2019-10-09  7:18                       ` Andrew Rybchenko
  2019-10-09  6:57                     ` [dpdk-dev] [PATCH v11 3/3] app/testpmd: add RSS offload types extending support Simei Su
  2019-10-14 13:36                     ` [dpdk-dev] [PATCH v12 0/3] extend RSS offload types Simei Su
  3 siblings, 1 reply; 97+ messages in thread
From: Simei Su @ 2019-10-09  6:57 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch reserves several bits as input set selection from the
high end of the 64 bits. It is combined with exisiting ETH_RSS_*
to represent RSS types.

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_ethdev.c |  5 +++++
 lib/librte_ethdev/rte_ethdev.h | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+)

diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index af82360..69f4133 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -1269,6 +1269,9 @@ struct rte_eth_dev *
 		goto rollback;
 	}
 
+	dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf =
+		strip_out_src_dst_only(dev_conf->rx_adv_conf.rss_conf.rss_hf);
+
 	/* Check that device supports requested rss hash functions. */
 	if ((dev_info.flow_type_rss_offloads |
 	     dev_conf->rx_adv_conf.rss_conf.rss_hf) !=
@@ -3112,6 +3115,8 @@ struct rte_eth_dev *
 	if (ret != 0)
 		return ret;
 
+	rss_conf->rss_hf = strip_out_src_dst_only(rss_conf->rss_hf);
+
 	dev = &rte_eth_devices[port_id];
 	if ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) !=
 	    dev_info.flow_type_rss_offloads) {
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 7722f70..ef59ed5 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -505,6 +505,20 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_GENEVE             (1ULL << 20)
 #define ETH_RSS_NVGRE              (1ULL << 21)
 
+/*
+ * We use the following macros to combine with above ETH_RSS_* for
+ * more specific input set selection. These bits are defined starting
+ * from the high end of the 64 bits.
+ * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it represents
+ * both SRC and DST are taken into account. If SRC_ONLY and DST_ONLY of
+ * the same level are used simultaneously, it is the same case as none of
+ * them are added.
+ */
+#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
+#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
+#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
+#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
+
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
 	ETH_RSS_FRAG_IPV4 | \
@@ -4034,6 +4048,27 @@ int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id,
 void *
 rte_eth_dev_get_sec_ctx(uint16_t port_id);
 
+/**
+ * If SRC_ONLY and DST_ONLY of the same level are used
+ * simultaneously, it is the same case as none of them
+ * are added.
+ *
+ * @param rss_hf
+ *   RSS types with SRC/DST_ONLY.
+ * @return
+ *   RSS types.
+ */
+static inline uint64_t
+strip_out_src_dst_only(uint64_t rss_hf)
+{
+	if ((rss_hf & ETH_RSS_L3_SRC_ONLY) && (rss_hf & ETH_RSS_L3_DST_ONLY))
+		rss_hf &= ~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY);
+
+	if ((rss_hf & ETH_RSS_L4_SRC_ONLY) && (rss_hf & ETH_RSS_L4_DST_ONLY))
+		rss_hf &= ~(ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY);
+
+	return rss_hf;
+}
 
 #include <rte_ethdev_core.h>
 
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v11 3/3] app/testpmd: add RSS offload types extending support
  2019-10-09  6:57                   ` [dpdk-dev] [PATCH v11 0/3] extend RSS offload types Simei Su
  2019-10-09  6:57                     ` [dpdk-dev] [PATCH v11 1/3] ethdev: decouple flow types and " Simei Su
  2019-10-09  6:57                     ` [dpdk-dev] [PATCH v11 2/3] ethdev: extend " Simei Su
@ 2019-10-09  6:57                     ` Simei Su
  2019-10-14 13:36                     ` [dpdk-dev] [PATCH v12 0/3] extend RSS offload types Simei Su
  3 siblings, 0 replies; 97+ messages in thread
From: Simei Su @ 2019-10-09  6:57 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch adds cmdline support for extended rss types configuration.

Signed-off-by: Simei Su <simei.su@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
---
 app/test-pmd/cmdline.c | 14 ++++++++++++--
 app/test-pmd/config.c  |  4 ++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index def471d..dbeb2ee 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2208,6 +2208,14 @@ struct cmd_config_rss {
 		rss_conf.rss_hf = ETH_RSS_GENEVE;
 	else if (!strcmp(res->value, "nvgre"))
 		rss_conf.rss_hf = ETH_RSS_NVGRE;
+	else if (!strcmp(res->value, "l3-src-only"))
+		rss_conf.rss_hf = ETH_RSS_L3_SRC_ONLY;
+	else if (!strcmp(res->value, "l3-dst-only"))
+		rss_conf.rss_hf = ETH_RSS_L3_DST_ONLY;
+	else if (!strcmp(res->value, "l4-src-only"))
+		rss_conf.rss_hf = ETH_RSS_L4_SRC_ONLY;
+	else if (!strcmp(res->value, "l4-dst-only"))
+		rss_conf.rss_hf = ETH_RSS_L4_DST_ONLY;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "default"))
@@ -2375,7 +2383,8 @@ struct cmd_config_rss_hash_key {
 				 "ipv4#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#"
 				 "ipv4-other#ipv6#ipv6-frag#ipv6-tcp#ipv6-udp#"
 				 "ipv6-sctp#ipv6-other#l2-payload#ipv6-ex#"
-				 "ipv6-tcp-ex#ipv6-udp-ex");
+				 "ipv6-tcp-ex#ipv6-udp-ex#"
+				 "l3-src-only#l3-dst-only#l4-src-only#l4-dst-only");
 cmdline_parse_token_string_t cmd_config_rss_hash_key_value =
 	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);
 
@@ -2385,7 +2394,8 @@ struct cmd_config_rss_hash_key {
 	.help_str = "port config <port_id> rss-hash-key "
 		"ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|"
 		"ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|"
-		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex "
+		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
+		"l3-src-only|l3-dst-only|l4-src-only|l4-dst-only "
 		"<string of hex digits (variable length, NIC dependent)>",
 	.tokens = {
 		(void *)&cmd_config_rss_hash_key_port,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index a3b6cbd..5022d42 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -103,6 +103,10 @@
 	{ "tcp", ETH_RSS_TCP },
 	{ "sctp", ETH_RSS_SCTP },
 	{ "tunnel", ETH_RSS_TUNNEL },
+	{ "l3-src-only", ETH_RSS_L3_SRC_ONLY },
+	{ "l3-dst-only", ETH_RSS_L3_DST_ONLY },
+	{ "l4-src-only", ETH_RSS_L4_SRC_ONLY },
+	{ "l4-dst-only", ETH_RSS_L4_DST_ONLY },
 	{ NULL, 0 },
 };
 
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH v10 2/3] ethdev: extend RSS offload types
  2019-10-08 16:45                     ` Andrew Rybchenko
@ 2019-10-09  7:06                       ` Su, Simei
  0 siblings, 0 replies; 97+ messages in thread
From: Su, Simei @ 2019-10-09  7:06 UTC (permalink / raw)
  To: Andrew Rybchenko, Zhang, Qi Z, Ye, Xiaolong, Yigit, Ferruh; +Cc: dev

Hi, Andrew

> -----Original Message-----
> From: Andrew Rybchenko [mailto:arybchenko@solarflare.com]
> Sent: Wednesday, October 9, 2019 12:46 AM
> To: Su, Simei <simei.su@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Ye,
> Xiaolong <xiaolong.ye@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v10 2/3] ethdev: extend RSS offload types
> 
> On 10/4/19 7:46 AM, Simei Su wrote:
> > This patch reserves several bits as input set selection from the high
> > end of the 64 bits. It is combined with exisiting ETH_RSS_* to
> > represent RSS types.
> >
> > 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_ethdev.c | 42
> ++++++++++++++++++++++++++++++++++++++++++
> >   lib/librte_ethdev/rte_ethdev.h | 14 ++++++++++++++
> >   2 files changed, 56 insertions(+)
> >
> > diff --git a/lib/librte_ethdev/rte_ethdev.c
> > b/lib/librte_ethdev/rte_ethdev.c index af82360..1666652 100644
> > --- a/lib/librte_ethdev/rte_ethdev.c
> > +++ b/lib/librte_ethdev/rte_ethdev.c
> > @@ -1115,6 +1115,26 @@ struct rte_eth_dev *
> >   	return name;
> >   }
> >
> > +static uint64_t
> > +strip_out_src_dst_only(uint64_t value, uint64_t layer) {
> > +	uint64_t flag = 0;
> > +
> > +	if (layer == 3) {
> > +		if ((value & ETH_RSS_L3_SRC_ONLY) &&
> > +			(value & ETH_RSS_L3_DST_ONLY))
> > +				flag = 1;
> > +	}
> > +
> > +	if (layer == 4) {
> > +		if ((value & ETH_RSS_L4_SRC_ONLY) &&
> > +			(value & ETH_RSS_L4_DST_ONLY))
> > +				flag = 1;
> > +	}
> > +
> > +	return flag;
> > +}
> > +
> 
> I though about something like:
> 
> static uint64_t
> strip_out_src_dst_only(uint64_t rss_hf)
> {
> 	if ((rss_hf & ETH_RSS_L3_SRC_ONLY) && (rss_hf &
> ETH_RSS_L3_DST_ONLY))
> 		rss_hf &= ~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY);
> 
> 	if ((rss_hf & ETH_RSS_L4_SRC_ONLY) && (rss_hf &
> ETH_RSS_L4_DST_ONLY))
> 		rss_hf &= ~(ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY);
> 
> 	return rss_hf;
> }
> 
> dev_conf->rx_adv_conf.rss_conf.rss_hf =
> 	strip_out_src_dst_only(dev_conf->rx_adv_conf.rss_conf.rss_hf);
> 
> or void function with uint64_t *rss_hf argument.

  Yes, this way is more concise and clear. I have sent PATCH v11. Thanks for your guidance.

> 
> >   int
> >   rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t
> nb_tx_q,
> >   		      const struct rte_eth_conf *dev_conf) @@ -1124,6 +1144,8
> @@
> > struct rte_eth_dev *
> >   	struct rte_eth_conf orig_conf;
> >   	int diag;
> >   	int ret;
> > +	uint64_t layer3 = 3;
> > +	uint64_t layer4 = 4;
> >
> >   	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
> >
> > @@ -1269,6 +1291,16 @@ struct rte_eth_dev *
> >   		goto rollback;
> >   	}
> >
> > +	if (strip_out_src_dst_only(
> > +		dev_conf->rx_adv_conf.rss_conf.rss_hf, layer3) == 1)
> > +			dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf &=
> > +				~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY);
> > +
> > +	if (strip_out_src_dst_only(
> > +		dev_conf->rx_adv_conf.rss_conf.rss_hf, layer4) == 1)
> > +			dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf &=
> > +				~(ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY);
> > +
> >   	/* Check that device supports requested rss hash functions. */
> >   	if ((dev_info.flow_type_rss_offloads |
> >   	     dev_conf->rx_adv_conf.rss_conf.rss_hf) != @@ -3105,6 +3137,8
> > @@ struct rte_eth_dev *
> >   	struct rte_eth_dev *dev;
> >   	struct rte_eth_dev_info dev_info = { .flow_type_rss_offloads = 0, };
> >   	int ret;
> > +	uint64_t layer3 = 3;
> > +	uint64_t layer4 = 4;
> >
> >   	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> >
> > @@ -3112,6 +3146,14 @@ struct rte_eth_dev *
> >   	if (ret != 0)
> >   		return ret;
> >
> > +	if (strip_out_src_dst_only(rss_conf->rss_hf, layer3) == 1)
> > +		rss_conf->rss_hf &=
> > +			~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY);
> > +
> > +	if (strip_out_src_dst_only(rss_conf->rss_hf, layer4) == 1)
> > +		rss_conf->rss_hf &=
> > +			~(ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY);
> > +
> >   	dev = &rte_eth_devices[port_id];
> >   	if ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) !=
> >   	    dev_info.flow_type_rss_offloads) { diff --git
> > a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> > index 7722f70..6d61b84 100644
> > --- a/lib/librte_ethdev/rte_ethdev.h
> > +++ b/lib/librte_ethdev/rte_ethdev.h
> > @@ -505,6 +505,20 @@ struct rte_eth_rss_conf {
> >   #define ETH_RSS_GENEVE             (1ULL << 20)
> >   #define ETH_RSS_NVGRE              (1ULL << 21)
> >
> > +/*
> > + * We use the following macros to combine with above ETH_RSS_* for
> > + * more specific input set selection. These bits are defined starting
> > + * from the high end of the 64 bits.
> > + * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it
> > +represents
> > + * both SRC and DST are taken into account. If SRC_ONLY and DST_ONLY
> > +of
> > + * the same level be used simultaneously, it is the same case as none
> > +of
> > + * them are added.
> > + */
> > +#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
> > +#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
> > +#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
> > +#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
> > +
> >   #define ETH_RSS_IP ( \
> >   	ETH_RSS_IPV4 | \
> >   	ETH_RSS_FRAG_IPV4 | \


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

* Re: [dpdk-dev] [PATCH v11 2/3] ethdev: extend RSS offload types
  2019-10-09  6:57                     ` [dpdk-dev] [PATCH v11 2/3] ethdev: extend " Simei Su
@ 2019-10-09  7:18                       ` Andrew Rybchenko
  2019-10-09  7:42                         ` Su, Simei
  0 siblings, 1 reply; 97+ messages in thread
From: Andrew Rybchenko @ 2019-10-09  7:18 UTC (permalink / raw)
  To: Simei Su, qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev

On 10/9/19 9:57 AM, Simei Su wrote:
> This patch reserves several bits as input set selection from the
> high end of the 64 bits. It is combined with exisiting ETH_RSS_*
> to represent RSS types.
>
> 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_ethdev.c |  5 +++++
>   lib/librte_ethdev/rte_ethdev.h | 35 +++++++++++++++++++++++++++++++++++
>   2 files changed, 40 insertions(+)
>
> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index af82360..69f4133 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -1269,6 +1269,9 @@ struct rte_eth_dev *
>   		goto rollback;
>   	}
>   
> +	dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf =
> +		strip_out_src_dst_only(dev_conf->rx_adv_conf.rss_conf.rss_hf);
> +
>   	/* Check that device supports requested rss hash functions. */
>   	if ((dev_info.flow_type_rss_offloads |
>   	     dev_conf->rx_adv_conf.rss_conf.rss_hf) !=
> @@ -3112,6 +3115,8 @@ struct rte_eth_dev *
>   	if (ret != 0)
>   		return ret;
>   
> +	rss_conf->rss_hf = strip_out_src_dst_only(rss_conf->rss_hf);
> +
>   	dev = &rte_eth_devices[port_id];
>   	if ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) !=
>   	    dev_info.flow_type_rss_offloads) {
> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> index 7722f70..ef59ed5 100644
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -505,6 +505,20 @@ struct rte_eth_rss_conf {
>   #define ETH_RSS_GENEVE             (1ULL << 20)
>   #define ETH_RSS_NVGRE              (1ULL << 21)
>   
> +/*
> + * We use the following macros to combine with above ETH_RSS_* for
> + * more specific input set selection. These bits are defined starting
> + * from the high end of the 64 bits.
> + * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it represents
> + * both SRC and DST are taken into account. If SRC_ONLY and DST_ONLY of
> + * the same level are used simultaneously, it is the same case as none of
> + * them are added.
> + */
> +#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
> +#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
> +#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
> +#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
> +
>   #define ETH_RSS_IP ( \
>   	ETH_RSS_IPV4 | \
>   	ETH_RSS_FRAG_IPV4 | \
> @@ -4034,6 +4048,27 @@ int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id,
>   void *
>   rte_eth_dev_get_sec_ctx(uint16_t port_id);
>   
> +/**
> + * If SRC_ONLY and DST_ONLY of the same level are used
> + * simultaneously, it is the same case as none of them
> + * are added.
> + *
> + * @param rss_hf
> + *   RSS types with SRC/DST_ONLY.
> + * @return
> + *   RSS types.
> + */
> +static inline uint64_t
> +strip_out_src_dst_only(uint64_t rss_hf)

Inline function in public header without corresponding prefix is a bad idea.
Please, move it to C file and I think that inline should be removed.
Let the compiler do its job.

> +{
> +	if ((rss_hf & ETH_RSS_L3_SRC_ONLY) && (rss_hf & ETH_RSS_L3_DST_ONLY))
> +		rss_hf &= ~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY);
> +
> +	if ((rss_hf & ETH_RSS_L4_SRC_ONLY) && (rss_hf & ETH_RSS_L4_DST_ONLY))
> +		rss_hf &= ~(ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY);
> +
> +	return rss_hf;
> +}
>   
>   #include <rte_ethdev_core.h>
>   


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

* Re: [dpdk-dev] [PATCH v11 2/3] ethdev: extend RSS offload types
  2019-10-09  7:18                       ` Andrew Rybchenko
@ 2019-10-09  7:42                         ` Su, Simei
  2019-10-09  7:55                           ` Andrew Rybchenko
  0 siblings, 1 reply; 97+ messages in thread
From: Su, Simei @ 2019-10-09  7:42 UTC (permalink / raw)
  To: Andrew Rybchenko, Zhang, Qi Z, Ye, Xiaolong, Yigit, Ferruh; +Cc: dev

Hi, Andrew

> -----Original Message-----
> From: Andrew Rybchenko [mailto:arybchenko@solarflare.com]
> Sent: Wednesday, October 9, 2019 3:18 PM
> To: Su, Simei <simei.su@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Ye,
> Xiaolong <xiaolong.ye@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v11 2/3] ethdev: extend RSS offload types
> 
> On 10/9/19 9:57 AM, Simei Su wrote:
> > This patch reserves several bits as input set selection from the high
> > end of the 64 bits. It is combined with exisiting ETH_RSS_* to
> > represent RSS types.
> >
> > 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_ethdev.c |  5 +++++
> >   lib/librte_ethdev/rte_ethdev.h | 35
> +++++++++++++++++++++++++++++++++++
> >   2 files changed, 40 insertions(+)
> >
> > diff --git a/lib/librte_ethdev/rte_ethdev.c
> > b/lib/librte_ethdev/rte_ethdev.c index af82360..69f4133 100644
> > --- a/lib/librte_ethdev/rte_ethdev.c
> > +++ b/lib/librte_ethdev/rte_ethdev.c
> > @@ -1269,6 +1269,9 @@ struct rte_eth_dev *
> >   		goto rollback;
> >   	}
> >
> > +	dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf =
> > +		strip_out_src_dst_only(dev_conf->rx_adv_conf.rss_conf.rss_hf);
> > +
> >   	/* Check that device supports requested rss hash functions. */
> >   	if ((dev_info.flow_type_rss_offloads |
> >   	     dev_conf->rx_adv_conf.rss_conf.rss_hf) != @@ -3112,6 +3115,8
> > @@ struct rte_eth_dev *
> >   	if (ret != 0)
> >   		return ret;
> >
> > +	rss_conf->rss_hf = strip_out_src_dst_only(rss_conf->rss_hf);
> > +
> >   	dev = &rte_eth_devices[port_id];
> >   	if ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) !=
> >   	    dev_info.flow_type_rss_offloads) { diff --git
> > a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> > index 7722f70..ef59ed5 100644
> > --- a/lib/librte_ethdev/rte_ethdev.h
> > +++ b/lib/librte_ethdev/rte_ethdev.h
> > @@ -505,6 +505,20 @@ struct rte_eth_rss_conf {
> >   #define ETH_RSS_GENEVE             (1ULL << 20)
> >   #define ETH_RSS_NVGRE              (1ULL << 21)
> >
> > +/*
> > + * We use the following macros to combine with above ETH_RSS_* for
> > + * more specific input set selection. These bits are defined starting
> > + * from the high end of the 64 bits.
> > + * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it
> > +represents
> > + * both SRC and DST are taken into account. If SRC_ONLY and DST_ONLY
> > +of
> > + * the same level are used simultaneously, it is the same case as
> > +none of
> > + * them are added.
> > + */
> > +#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
> > +#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
> > +#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
> > +#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
> > +
> >   #define ETH_RSS_IP ( \
> >   	ETH_RSS_IPV4 | \
> >   	ETH_RSS_FRAG_IPV4 | \
> > @@ -4034,6 +4048,27 @@ int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t
> port_id,
> >   void *
> >   rte_eth_dev_get_sec_ctx(uint16_t port_id);
> >
> > +/**
> > + * If SRC_ONLY and DST_ONLY of the same level are used
> > + * simultaneously, it is the same case as none of them
> > + * are added.
> > + *
> > + * @param rss_hf
> > + *   RSS types with SRC/DST_ONLY.
> > + * @return
> > + *   RSS types.
> > + */
> > +static inline uint64_t
> > +strip_out_src_dst_only(uint64_t rss_hf)
> 
> Inline function in public header without corresponding prefix is a bad idea.
> Please, move it to C file and I think that inline should be removed.
> Let the compiler do its job.
> 

  Because I also need to check simultaneous use of SRC/DST_ONLY in PMD driver. 
  In order to call strip_out_src_dst_only() function directly in driver,
  I put it in header file and declare it as inline function.

> > +{
> > +	if ((rss_hf & ETH_RSS_L3_SRC_ONLY) && (rss_hf &
> ETH_RSS_L3_DST_ONLY))
> > +		rss_hf &= ~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY);
> > +
> > +	if ((rss_hf & ETH_RSS_L4_SRC_ONLY) && (rss_hf &
> ETH_RSS_L4_DST_ONLY))
> > +		rss_hf &= ~(ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY);
> > +
> > +	return rss_hf;
> > +}
> >
> >   #include <rte_ethdev_core.h>
> >


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

* Re: [dpdk-dev] [PATCH v11 2/3] ethdev: extend RSS offload types
  2019-10-09  7:42                         ` Su, Simei
@ 2019-10-09  7:55                           ` Andrew Rybchenko
  2019-10-09  9:08                             ` Su, Simei
  2019-10-09  9:32                             ` Zhang, Qi Z
  0 siblings, 2 replies; 97+ messages in thread
From: Andrew Rybchenko @ 2019-10-09  7:55 UTC (permalink / raw)
  To: Su, Simei, Zhang, Qi Z, Ye, Xiaolong, Yigit, Ferruh; +Cc: dev

On 10/9/19 10:42 AM, Su, Simei wrote:
> Hi, Andrew
>
>> -----Original Message-----
>> From: Andrew Rybchenko [mailto:arybchenko@solarflare.com]
>> Sent: Wednesday, October 9, 2019 3:18 PM
>> To: Su, Simei <simei.su@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Ye,
>> Xiaolong <xiaolong.ye@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
>> Cc: dev@dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH v11 2/3] ethdev: extend RSS offload types
>>
>> On 10/9/19 9:57 AM, Simei Su wrote:
>>> This patch reserves several bits as input set selection from the high
>>> end of the 64 bits. It is combined with exisiting ETH_RSS_* to
>>> represent RSS types.
>>>
>>> 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>

[snip]

>>> a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
>>> index 7722f70..ef59ed5 100644
>>> --- a/lib/librte_ethdev/rte_ethdev.h
>>> +++ b/lib/librte_ethdev/rte_ethdev.h
>>> @@ -4034,6 +4048,27 @@ int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id,
>>>    void *
>>>    rte_eth_dev_get_sec_ctx(uint16_t port_id);
>>>
>>> +/**
>>> + * If SRC_ONLY and DST_ONLY of the same level are used
>>> + * simultaneously, it is the same case as none of them
>>> + * are added.
>>> + *
>>> + * @param rss_hf
>>> + *   RSS types with SRC/DST_ONLY.
>>> + * @return
>>> + *   RSS types.
>>> + */
>>> +static inline uint64_t
>>> +strip_out_src_dst_only(uint64_t rss_hf)
>> Inline function in public header without corresponding prefix is a bad idea.
>> Please, move it to C file and I think that inline should be removed.
>> Let the compiler do its job.
>    Because I also need to check simultaneous use of SRC/DST_ONLY in PMD driver.
>    In order to call strip_out_src_dst_only() function directly in driver,
>    I put it in header file and declare it as inline function.

At bare minimum it should have rte_eth_dev_ prefix.
Also from the name it is not clear that it is about RSS etc.
Not sure why you need it in driver as well, hopefully I'll see.

Andrew.


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

* Re: [dpdk-dev] [PATCH v11 2/3] ethdev: extend RSS offload types
  2019-10-09  7:55                           ` Andrew Rybchenko
@ 2019-10-09  9:08                             ` Su, Simei
  2019-10-09  9:32                             ` Zhang, Qi Z
  1 sibling, 0 replies; 97+ messages in thread
From: Su, Simei @ 2019-10-09  9:08 UTC (permalink / raw)
  To: Andrew Rybchenko, Zhang, Qi Z, Ye, Xiaolong, Yigit, Ferruh; +Cc: dev

Hi, Andrew

> -----Original Message-----
> From: Andrew Rybchenko [mailto:arybchenko@solarflare.com]
> Sent: Wednesday, October 9, 2019 3:55 PM
> To: Su, Simei <simei.su@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Ye,
> Xiaolong <xiaolong.ye@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v11 2/3] ethdev: extend RSS offload types
> 
> On 10/9/19 10:42 AM, Su, Simei wrote:
> > Hi, Andrew
> >
> >> -----Original Message-----
> >> From: Andrew Rybchenko [mailto:arybchenko@solarflare.com]
> >> Sent: Wednesday, October 9, 2019 3:18 PM
> >> To: Su, Simei <simei.su@intel.com>; Zhang, Qi Z
> >> <qi.z.zhang@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>; Yigit,
> >> Ferruh <ferruh.yigit@intel.com>
> >> Cc: dev@dpdk.org
> >> Subject: Re: [dpdk-dev] [PATCH v11 2/3] ethdev: extend RSS offload
> >> types
> >>
> >> On 10/9/19 9:57 AM, Simei Su wrote:
> >>> This patch reserves several bits as input set selection from the
> >>> high end of the 64 bits. It is combined with exisiting ETH_RSS_* to
> >>> represent RSS types.
> >>>
> >>> 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>
> 
> [snip]
> 
> >>> a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> >>> index 7722f70..ef59ed5 100644
> >>> --- a/lib/librte_ethdev/rte_ethdev.h
> >>> +++ b/lib/librte_ethdev/rte_ethdev.h
> >>> @@ -4034,6 +4048,27 @@ int
> rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id,
> >>>    void *
> >>>    rte_eth_dev_get_sec_ctx(uint16_t port_id);
> >>>
> >>> +/**
> >>> + * If SRC_ONLY and DST_ONLY of the same level are used
> >>> + * simultaneously, it is the same case as none of them
> >>> + * are added.
> >>> + *
> >>> + * @param rss_hf
> >>> + *   RSS types with SRC/DST_ONLY.
> >>> + * @return
> >>> + *   RSS types.
> >>> + */
> >>> +static inline uint64_t
> >>> +strip_out_src_dst_only(uint64_t rss_hf)
> >> Inline function in public header without corresponding prefix is a bad idea.
> >> Please, move it to C file and I think that inline should be removed.
> >> Let the compiler do its job.
> >    Because I also need to check simultaneous use of SRC/DST_ONLY in PMD
> driver.
> >    In order to call strip_out_src_dst_only() function directly in driver,
> >    I put it in header file and declare it as inline function.
> 
> At bare minimum it should have rte_eth_dev_ prefix.
> Also from the name it is not clear that it is about RSS etc.
> Not sure why you need it in driver as well, hopefully I'll see.
> 
> Andrew.

I want to reuse it in hash filter, so just put it in public header but ignore rte_eth_dev_prefix and function name.
I reconsider it and think put it in C file is much better.
I will send the next version based on your advice.

As for need it in driver, because when creating a flow, PMD driver should check its RSS types of its own side. It has nothing to do with etherdev.

Br
Simei


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

* Re: [dpdk-dev] [PATCH v11 2/3] ethdev: extend RSS offload types
  2019-10-09  7:55                           ` Andrew Rybchenko
  2019-10-09  9:08                             ` Su, Simei
@ 2019-10-09  9:32                             ` Zhang, Qi Z
  2019-10-10 14:37                               ` Su, Simei
  1 sibling, 1 reply; 97+ messages in thread
From: Zhang, Qi Z @ 2019-10-09  9:32 UTC (permalink / raw)
  To: Andrew Rybchenko, Su, Simei, Ye, Xiaolong, Yigit, Ferruh; +Cc: dev



> -----Original Message-----
> From: Andrew Rybchenko [mailto:arybchenko@solarflare.com]
> Sent: Wednesday, October 9, 2019 3:55 PM
> To: Su, Simei <simei.su@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Ye,
> Xiaolong <xiaolong.ye@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v11 2/3] ethdev: extend RSS offload types
> 
> On 10/9/19 10:42 AM, Su, Simei wrote:
> > Hi, Andrew
> >
> >> -----Original Message-----
> >> From: Andrew Rybchenko [mailto:arybchenko@solarflare.com]
> >> Sent: Wednesday, October 9, 2019 3:18 PM
> >> To: Su, Simei <simei.su@intel.com>; Zhang, Qi Z
> >> <qi.z.zhang@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>; Yigit,
> >> Ferruh <ferruh.yigit@intel.com>
> >> Cc: dev@dpdk.org
> >> Subject: Re: [dpdk-dev] [PATCH v11 2/3] ethdev: extend RSS offload
> >> types
> >>
> >> On 10/9/19 9:57 AM, Simei Su wrote:
> >>> This patch reserves several bits as input set selection from the
> >>> high end of the 64 bits. It is combined with exisiting ETH_RSS_* to
> >>> represent RSS types.
> >>>
> >>> 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>
> 
> [snip]
> 
> >>> a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> >>> index 7722f70..ef59ed5 100644
> >>> --- a/lib/librte_ethdev/rte_ethdev.h
> >>> +++ b/lib/librte_ethdev/rte_ethdev.h
> >>> @@ -4034,6 +4048,27 @@ int
> rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id,
> >>>    void *
> >>>    rte_eth_dev_get_sec_ctx(uint16_t port_id);
> >>>
> >>> +/**
> >>> + * If SRC_ONLY and DST_ONLY of the same level are used
> >>> + * simultaneously, it is the same case as none of them
> >>> + * are added.
> >>> + *
> >>> + * @param rss_hf
> >>> + *   RSS types with SRC/DST_ONLY.
> >>> + * @return
> >>> + *   RSS types.
> >>> + */
> >>> +static inline uint64_t
> >>> +strip_out_src_dst_only(uint64_t rss_hf)
> >> Inline function in public header without corresponding prefix is a bad idea.
> >> Please, move it to C file and I think that inline should be removed.
> >> Let the compiler do its job.
> >    Because I also need to check simultaneous use of SRC/DST_ONLY in
> PMD driver.
> >    In order to call strip_out_src_dst_only() function directly in driver,
> >    I put it in header file and declare it as inline function.
> 
> At bare minimum it should have rte_eth_dev_ prefix.
> Also from the name it is not clear that it is about RSS etc.
> Not sure why you need it in driver as well, hopefully I'll see.

The consideration is when handle rte_flow_action_rss, we still need to strip it out since this route will bypass the dev_configure or rss_update 
So there are two options
1, strip out at rte_flow_create , this relief all the PMDs, but code looks a little bit strange.
2. handled by PMD themselves 

Anyway both of the cases need this helper function be exposed by rte_ethdev.h, maybe we can define a macro named RTE_ETH_RSS_HF_REFINE?

Regards
Qi 
> 
> Andrew.


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

* Re: [dpdk-dev] [PATCH v11 2/3] ethdev: extend RSS offload types
  2019-10-09  9:32                             ` Zhang, Qi Z
@ 2019-10-10 14:37                               ` Su, Simei
  0 siblings, 0 replies; 97+ messages in thread
From: Su, Simei @ 2019-10-10 14:37 UTC (permalink / raw)
  To: Zhang, Qi Z, Andrew Rybchenko, Ye, Xiaolong, Yigit, Ferruh; +Cc: dev

Hi, Andrew

> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Wednesday, October 9, 2019 5:32 PM
> To: Andrew Rybchenko <arybchenko@solarflare.com>; Su, Simei
> <simei.su@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>; Yigit, Ferruh
> <ferruh.yigit@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH v11 2/3] ethdev: extend RSS offload types
> 
> 
> 
> > -----Original Message-----
> > From: Andrew Rybchenko [mailto:arybchenko@solarflare.com]
> > Sent: Wednesday, October 9, 2019 3:55 PM
> > To: Su, Simei <simei.su@intel.com>; Zhang, Qi Z
> > <qi.z.zhang@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>; Yigit,
> > Ferruh <ferruh.yigit@intel.com>
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH v11 2/3] ethdev: extend RSS offload
> > types
> >
> > On 10/9/19 10:42 AM, Su, Simei wrote:
> > > Hi, Andrew
> > >
> > >> -----Original Message-----
> > >> From: Andrew Rybchenko [mailto:arybchenko@solarflare.com]
> > >> Sent: Wednesday, October 9, 2019 3:18 PM
> > >> To: Su, Simei <simei.su@intel.com>; Zhang, Qi Z
> > >> <qi.z.zhang@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>;
> > >> Yigit, Ferruh <ferruh.yigit@intel.com>
> > >> Cc: dev@dpdk.org
> > >> Subject: Re: [dpdk-dev] [PATCH v11 2/3] ethdev: extend RSS offload
> > >> types
> > >>
> > >> On 10/9/19 9:57 AM, Simei Su wrote:
> > >>> This patch reserves several bits as input set selection from the
> > >>> high end of the 64 bits. It is combined with exisiting ETH_RSS_*
> > >>> to represent RSS types.
> > >>>
> > >>> 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>
> >
> > [snip]
> >
> > >>> a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> > >>> index 7722f70..ef59ed5 100644
> > >>> --- a/lib/librte_ethdev/rte_ethdev.h
> > >>> +++ b/lib/librte_ethdev/rte_ethdev.h
> > >>> @@ -4034,6 +4048,27 @@ int
> > rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id,
> > >>>    void *
> > >>>    rte_eth_dev_get_sec_ctx(uint16_t port_id);
> > >>>
> > >>> +/**
> > >>> + * If SRC_ONLY and DST_ONLY of the same level are used
> > >>> + * simultaneously, it is the same case as none of them
> > >>> + * are added.
> > >>> + *
> > >>> + * @param rss_hf
> > >>> + *   RSS types with SRC/DST_ONLY.
> > >>> + * @return
> > >>> + *   RSS types.
> > >>> + */
> > >>> +static inline uint64_t
> > >>> +strip_out_src_dst_only(uint64_t rss_hf)
> > >> Inline function in public header without corresponding prefix is a bad idea.
> > >> Please, move it to C file and I think that inline should be removed.
> > >> Let the compiler do its job.
> > >    Because I also need to check simultaneous use of SRC/DST_ONLY in
> > PMD driver.
> > >    In order to call strip_out_src_dst_only() function directly in driver,
> > >    I put it in header file and declare it as inline function.
> >
> > At bare minimum it should have rte_eth_dev_ prefix.
> > Also from the name it is not clear that it is about RSS etc.
> > Not sure why you need it in driver as well, hopefully I'll see.
> 
> The consideration is when handle rte_flow_action_rss, we still need to strip it out
> since this route will bypass the dev_configure or rss_update So there are two
> options 1, strip out at rte_flow_create , this relief all the PMDs, but code looks a
> little bit strange.
> 2. handled by PMD themselves
> 
> Anyway both of the cases need this helper function be exposed by rte_ethdev.h,
> maybe we can define a macro named RTE_ETH_RSS_HF_REFINE?
> 
> Regards
> Qi

What advice do you have for above proposal or do you have a better suggestion? Thanks!

Br
Simei
> >
> > Andrew.


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

* [dpdk-dev] [PATCH v12 0/3] extend RSS offload types
  2019-10-09  6:57                   ` [dpdk-dev] [PATCH v11 0/3] extend RSS offload types Simei Su
                                       ` (2 preceding siblings ...)
  2019-10-09  6:57                     ` [dpdk-dev] [PATCH v11 3/3] app/testpmd: add RSS offload types extending support Simei Su
@ 2019-10-14 13:36                     ` Simei Su
  2019-10-14 13:36                       ` [dpdk-dev] [PATCH v12 1/3] ethdev: decouple flow types and " Simei Su
                                         ` (3 more replies)
  3 siblings, 4 replies; 97+ messages in thread
From: Simei Su @ 2019-10-14 13:36 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

[PATCH v12 1/3] ethdev: decouple flow types and RSS offload types.
[PATCH v12 2/3] ethdev: add several bits for extending rss offload types.
[PATCH v12 3/3] app/testpmd: add cmdline support for extending rss types.

v12:
* Use a macro to replace a function.

v11:
* Update code logic in rte_eth_dev_configure() and
  rte_eth_dev_rss_hash_update().

v10:
* Modify duplicate logic in rte_eth_dev_configure() and
  rte_eth_dev_rss_hash_update().

v9:
* Fix code style.
* Delete duplicate logic in rte_eth_dev_configure().

v8:
* Add to check the simultaneous use of SRC/DST_ONLY of the same level
  in rte_eth_dev_rss_hash_update() and rte_eth_dev_configure().
* Update code comments.

v7:
* Supplement related configuration for new flag in app/test-pmd/cmdline.c.

v6:
* Add the new flag in app/test-pmd/cmdline.c.

v5:
* Update code comments.

v4:
* Divide one patch into two patches.
* Delete ETH_RSS_L2_SRC/DST_ONLY.

v3:
* Update code comments and code style.

v2:
* Update code comments.

Simei Su (3):
  ethdev: decouple flow types and RSS offload types
  ethdev: extend RSS offload types
  app/testpmd: add RSS offload types extending support

 app/test-pmd/cmdline.c         | 14 ++++++--
 app/test-pmd/config.c          |  4 +++
 lib/librte_ethdev/rte_ethdev.c |  5 +++
 lib/librte_ethdev/rte_ethdev.h | 76 +++++++++++++++++++++++++++---------------
 4 files changed, 70 insertions(+), 29 deletions(-)

-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v12 1/3] ethdev: decouple flow types and RSS offload types
  2019-10-14 13:36                     ` [dpdk-dev] [PATCH v12 0/3] extend RSS offload types Simei Su
@ 2019-10-14 13:36                       ` " Simei Su
  2019-10-14 13:36                       ` [dpdk-dev] [PATCH v12 2/3] ethdev: extend " Simei Su
                                         ` (2 subsequent siblings)
  3 siblings, 0 replies; 97+ messages in thread
From: Simei Su @ 2019-10-14 13:36 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch decouples RTE_ETH_FLOW_* and ETH_RSS_*. The former defines
flow types and the latter defines RSS offload types.

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_ethdev.h | 51 ++++++++++++++++++++----------------------
 1 file changed, 24 insertions(+), 27 deletions(-)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index c26abe2..40aa6a3 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -453,7 +453,6 @@ struct rte_eth_rss_conf {
  * possible, and exclusively. For example, if a packet is identified as
  * 'RTE_ETH_FLOW_NONFRAG_IPV4_TCP', it will not be any of other flow types,
  * though it is an actual IPV4 packet.
- * Note that the flow types are used to define RSS offload types.
  */
 #define RTE_ETH_FLOW_UNKNOWN             0
 #define RTE_ETH_FLOW_RAW                 1
@@ -483,32 +482,30 @@ struct rte_eth_rss_conf {
 #define RTE_ETH_FLOW_MAX                24
 
 /*
- * The RSS offload types are defined based on flow types.
- * Different NIC hardware may support different RSS offload
- * types. The supported flow types or RSS offload types can be queried by
- * rte_eth_dev_info_get().
- */
-#define ETH_RSS_IPV4               (1ULL << RTE_ETH_FLOW_IPV4)
-#define ETH_RSS_FRAG_IPV4          (1ULL << RTE_ETH_FLOW_FRAG_IPV4)
-#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
-#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
-#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP)
-#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
-#define ETH_RSS_IPV6               (1ULL << RTE_ETH_FLOW_IPV6)
-#define ETH_RSS_FRAG_IPV6          (1ULL << RTE_ETH_FLOW_FRAG_IPV6)
-#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
-#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
-#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP)
-#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
-#define ETH_RSS_L2_PAYLOAD         (1ULL << RTE_ETH_FLOW_L2_PAYLOAD)
-#define ETH_RSS_IPV6_EX            (1ULL << RTE_ETH_FLOW_IPV6_EX)
-#define ETH_RSS_IPV6_TCP_EX        (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
-#define ETH_RSS_IPV6_UDP_EX        (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
-#define ETH_RSS_PORT               (1ULL << RTE_ETH_FLOW_PORT)
-#define ETH_RSS_VXLAN              (1ULL << RTE_ETH_FLOW_VXLAN)
-#define ETH_RSS_GENEVE             (1ULL << RTE_ETH_FLOW_GENEVE)
-#define ETH_RSS_NVGRE              (1ULL << RTE_ETH_FLOW_NVGRE)
-#define ETH_RSS_GTPU               (1ULL << RTE_ETH_FLOW_GTPU)
+ * Below macros are defined for RSS offload types, they can be used to
+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
+ */
+#define ETH_RSS_IPV4               (1ULL << 2)
+#define ETH_RSS_FRAG_IPV4          (1ULL << 3)
+#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << 4)
+#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << 5)
+#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << 6)
+#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << 7)
+#define ETH_RSS_IPV6               (1ULL << 8)
+#define ETH_RSS_FRAG_IPV6          (1ULL << 9)
+#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << 10)
+#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << 11)
+#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << 12)
+#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << 13)
+#define ETH_RSS_L2_PAYLOAD         (1ULL << 14)
+#define ETH_RSS_IPV6_EX            (1ULL << 15)
+#define ETH_RSS_IPV6_TCP_EX        (1ULL << 16)
+#define ETH_RSS_IPV6_UDP_EX        (1ULL << 17)
+#define ETH_RSS_PORT               (1ULL << 18)
+#define ETH_RSS_VXLAN              (1ULL << 19)
+#define ETH_RSS_GENEVE             (1ULL << 20)
+#define ETH_RSS_NVGRE              (1ULL << 21)
+#define ETH_RSS_GTPU               (1ULL << 23)
 
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v12 2/3] ethdev: extend RSS offload types
  2019-10-14 13:36                     ` [dpdk-dev] [PATCH v12 0/3] extend RSS offload types Simei Su
  2019-10-14 13:36                       ` [dpdk-dev] [PATCH v12 1/3] ethdev: decouple flow types and " Simei Su
@ 2019-10-14 13:36                       ` " Simei Su
  2019-10-15  9:07                         ` Andrew Rybchenko
  2019-10-14 13:36                       ` [dpdk-dev] [PATCH v12 3/3] app/testpmd: add RSS offload types extending support Simei Su
  2019-10-15 12:56                       ` [dpdk-dev] [PATCH v13 0/3] extend RSS offload types Simei Su
  3 siblings, 1 reply; 97+ messages in thread
From: Simei Su @ 2019-10-14 13:36 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch reserves several bits as input set selection from the
high end of the 64 bits. It is combined with exisiting ETH_RSS_*
to represent RSS types. This patch also checks the simultaneous
use of SRC_ONLY and DST_ONLY of the same level.

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_ethdev.c |  5 +++++
 lib/librte_ethdev/rte_ethdev.h | 25 +++++++++++++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 7caaa0b..69a3d71 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -1269,6 +1269,9 @@ struct rte_eth_dev *
 		goto rollback;
 	}
 
+	RTE_ETH_RSS_HF_REFINE(dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf,
+				dev_conf->rx_adv_conf.rss_conf.rss_hf);
+
 	/* Check that device supports requested rss hash functions. */
 	if ((dev_info.flow_type_rss_offloads |
 	     dev_conf->rx_adv_conf.rss_conf.rss_hf) !=
@@ -3112,6 +3115,8 @@ struct rte_eth_dev *
 	if (ret != 0)
 		return ret;
 
+	RTE_ETH_RSS_HF_REFINE(rss_conf->rss_hf, rss_conf->rss_hf);
+
 	dev = &rte_eth_devices[port_id];
 	if ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) !=
 	    dev_info.flow_type_rss_offloads) {
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 40aa6a3..389a3e6 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -165,6 +165,17 @@
 #define RTE_ETHDEV_LOG(level, ...) \
 	rte_log(RTE_LOG_ ## level, rte_eth_dev_logtype, "" __VA_ARGS__)
 
+#define RTE_ETH_RSS_HF_REFINE(output, input) do {         \
+	if ((input & ETH_RSS_L3_SRC_ONLY) &&              \
+		(input & ETH_RSS_L3_DST_ONLY))            \
+		output = input & (~(ETH_RSS_L3_SRC_ONLY | \
+			ETH_RSS_L3_DST_ONLY));            \
+	if ((input & ETH_RSS_L4_SRC_ONLY) &&              \
+		(input & ETH_RSS_L4_DST_ONLY))            \
+		output = input & (~(ETH_RSS_L4_SRC_ONLY | \
+			ETH_RSS_L4_DST_ONLY));            \
+} while (0)
+
 struct rte_mbuf;
 
 /**
@@ -507,6 +518,20 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_NVGRE              (1ULL << 21)
 #define ETH_RSS_GTPU               (1ULL << 23)
 
+/*
+ * We use the following macros to combine with above ETH_RSS_* for
+ * more specific input set selection. These bits are defined starting
+ * from the high end of the 64 bits.
+ * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it represents
+ * both SRC and DST are taken into account. If SRC_ONLY and DST_ONLY of
+ * the same level are used simultaneously, it is the same case as none of
+ * them are added.
+ */
+#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
+#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
+#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
+#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
+
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
 	ETH_RSS_FRAG_IPV4 | \
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v12 3/3] app/testpmd: add RSS offload types extending support
  2019-10-14 13:36                     ` [dpdk-dev] [PATCH v12 0/3] extend RSS offload types Simei Su
  2019-10-14 13:36                       ` [dpdk-dev] [PATCH v12 1/3] ethdev: decouple flow types and " Simei Su
  2019-10-14 13:36                       ` [dpdk-dev] [PATCH v12 2/3] ethdev: extend " Simei Su
@ 2019-10-14 13:36                       ` Simei Su
  2019-10-15 12:56                       ` [dpdk-dev] [PATCH v13 0/3] extend RSS offload types Simei Su
  3 siblings, 0 replies; 97+ messages in thread
From: Simei Su @ 2019-10-14 13:36 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch adds cmdline support for extended rss types configuration.

Signed-off-by: Simei Su <simei.su@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
---
 app/test-pmd/cmdline.c | 14 ++++++++++++--
 app/test-pmd/config.c  |  4 ++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 427eb30..6b5602d 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2212,6 +2212,14 @@ struct cmd_config_rss {
 		rss_conf.rss_hf = ETH_RSS_GENEVE;
 	else if (!strcmp(res->value, "nvgre"))
 		rss_conf.rss_hf = ETH_RSS_NVGRE;
+	else if (!strcmp(res->value, "l3-src-only"))
+		rss_conf.rss_hf = ETH_RSS_L3_SRC_ONLY;
+	else if (!strcmp(res->value, "l3-dst-only"))
+		rss_conf.rss_hf = ETH_RSS_L3_DST_ONLY;
+	else if (!strcmp(res->value, "l4-src-only"))
+		rss_conf.rss_hf = ETH_RSS_L4_SRC_ONLY;
+	else if (!strcmp(res->value, "l4-dst-only"))
+		rss_conf.rss_hf = ETH_RSS_L4_DST_ONLY;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "default"))
@@ -2379,7 +2387,8 @@ struct cmd_config_rss_hash_key {
 				 "ipv4#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#"
 				 "ipv4-other#ipv6#ipv6-frag#ipv6-tcp#ipv6-udp#"
 				 "ipv6-sctp#ipv6-other#l2-payload#ipv6-ex#"
-				 "ipv6-tcp-ex#ipv6-udp-ex");
+				 "ipv6-tcp-ex#ipv6-udp-ex#"
+				 "l3-src-only#l3-dst-only#l4-src-only#l4-dst-only");
 cmdline_parse_token_string_t cmd_config_rss_hash_key_value =
 	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);
 
@@ -2389,7 +2398,8 @@ struct cmd_config_rss_hash_key {
 	.help_str = "port config <port_id> rss-hash-key "
 		"ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|"
 		"ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|"
-		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex "
+		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
+		"l3-src-only|l3-dst-only|l4-src-only|l4-dst-only "
 		"<string of hex digits (variable length, NIC dependent)>",
 	.tokens = {
 		(void *)&cmd_config_rss_hash_key_port,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 8035961..1d2a97d 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -103,6 +103,10 @@
 	{ "tcp", ETH_RSS_TCP },
 	{ "sctp", ETH_RSS_SCTP },
 	{ "tunnel", ETH_RSS_TUNNEL },
+	{ "l3-src-only", ETH_RSS_L3_SRC_ONLY },
+	{ "l3-dst-only", ETH_RSS_L3_DST_ONLY },
+	{ "l4-src-only", ETH_RSS_L4_SRC_ONLY },
+	{ "l4-dst-only", ETH_RSS_L4_DST_ONLY },
 	{ NULL, 0 },
 };
 
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH v12 2/3] ethdev: extend RSS offload types
  2019-10-14 13:36                       ` [dpdk-dev] [PATCH v12 2/3] ethdev: extend " Simei Su
@ 2019-10-15  9:07                         ` Andrew Rybchenko
  2019-10-15 10:55                           ` Su, Simei
  0 siblings, 1 reply; 97+ messages in thread
From: Andrew Rybchenko @ 2019-10-15  9:07 UTC (permalink / raw)
  To: Simei Su, qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev

On 10/14/19 4:36 PM, Simei Su wrote:
> This patch reserves several bits as input set selection from the
> high end of the 64 bits. It is combined with exisiting ETH_RSS_*
> to represent RSS types. This patch also checks the simultaneous
> use of SRC_ONLY and DST_ONLY of the same level.
>
> 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_ethdev.c |  5 +++++
>   lib/librte_ethdev/rte_ethdev.h | 25 +++++++++++++++++++++++++
>   2 files changed, 30 insertions(+)
>
> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index 7caaa0b..69a3d71 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -1269,6 +1269,9 @@ struct rte_eth_dev *
>   		goto rollback;
>   	}
>   
> +	RTE_ETH_RSS_HF_REFINE(dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf,
> +				dev_conf->rx_adv_conf.rss_conf.rss_hf);
> +
>   	/* Check that device supports requested rss hash functions. */
>   	if ((dev_info.flow_type_rss_offloads |
>   	     dev_conf->rx_adv_conf.rss_conf.rss_hf) !=
> @@ -3112,6 +3115,8 @@ struct rte_eth_dev *
>   	if (ret != 0)
>   		return ret;
>   
> +	RTE_ETH_RSS_HF_REFINE(rss_conf->rss_hf, rss_conf->rss_hf);
> +
>   	dev = &rte_eth_devices[port_id];
>   	if ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) !=
>   	    dev_info.flow_type_rss_offloads) {
> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> index 40aa6a3..389a3e6 100644
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -165,6 +165,17 @@
>   #define RTE_ETHDEV_LOG(level, ...) \
>   	rte_log(RTE_LOG_ ## level, rte_eth_dev_logtype, "" __VA_ARGS__)
>   
> +#define RTE_ETH_RSS_HF_REFINE(output, input) do {         \
> +	if ((input & ETH_RSS_L3_SRC_ONLY) &&              \
> +		(input & ETH_RSS_L3_DST_ONLY))            \
> +		output = input & (~(ETH_RSS_L3_SRC_ONLY | \
> +			ETH_RSS_L3_DST_ONLY));            \
> +	if ((input & ETH_RSS_L4_SRC_ONLY) &&              \
> +		(input & ETH_RSS_L4_DST_ONLY))            \
> +		output = input & (~(ETH_RSS_L4_SRC_ONLY | \
> +			ETH_RSS_L4_DST_ONLY));            \
> +} while (0)
> +
>   struct rte_mbuf;
>   
>   /**

Sorry, I missed why macro is used. Inline function is better and
easier to read since macros which modify one of its parameters
are very error-prone.


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

* Re: [dpdk-dev] [PATCH v12 2/3] ethdev: extend RSS offload types
  2019-10-15  9:07                         ` Andrew Rybchenko
@ 2019-10-15 10:55                           ` Su, Simei
  2019-10-15 11:09                             ` Andrew Rybchenko
  0 siblings, 1 reply; 97+ messages in thread
From: Su, Simei @ 2019-10-15 10:55 UTC (permalink / raw)
  To: Andrew Rybchenko, Zhang, Qi Z, Ye, Xiaolong, Yigit, Ferruh; +Cc: dev

Hi, Andrew

> -----Original Message-----
> From: Andrew Rybchenko [mailto:arybchenko@solarflare.com]
> Sent: Tuesday, October 15, 2019 5:08 PM
> To: Su, Simei <simei.su@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Ye,
> Xiaolong <xiaolong.ye@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v12 2/3] ethdev: extend RSS offload types
> 
> On 10/14/19 4:36 PM, Simei Su wrote:
> > This patch reserves several bits as input set selection from the high
> > end of the 64 bits. It is combined with exisiting ETH_RSS_* to
> > represent RSS types. This patch also checks the simultaneous use of
> > SRC_ONLY and DST_ONLY of the same level.
> >
> > 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_ethdev.c |  5 +++++
> >   lib/librte_ethdev/rte_ethdev.h | 25 +++++++++++++++++++++++++
> >   2 files changed, 30 insertions(+)
> >
> > diff --git a/lib/librte_ethdev/rte_ethdev.c
> > b/lib/librte_ethdev/rte_ethdev.c index 7caaa0b..69a3d71 100644
> > --- a/lib/librte_ethdev/rte_ethdev.c
> > +++ b/lib/librte_ethdev/rte_ethdev.c
> > @@ -1269,6 +1269,9 @@ struct rte_eth_dev *
> >   		goto rollback;
> >   	}
> >
> > +
> 	RTE_ETH_RSS_HF_REFINE(dev->data->dev_conf.rx_adv_conf.rss_conf.rss_
> hf,
> > +				dev_conf->rx_adv_conf.rss_conf.rss_hf);
> > +
> >   	/* Check that device supports requested rss hash functions. */
> >   	if ((dev_info.flow_type_rss_offloads |
> >   	     dev_conf->rx_adv_conf.rss_conf.rss_hf) != @@ -3112,6 +3115,8
> > @@ struct rte_eth_dev *
> >   	if (ret != 0)
> >   		return ret;
> >
> > +	RTE_ETH_RSS_HF_REFINE(rss_conf->rss_hf, rss_conf->rss_hf);
> > +
> >   	dev = &rte_eth_devices[port_id];
> >   	if ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) !=
> >   	    dev_info.flow_type_rss_offloads) { diff --git
> > a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> > index 40aa6a3..389a3e6 100644
> > --- a/lib/librte_ethdev/rte_ethdev.h
> > +++ b/lib/librte_ethdev/rte_ethdev.h
> > @@ -165,6 +165,17 @@
> >   #define RTE_ETHDEV_LOG(level, ...) \
> >   	rte_log(RTE_LOG_ ## level, rte_eth_dev_logtype, "" __VA_ARGS__)
> >
> > +#define RTE_ETH_RSS_HF_REFINE(output, input) do {         \
> > +	if ((input & ETH_RSS_L3_SRC_ONLY) &&              \
> > +		(input & ETH_RSS_L3_DST_ONLY))            \
> > +		output = input & (~(ETH_RSS_L3_SRC_ONLY | \
> > +			ETH_RSS_L3_DST_ONLY));            \
> > +	if ((input & ETH_RSS_L4_SRC_ONLY) &&              \
> > +		(input & ETH_RSS_L4_DST_ONLY))            \
> > +		output = input & (~(ETH_RSS_L4_SRC_ONLY | \
> > +			ETH_RSS_L4_DST_ONLY));            \
> > +} while (0)
> > +
> >   struct rte_mbuf;
> >
> >   /**
> 
> Sorry, I missed why macro is used. Inline function is better and easier to read
> since macros which modify one of its parameters are very error-prone.

The history is
[Qi] The consideration is when handle rte_flow_action_rss, we still need to strip it out since this route will bypass the dev_configure or rss_update So there are two options 1, strip out at rte_flow_create , this relief all the PMDs, but code looks a little bit strange.
2. handled by PMD themselves 
Anyway both of the cases need this helper function be exposed by rte_ethdev.h, maybe we can define a macro named RTE_ETH_RSS_HF_REFINE?

So I try to use a macro to replace the function of strip_out_src_dst_only. Now, there are two options:
(1)define a macro in rte_ethdev.h, just like above patch.
(2)define an inline function "rte_eth_rss_strip_out_src_dst_only" in rte_ethdev.h.
What do you think? Thanks!

Br
Simei

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

* Re: [dpdk-dev] [PATCH v12 2/3] ethdev: extend RSS offload types
  2019-10-15 10:55                           ` Su, Simei
@ 2019-10-15 11:09                             ` Andrew Rybchenko
  2019-10-15 11:21                               ` Su, Simei
  0 siblings, 1 reply; 97+ messages in thread
From: Andrew Rybchenko @ 2019-10-15 11:09 UTC (permalink / raw)
  To: Su, Simei, Zhang, Qi Z, Ye, Xiaolong, Yigit, Ferruh; +Cc: dev

On 10/15/19 1:55 PM, Su, Simei wrote:
> Hi, Andrew
>
>> -----Original Message-----
>> From: Andrew Rybchenko [mailto:arybchenko@solarflare.com]
>> Sent: Tuesday, October 15, 2019 5:08 PM
>> To: Su, Simei <simei.su@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Ye,
>> Xiaolong <xiaolong.ye@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
>> Cc: dev@dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH v12 2/3] ethdev: extend RSS offload types
>>
>> On 10/14/19 4:36 PM, Simei Su wrote:
>>> This patch reserves several bits as input set selection from the high
>>> end of the 64 bits. It is combined with exisiting ETH_RSS_* to
>>> represent RSS types. This patch also checks the simultaneous use of
>>> SRC_ONLY and DST_ONLY of the same level.
>>>
>>> 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_ethdev.c |  5 +++++
>>>    lib/librte_ethdev/rte_ethdev.h | 25 +++++++++++++++++++++++++
>>>    2 files changed, 30 insertions(+)
>>>
>>> diff --git a/lib/librte_ethdev/rte_ethdev.c
>>> b/lib/librte_ethdev/rte_ethdev.c index 7caaa0b..69a3d71 100644
>>> --- a/lib/librte_ethdev/rte_ethdev.c
>>> +++ b/lib/librte_ethdev/rte_ethdev.c
>>> @@ -1269,6 +1269,9 @@ struct rte_eth_dev *
>>>    		goto rollback;
>>>    	}
>>>
>>> +
>> 	RTE_ETH_RSS_HF_REFINE(dev->data->dev_conf.rx_adv_conf.rss_conf.rss_
>> hf,
>>> +				dev_conf->rx_adv_conf.rss_conf.rss_hf);
>>> +
>>>    	/* Check that device supports requested rss hash functions. */
>>>    	if ((dev_info.flow_type_rss_offloads |
>>>    	     dev_conf->rx_adv_conf.rss_conf.rss_hf) != @@ -3112,6 +3115,8
>>> @@ struct rte_eth_dev *
>>>    	if (ret != 0)
>>>    		return ret;
>>>
>>> +	RTE_ETH_RSS_HF_REFINE(rss_conf->rss_hf, rss_conf->rss_hf);
>>> +
>>>    	dev = &rte_eth_devices[port_id];
>>>    	if ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) !=
>>>    	    dev_info.flow_type_rss_offloads) { diff --git
>>> a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
>>> index 40aa6a3..389a3e6 100644
>>> --- a/lib/librte_ethdev/rte_ethdev.h
>>> +++ b/lib/librte_ethdev/rte_ethdev.h
>>> @@ -165,6 +165,17 @@
>>>    #define RTE_ETHDEV_LOG(level, ...) \
>>>    	rte_log(RTE_LOG_ ## level, rte_eth_dev_logtype, "" __VA_ARGS__)
>>>
>>> +#define RTE_ETH_RSS_HF_REFINE(output, input) do {         \
>>> +	if ((input & ETH_RSS_L3_SRC_ONLY) &&              \
>>> +		(input & ETH_RSS_L3_DST_ONLY))            \
>>> +		output = input & (~(ETH_RSS_L3_SRC_ONLY | \
>>> +			ETH_RSS_L3_DST_ONLY));            \
>>> +	if ((input & ETH_RSS_L4_SRC_ONLY) &&              \
>>> +		(input & ETH_RSS_L4_DST_ONLY))            \
>>> +		output = input & (~(ETH_RSS_L4_SRC_ONLY | \
>>> +			ETH_RSS_L4_DST_ONLY));            \
>>> +} while (0)
>>> +
>>>    struct rte_mbuf;
>>>
>>>    /**
>> Sorry, I missed why macro is used. Inline function is better and easier to read
>> since macros which modify one of its parameters are very error-prone.
> The history is
> [Qi] The consideration is when handle rte_flow_action_rss, we still need to strip it out since this route will bypass the dev_configure or rss_update So there are two options 1, strip out at rte_flow_create , this relief all the PMDs, but code looks a little bit strange.
> 2. handled by PMD themselves
> Anyway both of the cases need this helper function be exposed by rte_ethdev.h, maybe we can define a macro named RTE_ETH_RSS_HF_REFINE?
>
> So I try to use a macro to replace the function of strip_out_src_dst_only. Now, there are two options:
> (1)define a macro in rte_ethdev.h, just like above patch.
> (2)define an inline function "rte_eth_rss_strip_out_src_dst_only" in rte_ethdev.h.
> What do you think? Thanks!

May be inline function rte_eth_rss_hf_refine()?


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

* Re: [dpdk-dev] [PATCH v12 2/3] ethdev: extend RSS offload types
  2019-10-15 11:09                             ` Andrew Rybchenko
@ 2019-10-15 11:21                               ` Su, Simei
  0 siblings, 0 replies; 97+ messages in thread
From: Su, Simei @ 2019-10-15 11:21 UTC (permalink / raw)
  To: Andrew Rybchenko, Zhang, Qi Z, Ye, Xiaolong, Yigit, Ferruh; +Cc: dev

Andrew, thanks for your patient guidance.
I will send the next version based on your advice.

> -----Original Message-----
> From: Andrew Rybchenko [mailto:arybchenko@solarflare.com]
> Sent: Tuesday, October 15, 2019 7:09 PM
> To: Su, Simei <simei.su@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Ye,
> Xiaolong <xiaolong.ye@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v12 2/3] ethdev: extend RSS offload types
> 
> On 10/15/19 1:55 PM, Su, Simei wrote:
> > Hi, Andrew
> >
> >> -----Original Message-----
> >> From: Andrew Rybchenko [mailto:arybchenko@solarflare.com]
> >> Sent: Tuesday, October 15, 2019 5:08 PM
> >> To: Su, Simei <simei.su@intel.com>; Zhang, Qi Z
> >> <qi.z.zhang@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>; Yigit,
> >> Ferruh <ferruh.yigit@intel.com>
> >> Cc: dev@dpdk.org
> >> Subject: Re: [dpdk-dev] [PATCH v12 2/3] ethdev: extend RSS offload
> >> types
> >>
> >> On 10/14/19 4:36 PM, Simei Su wrote:
> >>> This patch reserves several bits as input set selection from the
> >>> high end of the 64 bits. It is combined with exisiting ETH_RSS_* to
> >>> represent RSS types. This patch also checks the simultaneous use of
> >>> SRC_ONLY and DST_ONLY of the same level.
> >>>
> >>> 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_ethdev.c |  5 +++++
> >>>    lib/librte_ethdev/rte_ethdev.h | 25 +++++++++++++++++++++++++
> >>>    2 files changed, 30 insertions(+)
> >>>
> >>> diff --git a/lib/librte_ethdev/rte_ethdev.c
> >>> b/lib/librte_ethdev/rte_ethdev.c index 7caaa0b..69a3d71 100644
> >>> --- a/lib/librte_ethdev/rte_ethdev.c
> >>> +++ b/lib/librte_ethdev/rte_ethdev.c
> >>> @@ -1269,6 +1269,9 @@ struct rte_eth_dev *
> >>>    		goto rollback;
> >>>    	}
> >>>
> >>> +
> >> 	RTE_ETH_RSS_HF_REFINE(dev->data->dev_conf.rx_adv_conf.rss_conf.rss_
> >> hf,
> >>> +				dev_conf->rx_adv_conf.rss_conf.rss_hf);
> >>> +
> >>>    	/* Check that device supports requested rss hash functions. */
> >>>    	if ((dev_info.flow_type_rss_offloads |
> >>>    	     dev_conf->rx_adv_conf.rss_conf.rss_hf) != @@ -3112,6
> >>> +3115,8 @@ struct rte_eth_dev *
> >>>    	if (ret != 0)
> >>>    		return ret;
> >>>
> >>> +	RTE_ETH_RSS_HF_REFINE(rss_conf->rss_hf, rss_conf->rss_hf);
> >>> +
> >>>    	dev = &rte_eth_devices[port_id];
> >>>    	if ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) !=
> >>>    	    dev_info.flow_type_rss_offloads) { diff --git
> >>> a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> >>> index 40aa6a3..389a3e6 100644
> >>> --- a/lib/librte_ethdev/rte_ethdev.h
> >>> +++ b/lib/librte_ethdev/rte_ethdev.h
> >>> @@ -165,6 +165,17 @@
> >>>    #define RTE_ETHDEV_LOG(level, ...) \
> >>>    	rte_log(RTE_LOG_ ## level, rte_eth_dev_logtype, "" __VA_ARGS__)
> >>>
> >>> +#define RTE_ETH_RSS_HF_REFINE(output, input) do {         \
> >>> +	if ((input & ETH_RSS_L3_SRC_ONLY) &&              \
> >>> +		(input & ETH_RSS_L3_DST_ONLY))            \
> >>> +		output = input & (~(ETH_RSS_L3_SRC_ONLY | \
> >>> +			ETH_RSS_L3_DST_ONLY));            \
> >>> +	if ((input & ETH_RSS_L4_SRC_ONLY) &&              \
> >>> +		(input & ETH_RSS_L4_DST_ONLY))            \
> >>> +		output = input & (~(ETH_RSS_L4_SRC_ONLY | \
> >>> +			ETH_RSS_L4_DST_ONLY));            \
> >>> +} while (0)
> >>> +
> >>>    struct rte_mbuf;
> >>>
> >>>    /**
> >> Sorry, I missed why macro is used. Inline function is better and
> >> easier to read since macros which modify one of its parameters are very
> error-prone.
> > The history is
> > [Qi] The consideration is when handle rte_flow_action_rss, we still need to
> strip it out since this route will bypass the dev_configure or rss_update So there
> are two options 1, strip out at rte_flow_create , this relief all the PMDs, but code
> looks a little bit strange.
> > 2. handled by PMD themselves
> > Anyway both of the cases need this helper function be exposed by
> rte_ethdev.h, maybe we can define a macro named RTE_ETH_RSS_HF_REFINE?
> >
> > So I try to use a macro to replace the function of strip_out_src_dst_only. Now,
> there are two options:
> > (1)define a macro in rte_ethdev.h, just like above patch.
> > (2)define an inline function "rte_eth_rss_strip_out_src_dst_only" in
> rte_ethdev.h.
> > What do you think? Thanks!
> 
> May be inline function rte_eth_rss_hf_refine()?

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

* [dpdk-dev] [PATCH v13 0/3] extend RSS offload types
  2019-10-14 13:36                     ` [dpdk-dev] [PATCH v12 0/3] extend RSS offload types Simei Su
                                         ` (2 preceding siblings ...)
  2019-10-14 13:36                       ` [dpdk-dev] [PATCH v12 3/3] app/testpmd: add RSS offload types extending support Simei Su
@ 2019-10-15 12:56                       ` Simei Su
  2019-10-15 12:56                         ` [dpdk-dev] [PATCH v13 1/3] ethdev: decouple flow types and " Simei Su
                                           ` (3 more replies)
  3 siblings, 4 replies; 97+ messages in thread
From: Simei Su @ 2019-10-15 12:56 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

[PATCH v13 1/3] ethdev: decouple flow types and RSS offload types.
[PATCH v13 2/3] ethdev: add several bits for extending rss offload types.
[PATCH v13 3/3] app/testpmd: add cmdline support for extending rss types.

v13:
* Define an inline function.

v12:
* Use a macro to replace a function.

v11:
* Update code logic in rte_eth_dev_configure() and
  rte_eth_dev_rss_hash_update().

v10:
* Modify duplicate logic in rte_eth_dev_configure() and
  rte_eth_dev_rss_hash_update().

v9:
* Fix code style.
* Delete duplicate logic in rte_eth_dev_configure().

v8:
* Add to check the simultaneous use of SRC/DST_ONLY of the same level
  in rte_eth_dev_rss_hash_update() and rte_eth_dev_configure().
* Update code comments.

v7:
* Supplement related configuration for new flag in app/test-pmd/cmdline.c.

v6:
* Add the new flag in app/test-pmd/cmdline.c.

v5:
* Update code comments.

v4:
* Divide one patch into two patches.
* Delete ETH_RSS_L2_SRC/DST_ONLY.

v3:
* Update code comments and code style.

v2:
* Update code comments.

Simei Su (3):
  ethdev: decouple flow types and RSS offload types
  ethdev: extend RSS offload types
  app/testpmd: add RSS offload types extending support

 app/test-pmd/cmdline.c         | 14 ++++++-
 app/test-pmd/config.c          |  4 ++
 lib/librte_ethdev/rte_ethdev.c |  5 +++
 lib/librte_ethdev/rte_ethdev.h | 86 +++++++++++++++++++++++++++++-------------
 4 files changed, 80 insertions(+), 29 deletions(-)

-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v13 1/3] ethdev: decouple flow types and RSS offload types
  2019-10-15 12:56                       ` [dpdk-dev] [PATCH v13 0/3] extend RSS offload types Simei Su
@ 2019-10-15 12:56                         ` " Simei Su
  2019-10-15 12:56                         ` [dpdk-dev] [PATCH v13 2/3] ethdev: extend " Simei Su
                                           ` (2 subsequent siblings)
  3 siblings, 0 replies; 97+ messages in thread
From: Simei Su @ 2019-10-15 12:56 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch decouples RTE_ETH_FLOW_* and ETH_RSS_*. The former defines
flow types and the latter defines RSS offload types.

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_ethdev.h | 51 ++++++++++++++++++++----------------------
 1 file changed, 24 insertions(+), 27 deletions(-)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index c26abe2..40aa6a3 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -453,7 +453,6 @@ struct rte_eth_rss_conf {
  * possible, and exclusively. For example, if a packet is identified as
  * 'RTE_ETH_FLOW_NONFRAG_IPV4_TCP', it will not be any of other flow types,
  * though it is an actual IPV4 packet.
- * Note that the flow types are used to define RSS offload types.
  */
 #define RTE_ETH_FLOW_UNKNOWN             0
 #define RTE_ETH_FLOW_RAW                 1
@@ -483,32 +482,30 @@ struct rte_eth_rss_conf {
 #define RTE_ETH_FLOW_MAX                24
 
 /*
- * The RSS offload types are defined based on flow types.
- * Different NIC hardware may support different RSS offload
- * types. The supported flow types or RSS offload types can be queried by
- * rte_eth_dev_info_get().
- */
-#define ETH_RSS_IPV4               (1ULL << RTE_ETH_FLOW_IPV4)
-#define ETH_RSS_FRAG_IPV4          (1ULL << RTE_ETH_FLOW_FRAG_IPV4)
-#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
-#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
-#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP)
-#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
-#define ETH_RSS_IPV6               (1ULL << RTE_ETH_FLOW_IPV6)
-#define ETH_RSS_FRAG_IPV6          (1ULL << RTE_ETH_FLOW_FRAG_IPV6)
-#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
-#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
-#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP)
-#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
-#define ETH_RSS_L2_PAYLOAD         (1ULL << RTE_ETH_FLOW_L2_PAYLOAD)
-#define ETH_RSS_IPV6_EX            (1ULL << RTE_ETH_FLOW_IPV6_EX)
-#define ETH_RSS_IPV6_TCP_EX        (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
-#define ETH_RSS_IPV6_UDP_EX        (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
-#define ETH_RSS_PORT               (1ULL << RTE_ETH_FLOW_PORT)
-#define ETH_RSS_VXLAN              (1ULL << RTE_ETH_FLOW_VXLAN)
-#define ETH_RSS_GENEVE             (1ULL << RTE_ETH_FLOW_GENEVE)
-#define ETH_RSS_NVGRE              (1ULL << RTE_ETH_FLOW_NVGRE)
-#define ETH_RSS_GTPU               (1ULL << RTE_ETH_FLOW_GTPU)
+ * Below macros are defined for RSS offload types, they can be used to
+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
+ */
+#define ETH_RSS_IPV4               (1ULL << 2)
+#define ETH_RSS_FRAG_IPV4          (1ULL << 3)
+#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << 4)
+#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << 5)
+#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << 6)
+#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << 7)
+#define ETH_RSS_IPV6               (1ULL << 8)
+#define ETH_RSS_FRAG_IPV6          (1ULL << 9)
+#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << 10)
+#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << 11)
+#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << 12)
+#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << 13)
+#define ETH_RSS_L2_PAYLOAD         (1ULL << 14)
+#define ETH_RSS_IPV6_EX            (1ULL << 15)
+#define ETH_RSS_IPV6_TCP_EX        (1ULL << 16)
+#define ETH_RSS_IPV6_UDP_EX        (1ULL << 17)
+#define ETH_RSS_PORT               (1ULL << 18)
+#define ETH_RSS_VXLAN              (1ULL << 19)
+#define ETH_RSS_GENEVE             (1ULL << 20)
+#define ETH_RSS_NVGRE              (1ULL << 21)
+#define ETH_RSS_GTPU               (1ULL << 23)
 
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v13 2/3] ethdev: extend RSS offload types
  2019-10-15 12:56                       ` [dpdk-dev] [PATCH v13 0/3] extend RSS offload types Simei Su
  2019-10-15 12:56                         ` [dpdk-dev] [PATCH v13 1/3] ethdev: decouple flow types and " Simei Su
@ 2019-10-15 12:56                         ` " Simei Su
  2019-10-15 13:07                           ` Andrew Rybchenko
  2019-10-15 12:56                         ` [dpdk-dev] [PATCH v13 3/3] app/testpmd: add RSS offload types extending support Simei Su
  2019-10-15 15:09                         ` [dpdk-dev] [PATCH v14 0/3] extend RSS offload types Simei Su
  3 siblings, 1 reply; 97+ messages in thread
From: Simei Su @ 2019-10-15 12:56 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch reserves several bits as input set selection from the
high end of the 64 bits. It is combined with exisiting ETH_RSS_*
to represent RSS types. This patch also checks the simultaneous
use of SRC_ONLY and DST_ONLY of the same level.

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_ethdev.c |  5 +++++
 lib/librte_ethdev/rte_ethdev.h | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+)

diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 7caaa0b..3f989df 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -1269,6 +1269,9 @@ struct rte_eth_dev *
 		goto rollback;
 	}
 
+	dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf =
+		rte_eth_rss_hf_refine(dev_conf->rx_adv_conf.rss_conf.rss_hf);
+
 	/* Check that device supports requested rss hash functions. */
 	if ((dev_info.flow_type_rss_offloads |
 	     dev_conf->rx_adv_conf.rss_conf.rss_hf) !=
@@ -3112,6 +3115,8 @@ struct rte_eth_dev *
 	if (ret != 0)
 		return ret;
 
+	rss_conf->rss_hf = rte_eth_rss_hf_refine(rss_conf->rss_hf);
+
 	dev = &rte_eth_devices[port_id];
 	if ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) !=
 	    dev_info.flow_type_rss_offloads) {
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 40aa6a3..57fe78b 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -507,6 +507,20 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_NVGRE              (1ULL << 21)
 #define ETH_RSS_GTPU               (1ULL << 23)
 
+/*
+ * We use the following macros to combine with above ETH_RSS_* for
+ * more specific input set selection. These bits are defined starting
+ * from the high end of the 64 bits.
+ * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it represents
+ * both SRC and DST are taken into account. If SRC_ONLY and DST_ONLY of
+ * the same level are used simultaneously, it is the same case as none of
+ * them are added.
+ */
+#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
+#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
+#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
+#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
+
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
 	ETH_RSS_FRAG_IPV4 | \
@@ -4036,6 +4050,27 @@ int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id,
 void *
 rte_eth_dev_get_sec_ctx(uint16_t port_id);
 
+/**
+ * For input set change of hash filter, if SRC_ONLY and DST_ONLY of
+ * the same level are used simultaneously, it is the same case as
+ * none of them are added.
+ *
+ * @param rss_hf
+ *   RSS types with SRC/DST_ONLY.
+ * @return
+ *   RSS types.
+ */
+static inline uint64_t
+rte_eth_rss_hf_refine(uint64_t rss_hf)
+{
+	if ((rss_hf & ETH_RSS_L3_SRC_ONLY) && (rss_hf & ETH_RSS_L3_DST_ONLY))
+		rss_hf &= ~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY);
+
+	if ((rss_hf & ETH_RSS_L4_SRC_ONLY) && (rss_hf & ETH_RSS_L4_DST_ONLY))
+		rss_hf &= ~(ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY);
+
+	return rss_hf;
+}
 
 #include <rte_ethdev_core.h>
 
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v13 3/3] app/testpmd: add RSS offload types extending support
  2019-10-15 12:56                       ` [dpdk-dev] [PATCH v13 0/3] extend RSS offload types Simei Su
  2019-10-15 12:56                         ` [dpdk-dev] [PATCH v13 1/3] ethdev: decouple flow types and " Simei Su
  2019-10-15 12:56                         ` [dpdk-dev] [PATCH v13 2/3] ethdev: extend " Simei Su
@ 2019-10-15 12:56                         ` Simei Su
  2019-10-15 15:09                         ` [dpdk-dev] [PATCH v14 0/3] extend RSS offload types Simei Su
  3 siblings, 0 replies; 97+ messages in thread
From: Simei Su @ 2019-10-15 12:56 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch adds cmdline support for extended rss types configuration.

Signed-off-by: Simei Su <simei.su@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
---
 app/test-pmd/cmdline.c | 14 ++++++++++++--
 app/test-pmd/config.c  |  4 ++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 427eb30..6b5602d 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2212,6 +2212,14 @@ struct cmd_config_rss {
 		rss_conf.rss_hf = ETH_RSS_GENEVE;
 	else if (!strcmp(res->value, "nvgre"))
 		rss_conf.rss_hf = ETH_RSS_NVGRE;
+	else if (!strcmp(res->value, "l3-src-only"))
+		rss_conf.rss_hf = ETH_RSS_L3_SRC_ONLY;
+	else if (!strcmp(res->value, "l3-dst-only"))
+		rss_conf.rss_hf = ETH_RSS_L3_DST_ONLY;
+	else if (!strcmp(res->value, "l4-src-only"))
+		rss_conf.rss_hf = ETH_RSS_L4_SRC_ONLY;
+	else if (!strcmp(res->value, "l4-dst-only"))
+		rss_conf.rss_hf = ETH_RSS_L4_DST_ONLY;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "default"))
@@ -2379,7 +2387,8 @@ struct cmd_config_rss_hash_key {
 				 "ipv4#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#"
 				 "ipv4-other#ipv6#ipv6-frag#ipv6-tcp#ipv6-udp#"
 				 "ipv6-sctp#ipv6-other#l2-payload#ipv6-ex#"
-				 "ipv6-tcp-ex#ipv6-udp-ex");
+				 "ipv6-tcp-ex#ipv6-udp-ex#"
+				 "l3-src-only#l3-dst-only#l4-src-only#l4-dst-only");
 cmdline_parse_token_string_t cmd_config_rss_hash_key_value =
 	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);
 
@@ -2389,7 +2398,8 @@ struct cmd_config_rss_hash_key {
 	.help_str = "port config <port_id> rss-hash-key "
 		"ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|"
 		"ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|"
-		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex "
+		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
+		"l3-src-only|l3-dst-only|l4-src-only|l4-dst-only "
 		"<string of hex digits (variable length, NIC dependent)>",
 	.tokens = {
 		(void *)&cmd_config_rss_hash_key_port,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 8035961..1d2a97d 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -103,6 +103,10 @@
 	{ "tcp", ETH_RSS_TCP },
 	{ "sctp", ETH_RSS_SCTP },
 	{ "tunnel", ETH_RSS_TUNNEL },
+	{ "l3-src-only", ETH_RSS_L3_SRC_ONLY },
+	{ "l3-dst-only", ETH_RSS_L3_DST_ONLY },
+	{ "l4-src-only", ETH_RSS_L4_SRC_ONLY },
+	{ "l4-dst-only", ETH_RSS_L4_DST_ONLY },
 	{ NULL, 0 },
 };
 
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH v13 2/3] ethdev: extend RSS offload types
  2019-10-15 12:56                         ` [dpdk-dev] [PATCH v13 2/3] ethdev: extend " Simei Su
@ 2019-10-15 13:07                           ` Andrew Rybchenko
  2019-10-15 15:00                             ` Su, Simei
  0 siblings, 1 reply; 97+ messages in thread
From: Andrew Rybchenko @ 2019-10-15 13:07 UTC (permalink / raw)
  To: Simei Su, qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev

On 10/15/19 3:56 PM, Simei Su wrote:
> This patch reserves several bits as input set selection from the
> high end of the 64 bits. It is combined with exisiting ETH_RSS_*
> to represent RSS types. This patch also checks the simultaneous
> use of SRC_ONLY and DST_ONLY of the same level.
>
> 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>

One nit below
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>

> ---
>   lib/librte_ethdev/rte_ethdev.c |  5 +++++
>   lib/librte_ethdev/rte_ethdev.h | 35 +++++++++++++++++++++++++++++++++++
>   2 files changed, 40 insertions(+)
>
> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index 7caaa0b..3f989df 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -1269,6 +1269,9 @@ struct rte_eth_dev *
>   		goto rollback;
>   	}
>   
> +	dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf =
> +		rte_eth_rss_hf_refine(dev_conf->rx_adv_conf.rss_conf.rss_hf);
> +
>   	/* Check that device supports requested rss hash functions. */
>   	if ((dev_info.flow_type_rss_offloads |
>   	     dev_conf->rx_adv_conf.rss_conf.rss_hf) !=
> @@ -3112,6 +3115,8 @@ struct rte_eth_dev *
>   	if (ret != 0)
>   		return ret;
>   
> +	rss_conf->rss_hf = rte_eth_rss_hf_refine(rss_conf->rss_hf);
> +
>   	dev = &rte_eth_devices[port_id];
>   	if ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) !=
>   	    dev_info.flow_type_rss_offloads) {
> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> index 40aa6a3..57fe78b 100644
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -507,6 +507,20 @@ struct rte_eth_rss_conf {
>   #define ETH_RSS_NVGRE              (1ULL << 21)
>   #define ETH_RSS_GTPU               (1ULL << 23)
>   
> +/*
> + * We use the following macros to combine with above ETH_RSS_* for
> + * more specific input set selection. These bits are defined starting
> + * from the high end of the 64 bits.
> + * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it represents
> + * both SRC and DST are taken into account. If SRC_ONLY and DST_ONLY of
> + * the same level are used simultaneously, it is the same case as none of
> + * them are added.
> + */
> +#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
> +#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
> +#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
> +#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
> +
>   #define ETH_RSS_IP ( \
>   	ETH_RSS_IPV4 | \
>   	ETH_RSS_FRAG_IPV4 | \
> @@ -4036,6 +4050,27 @@ int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id,
>   void *
>   rte_eth_dev_get_sec_ctx(uint16_t port_id);
>   
> +/**
> + * For input set change of hash filter, if SRC_ONLY and DST_ONLY of
> + * the same level are used simultaneously, it is the same case as
> + * none of them are added.
> + *
> + * @param rss_hf
> + *   RSS types with SRC/DST_ONLY.
> + * @return
> + *   RSS types.
> + */
> +static inline uint64_t
> +rte_eth_rss_hf_refine(uint64_t rss_hf)
> +{
> +	if ((rss_hf & ETH_RSS_L3_SRC_ONLY) && (rss_hf & ETH_RSS_L3_DST_ONLY))
> +		rss_hf &= ~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY);
> +
> +	if ((rss_hf & ETH_RSS_L4_SRC_ONLY) && (rss_hf & ETH_RSS_L4_DST_ONLY))
> +		rss_hf &= ~(ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY);
> +
> +	return rss_hf;
> +}

May I suggest to put the function just after ETH_RSS defines.

>   #include <rte_ethdev_core.h>
>   


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

* Re: [dpdk-dev] [PATCH v13 2/3] ethdev: extend RSS offload types
  2019-10-15 13:07                           ` Andrew Rybchenko
@ 2019-10-15 15:00                             ` Su, Simei
  0 siblings, 0 replies; 97+ messages in thread
From: Su, Simei @ 2019-10-15 15:00 UTC (permalink / raw)
  To: Andrew Rybchenko, Zhang, Qi Z, Ye, Xiaolong, Yigit, Ferruh; +Cc: dev



> -----Original Message-----
> From: Andrew Rybchenko [mailto:arybchenko@solarflare.com]
> Sent: Tuesday, October 15, 2019 9:08 PM
> To: Su, Simei <simei.su@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Ye,
> Xiaolong <xiaolong.ye@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v13 2/3] ethdev: extend RSS offload types
> 
> On 10/15/19 3:56 PM, Simei Su wrote:
> > This patch reserves several bits as input set selection from the high
> > end of the 64 bits. It is combined with exisiting ETH_RSS_* to
> > represent RSS types. This patch also checks the simultaneous use of
> > SRC_ONLY and DST_ONLY of the same level.
> >
> > 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>
> 
> One nit below
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> 
> > ---
> >   lib/librte_ethdev/rte_ethdev.c |  5 +++++
> >   lib/librte_ethdev/rte_ethdev.h | 35
> +++++++++++++++++++++++++++++++++++
> >   2 files changed, 40 insertions(+)
> >
> > diff --git a/lib/librte_ethdev/rte_ethdev.c
> > b/lib/librte_ethdev/rte_ethdev.c index 7caaa0b..3f989df 100644
> > --- a/lib/librte_ethdev/rte_ethdev.c
> > +++ b/lib/librte_ethdev/rte_ethdev.c
> > @@ -1269,6 +1269,9 @@ struct rte_eth_dev *
> >   		goto rollback;
> >   	}
> >
> > +	dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf =
> > +		rte_eth_rss_hf_refine(dev_conf->rx_adv_conf.rss_conf.rss_hf);
> > +
> >   	/* Check that device supports requested rss hash functions. */
> >   	if ((dev_info.flow_type_rss_offloads |
> >   	     dev_conf->rx_adv_conf.rss_conf.rss_hf) != @@ -3112,6 +3115,8
> > @@ struct rte_eth_dev *
> >   	if (ret != 0)
> >   		return ret;
> >
> > +	rss_conf->rss_hf = rte_eth_rss_hf_refine(rss_conf->rss_hf);
> > +
> >   	dev = &rte_eth_devices[port_id];
> >   	if ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) !=
> >   	    dev_info.flow_type_rss_offloads) { diff --git
> > a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> > index 40aa6a3..57fe78b 100644
> > --- a/lib/librte_ethdev/rte_ethdev.h
> > +++ b/lib/librte_ethdev/rte_ethdev.h
> > @@ -507,6 +507,20 @@ struct rte_eth_rss_conf {
> >   #define ETH_RSS_NVGRE              (1ULL << 21)
> >   #define ETH_RSS_GTPU               (1ULL << 23)
> >
> > +/*
> > + * We use the following macros to combine with above ETH_RSS_* for
> > + * more specific input set selection. These bits are defined starting
> > + * from the high end of the 64 bits.
> > + * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it
> > +represents
> > + * both SRC and DST are taken into account. If SRC_ONLY and DST_ONLY
> > +of
> > + * the same level are used simultaneously, it is the same case as
> > +none of
> > + * them are added.
> > + */
> > +#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
> > +#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
> > +#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
> > +#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
> > +
> >   #define ETH_RSS_IP ( \
> >   	ETH_RSS_IPV4 | \
> >   	ETH_RSS_FRAG_IPV4 | \
> > @@ -4036,6 +4050,27 @@ int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t
> port_id,
> >   void *
> >   rte_eth_dev_get_sec_ctx(uint16_t port_id);
> >
> > +/**
> > + * For input set change of hash filter, if SRC_ONLY and DST_ONLY of
> > + * the same level are used simultaneously, it is the same case as
> > + * none of them are added.
> > + *
> > + * @param rss_hf
> > + *   RSS types with SRC/DST_ONLY.
> > + * @return
> > + *   RSS types.
> > + */
> > +static inline uint64_t
> > +rte_eth_rss_hf_refine(uint64_t rss_hf) {
> > +	if ((rss_hf & ETH_RSS_L3_SRC_ONLY) && (rss_hf &
> ETH_RSS_L3_DST_ONLY))
> > +		rss_hf &= ~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY);
> > +
> > +	if ((rss_hf & ETH_RSS_L4_SRC_ONLY) && (rss_hf &
> ETH_RSS_L4_DST_ONLY))
> > +		rss_hf &= ~(ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY);
> > +
> > +	return rss_hf;
> > +}
> 
> May I suggest to put the function just after ETH_RSS defines.
> 
  Ok, I think put it after ETH_RSS_L3/L4_SRC/DST_ONLY defines is better.

> >   #include <rte_ethdev_core.h>
> >


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

* [dpdk-dev] [PATCH v14 0/3] extend RSS offload types
  2019-10-15 12:56                       ` [dpdk-dev] [PATCH v13 0/3] extend RSS offload types Simei Su
                                           ` (2 preceding siblings ...)
  2019-10-15 12:56                         ` [dpdk-dev] [PATCH v13 3/3] app/testpmd: add RSS offload types extending support Simei Su
@ 2019-10-15 15:09                         ` Simei Su
  2019-10-15 15:09                           ` [dpdk-dev] [PATCH v14 1/3] ethdev: decouple flow types and " Simei Su
                                             ` (3 more replies)
  3 siblings, 4 replies; 97+ messages in thread
From: Simei Su @ 2019-10-15 15:09 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

[PATCH v14 1/3] ethdev: decouple flow types and RSS offload types.
[PATCH v14 2/3] ethdev: add several bits for extending rss offload types.
[PATCH v14 3/3] app/testpmd: add cmdline support for extending rss types.

v14:
* Adjust the location of the inline function.

v13:
* Define an inline function.

v12:
* Use a macro to replace a function.

v11:
* Update code logic in rte_eth_dev_configure() and
  rte_eth_dev_rss_hash_update().

v10:
* Modify duplicate logic in rte_eth_dev_configure() and
  rte_eth_dev_rss_hash_update().

v9:
* Fix code style.
* Delete duplicate logic in rte_eth_dev_configure().

v8:
* Add to check the simultaneous use of SRC/DST_ONLY of the same level
  in rte_eth_dev_rss_hash_update() and rte_eth_dev_configure().
* Update code comments.

v7:
* Supplement related configuration for new flag in app/test-pmd/cmdline.c.

v6:
* Add the new flag in app/test-pmd/cmdline.c.

v5:
* Update code comments.

v4:
* Divide one patch into two patches.
* Delete ETH_RSS_L2_SRC/DST_ONLY.

v3:
* Update code comments and code style.

v2:
* Update code comments.

Simei Su (3):
  ethdev: decouple flow types and RSS offload types
  ethdev: extend RSS offload types
  app/testpmd: add RSS offload types extending support

 app/test-pmd/cmdline.c         | 14 ++++++-
 app/test-pmd/config.c          |  4 ++
 lib/librte_ethdev/rte_ethdev.c |  5 +++
 lib/librte_ethdev/rte_ethdev.h | 87 +++++++++++++++++++++++++++++-------------
 4 files changed, 81 insertions(+), 29 deletions(-)

-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v14 1/3] ethdev: decouple flow types and RSS offload types
  2019-10-15 15:09                         ` [dpdk-dev] [PATCH v14 0/3] extend RSS offload types Simei Su
@ 2019-10-15 15:09                           ` " Simei Su
  2019-10-15 15:09                           ` [dpdk-dev] [PATCH v14 2/3] ethdev: extend " Simei Su
                                             ` (2 subsequent siblings)
  3 siblings, 0 replies; 97+ messages in thread
From: Simei Su @ 2019-10-15 15:09 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch decouples RTE_ETH_FLOW_* and ETH_RSS_*. The former defines
flow types and the latter defines RSS offload types.

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_ethdev.h | 51 ++++++++++++++++++++----------------------
 1 file changed, 24 insertions(+), 27 deletions(-)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index c26abe2..40aa6a3 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -453,7 +453,6 @@ struct rte_eth_rss_conf {
  * possible, and exclusively. For example, if a packet is identified as
  * 'RTE_ETH_FLOW_NONFRAG_IPV4_TCP', it will not be any of other flow types,
  * though it is an actual IPV4 packet.
- * Note that the flow types are used to define RSS offload types.
  */
 #define RTE_ETH_FLOW_UNKNOWN             0
 #define RTE_ETH_FLOW_RAW                 1
@@ -483,32 +482,30 @@ struct rte_eth_rss_conf {
 #define RTE_ETH_FLOW_MAX                24
 
 /*
- * The RSS offload types are defined based on flow types.
- * Different NIC hardware may support different RSS offload
- * types. The supported flow types or RSS offload types can be queried by
- * rte_eth_dev_info_get().
- */
-#define ETH_RSS_IPV4               (1ULL << RTE_ETH_FLOW_IPV4)
-#define ETH_RSS_FRAG_IPV4          (1ULL << RTE_ETH_FLOW_FRAG_IPV4)
-#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
-#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
-#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP)
-#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
-#define ETH_RSS_IPV6               (1ULL << RTE_ETH_FLOW_IPV6)
-#define ETH_RSS_FRAG_IPV6          (1ULL << RTE_ETH_FLOW_FRAG_IPV6)
-#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
-#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
-#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP)
-#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
-#define ETH_RSS_L2_PAYLOAD         (1ULL << RTE_ETH_FLOW_L2_PAYLOAD)
-#define ETH_RSS_IPV6_EX            (1ULL << RTE_ETH_FLOW_IPV6_EX)
-#define ETH_RSS_IPV6_TCP_EX        (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
-#define ETH_RSS_IPV6_UDP_EX        (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
-#define ETH_RSS_PORT               (1ULL << RTE_ETH_FLOW_PORT)
-#define ETH_RSS_VXLAN              (1ULL << RTE_ETH_FLOW_VXLAN)
-#define ETH_RSS_GENEVE             (1ULL << RTE_ETH_FLOW_GENEVE)
-#define ETH_RSS_NVGRE              (1ULL << RTE_ETH_FLOW_NVGRE)
-#define ETH_RSS_GTPU               (1ULL << RTE_ETH_FLOW_GTPU)
+ * Below macros are defined for RSS offload types, they can be used to
+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
+ */
+#define ETH_RSS_IPV4               (1ULL << 2)
+#define ETH_RSS_FRAG_IPV4          (1ULL << 3)
+#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << 4)
+#define ETH_RSS_NONFRAG_IPV4_UDP   (1ULL << 5)
+#define ETH_RSS_NONFRAG_IPV4_SCTP  (1ULL << 6)
+#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << 7)
+#define ETH_RSS_IPV6               (1ULL << 8)
+#define ETH_RSS_FRAG_IPV6          (1ULL << 9)
+#define ETH_RSS_NONFRAG_IPV6_TCP   (1ULL << 10)
+#define ETH_RSS_NONFRAG_IPV6_UDP   (1ULL << 11)
+#define ETH_RSS_NONFRAG_IPV6_SCTP  (1ULL << 12)
+#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << 13)
+#define ETH_RSS_L2_PAYLOAD         (1ULL << 14)
+#define ETH_RSS_IPV6_EX            (1ULL << 15)
+#define ETH_RSS_IPV6_TCP_EX        (1ULL << 16)
+#define ETH_RSS_IPV6_UDP_EX        (1ULL << 17)
+#define ETH_RSS_PORT               (1ULL << 18)
+#define ETH_RSS_VXLAN              (1ULL << 19)
+#define ETH_RSS_GENEVE             (1ULL << 20)
+#define ETH_RSS_NVGRE              (1ULL << 21)
+#define ETH_RSS_GTPU               (1ULL << 23)
 
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v14 2/3] ethdev: extend RSS offload types
  2019-10-15 15:09                         ` [dpdk-dev] [PATCH v14 0/3] extend RSS offload types Simei Su
  2019-10-15 15:09                           ` [dpdk-dev] [PATCH v14 1/3] ethdev: decouple flow types and " Simei Su
@ 2019-10-15 15:09                           ` " Simei Su
  2019-10-15 15:09                           ` [dpdk-dev] [PATCH v14 3/3] app/testpmd: add RSS offload types extending support Simei Su
  2019-10-18 11:43                           ` [dpdk-dev] [PATCH v14 0/3] extend RSS offload types Ferruh Yigit
  3 siblings, 0 replies; 97+ messages in thread
From: Simei Su @ 2019-10-15 15:09 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch reserves several bits as input set selection from the
high end of the 64 bits. It is combined with exisiting ETH_RSS_*
to represent RSS types. This patch also checks the simultaneous
use of SRC_ONLY and DST_ONLY of the same level.

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>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 lib/librte_ethdev/rte_ethdev.c |  5 +++++
 lib/librte_ethdev/rte_ethdev.h | 36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+)

diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 7caaa0b..3f989df 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -1269,6 +1269,9 @@ struct rte_eth_dev *
 		goto rollback;
 	}
 
+	dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf =
+		rte_eth_rss_hf_refine(dev_conf->rx_adv_conf.rss_conf.rss_hf);
+
 	/* Check that device supports requested rss hash functions. */
 	if ((dev_info.flow_type_rss_offloads |
 	     dev_conf->rx_adv_conf.rss_conf.rss_hf) !=
@@ -3112,6 +3115,8 @@ struct rte_eth_dev *
 	if (ret != 0)
 		return ret;
 
+	rss_conf->rss_hf = rte_eth_rss_hf_refine(rss_conf->rss_hf);
+
 	dev = &rte_eth_devices[port_id];
 	if ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) !=
 	    dev_info.flow_type_rss_offloads) {
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 40aa6a3..6b148be 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -507,6 +507,42 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_NVGRE              (1ULL << 21)
 #define ETH_RSS_GTPU               (1ULL << 23)
 
+/*
+ * We use the following macros to combine with above ETH_RSS_* for
+ * more specific input set selection. These bits are defined starting
+ * from the high end of the 64 bits.
+ * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it represents
+ * both SRC and DST are taken into account. If SRC_ONLY and DST_ONLY of
+ * the same level are used simultaneously, it is the same case as none of
+ * them are added.
+ */
+#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
+#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
+#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
+#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
+
+/**
+ * For input set change of hash filter, if SRC_ONLY and DST_ONLY of
+ * the same level are used simultaneously, it is the same case as
+ * none of them are added.
+ *
+ * @param rss_hf
+ *   RSS types with SRC/DST_ONLY.
+ * @return
+ *   RSS types.
+ */
+static inline uint64_t
+rte_eth_rss_hf_refine(uint64_t rss_hf)
+{
+	if ((rss_hf & ETH_RSS_L3_SRC_ONLY) && (rss_hf & ETH_RSS_L3_DST_ONLY))
+		rss_hf &= ~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY);
+
+	if ((rss_hf & ETH_RSS_L4_SRC_ONLY) && (rss_hf & ETH_RSS_L4_DST_ONLY))
+		rss_hf &= ~(ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY);
+
+	return rss_hf;
+}
+
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
 	ETH_RSS_FRAG_IPV4 | \
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v14 3/3] app/testpmd: add RSS offload types extending support
  2019-10-15 15:09                         ` [dpdk-dev] [PATCH v14 0/3] extend RSS offload types Simei Su
  2019-10-15 15:09                           ` [dpdk-dev] [PATCH v14 1/3] ethdev: decouple flow types and " Simei Su
  2019-10-15 15:09                           ` [dpdk-dev] [PATCH v14 2/3] ethdev: extend " Simei Su
@ 2019-10-15 15:09                           ` Simei Su
  2019-10-18 11:43                           ` [dpdk-dev] [PATCH v14 0/3] extend RSS offload types Ferruh Yigit
  3 siblings, 0 replies; 97+ messages in thread
From: Simei Su @ 2019-10-15 15:09 UTC (permalink / raw)
  To: qi.z.zhang, xiaolong.ye, ferruh.yigit; +Cc: dev, simei.su

This patch adds cmdline support for extended rss types configuration.

Signed-off-by: Simei Su <simei.su@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
---
 app/test-pmd/cmdline.c | 14 ++++++++++++--
 app/test-pmd/config.c  |  4 ++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 427eb30..6b5602d 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2212,6 +2212,14 @@ struct cmd_config_rss {
 		rss_conf.rss_hf = ETH_RSS_GENEVE;
 	else if (!strcmp(res->value, "nvgre"))
 		rss_conf.rss_hf = ETH_RSS_NVGRE;
+	else if (!strcmp(res->value, "l3-src-only"))
+		rss_conf.rss_hf = ETH_RSS_L3_SRC_ONLY;
+	else if (!strcmp(res->value, "l3-dst-only"))
+		rss_conf.rss_hf = ETH_RSS_L3_DST_ONLY;
+	else if (!strcmp(res->value, "l4-src-only"))
+		rss_conf.rss_hf = ETH_RSS_L4_SRC_ONLY;
+	else if (!strcmp(res->value, "l4-dst-only"))
+		rss_conf.rss_hf = ETH_RSS_L4_DST_ONLY;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "default"))
@@ -2379,7 +2387,8 @@ struct cmd_config_rss_hash_key {
 				 "ipv4#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#"
 				 "ipv4-other#ipv6#ipv6-frag#ipv6-tcp#ipv6-udp#"
 				 "ipv6-sctp#ipv6-other#l2-payload#ipv6-ex#"
-				 "ipv6-tcp-ex#ipv6-udp-ex");
+				 "ipv6-tcp-ex#ipv6-udp-ex#"
+				 "l3-src-only#l3-dst-only#l4-src-only#l4-dst-only");
 cmdline_parse_token_string_t cmd_config_rss_hash_key_value =
 	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);
 
@@ -2389,7 +2398,8 @@ struct cmd_config_rss_hash_key {
 	.help_str = "port config <port_id> rss-hash-key "
 		"ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|"
 		"ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|"
-		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex "
+		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
+		"l3-src-only|l3-dst-only|l4-src-only|l4-dst-only "
 		"<string of hex digits (variable length, NIC dependent)>",
 	.tokens = {
 		(void *)&cmd_config_rss_hash_key_port,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 8035961..1d2a97d 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -103,6 +103,10 @@
 	{ "tcp", ETH_RSS_TCP },
 	{ "sctp", ETH_RSS_SCTP },
 	{ "tunnel", ETH_RSS_TUNNEL },
+	{ "l3-src-only", ETH_RSS_L3_SRC_ONLY },
+	{ "l3-dst-only", ETH_RSS_L3_DST_ONLY },
+	{ "l4-src-only", ETH_RSS_L4_SRC_ONLY },
+	{ "l4-dst-only", ETH_RSS_L4_DST_ONLY },
 	{ NULL, 0 },
 };
 
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH v14 0/3] extend RSS offload types
  2019-10-15 15:09                         ` [dpdk-dev] [PATCH v14 0/3] extend RSS offload types Simei Su
                                             ` (2 preceding siblings ...)
  2019-10-15 15:09                           ` [dpdk-dev] [PATCH v14 3/3] app/testpmd: add RSS offload types extending support Simei Su
@ 2019-10-18 11:43                           ` Ferruh Yigit
  3 siblings, 0 replies; 97+ messages in thread
From: Ferruh Yigit @ 2019-10-18 11:43 UTC (permalink / raw)
  To: Simei Su, qi.z.zhang, xiaolong.ye; +Cc: dev

On 10/15/2019 4:09 PM, Simei Su wrote:
> [PATCH v14 1/3] ethdev: decouple flow types and RSS offload types.
> [PATCH v14 2/3] ethdev: add several bits for extending rss offload types.
> [PATCH v14 3/3] app/testpmd: add cmdline support for extending rss types.
> 
> v14:
> * Adjust the location of the inline function.
> 
> v13:
> * Define an inline function.
> 
> v12:
> * Use a macro to replace a function.
> 
> v11:
> * Update code logic in rte_eth_dev_configure() and
>   rte_eth_dev_rss_hash_update().
> 
> v10:
> * Modify duplicate logic in rte_eth_dev_configure() and
>   rte_eth_dev_rss_hash_update().
> 
> v9:
> * Fix code style.
> * Delete duplicate logic in rte_eth_dev_configure().
> 
> v8:
> * Add to check the simultaneous use of SRC/DST_ONLY of the same level
>   in rte_eth_dev_rss_hash_update() and rte_eth_dev_configure().
> * Update code comments.
> 
> v7:
> * Supplement related configuration for new flag in app/test-pmd/cmdline.c.
> 
> v6:
> * Add the new flag in app/test-pmd/cmdline.c.
> 
> v5:
> * Update code comments.
> 
> v4:
> * Divide one patch into two patches.
> * Delete ETH_RSS_L2_SRC/DST_ONLY.
> 
> v3:
> * Update code comments and code style.
> 
> v2:
> * Update code comments.
> 
> Simei Su (3):
>   ethdev: decouple flow types and RSS offload types
>   ethdev: extend RSS offload types
>   app/testpmd: add RSS offload types extending support

Series applied to dpdk-next-net/master, thanks.

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

end of thread, back to index

Thread overview: 97+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-09  5:35 [dpdk-dev] [PATCH 0/2] extend RSS offload types simei
2019-08-09  5:35 ` [dpdk-dev] [PATCH 1/2] ethdev: " simei
2019-08-09  5:35 ` [dpdk-dev] [PATCH 2/2] app/testpmd: add RSS offload types extending support simei
2019-09-23 14:05 ` [dpdk-dev] [PATCH v2 0/2] extend RSS offload types Simei Su
2019-09-23 14:05   ` [dpdk-dev] [PATCH v2 1/2] ethdev: " Simei Su
2019-09-25 10:27     ` Ye Xiaolong
2019-09-25 12:04       ` Su, Simei
2019-09-25 12:23         ` Ye Xiaolong
2019-09-25 12:42           ` Su, Simei
2019-09-25 10:49     ` Ye Xiaolong
2019-09-25 12:00       ` Su, Simei
2019-09-25 12:22         ` Ye Xiaolong
2019-09-25 12:38           ` Su, Simei
2019-09-23 14:05   ` [dpdk-dev] [PATCH v2 2/2] app/testpmd: add RSS offload types extending support Simei Su
2019-09-24  5:32   ` [dpdk-dev] [PATCH v2 0/2] extend RSS offload types Zhang, Qi Z
2019-09-25 14:06   ` [dpdk-dev] [PATCH v3 " Simei Su
2019-09-25 14:06     ` [dpdk-dev] [PATCH v3 1/2] ethdev: " Simei Su
2019-09-26  9:16       ` Andrew Rybchenko
2019-09-27  5:54         ` Zhang, Qi Z
2019-09-25 14:06     ` [dpdk-dev] [PATCH v3 2/2] app/testpmd: add RSS offload types extending support Simei Su
2019-09-27  8:54     ` [dpdk-dev] [PATCH v4 0/3] extend RSS offload types Simei Su
2019-09-27  8:54       ` [dpdk-dev] [PATCH v4 1/3] ethdev: decouple flow types and " Simei Su
2019-09-29 11:32         ` Andrew Rybchenko
2019-09-27  8:54       ` [dpdk-dev] [PATCH v4 2/3] ethdev: extend " Simei Su
2019-09-28  1:03         ` Zhang, Qi Z
2019-09-28  1:39           ` Su, Simei
2019-09-27  8:54       ` [dpdk-dev] [PATCH v4 3/3] app/testpmd: add RSS offload types extending support Simei Su
2019-09-28 16:49         ` Ori Kam
2019-09-29  6:46           ` Su, Simei
2019-09-29  7:21             ` Su, Simei
2019-09-28  2:29       ` [dpdk-dev] [PATCH v5 0/3] extend RSS offload types Simei Su
2019-09-28  2:29         ` [dpdk-dev] [PATCH v5 1/3] ethdev: decouple flow types and " Simei Su
2019-09-28 16:23           ` Ori Kam
2019-09-28  2:29         ` [dpdk-dev] [PATCH v5 2/3] ethdev: extend " Simei Su
2019-09-28 16:26           ` Ori Kam
2019-09-28  2:29         ` [dpdk-dev] [PATCH v5 3/3] app/testpmd: add RSS offload types extending support Simei Su
2019-09-29  5:11         ` [dpdk-dev] [PATCH v6 0/3] extend RSS offload types Simei Su
2019-09-29  5:11           ` [dpdk-dev] [PATCH v6 1/3] ethdev: decouple flow types and " Simei Su
2019-09-29  5:11           ` [dpdk-dev] [PATCH v6 2/3] ethdev: extend " Simei Su
2019-09-29 11:40             ` Andrew Rybchenko
2019-09-30  7:49               ` Zhang, Qi Z
2019-09-29  5:11           ` [dpdk-dev] [PATCH v6 3/3] app/testpmd: add RSS offload types extending support Simei Su
2019-09-29  7:09           ` [dpdk-dev] [PATCH v7 0/3] extend RSS offload types Simei Su
2019-09-29  7:09             ` [dpdk-dev] [PATCH v7 1/3] ethdev: decouple flow types and " Simei Su
2019-09-29  7:55               ` Yang, Zhiyong
2019-09-29  8:38                 ` Su, Simei
2019-09-29  7:09             ` [dpdk-dev] [PATCH v7 2/3] ethdev: extend " Simei Su
2019-09-29  8:55               ` Su, Simei
2019-09-29  9:15                 ` Su, Simei
2019-09-29  7:09             ` [dpdk-dev] [PATCH v7 3/3] app/testpmd: add RSS offload types extending support Simei Su
2019-10-01 14:36             ` [dpdk-dev] [PATCH v8 0/3] extend RSS offload types Simei Su
2019-10-01 14:36               ` [dpdk-dev] [PATCH v8 1/3] ethdev: decouple flow types and " Simei Su
2019-10-01 14:36               ` [dpdk-dev] [PATCH v8 2/3] ethdev: extend " Simei Su
2019-10-01 14:49                 ` Andrew Rybchenko
2019-10-01 16:02                   ` Iremonger, Bernard
2019-10-01 16:45                     ` Ferruh Yigit
2019-10-05  4:54                   ` Su, Simei
2019-10-01 14:36               ` [dpdk-dev] [PATCH v8 3/3] app/testpmd: add RSS offload types extending support Simei Su
2019-10-03 11:35               ` [dpdk-dev] [PATCH v9 0/3] extend RSS offload types Simei Su
2019-10-03 11:35                 ` [dpdk-dev] [PATCH v9 1/3] ethdev: decouple flow types and " Simei Su
2019-10-03 11:35                 ` [dpdk-dev] [PATCH v9 2/3] ethdev: extend " Simei Su
2019-10-03 11:35                 ` [dpdk-dev] [PATCH v9 3/3] app/testpmd: add RSS offload types extending support Simei Su
2019-10-04  4:45                 ` [dpdk-dev] [PATCH v10 0/3] extend RSS offload types Simei Su
2019-10-04  4:46                   ` [dpdk-dev] [PATCH v10 1/3] ethdev: decouple flow types and " Simei Su
2019-10-04  4:46                   ` [dpdk-dev] [PATCH v10 2/3] ethdev: extend " Simei Su
2019-10-08 16:45                     ` Andrew Rybchenko
2019-10-09  7:06                       ` Su, Simei
2019-10-04  4:46                   ` [dpdk-dev] [PATCH v10 3/3] app/testpmd: add RSS offload types extending support Simei Su
2019-10-09  6:57                   ` [dpdk-dev] [PATCH v11 0/3] extend RSS offload types Simei Su
2019-10-09  6:57                     ` [dpdk-dev] [PATCH v11 1/3] ethdev: decouple flow types and " Simei Su
2019-10-09  6:57                     ` [dpdk-dev] [PATCH v11 2/3] ethdev: extend " Simei Su
2019-10-09  7:18                       ` Andrew Rybchenko
2019-10-09  7:42                         ` Su, Simei
2019-10-09  7:55                           ` Andrew Rybchenko
2019-10-09  9:08                             ` Su, Simei
2019-10-09  9:32                             ` Zhang, Qi Z
2019-10-10 14:37                               ` Su, Simei
2019-10-09  6:57                     ` [dpdk-dev] [PATCH v11 3/3] app/testpmd: add RSS offload types extending support Simei Su
2019-10-14 13:36                     ` [dpdk-dev] [PATCH v12 0/3] extend RSS offload types Simei Su
2019-10-14 13:36                       ` [dpdk-dev] [PATCH v12 1/3] ethdev: decouple flow types and " Simei Su
2019-10-14 13:36                       ` [dpdk-dev] [PATCH v12 2/3] ethdev: extend " Simei Su
2019-10-15  9:07                         ` Andrew Rybchenko
2019-10-15 10:55                           ` Su, Simei
2019-10-15 11:09                             ` Andrew Rybchenko
2019-10-15 11:21                               ` Su, Simei
2019-10-14 13:36                       ` [dpdk-dev] [PATCH v12 3/3] app/testpmd: add RSS offload types extending support Simei Su
2019-10-15 12:56                       ` [dpdk-dev] [PATCH v13 0/3] extend RSS offload types Simei Su
2019-10-15 12:56                         ` [dpdk-dev] [PATCH v13 1/3] ethdev: decouple flow types and " Simei Su
2019-10-15 12:56                         ` [dpdk-dev] [PATCH v13 2/3] ethdev: extend " Simei Su
2019-10-15 13:07                           ` Andrew Rybchenko
2019-10-15 15:00                             ` Su, Simei
2019-10-15 12:56                         ` [dpdk-dev] [PATCH v13 3/3] app/testpmd: add RSS offload types extending support Simei Su
2019-10-15 15:09                         ` [dpdk-dev] [PATCH v14 0/3] extend RSS offload types Simei Su
2019-10-15 15:09                           ` [dpdk-dev] [PATCH v14 1/3] ethdev: decouple flow types and " Simei Su
2019-10-15 15:09                           ` [dpdk-dev] [PATCH v14 2/3] ethdev: extend " Simei Su
2019-10-15 15:09                           ` [dpdk-dev] [PATCH v14 3/3] app/testpmd: add RSS offload types extending support Simei Su
2019-10-18 11:43                           ` [dpdk-dev] [PATCH v14 0/3] extend RSS offload types Ferruh Yigit

DPDK-dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dpdk-dev/0 dpdk-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dpdk-dev dpdk-dev/ https://lore.kernel.org/dpdk-dev \
		dev@dpdk.org dpdk-dev@archiver.kernel.org
	public-inbox-index dpdk-dev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox