Skip to contentSkip to conversation

ethdev: add RSS offload type for L3 checksum

PATCH Superseded Alvin Zhang 8 participants 39 messages Jun 3, 2021 – Sep 29, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ethdev: add RSS offload type for L3 checksum

Add ETH_RSS_L3_CHKSUM macro.

---
 lib/ethdev/rte_ethdev.h | 1 +
 1 file changed, 1 insertion(+)
lib/ethdev/rte_ethdev.h +1 -0
index faf3bd9..4220ec5 100644
@@ -537,6 +537,7 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_L3_CHKSUM	   (1ULL << 34)
 
 /*
  * We use the following macros to combine with above ETH_RSS_* for
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 1 line · Alvin Zhang

Add ETH_RSS_L3_CHKSUM macro.

Sorry, too short description. I could be an existing practice to add more RSS offload types, but I want to break it. Please, add motivation in the description why it is useful etc.

Quoted 11 lines
---
 lib/ethdev/rte_ethdev.h | 1 +
 1 file changed, 1 insertion(+)
lib/ethdev/rte_ethdev.h +0 -0
index faf3bd9..4220ec5 100644

lib/ethdev/rte_ethdev.h struct rte_eth_rss_conf { · line 539

Quoted 3 lines
lib/ethdev/rte_ethdev.h +0 -0
@@ -537,6 +537,7 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)

Please, add a comment what does it mean in various cases covering various L3 protocols. IMHO, we must be explicit here since addition of a new L3 protocol will make it ambiguous if some drivers/HW use its checksum, but some do not.

Quoted 5 lines
lib/ethdev/rte_ethdev.h +1 -0
+#define ETH_RSS_L3_CHKSUM	   (1ULL << 34)
 
 /*
  * We use the following macros to combine with above ETH_RSS_* for
#2 lore raw

Hi Rybchenko,

Thanks for your review.
We will add more descriptions and update testpmd app in V2.

Quoted 21 lines

-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Thursday, June 3, 2021 3:15 PM
To: Zhang, AlvinX <[email protected]>; Yigit, Ferruh <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH] ethdev: add RSS offload type for L3 checksum

Quoted 1 line · Alvin Zhang

Add ETH_RSS_L3_CHKSUM macro.

Sorry, too short description. I could be an existing practice to add more RSS offload types, but I want to break it.
Please, add motivation in the description why it is useful etc.

Quoted 6 lines
---
 lib/ethdev/rte_ethdev.h | 1 +
 1 file changed, 1 insertion(+)
Quoted 18 lines

lib/ethdev/rte_ethdev.h struct rte_eth_rss_conf { · line 539

Quoted 8 lines
lib/ethdev/rte_ethdev.h index renamed from lib/ethdev/rte_ethdev.h +0 -0

faf3bd9..4220ec5 100644

lib/ethdev/rte_ethdev.h +0 -0
@@ -537,6 +537,7 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)

Please, add a comment what does it mean in various cases covering various L3 protocols. IMHO, we must be explicit here since addition of a new L3 protocol will make it ambiguous if some drivers/HW use its checksum, but some do not.

Quoted 5 lines
lib/ethdev/rte_ethdev.h +1 -0
+#define ETH_RSS_L3_CHKSUM	   (1ULL << 34)
 
 /*
  * We use the following macros to combine with above ETH_RSS_* for

BRs,
Alvin Zhang

#3 lore raw

PATCH v2 1/1 ethdev: add IPv4 checksum RSS offload type

In reply to Alvin Zhang

This patch defines new RSS offload type for IPv4 checksum, which is required when users want to distribute packets based on the IPv4 checksum field.

For example "flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-chksum end queues end / end", this flow causes all matching packets to be distributed to queues on basis of IPv4 checksum.

---
 app/test-pmd/cmdline.c  | 2 ++
 app/test-pmd/config.c   | 1 +
 lib/ethdev/rte_ethdev.h | 1 +
 3 files changed, 4 insertions(+)
app/test-pmd/cmdline.c +2 -0
index 0268b18..32da066 100644
@@ -2254,6 +2254,8 @@ struct cmd_config_rss {
 		rss_conf.rss_hf = ETH_RSS_ECPRI;
 	else if (!strcmp(res->value, "mpls"))
 		rss_conf.rss_hf = ETH_RSS_MPLS;
+	else if (!strcmp(res->value, "ipv4-chksum"))
+		rss_conf.rss_hf = ETH_RSS_IPV4_CHKSUM;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "level-default")) {
app/test-pmd/config.c +1 -0
index 43c79b5..2c0c415 100644
@@ -140,6 +140,7 @@
 	{ "gtpu", ETH_RSS_GTPU },
 	{ "ecpri", ETH_RSS_ECPRI },
 	{ "mpls", ETH_RSS_MPLS },
+	{ "ipv4-chksum", ETH_RSS_IPV4_CHKSUM },
 	{ NULL, 0 },
 };
 
lib/ethdev/rte_ethdev.h +1 -0
index faf3bd9..f10d834 100644
@@ -537,6 +537,7 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
 
 /*
  * We use the following macros to combine with above ETH_RSS_* for
Signature · 1 line
1.8.3.1
#4 lore raw

Re: [dpdk-dev] [PATCH v2] ethdev: add IPv4 checksum RSS offload type

Quoted 10 lines · Alvin Zhang

This patch defines new RSS offload type for IPv4 checksum, which is required when users want to distribute packets based on the IPv4 checksum field.

For example "flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-chksum end queues end / end", this flow causes all matching packets to be distributed to queues on basis of IPv4 checksum.

The patch LGTM now. I hope we'll have a PMD in the release cycle which supports it.

In fact it is a funny idea. Let's consider a TCP connection and routing change with one extra hop on the way while the connection is alive. Or a UDP stream in the same conditions. If so, TTL will different, checksum changes and connection packets may be delivered to a different Rx queue. May be sometimes it is not important and/or can't happen.

L4 checksum sounds better from this point of view since it covers IP addresses and transport ports and less bits to hash. The only concern is distribution fairness, but I keep the topic to those who understand corresponding math better.

Quoted 44 lines
---
 app/test-pmd/cmdline.c  | 2 ++
 app/test-pmd/config.c   | 1 +
 lib/ethdev/rte_ethdev.h | 1 +
 3 files changed, 4 insertions(+)
app/test-pmd/cmdline.c +2 -0
index 0268b18..32da066 100644
@@ -2254,6 +2254,8 @@ struct cmd_config_rss {
 		rss_conf.rss_hf = ETH_RSS_ECPRI;
 	else if (!strcmp(res->value, "mpls"))
 		rss_conf.rss_hf = ETH_RSS_MPLS;
+	else if (!strcmp(res->value, "ipv4-chksum"))
+		rss_conf.rss_hf = ETH_RSS_IPV4_CHKSUM;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "level-default")) {
app/test-pmd/config.c +1 -0
index 43c79b5..2c0c415 100644
@@ -140,6 +140,7 @@
 	{ "gtpu", ETH_RSS_GTPU },
 	{ "ecpri", ETH_RSS_ECPRI },
 	{ "mpls", ETH_RSS_MPLS },
+	{ "ipv4-chksum", ETH_RSS_IPV4_CHKSUM },
 	{ NULL, 0 },
 };
 
lib/ethdev/rte_ethdev.h +1 -0
index faf3bd9..f10d834 100644
@@ -537,6 +537,7 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
 
 /*
  * We use the following macros to combine with above ETH_RSS_* for
#5 lore raw

Re: [dpdk-dev] [PATCH v2] ethdev: add IPv4 checksum RSS offload type

Quoted 20 lines
Quoted 10 lines

This patch defines new RSS offload type for IPv4 checksum, which is required when users want to distribute packets based on the IPv4 checksum field.

For example "flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-chksum end queues end / end", this flow causes all matching packets to be distributed to queues on basis of IPv4 checksum.

The patch LGTM now. I hope we'll have a PMD in the release cycle which supports it.

In fact it is a funny idea. Let's consider a TCP connection and routing change with one extra hop on the way while the connection is alive. Or a UDP stream in the same conditions. If so, TTL will different, checksum changes and connection packets may be delivered to a different Rx queue.
May be sometimes it is not important and/or can't happen.

Quoted 5 lines

L4 checksum sounds better from this point of view since it covers IP addresses and transport ports and less bits to hash. The only concern is distribution fairness, but I keep the topic to those who understand corresponding math better.

Quoted 1 line

---

We are preparing a PMD patch to support this feature, if ready, we will submit it ASAP.

Thanks,
Alvin

Acked-by on v2 1/1
#6 lore raw

Re: [dpdk-dev] [PATCH v2] ethdev: add IPv4 checksum RSS offload type

In reply to Alvin Zhang
Quoted 11 lines · Alvin Zhang

This patch defines new RSS offload type for IPv4 checksum, which is required when users want to distribute packets based on the IPv4 checksum field.

For example "flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-chksum end queues end / end", this flow causes all matching packets to be distributed to queues on basis of IPv4 checksum.

Quoted 46 lines
---
 app/test-pmd/cmdline.c  | 2 ++
 app/test-pmd/config.c   | 1 +
 lib/ethdev/rte_ethdev.h | 1 +
 3 files changed, 4 insertions(+)
app/test-pmd/cmdline.c +2 -0
index 0268b18..32da066 100644
@@ -2254,6 +2254,8 @@ struct cmd_config_rss {
                rss_conf.rss_hf = ETH_RSS_ECPRI;
        else if (!strcmp(res->value, "mpls"))
                rss_conf.rss_hf = ETH_RSS_MPLS;
+       else if (!strcmp(res->value, "ipv4-chksum"))
+               rss_conf.rss_hf = ETH_RSS_IPV4_CHKSUM;
        else if (!strcmp(res->value, "none"))
                rss_conf.rss_hf = 0;
        else if (!strcmp(res->value, "level-default")) {
app/test-pmd/config.c +1 -0
index 43c79b5..2c0c415 100644
@@ -140,6 +140,7 @@
        { "gtpu", ETH_RSS_GTPU },
        { "ecpri", ETH_RSS_ECPRI },
        { "mpls", ETH_RSS_MPLS },
+       { "ipv4-chksum", ETH_RSS_IPV4_CHKSUM },
        { NULL, 0 },
 };
 
lib/ethdev/rte_ethdev.h +1 -1
index faf3bd9..f10d834 100644
@@ -537,6 +537,7 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE             (1ULL << 31)
 #define ETH_RSS_ECPRI             (1ULL << 32)
 #define ETH_RSS_MPLS              (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM       (1ULL << 34)
 
 /*
  * We use the following macros to combine with above ETH_RSS_* for
--

1.8.3.1

#7 lore raw

PATCH v3 1/1 ethdev: add IPv4 and L4 checksum RSS offload types

In reply to Alvin Zhang

This patch defines new RSS offload types for IPv4 and L4 checksum, which are required when users want to distribute packets based on the IPv4 or L4 checksum field.

For example "flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-chksum end queues end / end", this flow causes all matching packets to be distributed to queues on basis of IPv4 checksum.

---

v3: Add L4 checksum RSS offload type

---
 app/test-pmd/cmdline.c  | 4 ++++
 app/test-pmd/config.c   | 2 ++
 lib/ethdev/rte_ethdev.h | 2 ++
 3 files changed, 8 insertions(+)
app/test-pmd/cmdline.c +4 -0
index 0268b18..6148d84 100644
@@ -2254,6 +2254,10 @@ struct cmd_config_rss {
 		rss_conf.rss_hf = ETH_RSS_ECPRI;
 	else if (!strcmp(res->value, "mpls"))
 		rss_conf.rss_hf = ETH_RSS_MPLS;
+	else if (!strcmp(res->value, "ipv4-chksum"))
+		rss_conf.rss_hf = ETH_RSS_IPV4_CHKSUM;
+	else if (!strcmp(res->value, "l4-chksum"))
+		rss_conf.rss_hf = ETH_RSS_L4_CHKSUM;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "level-default")) {
app/test-pmd/config.c +2 -0
index 43c79b5..14968bf 100644
@@ -140,6 +140,8 @@
 	{ "gtpu", ETH_RSS_GTPU },
 	{ "ecpri", ETH_RSS_ECPRI },
 	{ "mpls", ETH_RSS_MPLS },
+	{ "ipv4-chksum", ETH_RSS_IPV4_CHKSUM },
+	{ "l4-chksum", ETH_RSS_L4_CHKSUM },
 	{ NULL, 0 },
 };
 
lib/ethdev/rte_ethdev.h +2 -0
index faf3bd9..1268729 100644
@@ -537,6 +537,8 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+#define ETH_RSS_L4_CHKSUM	   (1ULL << 35)
 
 /*
  * We use the following macros to combine with above ETH_RSS_* for
Signature · 1 line
1.8.3.1
#8 lore raw

Re: [dpdk-dev] [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 4 lines · Alvin Zhang

This patch defines new RSS offload types for IPv4 and L4 checksum, which are required when users want to distribute packets based on the IPv4 or L4 checksum field.

What is the usecase for distribution based on L4/IPv4 checksum? Is it something like HW has the feature so expose it or there is some real use case for this application?

Quoted 61 lines

For example "flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-chksum end queues end / end", this flow causes all matching packets to be distributed to queues on basis of IPv4 checksum.

---

v3: Add L4 checksum RSS offload type

---
 app/test-pmd/cmdline.c  | 4 ++++
 app/test-pmd/config.c   | 2 ++
 lib/ethdev/rte_ethdev.h | 2 ++
 3 files changed, 8 insertions(+)
app/test-pmd/cmdline.c +4 -0
index 0268b18..6148d84 100644
@@ -2254,6 +2254,10 @@ struct cmd_config_rss {
                rss_conf.rss_hf = ETH_RSS_ECPRI;
        else if (!strcmp(res->value, "mpls"))
                rss_conf.rss_hf = ETH_RSS_MPLS;
+       else if (!strcmp(res->value, "ipv4-chksum"))
+               rss_conf.rss_hf = ETH_RSS_IPV4_CHKSUM;
+       else if (!strcmp(res->value, "l4-chksum"))
+               rss_conf.rss_hf = ETH_RSS_L4_CHKSUM;
        else if (!strcmp(res->value, "none"))
                rss_conf.rss_hf = 0;
        else if (!strcmp(res->value, "level-default")) {
app/test-pmd/config.c +2 -0
index 43c79b5..14968bf 100644
@@ -140,6 +140,8 @@
        { "gtpu", ETH_RSS_GTPU },
        { "ecpri", ETH_RSS_ECPRI },
        { "mpls", ETH_RSS_MPLS },
+       { "ipv4-chksum", ETH_RSS_IPV4_CHKSUM },
+       { "l4-chksum", ETH_RSS_L4_CHKSUM },
        { NULL, 0 },
 };
 
lib/ethdev/rte_ethdev.h +2 -1
index faf3bd9..1268729 100644
@@ -537,6 +537,8 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE             (1ULL << 31)
 #define ETH_RSS_ECPRI             (1ULL << 32)
 #define ETH_RSS_MPLS              (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM       (1ULL << 34)
+#define ETH_RSS_L4_CHKSUM         (1ULL << 35)
 
 /*
  * We use the following macros to combine with above ETH_RSS_* for
--

1.8.3.1

#9 lore raw

Re: [dpdk-dev] [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 15 lines

-----Original Message-----
From: Jerin Jacob <[email protected]>
Sent: Tuesday, June 15, 2021 4:26 PM
To: Zhang, AlvinX <[email protected]>
Cc: Zhang, Qi Z <[email protected]>; Andrew Rybchenko <[email protected]>; Ajit Khaparde <[email protected]>; dpdk-dev <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 1 line · Alvin Zhang
Quoted 7 lines
Quoted 3 lines

This patch defines new RSS offload types for IPv4 and L4 checksum, which are required when users want to distribute packets based on the IPv4 or L4 checksum field.

What is the usecase for distribution based on L4/IPv4 checksum? Is it something like HW has the feature so expose it or there is some real use case for this application?

This is for real use case, some research by using TCP checksum for FDIR on ixgbe.
https://hsadok.com/papers/sprayer-hotnets18.pdf

and we are looking for similar solution in ice, and checksum RSS is the feature we need to have.

Quoted 64 lines
Quoted 64 lines

For example "flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-chksum end queues end / end", this flow causes all matching packets to be distributed to queues on basis of IPv4 checksum.

---

v3: Add L4 checksum RSS offload type

---
 app/test-pmd/cmdline.c  | 4 ++++
 app/test-pmd/config.c   | 2 ++
 lib/ethdev/rte_ethdev.h | 2 ++
 3 files changed, 8 insertions(+)
app/test-pmd/cmdline.c index renamed from app/test-pmd/cmdline.c +0 -0

0268b18..6148d84 100644

app/test-pmd/cmdline.c +4 -0
@@ -2254,6 +2254,10 @@ struct cmd_config_rss {
                rss_conf.rss_hf = ETH_RSS_ECPRI;
        else if (!strcmp(res->value, "mpls"))
                rss_conf.rss_hf = ETH_RSS_MPLS;
+       else if (!strcmp(res->value, "ipv4-chksum"))
+               rss_conf.rss_hf = ETH_RSS_IPV4_CHKSUM;
+       else if (!strcmp(res->value, "l4-chksum"))
+               rss_conf.rss_hf = ETH_RSS_L4_CHKSUM;
        else if (!strcmp(res->value, "none"))
                rss_conf.rss_hf = 0;
        else if (!strcmp(res->value, "level-default")) { diff --git

a/app/test-pmd/config.c b/app/test-pmd/config.c index 43c79b5..14968bf 100644

app/test-pmd/config.c +2 -0
@@ -140,6 +140,8 @@
        { "gtpu", ETH_RSS_GTPU },
        { "ecpri", ETH_RSS_ECPRI },
        { "mpls", ETH_RSS_MPLS },
+       { "ipv4-chksum", ETH_RSS_IPV4_CHKSUM },
+       { "l4-chksum", ETH_RSS_L4_CHKSUM },
        { NULL, 0 },
 };
 
lib/ethdev/rte_ethdev.h index renamed from lib/ethdev/rte_ethdev.h +0 -0

faf3bd9..1268729 100644

lib/ethdev/rte_ethdev.h +2 -1
@@ -537,6 +537,8 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE             (1ULL << 31)
 #define ETH_RSS_ECPRI             (1ULL << 32)
 #define ETH_RSS_MPLS              (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM       (1ULL << 34)
+#define ETH_RSS_L4_CHKSUM         (1ULL << 35)
 
 /*
  * We use the following macros to combine with above ETH_RSS_* for
--

1.8.3.1

#11 lore raw

Re: [dpdk-dev] [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

In reply to Alvin Zhang
Quoted 54 lines · Alvin Zhang

This patch defines new RSS offload types for IPv4 and L4 checksum, which are required when users want to distribute packets based on the IPv4 or L4 checksum field.

For example "flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-chksum end queues end / end", this flow causes all matching packets to be distributed to queues on basis of IPv4 checksum.

---

v3: Add L4 checksum RSS offload type

---
 app/test-pmd/cmdline.c  | 4 ++++
 app/test-pmd/config.c   | 2 ++
 lib/ethdev/rte_ethdev.h | 2 ++
 3 files changed, 8 insertions(+)
app/test-pmd/cmdline.c +4 -0
index 0268b18..6148d84 100644
@@ -2254,6 +2254,10 @@ struct cmd_config_rss {
 		rss_conf.rss_hf = ETH_RSS_ECPRI;
 	else if (!strcmp(res->value, "mpls"))
 		rss_conf.rss_hf = ETH_RSS_MPLS;
+	else if (!strcmp(res->value, "ipv4-chksum"))
+		rss_conf.rss_hf = ETH_RSS_IPV4_CHKSUM;
+	else if (!strcmp(res->value, "l4-chksum"))
+		rss_conf.rss_hf = ETH_RSS_L4_CHKSUM;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "level-default")) {
app/test-pmd/config.c +2 -0
index 43c79b5..14968bf 100644
@@ -140,6 +140,8 @@
 	{ "gtpu", ETH_RSS_GTPU },
 	{ "ecpri", ETH_RSS_ECPRI },
 	{ "mpls", ETH_RSS_MPLS },
+	{ "ipv4-chksum", ETH_RSS_IPV4_CHKSUM },
+	{ "l4-chksum", ETH_RSS_L4_CHKSUM },
 	{ NULL, 0 },
 };
 
lib/ethdev/rte_ethdev.h +0 -0
index faf3bd9..1268729 100644

lib/ethdev/rte_ethdev.h struct rte_eth_rss_conf { · line 541

Quoted 5 lines
lib/ethdev/rte_ethdev.h +2 -0
@@ -537,6 +537,8 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+#define ETH_RSS_L4_CHKSUM	   (1ULL << 35)

What does efine which L4 protocols are supported? How user will know?

#12 lore raw

Re: [dpdk-dev] [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 4 lines
Quoted 4 lines
lib/ethdev/rte_ethdev.h index renamed from lib/ethdev/rte_ethdev.h +0 -0

faf3bd9..1268729 100644

lib/ethdev/rte_ethdev.h +0 -0
Quoted 8 lines

lib/ethdev/rte_ethdev.h struct rte_eth_rss_conf { · line 541

Quoted 6 lines
lib/ethdev/rte_ethdev.h +2 -0
@@ -537,6 +537,8 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+#define ETH_RSS_L4_CHKSUM	   (1ULL << 35)

What does efine which L4 protocols are supported? How user will know?

I think TCP/UDP/SCTP can be supported, but this is determined by PMD, here we only provide a general interface.

BRs,
Alvin

#13 lore raw

Re: [dpdk-dev] [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

In reply to Andrew Rybchenko
Quoted 8 lines

lib/ethdev/rte_ethdev.h struct rte_eth_rss_conf { · line 541

Quoted 6 lines
lib/ethdev/rte_ethdev.h +2 -0
@@ -537,6 +537,8 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+#define ETH_RSS_L4_CHKSUM	   (1ULL << 35)

What does efine which L4 protocols are supported? How user will know?

I think if we want to support L4 checksum RSS by using below command port config all rss (all|default|eth|vlan|...)

We must define TCP/UDP/SCTP checksum RSS separately:
#define ETH_RSS_TCP_CHKSUM (1ULL << 35)
#define ETH_RSS_UDP_CHKSUM (1ULL << 36)
#deifne ETH_RSS_SCTP_CHKSUM (1ULL << 37)

Here 3 bits are occupied, this is not good for there are not many bits available.

If we only want to using it in flows, we only need to define ETH_RSS_L4_CHKSUM, because the flow pattern pointed out the L4 protocol type.
flow create 0 ingress pattern eth / ipv4 / tcp / end actions rss types l4-chksum end queues end / end

So what's your opinions?

Thanks
Alvin

#14 lore raw

Re: [dpdk-dev] [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 27 lines

-----Original Message-----
From: Zhang, AlvinX <[email protected]>
Sent: Tuesday, July 6, 2021 3:06 PM
To: Andrew Rybchenko <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 8 lines

lib/ethdev/rte_ethdev.h struct rte_eth_rss_conf { · line 541

Quoted 6 lines
lib/ethdev/rte_ethdev.h +2 -0
@@ -537,6 +537,8 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+#define ETH_RSS_L4_CHKSUM	   (1ULL << 35)

What does efine which L4 protocols are supported? How user will know?

I think if we want to support L4 checksum RSS by using below command port config all rss (all|default|eth|vlan|...)

We must define TCP/UDP/SCTP checksum RSS separately:
#define ETH_RSS_TCP_CHKSUM (1ULL << 35)
#define ETH_RSS_UDP_CHKSUM (1ULL << 36)
#deifne ETH_RSS_SCTP_CHKSUM (1ULL << 37)

Quoted 7 lines

Here 3 bits are occupied, this is not good for there are not many bits available.

If we only want to using it in flows, we only need to define ETH_RSS_L4_CHKSUM, because the flow pattern pointed out the L4 protocol type.
flow create 0 ingress pattern eth / ipv4 / tcp / end actions rss types l4-chksum end queues end / end

+1, the pattern already give the hint to avoid the ambiguity and I think we already have ETH_RSS_LEVEL to figure out inner or outer.

Quoted 5 lines

So what's your opinions?

Thanks
Alvin

#15 lore raw

Re: [dpdk-dev] [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 29 lines · Qi Z
Quoted 29 lines

-----Original Message-----
From: Zhang, AlvinX <[email protected]>
Sent: Tuesday, July 6, 2021 3:06 PM
To: Andrew Rybchenko <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 8 lines

lib/ethdev/rte_ethdev.h struct rte_eth_rss_conf { · line 541

Quoted 6 lines
lib/ethdev/rte_ethdev.h +2 -0
@@ -537,6 +537,8 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+#define ETH_RSS_L4_CHKSUM	   (1ULL << 35)

What does efine which L4 protocols are supported? How user will know?

I think if we want to support L4 checksum RSS by using below command port config all rss (all|default|eth|vlan|...)

We must define TCP/UDP/SCTP checksum RSS separately:
#define ETH_RSS_TCP_CHKSUM (1ULL << 35)
#define ETH_RSS_UDP_CHKSUM (1ULL << 36)
#deifne ETH_RSS_SCTP_CHKSUM (1ULL << 37)

Here 3 bits are occupied, this is not good for there are not many bits available.

Quoted 7 lines
Quoted 5 lines

If we only want to using it in flows, we only need to define ETH_RSS_L4_CHKSUM, because the flow pattern pointed out the L4 protocol type.
flow create 0 ingress pattern eth / ipv4 / tcp / end actions rss types l4-chksum end queues end / end

+1, the pattern already give the hint to avoid the ambiguity and I think we already have ETH_RSS_LEVEL to figure out inner or outer.

The problem that it may be used in generic RSS flags which has no the context. Also even in the case of flow API context could have no L4 protocol at all.

Is UDP checksum 0 treated as no checksum and go to default queue or treated as a regular checksum with value equal to 0?

I tend to agree that 3 flags is too much for the feature, but one flag without properly defined meaning is not good as well.

I just want rules to be defined and documented.

#16 lore raw

Re: [dpdk-dev] [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 48 lines

-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Tuesday, July 6, 2021 4:05 PM
To: Zhang, Qi Z <[email protected]>; Zhang, AlvinX <[email protected]>; [email protected]
Cc: [email protected]
Subject: Re: [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 23 lines · Qi Z
Quoted 23 lines

-----Original Message-----
From: Zhang, AlvinX <[email protected]>
Sent: Tuesday, July 6, 2021 3:06 PM
To: Andrew Rybchenko <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 8 lines

lib/ethdev/rte_ethdev.h struct rte_eth_rss_conf { · line 541

Quoted 6 lines
lib/ethdev/rte_ethdev.h +2 -0
@@ -537,6 +537,8 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+#define ETH_RSS_L4_CHKSUM	   (1ULL << 35)

What does efine which L4 protocols are supported? How user will know?

I think if we want to support L4 checksum RSS by using below command port config all rss (all|default|eth|vlan|...)

Quoted 6 lines
Quoted 6 lines

We must define TCP/UDP/SCTP checksum RSS separately:
#define ETH_RSS_TCP_CHKSUM (1ULL << 35)
#define ETH_RSS_UDP_CHKSUM (1ULL << 36)
#deifne ETH_RSS_SCTP_CHKSUM (1ULL << 37)

Here 3 bits are occupied, this is not good for there are not many bits

available.

Quoted 7 lines
Quoted 6 lines

If we only want to using it in flows, we only need to define ETH_RSS_L4_CHKSUM, because the flow pattern pointed out the L4 protocol type.
flow create 0 ingress pattern eth / ipv4 / tcp / end actions rss types l4-chksum end queues end / end

Quoted 5 lines
Quoted 1 line

+1, the pattern already give the hint to avoid the ambiguity and I think we

already have ETH_RSS_LEVEL to figure out inner or outer.

The problem that it may be used in generic RSS flags which has no the context. Also even in the case of flow API context could have no L4 protocol at all.

For generic case, it can simply assume it cover all L4 checksum cases and I'm not sure if any user intend to use it as generic RSS, pmd can simply reject it if it's not necessary to support. In flow API, if no l4 protocol in pattern , the PMD should return failure (or maybe some default behavior), and I think this is not a new question as it happens all the cases e.g.:
pattern eth / vlan / end action rss type ipv4 .

Quoted 3 lines

Is UDP checksum 0 treated as no checksum and go to default queue or treated as a regular checksum with value equal to 0?

I think we can treat it as value 0, as least our hardware behavior like this, is this any issue?

Quoted 5 lines

I tend to agree that 3 flags is too much for the feature, but one flag without properly defined meaning is not good as well.

I just want rules to be defined and documented.'

Agree, we need more document for this. if you agree above proposal.

#17 lore raw

Re: [dpdk-dev] [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 48 lines · Qi Z
Quoted 48 lines

-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Tuesday, July 6, 2021 4:05 PM
To: Zhang, Qi Z <[email protected]>; Zhang, AlvinX <[email protected]>; [email protected]
Cc: [email protected]
Subject: Re: [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 23 lines · Qi Z
Quoted 23 lines

-----Original Message-----
From: Zhang, AlvinX <[email protected]>
Sent: Tuesday, July 6, 2021 3:06 PM
To: Andrew Rybchenko <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 8 lines

lib/ethdev/rte_ethdev.h struct rte_eth_rss_conf { · line 541

Quoted 6 lines
lib/ethdev/rte_ethdev.h +2 -0
@@ -537,6 +537,8 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+#define ETH_RSS_L4_CHKSUM	   (1ULL << 35)

What does efine which L4 protocols are supported? How user will know?

I think if we want to support L4 checksum RSS by using below command port config all rss (all|default|eth|vlan|...)

Quoted 6 lines
Quoted 6 lines

We must define TCP/UDP/SCTP checksum RSS separately:
#define ETH_RSS_TCP_CHKSUM (1ULL << 35)
#define ETH_RSS_UDP_CHKSUM (1ULL << 36)
#deifne ETH_RSS_SCTP_CHKSUM (1ULL << 37)

Here 3 bits are occupied, this is not good for there are not many bits

available.

Quoted 7 lines
Quoted 6 lines

If we only want to using it in flows, we only need to define ETH_RSS_L4_CHKSUM, because the flow pattern pointed out the L4 protocol type.
flow create 0 ingress pattern eth / ipv4 / tcp / end actions rss types l4-chksum end queues end / end

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

+1, the pattern already give the hint to avoid the ambiguity and I think we

already have ETH_RSS_LEVEL to figure out inner or outer.

The problem that it may be used in generic RSS flags which has no the context. Also even in the case of flow API context could have no L4 protocol at all.

For generic case, it can simply assume it cover all L4 checksum cases and I'm not sure if any user intend to use it as generic RSS, pmd can simply reject it if it's not necessary to support.

Try to look at it from an application point of view which does not know any specifics of the driver.

* Get dev_info and see ETH_RSS_L4_CHKSUM, good!, would like to use it.

* If I try to use it in default RSS config, but the request fail, it could be very confusing.

* Will it distribute TCP packets? UDP packets? SCTP packets? Or should I care about RSS for some of them based on other supported fields? E.g. if SCTP is not supported by the NIC, I need to install RSS flow rule for the IP protocol to do RSS based on IPv4/IPv6 addresses. But if SCTP is supported, I'm happy to use ETH_RSS_L4_CHKSUM for it as well.

Quoted 3 lines

In flow API, if no l4 protocol in pattern , the PMD should return failure (or maybe some default behavior), and I think this is not a new question as it happens all the cases e.g.:
pattern eth / vlan / end action rss type ipv4 .

IMHO, it would be pretty logical to apply RSS to IPv4 packets only and send everything else to default queue.

Quoted 5 lines
Quoted 3 lines

Is UDP checksum 0 treated as no checksum and go to default queue or treated as a regular checksum with value equal to 0?

I think we can treat it as value 0, as least our hardware behavior like this, is this any issue?

OK, no problem. Just document it.

Quoted 8 lines
Quoted 5 lines

I tend to agree that 3 flags is too much for the feature, but one flag without properly defined meaning is not good as well.

I just want rules to be defined and documented.'

Agree, we need more document for this. if you agree above proposal.

#18 lore raw

Re: [dpdk-dev] [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 70 lines

-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Wednesday, July 7, 2021 5:49 PM
To: Zhang, Qi Z <[email protected]>; Zhang, AlvinX <[email protected]>; [email protected]
Cc: [email protected]
Subject: Re: [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 50 lines · Qi Z
Quoted 50 lines

-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Tuesday, July 6, 2021 4:05 PM
To: Zhang, Qi Z <[email protected]>; Zhang, AlvinX <[email protected]>; [email protected]
Cc: [email protected]
Subject: Re: [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 23 lines · Qi Z
Quoted 23 lines

-----Original Message-----
From: Zhang, AlvinX <[email protected]>
Sent: Tuesday, July 6, 2021 3:06 PM
To: Andrew Rybchenko <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 8 lines

Review struct rte_eth_rss_conf { · line 541

Quoted 6 lines
(quoted diff) +2 -0
@@ -537,6 +537,8 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+#define ETH_RSS_L4_CHKSUM	   (1ULL << 35)

What does efine which L4 protocols are supported? How user will know?

I think if we want to support L4 checksum RSS by using below command port config all rss (all|default|eth|vlan|...)

Quoted 7 lines
Quoted 7 lines

We must define TCP/UDP/SCTP checksum RSS separately:
#define ETH_RSS_TCP_CHKSUM (1ULL << 35)
#define ETH_RSS_UDP_CHKSUM (1ULL << 36)
#deifne ETH_RSS_SCTP_CHKSUM (1ULL << 37)

Here 3 bits are occupied, this is not good for there are not many bits

available.

Quoted 7 lines
Quoted 6 lines

If we only want to using it in flows, we only need to define ETH_RSS_L4_CHKSUM, because the flow pattern pointed out the L4 protocol type.
flow create 0 ingress pattern eth / ipv4 / tcp / end actions rss types l4-chksum end queues end / end

Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

+1, the pattern already give the hint to avoid the ambiguity and I +think we

already have ETH_RSS_LEVEL to figure out inner or outer.

The problem that it may be used in generic RSS flags which has no the

context.

Quoted 3 lines
Quoted 1 line

Also even in the case of flow API context could have no L4 protocol at all.

For generic case, it can simply assume it cover all L4 checksum cases and I'm

Quoted 8 lines

not sure if any user intend to use it as generic RSS, pmd can simply reject it if it's not necessary to support.

Try to look at it from an application point of view which does not know any specifics of the driver.

* Get dev_info and see ETH_RSS_L4_CHKSUM, good!, would like to use it.

The PMD should not expose it if it don't want to (or not able to) support all l4 checksum from generic RSS configure

And we should assume this is only apply for generic RSS configure but not for flow API.

Because the rte_flow_validate is the recommended method to check if a RSS action is supported in flow API or not.

Quoted 11 lines

* If I try to use it in default RSS config, but the request fail, it could be very confusing.

* Will it distribute TCP packets? UDP packets? SCTP packets? Or should I care about RSS for some of them based on other supported fields? E.g. if SCTP is not supported by the NIC, I need to install RSS flow rule for the IP protocol to do RSS based on IPv4/IPv6 addresses. But if SCTP is supported, I'm happy to use ETH_RSS_L4_CHKSUM for it as well.

Quoted 8 lines
Quoted 5 lines

In flow API, if no l4 protocol in pattern , the PMD should return failure (or maybe some default behavior), and I think this is not a new question as it happens all the cases
e.g.:
pattern eth / vlan / end action rss type ipv4 .

IMHO, it would be pretty logical to apply RSS to IPv4 packets only and send everything else to default queue.

Yes, this also make sense to me, but I think PMD's flow parser still can have more strict check, as it does not drop any feature that the NIC can support.

Quoted 18 lines
Quoted 6 lines
Quoted 4 lines

Is UDP checksum 0 treated as no checksum and go to default queue or treated as a regular checksum with value equal to 0?

I think we can treat it as value 0, as least our hardware behavior like this, is

this any issue?

OK, no problem. Just document it.

Quoted 8 lines
Quoted 5 lines

I tend to agree that 3 flags is too much for the feature, but one flag without properly defined meaning is not good as well.

I just want rules to be defined and documented.'

Agree, we need more document for this. if you agree above proposal.

#19 lore raw

Re: [dpdk-dev] [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 73 lines · Qi Z
Quoted 73 lines

-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Wednesday, July 7, 2021 5:49 PM
To: Zhang, Qi Z <[email protected]>; Zhang, AlvinX <[email protected]>; [email protected]
Cc: [email protected]
Subject: Re: [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 50 lines · Qi Z
Quoted 50 lines

-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Tuesday, July 6, 2021 4:05 PM
To: Zhang, Qi Z <[email protected]>; Zhang, AlvinX <[email protected]>; [email protected]
Cc: [email protected]
Subject: Re: [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 23 lines · Qi Z
Quoted 23 lines

-----Original Message-----
From: Zhang, AlvinX <[email protected]>
Sent: Tuesday, July 6, 2021 3:06 PM
To: Andrew Rybchenko <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 8 lines

Review struct rte_eth_rss_conf { · line 541

Quoted 6 lines
(quoted diff) +2 -0
@@ -537,6 +537,8 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+#define ETH_RSS_L4_CHKSUM	   (1ULL << 35)

What does efine which L4 protocols are supported? How user will know?

I think if we want to support L4 checksum RSS by using below command port config all rss (all|default|eth|vlan|...)

Quoted 7 lines
Quoted 7 lines

We must define TCP/UDP/SCTP checksum RSS separately:
#define ETH_RSS_TCP_CHKSUM (1ULL << 35)
#define ETH_RSS_UDP_CHKSUM (1ULL << 36)
#deifne ETH_RSS_SCTP_CHKSUM (1ULL << 37)

Here 3 bits are occupied, this is not good for there are not many bits

available.

Quoted 7 lines
Quoted 6 lines

If we only want to using it in flows, we only need to define ETH_RSS_L4_CHKSUM, because the flow pattern pointed out the L4 protocol type.
flow create 0 ingress pattern eth / ipv4 / tcp / end actions rss types l4-chksum end queues end / end

Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

+1, the pattern already give the hint to avoid the ambiguity and I +think we

already have ETH_RSS_LEVEL to figure out inner or outer.

The problem that it may be used in generic RSS flags which has no the

context.

Quoted 3 lines
Quoted 1 line

Also even in the case of flow API context could have no L4 protocol at all.

For generic case, it can simply assume it cover all L4 checksum cases and I'm

not sure if any user intend to use it as generic RSS, pmd can simply reject it if it's not necessary to support.

Quoted 8 lines
Quoted 5 lines

Try to look at it from an application point of view which does not know any specifics of the driver.

* Get dev_info and see ETH_RSS_L4_CHKSUM, good!, would like to use it.

The PMD should not expose it if it don't want to (or not able to) support all l4 checksum from generic RSS configure

Document what is "all L4".

Quoted 2 lines

And we should assume this is only apply for generic RSS configure but not for flow API.

I don't think so. IMHO, it should report all RSS capabilities regardless generic vs flow API RSS action.

It is just RSS capabilities reporting w/o any context.

Quoted 2 lines

Because the rte_flow_validate is the recommended method to check if a RSS action is supported in flow API or not.

It could restrict the subset. But superset should be reported in caps.

Quoted 42 lines
Quoted 12 lines

* If I try to use it in default RSS config, but the request fail, it could be very confusing.

* Will it distribute TCP packets? UDP packets? SCTP packets? Or should I care about RSS for some of them based on other supported fields? E.g. if SCTP is not supported by the NIC, I need to install RSS flow rule for the IP protocol to do RSS based on IPv4/IPv6 addresses. But if SCTP is supported, I'm happy to use ETH_RSS_L4_CHKSUM for it as well.

Quoted 8 lines
Quoted 5 lines

In flow API, if no l4 protocol in pattern , the PMD should return failure (or maybe some default behavior), and I think this is not a new question as it happens all the cases
e.g.:
pattern eth / vlan / end action rss type ipv4 .

IMHO, it would be pretty logical to apply RSS to IPv4 packets only and send everything else to default queue.

Yes, this also make sense to me, but I think PMD's flow parser still can have more strict check, as it does not drop any feature that the NIC can support.

Quoted 18 lines
Quoted 6 lines
Quoted 4 lines

Is UDP checksum 0 treated as no checksum and go to default queue or treated as a regular checksum with value equal to 0?

I think we can treat it as value 0, as least our hardware behavior like this, is

this any issue?

OK, no problem. Just document it.

Quoted 8 lines
Quoted 5 lines

I tend to agree that 3 flags is too much for the feature, but one flag without properly defined meaning is not good as well.

I just want rules to be defined and documented.'

Agree, we need more document for this. if you agree above proposal.

#20 lore raw

Re: [dpdk-dev] [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 98 lines

-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Wednesday, July 7, 2021 9:11 PM
To: Zhang, Qi Z <[email protected]>; Zhang, AlvinX <[email protected]>; [email protected]
Cc: [email protected]
Subject: Re: [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 35 lines · Qi Z
Quoted 35 lines

-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Wednesday, July 7, 2021 5:49 PM
To: Zhang, Qi Z <[email protected]>; Zhang, AlvinX <[email protected]>; [email protected]
Cc: [email protected]
Subject: Re: [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 23 lines · Qi Z
Quoted 23 lines

-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Tuesday, July 6, 2021 4:05 PM
To: Zhang, Qi Z <[email protected]>; Zhang, AlvinX <[email protected]>; [email protected]
Cc: [email protected]
Subject: Re: [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 11 lines · Qi Z
Quoted 11 lines

-----Original Message-----
From: Zhang, AlvinX <[email protected]>
Sent: Tuesday, July 6, 2021 3:06 PM
To: Andrew Rybchenko <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Review struct rte_eth_rss_conf { · line 541

Quoted 6 lines
(quoted diff) +2 -0
@@ -537,6 +537,8 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+#define ETH_RSS_L4_CHKSUM	   (1ULL << 35)

What does efine which L4 protocols are supported? How user will

know?

Quoted 36 lines
Quoted 36 lines
Quoted 19 lines
Quoted 19 lines
Quoted 11 lines
Quoted 11 lines

I think if we want to support L4 checksum RSS by using below command port config all rss (all|default|eth|vlan|...)

We must define TCP/UDP/SCTP checksum RSS separately:
#define ETH_RSS_TCP_CHKSUM (1ULL << 35)
#define ETH_RSS_UDP_CHKSUM (1ULL << 36)
#deifne ETH_RSS_SCTP_CHKSUM (1ULL << 37)

Here 3 bits are occupied, this is not good for there are not many bits

available.

Quoted 7 lines
Quoted 6 lines

If we only want to using it in flows, we only need to define ETH_RSS_L4_CHKSUM, because the flow pattern pointed out the L4 protocol type.
flow create 0 ingress pattern eth / ipv4 / tcp / end actions rss types l4-chksum end queues end / end

Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

+1, the pattern already give the hint to avoid the ambiguity and I +think we

already have ETH_RSS_LEVEL to figure out inner or outer.

The problem that it may be used in generic RSS flags which has no the

context.

Quoted 4 lines
Quoted 1 line

Also even in the case of flow API context could have no L4 protocol at all.

For generic case, it can simply assume it cover all L4 checksum cases and I'm

not sure if any user intend to use it as generic RSS, pmd can simply reject it if it's not necessary to support.

Try to look at it from an application point of view which does not know any specifics of the driver.

Quoted 6 lines
Quoted 2 lines

* Get dev_info and see ETH_RSS_L4_CHKSUM, good!, would like to use it.

The PMD should not expose it if it don't want to (or not able to) support all l4 checksum from generic RSS configure

Quoted 8 lines

Document what is "all L4".

Quoted 2 lines

And we should assume this is only apply for generic RSS configure but not for

flow API.

I don't think so. IMHO, it should report all RSS capabilities regardless generic vs flow API RSS action.

The RSS action in flow API could cover lots of possibility.
for example an ETH_RSS_IPV4 can be applied on a GTPU flow for inner but may not work for a VxLan flow's inner l3 at the same time. it's difficult to accurately describe all of these by a 64 bits capability, it's more practice to just rely on rte_flow_validation. Otherwise it will always leading the confusing you mentioned in previous mail.

It is more reasonable for me, the driver just expose some basic RSS bit that everybody can easiely understand,(e.g.: 5 tuple.), and left all the complexity capability probe to flow API.

Quoted 57 lines

It is just RSS capabilities reporting w/o any context.

Quoted 2 lines

Because the rte_flow_validate is the recommended method to check if a RSS

action is supported in flow API or not.

It could restrict the subset. But superset should be reported in caps.

Quoted 18 lines
Quoted 18 lines

* If I try to use it in default RSS config, but the request fail, it could be very confusing.

* Will it distribute TCP packets? UDP packets? SCTP packets? Or should I care about RSS for some of them based on other supported fields? E.g. if SCTP is not supported by the NIC, I need to install RSS flow rule for the IP protocol to do RSS based on IPv4/IPv6 addresses. But if SCTP is supported, I'm happy to use ETH_RSS_L4_CHKSUM for it as well.

Quoted 5 lines

In flow API, if no l4 protocol in pattern , the PMD should return failure (or maybe some default behavior), and I think this is not a new question as it happens all the cases
e.g.:
pattern eth / vlan / end action rss type ipv4 .

Quoted 4 lines
Quoted 2 lines

IMHO, it would be pretty logical to apply RSS to IPv4 packets only and send everything else to default queue.

Yes, this also make sense to me, but I think PMD's flow parser still can have

more strict check, as it does not drop any feature that the NIC can support.

Quoted 21 lines
Quoted 20 lines
Quoted 8 lines
Quoted 5 lines

Is UDP checksum 0 treated as no checksum and go to default queue or treated as a regular checksum with value equal to 0?

I think we can treat it as value 0, as least our hardware behavior like this, is

this any issue?

OK, no problem. Just document it.

Quoted 8 lines
Quoted 5 lines

I tend to agree that 3 flags is too much for the feature, but one flag without properly defined meaning is not good as well.

I just want rules to be defined and documented.'

Agree, we need more document for this. if you agree above proposal.

#21 lore raw

Re: [dpdk-dev] [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

@Thomas, @Ferruh, @Ori I need your opinion on the discussion.

Quoted 108 lines · Qi Z
Quoted 98 lines

-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Wednesday, July 7, 2021 9:11 PM
To: Zhang, Qi Z <[email protected]>; Zhang, AlvinX <[email protected]>; [email protected]
Cc: [email protected]
Subject: Re: [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 35 lines · Qi Z
Quoted 35 lines

-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Wednesday, July 7, 2021 5:49 PM
To: Zhang, Qi Z <[email protected]>; Zhang, AlvinX <[email protected]>; [email protected]
Cc: [email protected]
Subject: Re: [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 23 lines · Qi Z
Quoted 23 lines

-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Tuesday, July 6, 2021 4:05 PM
To: Zhang, Qi Z <[email protected]>; Zhang, AlvinX <[email protected]>; [email protected]
Cc: [email protected]
Subject: Re: [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 11 lines · Qi Z
Quoted 11 lines

-----Original Message-----
From: Zhang, AlvinX <[email protected]>
Sent: Tuesday, July 6, 2021 3:06 PM
To: Andrew Rybchenko <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Review struct rte_eth_rss_conf { · line 541

Quoted 6 lines
(quoted diff) +2 -0
@@ -537,6 +537,8 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+#define ETH_RSS_L4_CHKSUM	   (1ULL << 35)

What does efine which L4 protocols are supported? How user will

know?

Quoted 36 lines
Quoted 36 lines
Quoted 19 lines
Quoted 19 lines
Quoted 11 lines
Quoted 11 lines

I think if we want to support L4 checksum RSS by using below command port config all rss (all|default|eth|vlan|...)

We must define TCP/UDP/SCTP checksum RSS separately:
#define ETH_RSS_TCP_CHKSUM (1ULL << 35)
#define ETH_RSS_UDP_CHKSUM (1ULL << 36)
#deifne ETH_RSS_SCTP_CHKSUM (1ULL << 37)

Here 3 bits are occupied, this is not good for there are not many bits

available.

Quoted 7 lines
Quoted 6 lines

If we only want to using it in flows, we only need to define ETH_RSS_L4_CHKSUM, because the flow pattern pointed out the L4 protocol type.
flow create 0 ingress pattern eth / ipv4 / tcp / end actions rss types l4-chksum end queues end / end

Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

+1, the pattern already give the hint to avoid the ambiguity and I +think we

already have ETH_RSS_LEVEL to figure out inner or outer.

The problem that it may be used in generic RSS flags which has no the

context.

Quoted 4 lines
Quoted 1 line

Also even in the case of flow API context could have no L4 protocol at all.

For generic case, it can simply assume it cover all L4 checksum cases and I'm

not sure if any user intend to use it as generic RSS, pmd can simply reject it if it's not necessary to support.

Try to look at it from an application point of view which does not know any specifics of the driver.

Quoted 6 lines
Quoted 2 lines

* Get dev_info and see ETH_RSS_L4_CHKSUM, good!, would like to use it.

The PMD should not expose it if it don't want to (or not able to) support all l4 checksum from generic RSS configure

Quoted 8 lines

Document what is "all L4".

Quoted 2 lines

And we should assume this is only apply for generic RSS configure but not for

flow API.

I don't think so. IMHO, it should report all RSS capabilities regardless generic vs flow API RSS action.

Quoted 6 lines

The RSS action in flow API could cover lots of possibility.
for example an ETH_RSS_IPV4 can be applied on a GTPU flow for inner but may not work for a VxLan flow's inner l3 at the same time. it's difficult to accurately describe all of these by a 64 bits capability, it's more practice to just rely on rte_flow_validation. Otherwise it will always leading the confusing you mentioned in previous mail.

It is more reasonable for me, the driver just expose some basic RSS bit that everybody can easiely understand,(e.g.: 5 tuple.), and left all the complexity capability probe to flow API.

May be it is OK to report subset in dev_info->flow_type_rss_offloads, but I'm very uncomfortable with the approach. Superset sounds more logical to me, but has drawbacks as well.

Quoted 59 lines
Quoted 58 lines

It is just RSS capabilities reporting w/o any context.

Quoted 2 lines

Because the rte_flow_validate is the recommended method to check if a RSS

action is supported in flow API or not.

It could restrict the subset. But superset should be reported in caps.

Quoted 18 lines
Quoted 18 lines

* If I try to use it in default RSS config, but the request fail, it could be very confusing.

* Will it distribute TCP packets? UDP packets? SCTP packets? Or should I care about RSS for some of them based on other supported fields? E.g. if SCTP is not supported by the NIC, I need to install RSS flow rule for the IP protocol to do RSS based on IPv4/IPv6 addresses. But if SCTP is supported, I'm happy to use ETH_RSS_L4_CHKSUM for it as well.

Quoted 5 lines

In flow API, if no l4 protocol in pattern , the PMD should return failure (or maybe some default behavior), and I think this is not a new question as it happens all the cases
e.g.:
pattern eth / vlan / end action rss type ipv4 .

Quoted 4 lines
Quoted 2 lines

IMHO, it would be pretty logical to apply RSS to IPv4 packets only and send everything else to default queue.

Yes, this also make sense to me, but I think PMD's flow parser still can have

more strict check, as it does not drop any feature that the NIC can support.

Quoted 21 lines
Quoted 20 lines
Quoted 8 lines
Quoted 5 lines

Is UDP checksum 0 treated as no checksum and go to default queue or treated as a regular checksum with value equal to 0?

I think we can treat it as value 0, as least our hardware behavior like this, is

this any issue?

OK, no problem. Just document it.

Quoted 8 lines
Quoted 5 lines

I tend to agree that 3 flags is too much for the feature, but one flag without properly defined meaning is not good as well.

I just want rules to be defined and documented.'

Agree, we need more document for this. if you agree above proposal.

#22 lore raw

Re: [dpdk-dev] [PATCH v3] ethdev: add IPv4 and L4 checksum RSS offload types

08/07/2021 09:45, Andrew Rybchenko:

Quoted 61 lines

@Thomas, @Ferruh, @Ori I need your opinion on the discussion.

Quoted 58 lines · Qi Z

From: Andrew Rybchenko <[email protected]>

Quoted 57 lines
Quoted 14 lines

From: Andrew Rybchenko <[email protected]>

Quoted 13 lines · Qi Z
Quoted 12 lines

From: Andrew Rybchenko <[email protected]>

Quoted 11 lines · Qi Z
Quoted 10 lines

From: Zhang, AlvinX <[email protected]>

Quoted 9 lines
Quoted 9 lines

Review struct rte_eth_rss_conf { · line 541

Quoted 7 lines
(quoted diff) +2 -0
@@ -537,6 +537,8 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+#define ETH_RSS_L4_CHKSUM	   (1ULL << 35)

What does efine which L4 protocols are supported? How user will

know?

Quoted 42 lines
Quoted 30 lines
Quoted 19 lines
Quoted 19 lines
Quoted 11 lines
Quoted 11 lines

I think if we want to support L4 checksum RSS by using below command port config all rss (all|default|eth|vlan|...)

We must define TCP/UDP/SCTP checksum RSS separately:
#define ETH_RSS_TCP_CHKSUM (1ULL << 35)
#define ETH_RSS_UDP_CHKSUM (1ULL << 36)
#deifne ETH_RSS_SCTP_CHKSUM (1ULL << 37)

Here 3 bits are occupied, this is not good for there are not many bits

available.

Quoted 7 lines
Quoted 6 lines

If we only want to using it in flows, we only need to define ETH_RSS_L4_CHKSUM, because the flow pattern pointed out the L4 protocol type.
flow create 0 ingress pattern eth / ipv4 / tcp / end actions rss types l4-chksum end queues end / end

Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

+1, the pattern already give the hint to avoid the ambiguity and I +think we

already have ETH_RSS_LEVEL to figure out inner or outer.

The problem that it may be used in generic RSS flags which has no the

context.

Quoted 4 lines
Quoted 1 line

Also even in the case of flow API context could have no L4 protocol at all.

For generic case, it can simply assume it cover all L4 checksum cases and I'm

Quoted 8 lines

not sure if any user intend to use it as generic RSS, pmd can simply reject it if it's not necessary to support.

Try to look at it from an application point of view which does not know any specifics of the driver.

* Get dev_info and see ETH_RSS_L4_CHKSUM, good!, would like to use it.

The PMD should not expose it if it don't want to (or not able to) support all l4 checksum from generic RSS configure

That's restrictive to allow only full-support, but I'm fine with the trade-off to avoid wasting bits.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Document what is "all L4".

List of L4 protocols should be explicit.

Quoted 12 lines
Quoted 12 lines
Quoted 5 lines
Quoted 1 line

And we should assume this is only apply for generic RSS configure but not for

flow API.

I don't think so. IMHO, it should report all RSS capabilities regardless generic vs flow API RSS action.

The RSS action in flow API could cover lots of possibility.
for example an ETH_RSS_IPV4 can be applied on a GTPU flow for inner but may not work for a VxLan flow's inner l3 at the same time. it's difficult to accurately describe all of these by a 64 bits capability, it's more practice to just rely on rte_flow_validation. Otherwise it will always leading the confusing you mentioned in previous mail.

Quoted 6 lines
Quoted 1 line

It is more reasonable for me, the driver just expose some basic RSS bit that everybody can easiely understand,(e.g.: 5 tuple.), and left all the complexity capability probe to flow API.

May be it is OK to report subset in dev_info->flow_type_rss_offloads, but I'm very uncomfortable with the approach. Superset sounds more logical to me, but has drawbacks as well.

Yes superset should be reported, this is the meaning of capabilities:
the driver is capable but there are some limitations
which cannot be advertised, so rte_flow_validate checks the limitations in the dynamic context.

Quoted 44 lines
Quoted 44 lines
Quoted 44 lines

It is just RSS capabilities reporting w/o any context.

Quoted 2 lines

Because the rte_flow_validate is the recommended method to check if a RSS

action is supported in flow API or not.

It could restrict the subset. But superset should be reported in caps.

Quoted 18 lines
Quoted 18 lines

* If I try to use it in default RSS config, but the request fail, it could be very confusing.

* Will it distribute TCP packets? UDP packets? SCTP packets? Or should I care about RSS for some of them based on other supported fields? E.g. if SCTP is not supported by the NIC, I need to install RSS flow rule for the IP protocol to do RSS based on IPv4/IPv6 addresses. But if SCTP is supported, I'm happy to use ETH_RSS_L4_CHKSUM for it as well.

Quoted 5 lines

In flow API, if no l4 protocol in pattern , the PMD should return failure (or maybe some default behavior), and I think this is not a new question as it happens all the cases
e.g.:
pattern eth / vlan / end action rss type ipv4 .

Quoted 4 lines
Quoted 2 lines

IMHO, it would be pretty logical to apply RSS to IPv4 packets only and send everything else to default queue.

Yes, this also make sense to me, but I think PMD's flow parser still can have

more strict check, as it does not drop any feature that the NIC can support.

Quoted 13 lines
Quoted 13 lines
Quoted 8 lines
Quoted 5 lines

Is UDP checksum 0 treated as no checksum and go to default queue or treated as a regular checksum with value equal to 0?

I think we can treat it as value 0, as least our hardware behavior like this, is

this any issue?

OK, no problem. Just document it.

Quoted 1 line
Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

I tend to agree that 3 flags is too much for the feature, but one flag without properly defined meaning is not good as well.

I just want rules to be defined and documented.'

Agree, we need more document for this. if you agree above proposal.

Yes please do not add a new flag in rte_ethdev.h without doc.

#23 lore raw

PATCH v4 1/1 ethdev: add IPv4 and L4 checksum RSS offload types

In reply to Alvin Zhang

This patch defines new RSS offload types for IPv4 and L4(TCP/UDP/SCTP) checksum, which are required when users want to distribute packets based on the IPv4 or L4 checksum field.

For example "flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-chksum end queues end / end", this flow causes all matching packets to be distributed to queues on basis of IPv4 checksum.

---

v3: Add L4 checksum RSS offload type
v4: Add doc and help string, update commit log

---
 app/test-pmd/cmdline.c  | 12 +++++++++---
 app/test-pmd/config.c   |  2 ++
 lib/ethdev/rte_ethdev.h |  2 ++
 3 files changed, 13 insertions(+), 3 deletions(-)
app/test-pmd/cmdline.c +9 -3
index 0268b18..93543d8 100644
@@ -2254,6 +2254,10 @@ struct cmd_config_rss {
 		rss_conf.rss_hf = ETH_RSS_ECPRI;
 	else if (!strcmp(res->value, "mpls"))
 		rss_conf.rss_hf = ETH_RSS_MPLS;
+	else if (!strcmp(res->value, "ipv4-chksum"))
+		rss_conf.rss_hf = ETH_RSS_IPV4_CHKSUM;
+	else if (!strcmp(res->value, "l4-chksum"))
+		rss_conf.rss_hf = ETH_RSS_L4_CHKSUM;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "level-default")) {
@@ -2325,7 +2329,7 @@ struct cmd_config_rss {
 	.help_str = "port config all rss "
 		"all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|"
 		"nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"
-		"level-outer|level-inner|<flowtype_id>",
+		"level-outer|level-inner|ipv4-chksum|l4-chksum|<flowtype_id>",
 	.tokens = {
 		(void *)&cmd_config_rss_port,
 		(void *)&cmd_config_rss_keyword,
@@ -2438,7 +2442,8 @@ struct cmd_config_rss_hash_key {
 				 "ipv6-tcp-ex#ipv6-udp-ex#"
 				 "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");
+				 "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls#"
+				 "ipv4-chksum#l4-chksum");
 cmdline_parse_token_string_t cmd_config_rss_hash_key_value =
 	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);
 
@@ -2451,7 +2456,8 @@ struct cmd_config_rss_hash_key {
 		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
 		"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 "
+		"l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls|"
+		"ipv4-chksum|l4-chksum "
 		"<string of hex digits (variable length, NIC dependent)>",
 	.tokens = {
 		(void *)&cmd_config_rss_hash_key_port,
app/test-pmd/config.c +2 -0
index 43c79b5..14968bf 100644
@@ -140,6 +140,8 @@
 	{ "gtpu", ETH_RSS_GTPU },
 	{ "ecpri", ETH_RSS_ECPRI },
 	{ "mpls", ETH_RSS_MPLS },
+	{ "ipv4-chksum", ETH_RSS_IPV4_CHKSUM },
+	{ "l4-chksum", ETH_RSS_L4_CHKSUM },
 	{ NULL, 0 },
 };
 
lib/ethdev/rte_ethdev.h +2 -0
index faf3bd9..63b0321 100644
@@ -537,6 +537,8 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+#define ETH_RSS_L4_CHKSUM	   (1ULL << 35)	/* TCP/UDP/SCTP */
 
 /*
  * We use the following macros to combine with above ETH_RSS_* for
Signature · 1 line
1.8.3.1
#24 lore raw

Re: [dpdk-dev] [PATCH v4] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 11 lines · Alvin Zhang

This patch defines new RSS offload types for IPv4 and L4(TCP/UDP/SCTP) checksum, which are required when users want to distribute packets based on the IPv4 or L4 checksum field.

For example "flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-chksum end queues end / end", this flow causes all matching packets to be distributed to queues on basis of IPv4 checksum.

I've failed to find mail where I've added the tag. I've replied with "LGTM" for v2 which has IPv4 checksum only and many comments on L4 checksum added in v3. So, I think it is incorrect to inherit "LGTM" as Reviewed-by.

Quoted 74 lines

---

v3: Add L4 checksum RSS offload type
v4: Add doc and help string, update commit log

---
 app/test-pmd/cmdline.c  | 12 +++++++++---
 app/test-pmd/config.c   |  2 ++
 lib/ethdev/rte_ethdev.h |  2 ++
 3 files changed, 13 insertions(+), 3 deletions(-)
app/test-pmd/cmdline.c +9 -3
index 0268b18..93543d8 100644
@@ -2254,6 +2254,10 @@ struct cmd_config_rss {
 		rss_conf.rss_hf = ETH_RSS_ECPRI;
 	else if (!strcmp(res->value, "mpls"))
 		rss_conf.rss_hf = ETH_RSS_MPLS;
+	else if (!strcmp(res->value, "ipv4-chksum"))
+		rss_conf.rss_hf = ETH_RSS_IPV4_CHKSUM;
+	else if (!strcmp(res->value, "l4-chksum"))
+		rss_conf.rss_hf = ETH_RSS_L4_CHKSUM;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "level-default")) {
@@ -2325,7 +2329,7 @@ struct cmd_config_rss {
 	.help_str = "port config all rss "
 		"all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|"
 		"nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"
-		"level-outer|level-inner|<flowtype_id>",
+		"level-outer|level-inner|ipv4-chksum|l4-chksum|<flowtype_id>",
 	.tokens = {
 		(void *)&cmd_config_rss_port,
 		(void *)&cmd_config_rss_keyword,
@@ -2438,7 +2442,8 @@ struct cmd_config_rss_hash_key {
 				 "ipv6-tcp-ex#ipv6-udp-ex#"
 				 "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");
+				 "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls#"
+				 "ipv4-chksum#l4-chksum");
 cmdline_parse_token_string_t cmd_config_rss_hash_key_value =
 	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);
 
@@ -2451,7 +2456,8 @@ struct cmd_config_rss_hash_key {
 		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
 		"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 "
+		"l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls|"
+		"ipv4-chksum|l4-chksum "
 		"<string of hex digits (variable length, NIC dependent)>",
 	.tokens = {
 		(void *)&cmd_config_rss_hash_key_port,
app/test-pmd/config.c +2 -0
index 43c79b5..14968bf 100644
@@ -140,6 +140,8 @@
 	{ "gtpu", ETH_RSS_GTPU },
 	{ "ecpri", ETH_RSS_ECPRI },
 	{ "mpls", ETH_RSS_MPLS },
+	{ "ipv4-chksum", ETH_RSS_IPV4_CHKSUM },
+	{ "l4-chksum", ETH_RSS_L4_CHKSUM },
 	{ NULL, 0 },
 };
 
lib/ethdev/rte_ethdev.h +0 -0
index faf3bd9..63b0321 100644

lib/ethdev/rte_ethdev.h struct rte_eth_rss_conf { · line 541

Quoted 5 lines
lib/ethdev/rte_ethdev.h +2 -0
@@ -537,6 +537,8 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+#define ETH_RSS_L4_CHKSUM	   (1ULL << 35)	/* TCP/UDP/SCTP */

It does not reply on my questions at all.

Nack

#25 lore raw

Re: [dpdk-dev] [PATCH v4] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 18 lines

-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Tuesday, July 13, 2021 3:55 PM
To: Zhang, AlvinX <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Cc: [email protected]; Singh, Aman Deep <[email protected]>
Subject: Re: [PATCH v4] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 9 lines · Alvin Zhang

This patch defines new RSS offload types for IPv4 and L4(TCP/UDP/SCTP) checksum, which are required when users want to distribute packets based on the IPv4 or L4 checksum field.

For example "flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-chksum end queues end / end", this flow causes all matching packets to be distributed to queues on basis of IPv4 checksum.

Quoted 7 lines
Quoted 2 lines

I've failed to find mail where I've added the tag. I've replied with "LGTM" for v2 which has IPv4 checksum only and many comments on L4 checksum added in v3. So, I think it is incorrect to inherit "LGTM" as Reviewed-by.

I'll correct it at next version.

Quoted 82 lines
Quoted 29 lines

---

v3: Add L4 checksum RSS offload type
v4: Add doc and help string, update commit log

---
 app/test-pmd/cmdline.c  | 12 +++++++++---
 app/test-pmd/config.c   |  2 ++
 lib/ethdev/rte_ethdev.h |  2 ++
 3 files changed, 13 insertions(+), 3 deletions(-)
app/test-pmd/cmdline.c index renamed from app/test-pmd/cmdline.c +0 -0

0268b18..93543d8 100644

app/test-pmd/cmdline.c +4 -0
@@ -2254,6 +2254,10 @@ struct cmd_config_rss {
 		rss_conf.rss_hf = ETH_RSS_ECPRI;
 	else if (!strcmp(res->value, "mpls"))
 		rss_conf.rss_hf = ETH_RSS_MPLS;
+	else if (!strcmp(res->value, "ipv4-chksum"))
+		rss_conf.rss_hf = ETH_RSS_IPV4_CHKSUM;
+	else if (!strcmp(res->value, "l4-chksum"))
+		rss_conf.rss_hf = ETH_RSS_L4_CHKSUM;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "level-default")) { @@ -2325,7 +2329,7

@@ struct cmd_config_rss {

app/test-pmd/cmdline.c struct cmd_config_rss { · line 2330

Quoted 2 lines
app/test-pmd/cmdline.c +0 -0
 	.help_str = "port config all rss "
 		"all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|"
	"nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"
> -		"level-outer|level-inner|<flowtype_id>",
> +		"level-outer|level-inner|ipv4-chksum|l4-chksum|<flowtype_id>",
Quoted 41 lines
app/test-pmd/cmdline.c +4 -2
 	.tokens = {
 		(void *)&cmd_config_rss_port,
 		(void *)&cmd_config_rss_keyword,
@@ -2438,7 +2442,8 @@ struct cmd_config_rss_hash_key {
 				 "ipv6-tcp-ex#ipv6-udp-ex#"
 				 "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");
+				 "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls#"
+				 "ipv4-chksum#l4-chksum");
 cmdline_parse_token_string_t cmd_config_rss_hash_key_value =
 	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);
 
@@ -2451,7 +2456,8 @@ struct cmd_config_rss_hash_key {
 		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
 		"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 "
+		"l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls|"
+		"ipv4-chksum|l4-chksum "
 		"<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 43c79b5..14968bf 100644

app/test-pmd/config.c +2 -0
@@ -140,6 +140,8 @@
 	{ "gtpu", ETH_RSS_GTPU },
 	{ "ecpri", ETH_RSS_ECPRI },
 	{ "mpls", ETH_RSS_MPLS },
+	{ "ipv4-chksum", ETH_RSS_IPV4_CHKSUM },
+	{ "l4-chksum", ETH_RSS_L4_CHKSUM },
 	{ NULL, 0 },
 };
 
lib/ethdev/rte_ethdev.h index renamed from lib/ethdev/rte_ethdev.h +0 -0

faf3bd9..63b0321 100644

lib/ethdev/rte_ethdev.h struct rte_eth_rss_conf { · line 541

Quoted 5 lines
lib/ethdev/rte_ethdev.h +2 -0
@@ -537,6 +537,8 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+#define ETH_RSS_L4_CHKSUM	   (1ULL << 35)	/* TCP/UDP/SCTP */

It does not reply on my questions at all.

Quoted 7 lines · You have
Quoted 3 lines
Quoted 2 lines

I don't think so. IMHO, it should report all RSS capabilities regardless generic vs flow API RSS action.

May be it is OK to report subset in dev_info->flow_type_rss_offloads, but I'm very uncomfortable with the approach. Superset sounds more logical to me, but has drawbacks as well.

Here I have another question:
There are flow type definition and RSS offload type definition,

#define RTE_ETH_FLOW_RAW                 1       
#define RTE_ETH_FLOW_IPV4                2     
#define RTE_ETH_FLOW_FRAG_IPV4           3       
#define RTE_ETH_FLOW_NONFRAG_IPV4_TCP    4        
#define ETH_RSS_IPV4               (1ULL << 2)      
#define ETH_RSS_FRAG_IPV4          (1ULL << 3)         
#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << 4)        

are they the different expressions of the same concept?

If yes, why they have been decoupled by the commit: fce6b66893. Then what the flow type of ETH_RSS_PORT, it's UDP, TCP, or SCTP?

If not, the PMDs can report supported RSS flow type by dev_info->flow_type_rss_offloads, but have no way to report supported RSS offload types.

Thanks Alvin

Quoted 2 lines

Nack

#26 lore raw

Re: [dpdk-dev] [PATCH v4] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 21 lines · AlvinX
Quoted 21 lines

-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Tuesday, July 13, 2021 3:55 PM
To: Zhang, AlvinX <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Cc: [email protected]; Singh, Aman Deep <[email protected]>
Subject: Re: [PATCH v4] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 11 lines · Alvin Zhang

This patch defines new RSS offload types for IPv4 and L4(TCP/UDP/SCTP) checksum, which are required when users want to distribute packets based on the IPv4 or L4 checksum field.

For example "flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-chksum end queues end / end", this flow causes all matching packets to be distributed to queues on basis of IPv4 checksum.

Quoted 89 lines
Quoted 4 lines

I've failed to find mail where I've added the tag. I've replied with "LGTM" for v2 which has IPv4 checksum only and many comments on L4 checksum added in v3. So, I think it is incorrect to inherit "LGTM" as Reviewed-by.

I'll correct it at next version.

Quoted 82 lines
Quoted 29 lines

---

v3: Add L4 checksum RSS offload type
v4: Add doc and help string, update commit log

---
 app/test-pmd/cmdline.c  | 12 +++++++++---
 app/test-pmd/config.c   |  2 ++
 lib/ethdev/rte_ethdev.h |  2 ++
 3 files changed, 13 insertions(+), 3 deletions(-)
app/test-pmd/cmdline.c index renamed from app/test-pmd/cmdline.c +0 -0

0268b18..93543d8 100644

app/test-pmd/cmdline.c +4 -0
@@ -2254,6 +2254,10 @@ struct cmd_config_rss {
 		rss_conf.rss_hf = ETH_RSS_ECPRI;
 	else if (!strcmp(res->value, "mpls"))
 		rss_conf.rss_hf = ETH_RSS_MPLS;
+	else if (!strcmp(res->value, "ipv4-chksum"))
+		rss_conf.rss_hf = ETH_RSS_IPV4_CHKSUM;
+	else if (!strcmp(res->value, "l4-chksum"))
+		rss_conf.rss_hf = ETH_RSS_L4_CHKSUM;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "level-default")) { @@ -2325,7 +2329,7

@@ struct cmd_config_rss {

app/test-pmd/cmdline.c struct cmd_config_rss { · line 2330

Quoted 2 lines
app/test-pmd/cmdline.c +0 -0
 	.help_str = "port config all rss "
 		"all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|"
	"nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"
> -		"level-outer|level-inner|<flowtype_id>",
> +		"level-outer|level-inner|ipv4-chksum|l4-chksum|<flowtype_id>",
Quoted 41 lines
app/test-pmd/cmdline.c +4 -2
 	.tokens = {
 		(void *)&cmd_config_rss_port,
 		(void *)&cmd_config_rss_keyword,
@@ -2438,7 +2442,8 @@ struct cmd_config_rss_hash_key {
 				 "ipv6-tcp-ex#ipv6-udp-ex#"
 				 "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");
+				 "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls#"
+				 "ipv4-chksum#l4-chksum");
 cmdline_parse_token_string_t cmd_config_rss_hash_key_value =
 	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);
 
@@ -2451,7 +2456,8 @@ struct cmd_config_rss_hash_key {
 		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
 		"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 "
+		"l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls|"
+		"ipv4-chksum|l4-chksum "
 		"<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 43c79b5..14968bf 100644

app/test-pmd/config.c +2 -0
@@ -140,6 +140,8 @@
 	{ "gtpu", ETH_RSS_GTPU },
 	{ "ecpri", ETH_RSS_ECPRI },
 	{ "mpls", ETH_RSS_MPLS },
+	{ "ipv4-chksum", ETH_RSS_IPV4_CHKSUM },
+	{ "l4-chksum", ETH_RSS_L4_CHKSUM },
 	{ NULL, 0 },
 };
 
lib/ethdev/rte_ethdev.h index renamed from lib/ethdev/rte_ethdev.h +0 -0

faf3bd9..63b0321 100644

lib/ethdev/rte_ethdev.h struct rte_eth_rss_conf { · line 541

Quoted 5 lines
lib/ethdev/rte_ethdev.h +2 -0
@@ -537,6 +537,8 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+#define ETH_RSS_L4_CHKSUM	   (1ULL << 35)	/* TCP/UDP/SCTP */

It does not reply on my questions at all.

Above list of Layer 4 protocols does not say if the flag may be reported when all above protocols are supported or some protocols are supported only.

Also I had a question about UDP checksum 0 since it could be treated in a different ways since logically it is no checksum at all.

Quoted 16 lines
Quoted 7 lines · You have
Quoted 3 lines
Quoted 2 lines

I don't think so. IMHO, it should report all RSS capabilities regardless generic vs flow API RSS action.

May be it is OK to report subset in dev_info->flow_type_rss_offloads, but I'm very uncomfortable with the approach. Superset sounds more logical to me, but has drawbacks as well.

Here I have another question:
There are flow type definition and RSS offload type definition,

#define RTE_ETH_FLOW_RAW                 1       
#define RTE_ETH_FLOW_IPV4                2     
#define RTE_ETH_FLOW_FRAG_IPV4           3       
#define RTE_ETH_FLOW_NONFRAG_IPV4_TCP    4        
Quoted 5 lines
#define ETH_RSS_IPV4               (1ULL << 2)      
#define ETH_RSS_FRAG_IPV4          (1ULL << 3)         
#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << 4)        

are they the different expressions of the same concept?

Sorry, but I don't understand the question.

Quoted 2 lines

If yes, why they have been decoupled by the commit: fce6b66893.

Do you mean that motivation in the changeset description is not clear?

Quoted 1 line

Then what the flow type of ETH_RSS_PORT, it's UDP, TCP, or SCTP?

I have no answer to the question as well. That's why I'm trying to avoid it in the patch.

Quoted 3 lines

If not, the PMDs can report supported RSS flow type by dev_info->flow_type_rss_offloads, but have no way to report supported RSS offload types.

Sorry, don't understand.

Quoted 2 lines
Quoted 2 lines

Nack

#27 lore raw

Re: [dpdk-dev] [PATCH v4] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 125 lines

-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Tuesday, July 13, 2021 6:24 PM
To: Zhang, AlvinX <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Cc: [email protected]; Singh, Aman Deep <[email protected]>
Subject: Re: [PATCH v4] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 19 lines · AlvinX
Quoted 19 lines

-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Tuesday, July 13, 2021 3:55 PM
To: Zhang, AlvinX <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Cc: [email protected]; Singh, Aman Deep <[email protected]>
Subject: Re: [PATCH v4] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 9 lines · Alvin Zhang

This patch defines new RSS offload types for IPv4 and L4(TCP/UDP/SCTP) checksum, which are required when users want to distribute packets based on the IPv4 or L4 checksum field.

For example "flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-chksum end queues end / end", this flow causes all matching packets to be distributed to queues on basis of IPv4 checksum.

Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

I've failed to find mail where I've added the tag. I've replied with "LGTM" for v2 which has IPv4 checksum only and many comments on L4

checksum added in v3.

Quoted 27 lines
Quoted 2 lines

So, I think it is incorrect to inherit "LGTM" as Reviewed-by.

I'll correct it at next version.

Quoted 22 lines
Quoted 22 lines

---

v3: Add L4 checksum RSS offload type
v4: Add doc and help string, update commit log

---
 app/test-pmd/cmdline.c  | 12 +++++++++---
 app/test-pmd/config.c   |  2 ++
 lib/ethdev/rte_ethdev.h |  2 ++
 3 files changed, 13 insertions(+), 3 deletions(-)
app/test-pmd/cmdline.c index renamed from app/test-pmd/cmdline.c +0 -0

0268b18..93543d8 100644

app/test-pmd/cmdline.c +2 -0
@@ -2254,6 +2254,10 @@ struct cmd_config_rss {
 		rss_conf.rss_hf = ETH_RSS_ECPRI;
 	else if (!strcmp(res->value, "mpls"))
 		rss_conf.rss_hf = ETH_RSS_MPLS;
+	else if (!strcmp(res->value, "ipv4-chksum"))
+		rss_conf.rss_hf = ETH_RSS_IPV4_CHKSUM;
Quoted 8 lines
Quoted 8 lines

app/test-pmd/cmdline.c struct cmd_config_rss {

Quoted 8 lines
app/test-pmd/cmdline.c +3 -0
+	else if (!strcmp(res->value, "l4-chksum"))
+		rss_conf.rss_hf = ETH_RSS_L4_CHKSUM;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "level-default")) { @@ -2325,7
+2329,7 @@ struct cmd_config_rss {
 	.help_str = "port config all rss "

"all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|"

Quoted 42 lines
Quoted 42 lines
Quoted 1 line
	"nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"
> -		"level-outer|level-inner|<flowtype_id>",
> +		"level-outer|level-inner|ipv4-chksum|l4-chksum|<flowtype_id>",
Quoted 38 lines
app/test-pmd/cmdline.c +4 -2
 	.tokens = {
 		(void *)&cmd_config_rss_port,
 		(void *)&cmd_config_rss_keyword,
@@ -2438,7 +2442,8 @@ struct cmd_config_rss_hash_key {
 				 "ipv6-tcp-ex#ipv6-udp-ex#"
 				 "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");
+				 "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls#"
+				 "ipv4-chksum#l4-chksum");
 cmdline_parse_token_string_t cmd_config_rss_hash_key_value =
 	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key,
 NULL);
@@ -2451,7 +2456,8 @@ struct cmd_config_rss_hash_key {
 		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
 		"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 "
+		"l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls|"
+		"ipv4-chksum|l4-chksum "
 		"<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 43c79b5..14968bf
100644

app/test-pmd/config.c +2 -0
@@ -140,6 +140,8 @@
 	{ "gtpu", ETH_RSS_GTPU },
 	{ "ecpri", ETH_RSS_ECPRI },
 	{ "mpls", ETH_RSS_MPLS },
+	{ "ipv4-chksum", ETH_RSS_IPV4_CHKSUM },
+	{ "l4-chksum", ETH_RSS_L4_CHKSUM },
 	{ NULL, 0 },
 };
 
Quoted 12 lines
Quoted 4 lines
Quoted 4 lines
lib/ethdev/rte_ethdev.h index renamed from lib/ethdev/rte_ethdev.h +0 -0

faf3bd9..63b0321 100644

lib/ethdev/rte_ethdev.h +0 -0
Quoted 8 lines

lib/ethdev/rte_ethdev.h struct rte_eth_rss_conf { · line 541

Quoted 6 lines
lib/ethdev/rte_ethdev.h +2 -0
@@ -537,6 +537,8 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+#define ETH_RSS_L4_CHKSUM	   (1ULL << 35)	/* TCP/UDP/SCTP */

It does not reply on my questions at all.

Quoted 5 lines

Above list of Layer 4 protocols does not say if the flag may be reported when all above protocols are supported or some protocols are supported only.

Also I had a question about UDP checksum 0 since it could be treated in a different ways since logically it is no checksum at all.

I'll add comment for UDP checksum in next patch.
Thanks.

Quoted 26 lines
Quoted 17 lines
Quoted 7 lines · You have
Quoted 3 lines
Quoted 2 lines

I don't think so. IMHO, it should report all RSS capabilities regardless generic vs flow API RSS action.

May be it is OK to report subset in dev_info->flow_type_rss_offloads, but I'm very uncomfortable with the approach. Superset sounds more logical to me, but has drawbacks as well.

Here I have another question:
There are flow type definition and RSS offload type definition,

#define RTE_ETH_FLOW_RAW                 1
#define RTE_ETH_FLOW_IPV4                2
#define RTE_ETH_FLOW_FRAG_IPV4           3
#define RTE_ETH_FLOW_NONFRAG_IPV4_TCP    4
Quoted 5 lines
#define ETH_RSS_IPV4               (1ULL << 2)
#define ETH_RSS_FRAG_IPV4          (1ULL << 3)
#define ETH_RSS_NONFRAG_IPV4_TCP   (1ULL << 4)

are they the different expressions of the same concept?

Sorry, but I don't understand the question.

Quoted 1 line
Quoted 8 lines
Quoted 1 line

If yes, why they have been decoupled by the commit: fce6b66893.

Do you mean that motivation in the changeset description is not clear?

Quoted 1 line

Then what the flow type of ETH_RSS_PORT, it's UDP, TCP, or SCTP?

I have no answer to the question as well. That's why I'm trying to avoid it in the patch.

IMHO, the flow type is different from RSS Offload type. That's why they have been decoupled in commit fce6b66893
ethdev: decouple flow types and RSS offload types

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

There are total 25 flow types, but 30+ RSS offload types.
The PMDs report flow type in dev_info->flow_type_rss_offloads, but they don't report RSS offload type.

Quoted 10 lines
Quoted 3 lines

If not, the PMDs can report supported RSS flow type by

dev_info->flow_type_rss_offloads,

Quoted 1 line

but have no way to report supported RSS offload types.

Sorry, don't understand.

Quoted 2 lines
Quoted 2 lines

Nack

#28 lore raw

PATCH v5 1/1 ethdev: add IPv4 and L4 checksum RSS offload types

In reply to Alvin Zhang

This patch defines new RSS offload types for IPv4 and L4(TCP/UDP/SCTP) checksum, which are required when users want to distribute packets based on the IPv4 or L4 checksum field.

For example "flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-chksum end queues end / end", this flow causes all matching packets to be distributed to queues on basis of IPv4 checksum.

---

v5: Add release note and code commands.

---
 app/test-pmd/cmdline.c                 |  4 ++-
 app/test-pmd/config.c                  |  2 ++
 doc/guides/rel_notes/release_21_11.rst | 61 ++++++++++++++++++++++++++++++++++
 lib/ethdev/rte_ethdev.h                | 23 +++++++++++++
 4 files changed, 89 insertions(+), 1 deletion(-)
 create mode 100644 doc/guides/rel_notes/release_21_11.rst
app/test-pmd/cmdline.c +3 -1
index 82253bc..656a311 100644
@@ -2252,6 +2252,8 @@ struct cmd_config_rss {
 		rss_conf.rss_hf = ETH_RSS_ECPRI;
 	else if (!strcmp(res->value, "mpls"))
 		rss_conf.rss_hf = ETH_RSS_MPLS;
+	else if (!strcmp(res->value, "ipv4-chksum"))
+		rss_conf.rss_hf = ETH_RSS_IPV4_CHKSUM;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "level-default")) {
@@ -2323,7 +2325,7 @@ struct cmd_config_rss {
 	.help_str = "port config all rss "
 		"all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|"
 		"nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"
-		"level-outer|level-inner|<flowtype_id>",
+		"level-outer|level-inner|ipv4-chksum|<flowtype_id>",
 	.tokens = {
 		(void *)&cmd_config_rss_port,
 		(void *)&cmd_config_rss_keyword,
app/test-pmd/config.c +2 -0
index 31d8ba1..ece78f2 100644
@@ -140,6 +140,8 @@
 	{ "gtpu", ETH_RSS_GTPU },
 	{ "ecpri", ETH_RSS_ECPRI },
 	{ "mpls", ETH_RSS_MPLS },
+	{ "ipv4-chksum", ETH_RSS_IPV4_CHKSUM },
+	{ "l4-chksum", ETH_RSS_L4_CHKSUM },
 	{ NULL, 0 },
 };
 
doc/guides/rel_notes/release_21_11.rst new file +61 -0

61 lines not on this page · raw message

lib/ethdev/rte_ethdev.h +23 -0
index d2b27c3..9a59e7b 100644
@@ -537,6 +537,29 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+
+/**
+ * The ETH_RSS_L4_CHKSUM generally refers to a type of checksum field for
+ * any L4 header, such as TCP, UDP and SCTP. It is similar to ETH_RSS_PORT,
+ * it does not specify the type of L4 header.
+ * We use this macro to replace below macro for constricting the use of RSS
+ * offload bits:
+ * ETH_RSS_IPV4_TCP_CHKSUM
+ * ETH_RSS_IPV4_UDP_CHKSUM
+ * ETH_RSS_IPV4_SCTP_CHKSUM
+ * ETH_RSS_IPV6_TCP_CHKSUM
+ * ETH_RSS_IPV6_UDP_CHKSUM
+ * ETH_RSS_IPV6_SCTP_CHKSUM
+ *
+ * Then how to use this macro? We can use it in RSS flow where the pattern
+ * type will specify the L4 header type, for example "flow create 0 ingress \
+ * pattern eth / ipv4 / tcp / end actions rss types l4-chksum  end queues end \
+ * / end"
+ * For UDP, the checksum is not required, if the checksum is 0, it will be
+ * treated as a regular checksum with value equal to 0.
+ */
+#define ETH_RSS_L4_CHKSUM	   (1ULL << 35)
 
 /*
  * We use the following macros to combine with above ETH_RSS_* for
Signature · 1 line
1.8.3.1
#29 lore raw

Re: [dpdk-dev] [PATCH v5] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 165 lines

-----Original Message-----
From: Zhang, AlvinX <[email protected]>
Sent: Wednesday, August 18, 2021 10:32 AM
To: Zhang, Qi Z <[email protected]>; Guo, Junfeng <[email protected]>
Cc: [email protected]; Zhang, AlvinX <[email protected]>; Ajit Khaparde <[email protected]>; Singh, Aman Deep <[email protected]>
Subject: [PATCH v5] ethdev: add IPv4 and L4 checksum RSS offload types

This patch defines new RSS offload types for IPv4 and L4(TCP/UDP/SCTP) checksum, which are required when users want to distribute packets based on the IPv4 or L4 checksum field.

For example "flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-chksum end queues end / end", this flow causes all matching packets to be distributed to queues on basis of IPv4 checksum.

---

v5: Add release note and code commands.

---
 app/test-pmd/cmdline.c                 |  4 ++-
 app/test-pmd/config.c                  |  2 ++
 doc/guides/rel_notes/release_21_11.rst | 61
++++++++++++++++++++++++++++++++++
 lib/ethdev/rte_ethdev.h                | 23 +++++++++++++
 4 files changed, 89 insertions(+), 1 deletion(-)  create mode 100644

doc/guides/rel_notes/release_21_11.rst

app/test-pmd/cmdline.c index renamed from app/test-pmd/cmdline.c +0 -0

82253bc..656a311 100644

app/test-pmd/cmdline.c +2 -0
@@ -2252,6 +2252,8 @@ struct cmd_config_rss {
 		rss_conf.rss_hf = ETH_RSS_ECPRI;
 	else if (!strcmp(res->value, "mpls"))
 		rss_conf.rss_hf = ETH_RSS_MPLS;
+	else if (!strcmp(res->value, "ipv4-chksum"))
+		rss_conf.rss_hf = ETH_RSS_IPV4_CHKSUM;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "level-default")) { @@ -2323,7 +2325,7 @@

struct cmd_config_rss {

app/test-pmd/cmdline.c +0 -0
 	.help_str = "port config all rss "
 		"all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|"

"nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"

app/test-pmd/cmdline.c +1 -1
-		"level-outer|level-inner|<flowtype_id>",
+		"level-outer|level-inner|ipv4-chksum|<flowtype_id>",
 	.tokens = {
 		(void *)&cmd_config_rss_port,
 		(void *)&cmd_config_rss_keyword,
app/test-pmd/config.c index renamed from app/test-pmd/config.c +0 -0

31d8ba1..ece78f2 100644

app/test-pmd/config.c +2 -0
@@ -140,6 +140,8 @@
 	{ "gtpu", ETH_RSS_GTPU },
 	{ "ecpri", ETH_RSS_ECPRI },
 	{ "mpls", ETH_RSS_MPLS },
+	{ "ipv4-chksum", ETH_RSS_IPV4_CHKSUM },
+	{ "l4-chksum", ETH_RSS_L4_CHKSUM },
 	{ NULL, 0 },
 };
 
doc/guides/rel_notes/release_21_11.rst new file +46 -0
new file mode 100644
index 0000000..1017550
@@ -0,0 +1,61 @@
+.. SPDX-License-Identifier: BSD-3-Clause
+   Copyright 2021 The DPDK contributors
+
+.. include:: <isonum.txt>
+
+DPDK Release 21.11
+==================
+
+.. **Read this first.**
+
+   The text in the sections below explains how to update the release notes.
+
+   Use proper spelling, capitalization and punctuation in all sections.
+
+   Variable and config names should be quoted as fixed width text:
+   ``LIKE_THIS``.
+
+   Build the docs and view the output file to ensure the changes are correct::
+
+      make doc-guides-html
+      xdg-open build/doc/html/guides/rel_notes/release_21_11.html
+
+
+New Features
+------------
+
+.. This section should contain new features added in this release.
+   Sample format:
+
+   * **Add a title in the past tense with a full stop.**
+
+     Add a short 1-2 sentence description in the past tense.
+     The description should be enough to allow someone scanning
+     the release notes to understand the new feature.
+
+     If the feature adds a lot of sub-features you can use a bullet list
+     like this:
+
+     * Added feature foo to do something.
+     * Enhanced feature bar to do something else.
+
+     Refer to the previous release notes for examples.
+
+     Suggested order in release notes items:
+     * Core libs (EAL, mempool, ring, mbuf, buses)
+     * Device abstraction libs and PMDs (ordered alphabetically by vendor

name)

doc/guides/rel_notes/release_21_11.rst new file +14 -0
+       - ethdev (lib, PMDs)
+       - cryptodev (lib, PMDs)
+       - eventdev (lib, PMDs)
+       - etc
+     * Other libs
+     * Apps, Examples, Tools (if significant)
+
+     This section is a comment. Do not overwrite or remove it.
+     Also, make sure to start the actual text at the margin.
+     =======================================================
+
+* **Add new RSS offload types for IPv4/L4 checksum in RSS flow.**
+
+     Add macros ETH_RSS_IPV4_CHKSUM and ETH_RSS_L4_CHKSUM, now

IPv4 and

doc/guides/rel_notes/release_21_11.rst new file +1 -0
+     TCP/UDP/SCTP header checksum field can be used as input set for RSS.
lib/ethdev/rte_ethdev.h index renamed from lib/ethdev/rte_ethdev.h +0 -0

d2b27c3..9a59e7b 100644

lib/ethdev/rte_ethdev.h +16 -0
@@ -537,6 +537,29 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+
+/**
+ * The ETH_RSS_L4_CHKSUM generally refers to a type of checksum field
+for
+ * any L4 header, such as TCP, UDP and SCTP. It is similar to
+ETH_RSS_PORT,
+ * it does not specify the type of L4 header.
+ * We use this macro to replace below macro for constricting the use of
+RSS
+ * offload bits:
+ * ETH_RSS_IPV4_TCP_CHKSUM
+ * ETH_RSS_IPV4_UDP_CHKSUM
+ * ETH_RSS_IPV4_SCTP_CHKSUM
+ * ETH_RSS_IPV6_TCP_CHKSUM
+ * ETH_RSS_IPV6_UDP_CHKSUM

lib/ethdev/rte_ethdev.h struct rte_eth_rss_conf { · line 565

Quoted 10 lines
lib/ethdev/rte_ethdev.h +10 -0
+ * ETH_RSS_IPV6_SCTP_CHKSUM
+ *
+ * Then how to use this macro? We can use it in RSS flow where the
+pattern
+ * type will specify the L4 header type, for example "flow create 0
+ingress \
+ * pattern eth / ipv4 / tcp / end actions rss types l4-chksum  end
+queues end \
+ * / end"
+ * For UDP, the checksum is not required, if the checksum is 0, it will

Do you mean
For UDP , the checksum is optional, if the checksum is not used, it will...?

Quoted 3 lines

+be
+ * treated as a regular checksum with value equal to 0.
+ */

Or maybe just reword to below
For the case that checksum is not used in a UDP header, it take the reserved value 0 as input for the hash function.

Quoted 6 lines

+#define ETH_RSS_L4_CHKSUM (1ULL << 35)

/*
* We use the following macros to combine with above ETH_RSS_* for
--
1.8.3.1

#30 lore raw

PATCH v6 1/1 ethdev: add IPv4 and L4 checksum RSS offload types

In reply to Alvin Zhang

This patch defines new RSS offload types for IPv4 and L4(TCP/UDP/SCTP) checksum, which are required when users want to distribute packets based on the IPv4 or L4 checksum field.

For example "flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-chksum end queues end / end", this flow causes all matching packets to be distributed to queues on basis of IPv4 checksum.

---

v6: rebase to eeedef70, update some note

---
 app/test-pmd/cmdline.c                 |  4 +++-
 app/test-pmd/config.c                  |  2 ++
 doc/guides/rel_notes/release_21_11.rst |  4 ++++
 lib/ethdev/rte_ethdev.h                | 24 ++++++++++++++++++++++++
 4 files changed, 33 insertions(+), 1 deletion(-)
app/test-pmd/cmdline.c +3 -1
index 82253bc..656a311 100644
@@ -2252,6 +2252,8 @@ struct cmd_config_rss {
 		rss_conf.rss_hf = ETH_RSS_ECPRI;
 	else if (!strcmp(res->value, "mpls"))
 		rss_conf.rss_hf = ETH_RSS_MPLS;
+	else if (!strcmp(res->value, "ipv4-chksum"))
+		rss_conf.rss_hf = ETH_RSS_IPV4_CHKSUM;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "level-default")) {
@@ -2323,7 +2325,7 @@ struct cmd_config_rss {
 	.help_str = "port config all rss "
 		"all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|"
 		"nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"
-		"level-outer|level-inner|<flowtype_id>",
+		"level-outer|level-inner|ipv4-chksum|<flowtype_id>",
 	.tokens = {
 		(void *)&cmd_config_rss_port,
 		(void *)&cmd_config_rss_keyword,
app/test-pmd/config.c +2 -0
index 31d8ba1..ece78f2 100644
@@ -140,6 +140,8 @@
 	{ "gtpu", ETH_RSS_GTPU },
 	{ "ecpri", ETH_RSS_ECPRI },
 	{ "mpls", ETH_RSS_MPLS },
+	{ "ipv4-chksum", ETH_RSS_IPV4_CHKSUM },
+	{ "l4-chksum", ETH_RSS_L4_CHKSUM },
 	{ NULL, 0 },
 };
 
doc/guides/rel_notes/release_21_11.rst +4 -0
index d707a55..e8a64f5 100644
@@ -55,6 +55,10 @@ New Features
      Also, make sure to start the actual text at the margin.
      =======================================================
 
+* **Add new RSS offload types for IPv4/L4 checksum in RSS flow.**
+  Add macros ETH_RSS_IPV4_CHKSUM and ETH_RSS_L4_CHKSUM, now IPv4 and
+  TCP/UDP/SCTP header checksum field can be used as input set for RSS.
+
 
 Removed Items
 -------------
lib/ethdev/rte_ethdev.h +24 -0
index d2b27c3..e6734df 100644
@@ -537,6 +537,30 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+
+/**
+ * The ETH_RSS_L4_CHKSUM generally refers to a type of checksum field for
+ * any L4 header, such as TCP, UDP and SCTP. It is similar to ETH_RSS_PORT,
+ * it does not specify the type of L4 header.
+ * We use this macro to replace below macro for constricting the use of RSS
+ * offload bits:
+ * ETH_RSS_IPV4_TCP_CHKSUM
+ * ETH_RSS_IPV4_UDP_CHKSUM
+ * ETH_RSS_IPV4_SCTP_CHKSUM
+ * ETH_RSS_IPV6_TCP_CHKSUM
+ * ETH_RSS_IPV6_UDP_CHKSUM
+ * ETH_RSS_IPV6_SCTP_CHKSUM
+ *
+ * Then how to use this macro? We can use it in RSS flow where the pattern
+ * type will specify the L4 header type, for example "flow create 0 ingress \
+ * pattern eth / ipv4 / tcp / end actions rss types l4-chksum  end queues end \
+ * / end"
+ *
+ * For the case that checksum is not used in a UDP header, it takes the
+ * reserved value 0 as input for the hash function.
+ */
+#define ETH_RSS_L4_CHKSUM	   (1ULL << 35)
 
 /*
  * We use the following macros to combine with above ETH_RSS_* for
Signature · 1 line
1.8.3.1
#31 lore raw

PATCH v7 1/1 ethdev: add IPv4 and L4 checksum RSS offload types

This patch defines new RSS offload types for IPv4 and L4(TCP/UDP/SCTP) checksum, which are required when users want to distribute packets based on the IPv4 or L4 checksum field.

For example "flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-chksum end queues end / end", this flow causes all matching packets to be distributed to queues on basis of IPv4 checksum.

---

v6: rebase to eeedef70, update some note
v7: fix code style issues

---
 app/test-pmd/cmdline.c                 |  4 +++-
 app/test-pmd/config.c                  |  2 ++
 doc/guides/rel_notes/release_21_11.rst |  5 +++++
 lib/ethdev/rte_ethdev.h                | 24 ++++++++++++++++++++++++
 4 files changed, 34 insertions(+), 1 deletion(-)
app/test-pmd/cmdline.c +3 -1
index 82253bc..656a311 100644
@@ -2252,6 +2252,8 @@ struct cmd_config_rss {
 		rss_conf.rss_hf = ETH_RSS_ECPRI;
 	else if (!strcmp(res->value, "mpls"))
 		rss_conf.rss_hf = ETH_RSS_MPLS;
+	else if (!strcmp(res->value, "ipv4-chksum"))
+		rss_conf.rss_hf = ETH_RSS_IPV4_CHKSUM;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "level-default")) {
@@ -2323,7 +2325,7 @@ struct cmd_config_rss {
 	.help_str = "port config all rss "
 		"all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|"
 		"nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"
-		"level-outer|level-inner|<flowtype_id>",
+		"level-outer|level-inner|ipv4-chksum|<flowtype_id>",
 	.tokens = {
 		(void *)&cmd_config_rss_port,
 		(void *)&cmd_config_rss_keyword,
app/test-pmd/config.c +2 -0
index 31d8ba1..ece78f2 100644
@@ -140,6 +140,8 @@
 	{ "gtpu", ETH_RSS_GTPU },
 	{ "ecpri", ETH_RSS_ECPRI },
 	{ "mpls", ETH_RSS_MPLS },
+	{ "ipv4-chksum", ETH_RSS_IPV4_CHKSUM },
+	{ "l4-chksum", ETH_RSS_L4_CHKSUM },
 	{ NULL, 0 },
 };
 
doc/guides/rel_notes/release_21_11.rst +5 -0
index d707a55..fa29b13 100644
@@ -55,6 +55,11 @@ New Features
      Also, make sure to start the actual text at the margin.
      =======================================================
 
+* **Add new RSS offload types for IPv4/L4 checksum in RSS flow.**
+
+  Add macros ETH_RSS_IPV4_CHKSUM and ETH_RSS_L4_CHKSUM, now IPv4 and
+  TCP/UDP/SCTP header checksum field can be used as input set for RSS.
+
 
 Removed Items
 -------------
lib/ethdev/rte_ethdev.h +24 -0
index d2b27c3..e6734df 100644
@@ -537,6 +537,30 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+
+/**
+ * The ETH_RSS_L4_CHKSUM generally refers to a type of checksum field for
+ * any L4 header, such as TCP, UDP and SCTP. It is similar to ETH_RSS_PORT,
+ * it does not specify the type of L4 header.
+ * We use this macro to replace below macro for constricting the use of RSS
+ * offload bits:
+ * ETH_RSS_IPV4_TCP_CHKSUM
+ * ETH_RSS_IPV4_UDP_CHKSUM
+ * ETH_RSS_IPV4_SCTP_CHKSUM
+ * ETH_RSS_IPV6_TCP_CHKSUM
+ * ETH_RSS_IPV6_UDP_CHKSUM
+ * ETH_RSS_IPV6_SCTP_CHKSUM
+ *
+ * Then how to use this macro? We can use it in RSS flow where the pattern
+ * type will specify the L4 header type, for example "flow create 0 ingress \
+ * pattern eth / ipv4 / tcp / end actions rss types l4-chksum  end queues end \
+ * / end"
+ *
+ * For the case that checksum is not used in a UDP header, it takes the
+ * reserved value 0 as input for the hash function.
+ */
+#define ETH_RSS_L4_CHKSUM	   (1ULL << 35)
 
 /*
  * We use the following macros to combine with above ETH_RSS_* for
Signature · 1 line
1.8.3.1
Reviewed-by on v7 1/1
#32 lore raw

Re: [dpdk-dev] [PATCH v7] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 130 lines

-----Original Message-----
From: Zhang, AlvinX <[email protected]>
Sent: Tuesday, August 31, 2021 5:53 PM
To: Zhang, Qi Z <[email protected]>; Guo, Junfeng <[email protected]>
Cc: [email protected]; Zhang, AlvinX <[email protected]>; Ajit Khaparde <[email protected]>; Singh, Aman Deep <[email protected]>
Subject: [PATCH v7] ethdev: add IPv4 and L4 checksum RSS offload types

This patch defines new RSS offload types for IPv4 and L4(TCP/UDP/SCTP) checksum, which are required when users want to distribute packets based on the IPv4 or L4 checksum field.

For example "flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-chksum end queues end / end", this flow causes all matching packets to be distributed to queues on basis of IPv4 checksum.

---

v6: rebase to eeedef70, update some note
v7: fix code style issues

---
 app/test-pmd/cmdline.c                 |  4 +++-
 app/test-pmd/config.c                  |  2 ++
 doc/guides/rel_notes/release_21_11.rst |  5 +++++
 lib/ethdev/rte_ethdev.h                | 24 ++++++++++++++++++++++++
 4 files changed, 34 insertions(+), 1 deletion(-)
app/test-pmd/cmdline.c index renamed from app/test-pmd/cmdline.c +0 -0

82253bc..656a311 100644

app/test-pmd/cmdline.c +2 -0
@@ -2252,6 +2252,8 @@ struct cmd_config_rss {
 		rss_conf.rss_hf = ETH_RSS_ECPRI;
 	else if (!strcmp(res->value, "mpls"))
 		rss_conf.rss_hf = ETH_RSS_MPLS;
+	else if (!strcmp(res->value, "ipv4-chksum"))
+		rss_conf.rss_hf = ETH_RSS_IPV4_CHKSUM;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "level-default")) { @@ -2323,7 +2325,7 @@

struct cmd_config_rss {

app/test-pmd/cmdline.c +0 -0
 	.help_str = "port config all rss "
 		"all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|"

"nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"

app/test-pmd/cmdline.c +1 -1
-		"level-outer|level-inner|<flowtype_id>",
+		"level-outer|level-inner|ipv4-chksum|<flowtype_id>",
 	.tokens = {
 		(void *)&cmd_config_rss_port,
 		(void *)&cmd_config_rss_keyword,
app/test-pmd/config.c index renamed from app/test-pmd/config.c +0 -0

31d8ba1..ece78f2 100644

app/test-pmd/config.c +2 -0
@@ -140,6 +140,8 @@
 	{ "gtpu", ETH_RSS_GTPU },
 	{ "ecpri", ETH_RSS_ECPRI },
 	{ "mpls", ETH_RSS_MPLS },
+	{ "ipv4-chksum", ETH_RSS_IPV4_CHKSUM },
+	{ "l4-chksum", ETH_RSS_L4_CHKSUM },
 	{ NULL, 0 },
 };
 
doc/guides/rel_notes/release_21_11.rst +3 -0
index d707a55..fa29b13 100644
@@ -55,6 +55,11 @@ New Features
      Also, make sure to start the actual text at the margin.
      =======================================================
 
+* **Add new RSS offload types for IPv4/L4 checksum in RSS flow.**
+
+  Add macros ETH_RSS_IPV4_CHKSUM and ETH_RSS_L4_CHKSUM, now IPv4

and
+ TCP/UDP/SCTP header checksum field can be used as input set for RSS.

doc/guides/rel_notes/release_21_11.rst +1 -0
+
 
 Removed Items
 -------------
lib/ethdev/rte_ethdev.h index renamed from lib/ethdev/rte_ethdev.h +0 -0

d2b27c3..e6734df 100644

lib/ethdev/rte_ethdev.h +30 -1
@@ -537,6 +537,30 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+
+/**
+ * The ETH_RSS_L4_CHKSUM generally refers to a type of checksum field
+for
+ * any L4 header, such as TCP, UDP and SCTP. It is similar to
+ETH_RSS_PORT,
+ * it does not specify the type of L4 header.
+ * We use this macro to replace below macro for constricting the use of
+RSS
+ * offload bits:
+ * ETH_RSS_IPV4_TCP_CHKSUM
+ * ETH_RSS_IPV4_UDP_CHKSUM
+ * ETH_RSS_IPV4_SCTP_CHKSUM
+ * ETH_RSS_IPV6_TCP_CHKSUM
+ * ETH_RSS_IPV6_UDP_CHKSUM
+ * ETH_RSS_IPV6_SCTP_CHKSUM
+ *
+ * Then how to use this macro? We can use it in RSS flow where the
+pattern
+ * type will specify the L4 header type, for example "flow create 0
+ingress \
+ * pattern eth / ipv4 / tcp / end actions rss types l4-chksum  end
+queues end \
+ * / end"
+ *
+ * For the case that checksum is not used in a UDP header, it takes the
+ * reserved value 0 as input for the hash function.
+ */
+#define ETH_RSS_L4_CHKSUM	   (1ULL << 35)
 
 /*
  * We use the following macros to combine with above ETH_RSS_* for
--
Quoted 1 line

1.8.3.1

#33 lore raw

Re: [dpdk-dev] [PATCH v7] ethdev: add IPv4 and L4 checksum RSS offload types

In reply to Alvin Zhang
Quoted 78 lines · Alvin Zhang

This patch defines new RSS offload types for IPv4 and L4(TCP/UDP/SCTP) checksum, which are required when users want to distribute packets based on the IPv4 or L4 checksum field.

For example "flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-chksum end queues end / end", this flow causes all matching packets to be distributed to queues on basis of IPv4 checksum.

---

v6: rebase to eeedef70, update some note
v7: fix code style issues

---
 app/test-pmd/cmdline.c                 |  4 +++-
 app/test-pmd/config.c                  |  2 ++
 doc/guides/rel_notes/release_21_11.rst |  5 +++++
 lib/ethdev/rte_ethdev.h                | 24 ++++++++++++++++++++++++
 4 files changed, 34 insertions(+), 1 deletion(-)
app/test-pmd/cmdline.c +3 -1
index 82253bc..656a311 100644
@@ -2252,6 +2252,8 @@ struct cmd_config_rss {
 		rss_conf.rss_hf = ETH_RSS_ECPRI;
 	else if (!strcmp(res->value, "mpls"))
 		rss_conf.rss_hf = ETH_RSS_MPLS;
+	else if (!strcmp(res->value, "ipv4-chksum"))
+		rss_conf.rss_hf = ETH_RSS_IPV4_CHKSUM;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "level-default")) {
@@ -2323,7 +2325,7 @@ struct cmd_config_rss {
 	.help_str = "port config all rss "
 		"all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|"
 		"nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"
-		"level-outer|level-inner|<flowtype_id>",
+		"level-outer|level-inner|ipv4-chksum|<flowtype_id>",
 	.tokens = {
 		(void *)&cmd_config_rss_port,
 		(void *)&cmd_config_rss_keyword,
app/test-pmd/config.c +2 -0
index 31d8ba1..ece78f2 100644
@@ -140,6 +140,8 @@
 	{ "gtpu", ETH_RSS_GTPU },
 	{ "ecpri", ETH_RSS_ECPRI },
 	{ "mpls", ETH_RSS_MPLS },
+	{ "ipv4-chksum", ETH_RSS_IPV4_CHKSUM },
+	{ "l4-chksum", ETH_RSS_L4_CHKSUM },>  	{ NULL, 0 },
 };
 
doc/guides/rel_notes/release_21_11.rst +5 -0
index d707a55..fa29b13 100644
@@ -55,6 +55,11 @@ New Features
      Also, make sure to start the actual text at the margin.
      =======================================================
 
+* **Add new RSS offload types for IPv4/L4 checksum in RSS flow.**
+
+  Add macros ETH_RSS_IPV4_CHKSUM and ETH_RSS_L4_CHKSUM, now IPv4 and
+  TCP/UDP/SCTP header checksum field can be used as input set for RSS.
+
 
 Removed Items
 -------------
lib/ethdev/rte_ethdev.h +0 -0
index d2b27c3..e6734df 100644

lib/ethdev/rte_ethdev.h struct rte_eth_rss_conf { · line 543

Quoted 7 lines
lib/ethdev/rte_ethdev.h +4 -0
@@ -537,6 +537,30 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+
+/**
+ * The ETH_RSS_L4_CHKSUM generally refers to a type of checksum field for

what does 'generally' means here? Is there a case it refers to something else?

lib/ethdev/rte_ethdev.h struct rte_eth_rss_conf { · line 553

Quoted 10 lines
lib/ethdev/rte_ethdev.h +10 -0
+ * any L4 header, such as TCP, UDP and SCTP. It is similar to ETH_RSS_PORT,
+ * it does not specify the type of L4 header.
+ * We use this macro to replace below macro for constricting the use of RSS
+ * offload bits:
+ * ETH_RSS_IPV4_TCP_CHKSUM
+ * ETH_RSS_IPV4_UDP_CHKSUM
+ * ETH_RSS_IPV4_SCTP_CHKSUM
+ * ETH_RSS_IPV6_TCP_CHKSUM
+ * ETH_RSS_IPV6_UDP_CHKSUM
+ * ETH_RSS_IPV6_SCTP_CHKSUM

As I get you are listing them here to say the 'ETH_RSS_L4_CHKSUM' replaces possible usage of above list, but my concern is it may confuse people as those macros exists (or did exist in the past), so what do you think to remove them?

And just to confirm, we can't use this flag, 'ETH_RSS_L4_CHKSUM' anymore with 'rte_eth_rss_conf.rss_hf', right? Since it will be missing some context for it. Which means some old APIs (and configuration) won't support this new offload, but only rte_flow will support it.
If above is correct should it be highlighted in above comment?

lib/ethdev/rte_ethdev.h struct rte_eth_rss_conf { · line 555

Quoted 2 lines
lib/ethdev/rte_ethdev.h +2 -0
+ *
+ * Then how to use this macro? We can use it in RSS flow where the pattern

Can we convert this question to a description just to be a little more formal?

Quoted 12 lines
lib/ethdev/rte_ethdev.h +8 -0
+ * type will specify the L4 header type, for example "flow create 0 ingress \
+ * pattern eth / ipv4 / tcp / end actions rss types l4-chksum  end queues end \
+ * / end"
+ *
+ * For the case that checksum is not used in a UDP header, it takes the
+ * reserved value 0 as input for the hash function.
+ */
+#define ETH_RSS_L4_CHKSUM	   (1ULL << 35)
 
 /*
  * We use the following macros to combine with above ETH_RSS_* for
#34 lore raw

Re: [dpdk-dev] [PATCH v7] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 146 lines

-----Original Message-----
From: Yigit, Ferruh <[email protected]>
Sent: Tuesday, September 14, 2021 10:01 PM
To: Zhang, AlvinX <[email protected]>; Zhang, Qi Z <[email protected]>; Guo, Junfeng <[email protected]>
Cc: [email protected]; Ajit Khaparde <[email protected]>; Singh, Aman Deep <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v7] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 14 lines · Alvin Zhang

This patch defines new RSS offload types for IPv4 and L4(TCP/UDP/SCTP) checksum, which are required when users want to distribute packets based on the IPv4 or L4 checksum field.

For example "flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-chksum end queues end / end", this flow causes all matching packets to be distributed to queues on basis of IPv4 checksum.

---

Quoted 7 lines

v6: rebase to eeedef70, update some note
v7: fix code style issues

---
 app/test-pmd/cmdline.c                 |  4 +++-
 app/test-pmd/config.c                  |  2 ++
 doc/guides/rel_notes/release_21_11.rst |  5 +++++
 lib/ethdev/rte_ethdev.h                | 24

++++++++++++++++++++++++

Quoted 17 lines
 4 files changed, 34 insertions(+), 1 deletion(-)
app/test-pmd/cmdline.c index renamed from app/test-pmd/cmdline.c +0 -0

82253bc..656a311 100644

app/test-pmd/cmdline.c +2 -0
@@ -2252,6 +2252,8 @@ struct cmd_config_rss {
 		rss_conf.rss_hf = ETH_RSS_ECPRI;
 	else if (!strcmp(res->value, "mpls"))
 		rss_conf.rss_hf = ETH_RSS_MPLS;
+	else if (!strcmp(res->value, "ipv4-chksum"))
+		rss_conf.rss_hf = ETH_RSS_IPV4_CHKSUM;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "level-default")) { @@ -2323,7 +2325,7

@@ struct cmd_config_rss {

app/test-pmd/cmdline.c struct cmd_config_rss { · line 2326

Quoted 2 lines
app/test-pmd/cmdline.c +0 -0
 	.help_str = "port config all rss "
 		"all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|"
	"nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"
> -		"level-outer|level-inner|<flowtype_id>",
> +		"level-outer|level-inner|ipv4-chksum|<flowtype_id>",
Quoted 21 lines
app/test-pmd/cmdline.c +0 -0
 	.tokens = {
 		(void *)&cmd_config_rss_port,
 		(void *)&cmd_config_rss_keyword,
app/test-pmd/config.c index renamed from app/test-pmd/config.c +0 -0

31d8ba1..ece78f2 100644

app/test-pmd/config.c +2 -0
@@ -140,6 +140,8 @@
 	{ "gtpu", ETH_RSS_GTPU },
 	{ "ecpri", ETH_RSS_ECPRI },
 	{ "mpls", ETH_RSS_MPLS },
+	{ "ipv4-chksum", ETH_RSS_IPV4_CHKSUM },
+	{ "l4-chksum", ETH_RSS_L4_CHKSUM },>  	{ NULL, 0 },
 };
 
doc/guides/rel_notes/release_21_11.rst +0 -0
index d707a55..fa29b13 100644

doc/guides/rel_notes/release_21_11.rst New Features · line 60

Quoted 6 lines
doc/guides/rel_notes/release_21_11.rst +3 -0
@@ -55,6 +55,11 @@ New Features
      Also, make sure to start the actual text at the margin.
      =======================================================
 
+* **Add new RSS offload types for IPv4/L4 checksum in RSS flow.**
+
+  Add macros ETH_RSS_IPV4_CHKSUM and ETH_RSS_L4_CHKSUM, now IPv4

and

Quoted 10 lines
doc/guides/rel_notes/release_21_11.rst +2 -0
+ TCP/UDP/SCTP header checksum field can be used as input set for RSS.
+
 
 Removed Items
 -------------
lib/ethdev/rte_ethdev.h index renamed from lib/ethdev/rte_ethdev.h +0 -0

d2b27c3..e6734df 100644

lib/ethdev/rte_ethdev.h struct rte_eth_rss_conf { · line 544

Quoted 8 lines
lib/ethdev/rte_ethdev.h +5 -0
@@ -537,6 +537,30 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+
+/**
+ * The ETH_RSS_L4_CHKSUM generally refers to a type of checksum field
+for

what does 'generally' means here? Is there a case it refers to something else?

lib/ethdev/rte_ethdev.h struct rte_eth_rss_conf { · line 553

Quoted 12 lines
lib/ethdev/rte_ethdev.h +12 -0
+ * any L4 header, such as TCP, UDP and SCTP. It is similar to
+ ETH_RSS_PORT,
+ * it does not specify the type of L4 header.
+ * We use this macro to replace below macro for constricting the use
+ of RSS
+ * offload bits:
+ * ETH_RSS_IPV4_TCP_CHKSUM
+ * ETH_RSS_IPV4_UDP_CHKSUM
+ * ETH_RSS_IPV4_SCTP_CHKSUM
+ * ETH_RSS_IPV6_TCP_CHKSUM
+ * ETH_RSS_IPV6_UDP_CHKSUM
+ * ETH_RSS_IPV6_SCTP_CHKSUM

As I get you are listing them here to say the 'ETH_RSS_L4_CHKSUM' replaces possible usage of above list, but my concern is it may confuse people as those macros exists (or did exist in the past), so what do you think to remove them?

And just to confirm, we can't use this flag, 'ETH_RSS_L4_CHKSUM' anymore with 'rte_eth_rss_conf.rss_hf', right? Since it will be missing some context for it. Which means some old APIs (and configuration) won't support this new offload, but only rte_flow will support it.
If above is correct should it be highlighted in above comment?

lib/ethdev/rte_ethdev.h struct rte_eth_rss_conf { · line 559

Quoted 3 lines
lib/ethdev/rte_ethdev.h +3 -0
+ *
+ * Then how to use this macro? We can use it in RSS flow where the
+ pattern

Can we convert this question to a description just to be a little more formal?

Quoted 12 lines
lib/ethdev/rte_ethdev.h +11 -0
+ * type will specify the L4 header type, for example "flow create 0
+ingress \
+ * pattern eth / ipv4 / tcp / end actions rss types l4-chksum  end
+queues end \
+ * / end"
+ *
+ * For the case that checksum is not used in a UDP header, it takes
+the
+ * reserved value 0 as input for the hash function.
+ */
+#define ETH_RSS_L4_CHKSUM	   (1ULL << 35)
Quoted 3 lines
Quoted 3 lines

/*
* We use the following macros to combine with above ETH_RSS_* for

I'll refine the notes.
Thanks,
Alvin

#35 lore raw

PATCH v8 1/1 ethdev: add IPv4 and L4 checksum RSS offload types

In reply to Alvin Zhang

This patch defines new RSS offload types for IPv4 and L4(TCP/UDP/SCTP) checksum, which are required when users want to distribute packets based on the IPv4 or L4 checksum field.

For example "flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-chksum end queues end / end", this flow causes all matching packets to be distributed to queues on basis of IPv4 checksum.

---

v6: rebase to eeedef70, update some note
v7: fix code style issues
v8: rebase to 22a9f34e67ea, update some note

---
 app/test-pmd/cmdline.c                 |  4 +++-
 app/test-pmd/config.c                  |  2 ++
 doc/guides/rel_notes/release_21_11.rst |  5 +++++
 lib/ethdev/rte_ethdev.h                | 18 ++++++++++++++++++
 4 files changed, 28 insertions(+), 1 deletion(-)
app/test-pmd/cmdline.c +3 -1
index 7dd3965..a9efd02 100644
@@ -2252,6 +2252,8 @@ struct cmd_config_rss {
 		rss_conf.rss_hf = ETH_RSS_ECPRI;
 	else if (!strcmp(res->value, "mpls"))
 		rss_conf.rss_hf = ETH_RSS_MPLS;
+	else if (!strcmp(res->value, "ipv4-chksum"))
+		rss_conf.rss_hf = ETH_RSS_IPV4_CHKSUM;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "level-default")) {
@@ -2323,7 +2325,7 @@ struct cmd_config_rss {
 	.help_str = "port config all rss "
 		"all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|"
 		"nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"
-		"level-outer|level-inner|<flowtype_id>",
+		"level-outer|level-inner|ipv4-chksum|<flowtype_id>",
 	.tokens = {
 		(void *)&cmd_config_rss_port,
 		(void *)&cmd_config_rss_keyword,
app/test-pmd/config.c +2 -0
index f5765b3..9c66329 100644
@@ -140,6 +140,8 @@
 	{ "gtpu", ETH_RSS_GTPU },
 	{ "ecpri", ETH_RSS_ECPRI },
 	{ "mpls", ETH_RSS_MPLS },
+	{ "ipv4-chksum", ETH_RSS_IPV4_CHKSUM },
+	{ "l4-chksum", ETH_RSS_L4_CHKSUM },
 	{ NULL, 0 },
 };
 
doc/guides/rel_notes/release_21_11.rst +5 -0
index 43d367b..388e6bd 100644
@@ -87,6 +87,11 @@ New Features
   Added command-line options to specify total number of processes and
   current process ID. Each process owns subset of Rx and Tx queues.
 
+* **Add new RSS offload types for IPv4/L4 checksum in RSS flow.**
+
+  Add macros ETH_RSS_IPV4_CHKSUM and ETH_RSS_L4_CHKSUM, now IPv4 and
+  TCP/UDP/SCTP header checksum field can be used as input set for RSS.
+
 
 Removed Items
 -------------
lib/ethdev/rte_ethdev.h +18 -0
index d2b27c3..d0bbe33 100644
@@ -537,6 +537,24 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PPPOE		   (1ULL << 31)
 #define ETH_RSS_ECPRI		   (1ULL << 32)
 #define ETH_RSS_MPLS		   (1ULL << 33)
+#define ETH_RSS_IPV4_CHKSUM	   (1ULL << 34)
+
+/**
+ * The ETH_RSS_L4_CHKSUM works on checksum field of any L4 header.
+ * It is similar to ETH_RSS_PORT that they don't specify the specific type of
+ * L4 header. We define this macro to replace some specific L4 (TCP/UDP/SCTP)
+ * checksum type for constricting the use of RSS offload bits.
+ *
+ * Due to above reason, some old APIs (and configuration) won't support
+ * ETH_RSS_L4_CHKSUM, rte_flow will support it, in a RSS flow the pattern type
+ * can specify the L4 header type, for example
+ * "flow create 0 ingress pattern eth / ipv4 / tcp / end actions rss types \
+ * l4-chksum end queues end / end"
+ *
+ * For the case that checksum is not used in a UDP header, it takes the
+ * reserved value 0 as input for the hash function.
+ */
+#define ETH_RSS_L4_CHKSUM	   (1ULL << 35)
 
 /*
  * We use the following macros to combine with above ETH_RSS_* for
Signature · 1 line
1.8.3.1
Acked-by on v8 1/1 Applied
#36 lore raw

Re: [dpdk-dev] [PATCH v8] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 9 lines · Alvin Zhang

This patch defines new RSS offload types for IPv4 and L4(TCP/UDP/SCTP) checksum, which are required when users want to distribute packets based on the IPv4 or L4 checksum field.

For example "flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-chksum end queues end / end", this flow causes all matching packets to be distributed to queues on basis of IPv4 checksum.

Quoted 4 lines

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

#37 lore raw

Re: [dpdk-dev] [PATCH v8] ethdev: add IPv4 and L4 checksum RSS offload types

In reply to Alvin Zhang
Quoted 13 lines · Alvin Zhang

This patch defines new RSS offload types for IPv4 and L4(TCP/UDP/SCTP) checksum, which are required when users want to distribute packets based on the IPv4 or L4 checksum field.

For example "flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-chksum end queues end / end", this flow causes all matching packets to be distributed to queues on basis of IPv4 checksum.

<...>

doc/guides/rel_notes/release_21_11.rst New Features · line 95

Quoted 12 lines
doc/guides/rel_notes/release_21_11.rst +5 -0
@@ -87,6 +87,11 @@ New Features
   Added command-line options to specify total number of processes and
   current process ID. Each process owns subset of Rx and Tx queues.
 
+* **Add new RSS offload types for IPv4/L4 checksum in RSS flow.**
+
+  Add macros ETH_RSS_IPV4_CHKSUM and ETH_RSS_L4_CHKSUM, now IPv4 and
+  TCP/UDP/SCTP header checksum field can be used as input set for RSS.
+
 

Thomas reported the issue that release notes items should be in past tense, updated the documentation in next-net, as s/Add/Added/ , fyi.

#38 lore raw

Re: [dpdk-dev] [PATCH v8] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 37 lines

-----Original Message-----
From: Yigit, Ferruh <[email protected]>
Sent: Tuesday, September 28, 2021 9:09 PM
To: Zhang, AlvinX <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: [email protected]; Ajit Khaparde <[email protected]>; Singh, Aman Deep <[email protected]>; Thomas Monjalon <[email protected]>
Subject: Re: [PATCH v8] ethdev: add IPv4 and L4 checksum RSS offload types

Quoted 13 lines · Alvin Zhang

This patch defines new RSS offload types for IPv4 and L4(TCP/UDP/SCTP) checksum, which are required when users want to distribute packets based on the IPv4 or L4 checksum field.

For example "flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-chksum end queues end / end", this flow causes all matching packets to be distributed to queues on basis of IPv4 checksum.

<...>

doc/guides/rel_notes/release_21_11.rst New Features · line 92

Quoted 9 lines
doc/guides/rel_notes/release_21_11.rst +3 -0
@@ -87,6 +87,11 @@ New Features
   Added command-line options to specify total number of processes and
   current process ID. Each process owns subset of Rx and Tx queues.
 
+* **Add new RSS offload types for IPv4/L4 checksum in RSS flow.**
+
+  Add macros ETH_RSS_IPV4_CHKSUM and ETH_RSS_L4_CHKSUM, now IPv4

and

Quoted 6 lines

doc/guides/rel_notes/release_21_11.rst New Features · line 95

Quoted 3 lines
doc/guides/rel_notes/release_21_11.rst +2 -0
+ TCP/UDP/SCTP header checksum field can be used as input set for RSS.
+
 

Thomas reported the issue that release notes items should be in past tense, updated the documentation in next-net, as s/Add/Added/ , fyi.

Ok, Thanks.