[v2] ethdev: add support for RSS based on IPv6 flow label

Message ID 20240208220600.56443-1-ajit.khaparde@broadcom.com (mailing list archive)
State Changes Requested, archived
Delegated to: Ferruh Yigit
Headers
Series [v2] ethdev: add support for RSS based on IPv6 flow label |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

Ajit Khaparde Feb. 8, 2024, 10:06 p.m. UTC
  On supporting hardware, the 20-bit Flow Label field in the
IPv6 header can be used to perform RSS in the ingress path.

Flow label values can be chosen such that they can be
used as part of the input to a hash function used in a load
distribution scheme.

On supporting hardware, the 20-bit Flow Label field in the
IPv6 header can be used to perform RSS in the ingress path.

Example to configure IPv6 flow label based RSS:

flow create 0 ingress pattern eth / ipv6 / tcp / end actions rss types ipv6-flow-label end / end

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
v1->v2:
Combined ethdev and testmd patches into single patch as suggested.
---
 app/test-pmd/cmdline.c  | 8 ++++----
 app/test-pmd/config.c   | 1 +
 lib/ethdev/rte_ethdev.h | 1 +
 3 files changed, 6 insertions(+), 4 deletions(-)
  

Comments

Ferruh Yigit Feb. 8, 2024, 10:22 p.m. UTC | #1
On 2/8/2024 10:06 PM, Ajit Khaparde wrote:
> On supporting hardware, the 20-bit Flow Label field in the
> IPv6 header can be used to perform RSS in the ingress path.
> 
> Flow label values can be chosen such that they can be
> used as part of the input to a hash function used in a load
> distribution scheme.
> 
> On supporting hardware, the 20-bit Flow Label field in the
> IPv6 header can be used to perform RSS in the ingress path.
> 
> Example to configure IPv6 flow label based RSS:
> 
> flow create 0 ingress pattern eth / ipv6 / tcp / end actions rss types ipv6-flow-label end / end
> 
> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> ---
> v1->v2:
> Combined ethdev and testmd patches into single patch as suggested.
> ---
>  app/test-pmd/cmdline.c  | 8 ++++----
>  app/test-pmd/config.c   | 1 +
>  lib/ethdev/rte_ethdev.h | 1 +
>  3 files changed, 6 insertions(+), 4 deletions(-)
> 

testpmd documentation needs to be updated for updated commands:
'doc/guides/testpmd_app_ug/testpmd_funcs.rst'
  
Ajit Khaparde Feb. 8, 2024, 10:24 p.m. UTC | #2
On Thu, Feb 8, 2024 at 2:23 PM Ferruh Yigit <ferruh.yigit@amd.com> wrote:
>
> On 2/8/2024 10:06 PM, Ajit Khaparde wrote:
> > On supporting hardware, the 20-bit Flow Label field in the
> > IPv6 header can be used to perform RSS in the ingress path.
> >
> > Flow label values can be chosen such that they can be
> > used as part of the input to a hash function used in a load
> > distribution scheme.
> >
> > On supporting hardware, the 20-bit Flow Label field in the
> > IPv6 header can be used to perform RSS in the ingress path.
> >
> > Example to configure IPv6 flow label based RSS:
> >
> > flow create 0 ingress pattern eth / ipv6 / tcp / end actions rss types ipv6-flow-label end / end
> >
> > Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> > ---
> > v1->v2:
> > Combined ethdev and testmd patches into single patch as suggested.
> > ---
> >  app/test-pmd/cmdline.c  | 8 ++++----
> >  app/test-pmd/config.c   | 1 +
> >  lib/ethdev/rte_ethdev.h | 1 +
> >  3 files changed, 6 insertions(+), 4 deletions(-)
> >
>
> testpmd documentation needs to be updated for updated commands:
> 'doc/guides/testpmd_app_ug/testpmd_funcs.rst'
ACK.

>
>
  

Patch

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index d8ea2b76e6..ced4a762fc 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -715,7 +715,7 @@  static void cmd_help_long_parsed(void *parsed_result,
 			"port config all rss (all|default|level-default|level-outer|level-inner|"
 			"ip|tcp|udp|sctp|tunnel|vlan|none|"
 			"ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|"
-			"ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
+			"ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|ipv6-flow-label|"
 			"l2-payload|port|vxlan|geneve|nvgre|gtpu|eth|s-vlan|c-vlan|"
 			"esp|ah|l2tpv3|pfcp|pppoe|ecpri|mpls|ipv4-chksum|l4-chksum|"
 			"l2tpv2|l3-pre96|l3-pre64|l3-pre56|l3-pre48|l3-pre40|l3-pre32|"
@@ -2133,7 +2133,7 @@  static cmdline_parse_inst_t cmd_config_rss = {
 		"all|default|level-default|level-outer|level-inner|"
 		"ip|tcp|udp|sctp|tunnel|vlan|none|"
 		"ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|"
-		"ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
+		"ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|ipv6-flow-label|"
 		"l2-payload|port|vxlan|geneve|nvgre|gtpu|eth|s-vlan|c-vlan|"
 		"esp|ah|l2tpv3|pfcp|pppoe|ecpri|mpls|ipv4-chksum|l4-chksum|"
 		"l2tpv2|l3-pre96|l3-pre64|l3-pre56|l3-pre48|l3-pre40|l3-pre32|"
@@ -2249,7 +2249,7 @@  static cmdline_parse_token_string_t cmd_config_rss_hash_key_rss_type =
 				 "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#ipv6-flow-label#"
 				 "l3-src-only#l3-dst-only#l4-src-only#l4-dst-only#"
 				 "l2-src-only#l2-dst-only#s-vlan#c-vlan#"
 				 "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls#l2tpv2");
@@ -2262,7 +2262,7 @@  static cmdline_parse_inst_t 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|ipv6-flow-label|"
 		"l3-src-only|l3-dst-only|l4-src-only|l4-dst-only|"
 		"l2-src-only|l2-dst-only|s-vlan|c-vlan|"
 		"l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls|l2tpv2 "
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 2c4dedd603..3c5c5bac67 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -148,6 +148,7 @@  const struct rss_type_info rss_type_table[] = {
 	{ "l4-src-only", RTE_ETH_RSS_L4_SRC_ONLY },
 	{ "l3-dst-only", RTE_ETH_RSS_L3_DST_ONLY },
 	{ "l3-src-only", RTE_ETH_RSS_L3_SRC_ONLY },
+	{ "ipv6-flow-label", RTE_ETH_RSS_IPV6_FLOW_LABEL },
 	{ NULL, 0},
 };
 
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index 2687c23fa6..75a3f5f2c7 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -587,6 +587,7 @@  struct rte_eth_rss_conf {
 #define RTE_ETH_RSS_L4_CHKSUM          RTE_BIT64(35)
 
 #define RTE_ETH_RSS_L2TPV2             RTE_BIT64(36)
+#define RTE_ETH_RSS_IPV6_FLOW_LABEL    RTE_BIT64(37)
 
 /*
  * We use the following macros to combine with above RTE_ETH_RSS_* for