Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157071669
D26933.id78708.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D26933.id78708.diff
View Options
Index: sys/dev/virtio/pci/virtio_pci.c
===================================================================
--- sys/dev/virtio/pci/virtio_pci.c
+++ sys/dev/virtio/pci/virtio_pci.c
@@ -68,7 +68,8 @@
struct vtpci_softc {
device_t vtpci_dev;
struct resource *vtpci_res;
- struct resource *vtpci_msix_res;
+ struct resource *vtpci_msix_table_res;
+ struct resource *vtpci_msix_pba_res;
uint64_t vtpci_features;
uint32_t vtpci_flags;
#define VTPCI_FLAG_NO_MSI 0x0001
@@ -305,12 +306,18 @@
sc->vtpci_flags |= VTPCI_FLAG_NO_MSI;
if (pci_find_cap(dev, PCIY_MSIX, NULL) == 0) {
- rid = PCIR_BAR(1);
- sc->vtpci_msix_res = bus_alloc_resource_any(dev,
+ int table_bar;
+
+ rid = table_bar = pci_msix_table_bar(dev);
+ sc->vtpci_msix_table_res = bus_alloc_resource_any(dev,
SYS_RES_MEMORY, &rid, RF_ACTIVE);
+ rid = pci_msix_pba_bar(dev);
+ if (rid != table_bar)
+ sc->vtpci_msix_pba_res = bus_alloc_resource_any(dev,
+ SYS_RES_MEMORY, &rid, RF_ACTIVE);
}
- if (sc->vtpci_msix_res == NULL)
+ if (sc->vtpci_msix_table_res == NULL)
sc->vtpci_flags |= VTPCI_FLAG_NO_MSIX;
vtpci_reset(sc);
@@ -349,10 +356,18 @@
vtpci_reset(sc);
- if (sc->vtpci_msix_res != NULL) {
- bus_release_resource(dev, SYS_RES_MEMORY, PCIR_BAR(1),
- sc->vtpci_msix_res);
- sc->vtpci_msix_res = NULL;
+ if (sc->vtpci_msix_table_res != NULL) {
+ bus_release_resource(dev, SYS_RES_MEMORY,
+ rman_get_rid(sc->vtpci_msix_table_res),
+ sc->vtpci_msix_table_res);
+ sc->vtpci_msix_table_res = NULL;
+ }
+
+ if (sc->vtpci_msix_pba_res != NULL) {
+ bus_release_resource(dev, SYS_RES_MEMORY,
+ rman_get_rid(sc->vtpci_msix_pba_res),
+ sc->vtpci_msix_pba_res);
+ sc->vtpci_msix_pba_res = NULL;
}
if (sc->vtpci_res != NULL) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, May 19, 6:51 AM (15 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33298063
Default Alt Text
D26933.id78708.diff (1 KB)
Attached To
Mode
D26933: virtio_pci: Use the table BAR and PBA BAR from MSI-X cap
Attached
Detach File
Event Timeline
Log In to Comment