From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] bus/pci: fix unexpected resource mapping override Date: Sun, 30 Sep 2018 10:52:45 +0200 Message-ID: <384590219.OtUJQTVY6u@xps> References: <20180903084005.29706-1-qi.z.zhang@intel.com> <14389377.uLlNGEYteW@xps> <039ED4275CED7440929022BC67E70611532A7E71@SHSMSX103.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: "dev@dpdk.org" , "Burakov, Anatoly" , "Yigit, Ferruh" , "geoffrey.lv@gmail.com" , "ajit.khaparde@broadcom.com" , "stable@dpdk.org" To: "Zhang, Qi Z" Return-path: In-Reply-To: <039ED4275CED7440929022BC67E70611532A7E71@SHSMSX103.ccr.corp.intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 29/09/2018 08:43, Zhang, Qi Z: > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > > > Hi, > > > > 03/09/2018 10:40, Qi Zhang: > > > When scanning an already plugged device, the virtual address of mapped > > > PCI resource in rte_pci_device will be overridden with 0, that may > > > cause driver does not work correctly. > > > > Why is it overridden with 0? > > Can we try to fix the root cause? > > From my view this is place to fix the issue: "scan an already probed device will corrupt the PCI resource map" > Another option is "to prevent scan an already probed device", this can be implemented by adding some check before bus->scan in rte_dev_hotplug_add but I'm not prefer for this solution, because it's better to keep bus->scan's independency. I don't understand why we are currently changing an already scanned device in pci_scan_one. We could check the PCI address is known at the beginning and stop here, even before allocating a new rte_pci_device. Why trying to override with this memmove?