MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vhost_clear_queue

Function vhost_clear_queue

dpdk/examples/vhost/main.c:1550–1567  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1548}
1549
1550static void
1551vhost_clear_queue(struct vhost_dev *vdev, uint16_t queue_id)
1552{
1553 uint16_t n_pkt = 0;
1554 int pkts_inflight;
1555
1556 int16_t dma_id = dma_bind[vid2socketid[vdev->vid]].dmas[queue_id].dev_id;
1557 pkts_inflight = rte_vhost_async_get_inflight(vdev->vid, queue_id);
1558
1559 struct rte_mbuf *m_cpl[pkts_inflight];
1560
1561 while (pkts_inflight) {
1562 n_pkt = rte_vhost_clear_queue(vdev->vid, queue_id, m_cpl,
1563 pkts_inflight, dma_id, 0);
1564 free_pkts(m_cpl, n_pkt);
1565 pkts_inflight = rte_vhost_async_get_inflight(vdev->vid, queue_id);
1566 }
1567}
1568
1569/*
1570 * Remove a device from the specific data core linked list and from the

Callers 1

destroy_deviceFunction · 0.85

Calls 3

rte_vhost_clear_queueFunction · 0.85
free_pktsFunction · 0.70

Tested by

no test coverage detected