Changeset View
Changeset View
Standalone View
Standalone View
head/usr.sbin/bhyve/virtio.c
Show First 20 Lines • Show All 422 Lines • ▼ Show 20 Lines | vq_relchain(struct vqueue_info *vq, uint16_t idx, uint32_t iolen) | ||||
uidx = vuh->vu_idx; | uidx = vuh->vu_idx; | ||||
vue = &vuh->vu_ring[uidx++ & mask]; | vue = &vuh->vu_ring[uidx++ & mask]; | ||||
vue->vu_idx = idx; | vue->vu_idx = idx; | ||||
vue->vu_tlen = iolen; | vue->vu_tlen = iolen; | ||||
/* | /* | ||||
* Ensure the used descriptor is visible before updating the index. | * Ensure the used descriptor is visible before updating the index. | ||||
* This is necessary on ISAs with memory ordering less strict than x86. | * This is necessary on ISAs with memory ordering less strict than x86 | ||||
* (and even on x86 to act as a compiler barrier). | |||||
*/ | */ | ||||
atomic_thread_fence_rel(); | atomic_thread_fence_rel(); | ||||
vuh->vu_idx = uidx; | vuh->vu_idx = uidx; | ||||
} | } | ||||
/* | /* | ||||
* Driver has finished processing "available" chains and calling | * Driver has finished processing "available" chains and calling | ||||
* vq_relchain on each one. If driver used all the available | * vq_relchain on each one. If driver used all the available | ||||
▲ Show 20 Lines • Show All 356 Lines • Show Last 20 Lines |