mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-18 10:35:23 +00:00
vhost_user_net, vm-virtio: Interrupt guest when TX queue is updated
According to the virtio spec the guest should always be interrupted when "used" descriptors are returned from the device to the driver. However this was not the case for the TX queue in either the virtio-net implementation or the vhost-user-net implementation. This would have meant that the guest could end up with a reduced TX throughput as it would not know that the packets had been dispatched via the VMM. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
c8a081e459
commit
039accc139
@ -312,7 +312,9 @@ impl VhostUserBackend for VhostUserNetBackend {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
1 => {
|
1 => {
|
||||||
thread.process_tx(&mut vrings[1].write().unwrap().mut_queue())?;
|
let mut vring = vrings[1].write().unwrap();
|
||||||
|
thread.process_tx(vring.mut_queue())?;
|
||||||
|
vring.signal_used_queue()?;
|
||||||
}
|
}
|
||||||
2 => {
|
2 => {
|
||||||
let mut vring = vrings[0].write().unwrap();
|
let mut vring = vrings[0].write().unwrap();
|
||||||
|
@ -148,8 +148,7 @@ impl NetEpollHandler {
|
|||||||
let mem = self.mem.memory();
|
let mem = self.mem.memory();
|
||||||
|
|
||||||
self.tx.process_desc_chain(&mem, &mut self.tap, &mut queue);
|
self.tx.process_desc_chain(&mem, &mut self.tap, &mut queue);
|
||||||
|
self.signal_used_queue(queue)
|
||||||
Ok(())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn read_tap(&mut self) -> io::Result<usize> {
|
fn read_tap(&mut self) -> io::Result<usize> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user