mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-05 13:05:45 +00:00
vhost_user_net: Simplify match values for handle_event()
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
a517be4eac
commit
82d0cdff4f
@ -292,7 +292,7 @@ impl VhostUserBackend for VhostUserNetBackend {
|
|||||||
|
|
||||||
let mut thread = self.threads[thread_id].lock().unwrap();
|
let mut thread = self.threads[thread_id].lock().unwrap();
|
||||||
match device_event {
|
match device_event {
|
||||||
x if x == 0 => {
|
0 => {
|
||||||
thread.resume_rx(&mut vrings[0].write().unwrap())?;
|
thread.resume_rx(&mut vrings[0].write().unwrap())?;
|
||||||
|
|
||||||
if !thread.rx_tap_listening {
|
if !thread.rx_tap_listening {
|
||||||
@ -304,10 +304,10 @@ impl VhostUserBackend for VhostUserNetBackend {
|
|||||||
thread.rx_tap_listening = true;
|
thread.rx_tap_listening = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
x if x == 1 => {
|
1 => {
|
||||||
thread.process_tx(&mut vrings[1].write().unwrap().mut_queue())?;
|
thread.process_tx(&mut vrings[1].write().unwrap().mut_queue())?;
|
||||||
}
|
}
|
||||||
x if x == 2 => {
|
2 => {
|
||||||
let mut vring = vrings[0].write().unwrap();
|
let mut vring = vrings[0].write().unwrap();
|
||||||
if thread.rx.deferred_frame
|
if thread.rx.deferred_frame
|
||||||
// Process a deferred frame first if available. Don't read from tap again
|
// Process a deferred frame first if available. Don't read from tap again
|
||||||
|
Loading…
Reference in New Issue
Block a user