net/iavf: fix mbuf VLAN offload flags in the L2TAG2 path with AVX2
PATCH 1/1 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.
--- drivers/net/iavf/iavf_rxtx_vec_avx2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/iavf/iavf_rxtx_vec_avx2.c +4 -1
@@ -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,
Signature · 1 line
2.37.2
Hi Michal,
Quoted 11 lines · Michal Schmidt
It has been observed that mbufs of some received VLAN packets had the VLAN tag correctly set in
vlan_tci, butol_flagswere missing the VLAN-indicating flags.
_mm256_shuffle_epi8operates 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 resultingvlan_flagsfor all 8 rx descriptors, the inputl2tag2_flags_shufmust 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: [email protected]
Maybe no need to resubmit and maintainer can add it when applying.
Quoted 12 lines
Signed-off-by Michal Schmidt <[email protected]>--- drivers/net/iavf/iavf_rxtx_vec_avx2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/net/iavf/iavf_rxtx_vec_avx2.c +0
-0@@ -1074,7 +1074,10 @@ _iavf_recv_raw_pkts_vec_avx2_flex_rxd(struct iavf_rx_queue *rxq, _mm256_set_epi8(0, 0, 0, 0,
drivers/net/iavf/iavf_rxtx_vec_avx2.c _iavf_recv_raw_pkts_vec_avx2_flex_rxd(struct iavf_rx_queue *rxq, · line 1083
Quoted 10 lines
drivers/net/iavf/iavf_rxtx_vec_avx2.c +4
-10 ,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,
Thanks,
Maxime
Quoted 16 lines
-----Original Message-----
From: Michal Schmidt <[email protected]>
Sent: Thursday, December 8, 2022 8:19 PM
To: [email protected]
Cc: Richardson, Bruce <[email protected]>; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Wang, Haiyue <[email protected]>
Subject: [PATCH] net/iavf: fix mbuf VLAN offload flags in the L2TAG2 path with AVX2It has been observed that mbufs of some received VLAN packets had the VLAN tag correctly set in
vlan_tci, butol_flagswere missing the VLAN-indicating flags.
Quoted 8 lines
_mm256_shuffle_epi8operates 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 resultingvlan_flagsfor all 8 rx descriptors, the inputl2tag2_flags_shufmust contain the required pattern in both 128-bit halves.Fixes 3a1aca384d3a ("net/iavf: fix VLAN tag extraction handling")Signed-off-by Michal Schmidt <[email protected]>
Zhang, Qi Z
AppliedQuoted 33 lines
-----Original Message-----
From: Lu, Wenzhuo <[email protected]>
Sent: Wednesday, December 14, 2022 10:06 AM
To: mschmidt <[email protected]>; [email protected]
Cc: Richardson, Bruce <[email protected]>; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Wang, Haiyue <[email protected]>
Subject: RE: [PATCH] net/iavf: fix mbuf VLAN offload flags in the L2TAG2 path with AVX2Quoted 11 lines
-----Original Message-----
From: Michal Schmidt <[email protected]>
Sent: Thursday, December 8, 2022 8:19 PM
To: [email protected]
Cc: Richardson, Bruce <[email protected]>; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Wang, Haiyue <[email protected]>
Subject: [PATCH] net/iavf: fix mbuf VLAN offload flags in the L2TAG2 path with
AVX2Quoted 8 lines
It has been observed that mbufs of some received VLAN packets had the VLAN tag correctly set in
vlan_tci, butol_flagswere missing the VLAN-indicating flags.
_mm256_shuffle_epi8operates 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 resultingvlan_flagsfor all 8 rx descriptors, the inputl2tag2_flags_shufmust contain the required pattern in both 128-
Quoted 6 lines
bit halves.
Quoted 4 lines
Fixes 3a1aca384d3a ("net/iavf: fix VLAN tag extraction handling")Signed-off-by Michal Schmidt <[email protected]>Acked-by Wenzhuo Lu <[email protected]>
Applied to dpdk-next-net-intel.
Thanks
Qi