]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Support MSI-X for passthrough devices with a separate PBA BAR.
authorJohn Baldwin <jhb@FreeBSD.org>
Wed, 5 Jun 2019 19:30:32 +0000 (19:30 +0000)
committerJohn Baldwin <jhb@FreeBSD.org>
Wed, 5 Jun 2019 19:30:32 +0000 (19:30 +0000)
commit0d1fd6e5414b0d7f72fe2b6892bf673ec2a5d500
tree9ef045e9c6a0517c2c344378fbc90e7d9a00c762
parent24be3f513f218c83acd6733097bd5b3ce8aed451
Support MSI-X for passthrough devices with a separate PBA BAR.

pci_alloc_msix() requires both the table and PBA BARs to be allocated
by the driver.  ppt was only allocating the table BAR so would fail
for devices with the PBA in a separate BAR.  Fix this by allocating
the PBA BAR before pci_alloc_msix() if it is stored in a separate BAR.

While here, release BARs after calling pci_release_msi() instead of
before.  Also, don't call bus_teardown_intr() in error handling code
if bus_setup_intr() has just failed.

Reported by: gallatin
Tested by: gallatin
Reviewed by: rgrimes, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D20525
sys/amd64/vmm/io/ppt.c