offsetof(struct rte_mbuf, rx_descriptor_fields1) + 8);
RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, hash) !=
offsetof(struct rte_mbuf, rx_descriptor_fields1) + 12);
+ /*
+ * Not to overflow elts array. Decompress next time after mbuf
+ * replenishment.
+ */
+ if (unlikely(mcqe_n + MLX5_VPMD_DESCS_PER_LOOP >
+ (uint16_t)(rxq->rq_ci - rxq->cq_ci)))
+ return;
/*
* A. load mCQEs into a 128bit register.
* B. store rearm data to mbuf.
}
elts_idx = rxq->rq_pi & q_mask;
elts = &(*rxq->elts)[elts_idx];
- /* Not to overflow pkts array. */
- pkts_n = RTE_ALIGN_FLOOR(pkts_n - rcvd_pkt, MLX5_VPMD_DESCS_PER_LOOP);
+ pkts_n = RTE_MIN(pkts_n - rcvd_pkt,
+ (uint16_t)(rxq->rq_ci - rxq->cq_ci));
+ /* Not to overflow pkts/elts array. */
+ pkts_n = RTE_ALIGN_FLOOR(pkts_n, MLX5_VPMD_DESCS_PER_LOOP);
/* Not to cross queue end. */
pkts_n = RTE_MIN(pkts_n, q_n - elts_idx);
if (!pkts_n)