struct rte_mbuf *mbuf)
{
uint32_t cfa_code = 0;
- uint8_t meta_fmt = 0;
- uint16_t flags2 = 0;
- uint32_t meta = 0;
+
+ if (unlikely(bp->mark_table == NULL))
+ return;
cfa_code = rte_le_to_cpu_16(rxcmp1->cfa_code);
if (!cfa_code)
if (cfa_code && !bp->mark_table[cfa_code].valid)
return;
- flags2 = rte_le_to_cpu_16(rxcmp1->flags2);
- meta = rte_le_to_cpu_32(rxcmp1->metadata);
- if (meta) {
- meta >>= BNXT_RX_META_CFA_CODE_SHIFT;
-
- /* The flags field holds extra bits of info from [6:4]
- * which indicate if the flow is in TCAM or EM or EEM
- */
- meta_fmt = (flags2 & BNXT_CFA_META_FMT_MASK) >>
- BNXT_CFA_META_FMT_SHFT;
-
- /* meta_fmt == 4 => 'b100 => 'b10x => EM.
- * meta_fmt == 5 => 'b101 => 'b10x => EM + VLAN
- * meta_fmt == 6 => 'b110 => 'b11x => EEM
- * meta_fmt == 7 => 'b111 => 'b11x => EEM + VLAN.
- */
- meta_fmt >>= BNXT_CFA_META_FMT_EM_EEM_SHFT;
- }
-
mbuf->hash.fdir.hi = bp->mark_table[cfa_code].mark_id;
mbuf->ol_flags |= RTE_MBUF_F_RX_FDIR | RTE_MBUF_F_RX_FDIR_ID;
}
goto rx;
}
rxr->rx_raw_prod = raw_prod;
+rx:
rxr->rx_next_cons = RING_IDX(rxr->rx_ring_struct, RING_NEXT(cons));
if (BNXT_TRUFLOW_EN(bp) && (BNXT_VF_IS_TRUSTED(bp) || BNXT_PF(bp)) &&
* All MBUFs are allocated with the same size under DPDK,
* no optimization for rx_copy_thresh
*/
-rx:
*rx_pkt = mbuf;
next_rx:
if (unlikely(!rxr->rx_buf_ring[i])) {
if (bnxt_alloc_rx_data(rxq, rxr, raw_prod) != 0) {
PMD_DRV_LOG(WARNING,
- "init'ed rx ring %d with %d/%d mbufs only\n",
+ "RxQ %d allocated %d of %d mbufs\n",
rxq->queue_id, i, ring->ring_size);
- break;
+ return -ENOMEM;
}
}
rxr->rx_raw_prod = raw_prod;
if (unlikely(!rxr->ag_buf_ring[i])) {
if (bnxt_alloc_ag_data(rxq, rxr, raw_prod) != 0) {
PMD_DRV_LOG(WARNING,
- "init'ed AG ring %d with %d/%d mbufs only\n",
+ "RxQ %d allocated %d of %d mbufs\n",
rxq->queue_id, i, ring->ring_size);
- break;
+ return -ENOMEM;
}
}
rxr->ag_raw_prod = raw_prod;
cons = RING_CMP(cpr->cp_ring_struct, raw_cons);
rxcmp = (struct rx_pkt_cmpl *)&cpr->cp_desc_ring[cons];
+ if (!bnxt_cpr_cmp_valid(rxcmp, raw_cons, ring_mask + 1))
+ break;
+
if (CMP_TYPE(rxcmp) == CMPL_BASE_TYPE_HWRM_DONE)
return 1;