From b9aeaf66340ceb090060c17ce2b2f223999013da Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Tue, 15 Mar 2022 15:30:18 +0000 Subject: [PATCH] net_util: Remove unnecessary return value from CtrlQueue::process() Since the code has been adapted to support VIRTIO_F_EVENT_IDX we use Queue::needs_notification() to determine whether to signal the guest so it is no longer necessary to check if there are any used descriptors. If the feature is not negotiated then Queue::needs_notification() will return true triggering an interrupt of the guest. Theoretically this could be a spurious interrupt of the guest if there were no used used descriptors but this is unlikely as we only generate used descriptors for the control queue as a result of an interrupt of the VMM by the guest. Signed-off-by: Rob Bradford --- net_util/src/ctrl_queue.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net_util/src/ctrl_queue.rs b/net_util/src/ctrl_queue.rs index b06a1977a..233c10b12 100644 --- a/net_util/src/ctrl_queue.rs +++ b/net_util/src/ctrl_queue.rs @@ -60,7 +60,7 @@ impl CtrlQueue { &mut self, queue: &mut Queue>, access_platform: Option<&Arc>, - ) -> Result { + ) -> Result<()> { let mut used_desc_heads = Vec::new(); loop { for mut desc_chain in queue.iter().map_err(Error::QueueIterator)? { @@ -156,7 +156,7 @@ impl CtrlQueue { } } - Ok(!used_desc_heads.is_empty()) + Ok(()) } }