If the number of packets requested are already present in the
rx_ring then skip reading the ring buffer from the host.
If the ring between the poll and receive side is full, then don't
poll (let incoming packets stay on host).
If no more transmit descriptors are available, then still try and
flush any outstanding data.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
PMD_DRV_LOG(ERR, "unknown chan pkt %u", pkt->type);
break;
}
PMD_DRV_LOG(ERR, "unknown chan pkt %u", pkt->type);
break;
}
+
+ if (rxq->rx_ring && rte_ring_full(rxq->rx_ring))
+ break;
}
rte_spinlock_unlock(&rxq->ring_lock);
}
rte_spinlock_unlock(&rxq->ring_lock);
-
- if (unlikely(ret != -EAGAIN))
- PMD_DRV_LOG(ERR, "channel receive failed: %d", ret);
}
static void hn_append_to_chim(struct hn_tx_queue *txq,
}
static void hn_append_to_chim(struct hn_tx_queue *txq,
pkt = hn_try_txagg(hv, txq, pkt_size);
if (unlikely(!pkt))
pkt = hn_try_txagg(hv, txq, pkt_size);
if (unlikely(!pkt))
hn_encap(pkt, txq->queue_id, m);
hn_append_to_chim(txq, pkt, m);
hn_encap(pkt, txq->queue_id, m);
hn_append_to_chim(txq, pkt, m);
} else {
txd = hn_new_txd(hv, txq);
if (unlikely(!txd))
} else {
txd = hn_new_txd(hv, txq);
if (unlikely(!txd))
if (unlikely(hv->closed))
return 0;
if (unlikely(hv->closed))
return 0;
- /* Get all outstanding receive completions */
- hn_process_events(hv, rxq->queue_id);
+ /* If ring is empty then process more */
+ if (rte_ring_count(rxq->rx_ring) < nb_pkts)
+ hn_process_events(hv, rxq->queue_id);
/* Get mbufs off staging ring */
return rte_ring_sc_dequeue_burst(rxq->rx_ring, (void **)rx_pkts,
/* Get mbufs off staging ring */
return rte_ring_sc_dequeue_burst(rxq->rx_ring, (void **)rx_pkts,