From 9c658e21a54d2350bab611187f0efb12c9ce1969 Mon Sep 17 00:00:00 2001 From: Bo Chen Date: Thu, 20 Oct 2022 08:15:00 -0700 Subject: [PATCH] virtio-devices: iommu: Remove trivial handling of 'EVENT_Q_EVENT' Signed-off-by: Bo Chen --- virtio-devices/src/iommu.rs | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/virtio-devices/src/iommu.rs b/virtio-devices/src/iommu.rs index 227748b23..ddc0ae38f 100644 --- a/virtio-devices/src/iommu.rs +++ b/virtio-devices/src/iommu.rs @@ -47,7 +47,7 @@ const REQUEST_Q_EVENT: u16 = EPOLL_HELPER_EVENT_LAST + 1; /// New descriptors are pending on the event queue. /// "eventq" lets the device report any fault or other asynchronous event to /// the guest driver. -const EVENT_Q_EVENT: u16 = EPOLL_HELPER_EVENT_LAST + 2; +const _EVENT_Q_EVENT: u16 = EPOLL_HELPER_EVENT_LAST + 2; /// PROBE properties size. /// This is the minimal size to provide at least one RESV_MEM property. @@ -634,7 +634,7 @@ struct IommuEpollHandler { _event_queue: Queue, interrupt_cb: Arc, request_queue_evt: EventFd, - event_queue_evt: EventFd, + _event_queue_evt: EventFd, kill_evt: EventFd, pause_evt: EventFd, mapping: Arc, @@ -664,10 +664,6 @@ impl IommuEpollHandler { Ok(used_descs) } - fn event_queue(&mut self) -> bool { - false - } - fn signal_used_queue(&self, queue_index: u16) -> result::Result<(), DeviceError> { self.interrupt_cb .trigger(VirtioInterruptType::Queue(queue_index)) @@ -684,7 +680,6 @@ impl IommuEpollHandler { ) -> result::Result<(), EpollHelperError> { let mut helper = EpollHelper::new(&self.kill_evt, &self.pause_evt)?; helper.add_event(self.request_queue_evt.as_raw_fd(), REQUEST_Q_EVENT)?; - helper.add_event(self.event_queue_evt.as_raw_fd(), EVENT_Q_EVENT)?; helper.run(paused, paused_sync, self)?; Ok(()) @@ -719,20 +714,6 @@ impl EpollHelperHandler for IommuEpollHandler { })?; } } - EVENT_Q_EVENT => { - self.event_queue_evt.read().map_err(|e| { - EpollHelperError::HandleEvent(anyhow!("Failed to get queue event: {:?}", e)) - })?; - - if self.event_queue() { - self.signal_used_queue(1).map_err(|e| { - EpollHelperError::HandleEvent(anyhow!( - "Failed to signal used queue: {:?}", - e - )) - })?; - } - } _ => { return Err(EpollHelperError::HandleEvent(anyhow!( "Unexpected event: {}", @@ -1043,7 +1024,7 @@ impl VirtioDevice for Iommu { let (kill_evt, pause_evt) = self.common.dup_eventfds(); let (_, request_queue, request_queue_evt) = queues.remove(0); - let (_, _event_queue, event_queue_evt) = queues.remove(0); + let (_, _event_queue, _event_queue_evt) = queues.remove(0); let mut handler = IommuEpollHandler { mem, @@ -1051,7 +1032,7 @@ impl VirtioDevice for Iommu { _event_queue, interrupt_cb, request_queue_evt, - event_queue_evt, + _event_queue_evt, kill_evt, pause_evt, mapping: self.mapping.clone(),