Skip to contentSkip to conversation

fix variable type in pattern parsing for raw flow

PATCH Applied Junfeng Guo 4 participants 8 messages Jun 15, 2023 – Jun 19, 2023 Network drivers

lore
Share & tools
lore
#0 lore raw

cover fix variable type in pattern parsing for raw flow

In current pattern parsing function for protocol agnostic flow offloading (raw flow), some of the variables of packet length are defined as uint8_t, which are too small for some large-size packets, such as srv6 (Segment Routing over IPv6 dataplane) type. Change the type to uint16_t.

For example, the length of below srv6 paket is 268 B, larger than the max of uint8_t type (i.e., 256).

"mac()/ipv6(nextheader=43)/ipv6srh(headerextlength=4,nextheader=41)\
		/ipv6(dst=2001:2:0:0:0:0:0:2)"

Junfeng Guo (2):
net/ice: fix variable type in pattern parsing for raw flow net/iavf: fix variable type in pattern parsing for raw flow

 drivers/net/iavf/iavf_hash.c      | 2 +-
 drivers/net/ice/ice_fdir_filter.c | 2 +-
 drivers/net/ice/ice_hash.c        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/2 net/ice: fix variable type in pattern parsing for raw flow

In current pattern parsing function for protocol agnostic flow offloading (raw flow), some of the variables of packet length are defined as uint8_t, which are too small for some large-size packets, such as srv6 (Segment Routing over IPv6 dataplane) type. Change the type to uint16_t.

Fixes 25be39cc1760 ("net/ice: enable protocol agnostic flow offloading in FDIR")
Fixes 1b9c68120a1c ("net/ice: enable protocol agnostic flow offloading in RSS")
---
 drivers/net/ice/ice_fdir_filter.c | 2 +-
 drivers/net/ice/ice_hash.c        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ice/ice_fdir_filter.c +1 -1
index 480b369af8..e8842bc242 100644
@@ -1876,7 +1876,7 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 				(uint8_t *)(uintptr_t)raw_mask->pattern;
 			uint8_t *tmp_spec, *tmp_mask;
 			uint16_t tmp_val = 0;
-			uint8_t pkt_len = 0;
+			uint16_t pkt_len = 0;
 			uint8_t tmp = 0;
 			int i, j;
 
drivers/net/ice/ice_hash.c +1 -1
index f35727856e..52646e9408 100644
@@ -653,8 +653,8 @@ ice_hash_parse_raw_pattern(struct ice_adapter *ad,
 	const struct rte_flow_item_raw *raw_spec, *raw_mask;
 	struct ice_parser_profile prof;
 	struct ice_parser_result rslt;
+	uint16_t spec_len, pkt_len;
 	uint8_t *pkt_buf, *msk_buf;
-	uint8_t spec_len, pkt_len;
 	uint8_t tmp_val = 0;
 	uint8_t tmp_c = 0;
 	int i, j;
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/2 net/iavf: fix variable type in pattern parsing for raw flow

In reply to Junfeng Guo

In current pattern parsing function for protocol agnostic flow offloading (raw flow), some of the variables of packet length are defined as uint8_t, which are too small for some large-size packets, such as srv6 (Segment Routing over IPv6 dataplane) type. Change the type to uint16_t.

Fixes bc0e85586eaf ("net/iavf: support VF RSS flow rule with raw pattern")
---
 drivers/net/iavf/iavf_hash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/iavf/iavf_hash.c +1 -1
index ae6fb38594..cf4d677101 100644
@@ -886,8 +886,8 @@ iavf_hash_parse_raw_pattern(const struct rte_flow_item *item,
 			struct iavf_rss_meta *meta)
 {
 	const struct rte_flow_item_raw *raw_spec, *raw_mask;
+	uint16_t spec_len, pkt_len;
 	uint8_t *pkt_buf, *msk_buf;
-	uint8_t spec_len, pkt_len;
 	uint8_t tmp_val = 0;
 	uint8_t tmp_c = 0;
 	int i, j;
Signature · 1 line
2.25.1
Acked-by on the v1 series
#3 lore raw
In reply to Junfeng Guo
Quoted 23 lines

-----Original Message-----
From: Guo, Junfeng <[email protected]>
Sent: Thursday, June 15, 2023 1:17 PM
To: Zhang, Qi Z <[email protected]>; Yang, Qiming <[email protected]>
Cc: [email protected]; [email protected]; Xu, Ting <[email protected]>; Guo, Junfeng <[email protected]>
Subject: [PATCH 0/2] fix variable type in pattern parsing for raw flow

In current pattern parsing function for protocol agnostic flow offloading (raw flow), some of the variables of packet length are defined as uint8_t, which are too small for some large-size packets, such as srv6 (Segment Routing over IPv6 dataplane) type. Change the type to uint16_t.

For example, the length of below srv6 paket is 268 B, larger than the max of uint8_t type (i.e., 256).

"mac()/ipv6(nextheader=43)/ipv6srh(headerextlength=4,nextheader=41)\
		/ipv6(dst=2001:2:0:0:0:0:0:2)"

Junfeng Guo (2):
net/ice: fix variable type in pattern parsing for raw flow net/iavf: fix variable type in pattern parsing for raw flow

Quoted 7 lines
 drivers/net/iavf/iavf_hash.c      | 2 +-
 drivers/net/ice/ice_fdir_filter.c | 2 +-
 drivers/net/ice/ice_hash.c        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

--
2.25.1

#4 lore raw
In reply to Junfeng Guo
Quoted 7 lines · Junfeng Guo

In current pattern parsing function for protocol agnostic flow offloading (raw flow), some of the variables of packet length are defined as uint8_t, which are too small for some large-size packets, such as srv6 (Segment Routing over IPv6 dataplane) type. Change the type to uint16_t.

Quoted 8 lines

For example, the length of below srv6 paket is 268 B, larger than the max of uint8_t type (i.e., 256).

"mac()/ipv6(nextheader=43)/ipv6srh(headerextlength=4,nextheader=41)\
                /ipv6(dst=2001:2:0:0:0:0:0:2)"

Junfeng Guo (2):
net/ice: fix variable type in pattern parsing for raw flow net/iavf: fix variable type in pattern parsing for raw flow

In the commit title, it is better to describe a functional impact rather than repeat the implementation of a fix.

This makes it easier for people looking for a fix for their specific issue they are investigating.
And, on the contrary, it also makes it easier when looking for a regression on a specific feature.

Here, "fix variable type" gives no clue that it is linked to packet length or the protocol agnostic/raw pattern offloading feature.

So, I don't understand this part of the code, but I think a better title would be:
net/ice: fix protocol agnostic offloading with big packets

Does it sound ok to you?

Quoted 9 lines
 drivers/net/iavf/iavf_hash.c      | 2 +-
 drivers/net/ice/ice_fdir_filter.c | 2 +-
 drivers/net/ice/ice_hash.c        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

--
2.25.1

Signature · 1 line
David Marchand
#5 lore raw
Quoted 37 lines

-----Original Message-----
From: David Marchand <[email protected]>
Sent: Thursday, June 15, 2023 3:28 PM
To: Guo, Junfeng <[email protected]>
Cc: Zhang, Qi Z <[email protected]>; Yang, Qiming <[email protected]>; [email protected]; [email protected]; Xu, Ting <[email protected]>
Subject: Re: [PATCH 0/2] fix variable type in pattern parsing for raw flow

Quoted 7 lines · Junfeng Guo

In current pattern parsing function for protocol agnostic flow offloading (raw flow), some of the variables of packet length are defined as uint8_t, which are too small for some large-size packets, such as srv6 (Segment Routing over IPv6 dataplane) type. Change the type to uint16_t.

Quoted 8 lines

For example, the length of below srv6 paket is 268 B, larger than the max of uint8_t type (i.e., 256).

"mac()/ipv6(nextheader=43)/ipv6srh(headerextlength=4,nextheader=41)\
                /ipv6(dst=2001:2:0:0:0:0:0:2)"

Junfeng Guo (2):
net/ice: fix variable type in pattern parsing for raw flow net/iavf: fix variable type in pattern parsing for raw flow

In the commit title, it is better to describe a functional impact rather than repeat the implementation of a fix.

This makes it easier for people looking for a fix for their specific issue they are investigating.
And, on the contrary, it also makes it easier when looking for a regression on a specific feature.

Quoted 8 lines

Here, "fix variable type" gives no clue that it is linked to packet length or the protocol agnostic/raw pattern offloading feature.

So, I don't understand this part of the code, but I think a better title would be:
net/ice: fix protocol agnostic offloading with big packets

Does it sound ok to you?

+1
Junfeng, could you comment, if no concern, I will merge patch with the suggested title.

Quoted 15 lines
Quoted 11 lines


 drivers/net/iavf/iavf_hash.c      | 2 +-
 drivers/net/ice/ice_fdir_filter.c | 2 +-
 drivers/net/ice/ice_hash.c        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

--
2.25.1

--
David Marchand

#6 lore raw
Quoted 58 lines

-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: Friday, June 16, 2023 13:49
To: David Marchand <[email protected]>; Guo, Junfeng <[email protected]>
Cc: Yang, Qiming <[email protected]>; [email protected]; [email protected]; Xu, Ting <[email protected]>
Subject: RE: [PATCH 0/2] fix variable type in pattern parsing for raw flow

Quoted 9 lines

-----Original Message-----
From: David Marchand <[email protected]>
Sent: Thursday, June 15, 2023 3:28 PM
To: Guo, Junfeng <[email protected]>
Cc: Zhang, Qi Z <[email protected]>; Yang, Qiming <[email protected]>; [email protected]; [email protected]; Xu, Ting <[email protected]>
Subject: Re: [PATCH 0/2] fix variable type in pattern parsing for raw flow

Quoted 12 lines
Quoted 10 lines · Junfeng Guo

In current pattern parsing function for protocol agnostic flow offloading (raw flow), some of the variables of packet length are defined as uint8_t, which are too small for some large-size packets, such as srv6 (Segment Routing over IPv6 dataplane) type. Change the type to uint16_t.

For example, the length of below srv6 paket is 268 B, larger than the max of uint8_t type (i.e., 256).

"mac()/ipv6(nextheader=43)/ipv6srh(headerextlength=4,nextheader=41)\

Quoted 7 lines
Quoted 5 lines
                /ipv6(dst=2001:2:0:0:0:0:0:2)"

Junfeng Guo (2):
net/ice: fix variable type in pattern parsing for raw flow net/iavf: fix variable type in pattern parsing for raw flow

In the commit title, it is better to describe a functional impact rather

than

Quoted 3 lines

repeat the implementation of a fix.

This makes it easier for people looking for a fix for their specific issue

they

Quoted 2 lines

are investigating.
And, on the contrary, it also makes it easier when looking for a

regression on

Quoted 3 lines

a specific feature.

Here, "fix variable type" gives no clue that it is linked to packet length or

the

Quoted 3 lines

protocol agnostic/raw pattern offloading feature.

So, I don't understand this part of the code, but I think a better title

would

Quoted 8 lines
Quoted 4 lines

be:
net/ice: fix protocol agnostic offloading with big packets

Does it sound ok to you?

+1
Junfeng, could you comment, if no concern, I will merge patch with the suggested title.

Sure, that sounds good to me!
Please go ahead with the suggested title.

Thanks David for the comment!
Yes, it's more reasonable to describe patch with more specific and valid words.

Quoted 16 lines
Quoted 16 lines
Quoted 4 lines
Quoted 8 lines
 drivers/net/iavf/iavf_hash.c      | 2 +-
 drivers/net/ice/ice_fdir_filter.c | 2 +-
 drivers/net/ice/ice_hash.c        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

--
2.25.1

--
David Marchand

Acked-by Applied
#7 lore raw
Quoted 84 lines

-----Original Message-----
From: Guo, Junfeng <[email protected]>
Sent: Friday, June 16, 2023 2:22 PM
To: Zhang, Qi Z <[email protected]>; David Marchand <[email protected]>
Cc: Yang, Qiming <[email protected]>; [email protected]; [email protected]; Xu, Ting <[email protected]>
Subject: RE: [PATCH 0/2] fix variable type in pattern parsing for raw flow

Quoted 62 lines

-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: Friday, June 16, 2023 13:49
To: David Marchand <[email protected]>; Guo, Junfeng <[email protected]>
Cc: Yang, Qiming <[email protected]>; [email protected]; [email protected]; Xu, Ting <[email protected]>
Subject: RE: [PATCH 0/2] fix variable type in pattern parsing for raw flow

Quoted 10 lines

-----Original Message-----
From: David Marchand <[email protected]>
Sent: Thursday, June 15, 2023 3:28 PM
To: Guo, Junfeng <[email protected]>
Cc: Zhang, Qi Z <[email protected]>; Yang, Qiming <[email protected]>; [email protected]; [email protected]; Xu, Ting <[email protected]>
Subject: Re: [PATCH 0/2] fix variable type in pattern parsing for raw flow

Quoted 12 lines
Quoted 10 lines · Junfeng Guo

In current pattern parsing function for protocol agnostic flow offloading (raw flow), some of the variables of packet length are defined as uint8_t, which are too small for some large-size packets, such as srv6 (Segment Routing over IPv6 dataplane) type. Change the type to uint16_t.

For example, the length of below srv6 paket is 268 B, larger than the max of uint8_t type (i.e., 256).

"mac()/ipv6(nextheader=43)/ipv6srh(headerextlength=4,nextheader=41)\

Quoted 8 lines
Quoted 5 lines
                /ipv6(dst=2001:2:0:0:0:0:0:2)"

Junfeng Guo (2):
net/ice: fix variable type in pattern parsing for raw flow net/iavf: fix variable type in pattern parsing for raw flow

In the commit title, it is better to describe a functional impact rather

than

Quoted 4 lines

repeat the implementation of a fix.

This makes it easier for people looking for a fix for their specific issue

they

Quoted 2 lines

are investigating.
And, on the contrary, it also makes it easier when looking for a

regression on

Quoted 4 lines

a specific feature.

Here, "fix variable type" gives no clue that it is linked to packet length or

the

Quoted 4 lines

protocol agnostic/raw pattern offloading feature.

So, I don't understand this part of the code, but I think a better title

would

Quoted 8 lines
Quoted 4 lines

be:
net/ice: fix protocol agnostic offloading with big packets

Does it sound ok to you?

+1
Junfeng, could you comment, if no concern, I will merge patch with the suggested title.

Quoted 6 lines

Sure, that sounds good to me!
Please go ahead with the suggested title.

Thanks David for the comment!
Yes, it's more reasonable to describe patch with more specific and valid words.

Applied to dpdk-next-net-intel.

Thanks
Qi

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 5 lines
Quoted 8 lines
 drivers/net/iavf/iavf_hash.c      | 2 +-
 drivers/net/ice/ice_fdir_filter.c | 2 +-
 drivers/net/ice/ice_hash.c        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

--
2.25.1

--
David Marchand