vfio-pci: Fix MSI-X masking performance
commitf4d45d47826377722700894dbf7f47444527a9d2
authorAlex Williamson <alex.williamson@redhat.com>
Mon, 30 Jun 2014 15:50:33 +0000 (30 09:50 -0600)
committerAlex Williamson <alex.williamson@redhat.com>
Mon, 30 Jun 2014 15:50:33 +0000 (30 09:50 -0600)
tree99216fd6e9dfe616bb2aabf39070e7d3edf8a550
parent9035f8c09bebb63c0cc6014acf5c7066ef778aff
vfio-pci: Fix MSI-X masking performance

There are still old guests out there that over-exercise MSI-X masking.
The current code completely sets-up and tears-down an MSI-X vector on
the "use" and "release" callbacks.  While this is functional, it can
slow an old guest to a crawl.  We can easily skip the KVM parts of
this so that we keep the MSI route and irqfd setup.  We do however
need to switch VFIO to trigger a different eventfd while masked.
Actually, we have the option of continuing to use -1 to disable the
trigger, but by using another EventNotifier we can allow the MSI-X
core to emulate pending bits and re-fire the vector once unmasked.
MSI code gets updated as well to use the same setup and teardown
structures and functions.

Prior to this change, an igbvf assigned to a RHEL5 guest gets about
20Mbps and 50 transactions/s with netperf (remote or VF->PF).  With
this change, we get line rate and 3k transactions/s remote or 2Gbps
and 6k+ transactions/s to the PF.  No significant change is expected
for newer guests with more well behaved MSI-X support.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
hw/misc/vfio.c