mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
pci: Set the domain in the pci_generic driver
Tell bus_dma(9) which NUMA domain the PCI driver is closest to so it can allocate memory from there when possible. Reviewed by: markj, jhb Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42186 (cherry picked from commit 7098f3c7569c21ecdfc990772e96a416f1a94eee)
This commit is contained in:
parent
45ffdd4ea5
commit
729576a3d5
1 changed files with 8 additions and 1 deletions
|
|
@ -83,7 +83,7 @@ pci_host_generic_core_attach(device_t dev)
|
|||
uint64_t phys_base;
|
||||
uint64_t pci_base;
|
||||
uint64_t size;
|
||||
int error;
|
||||
int domain, error;
|
||||
int rid, tuple;
|
||||
|
||||
sc = device_get_softc(dev);
|
||||
|
|
@ -104,6 +104,13 @@ pci_host_generic_core_attach(device_t dev)
|
|||
if (error != 0)
|
||||
return (error);
|
||||
|
||||
/*
|
||||
* Attempt to set the domain. If it's missing, or we are unable to
|
||||
* set it then memory allocations may be placed in the wrong domain.
|
||||
*/
|
||||
if (bus_get_domain(dev, &domain) == 0)
|
||||
(void)bus_dma_tag_set_domain(sc->dmat, domain);
|
||||
|
||||
if ((sc->quirks & PCIE_CUSTOM_CONFIG_SPACE_QUIRK) == 0) {
|
||||
rid = 0;
|
||||
sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
|
||||
|
|
|
|||
Loading…
Reference in a new issue