Skip to contentSkip to conversation

net/iavf: support FDIR L3 fields for IP fragment packets

PATCH Applied Wenjun Wu 3 participants 8 messages Aug 2, 2021 – Aug 29, 2021 Network drivers

lore
Share & tools
lore

Wenjun Wu

author
#0 lore raw

PATCH 1/1 net/iavf: support FDIR L3 fields for IP fragment packets

Add support of FDIR L3 fields for both IPv4 and IPv6 fragment packets.

---
 drivers/net/iavf/iavf_fdir.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/iavf/iavf_fdir.c +2 -1
index da3eec8b59..32b06044f2 100644
@@ -57,7 +57,7 @@
 	IAVF_INSET_IPV6_HOP_LIMIT)
 
 #define IAVF_FDIR_INSET_ETH_IPV6_FRAG_EXT (\
-	IAVF_INSET_IPV6_ID)
+	IAVF_FDIR_INSET_ETH_IPV6 | IAVF_INSET_IPV6_ID)
 
 #define IAVF_FDIR_INSET_ETH_IPV6_UDP (\
 	IAVF_INSET_IPV6_SRC | IAVF_INSET_IPV6_DST | \
@@ -664,6 +664,7 @@ iavf_fdir_add_fragment_hdr(struct virtchnl_proto_hdrs *hdrs, int layer)
 	/* adding dummy fragment header */
 	hdr1 = &hdrs->proto_hdr[layer];
 	VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, IPV4_FRAG);
+	hdr1->field_selector = 0;
 	hdrs->count = ++layer;
 }
 
Signature · 1 line
2.25.1
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 10 lines

-----Original Message-----
From: Wu, Wenjun1 <[email protected]>
Sent: Monday, August 2, 2021 3:58 PM
To: [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: Wu, Wenjun1 <[email protected]>
Subject: [PATCH] net/iavf: support FDIR L3 fields for IP fragment packets

Quoted 3 lines

Add support of FDIR L3 fields for both IPv4 and IPv6 fragment packets.

Applied to dpdk-next-net-intel.

Thanks
Qi

#2 lore raw
In reply to Wenjun Wu
Quoted 2 lines · Wenjun Wu

Add support of FDIR L3 fields for both IPv4 and IPv6 fragment packets.

Description mentions from both IPv4 & IPv6 but only IPv6 macro is updated, is this expected?

Is following correct:
Before this patch flow director rules were not applied to fragmented IPv4 & IPv6 packets (so packets were not able to sent to specific queues), but after this patch it does.
Is it the case that HW configuration was missing and hash is not calculated for these kind of packets etc.. If you have more details can you please provide? Also what was happening to these packets previously, sent to queue 0 by default?

Overall can please provide more description and check below question related to 'field_selector'?

Thanks,
ferruh

Quoted 19 lines
---
 drivers/net/iavf/iavf_fdir.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/iavf/iavf_fdir.c +1 -1
index da3eec8b59..32b06044f2 100644
@@ -57,7 +57,7 @@
 	IAVF_INSET_IPV6_HOP_LIMIT)
 
 #define IAVF_FDIR_INSET_ETH_IPV6_FRAG_EXT (\
-	IAVF_INSET_IPV6_ID)
+	IAVF_FDIR_INSET_ETH_IPV6 | IAVF_INSET_IPV6_ID)
 
 #define IAVF_FDIR_INSET_ETH_IPV6_UDP (\
 	IAVF_INSET_IPV6_SRC | IAVF_INSET_IPV6_DST | \

drivers/net/iavf/iavf_fdir.c iavf_fdir_add_fragment_hdr(struct virtchnl_proto_hdrs *hdrs, int layer) · line 667

Quoted 4 lines
drivers/net/iavf/iavf_fdir.c +1 -0
@@ -664,6 +664,7 @@ iavf_fdir_add_fragment_hdr(struct virtchnl_proto_hdrs *hdrs, int layer)
 	/* adding dummy fragment header */
 	hdr1 = &hdrs->proto_hdr[layer];
 	VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, IPV4_FRAG);
+	hdr1->field_selector = 0;

Is this change related to new support, or fixing something that was missing previously?

Quoted 4 lines
drivers/net/iavf/iavf_fdir.c +0 -0
 	hdrs->count = ++layer;
 }
 
#3 lore raw

Hi Ferruh,

I am sorry my description caused confusion. I will split this patch into two, rework the commit log and send it later.

Quoted 63 lines

-----Original Message-----
From: Yigit, Ferruh <[email protected]>
Sent: Friday, August 13, 2021 10:00 PM
To: Wu, Wenjun1 <[email protected]>; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] net/iavf: support FDIR L3 fields for IP fragment packets

Quoted 2 lines · Wenjun Wu

Add support of FDIR L3 fields for both IPv4 and IPv6 fragment packets.

Description mentions from both IPv4 & IPv6 but only IPv6 macro is updated, is this expected?

Is following correct:
Before this patch flow director rules were not applied to fragmented IPv4 & IPv6 packets (so packets were not able to sent to specific queues), but after this patch it does.
Is it the case that HW configuration was missing and hash is not calculated for these kind of packets etc.. If you have more details can you please provide? Also what was happening to these packets previously, sent to queue 0 by default?

Overall can please provide more description and check below question related to 'field_selector'?

Thanks,
ferruh

Quoted 10 lines
---
 drivers/net/iavf/iavf_fdir.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/net/iavf/iavf_fdir.c index da3eec8b59..32b06044f2 100644

drivers/net/iavf/iavf_fdir.c line 63

Quoted 8 lines
drivers/net/iavf/iavf_fdir.c +1 -1
@@ -57,7 +57,7 @@
 	IAVF_INSET_IPV6_HOP_LIMIT)
 
 #define IAVF_FDIR_INSET_ETH_IPV6_FRAG_EXT (\
-	IAVF_INSET_IPV6_ID)
+	IAVF_FDIR_INSET_ETH_IPV6 | IAVF_INSET_IPV6_ID)
 
 #define IAVF_FDIR_INSET_ETH_IPV6_UDP (\
 	IAVF_INSET_IPV6_SRC | IAVF_INSET_IPV6_DST | \ @@ -664,6 +664,7

@@

drivers/net/iavf/iavf_fdir.c iavf_fdir_add_fragment_hdr(struct virtchnl_proto_hdrs *hdrs, int layer) · line 667

Quoted 5 lines

iavf_fdir_add_fragment_hdr(struct virtchnl_proto_hdrs *hdrs, int layer)

drivers/net/iavf/iavf_fdir.c +1 -0
 	/* adding dummy fragment header */
 	hdr1 = &hdrs->proto_hdr[layer];
 	VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, IPV4_FRAG);
+	hdr1->field_selector = 0;

Is this change related to new support, or fixing something that was missing previously?

Quoted 4 lines

hdrs->count = ++layer;
}

author
#4 lore raw

PATCH v2 1/1 net/iavf: fix wrong FDIR L3 field set for IPv4 fragment packets

In reply to Wenjun Wu

Originally, the value of field_selector for IPV4_FRAG header hdr1 is the same as the previous header hdr2. For IPv4 packets, field_selector for hdr2 can be any value between 0 and 4, depending on the selected field. Actually, this value for IPV4_FRAG should be constant 0, which denotes the field packet ID.

This patch adds an assignment to hdr1->field_selector to make sure that it is always 0.

Fixes 3334513ef484 ("net/iavf: support flow director for IP fragment")

---
v2: reword commit log

---
 drivers/net/iavf/iavf_fdir.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/iavf/iavf_fdir.c +1 -0
index 2869a8b424..32b06044f2 100644
@@ -664,6 +664,7 @@ iavf_fdir_add_fragment_hdr(struct virtchnl_proto_hdrs *hdrs, int layer)
 	/* adding dummy fragment header */
 	hdr1 = &hdrs->proto_hdr[layer];
 	VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, IPV4_FRAG);
+	hdr1->field_selector = 0;
 	hdrs->count = ++layer;
 }
 
Signature · 1 line
2.25.1
Acked-by on v2 1/1 Applied
#5 lore raw

Re: [dpdk-dev] [PATCH v2] net/iavf: fix wrong FDIR L3 field set for IPv4 fragment packets

Quoted 16 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Wenjun Wu
Sent: Tuesday, August 17, 2021 2:50 PM
To: [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Cc: Wu, Wenjun1 <[email protected]>
Subject: [dpdk-dev] [PATCH v2] net/iavf: fix wrong FDIR L3 field set for IPv4 fragment packets

Originally, the value of field_selector for IPV4_FRAG header hdr1 is the same as the previous header hdr2. For IPv4 packets, field_selector for hdr2 can be any value between 0 and 4, depending on the selected field. Actually, this value for IPV4_FRAG should be constant 0, which denotes the field packet ID.

Quoted 6 lines

This patch adds an assignment to hdr1->field_selector to make sure that it is always 0.

Fixes 3334513ef484 ("net/iavf: support flow director for IP fragment")

Applied to dpdk-next-net-intel.

Thanks
Qi

author
#6 lore raw

PATCH v2 1/1 net/iavf: support FDIR L3 fields for IPv6 fragment packets

In reply to Wenjun Wu

This patch adds L3 fields FDIR support for IPv6 fragment packets.

---
v2: reword commit log

---
 drivers/net/iavf/iavf_fdir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/iavf/iavf_fdir.c +1 -1
index da3eec8b59..2869a8b424 100644
@@ -57,7 +57,7 @@
 	IAVF_INSET_IPV6_HOP_LIMIT)
 
 #define IAVF_FDIR_INSET_ETH_IPV6_FRAG_EXT (\
-	IAVF_INSET_IPV6_ID)
+	IAVF_FDIR_INSET_ETH_IPV6 | IAVF_INSET_IPV6_ID)
 
 #define IAVF_FDIR_INSET_ETH_IPV6_UDP (\
 	IAVF_INSET_IPV6_SRC | IAVF_INSET_IPV6_DST | \
Signature · 1 line
2.25.1
Acked-by on v2 1/1 Applied
#7 lore raw

Re: [dpdk-dev] [PATCH v2] net/iavf: support FDIR L3 fields for IPv6 fragment packets

Quoted 11 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Wenjun Wu
Sent: Tuesday, August 17, 2021 2:50 PM
To: [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Cc: Wu, Wenjun1 <[email protected]>
Subject: [dpdk-dev] [PATCH v2] net/iavf: support FDIR L3 fields for IPv6 fragment packets

Quoted 3 lines

This patch adds L3 fields FDIR support for IPv6 fragment packets.

Applied to dpdk-next-net-intel.

Thanks
Qi