Re: [PATCH] libvhost-user: Fix update of signalled_used

2023-05-09 Thread Stefan Hajnoczi
On Tue, 9 May 2023 at 06:28, Nir Soffer wrote: > > When we check if a driver needs a signal, we compare: > > - used_event: written by the driver each time it consumes an item In practice drivers tend to update it as you described, but devices cannot make that assumption. used_event is simply the

[PATCH] libvhost-user: Fix update of signalled_used

2023-05-09 Thread Nir Soffer
When we check if a driver needs a signal, we compare: - used_event: written by the driver each time it consumes an item - new: current idx written to the used ring, updated by us - old: last idx we signaled about We call vring_need_event() which does: return (__u16)(new_idx - event_idx - 1)