Re: [PATCH v8 3/9] pci: split match and probe function
From: Shreyansh Jain <hidden>
Date: 2017-01-18 06:17:38
-----Original Message----- From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] Sent: Wednesday, January 18, 2017 5:02 AM To: Shreyansh Jain <redacted> Cc: dev@dpdk.org Subject: Re: [PATCH v8 3/9] pci: split match and probe function 2017-01-17 19:07, Shreyansh Jain:quoted
+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?