| 797 | } |
| 798 | |
| 799 | static void |
| 800 | virtio_xmit_cleanup_normal_packed(struct virtqueue *vq, uint16_t num) |
| 801 | { |
| 802 | uint16_t used_idx, id; |
| 803 | uint16_t size = vq->vq_nentries; |
| 804 | struct vring_packed_desc *desc = vq->vq_packed.ring.desc; |
| 805 | struct vq_desc_extra *dxp; |
| 806 | |
| 807 | used_idx = vq->vq_used_cons_idx; |
| 808 | /* desc_is_used has a load-acquire or rte_io_rmb inside |
| 809 | * and wait for used desc in virtqueue. |
| 810 | */ |
| 811 | while (num-- && desc_is_used(&desc[used_idx], vq)) { |
| 812 | id = desc[used_idx].id; |
| 813 | dxp = &vq->vq_descx[id]; |
| 814 | vq->vq_used_cons_idx += dxp->ndescs; |
| 815 | if (vq->vq_used_cons_idx >= size) { |
| 816 | vq->vq_used_cons_idx -= size; |
| 817 | vq->vq_packed.used_wrap_counter ^= 1; |
| 818 | } |
| 819 | vq_ring_free_id_packed(vq, id); |
| 820 | if (dxp->cookie != NULL) { |
| 821 | rte_pktmbuf_free(dxp->cookie); |
| 822 | dxp->cookie = NULL; |
| 823 | } |
| 824 | used_idx = vq->vq_used_cons_idx; |
| 825 | } |
| 826 | } |
| 827 | |
| 828 | /* Cleanup from completed transmits. */ |
| 829 | static inline void |
no test coverage detected