[dpdk-dev] [PATCH v8 3/9] pci: split match and probe function

Shreyansh Jain shreyansh.jain at nxp.com
Wed Jan 18 07:17:24 CET 2017


> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> Sent: Wednesday, January 18, 2017 5:02 AM
> To: Shreyansh Jain <shreyansh.jain at nxp.com>
> Cc: dev at dpdk.org
> Subject: Re: [PATCH v8 3/9] pci: split match and probe function
> 
> 2017-01-17 19:07, Shreyansh Jain:
> > +static int
> > +rte_eal_pci_detach_dev(struct rte_pci_driver *dr,
> > +               struct rte_pci_device *dev)
> > +{
> > +       int ret;
> > +       struct rte_pci_addr *loc;
> > +
> > +       if ((dr == NULL) || (dev == NULL))
> > +               return -EINVAL;
> > +
> > +       ret = rte_pci_match(dr, dev);
> 
> I do not understand this function.
> The driver should be known by the device at this stage.
> Why specifying a driver as parameter?
> 
> I know it is not new in this series, but
> pci_detach_all_drivers(struct rte_pci_device *dev) makes no sense to me.

>From what I understand, pci_detach_all_drivers is simply a wrapper over the PCI driver list, calling rte_eal_pci_detach_dev for each driver. Considering that all it does is iterate, it is not functionally required.

But, let me clarify one more thing: There is a possibility that rte_pci_device->pci_driver be directly used in case of detach rather than searching for a driver. This is assuming that before 'detach', a pci_device would link to a valid pci_driver. Is there some caveat in this assumption?


More information about the dev mailing list