net/bnxt: fix missing barriers in completion handling
[dpdk.git] / drivers / net / bnxt / bnxt_rxr.c
index 0dee73a..aea7170 100644 (file)
@@ -297,7 +297,8 @@ static int bnxt_agg_bufs_valid(struct bnxt_cp_ring_info *cpr,
        raw_cp_cons = ADV_RAW_CMP(raw_cp_cons, agg_bufs);
        last_cp_cons = RING_CMP(cpr->cp_ring_struct, raw_cp_cons);
        agg_cmpl = (struct rx_pkt_cmpl *)&cpr->cp_desc_ring[last_cp_cons];
-       return CMP_VALID(agg_cmpl, raw_cp_cons, cpr->cp_ring_struct);
+       return bnxt_cpr_cmp_valid(agg_cmpl, raw_cp_cons,
+                                 cpr->cp_ring_struct->ring_size);
 }
 
 /* TPA consume agg buffer out of order, allocate connected data only */
@@ -892,7 +893,8 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
        cp_cons = RING_CMP(cpr->cp_ring_struct, tmp_raw_cons);
        rxcmp1 = (struct rx_pkt_cmpl_hi *)&cpr->cp_desc_ring[cp_cons];
 
-       if (!CMP_VALID(rxcmp1, tmp_raw_cons, cpr->cp_ring_struct))
+       if (!bnxt_cpr_cmp_valid(rxcmp1, tmp_raw_cons,
+                               cpr->cp_ring_struct->ring_size))
                return -EBUSY;
 
        if (cmp_type == RX_TPA_START_CMPL_TYPE_RX_TPA_START ||
@@ -1077,7 +1079,8 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
                cons = RING_CMP(cpr->cp_ring_struct, raw_cons);
                rxcmp = (struct rx_pkt_cmpl *)&cpr->cp_desc_ring[cons];
 
-               if (!CMP_VALID(rxcmp, raw_cons, cpr->cp_ring_struct))
+               if (!bnxt_cpr_cmp_valid(rxcmp, raw_cons,
+                                       cpr->cp_ring_struct->ring_size))
                        break;
                if (CMP_TYPE(rxcmp) == CMPL_BASE_TYPE_HWRM_DONE) {
                        PMD_DRV_LOG(ERR, "Rx flush done\n");