Lines Matching full:vring
42 /* SVQ trust that the guest vring is little endian */ in vhost_svq_valid_features()
127 * Write descriptors to SVQ vring
145 vring_desc_t *descs = svq->vring.desc; in vhost_svq_vring_write_descs()
181 vring_avail_t *avail = svq->vring.avail; in vhost_svq_add_split()
209 avail_idx = svq->shadow_avail_idx & (svq->vring.num - 1); in vhost_svq_add_split()
231 uint16_t avail_event = *(uint16_t *)(&svq->vring.used->ring[svq->vring.num]); in vhost_svq_kick()
234 needs_kick = !(svq->vring.used->flags & VRING_USED_F_NO_NOTIFY); in vhost_svq_kick()
363 uint16_t *used_idx = &svq->vring.used->idx; in vhost_svq_more_used()
380 * callbacks. True if SVQ used vring has no more pending buffers.
385 uint16_t *used_event = (uint16_t *)&svq->vring.avail->ring[svq->vring.num]; in vhost_svq_enable_notification()
388 svq->vring.avail->flags &= ~cpu_to_le16(VRING_AVAIL_F_NO_INTERRUPT); in vhost_svq_enable_notification()
403 svq->vring.avail->flags |= cpu_to_le16(VRING_AVAIL_F_NO_INTERRUPT); in vhost_svq_disable_notification()
421 const vring_used_t *used = svq->vring.used; in vhost_svq_get_buf()
431 last_used = svq->last_used_idx & (svq->vring.num - 1); in vhost_svq_get_buf()
436 if (unlikely(used_elem.id >= svq->vring.num)) { in vhost_svq_get_buf()
493 if (unlikely(i >= svq->vring.num)) { in vhost_svq_flush()
496 i, svq->vring.num); in vhost_svq_flush()
593 * Get the shadow vq vring address.
600 addr->desc_user_addr = (uint64_t)(uintptr_t)svq->vring.desc; in vhost_svq_get_vring_addr()
601 addr->avail_user_addr = (uint64_t)(uintptr_t)svq->vring.avail; in vhost_svq_get_vring_addr()
602 addr->used_user_addr = (uint64_t)(uintptr_t)svq->vring.used; in vhost_svq_get_vring_addr()
607 size_t desc_size = sizeof(vring_desc_t) * svq->vring.num; in vhost_svq_driver_area_size()
608 size_t avail_size = offsetof(vring_avail_t, ring[svq->vring.num]) + in vhost_svq_driver_area_size()
616 size_t used_size = offsetof(vring_used_t, ring[svq->vring.num]) + in vhost_svq_device_area_size()
673 svq->vring.num = virtio_queue_get_num(vdev, virtio_get_queue_index(vq)); in vhost_svq_start()
674 svq->num_free = svq->vring.num; in vhost_svq_start()
675 svq->vring.desc = mmap(NULL, vhost_svq_driver_area_size(svq), in vhost_svq_start()
678 desc_size = sizeof(vring_desc_t) * svq->vring.num; in vhost_svq_start()
679 svq->vring.avail = (void *)((char *)svq->vring.desc + desc_size); in vhost_svq_start()
680 svq->vring.used = mmap(NULL, vhost_svq_device_area_size(svq), in vhost_svq_start()
683 svq->desc_state = g_new0(SVQDescState, svq->vring.num); in vhost_svq_start()
684 svq->desc_next = g_new0(uint16_t, svq->vring.num); in vhost_svq_start()
685 for (unsigned i = 0; i < svq->vring.num - 1; i++) { in vhost_svq_start()
706 for (unsigned i = 0; i < svq->vring.num; ++i) { in vhost_svq_stop()
725 munmap(svq->vring.desc, vhost_svq_driver_area_size(svq)); in vhost_svq_stop()
726 munmap(svq->vring.used, vhost_svq_device_area_size(svq)); in vhost_svq_stop()