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

Function virtio_dev_rx_packed

dpdk/lib/vhost/virtio_net.c:1661–1697  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1659}
1660
1661static __rte_noinline uint32_t
1662virtio_dev_rx_packed(struct virtio_net *dev,
1663 struct vhost_virtqueue *__rte_restrict vq,
1664 struct rte_mbuf **__rte_restrict pkts,
1665 uint32_t count)
1666 __rte_shared_locks_required(&vq->access_lock)
1667 __rte_shared_locks_required(&vq->iotlb_lock)
1668{
1669 uint32_t pkt_idx = 0;
1670
1671 do {
1672 rte_prefetch0(&vq->desc_packed[vq->last_avail_idx]);
1673
1674 if (count - pkt_idx >= PACKED_BATCH_SIZE) {
1675 if (!virtio_dev_rx_sync_batch_packed(dev, vq,
1676 &pkts[pkt_idx])) {
1677 pkt_idx += PACKED_BATCH_SIZE;
1678 continue;
1679 }
1680 }
1681
1682 if (virtio_dev_rx_single_packed(dev, vq, pkts[pkt_idx]))
1683 break;
1684 pkt_idx++;
1685
1686 } while (pkt_idx < count);
1687
1688 if (vq->shadow_used_idx) {
1689 do_data_copy_enqueue(dev, vq);
1690 vhost_flush_enqueue_shadow_packed(dev, vq);
1691 }
1692
1693 if (pkt_idx)
1694 vhost_vring_call_packed(dev, vq);
1695
1696 return pkt_idx;
1697}
1698
1699static void
1700virtio_dev_vring_translate(struct virtio_net *dev, struct vhost_virtqueue *vq)

Callers 1

virtio_dev_rxFunction · 0.85

Calls 6

do_data_copy_enqueueFunction · 0.85
vhost_vring_call_packedFunction · 0.85
rte_prefetch0Function · 0.50

Tested by

no test coverage detected