Skip to contentSkip to conversation

net/i40e: fix outer checksum flags

PATCH New Mingjin Ye 1 participant 1 message Oct 21, 2022 Network drivers

lore
Share & tools
lore

Mingjin Ye

author
#0 lore raw

PATCH 1/1 net/i40e: fix outer checksum flags

When receiving tunnel packets, the testpmd terminal output log shows 'ol_flags' value always as 'RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN', but what we expected should be 'RTE_MBUF_F_RX_OUTER_L4_CKSUM_GOOD' or 'RTE_MBUF_F_RX_OUTER_L4_CKSUM_BAD'.

Adding 'RTE_MBUF_F_RX_OUTER_L4_CKSUM_GOOD' and 'RTE_MBUF_F_RX_OUTER_L4_CKSUM_BAD' flags for normal path, which are also added to 'l3_l4_flags_shuf' for AVX2 and AVX512 vector path and 'cksum_flags' for SSE vector path to ensure the 'ol_flags' can match correct flags.

Fixes 4861cde46116 ("i40e: new poll mode driver")
Fixes daa02b5cddbb ("mbuf: add namespace to offload flags")
Fixes e6a6a138919f ("net/i40e: add AVX512 vector path")
Fixes dafadd73762e ("net/i40e: add AVX2 Rx function")
Fixes 9966a00a0688 ("net/i40e: enable bad checksum flags in vector Rx")
Fixes f3a85f4ce04d ("net/i40e: fix checksum flag in x86 vector Rx")
Fixes f4356d7ca168 ("net/i40e: eliminate mbuf write on rearm")
---
 drivers/net/i40e/i40e_rxtx.c            |   6 +-
 drivers/net/i40e/i40e_rxtx_vec_avx2.c   | 119 +++++++++++++++++-------
 drivers/net/i40e/i40e_rxtx_vec_avx512.c | 113 ++++++++++++++++------
 drivers/net/i40e/i40e_rxtx_vec_sse.c    |  73 ++++++++++-----
 4 files changed, 228 insertions(+), 83 deletions(-)
drivers/net/i40e/i40e_rxtx.c +5 -1
index 788ffb51c2..e8903007f0 100644
@@ -169,7 +169,9 @@ i40e_rxd_error_to_pkt_flags(uint64_t qword)
 
 #define I40E_RX_ERR_BITS 0x3f
 	if (likely((error_bits & I40E_RX_ERR_BITS) == 0)) {
-		flags |= (RTE_MBUF_F_RX_IP_CKSUM_GOOD | RTE_MBUF_F_RX_L4_CKSUM_GOOD);
+		flags |= (RTE_MBUF_F_RX_IP_CKSUM_GOOD |
+			RTE_MBUF_F_RX_L4_CKSUM_GOOD |
+			RTE_MBUF_F_RX_OUTER_L4_CKSUM_GOOD);
 		return flags;
 	}
 
@@ -185,6 +187,8 @@ i40e_rxd_error_to_pkt_flags(uint64_t qword)
 
 	if (unlikely(error_bits & (1 << I40E_RX_DESC_ERROR_EIPE_SHIFT)))
 		flags |= RTE_MBUF_F_RX_OUTER_IP_CKSUM_BAD;
+	else
+		flags |= RTE_MBUF_F_RX_OUTER_L4_CKSUM_GOOD;
 
 	return flags;
 }
drivers/net/i40e/i40e_rxtx_vec_avx2.c +87 -32

139 lines not on this page · raw message

drivers/net/i40e/i40e_rxtx_vec_avx512.c +85 -28

133 lines not on this page · raw message

drivers/net/i40e/i40e_rxtx_vec_sse.c +51 -22

103 lines not on this page · raw message

Signature · 1 line
2.34.1