mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-22 03:12:27 +00:00
vm-virtio: queue: hint that get_used_event should be inlined
get_used_event is used from vhost_user_backend:needs_notification to check whether an interrupt must be sent to the guest to notify there are new items in the queue. Shorten the update window by asking the the compiler to inline this method, so a write won't slip between the read of the memory contents and the actual check. Signed-off-by: Sergio Lopez <slp@redhat.com>
This commit is contained in:
parent
401e1d2489
commit
536323d9fb
@ -548,6 +548,7 @@ impl Queue {
|
||||
}
|
||||
|
||||
/// Return the value present in the used_event field of the avail ring.
|
||||
#[inline(always)]
|
||||
pub fn get_used_event(&self, mem: &GuestMemoryMmap) -> Option<Wrapping<u16>> {
|
||||
let avail_ring = self.avail_ring;
|
||||
let used_event_addr =
|
||||
|
Loading…
x
Reference in New Issue
Block a user