summary refs log tree commit diff
path: root/devices/src/virtio/interrupt.rs
Commit message (Collapse)AuthorAge
* devices: make virtio::Interrupt a traitAlyssa Ross2020-06-15
| | | | | This patch is designed not for efficiency, but for minimal code footprint for experimentation. Hence, Box.
* vhost-net: implement direct msix irq fdChuanxiao Dong2020-03-25
| | | | | | | | | | | | | | | | | | | | | | | | | The current vhost-net msix irq injection flow is from vhost-kernel to crosvm vhost-net, then to the KVM for irq injection. It still need crosvm vhost-net to trigger irq, which is because the set_vring_call is not directly using the msix irq fd. To optimize this flow to be from vhost-kernel to KVM directly, need: 1. if the msix is enabled and unmasked, use the misx irq fd for the vring_call directly so that all the misx injection can directly to KVM from vhost-kernel. 2. if the msix is disabled or masked, use the indirect vhost_interrupt fd to let the crosvm to control the irq injection. BUG=None TEST=cargo test -p devices TEST=start crosvm with vhost-net, and run the iperf3 on the network without any issue Change-Id: Idb3427f69f23b728305ed63d88973156a03e7c6b Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2046452 Reviewed-by: Stephen Barber <smbarber@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com>
* devices: virtio: use signal helper for config changesDaniel Verkamp2019-11-18
| | | | | | | | | | | | | | | | Add handling of the virtio device MSI-X configuration change vector by using the signal function that was previously factored out. BUG=chromium:854765 TEST=./build_test TEST=trigger disk config change with `crosvm disk resize ...` Change-Id: I462c23e10d152f896586bb70b95634a53088d480 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1898269 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Zide Chen <zide.chen@intel.corp-partner.google.com> Reviewed-by: Zach Reizner <zachr@chromium.org>
* devices: virtio: factor out interrupt signal functionDaniel Verkamp2019-11-06
| | | | | | | | | | | | | | | | This will be used for configuration interrupts as well. No functional change. BUG=chromium:854765 TEST=./build_test.py Change-Id: Iacccfd0a93a5c90783033a8e37598c2683704351 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1898267 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Zide Chen <zide.chen@intel.corp-partner.google.com> Reviewed-by: Zach Reizner <zachr@chromium.org>
* devices: virtio: do not trigger MSI-X with no vectorDaniel Verkamp2019-11-06
| | | | | | | | | | | | | | | | The virtio specification allows the driver to configure a queue's MSI-X vector to the magic NO_VECTOR value (0xffff); in this case, if MSI-X is enabled, no interrupt should be delivered (neither MSI-X nor INTx). BUG=chromium:854765 TEST=./build_test.py Change-Id: Icb5e82bf9a57ded60fc8c022c4d8630b5ab70dcf Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1898266 Reviewed-by: Zide Chen <zide.chen@intel.corp-partner.google.com> Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com>
* devices: virtio: simplify interrupt status updateDaniel Verkamp2019-11-06
| | | | | | | | | | | | | | | | | | | | The first interrupt_status.fetch_or() operation already sets the appropriate bit; calling fetch_or() again with the same value is unnecessary. In addition, if the interrupt_status field has any bit set (not just the USED_RING bit), then the interrupt is already pending and we don't need to trigger it again. BUG=chromium:854765 TEST=./build_test.py Change-Id: Iba7fb9b934d062db801f8ba0e743618f9db580ee Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1898045 Reviewed-by: Zide Chen <zide.chen@intel.corp-partner.google.com> Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com>
* devices: implement dedicated Interrupt struct for virtio WorkerZide Chen2019-10-25
The code to inject interrupt to the guest can be generic to all virtio devices. This patch: - move those guest interrupt related fields out of Worker structure and put in a separate file, making the worker code cleaner. - remove redandant functions across virtio devices: signal_used_queue(), signal_config_changed(), etc. BUG=chromium:854765 TEST=sanity test on eve and Linux TEST=cargo test -p devices Change-Id: I8e9f760f2057f192fdc74d16a59fea2e6b08c194 Signed-off-by: Zide Chen <zide.chen@intel.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1869553 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>