net/iavf: fix VLAN offload with AVX512

Message ID 20230327100750.448859-1-mschmidt@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series net/iavf: fix VLAN offload with AVX512 |

Checks

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

Commit Message

Michal Schmidt March 27, 2023, 10:07 a.m. UTC
  It has been observed that mbufs of some received VLAN packets had the
VLAN tag correctly set in vlan_tci, but ol_flags were missing the
VLAN-indicating flags.

_mm256_shuffle_epi8 operates as two independent 128-bit operations,
not as a single 256-bit operation. To have the RTE_MBUF_F_RX_VLAN* flags
reflected in the resulting vlan_flags for all 8 rx descriptors, the
input l2tag2_flags_shuf must contain the required pattern in both
128-bit halves.

This fix is for the AVX512 Rx path. The same bug in AVX2 was fixed
by commit eb24917428a1 ("net/iavf: fix VLAN offload with AVX2").

Fixes: 4b64ccb328c9 ("net/iavf: fix VLAN extraction in AVX512 path")
Cc: stable@dpdk.org

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
---
 drivers/net/iavf/iavf_rxtx_vec_avx512.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Comments

Wenzhuo Lu March 29, 2023, 1:05 a.m. UTC | #1
> -----Original Message-----
> From: Michal Schmidt <mschmidt@redhat.com>
> Sent: Monday, March 27, 2023 6:08 PM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>; Konstantin Ananyev
> <konstantin.v.ananyev@yandex.ru>; Wu, Jingjing <jingjing.wu@intel.com>;
> Xing, Beilei <beilei.xing@intel.com>; Rong, Leyi <leyi.rong@intel.com>; Lu,
> Wenzhuo <wenzhuo.lu@intel.com>; stable@dpdk.org
> Subject: [PATCH] net/iavf: fix VLAN offload with AVX512
> 
> It has been observed that mbufs of some received VLAN packets had the VLAN
> tag correctly set in vlan_tci, but ol_flags were missing the VLAN-indicating
> flags.
> 
> _mm256_shuffle_epi8 operates as two independent 128-bit operations, not as
> a single 256-bit operation. To have the RTE_MBUF_F_RX_VLAN* flags reflected
> in the resulting vlan_flags for all 8 rx descriptors, the input l2tag2_flags_shuf
> must contain the required pattern in both 128-bit halves.
> 
> This fix is for the AVX512 Rx path. The same bug in AVX2 was fixed by commit
> eb24917428a1 ("net/iavf: fix VLAN offload with AVX2").
> 
> Fixes: 4b64ccb328c9 ("net/iavf: fix VLAN extraction in AVX512 path")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
  
Qi Zhang April 3, 2023, 5:39 a.m. UTC | #2
> -----Original Message-----
> From: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Sent: Wednesday, March 29, 2023 9:06 AM
> To: mschmidt <mschmidt@redhat.com>; dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>; Konstantin Ananyev
> <konstantin.v.ananyev@yandex.ru>; Wu, Jingjing <jingjing.wu@intel.com>;
> Xing, Beilei <beilei.xing@intel.com>; Rong, Leyi <leyi.rong@intel.com>;
> stable@dpdk.org
> Subject: RE: [PATCH] net/iavf: fix VLAN offload with AVX512
> 
> 
> 
> > -----Original Message-----
> > From: Michal Schmidt <mschmidt@redhat.com>
> > Sent: Monday, March 27, 2023 6:08 PM
> > To: dev@dpdk.org
> > Cc: Richardson, Bruce <bruce.richardson@intel.com>; Konstantin Ananyev
> > <konstantin.v.ananyev@yandex.ru>; Wu, Jingjing
> > <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Rong,
> > Leyi <leyi.rong@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>;
> > stable@dpdk.org
> > Subject: [PATCH] net/iavf: fix VLAN offload with AVX512
> >
> > It has been observed that mbufs of some received VLAN packets had the
> > VLAN tag correctly set in vlan_tci, but ol_flags were missing the
> > VLAN-indicating flags.
> >
> > _mm256_shuffle_epi8 operates as two independent 128-bit operations,
> > not as a single 256-bit operation. To have the RTE_MBUF_F_RX_VLAN*
> > flags reflected in the resulting vlan_flags for all 8 rx descriptors,
> > the input l2tag2_flags_shuf must contain the required pattern in both 128-
> bit halves.
> >
> > This fix is for the AVX512 Rx path. The same bug in AVX2 was fixed by
> > commit
> > eb24917428a1 ("net/iavf: fix VLAN offload with AVX2").
> >
> > Fixes: 4b64ccb328c9 ("net/iavf: fix VLAN extraction in AVX512 path")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
> Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
  
Thomas Monjalon June 12, 2023, 6:02 p.m. UTC | #3
03/04/2023 07:39, Zhang, Qi Z:
> > > It has been observed that mbufs of some received VLAN packets had the
> > > VLAN tag correctly set in vlan_tci, but ol_flags were missing the
> > > VLAN-indicating flags.
> > >
> > > _mm256_shuffle_epi8 operates as two independent 128-bit operations,
> > > not as a single 256-bit operation. To have the RTE_MBUF_F_RX_VLAN*
> > > flags reflected in the resulting vlan_flags for all 8 rx descriptors,
> > > the input l2tag2_flags_shuf must contain the required pattern in both 128-
> > bit halves.
> > >
> > > This fix is for the AVX512 Rx path. The same bug in AVX2 was fixed by
> > > commit
> > > eb24917428a1 ("net/iavf: fix VLAN offload with AVX2").
> > >
> > > Fixes: 4b64ccb328c9 ("net/iavf: fix VLAN extraction in AVX512 path")
> > > Cc: stable@dpdk.org
> > >
> > > Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
> > Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> 
> Applied to dpdk-next-net-intel.

I don't find this patch in your tree.
Is it lost somewhere?
  
Qi Zhang June 13, 2023, 12:38 a.m. UTC | #4
> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Tuesday, June 13, 2023 2:02 AM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; mschmidt
> <mschmidt@redhat.com>; dev@dpdk.org; Richardson, Bruce
> <bruce.richardson@intel.com>; Konstantin Ananyev
> <konstantin.v.ananyev@yandex.ru>; Wu, Jingjing <jingjing.wu@intel.com>;
> Xing, Beilei <beilei.xing@intel.com>; Rong, Leyi <leyi.rong@intel.com>;
> stable@dpdk.org; Zhang, Helin <helin.zhang@intel.com>;
> david.marchand@redhat.com
> Subject: Re: [PATCH] net/iavf: fix VLAN offload with AVX512
> 
> 03/04/2023 07:39, Zhang, Qi Z:
> > > > It has been observed that mbufs of some received VLAN packets had
> > > > the VLAN tag correctly set in vlan_tci, but ol_flags were missing
> > > > the VLAN-indicating flags.
> > > >
> > > > _mm256_shuffle_epi8 operates as two independent 128-bit
> > > > operations, not as a single 256-bit operation. To have the
> > > > RTE_MBUF_F_RX_VLAN* flags reflected in the resulting vlan_flags
> > > > for all 8 rx descriptors, the input l2tag2_flags_shuf must contain
> > > > the required pattern in both 128-
> > > bit halves.
> > > >
> > > > This fix is for the AVX512 Rx path. The same bug in AVX2 was fixed
> > > > by commit
> > > > eb24917428a1 ("net/iavf: fix VLAN offload with AVX2").
> > > >
> > > > Fixes: 4b64ccb328c9 ("net/iavf: fix VLAN extraction in AVX512
> > > > path")
> > > > Cc: stable@dpdk.org
> > > >
> > > > Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
> > > Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> >
> > Applied to dpdk-next-net-intel.
> 
> I don't find this patch in your tree.
> Is it lost somewhere?

Sorry, it is merged now.
> 
>
  

Patch

diff --git a/drivers/net/iavf/iavf_rxtx_vec_avx512.c b/drivers/net/iavf/iavf_rxtx_vec_avx512.c
index 4fe9b972786a..bd2788121b5a 100644
--- a/drivers/net/iavf/iavf_rxtx_vec_avx512.c
+++ b/drivers/net/iavf/iavf_rxtx_vec_avx512.c
@@ -1214,7 +1214,10 @@  _iavf_recv_raw_pkts_vec_avx512_flex_rxd(struct iavf_rx_queue *rxq,
 							(0, 0, 0, 0,
 							 0, 0, 0, 0,
 							 0, 0, 0, 0,
-							 0, 0, 0, 0,
+							 0, 0,
+							 RTE_MBUF_F_RX_VLAN |
+							 RTE_MBUF_F_RX_VLAN_STRIPPED,
+							 0,
 							 /* end up 128-bits */
 							 0, 0, 0, 0,
 							 0, 0, 0, 0,