mirror of
https://github.com/google/alioth.git
synced 2024-11-28 01:06:51 +00:00
perf(virtio): send 1 interrupt in a single loop
virtio-net benchmark data (Gbits/sec) with iperf3 AMD | before | after ----|--------|------- TX | 53.77 | 55.64 RX | 49.18 | 57.6 Intel | before | after ----|--------|------- TX | 37.68 | 36.32 RX | 44.17 | 47.07 Signed-off-by: Changyuan Lyu <changyuanl@google.com>
This commit is contained in:
parent
608fb13e3d
commit
b306c1a7b2
1 changed files with 6 additions and 4 deletions
|
@ -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(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue