[dpdk-dev] [Bug 85] pci_scan_one() issue

bugzilla at dpdk.org bugzilla at dpdk.org
Mon Aug 27 07:43:49 CEST 2018


https://bugs.dpdk.org/show_bug.cgi?id=85

            Bug ID: 85
           Summary: pci_scan_one() issue
           Product: DPDK
           Version: 17.11
          Hardware: All
                OS: Linux
            Status: CONFIRMED
          Severity: major
          Priority: Normal
         Component: core
          Assignee: dev at dpdk.org
          Reporter: geoffrey.lv at gmail.com
  Target Milestone: ---

/* Scan one pci sysfs entry, and fill the devices list from it. */
static int
pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)

This function is at drivers/bus/pci/linux/pci.c, and please refer to below
code:

                        } else { /* already registered */
                                dev2->kdrv = dev->kdrv;
                                dev2->max_vfs = dev->max_vfs;
                                pci_name_set(dev2);
                                memmove(dev2->mem_resource, dev->mem_resource,
                                        sizeof(dev->mem_resource));
                                free(dev);
                        }
If this device is already registered, this function will replace the
mem_resource.
But some devices need to map the PCI resource of a PCI device in virtual
memory, which means dev2->mem_resource[i].addr is not 0, and it's overwritten
here. 

When we attach a new device, calling sequence is:
rte_eth_dev_attach()->rte_eal_hotplug_add()->rte_pci_scan()->pci_scan_one()
For already registered devices, mem_resource[i].addr is set to 0, and DPDK will
not invoke rte_pci_map_device() for these devices.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the dev mailing list