net/iavf: fix VLAN insertion in vector path

Message ID 1687310355-130696-1-git-send-email-wenzhuo.lu@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series net/iavf: fix VLAN insertion in vector path |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-aarch-unit-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS

Commit Message

Wenzhuo Lu June 21, 2023, 1:19 a.m. UTC
  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")
Cc: stable@dpdk.org

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 drivers/net/iavf/iavf_rxtx.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Qi Zhang June 28, 2023, 6:57 a.m. UTC | #1
> -----Original Message-----
> From: Wenzhuo Lu <wenzhuo.lu@intel.com>
> Sent: Wednesday, June 21, 2023 9:19 AM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; stable@dpdk.org
> 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")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> ---
>  drivers/net/iavf/iavf_rxtx.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/iavf/iavf_rxtx.h b/drivers/net/iavf/iavf_rxtx.h index
> 547b68f..2459c15 100644
> --- a/drivers/net/iavf/iavf_rxtx.h
> +++ b/drivers/net/iavf/iavf_rxtx.h
> @@ -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 |		 \
> --
> 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
  
Wenzhuo Lu June 28, 2023, 7:13 a.m. UTC | #2
Hi Qi,

> -----Original Message-----
> From: Zhang, Qi Z <qi.z.zhang@intel.com>
> Sent: Wednesday, June 28, 2023 2:57 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; stable@dpdk.org
> 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.
  
Qi Zhang June 28, 2023, 8:59 a.m. UTC | #3
> -----Original Message-----
> From: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Sent: Wednesday, June 28, 2023 3:13 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; dev@dpdk.org
> Cc: stable@dpdk.org
> Subject: RE: [PATCH] net/iavf: fix VLAN insertion in vector path
> 
> Hi Qi,
> 
> > -----Original Message-----
> > From: Zhang, Qi Z <qi.z.zhang@intel.com>
> > Sent: Wednesday, June 28, 2023 2:57 PM
> > To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; dev@dpdk.org
> > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; stable@dpdk.org
> > 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.

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?
  
Wenzhuo Lu June 29, 2023, 12:16 a.m. UTC | #4
> -----Original Message-----
> From: Zhang, Qi Z <qi.z.zhang@intel.com>
> Sent: Wednesday, June 28, 2023 4:59 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; dev@dpdk.org
> Cc: stable@dpdk.org
> Subject: RE: [PATCH] net/iavf: fix VLAN insertion in vector path
> 
> 
> 
> > -----Original Message-----
> > From: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> > Sent: Wednesday, June 28, 2023 3:13 PM
> > To: Zhang, Qi Z <qi.z.zhang@intel.com>; dev@dpdk.org
> > Cc: stable@dpdk.org
> > Subject: RE: [PATCH] net/iavf: fix VLAN insertion in vector path
> >
> > Hi Qi,
> >
> > > -----Original Message-----
> > > From: Zhang, Qi Z <qi.z.zhang@intel.com>
> > > Sent: Wednesday, June 28, 2023 2:57 PM
> > > To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; dev@dpdk.org
> > > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; stable@dpdk.org
> > > 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.
> 
> 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.
  

Patch

diff --git a/drivers/net/iavf/iavf_rxtx.h b/drivers/net/iavf/iavf_rxtx.h
index 547b68f..2459c15 100644
--- a/drivers/net/iavf/iavf_rxtx.h
+++ b/drivers/net/iavf/iavf_rxtx.h
@@ -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 |		 \