From: Keegan Freyhof <[email protected]>

The v3 vector mode would default to all cksums being good rather
than cksum unknown in the case that flags2 cscalc section was 0.
Added an entry in the lookup table for this case and corrected
the logic.

Signed-off-by: Keegan Freyhof <[email protected]>
Signed-off-by: Mohammad Shuab Siddique <[email protected]>
---
 drivers/net/bnxt/bnxt_rxtx_vec_avx2.c   | 14 ++++++++------
 drivers/net/bnxt/bnxt_rxtx_vec_common.h |  3 ++-
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_avx2.c 
b/drivers/net/bnxt/bnxt_rxtx_vec_avx2.c
index 38aca98cb1..b5fb9d35c4 100644
--- a/drivers/net/bnxt/bnxt_rxtx_vec_avx2.c
+++ b/drivers/net/bnxt/bnxt_rxtx_vec_avx2.c
@@ -1111,14 +1111,16 @@ recv_burst_vec_avx2_v3(void *rx_queue, struct rte_mbuf 
**rx_pkts, uint16_t nb_pk
                 * RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR | 
RX_PKT_CMPL_ERRORS_L4_CS_ERROR |
                 * RX_PKT_CMPL_ERRORS_IP_CS_ERROR
                 */
-               errors_csum_idx = _mm256_srli_epi32(_mm256_and_si256(errors_v2,
-                                                   _mm256_slli_epi32(mask_fs, 
4)), 4);
+               errors_csum_idx = _mm256_and_si256(_mm256_srli_epi32(errors_v2, 
4),
+                                                  mask_fs);
                meta_format = _mm256_cmpeq_epi32(_mm256_and_si256(cs_calc,
-                                                       
_mm256_slli_epi32(mask_fs, 4)),
-                                                       _mm256_setzero_si256());
+                                                _mm256_slli_epi32(mask_fs, 4)),
+                                                _mm256_setzero_si256());
                cs_valid = _mm256_cmpeq_epi32(_mm256_and_si256(cs_calc, 
mask_fs),
-                                                       _mm256_setzero_si256());
-               errors_csum_idx = _mm256_andnot_si256(cs_valid, 
errors_csum_idx);
+                                             _mm256_setzero_si256());
+               errors_csum_idx = 
_mm256_add_epi32(_mm256_andnot_si256(cs_valid, mask_1s),
+                                                  _mm256_andnot_si256(cs_valid,
+                                                                      
errors_csum_idx));
 
                /*
                 * Load ol_flags for eight packets using gather. Gather
diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_common.h 
b/drivers/net/bnxt/bnxt_rxtx_vec_common.h
index d8659d1001..c75a8bd09f 100644
--- a/drivers/net/bnxt/bnxt_rxtx_vec_common.h
+++ b/drivers/net/bnxt/bnxt_rxtx_vec_common.h
@@ -178,7 +178,8 @@ bnxt_tx_cmp_vec(struct bnxt_tx_queue *txq, uint32_t nr_pkts)
        txr->tx_raw_cons = raw_cons;
 }
 
-static const uint32_t errors_to_olflags_v3[16] = {
+static const uint32_t errors_to_olflags_v3[17] = {
+       RTE_MBUF_F_RX_IP_CKSUM_UNKNOWN,
        RTE_MBUF_F_RX_OUTER_L4_CKSUM_GOOD | RTE_MBUF_F_RX_L4_CKSUM_GOOD |
        RTE_MBUF_F_RX_IP_CKSUM_GOOD,
        RTE_MBUF_F_RX_OUTER_L4_CKSUM_GOOD | RTE_MBUF_F_RX_L4_CKSUM_GOOD |
-- 
2.47.3

Reply via email to