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 <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2022-03-15 15:30:18 +00:00
parent aa3ef70ea6
commit b9aeaf6634

View File

@ -60,7 +60,7 @@ impl CtrlQueue {
&mut self,
queue: &mut Queue<GuestMemoryAtomic<GuestMemoryMmap>>,
access_platform: Option<&Arc<dyn AccessPlatform>>,
) -> Result<bool> {
) -> 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(())
}
}