[dpdk-dev] [PATCH] bus/pci: fix unexpected resource mapping override

Zhang, Qi Z qi.z.zhang at intel.com
Sat Sep 29 08:43:22 CEST 2018



> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas at monjalon.net]
> Sent: Wednesday, September 26, 2018 9:51 PM
> To: Zhang, Qi Z <qi.z.zhang at intel.com>
> Cc: dev at dpdk.org; Burakov, Anatoly <anatoly.burakov at intel.com>; Yigit,
> Ferruh <ferruh.yigit at intel.com>; geoffrey.lv at gmail.com;
> ajit.khaparde at broadcom.com; stable at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] bus/pci: fix unexpected resource mapping
> override
> 
> 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.

> 
> > The fix is not to update any rte_pci_device's field if the being
> > scanned device's driver is already probed.
> 
> I am going to send a patch to have a safer way of checking whether a device is
> probed or not.
> If this change is really needed, I suggest to rebase it on top my patch.

OK, I will rebase on it by using rte_dev_is_probed.

Regards
Qi
> 



More information about the dev mailing list