net/iavf: fix mbuf VLAN offload flags in the L2TAG2 path with AVX2

Message ID 20221208121916.155132-1-mschmidt@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series net/iavf: fix mbuf VLAN offload flags in the L2TAG2 path with AVX2 |

Checks

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

Commit Message

Michal Schmidt Dec. 8, 2022, 12:19 p.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.

Fixes: 3a1aca384d3a ("net/iavf: fix VLAN tag extraction handling")

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

Comments

Maxime Coquelin Dec. 13, 2022, 8:17 a.m. UTC | #1
Hi Michal,

On 12/8/22 13:19, Michal Schmidt wrote:
> 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.
> 
> Fixes: 3a1aca384d3a ("net/iavf: fix VLAN tag extraction handling")

Adding stable ML since bug was introduced in v21.05:
Cc: stable@dpdk.org

Maybe no need to resubmit and maintainer can add it when applying.

> 
> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
> ---
>   drivers/net/iavf/iavf_rxtx_vec_avx2.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/iavf/iavf_rxtx_vec_avx2.c b/drivers/net/iavf/iavf_rxtx_vec_avx2.c
> index 862f6eb0c0..b4ebac9d34 100644
> --- a/drivers/net/iavf/iavf_rxtx_vec_avx2.c
> +++ b/drivers/net/iavf/iavf_rxtx_vec_avx2.c
> @@ -1074,7 +1074,10 @@ _iavf_recv_raw_pkts_vec_avx2_flex_rxd(struct iavf_rx_queue *rxq,
>   					_mm256_set_epi8(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,

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime
  
Wenzhuo Lu Dec. 14, 2022, 2:06 a.m. UTC | #2
> -----Original Message-----
> From: Michal Schmidt <mschmidt@redhat.com>
> Sent: Thursday, December 8, 2022 8:19 PM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Wang, Haiyue
> <haiyue.wang@intel.com>
> Subject: [PATCH] net/iavf: fix mbuf VLAN offload flags in the L2TAG2 path with
> AVX2
> 
> 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.
> 
> Fixes: 3a1aca384d3a ("net/iavf: fix VLAN tag extraction handling")
> 
> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
  
Qi Zhang Feb. 14, 2023, 1:48 a.m. UTC | #3
> -----Original Message-----
> From: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Sent: Wednesday, December 14, 2022 10:06 AM
> To: mschmidt <mschmidt@redhat.com>; dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Wang, Haiyue
> <haiyue.wang@intel.com>
> Subject: RE: [PATCH] net/iavf: fix mbuf VLAN offload flags in the L2TAG2
> path with AVX2
> 
> 
> 
> > -----Original Message-----
> > From: Michal Schmidt <mschmidt@redhat.com>
> > Sent: Thursday, December 8, 2022 8:19 PM
> > To: dev@dpdk.org
> > Cc: Richardson, Bruce <bruce.richardson@intel.com>; Wu, Jingjing
> > <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Wang,
> > Haiyue <haiyue.wang@intel.com>
> > Subject: [PATCH] net/iavf: fix mbuf VLAN offload flags in the L2TAG2
> > path with
> > AVX2
> >
> > 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.
> >
> > Fixes: 3a1aca384d3a ("net/iavf: fix VLAN tag extraction handling")
> >
> > Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
> Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
  

Patch

diff --git a/drivers/net/iavf/iavf_rxtx_vec_avx2.c b/drivers/net/iavf/iavf_rxtx_vec_avx2.c
index 862f6eb0c0..b4ebac9d34 100644
--- a/drivers/net/iavf/iavf_rxtx_vec_avx2.c
+++ b/drivers/net/iavf/iavf_rxtx_vec_avx2.c
@@ -1074,7 +1074,10 @@  _iavf_recv_raw_pkts_vec_avx2_flex_rxd(struct iavf_rx_queue *rxq,
 					_mm256_set_epi8(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,