DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] net/ice: fix wrong IP RSS configuration template
@ 2021-05-08  7:11 Ting Xu
  2021-05-10  2:40 ` Zhang, Qi Z
  0 siblings, 1 reply; 3+ messages in thread
From: Ting Xu @ 2021-05-08  7:11 UTC (permalink / raw)
  To: dev; +Cc: qiming.yang, qi.z.zhang, Ting Xu, stable

To enable IP fragment RSS hash, ICE_FLOW_SEG_HDR_IPV_FRAG is added to the
IP RSS configuration template, together with ICE_FLOW_SEG_HDR_IPV_OTHER.
It will cause error when associating flow profile. And packet id field
for RSS is not correctly added when IP fragment is enabled. To fix this
issue, this patch only selects one of the above two segment header types
based on rss types.

Fixes: 672f321d09ed ("net/ice: support RSS hash for IP fragment")
Cc: stable@dpdk.org

Signed-off-by: Ting Xu <ting.xu@intel.com>
---
 drivers/net/ice/ice_hash.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c
index 2bf8983f5a..3bc16139d1 100644
--- a/drivers/net/ice/ice_hash.c
+++ b/drivers/net/ice/ice_hash.c
@@ -111,7 +111,6 @@ ice_hash_parse_pattern_action(struct ice_adapter *ad,
 /* Rss configuration template */
 struct ice_rss_hash_cfg ipv4_tmplt = {
 	ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_IPV4 |
-	ICE_FLOW_SEG_HDR_IPV_FRAG |
 	ICE_FLOW_SEG_HDR_IPV_OTHER,
 	ICE_FLOW_HASH_ETH | ICE_FLOW_HASH_IPV4,
 	ICE_RSS_OUTER_HEADERS,
@@ -152,8 +151,7 @@ struct ice_rss_hash_cfg ipv6_tmplt = {
 
 struct ice_rss_hash_cfg ipv6_frag_tmplt = {
 	ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_IPV6 |
-	ICE_FLOW_SEG_HDR_IPV_FRAG |
-	ICE_FLOW_SEG_HDR_IPV_OTHER,
+	ICE_FLOW_SEG_HDR_IPV_FRAG,
 	ICE_FLOW_HASH_ETH | ICE_FLOW_HASH_IPV6,
 	ICE_RSS_ANY_HEADERS,
 	0
@@ -657,10 +655,13 @@ ice_refine_hash_cfg_l234(struct ice_rss_hash_cfg *hash_cfg,
 		    ETH_RSS_NONFRAG_IPV4_UDP |
 		    ETH_RSS_NONFRAG_IPV4_TCP |
 		    ETH_RSS_NONFRAG_IPV4_SCTP)) {
-			if (rss_type & ETH_RSS_FRAG_IPV4)
-				*hash_flds &=
-					~(BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_ID));
-			else if (rss_type & ETH_RSS_L3_SRC_ONLY)
+			if (rss_type & ETH_RSS_FRAG_IPV4) {
+				*addl_hdrs |= ICE_FLOW_SEG_HDR_IPV_FRAG;
+				*addl_hdrs &= ~(ICE_FLOW_SEG_HDR_IPV_OTHER);
+				*hash_flds |=
+					BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_ID);
+			}
+			if (rss_type & ETH_RSS_L3_SRC_ONLY)
 				*hash_flds &= ~(BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_DA));
 			else if (rss_type & ETH_RSS_L3_DST_ONLY)
 				*hash_flds &= ~(BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA));
@@ -680,9 +681,9 @@ ice_refine_hash_cfg_l234(struct ice_rss_hash_cfg *hash_cfg,
 		    ETH_RSS_NONFRAG_IPV6_TCP |
 		    ETH_RSS_NONFRAG_IPV6_SCTP)) {
 			if (rss_type & ETH_RSS_FRAG_IPV6)
-				*hash_flds &=
-					~(BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_ID));
-			else if (rss_type & ETH_RSS_L3_SRC_ONLY)
+				*hash_flds |=
+					BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_ID);
+			if (rss_type & ETH_RSS_L3_SRC_ONLY)
 				*hash_flds &= ~(BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_DA));
 			else if (rss_type & ETH_RSS_L3_DST_ONLY)
 				*hash_flds &= ~(BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_SA));
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread
* [dpdk-dev] [PATCH v1] net/ice: fix wrong IP RSS configuration template
@ 2021-05-07  9:52 Ting Xu
  0 siblings, 0 replies; 3+ messages in thread
From: Ting Xu @ 2021-05-07  9:52 UTC (permalink / raw)
  To: dev; +Cc: qiming.yang, qi.z.zhang, Ting Xu, stable

To enable IP fragment RSS hash, ICE_FLOW_SEG_HDR_IPV_FRAG is added to the
IP RSS configuration template, together with ICE_FLOW_SEG_HDR_IPV_OTHER.
It will cause error when associating flow profile. To fix this issue,
this patch only selects one of the above two segment header types based
on rss types.

Fixes: 672f321d09ed ("net/ice: support RSS hash for IP fragment")
Cc: stable@dpdk.org

Signed-off-by: Ting Xu <ting.xu@intel.com>
---
 drivers/net/ice/ice_hash.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c
index 2bf8983f5a..9e52f1c4a7 100644
--- a/drivers/net/ice/ice_hash.c
+++ b/drivers/net/ice/ice_hash.c
@@ -111,7 +111,6 @@ ice_hash_parse_pattern_action(struct ice_adapter *ad,
 /* Rss configuration template */
 struct ice_rss_hash_cfg ipv4_tmplt = {
 	ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_IPV4 |
-	ICE_FLOW_SEG_HDR_IPV_FRAG |
 	ICE_FLOW_SEG_HDR_IPV_OTHER,
 	ICE_FLOW_HASH_ETH | ICE_FLOW_HASH_IPV4,
 	ICE_RSS_OUTER_HEADERS,
@@ -152,8 +151,7 @@ struct ice_rss_hash_cfg ipv6_tmplt = {
 
 struct ice_rss_hash_cfg ipv6_frag_tmplt = {
 	ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_IPV6 |
-	ICE_FLOW_SEG_HDR_IPV_FRAG |
-	ICE_FLOW_SEG_HDR_IPV_OTHER,
+	ICE_FLOW_SEG_HDR_IPV_FRAG,
 	ICE_FLOW_HASH_ETH | ICE_FLOW_HASH_IPV6,
 	ICE_RSS_ANY_HEADERS,
 	0
@@ -657,17 +655,20 @@ ice_refine_hash_cfg_l234(struct ice_rss_hash_cfg *hash_cfg,
 		    ETH_RSS_NONFRAG_IPV4_UDP |
 		    ETH_RSS_NONFRAG_IPV4_TCP |
 		    ETH_RSS_NONFRAG_IPV4_SCTP)) {
-			if (rss_type & ETH_RSS_FRAG_IPV4)
-				*hash_flds &=
-					~(BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_ID));
-			else if (rss_type & ETH_RSS_L3_SRC_ONLY)
+			if (rss_type & ETH_RSS_FRAG_IPV4) {
+				*addl_hdrs |= ICE_FLOW_SEG_HDR_IPV_FRAG;
+				*addl_hdrs &= ~(ICE_FLOW_SEG_HDR_IPV_FRAG);
+				*hash_flds |=
+					BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_ID);
+			} else if (rss_type & ETH_RSS_L3_SRC_ONLY) {
 				*hash_flds &= ~(BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_DA));
-			else if (rss_type & ETH_RSS_L3_DST_ONLY)
+			} else if (rss_type & ETH_RSS_L3_DST_ONLY) {
 				*hash_flds &= ~(BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA));
-			else if (rss_type &
+			} else if (rss_type &
 				(ETH_RSS_L4_SRC_ONLY |
-				ETH_RSS_L4_DST_ONLY))
+				ETH_RSS_L4_DST_ONLY)) {
 				*hash_flds &= ~ICE_FLOW_HASH_IPV4;
+			}
 		} else {
 			*hash_flds &= ~ICE_FLOW_HASH_IPV4;
 		}
-- 
2.17.1


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

end of thread, other threads:[~2021-05-10  2:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-08  7:11 [dpdk-dev] [PATCH v1] net/ice: fix wrong IP RSS configuration template Ting Xu
2021-05-10  2:40 ` Zhang, Qi Z
  -- strict thread matches above, loose matches on Subject: below --
2021-05-07  9:52 Ting Xu

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