From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <bugzilla@dpdk.org>
Received: by dpdk.org (Postfix, from userid 33)
 id EC5024C99; Mon, 27 Aug 2018 07:43:49 +0200 (CEST)
From: bugzilla@dpdk.org
To: dev@dpdk.org
Date: Mon, 27 Aug 2018 05:43:49 +0000
X-Bugzilla-Reason: AssignedTo
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: DPDK
X-Bugzilla-Component: core
X-Bugzilla-Version: 17.11
X-Bugzilla-Keywords: 
X-Bugzilla-Severity: major
X-Bugzilla-Who: geoffrey.lv@gmail.com
X-Bugzilla-Status: CONFIRMED
X-Bugzilla-Resolution: 
X-Bugzilla-Priority: Normal
X-Bugzilla-Assigned-To: dev@dpdk.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags: 
X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform
 op_sys bug_status bug_severity priority component assigned_to reporter
 target_milestone
Message-ID: <bug-85-3@http.bugs.dpdk.org/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://bugs.dpdk.org/
Auto-Submitted: auto-generated
X-Auto-Response-Suppress: All
MIME-Version: 1.0
Subject: [dpdk-dev] [Bug 85] pci_scan_one() issue
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 27 Aug 2018 05:43:50 -0000

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

            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 =3D dev->kdrv;
                                dev2->max_vfs =3D dev->max_vfs;
                                pci_name_set(dev2);
                                memmove(dev2->mem_resource, dev->mem_resour=
ce,
                                        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 overwritt=
en
here.=20

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.

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