On Wed, Jun 28, 2017 at 09:44:18AM +0200, Thomas Monjalon wrote: > 21/06/2017 01:35, Gaetan Rivet: > > Remove the dependency of this subsystem upon bus specific device > > representation. > > > > Devargs only validates that a device declaration is correct and handled > > by a bus. The device interpretation is done afterward within the bus. > > > > Signed-off-by: Gaetan Rivet <gaetan.ri...@6wind.com> > > --- > > app/test-pmd/testpmd.c | 9 ++---- > > lib/librte_eal/common/eal_common_devargs.c | 48 > > +++++------------------------ > > lib/librte_eal/common/eal_common_pci.c | 9 ++++-- > > lib/librte_eal/common/eal_common_vdev.c | 17 +++++----- > > lib/librte_eal/common/include/rte_devargs.h | 16 ++-------- > > lib/librte_eal/common/include/rte_vdev.h | 2 +- > > test/test/test_devargs.c | 9 ++---- > > 7 files changed, 30 insertions(+), 80 deletions(-) > > Is it correct to add this change when rebasing? > > --- a/lib/librte_eal/common/eal_common_pci.c > +++ b/lib/librte_eal/common/eal_common_pci.c > @@ -533,7 +533,7 @@ pci_plug(struct rte_devargs *da) > struct rte_pci_device *pdev; > struct rte_pci_addr *addr; > > - addr = &da->pci.addr; > + da->bus->parse(da->name, &addr); > /* > * Update eventual pci device in global list. > * Insert it if none was found. >
This is the spirit of this API at least :). bus->parse() will verify that the name is correct, as well as interpret it to obtain the bus-specific representation of the device. > > Devargs only validates that a device declaration is correct and handled > > by a bus. The device interpretation is done afterward within the bus. So the PCI address can be removed from rte_devargs. As such, it cannot be intepreted during parsing, and it must be done afterward from within the bus itself. I was wondering whether I should update all subsystems relying on this previous rte_devargs logic at once, EAL + vdev + PCI + tests etc... But this is the only way to keep compilation atomicity between patches. -- Gaëtan Rivet 6WIND