sw_ring = rxq->rx_ring->rx_buf_ring;
if (sw_ring) {
+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
+ /*
+ * The vector receive burst function does not set used
+ * mbuf pointers to NULL, do that here to simplify
+ * cleanup logic.
+ */
+ for (i = 0; i < rxq->rxrearm_nb; i++)
+ sw_ring[rxq->rxrearm_start + i] = NULL;
+ rxq->rxrearm_nb = 0;
+#endif
for (i = 0;
i < rxq->rx_ring->rx_ring_struct->ring_size; i++) {
if (sw_ring[i]) {
num_valid = (sizeof(uint64_t) / sizeof(uint16_t)) -
(__builtin_clzl(valid & desc_valid_mask) / 16);
- switch (num_valid) {
- case 4:
- rxr->rx_buf_ring[mbcons + 3] = NULL;
- /* FALLTHROUGH */
- case 3:
- rxr->rx_buf_ring[mbcons + 2] = NULL;
- /* FALLTHROUGH */
- case 2:
- rxr->rx_buf_ring[mbcons + 1] = NULL;
- /* FALLTHROUGH */
- case 1:
- rxr->rx_buf_ring[mbcons + 0] = NULL;
+ if (num_valid == 0)
break;
- case 0:
- goto out;
- }
descs_to_mbufs(rxcmp, rxcmp1, mb_init, &rx_pkts[nb_rx_pkts],
rxr);
break;
}
-out:
if (nb_rx_pkts) {
rxr->rx_raw_prod = RING_ADV(rxr->rx_raw_prod, nb_rx_pkts);
valid = _mm_cvtsi128_si64(_mm_packs_epi32(info3_v, info3_v));
num_valid = __builtin_popcountll(valid & desc_valid_mask);
- switch (num_valid) {
- case 4:
- rxr->rx_buf_ring[mbcons + 3] = NULL;
- /* FALLTHROUGH */
- case 3:
- rxr->rx_buf_ring[mbcons + 2] = NULL;
- /* FALLTHROUGH */
- case 2:
- rxr->rx_buf_ring[mbcons + 1] = NULL;
- /* FALLTHROUGH */
- case 1:
- rxr->rx_buf_ring[mbcons + 0] = NULL;
+ if (num_valid == 0)
break;
- case 0:
- goto out;
- }
descs_to_mbufs(rxcmp, rxcmp1, mbuf_init, &rx_pkts[nb_rx_pkts],
rxr);
break;
}
-out:
if (nb_rx_pkts) {
rxr->rx_raw_prod = RING_ADV(rxr->rx_raw_prod, nb_rx_pkts);