Skip to content

Commit

Permalink
vsock: Try processing raw packets on other events too
Browse files Browse the repository at this point in the history
Currently, the `raw_pkts_queue` is processed only when a
`SIBLING_VM_EVENT` is received. But it may happen that the
`raw_pkts_queue` could not be processed completely due to insufficient
space in the RX virtqueue at that time. So, try to process raw packets on
other events too similar to what happens in the RX of standard packets.

Signed-off-by: Priyansh Rathi <[email protected]>
  • Loading branch information
techiepriyansh committed Jul 5, 2023
1 parent c684bed commit 600f053
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crates/vsock/src/vhu_vsock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,13 @@ impl VhostUserBackend<VringRwLock, ()> for VhostUserVsockBackend {
}
}

if device_event != EVT_QUEUE_EVENT && thread.thread_backend.pending_rx() {
thread.process_rx(vring_rx, evt_idx)?;
if device_event != EVT_QUEUE_EVENT {
if thread.thread_backend.pending_rx() {
thread.process_rx(vring_rx, evt_idx)?;
}
if thread.thread_backend.pending_raw_pkts() {
thread.process_raw_pkts(vring_rx, evt_idx)?;
}
}

Ok(false)
Expand Down

0 comments on commit 600f053

Please sign in to comment.