aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhihong Wang <zhihong.wang@intel.com>2016-06-21 20:33:59 -0400
committerDamjan Marion <damarion@cisco.com>2016-06-25 17:34:30 +0000
commit692581faf8d2eb876db5ab068ba4b477bc7ea174 (patch)
treeb3fbc1b90423bee14166dc2cdda1904b19d66f7d
parent07515d7aaee6ab030501fc155bc8938f72f0da34 (diff)
vhost-dpdk: dequeue size fix
Burst size for DPDK is 32, which is different from VLIB_FRAME_SIZE. A loop is needed to dequeue all packets. Change-Id: Ie611c58c4e3434251a47fe6ad1f38abcb85180cb Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
-rw-r--r--vnet/vnet/devices/dpdk/dpdk_priv.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/vnet/vnet/devices/dpdk/dpdk_priv.h b/vnet/vnet/devices/dpdk/dpdk_priv.h
index e5a67978a07..c202d85b590 100644
--- a/vnet/vnet/devices/dpdk/dpdk_priv.h
+++ b/vnet/vnet/devices/dpdk/dpdk_priv.h
@@ -92,12 +92,20 @@ dpdk_rx_burst ( dpdk_main_t * dm, dpdk_device_t * xd, u16 queue_id)
return 0;
#endif
- n_buffers = rte_vhost_dequeue_burst(&xd->vu_vhost_dev, offset + VIRTIO_TXQ,
- bm->pktmbuf_pools[socket_id],
- xd->rx_vectors[queue_id], VLIB_FRAME_SIZE);
+ struct rte_mbuf **pkts = xd->rx_vectors[queue_id];
+ while (n_left) {
+ n_this_chunk = rte_vhost_dequeue_burst(&xd->vu_vhost_dev,
+ offset + VIRTIO_TXQ,
+ bm->pktmbuf_pools[socket_id],
+ pkts + n_buffers,
+ n_left);
+ n_buffers += n_this_chunk;
+ n_left -= n_this_chunk;
+ if (n_this_chunk == 0)
+ break;
+ }
int i; u32 bytes = 0;
- struct rte_mbuf **pkts = xd->rx_vectors[queue_id];
for (i = 0; i < n_buffers; i++) {
struct rte_mbuf *buff = pkts[i];
bytes += rte_pktmbuf_data_len(buff);