]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_eal/common/eal_common_pci.c
pci: allow to override sysfs path
[dpdk.git] / lib / librte_eal / common / eal_common_pci.c
index 3cae4cbe24eadf5ddb857bd89fd5586d6af352a0..0ec3b610c35008ce8ca42e243bc481b4d548f6cf 100644 (file)
 struct pci_driver_list pci_driver_list;
 struct pci_device_list pci_device_list;
 
+#define SYSFS_PCI_DEVICES "/sys/bus/pci/devices"
+
+const char *pci_get_sysfs_path(void)
+{
+       const char *path = NULL;
+
+       path = getenv("SYSFS_PCI_DEVICES");
+       if (path == NULL)
+               return SYSFS_PCI_DEVICES;
+
+       return path;
+}
+
 static struct rte_devargs *pci_devargs_lookup(struct rte_pci_device *dev)
 {
        struct rte_devargs *devargs;