Page MenuHomeFreeBSD

D26933.id80724.diff
No OneTemporary

D26933.id80724.diff

Index: sys/dev/virtio/pci/virtio_pci.c
===================================================================
--- sys/dev/virtio/pci/virtio_pci.c
+++ sys/dev/virtio/pci/virtio_pci.c
@@ -305,21 +305,35 @@
if (pci_find_cap(dev, PCIY_MSI, NULL) != 0)
sc->vtpci_flags |= VTPCI_FLAG_NO_MSI;
+ sc->vtpci_flags |= VTPCI_FLAG_NO_MSIX;
if (pci_find_cap(dev, PCIY_MSIX, NULL) == 0) {
- int table_bar;
+ int table_rid;
+ int msix_load;
+
+ msix_load = 0;
+ rid = table_rid = pci_msix_table_bar(dev);
+
+ if (table_rid != PCIR_BAR(0)) {
+ sc->vtpci_msix_table_res = bus_alloc_resource_any(
+ dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
+ if (sc->vtpci_msix_table_res != NULL)
+ msix_load++;
+ } else
+ msix_load++;
- 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 (rid != table_rid) {
+ sc->vtpci_msix_pba_res = bus_alloc_resource_any(
+ dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
+ if (sc->vtpci_msix_pba_res != NULL)
+ msix_load++;
+ } else
+ msix_load++;
+
+ if (msix_load == 2)
+ sc->vtpci_flags &= ~VTPCI_FLAG_NO_MSIX;
}
- if (sc->vtpci_msix_table_res == NULL)
- sc->vtpci_flags |= VTPCI_FLAG_NO_MSIX;
-
vtpci_reset(sc);
/* Tell the host we've noticed this device. */

File Metadata

Mime Type
text/plain
Expires
Thu, Apr 2, 6:04 AM (11 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30710223
Default Alt Text
D26933.id80724.diff (1 KB)

Event Timeline