DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ice: support IPv4/L4 checksum RSS offload
@ 2021-09-09  6:47 Alvin Zhang
  2021-09-24  9:05 ` [dpdk-dev] [PATCH v2] " Alvin Zhang
  0 siblings, 1 reply; 4+ messages in thread
From: Alvin Zhang @ 2021-09-09  6:47 UTC (permalink / raw)
  To: qi.z.zhang, junfeng.guo; +Cc: dev, Alvin Zhang

Add supports for RSS_IPV4_CHKSUM & RSS_L4_CHKSUM RSS offload types
in RSS flow.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
---
 drivers/net/ice/ice_hash.c | 33 ++++++++++++++++++++++++++-------
 1 file changed, 26 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c
index 54d14df..3bf8027 100644
--- a/drivers/net/ice/ice_hash.c
+++ b/drivers/net/ice/ice_hash.c
@@ -374,13 +374,17 @@ struct ice_rss_hash_cfg eth_tmplt = {
 
 /* IPv4 */
 #define ICE_RSS_TYPE_ETH_IPV4		(ETH_RSS_ETH | ETH_RSS_IPV4 | \
-					 ETH_RSS_FRAG_IPV4)
+					 ETH_RSS_FRAG_IPV4 | \
+					 ETH_RSS_IPV4_CHKSUM)
 #define ICE_RSS_TYPE_ETH_IPV4_UDP	(ICE_RSS_TYPE_ETH_IPV4 | \
-					 ETH_RSS_NONFRAG_IPV4_UDP)
+					 ETH_RSS_NONFRAG_IPV4_UDP | \
+					 ETH_RSS_L4_CHKSUM)
 #define ICE_RSS_TYPE_ETH_IPV4_TCP	(ICE_RSS_TYPE_ETH_IPV4 | \
-					 ETH_RSS_NONFRAG_IPV4_TCP)
+					 ETH_RSS_NONFRAG_IPV4_TCP | \
+					 ETH_RSS_L4_CHKSUM)
 #define ICE_RSS_TYPE_ETH_IPV4_SCTP	(ICE_RSS_TYPE_ETH_IPV4 | \
-					 ETH_RSS_NONFRAG_IPV4_SCTP)
+					 ETH_RSS_NONFRAG_IPV4_SCTP | \
+					 ETH_RSS_L4_CHKSUM)
 #define ICE_RSS_TYPE_IPV4		ETH_RSS_IPV4
 #define ICE_RSS_TYPE_IPV4_UDP		(ETH_RSS_IPV4 | \
 					 ETH_RSS_NONFRAG_IPV4_UDP)
@@ -394,11 +398,14 @@ struct ice_rss_hash_cfg eth_tmplt = {
 #define ICE_RSS_TYPE_ETH_IPV6_FRAG	(ETH_RSS_ETH | ETH_RSS_IPV6 | \
 					 ETH_RSS_FRAG_IPV6)
 #define ICE_RSS_TYPE_ETH_IPV6_UDP	(ICE_RSS_TYPE_ETH_IPV6 | \
-					 ETH_RSS_NONFRAG_IPV6_UDP)
+					 ETH_RSS_NONFRAG_IPV6_UDP | \
+					 ETH_RSS_L4_CHKSUM)
 #define ICE_RSS_TYPE_ETH_IPV6_TCP	(ICE_RSS_TYPE_ETH_IPV6 | \
-					 ETH_RSS_NONFRAG_IPV6_TCP)
+					 ETH_RSS_NONFRAG_IPV6_TCP | \
+					 ETH_RSS_L4_CHKSUM)
 #define ICE_RSS_TYPE_ETH_IPV6_SCTP	(ICE_RSS_TYPE_ETH_IPV6 | \
-					 ETH_RSS_NONFRAG_IPV6_SCTP)
+					 ETH_RSS_NONFRAG_IPV6_SCTP | \
+					 ETH_RSS_L4_CHKSUM)
 #define ICE_RSS_TYPE_IPV6		ETH_RSS_IPV6
 #define ICE_RSS_TYPE_IPV6_UDP		(ETH_RSS_IPV6 | \
 					 ETH_RSS_NONFRAG_IPV6_UDP)
@@ -689,6 +696,9 @@ struct ice_rss_hash_cfg eth_tmplt = {
 		} else {
 			*hash_flds &= ~ICE_FLOW_HASH_IPV4;
 		}
+
+		if (rss_type & ETH_RSS_IPV4_CHKSUM)
+			*hash_flds |= BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_CHKSUM);
 	}
 
 	if (*addl_hdrs & ICE_FLOW_SEG_HDR_IPV6) {
@@ -765,6 +775,9 @@ struct ice_rss_hash_cfg eth_tmplt = {
 		} else {
 			*hash_flds &= ~ICE_FLOW_HASH_UDP_PORT;
 		}
+
+		if (rss_type & ETH_RSS_L4_CHKSUM)
+			*hash_flds |= BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_CHKSUM);
 	}
 
 	if (*addl_hdrs & ICE_FLOW_SEG_HDR_TCP) {
@@ -782,6 +795,9 @@ struct ice_rss_hash_cfg eth_tmplt = {
 		} else {
 			*hash_flds &= ~ICE_FLOW_HASH_TCP_PORT;
 		}
+
+		if (rss_type & ETH_RSS_L4_CHKSUM)
+			*hash_flds |= BIT_ULL(ICE_FLOW_FIELD_IDX_TCP_CHKSUM);
 	}
 
 	if (*addl_hdrs & ICE_FLOW_SEG_HDR_SCTP) {
@@ -799,6 +815,9 @@ struct ice_rss_hash_cfg eth_tmplt = {
 		} else {
 			*hash_flds &= ~ICE_FLOW_HASH_SCTP_PORT;
 		}
+
+		if (rss_type & ETH_RSS_L4_CHKSUM)
+			*hash_flds |= BIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_CHKSUM);
 	}
 
 	if (*addl_hdrs & ICE_FLOW_SEG_HDR_L2TPV3) {
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v2] net/ice: support IPv4/L4 checksum RSS offload
  2021-09-09  6:47 [dpdk-dev] [PATCH] net/ice: support IPv4/L4 checksum RSS offload Alvin Zhang
@ 2021-09-24  9:05 ` Alvin Zhang
  2021-09-24  9:53   ` [dpdk-dev] [PATCH v3] " Alvin Zhang
  0 siblings, 1 reply; 4+ messages in thread
From: Alvin Zhang @ 2021-09-24  9:05 UTC (permalink / raw)
  To: qi.z.zhang; +Cc: dev, Alvin Zhang

Add supports for RSS_IPV4_CHKSUM & RSS_L4_CHKSUM RSS offload types
in RSS flow.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
---

v2: rebase to dpdk-next-net-intel
---
 drivers/net/ice/ice_hash.c | 33 ++++++++++++++++++++++++++-------
 1 file changed, 26 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c
index 175780c..df1bdfd 100644
--- a/drivers/net/ice/ice_hash.c
+++ b/drivers/net/ice/ice_hash.c
@@ -374,13 +374,17 @@ struct ice_rss_hash_cfg eth_tmplt = {
 
 /* IPv4 */
 #define ICE_RSS_TYPE_ETH_IPV4		(ETH_RSS_ETH | ETH_RSS_IPV4 | \
-					 ETH_RSS_FRAG_IPV4)
+					 ETH_RSS_FRAG_IPV4 | \
+					 ETH_RSS_IPV4_CHKSUM)
 #define ICE_RSS_TYPE_ETH_IPV4_UDP	(ICE_RSS_TYPE_ETH_IPV4 | \
-					 ETH_RSS_NONFRAG_IPV4_UDP)
+					 ETH_RSS_NONFRAG_IPV4_UDP | \
+					 ETH_RSS_L4_CHKSUM)
 #define ICE_RSS_TYPE_ETH_IPV4_TCP	(ICE_RSS_TYPE_ETH_IPV4 | \
-					 ETH_RSS_NONFRAG_IPV4_TCP)
+					 ETH_RSS_NONFRAG_IPV4_TCP | \
+					 ETH_RSS_L4_CHKSUM)
 #define ICE_RSS_TYPE_ETH_IPV4_SCTP	(ICE_RSS_TYPE_ETH_IPV4 | \
-					 ETH_RSS_NONFRAG_IPV4_SCTP)
+					 ETH_RSS_NONFRAG_IPV4_SCTP | \
+					 ETH_RSS_L4_CHKSUM)
 #define ICE_RSS_TYPE_IPV4		ETH_RSS_IPV4
 #define ICE_RSS_TYPE_IPV4_UDP		(ETH_RSS_IPV4 | \
 					 ETH_RSS_NONFRAG_IPV4_UDP)
@@ -394,11 +398,14 @@ struct ice_rss_hash_cfg eth_tmplt = {
 #define ICE_RSS_TYPE_ETH_IPV6_FRAG	(ETH_RSS_ETH | ETH_RSS_IPV6 | \
 					 ETH_RSS_FRAG_IPV6)
 #define ICE_RSS_TYPE_ETH_IPV6_UDP	(ICE_RSS_TYPE_ETH_IPV6 | \
-					 ETH_RSS_NONFRAG_IPV6_UDP)
+					 ETH_RSS_NONFRAG_IPV6_UDP | \
+					 ETH_RSS_L4_CHKSUM)
 #define ICE_RSS_TYPE_ETH_IPV6_TCP	(ICE_RSS_TYPE_ETH_IPV6 | \
-					 ETH_RSS_NONFRAG_IPV6_TCP)
+					 ETH_RSS_NONFRAG_IPV6_TCP | \
+					 ETH_RSS_L4_CHKSUM)
 #define ICE_RSS_TYPE_ETH_IPV6_SCTP	(ICE_RSS_TYPE_ETH_IPV6 | \
-					 ETH_RSS_NONFRAG_IPV6_SCTP)
+					 ETH_RSS_NONFRAG_IPV6_SCTP | \
+					 ETH_RSS_L4_CHKSUM)
 #define ICE_RSS_TYPE_IPV6		ETH_RSS_IPV6
 #define ICE_RSS_TYPE_IPV6_UDP		(ETH_RSS_IPV6 | \
 					 ETH_RSS_NONFRAG_IPV6_UDP)
@@ -689,6 +696,9 @@ struct ice_rss_hash_cfg eth_tmplt = {
 		} else {
 			*hash_flds &= ~ICE_FLOW_HASH_IPV4;
 		}
+
+		if (rss_type & ETH_RSS_IPV4_CHKSUM)
+			*hash_flds |= BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_CHKSUM);
 	}
 
 	if (*addl_hdrs & ICE_FLOW_SEG_HDR_IPV6) {
@@ -765,6 +775,9 @@ struct ice_rss_hash_cfg eth_tmplt = {
 		} else {
 			*hash_flds &= ~ICE_FLOW_HASH_UDP_PORT;
 		}
+
+		if (rss_type & ETH_RSS_L4_CHKSUM)
+			*hash_flds |= BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_CHKSUM);
 	}
 
 	if (*addl_hdrs & ICE_FLOW_SEG_HDR_TCP) {
@@ -782,6 +795,9 @@ struct ice_rss_hash_cfg eth_tmplt = {
 		} else {
 			*hash_flds &= ~ICE_FLOW_HASH_TCP_PORT;
 		}
+
+		if (rss_type & ETH_RSS_L4_CHKSUM)
+			*hash_flds |= BIT_ULL(ICE_FLOW_FIELD_IDX_TCP_CHKSUM);
 	}
 
 	if (*addl_hdrs & ICE_FLOW_SEG_HDR_SCTP) {
@@ -799,6 +815,9 @@ struct ice_rss_hash_cfg eth_tmplt = {
 		} else {
 			*hash_flds &= ~ICE_FLOW_HASH_SCTP_PORT;
 		}
+
+		if (rss_type & ETH_RSS_L4_CHKSUM)
+			*hash_flds |= BIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_CHKSUM);
 	}
 
 	if (*addl_hdrs & ICE_FLOW_SEG_HDR_L2TPV3) {
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v3] net/ice: support IPv4/L4 checksum RSS offload
  2021-09-24  9:05 ` [dpdk-dev] [PATCH v2] " Alvin Zhang
@ 2021-09-24  9:53   ` Alvin Zhang
  2021-09-24 11:05     ` Zhang, Qi Z
  0 siblings, 1 reply; 4+ messages in thread
From: Alvin Zhang @ 2021-09-24  9:53 UTC (permalink / raw)
  To: qi.z.zhang; +Cc: dev, Alvin Zhang

Add supports for RSS_IPV4_CHKSUM & RSS_L4_CHKSUM RSS offload types
in RSS flow.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
---

v2: rebase to dpdk-next-net-intel
v3: add release note
---
 doc/guides/rel_notes/release_21_11.rst |  3 ++-
 drivers/net/ice/ice_hash.c             | 33 ++++++++++++++++++++++++++-------
 2 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index 19356ac..eeb1e3d 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -75,7 +75,8 @@ New Features
 
 * **Updated Intel ice driver.**
 
-  Added 1PPS out support by a devargs.
+  * Added 1PPS out support by a devargs.
+  * Added IPv4 and L4(TCP/UDP/SCTP) checksum hash support in RSS flow.
 
 * **Updated Marvell cnxk ethdev driver.**
 
diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c
index 175780c..df1bdfd 100644
--- a/drivers/net/ice/ice_hash.c
+++ b/drivers/net/ice/ice_hash.c
@@ -374,13 +374,17 @@ struct ice_rss_hash_cfg eth_tmplt = {
 
 /* IPv4 */
 #define ICE_RSS_TYPE_ETH_IPV4		(ETH_RSS_ETH | ETH_RSS_IPV4 | \
-					 ETH_RSS_FRAG_IPV4)
+					 ETH_RSS_FRAG_IPV4 | \
+					 ETH_RSS_IPV4_CHKSUM)
 #define ICE_RSS_TYPE_ETH_IPV4_UDP	(ICE_RSS_TYPE_ETH_IPV4 | \
-					 ETH_RSS_NONFRAG_IPV4_UDP)
+					 ETH_RSS_NONFRAG_IPV4_UDP | \
+					 ETH_RSS_L4_CHKSUM)
 #define ICE_RSS_TYPE_ETH_IPV4_TCP	(ICE_RSS_TYPE_ETH_IPV4 | \
-					 ETH_RSS_NONFRAG_IPV4_TCP)
+					 ETH_RSS_NONFRAG_IPV4_TCP | \
+					 ETH_RSS_L4_CHKSUM)
 #define ICE_RSS_TYPE_ETH_IPV4_SCTP	(ICE_RSS_TYPE_ETH_IPV4 | \
-					 ETH_RSS_NONFRAG_IPV4_SCTP)
+					 ETH_RSS_NONFRAG_IPV4_SCTP | \
+					 ETH_RSS_L4_CHKSUM)
 #define ICE_RSS_TYPE_IPV4		ETH_RSS_IPV4
 #define ICE_RSS_TYPE_IPV4_UDP		(ETH_RSS_IPV4 | \
 					 ETH_RSS_NONFRAG_IPV4_UDP)
@@ -394,11 +398,14 @@ struct ice_rss_hash_cfg eth_tmplt = {
 #define ICE_RSS_TYPE_ETH_IPV6_FRAG	(ETH_RSS_ETH | ETH_RSS_IPV6 | \
 					 ETH_RSS_FRAG_IPV6)
 #define ICE_RSS_TYPE_ETH_IPV6_UDP	(ICE_RSS_TYPE_ETH_IPV6 | \
-					 ETH_RSS_NONFRAG_IPV6_UDP)
+					 ETH_RSS_NONFRAG_IPV6_UDP | \
+					 ETH_RSS_L4_CHKSUM)
 #define ICE_RSS_TYPE_ETH_IPV6_TCP	(ICE_RSS_TYPE_ETH_IPV6 | \
-					 ETH_RSS_NONFRAG_IPV6_TCP)
+					 ETH_RSS_NONFRAG_IPV6_TCP | \
+					 ETH_RSS_L4_CHKSUM)
 #define ICE_RSS_TYPE_ETH_IPV6_SCTP	(ICE_RSS_TYPE_ETH_IPV6 | \
-					 ETH_RSS_NONFRAG_IPV6_SCTP)
+					 ETH_RSS_NONFRAG_IPV6_SCTP | \
+					 ETH_RSS_L4_CHKSUM)
 #define ICE_RSS_TYPE_IPV6		ETH_RSS_IPV6
 #define ICE_RSS_TYPE_IPV6_UDP		(ETH_RSS_IPV6 | \
 					 ETH_RSS_NONFRAG_IPV6_UDP)
@@ -689,6 +696,9 @@ struct ice_rss_hash_cfg eth_tmplt = {
 		} else {
 			*hash_flds &= ~ICE_FLOW_HASH_IPV4;
 		}
+
+		if (rss_type & ETH_RSS_IPV4_CHKSUM)
+			*hash_flds |= BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_CHKSUM);
 	}
 
 	if (*addl_hdrs & ICE_FLOW_SEG_HDR_IPV6) {
@@ -765,6 +775,9 @@ struct ice_rss_hash_cfg eth_tmplt = {
 		} else {
 			*hash_flds &= ~ICE_FLOW_HASH_UDP_PORT;
 		}
+
+		if (rss_type & ETH_RSS_L4_CHKSUM)
+			*hash_flds |= BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_CHKSUM);
 	}
 
 	if (*addl_hdrs & ICE_FLOW_SEG_HDR_TCP) {
@@ -782,6 +795,9 @@ struct ice_rss_hash_cfg eth_tmplt = {
 		} else {
 			*hash_flds &= ~ICE_FLOW_HASH_TCP_PORT;
 		}
+
+		if (rss_type & ETH_RSS_L4_CHKSUM)
+			*hash_flds |= BIT_ULL(ICE_FLOW_FIELD_IDX_TCP_CHKSUM);
 	}
 
 	if (*addl_hdrs & ICE_FLOW_SEG_HDR_SCTP) {
@@ -799,6 +815,9 @@ struct ice_rss_hash_cfg eth_tmplt = {
 		} else {
 			*hash_flds &= ~ICE_FLOW_HASH_SCTP_PORT;
 		}
+
+		if (rss_type & ETH_RSS_L4_CHKSUM)
+			*hash_flds |= BIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_CHKSUM);
 	}
 
 	if (*addl_hdrs & ICE_FLOW_SEG_HDR_L2TPV3) {
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH v3] net/ice: support IPv4/L4 checksum RSS offload
  2021-09-24  9:53   ` [dpdk-dev] [PATCH v3] " Alvin Zhang
@ 2021-09-24 11:05     ` Zhang, Qi Z
  0 siblings, 0 replies; 4+ messages in thread
From: Zhang, Qi Z @ 2021-09-24 11:05 UTC (permalink / raw)
  To: Zhang, AlvinX; +Cc: dev



> -----Original Message-----
> From: Zhang, AlvinX <alvinx.zhang@intel.com>
> Sent: Friday, September 24, 2021 5:54 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Zhang, AlvinX <alvinx.zhang@intel.com>
> Subject: [PATCH v3] net/ice: support IPv4/L4 checksum RSS offload
> 
> Add supports for RSS_IPV4_CHKSUM & RSS_L4_CHKSUM RSS offload types in
> RSS flow.
> 
> Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>

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

Applied to dpdk-next-net-intel.

Thanks
Qi

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

end of thread, other threads:[~2021-09-24 11:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-09  6:47 [dpdk-dev] [PATCH] net/ice: support IPv4/L4 checksum RSS offload Alvin Zhang
2021-09-24  9:05 ` [dpdk-dev] [PATCH v2] " Alvin Zhang
2021-09-24  9:53   ` [dpdk-dev] [PATCH v3] " Alvin Zhang
2021-09-24 11:05     ` Zhang, Qi Z

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).