DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [Bug 85] pci_scan_one() issue
@ 2018-08-27  5:43 bugzilla
  0 siblings, 0 replies; only message in thread
From: bugzilla @ 2018-08-27  5:43 UTC (permalink / raw)
  To: dev

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@dpdk.org
          Reporter: geoffrey.lv@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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-08-27  5:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-27  5:43 [dpdk-dev] [Bug 85] pci_scan_one() issue bugzilla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).