Skip to contentSkip to conversation

net/ice: fix the judgment order of buffer split

PATCH Superseded Yuan Wang 4 participants 6 messages Oct 17, 2022 – Oct 24, 2022 Network drivers

lore
Share & tools
lore

Yuan Wang

author
#0 lore raw

PATCH 1/1 net/ice: fix the judgment order of buffer split

proto_hdr defines a bit mask of the protocol sequence as RTE_PTYPE_*, The last RTE_PTYPE* in the mask indicates the split position.

To get the split position from hdr_proto, the order of judgement should be from inner to outer layer, so for tunneling packets the tunnel header should be placed at the end of the judgement condition.

Fixes 629dad3ef325 ("net/ice: support buffer split in scalar Rx")
---
 drivers/net/ice/ice_rxtx.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/ice/ice_rxtx.c +7 -7
index 953ff217df..7a2d5829c0 100644
@@ -324,13 +324,6 @@ ice_program_hw_rx_queue(struct ice_rx_queue *rxq)
 			goto set_hsplit_finish;
 		}
 
-		switch (proto_hdr & RTE_PTYPE_TUNNEL_MASK) {
-		case RTE_PTYPE_TUNNEL_GRENAT:
-			rx_ctx.dtype = ICE_RX_DTYPE_HEADER_SPLIT;
-			rx_ctx.hsplit_1 = ICE_RLAN_RX_HSPLIT_1_SPLIT_ALWAYS;
-			goto set_hsplit_finish;
-		}
-
 		switch (proto_hdr & RTE_PTYPE_INNER_L4_MASK) {
 		case RTE_PTYPE_INNER_L4_TCP:
 		case RTE_PTYPE_INNER_L4_UDP:
@@ -358,6 +351,13 @@ ice_program_hw_rx_queue(struct ice_rx_queue *rxq)
 			goto set_hsplit_finish;
 		}
 
+		switch (proto_hdr & RTE_PTYPE_TUNNEL_MASK) {
+		case RTE_PTYPE_TUNNEL_GRENAT:
+			rx_ctx.dtype = ICE_RX_DTYPE_HEADER_SPLIT;
+			rx_ctx.hsplit_1 = ICE_RLAN_RX_HSPLIT_1_SPLIT_ALWAYS;
+			goto set_hsplit_finish;
+		}
+
 		PMD_DRV_LOG(ERR, "Buffer split protocol is not supported");
 		return -EINVAL;
 
Signature · 1 line
2.25.1
#1 lore raw

Hi Yuan,

Quoted 9 lines

-----Original Message-----
From: Wang, YuanX <[email protected]>
Sent: Tuesday, October 18, 2022 12:00 AM
To: Yang, Qiming <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: [email protected]; Ding, Xuan <[email protected]>; Tang, Yaqi <[email protected]>; Wang, YuanX <[email protected]>
Subject: [PATCH] net/ice: fix the judgment order of buffer split

Quoted 4 lines

proto_hdr defines a bit mask of the protocol sequence as RTE_PTYPE_*, The last RTE_PTYPE* in the mask indicates the split position.

To get the split position from hdr_proto, the order of judgement should be

The hdr_proto here should be proto_hdr?

Thanks,
Xuan

Quoted 48 lines

from inner to outer layer, so for tunneling packets the tunnel header should be placed at the end of the judgement condition.

Fixes 629dad3ef325 ("net/ice: support buffer split in scalar Rx")
---
 drivers/net/ice/ice_rxtx.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/ice/ice_rxtx.c index renamed from drivers/net/ice/ice_rxtx.c +0 -0

953ff217df..7a2d5829c0 100644

drivers/net/ice/ice_rxtx.c +0 -7
@@ -324,13 +324,6 @@ ice_program_hw_rx_queue(struct ice_rx_queue
 *rxq)
 			goto set_hsplit_finish;
 		}
 
-		switch (proto_hdr & RTE_PTYPE_TUNNEL_MASK) {
-		case RTE_PTYPE_TUNNEL_GRENAT:
-			rx_ctx.dtype = ICE_RX_DTYPE_HEADER_SPLIT;
-			rx_ctx.hsplit_1 =
 ICE_RLAN_RX_HSPLIT_1_SPLIT_ALWAYS;
-			goto set_hsplit_finish;
-		}
-
 		switch (proto_hdr & RTE_PTYPE_INNER_L4_MASK) {
drivers/net/ice/ice_rxtx.c +7 -0
 		case RTE_PTYPE_INNER_L4_TCP:
 		case RTE_PTYPE_INNER_L4_UDP:
@@ -358,6 +351,13 @@ ice_program_hw_rx_queue(struct ice_rx_queue
 *rxq)
 			goto set_hsplit_finish;
 		}
 
+		switch (proto_hdr & RTE_PTYPE_TUNNEL_MASK) {
+		case RTE_PTYPE_TUNNEL_GRENAT:
+			rx_ctx.dtype = ICE_RX_DTYPE_HEADER_SPLIT;
+			rx_ctx.hsplit_1 =
 ICE_RLAN_RX_HSPLIT_1_SPLIT_ALWAYS;
+			goto set_hsplit_finish;
+		}
+
 		PMD_DRV_LOG(ERR, "Buffer split protocol is not supported");

return -EINVAL;

--
2.25.1

#2 lore raw

Hi Xuan,

Quoted 19 lines

-----Original Message-----
From: Ding, Xuan <[email protected]>
Sent: Monday, October 17, 2022 4:40 PM
To: Wang, YuanX <[email protected]>; Yang, Qiming <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: [email protected]; Tang, Yaqi <[email protected]>
Subject: RE: [PATCH] net/ice: fix the judgment order of buffer split

Hi Yuan,

Quoted 9 lines

-----Original Message-----
From: Wang, YuanX <[email protected]>
Sent: Tuesday, October 18, 2022 12:00 AM
To: Yang, Qiming <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: [email protected]; Ding, Xuan <[email protected]>; Tang, Yaqi <[email protected]>; Wang, YuanX <[email protected]>
Subject: [PATCH] net/ice: fix the judgment order of buffer split

Quoted 7 lines
Quoted 5 lines

proto_hdr defines a bit mask of the protocol sequence as RTE_PTYPE_*, The last RTE_PTYPE* in the mask indicates the split position.

To get the split position from hdr_proto, the order of judgement should be

The hdr_proto here should be proto_hdr?

Yes, it's proto_hdr. Thanks for the correction.
Will fix in new version.

Thanks,
Yuan.

[...]

author
#3 lore raw

PATCH v2 1/1 net/ice: fix the judgment order of buffer split

In reply to Yuan Wang

proto_hdr defines a bit mask of the protocol sequence as RTE_PTYPE_*, The last RTE_PTYPE* in the mask indicates the split position.

To get the split position from proto_hdr, the order of judgement should be from inner to outer layer, so for tunneling packets the tunnel header should be placed at the end of the judgement condition.

Fixes 629dad3ef325 ("net/ice: support buffer split in scalar Rx")

---
v2: fix typo

---
 drivers/net/ice/ice_rxtx.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/ice/ice_rxtx.c +7 -7
index 953ff217df..7a2d5829c0 100644
@@ -324,13 +324,6 @@ ice_program_hw_rx_queue(struct ice_rx_queue *rxq)
 			goto set_hsplit_finish;
 		}
 
-		switch (proto_hdr & RTE_PTYPE_TUNNEL_MASK) {
-		case RTE_PTYPE_TUNNEL_GRENAT:
-			rx_ctx.dtype = ICE_RX_DTYPE_HEADER_SPLIT;
-			rx_ctx.hsplit_1 = ICE_RLAN_RX_HSPLIT_1_SPLIT_ALWAYS;
-			goto set_hsplit_finish;
-		}
-
 		switch (proto_hdr & RTE_PTYPE_INNER_L4_MASK) {
 		case RTE_PTYPE_INNER_L4_TCP:
 		case RTE_PTYPE_INNER_L4_UDP:
@@ -358,6 +351,13 @@ ice_program_hw_rx_queue(struct ice_rx_queue *rxq)
 			goto set_hsplit_finish;
 		}
 
+		switch (proto_hdr & RTE_PTYPE_TUNNEL_MASK) {
+		case RTE_PTYPE_TUNNEL_GRENAT:
+			rx_ctx.dtype = ICE_RX_DTYPE_HEADER_SPLIT;
+			rx_ctx.hsplit_1 = ICE_RLAN_RX_HSPLIT_1_SPLIT_ALWAYS;
+			goto set_hsplit_finish;
+		}
+
 		PMD_DRV_LOG(ERR, "Buffer split protocol is not supported");
 		return -EINVAL;
 
Signature · 1 line
2.25.1
Acked-by on v2 1/1 Applied
#4 lore raw
Quoted 14 lines

-----Original Message-----
From: Wang, YuanX <[email protected]>
Sent: Tuesday, October 18, 2022 1:05 AM
To: Yang, Qiming <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: [email protected]; Ding, Xuan <[email protected]>; Tang, Yaqi <[email protected]>; Wang, YuanX <[email protected]>
Subject: [PATCH v2] net/ice: fix the judgment order of buffer split

proto_hdr defines a bit mask of the protocol sequence as RTE_PTYPE_*, The last RTE_PTYPE* in the mask indicates the split position.

Quoted 7 lines

To get the split position from proto_hdr, the order of judgement should be from inner to outer layer, so for tunneling packets the tunnel header should be placed at the end of the judgement condition.

Fixes 629dad3ef325 ("net/ice: support buffer split in scalar Rx")

Applied to dpdk-next-net-intel.

Thanks
Qi

Tested-by on v2 1/1
#5 lore raw
In reply to Yuan Wang
Quoted 17 lines

-----Original Message-----
From: Wang, YuanX <[email protected]>
Sent: Tuesday, October 18, 2022 1:05 AM
To: Yang, Qiming <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: [email protected]; Ding, Xuan <[email protected]>; Tang, Yaqi <[email protected]>; Wang, YuanX <[email protected]>
Subject: [PATCH v2] net/ice: fix the judgment order of buffer split

proto_hdr defines a bit mask of the protocol sequence as RTE_PTYPE_*, The last RTE_PTYPE* in the mask indicates the split position.

To get the split position from proto_hdr, the order of judgement should be from inner to outer layer, so for tunneling packets the tunnel header should be placed at the end of the judgement condition.

Quoted 8 lines
Fixes 629dad3ef325 ("net/ice: support buffer split in scalar Rx")

---
v2: fix typo

---