[dpdk-dev] [PATCH v6 5/8] eal: introduce bus scan and probe in EAL

Thomas Monjalon thomas.monjalon at 6wind.com
Wed Jan 18 00:04:36 CET 2017


2017-01-17 10:33, Shreyansh Jain:
> On Tuesday 17 January 2017 01:28 AM, Ferruh Yigit wrote:
> > On 1/16/2017 3:38 PM, Shreyansh Jain wrote:
> >> +/* Add a PCI device to PCI Bus */
> >> +void
> >> +rte_eal_pci_add_device(struct rte_pci_bus *pci_bus,
> >> +                   struct rte_pci_device *pci_dev)
> >
> > I think more generic approach from previous version was better
> > (rte_eal_bus_add_device()), but I guess they sacrificed for less
> > modification.
> 
> There was a lot of offline discussions after the reviews were posted 
> until v5. From the gist of it, I gathered that smaller 'specific' 
> changes are preferred as compared to complete generic approach without 
> an upfront usecase.

Yes I discussed (a lot) this approach with Shreyansh.

> Also, this change became irrelevant once I moved out the device/driver 
> lists from rte_bus to rte_xxx_bus. This is inline with existing model of 
> (rte_pci_device->rte_device, rte_pci_driver->rte_driver, 
> rte_pci_bus->rte_bus) and having pci_device_list/pci_driver_list private 
> to PCI itself.
> 
> I guess what is going to happen is that in near future when buses start 
> moving to drivers/bus/*, this kind of generic layer would come in.

I think there will be no use case requiring a unique list of all rte_device(s).
Being generic and wrapping stuff with abstract classes is not always a benefit.
That's why, this version is more focused on specialized objects.

Experience with this layering will tell us wether it is a good design or not.


More information about the dev mailing list