From 600f05370c4c2a3cf373694adfa3606d9677cd27 Mon Sep 17 00:00:00 2001 From: Priyansh Rathi Date: Wed, 5 Jul 2023 23:13:25 +0530 Subject: [PATCH] vsock: Try processing raw packets on other events too 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 --- crates/vsock/src/vhu_vsock.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/vsock/src/vhu_vsock.rs b/crates/vsock/src/vhu_vsock.rs index a0e8dc72..b9da5a83 100644 --- a/crates/vsock/src/vhu_vsock.rs +++ b/crates/vsock/src/vhu_vsock.rs @@ -317,8 +317,13 @@ impl VhostUserBackend 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)