diff options
author | Damjan Marion <damarion@cisco.com> | 2019-01-07 20:56:04 +0100 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2019-01-07 21:57:17 +0000 |
commit | d2bfb78f4f8fbfae204424467a4106530b89e608 (patch) | |
tree | ef7f5c75f313c973eed5b441646d6898c717198a /src/vlib/linux | |
parent | 7c03ed47d5acfa39820f9553999caa01cf47dba4 (diff) |
avf: allocate descriptor memory from local numa
Change-Id: Ic56ee4ce83b282a5f0f5aed500721fe639b941b3
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/linux')
-rw-r--r-- | src/vlib/linux/pci.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vlib/linux/pci.c b/src/vlib/linux/pci.c index ed43580ffc0..b99f54f2a62 100644 --- a/src/vlib/linux/pci.c +++ b/src/vlib/linux/pci.c @@ -97,6 +97,7 @@ typedef struct linux_pci_device_type_t type; vlib_pci_dev_handle_t handle; vlib_pci_addr_t addr; + u32 numa_node; /* Resource file descriptors. */ linux_pci_region_t *regions; @@ -165,6 +166,13 @@ vlib_pci_get_addr (vlib_main_t * vm, vlib_pci_dev_handle_t h) return &d->addr; } +u32 +vlib_pci_get_numa_node (vlib_main_t * vm, vlib_pci_dev_handle_t h) +{ + linux_pci_device_t *d = linux_pci_get_device (h); + return d->numa_node; +} + /* Call to allocate/initialize the pci subsystem. This is not an init function so that users can explicitly enable pci only when it's needed. */ @@ -1210,6 +1218,7 @@ vlib_pci_device_open (vlib_main_t * vm, vlib_pci_addr_t * addr, p->handle = p - lpm->linux_pci_devices; p->addr.as_u32 = di->addr.as_u32; p->intx_irq.fd = -1; + p->numa_node = di->numa_node; /* * pci io bar read/write fd */ |