diff --git a/alioth/src/virtio/queue/handlers.rs b/alioth/src/virtio/queue/handlers.rs index a2317b8..6ff38cd 100644 --- a/alioth/src/virtio/queue/handlers.rs +++ b/alioth/src/virtio/queue/handlers.rs @@ -28,6 +28,7 @@ pub fn handle_desc<'m, Q>( where Q: VirtQueue<'m>, { + let mut send_irq = false; 'out: loop { if !queue.has_next_desc() { break; @@ -44,16 +45,17 @@ where Ok(None) => break 'out, Ok(Some(len)) => { queue.push_used(desc, len); - if queue.interrupt_enabled() { - fence(Ordering::SeqCst); - irq_sender.queue_irq(q_index) - } + send_irq = send_irq || queue.interrupt_enabled(); } } } queue.enable_notification(true); fence(Ordering::SeqCst); } + if send_irq { + fence(Ordering::SeqCst); + irq_sender.queue_irq(q_index) + } Ok(()) }