goto rx;
}
rxr->rx_prod = prod;
+
+ if (BNXT_TRUFLOW_EN(bp) && (BNXT_VF_IS_TRUSTED(bp) || BNXT_PF(bp)) &&
+ vfr_flag) {
+ bnxt_vfr_recv(mark_id, rxq->queue_id, mbuf);
+ /* Now return an error so that nb_rx_pkts is not
+ * incremented.
+ * This packet was meant to be given to the representor.
+ * So no need to account the packet and give it to
+ * parent Rx burst function.
+ */
+ rc = -ENODEV;
+ goto next_rx;
+ }
/*
* All MBUFs are allocated with the same size under DPDK,
* no optimization for rx_copy_thresh
rx:
*rx_pkt = mbuf;
- if (BNXT_TRUFLOW_EN(bp) &&
- (BNXT_VF_IS_TRUSTED(bp) || BNXT_PF(bp)) &&
- vfr_flag) {
- if (!bnxt_vfr_recv(mark_id, rxq->queue_id, mbuf)) {
- /* Now return an error so that nb_rx_pkts is not
- * incremented.
- * This packet was meant to be given to the representor.
- * So no need to account the packet and give it to
- * parent Rx burst function.
- */
- rc = -ENODEV;
- }
- }
-
next_rx:
*raw_cons = tmp_raw_cons;
struct rte_mbuf **rx_buf = &rxr->rx_buf_ring[i];
/* Buffer already allocated for this index. */
- if (*rx_buf != NULL)
+ if (*rx_buf != NULL && *rx_buf != &rxq->fake_mbuf)
continue;
/* This slot is empty. Alloc buffer for Rx */
ring->ring_mask = ring->ring_size - 1;
ring->bd = (void *)rxr->rx_desc_ring;
ring->bd_dma = rxr->rx_desc_mapping;
- ring->vmem_size = ring->ring_size * sizeof(struct rte_mbuf *);
+
+ /* Allocate extra rx ring entries for vector rx. */
+ ring->vmem_size = sizeof(struct rte_mbuf *) *
+ (ring->ring_size + RTE_BNXT_DESCS_PER_LOOP);
+
ring->vmem = (void **)&rxr->rx_buf_ring;
ring->fw_ring_id = INVALID_HW_RING_ID;
prod = RING_NEXT(rxr->rx_ring_struct, prod);
}
+ /* Initialize dummy mbuf pointers for vector mode rx. */
+ for (i = ring->ring_size;
+ i < ring->ring_size + RTE_BNXT_DESCS_PER_LOOP; i++) {
+ rxr->rx_buf_ring[i] = &rxq->fake_mbuf;
+ }
+
ring = rxr->ag_ring_struct;
type = RX_PROD_AGG_BD_TYPE_RX_PROD_AGG;
bnxt_init_rxbds(ring, type, size);