Skip to contentSkip to conversation

net/iavf: fix VLAN insertion in vector path

PATCH Superseded Wenzhuo Lu 2 participants 7 messages Jun 21, 2023 – Jul 3, 2023 Network drivers

lore
Share & tools
lore

Wenzhuo Lu

author
#0 lore raw

PATCH 1/1 net/iavf: fix VLAN insertion in vector path

As the VLAN insertion is partially supported in vector path, the behavior is different in scalar and vector path. For a VLAN packet, if using scalar path, the new VLAN tag will be inserted after the original VLAN tag. If using vector path, the new VLAN tag is inserted before the original VLAN tag. To avoid any misleading, disable VLAN insertion in vector path.

Fixes 059f18ae2aec ("net/iavf: add offload path for Tx AVX512")
---
 drivers/net/iavf/iavf_rxtx.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/iavf/iavf_rxtx.h +2 -2
index 547b68f..2459c15 100644
@@ -27,13 +27,13 @@
 #define IAVF_VPMD_TX_MAX_FREE_BUF 64
 
 #define IAVF_TX_NO_VECTOR_FLAGS (				 \
+		RTE_ETH_TX_OFFLOAD_VLAN_INSERT |		 \
+		RTE_ETH_TX_OFFLOAD_QINQ_INSERT |		 \
 		RTE_ETH_TX_OFFLOAD_MULTI_SEGS |		 \
 		RTE_ETH_TX_OFFLOAD_TCP_TSO |		 \
 		RTE_ETH_TX_OFFLOAD_SECURITY)
 
 #define IAVF_TX_VECTOR_OFFLOAD (				 \
-		RTE_ETH_TX_OFFLOAD_VLAN_INSERT |		 \
-		RTE_ETH_TX_OFFLOAD_QINQ_INSERT |		 \
 		RTE_ETH_TX_OFFLOAD_IPV4_CKSUM |		 \
 		RTE_ETH_TX_OFFLOAD_SCTP_CKSUM |		 \
 		RTE_ETH_TX_OFFLOAD_UDP_CKSUM |		 \
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 45 lines

-----Original Message-----
From: Wenzhuo Lu <[email protected]>
Sent: Wednesday, June 21, 2023 9:19 AM
To: [email protected]
Cc: Lu, Wenzhuo <[email protected]>; [email protected]
Subject: [PATCH] net/iavf: fix VLAN insertion in vector path

As the VLAN insertion is partially supported in vector path, the behavior is different in scalar and vector path.
For a VLAN packet, if using scalar path, the new VLAN tag will be inserted after the original VLAN tag. If using vector path, the new VLAN tag is inserted before the original VLAN tag.
To avoid any misleading, disable VLAN insertion in vector path.

Fixes 059f18ae2aec ("net/iavf: add offload path for Tx AVX512")
---
 drivers/net/iavf/iavf_rxtx.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/iavf/iavf_rxtx.h index renamed from drivers/net/iavf/iavf_rxtx.h +0 -0

547b68f..2459c15 100644

drivers/net/iavf/iavf_rxtx.h +2 -3
@@ -27,13 +27,13 @@
 #define IAVF_VPMD_TX_MAX_FREE_BUF 64
 
 #define IAVF_TX_NO_VECTOR_FLAGS (				 \
+		RTE_ETH_TX_OFFLOAD_VLAN_INSERT |		 \
+		RTE_ETH_TX_OFFLOAD_QINQ_INSERT |		 \
 		RTE_ETH_TX_OFFLOAD_MULTI_SEGS |		 \
 		RTE_ETH_TX_OFFLOAD_TCP_TSO |		 \
 		RTE_ETH_TX_OFFLOAD_SECURITY)
 
 #define IAVF_TX_VECTOR_OFFLOAD (				 \
-		RTE_ETH_TX_OFFLOAD_VLAN_INSERT |		 \
-		RTE_ETH_TX_OFFLOAD_QINQ_INSERT |		 \
 		RTE_ETH_TX_OFFLOAD_IPV4_CKSUM |		 \
 		RTE_ETH_TX_OFFLOAD_SCTP_CKSUM |		 \
 		RTE_ETH_TX_OFFLOAD_UDP_CKSUM |		 \
--
Quoted 1 line

1.8.3.1

We may need to update the iavf.ini to claim VLAN offload is partially supported to align with this implementation.

VLAN offload = P

#2 lore raw

Hi Qi,

Quoted 11 lines

-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: Wednesday, June 28, 2023 2:57 PM
To: Lu, Wenzhuo <[email protected]>; [email protected]
Cc: Lu, Wenzhuo <[email protected]>; [email protected]
Subject: RE: [PATCH] net/iavf: fix VLAN insertion in vector path

We may need to update the iavf.ini to claim VLAN offload is partially supported to align with this implementation.

VLAN offload = P

I mean the vector path cannot fully support this VLAN feature. With this patch, we use scalar path instead of vector path if VLAN feature is needed. It can be taken as fully supported.

#3 lore raw
Quoted 18 lines

-----Original Message-----
From: Lu, Wenzhuo <[email protected]>
Sent: Wednesday, June 28, 2023 3:13 PM
To: Zhang, Qi Z <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [PATCH] net/iavf: fix VLAN insertion in vector path

Hi Qi,

Quoted 7 lines

-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: Wednesday, June 28, 2023 2:57 PM
To: Lu, Wenzhuo <[email protected]>; [email protected]
Cc: Lu, Wenzhuo <[email protected]>; [email protected]
Subject: RE: [PATCH] net/iavf: fix VLAN insertion in vector path

Quoted 7 lines
Quoted 4 lines

We may need to update the iavf.ini to claim VLAN offload is partially supported to align with this implementation.

VLAN offload = P

I mean the vector path cannot fully support this VLAN feature. With this patch, we use scalar path instead of vector path if VLAN feature is needed. It can be taken as fully supported.

Ok, the "P" flag has been explained as below in iavf.ini.

A feature with "P" indicates only be supported when non-vector path is selected.

And now we just disabled VLAN insertion in vector path, right?

#4 lore raw
Quoted 35 lines

-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: Wednesday, June 28, 2023 4:59 PM
To: Lu, Wenzhuo <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [PATCH] net/iavf: fix VLAN insertion in vector path

Quoted 16 lines

-----Original Message-----
From: Lu, Wenzhuo <[email protected]>
Sent: Wednesday, June 28, 2023 3:13 PM
To: Zhang, Qi Z <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [PATCH] net/iavf: fix VLAN insertion in vector path

Hi Qi,

Quoted 7 lines

-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: Wednesday, June 28, 2023 2:57 PM
To: Lu, Wenzhuo <[email protected]>; [email protected]
Cc: Lu, Wenzhuo <[email protected]>; [email protected]
Subject: RE: [PATCH] net/iavf: fix VLAN insertion in vector path

Quoted 7 lines
Quoted 4 lines

We may need to update the iavf.ini to claim VLAN offload is partially supported to align with this implementation.

VLAN offload = P

I mean the vector path cannot fully support this VLAN feature. With this patch, we use scalar path instead of vector path if VLAN feature is needed. It can be taken as fully supported.

Quoted 6 lines

Ok, the "P" flag has been explained as below in iavf.ini.

A feature with "P" indicates only be supported when non-vector path is selected.

And now we just disabled VLAN insertion in vector path, right?

Yes. We just disable the vector path to make behavior not changed.

author
#5 lore raw

PATCH v2 1/1 net/iavf: fix VLAN insertion in vector path

In reply to Wenzhuo Lu

As the VLAN insertion is partially supported in vector path, the behavior is different in scalar and vector path. For a VLAN packet, if using scalar path, the new VLAN tag will be inserted after the original VLAN tag. If using vector path, the new VLAN tag is inserted before the original VLAN tag. To avoid any misleading, disable VLAN insertion in vector path.

Fixes 059f18ae2aec ("net/iavf: add offload path for Tx AVX512")

---

v2:
- Updated iavf.ini.

 doc/guides/nics/features/iavf.ini | 2 +-
 drivers/net/iavf/iavf_rxtx.h      | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
doc/guides/nics/features/iavf.ini +1 -1
index fbb5b7d..55a0216 100644
@@ -24,7 +24,7 @@ RSS key update       = Y
 RSS reta update      = Y
 VLAN filter          = Y
 CRC offload          = Y
-VLAN offload         = Y
+VLAN offload         = P
 L3 checksum offload  = Y
 L4 checksum offload  = Y
 Timestamp offload    = P
drivers/net/iavf/iavf_rxtx.h +2 -2
index 2bf2e32..8d4a772 100644
@@ -27,13 +27,13 @@
 #define IAVF_VPMD_TX_MAX_FREE_BUF 64
 
 #define IAVF_TX_NO_VECTOR_FLAGS (				 \
+		RTE_ETH_TX_OFFLOAD_VLAN_INSERT |		 \
+		RTE_ETH_TX_OFFLOAD_QINQ_INSERT |		 \
 		RTE_ETH_TX_OFFLOAD_MULTI_SEGS |		 \
 		RTE_ETH_TX_OFFLOAD_TCP_TSO |		 \
 		RTE_ETH_TX_OFFLOAD_SECURITY)
 
 #define IAVF_TX_VECTOR_OFFLOAD (				 \
-		RTE_ETH_TX_OFFLOAD_VLAN_INSERT |		 \
-		RTE_ETH_TX_OFFLOAD_QINQ_INSERT |		 \
 		RTE_ETH_TX_OFFLOAD_IPV4_CKSUM |		 \
 		RTE_ETH_TX_OFFLOAD_SCTP_CKSUM |		 \
 		RTE_ETH_TX_OFFLOAD_UDP_CKSUM |		 \
Signature · 1 line
1.8.3.1
Acked-by on v2 1/1 Applied
#6 lore raw
Quoted 16 lines

-----Original Message-----
From: Wenzhuo Lu <[email protected]>
Sent: Monday, July 3, 2023 10:22 AM
To: [email protected]
Cc: Lu, Wenzhuo <[email protected]>; [email protected]
Subject: [PATCH v2] net/iavf: fix VLAN insertion in vector path

As the VLAN insertion is partially supported in vector path, the behavior is different in scalar and vector path.
For a VLAN packet, if using scalar path, the new VLAN tag will be inserted after the original VLAN tag. If using vector path, the new VLAN tag is inserted before the original VLAN tag.
To avoid any misleading, disable VLAN insertion in vector path.

Quoted 4 lines
Fixes 059f18ae2aec ("net/iavf: add offload path for Tx AVX512")

Applied to dpdk-next-net-intel.

Thanks
Qi