eal: remove sys/queue.h from public headers
[dpdk.git] / drivers / net / bnxt / bnxt_rxr.c
index 0dee73a..a40fa50 100644 (file)
@@ -272,7 +272,7 @@ static void bnxt_tpa_start(struct bnxt_rx_queue *rxq,
                mbuf->ol_flags |= PKT_RX_FDIR | PKT_RX_FDIR_ID;
        }
 
-       if (tpa_info->vlan_valid) {
+       if (tpa_info->vlan_valid && BNXT_RX_VLAN_STRIP_EN(rxq->bp)) {
                mbuf->vlan_tci = tpa_info->vlan;
                mbuf->ol_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;
        }
@@ -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 */
@@ -573,8 +574,10 @@ bnxt_init_ol_flags_tables(struct bnxt_rx_queue *rxq)
        for (i = 0; i < BNXT_OL_FLAGS_TBL_DIM; i++) {
                pt[i] = 0;
 
-               if (i & RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN)
-                       pt[i] |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;
+               if (BNXT_RX_VLAN_STRIP_EN(rxq->bp)) {
+                       if (i & RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN)
+                               pt[i] |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;
+               }
 
                if (i & (RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC << 3)) {
                        /* Tunnel case. */
@@ -892,7 +895,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 ||
@@ -960,6 +964,8 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
 
        mbuf->packet_type = bnxt_parse_pkt_type(rxcmp, rxcmp1);
 
+       bnxt_set_vlan(rxcmp1, mbuf);
+
        if (BNXT_TRUFLOW_EN(bp))
                mark_id = bnxt_ulp_set_mark_in_mbuf(rxq->bp, rxcmp1, mbuf,
                                                    &vfr_flag);
@@ -1077,7 +1083,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");
@@ -1376,6 +1383,9 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq)
        }
        PMD_DRV_LOG(DEBUG, "TPA alloc Done!\n");
 
+       /* Explicitly reset this driver internal tracker on a ring init */
+       rxr->rx_next_cons = 0;
+
        return 0;
 }