+ if ((clib_atomic_load_seq_cst (&vring->used->flags) &
+ VRING_USED_F_NO_NOTIFY) == 0)
+ {
+ virtio_kick (vm, vring, vif);
+ }
+ goto more;
+}
+
+static_always_inline void
+virtio_refill_vring_packed (vlib_main_t * vm, virtio_if_t * vif,
+ virtio_if_type_t type, virtio_vring_t * vring,
+ const int hdr_sz, u32 node_index)
+{
+ u16 used, next, n_slots, n_refill, flags = 0, first_desc_flags;
+ u16 sz = vring->size;
+
+more:
+ used = vring->desc_in_use;
+
+ if (sz == used)
+ return;
+
+ /* deliver free buffers in chunks of 64 */
+ n_refill = clib_min (sz - used, 64);
+
+ next = vring->desc_next;
+ first_desc_flags = vring->packed_desc[next].flags;
+ n_slots =
+ vlib_buffer_alloc_to_ring_from_pool (vm, vring->buffers, next,
+ sz, n_refill,
+ vring->buffer_pool_index);
+
+ if (PREDICT_FALSE (n_slots != n_refill))
+ {
+ vlib_error_count (vm, node_index,
+ VIRTIO_INPUT_ERROR_BUFFER_ALLOC, n_refill - n_slots);
+ if (n_slots == 0)
+ return;
+ }