svn commit: r316540 - stable/11/sys/dev/e1000
Sean Bruno
sbruno at FreeBSD.org
Wed Apr 5 19:46:26 UTC 2017
Author: sbruno
Date: Wed Apr 5 19:46:24 2017
New Revision: 316540
URL: https://svnweb.freebsd.org/changeset/base/316540
Log:
Direct commit of fixes to stable/11, resolving PCI passthrough and initialization
issues when trying to passthrough a i340 (igb) to VMware.
While here, cleanup some bits of em(4) to DTRT as well.
PR: 218113
Submitted by: Kaho Toshikazu <kaho at elam.kais.kyoto-u.ac.jp>
Modified:
stable/11/sys/dev/e1000/if_em.c
stable/11/sys/dev/e1000/if_em.h
stable/11/sys/dev/e1000/if_igb.c
Modified: stable/11/sys/dev/e1000/if_em.c
==============================================================================
--- stable/11/sys/dev/e1000/if_em.c Wed Apr 5 19:33:04 2017 (r316539)
+++ stable/11/sys/dev/e1000/if_em.c Wed Apr 5 19:46:24 2017 (r316540)
@@ -2800,7 +2800,7 @@ em_free_pci_resources(struct adapter *ad
if (adapter->msix_mem != NULL)
bus_release_resource(dev, SYS_RES_MEMORY,
- PCIR_BAR(EM_MSIX_BAR), adapter->msix_mem);
+ adapter->memrid, adapter->msix_mem);
if (adapter->memory != NULL)
bus_release_resource(dev, SYS_RES_MEMORY,
@@ -2834,9 +2834,9 @@ em_setup_msix(struct adapter *adapter)
em_enable_vectors_82574(adapter);
#endif
/* Map the MSIX BAR */
- int rid = PCIR_BAR(EM_MSIX_BAR);
+ adapter->memrid = PCIR_BAR(EM_MSIX_BAR);
adapter->msix_mem = bus_alloc_resource_any(dev,
- SYS_RES_MEMORY, &rid, RF_ACTIVE);
+ SYS_RES_MEMORY, &adapter->memrid, RF_ACTIVE);
if (adapter->msix_mem == NULL) {
/* May not be enabled */
device_printf(adapter->dev,
@@ -2887,7 +2887,7 @@ msix_one:
msi:
if (adapter->msix_mem != NULL) {
bus_release_resource(dev, SYS_RES_MEMORY,
- PCIR_BAR(EM_MSIX_BAR), adapter->msix_mem);
+ adapter->memrid, adapter->msix_mem);
adapter->msix_mem = NULL;
}
val = 1;
Modified: stable/11/sys/dev/e1000/if_em.h
==============================================================================
--- stable/11/sys/dev/e1000/if_em.h Wed Apr 5 19:33:04 2017 (r316539)
+++ stable/11/sys/dev/e1000/if_em.h Wed Apr 5 19:46:24 2017 (r316540)
@@ -400,6 +400,7 @@ struct adapter {
struct resource *memory;
struct resource *flash;
struct resource *msix_mem;
+ int memrid;
struct resource *res;
void *tag;
Modified: stable/11/sys/dev/e1000/if_igb.c
==============================================================================
--- stable/11/sys/dev/e1000/if_igb.c Wed Apr 5 19:33:04 2017 (r316539)
+++ stable/11/sys/dev/e1000/if_igb.c Wed Apr 5 19:46:24 2017 (r316540)
@@ -2901,7 +2901,7 @@ igb_setup_msix(struct adapter *adapter)
msi:
if (adapter->msix_mem != NULL) {
bus_release_resource(dev, SYS_RES_MEMORY,
- PCIR_BAR(IGB_MSIX_BAR), adapter->msix_mem);
+ adapter->memrid, adapter->msix_mem);
adapter->msix_mem = NULL;
}
msgs = 1;
More information about the svn-src-all
mailing list