@@ -28,6 +28,7 @@ pci_alloc_dev(struct pci_access *a)
d->access = a;
d->methods = a->methods;
d->hdrtype = -1;
+ d->numa_node = -1;
if (d->methods->init_dev)
d->methods->init_dev(d);
return d;
@@ -127,6 +127,7 @@ struct pci_dev {
u16 vendor_id, device_id; /* Identity of the device */
u16 device_class; /* PCI device class */
int irq; /* IRQ number */
+ int numa_node; /* NUMA node */
pciaddr_t base_addr[6]; /* Base addresses including flags in lower bits */
pciaddr_t size[6]; /* Region sizes */
pciaddr_t rom_base_addr; /* Expansion ROM base address */
@@ -192,6 +192,7 @@ static void sysfs_scan(struct pci_access *a)
{
sysfs_get_resources(d);
d->irq = sysfs_get_value(d, "irq");
+ d->numa_node = sysfs_get_value(d, "numa_node");
/*
* We could read these faster from the config registers, but we want to give
* the kernel a chance to fix up ID's and especially classes of broken devices.
@@ -757,6 +757,8 @@ show_verbose(struct device *d)
printf(", latency %d", latency);
if (irq)
printf(", IRQ " PCIIRQ_FMT, irq);
+ if (p->numa_node != -1)
+ printf(", NUMA node %d", p->numa_node);
putchar('\n');
}