| 1659 | } |
| 1660 | |
| 1661 | static __rte_noinline uint32_t |
| 1662 | virtio_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 | |
| 1699 | static void |
| 1700 | virtio_dev_vring_translate(struct virtio_net *dev, struct vhost_virtqueue *vq) |
no test coverage detected