4 * Copyright(c) 2010-2013 Intel Corporation. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of Intel Corporation nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42 #include <sys/types.h>
49 #include <sys/queue.h>
51 #include <sys/ioctl.h>
53 #include <rte_interrupts.h>
56 #include <rte_common.h>
57 #include <rte_launch.h>
58 #include <rte_memory.h>
59 #include <rte_memzone.h>
60 #include <rte_tailq.h>
62 #include <rte_eal_memconfig.h>
63 #include <rte_per_lcore.h>
64 #include <rte_lcore.h>
65 #include <rte_malloc.h>
66 #include <rte_string_fns.h>
67 #include <rte_debug.h>
69 #include "eal_filesystem.h"
70 #include "eal_private.h"
74 * PCI probing under linux
76 * This code is used to simulate a PCI probe by parsing information in
77 * sysfs. Moreover, when a registered driver matches a device, the
78 * kernel driver currently using it is unloaded and replaced by
79 * igb_uio module, which is a very minimal userland driver for Intel
80 * network card, only providing access to PCI BAR to applications, and
81 * enabling bus master.
85 #define PROC_MODULES "/proc/modules"
87 #define IGB_UIO_NAME "igb_uio"
89 #define UIO_DRV_PATH "/sys/bus/pci/drivers/%s"
91 /* maximum time to wait that /dev/uioX appears */
92 #define UIO_DEV_WAIT_TIMEOUT 3 /* seconds */
95 * For multi-process we need to reproduce all PCI mappings in secondary
96 * processes, so save them in a tailq.
99 TAILQ_ENTRY(uio_resource) next;
101 struct rte_pci_addr pci_addr;
105 unsigned long offset;
108 TAILQ_HEAD(uio_res_list, uio_resource);
110 static struct uio_res_list *uio_res_list = NULL;
113 * Check that a kernel module is loaded. Returns 0 on success, or if the
114 * parameter is NULL, or -1 if the module is not loaded.
117 pci_uio_check_module(const char *module_name)
123 if (module_name == NULL)
126 f = fopen(PROC_MODULES, "r");
128 RTE_LOG(ERR, EAL, "Cannot open "PROC_MODULES": %s\n",
133 while(fgets(buf, sizeof(buf), f) != NULL) {
135 for (i = 0; i < sizeof(buf) && buf[i] != '\0'; i++) {
140 if (strncmp(buf, module_name, sizeof(buf)) == 0) {
149 /* bind a PCI to the kernel module driver */
151 pci_bind_device(struct rte_pci_device *dev, char dr_path[])
156 char dev_bind[PATH_MAX];
157 struct rte_pci_addr *loc = &dev->addr;
159 RTE_LOG(DEBUG, EAL, "bind PCI device "PCI_PRI_FMT"\n",
160 loc->domain, loc->bus, loc->devid, loc->function);
162 n = rte_snprintf(dev_bind, sizeof(dev_bind), "%s/bind", dr_path);
163 if ((n < 0) || (n >= (int)sizeof(buf))) {
164 RTE_LOG(ERR, EAL, "Cannot rte_snprintf device bind path\n");
168 f = fopen(dev_bind, "w");
170 RTE_LOG(ERR, EAL, "Cannot open %s\n", dev->previous_dr);
173 n = rte_snprintf(buf, sizeof(buf), PCI_PRI_FMT "\n",
174 loc->domain, loc->bus, loc->devid, loc->function);
175 if ((n < 0) || (n >= (int)sizeof(buf))) {
176 RTE_LOG(ERR, EAL, "Cannot rte_snprintf PCI infos\n");
180 if (fwrite(buf, n, 1, f) == 0) {
185 RTE_LOG(DEBUG, EAL, "Device bound\n");
192 pci_uio_bind_device(struct rte_pci_device *dev, const char *module_name)
197 char uio_newid[PATH_MAX];
198 char uio_bind[PATH_MAX];
200 n = rte_snprintf(uio_newid, sizeof(uio_newid), UIO_DRV_PATH "/new_id", module_name);
201 if ((n < 0) || (n >= (int)sizeof(uio_newid))) {
202 RTE_LOG(ERR, EAL, "Cannot rte_snprintf uio_newid name\n");
206 n = rte_snprintf(uio_bind, sizeof(uio_bind), UIO_DRV_PATH, module_name);
207 if ((n < 0) || (n >= (int)sizeof(uio_bind))) {
208 RTE_LOG(ERR, EAL, "Cannot rte_snprintf uio_bind name\n");
212 n = rte_snprintf(buf, sizeof(buf), "%x %x\n",
213 dev->id.vendor_id, dev->id.device_id);
214 if ((n < 0) || (n >= (int)sizeof(buf))) {
215 RTE_LOG(ERR, EAL, "Cannot rte_snprintf vendor_id/device_id\n");
219 f = fopen(uio_newid, "w");
221 RTE_LOG(ERR, EAL, "Cannot open %s\n", uio_newid);
224 if (fwrite(buf, n, 1, f) == 0) {
230 pci_bind_device(dev, uio_bind);
235 /* map a particular resource from a file */
237 pci_map_resource(struct rte_pci_device *dev, void *requested_addr, const char *devname,
238 unsigned long offset, unsigned long size)
245 * open devname, and mmap it: it can take some time to
246 * appear, so we wait some time before returning an error
248 for (n=0; n<UIO_DEV_WAIT_TIMEOUT*10; n++) {
249 fd = open(devname, O_RDWR);
257 RTE_LOG(ERR, EAL, "Cannot open %s: %s\n", devname, strerror(errno));
261 /* Map the PCI memory resource of device */
262 mapaddr = mmap(requested_addr, size, PROT_READ | PROT_WRITE,
263 MAP_SHARED, fd, offset);
264 if (mapaddr == MAP_FAILED ||
265 (requested_addr != NULL && mapaddr != requested_addr)) {
266 RTE_LOG(ERR, EAL, "%s(): cannot mmap %s: %s\n", __func__,
267 devname, strerror(errno));
271 if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
272 /* save fd if in primary process */
273 dev->intr_handle.fd = fd;
274 dev->intr_handle.type = RTE_INTR_HANDLE_UIO;
276 /* fd is not needed in slave process, close it */
277 dev->intr_handle.fd = -1;
278 dev->intr_handle.type = RTE_INTR_HANDLE_UNKNOWN;
282 RTE_LOG(DEBUG, EAL, "PCI memory mapped at %p\n", mapaddr);
287 dev->intr_handle.fd = -1;
288 dev->intr_handle.type = RTE_INTR_HANDLE_UNKNOWN;
292 /* map the PCI resource of a PCI device in virtual memory */
294 pci_uio_map_resource(struct rte_pci_device *dev)
298 char dirname[PATH_MAX];
299 char dirname2[PATH_MAX];
300 char filename[PATH_MAX];
301 char devname[PATH_MAX]; /* contains the /dev/uioX */
304 unsigned long size, offset;
305 struct rte_pci_addr *loc = &dev->addr;
306 struct uio_resource *uio_res;
308 RTE_LOG(DEBUG, EAL, "map PCI resource for device "PCI_PRI_FMT"\n",
309 loc->domain, loc->bus, loc->devid, loc->function);
311 /* secondary processes - use already recorded details */
312 if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
314 TAILQ_FOREACH(uio_res, uio_res_list, next) {
315 /* skip this element if it doesn't match our PCI address */
316 if (memcmp(&uio_res->pci_addr, &dev->addr, sizeof(dev->addr)))
319 if (pci_map_resource(dev, uio_res->addr, uio_res->path, \
320 uio_res->offset, uio_res->size) == uio_res->addr)
323 RTE_LOG(ERR, EAL, "Cannot mmap device resource\n");
327 RTE_LOG(ERR, EAL, "Cannot find resource for device\n");
331 /* depending on kernel version, uio can be located in uio/uioX
334 rte_snprintf(dirname, sizeof(dirname),
335 "/sys/bus/pci/devices/" PCI_PRI_FMT "/uio",
336 loc->domain, loc->bus, loc->devid, loc->function);
338 dir = opendir(dirname);
340 /* retry with the parent directory */
341 rte_snprintf(dirname, sizeof(dirname),
342 "/sys/bus/pci/devices/" PCI_PRI_FMT,
343 loc->domain, loc->bus, loc->devid, loc->function);
344 dir = opendir(dirname);
347 RTE_LOG(ERR, EAL, "Cannot opendir %s\n", dirname);
352 /* take the first file starting with "uio" */
353 while ((e = readdir(dir)) != NULL) {
354 int shortprefix_len = sizeof("uio") - 1; /* format could be uio%d ...*/
355 int longprefix_len = sizeof("uio:uio") - 1; /* ... or uio:uio%d */
358 if (strncmp(e->d_name, "uio", 3) != 0)
361 /* first try uio%d */
363 uio_num = strtoull(e->d_name + shortprefix_len, &endptr, 10);
364 if (errno == 0 && endptr != e->d_name) {
365 rte_snprintf(dirname2, sizeof(dirname2),
366 "%s/uio%u", dirname, uio_num);
370 /* then try uio:uio%d */
372 uio_num = strtoull(e->d_name + longprefix_len, &endptr, 10);
373 if (errno == 0 && endptr != e->d_name) {
374 rte_snprintf(dirname2, sizeof(dirname2),
375 "%s/uio:uio%u", dirname, uio_num);
381 /* No uio resource found */
385 /* get mapping offset */
386 rte_snprintf(filename, sizeof(filename),
387 "%s/maps/map0/offset", dirname2);
388 if (eal_parse_sysfs_value(filename, &offset) < 0) {
389 RTE_LOG(ERR, EAL, "%s(): cannot parse offset\n",
394 /* get mapping size */
395 rte_snprintf(filename, sizeof(filename),
396 "%s/maps/map0/size", dirname2);
397 if (eal_parse_sysfs_value(filename, &size) < 0) {
398 RTE_LOG(ERR, EAL, "%s(): cannot parse size\n",
403 /* open and mmap /dev/uioX */
404 rte_snprintf(devname, sizeof(devname), "/dev/uio%u", uio_num);
405 mapaddr = pci_map_resource(dev, NULL, devname, offset, size);
408 dev->mem_resource.addr = mapaddr;
410 /* save the mapping details for secondary processes*/
411 uio_res = rte_malloc("UIO_RES", sizeof(*uio_res), 0);
412 if (uio_res == NULL) {
413 RTE_LOG(ERR, EAL, "%s(): cannot store uio mmap details\n", __func__);
416 uio_res->addr = mapaddr;
417 uio_res->offset = offset;
418 uio_res->size = size;
419 rte_snprintf(uio_res->path, sizeof(uio_res->path), "%s", devname);
420 memcpy(&uio_res->pci_addr, &dev->addr, sizeof(uio_res->pci_addr));
422 TAILQ_INSERT_TAIL(uio_res_list, uio_res, next);
427 /* parse the "resource" sysfs file */
428 #define IORESOURCE_MEM 0x00000200
431 pci_parse_sysfs_resource(const char *filename, struct rte_pci_device *dev)
435 union pci_resource_info {
441 char *ptrs[PCI_RESOURCE_FMT_NVAL];
444 uint64_t phys_addr, end_addr, flags;
446 f = fopen(filename, "r");
448 RTE_LOG(ERR, EAL, "Cannot open sysfs resource\n");
452 for (i = 0; i<PCI_MAX_RESOURCE; i++) {
454 if (fgets(buf, sizeof(buf), f) == NULL) {
455 RTE_LOG(ERR, EAL, "%s(): cannot read resource\n", __func__);
459 if (rte_strsplit(buf, sizeof(buf), res_info.ptrs, 3, ' ') != 3) {
460 RTE_LOG(ERR, EAL, "%s(): bad resource format\n", __func__);
464 phys_addr = strtoull(res_info.phys_addr, NULL, 16);
465 end_addr = strtoull(res_info.end_addr, NULL, 16);
466 flags = strtoull(res_info.flags, NULL, 16);
468 RTE_LOG(ERR, EAL, "%s(): bad resource format\n", __func__);
472 if (flags & IORESOURCE_MEM) {
473 dev->mem_resource.phys_addr = phys_addr;
474 dev->mem_resource.len = end_addr - phys_addr + 1;
475 dev->mem_resource.addr = NULL; /* not mapped for now */
488 /* Compare two PCI device addresses. */
490 pci_addr_comparison(struct rte_pci_addr *addr, struct rte_pci_addr *addr2)
492 uint64_t dev_addr = (addr->domain << 24) + (addr->bus << 16) + (addr->devid << 8) + addr->function;
493 uint64_t dev_addr2 = (addr2->domain << 24) + (addr2->bus << 16) + (addr2->devid << 8) + addr2->function;
495 if (dev_addr > dev_addr2)
502 /* Scan one pci sysfs entry, and fill the devices list from it. */
504 pci_scan_one(const char *dirname, uint16_t domain, uint8_t bus,
505 uint8_t devid, uint8_t function)
507 char filename[PATH_MAX];
509 struct rte_pci_device *dev;
511 dev = malloc(sizeof(*dev));
516 memset(dev, 0, sizeof(*dev));
517 dev->addr.domain = domain;
519 dev->addr.devid = devid;
520 dev->addr.function = function;
523 rte_snprintf(filename, sizeof(filename), "%s/vendor", dirname);
524 if (eal_parse_sysfs_value(filename, &tmp) < 0) {
528 dev->id.vendor_id = (uint16_t)tmp;
531 rte_snprintf(filename, sizeof(filename), "%s/device", dirname);
532 if (eal_parse_sysfs_value(filename, &tmp) < 0) {
536 dev->id.device_id = (uint16_t)tmp;
538 /* get subsystem_vendor id */
539 rte_snprintf(filename, sizeof(filename), "%s/subsystem_vendor",
541 if (eal_parse_sysfs_value(filename, &tmp) < 0) {
545 dev->id.subsystem_vendor_id = (uint16_t)tmp;
547 /* get subsystem_device id */
548 rte_snprintf(filename, sizeof(filename), "%s/subsystem_device",
550 if (eal_parse_sysfs_value(filename, &tmp) < 0) {
554 dev->id.subsystem_device_id = (uint16_t)tmp;
556 /* parse resources */
557 rte_snprintf(filename, sizeof(filename), "%s/resource", dirname);
558 if (pci_parse_sysfs_resource(filename, dev) < 0) {
559 RTE_LOG(ERR, EAL, "%s(): cannot parse resource\n", __func__);
564 /* device is valid, add in list (sorted) */
565 if (TAILQ_EMPTY(&device_list)) {
566 TAILQ_INSERT_TAIL(&device_list, dev, next);
569 struct rte_pci_device *dev2 = NULL;
571 TAILQ_FOREACH(dev2, &device_list, next) {
572 if (pci_addr_comparison(&dev->addr, &dev2->addr))
575 TAILQ_INSERT_BEFORE(dev2, dev, next);
579 TAILQ_INSERT_TAIL(&device_list, dev, next);
586 * split up a pci address into its constituent parts.
589 parse_pci_addr_format(const char *buf, int bufsize, uint16_t *domain,
590 uint8_t *bus, uint8_t *devid, uint8_t *function)
592 /* first split on ':' */
600 char *str[PCI_FMT_NVAL]; /* last element-separator is "." not ":" */
603 char *buf_copy = strndup(buf, bufsize);
604 if (buf_copy == NULL)
607 if (rte_strsplit(buf_copy, bufsize, splitaddr.str, PCI_FMT_NVAL, ':')
610 /* final split is on '.' between devid and function */
611 splitaddr.function = strchr(splitaddr.devid,'.');
612 if (splitaddr.function == NULL)
614 *splitaddr.function++ = '\0';
616 /* now convert to int values */
618 *domain = (uint8_t)strtoul(splitaddr.domain, NULL, 16);
619 *bus = (uint8_t)strtoul(splitaddr.bus, NULL, 16);
620 *devid = (uint8_t)strtoul(splitaddr.devid, NULL, 16);
621 *function = (uint8_t)strtoul(splitaddr.function, NULL, 10);
625 free(buf_copy); /* free the copy made with strdup */
633 * Scan the content of the PCI bus, and the devices in the devices
641 char dirname[PATH_MAX];
643 uint8_t bus, devid, function;
645 dir = opendir(SYSFS_PCI_DEVICES);
647 RTE_LOG(ERR, EAL, "%s(): opendir failed: %s\n",
648 __func__, strerror(errno));
652 while ((e = readdir(dir)) != NULL) {
653 if (e->d_name[0] == '.')
656 if (parse_pci_addr_format(e->d_name, sizeof(e->d_name), &domain,
657 &bus, &devid, &function) != 0)
660 rte_snprintf(dirname, sizeof(dirname), "%s/%s", SYSFS_PCI_DEVICES,
662 if (pci_scan_one(dirname, domain, bus, devid, function) < 0)
673 /* unbind kernel driver for this device */
675 pci_unbind_kernel_driver(struct rte_pci_device *dev)
679 char filename[PATH_MAX];
681 struct rte_pci_addr *loc = &dev->addr;
683 /* open /sys/bus/pci/devices/AAAA:BB:CC.D/driver */
684 rte_snprintf(filename, sizeof(filename),
685 SYSFS_PCI_DEVICES "/" PCI_PRI_FMT "/driver/unbind",
686 loc->domain, loc->bus, loc->devid, loc->function);
688 RTE_LOG(DEBUG, EAL, "unbind kernel driver %s\n", filename);
690 f = fopen(filename, "w");
691 if (f == NULL) /* device was not bound */
694 n = rte_snprintf(buf, sizeof(buf), PCI_PRI_FMT "\n",
695 loc->domain, loc->bus, loc->devid, loc->function);
696 if ((n < 0) || (n >= (int)sizeof(buf))) {
697 RTE_LOG(ERR, EAL, "%s(): rte_snprintf failed\n", __func__);
700 if (fwrite(buf, n, 1, f) == 0) {
701 RTE_LOG(ERR, EAL, "%s(): could not write to %s\n", __func__,
715 pci_exit_process(struct rte_pci_device *dev)
717 if (munmap(dev->mem_resource.addr, dev->mem_resource.len) == -1){
718 RTE_LOG(ERR, EAL, "Error with munmap\n");
721 if (close(dev->intr_handle.fd) == -1){
722 RTE_LOG(ERR, EAL, "Error closing interrupt handle\n");
725 if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
726 if (pci_unbind_kernel_driver(dev) < 0){
727 RTE_LOG(ERR, EAL, "Error unbinding\n");
730 if (pci_bind_device(dev, dev->previous_dr) < 0){
731 RTE_LOG(ERR, EAL, "Error binding\n");
740 pci_get_previous_driver_path(struct rte_pci_device *dev)
743 char dev_path[PATH_MAX];
744 char dr_path[PATH_MAX];
745 struct rte_pci_addr *loc = &dev->addr;
747 n = rte_snprintf(dev_path, sizeof(dev_path), SYSFS_PCI_DEVICES "/"
748 PCI_PRI_FMT "/driver", loc->domain, loc->bus, loc->devid, loc->function );
749 if ((n < 0) || (n >= (int)sizeof(dev_path)))
750 RTE_LOG(ERR, EAL, "Cannot rte_snprintf device filepath\n");
752 n = readlink(dev_path, dr_path, sizeof(dr_path));
753 if ((n < 0) || (n >= (int)sizeof(dr_path))){
754 RTE_LOG(ERR, EAL, "Cannot readlink driver filepath\n");
755 dev->previous_dr[0] = '\0';
760 if (dr_path[0] != '/')
761 n = rte_snprintf(dev->previous_dr, sizeof(dev->previous_dr),
762 SYSFS_PCI_DEVICES "/" PCI_PRI_FMT "/%s",
763 loc->domain, loc->bus, loc->devid, loc->function, dr_path);
765 n = rte_snprintf(dev->previous_dr, sizeof(dev->previous_dr),
767 if ((n < 0) || (n >= (int)sizeof(dev_path)))
768 RTE_LOG(ERR, EAL, "Cannot rte_snprintf driver filepath\n");
772 * If vendor/device ID match, call the devinit() function of the
776 rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *dev)
778 struct rte_pci_id *id_table;
779 const char *module_name = NULL;
782 if (dr->drv_flags & RTE_PCI_DRV_NEED_IGB_UIO)
783 module_name = IGB_UIO_NAME;
785 for (id_table = dr->id_table ; id_table->vendor_id != 0; id_table++) {
787 /* check if device's identifiers match the driver's ones */
788 if (id_table->vendor_id != dev->id.vendor_id &&
789 id_table->vendor_id != PCI_ANY_ID)
791 if (id_table->device_id != dev->id.device_id &&
792 id_table->device_id != PCI_ANY_ID)
794 if (id_table->subsystem_vendor_id != dev->id.subsystem_vendor_id &&
795 id_table->subsystem_vendor_id != PCI_ANY_ID)
797 if (id_table->subsystem_device_id != dev->id.subsystem_device_id &&
798 id_table->subsystem_device_id != PCI_ANY_ID)
801 RTE_LOG(DEBUG, EAL, "probe driver: %x:%x %s\n", dev->id.vendor_id,
802 dev->id.device_id, dr->name);
804 /* reference driver structure */
807 /* no initialization when blacklisted, return without error */
808 if (dev->blacklisted)
811 /* Unbind PCI devices if needed */
812 if (module_name != NULL) {
814 if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
815 /* check that our driver is loaded */
816 if (uio_status != 0 &&
817 (uio_status = pci_uio_check_module(module_name)) != 0)
818 rte_exit(EXIT_FAILURE, "The %s module is required by the "
819 "%s driver\n", module_name, dr->name);
821 /* unbind current driver, bind ours */
822 pci_get_previous_driver_path(dev);
823 if (pci_unbind_kernel_driver(dev) < 0)
825 if (pci_uio_bind_device(dev, module_name) < 0)
828 /* map the NIC resources */
829 if (pci_uio_map_resource(dev) < 0)
833 /* call the driver devinit() function */
834 return dr->devinit(dr, dev);
839 /*Start the exit process for each dev in use*/
841 rte_eal_pci_exit(void)
843 struct rte_pci_device *dev = NULL;
845 TAILQ_FOREACH(dev, &device_list, next){
846 if (dev->previous_dr[0] == '\0')
848 if(pci_exit_process(dev) == 1)
849 RTE_LOG(ERR, EAL, "Exit process failure\n");
853 /* Init the PCI EAL subsystem */
855 rte_eal_pci_init(void)
857 TAILQ_INIT(&driver_list);
858 TAILQ_INIT(&device_list);
859 uio_res_list = RTE_TAILQ_RESERVE_BY_IDX(RTE_TAILQ_PCI, uio_res_list);
861 /* for debug purposes, PCI can be disabled */
862 if (internal_config.no_pci)
865 if (pci_scan() < 0) {
866 RTE_LOG(ERR, EAL, "%s(): Cannot scan PCI bus\n", __func__);