From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet Subject: Re: [PATCH v5 12/19] devargs: generic device representation Date: Wed, 28 Jun 2017 10:05:44 +0200 Message-ID: <20170628080544.GF13355@bidouze.vm.6wind.com> References: <3705717.5YLzOZFs93@xps> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org To: Thomas Monjalon Return-path: Received: from mail-wr0-f172.google.com (mail-wr0-f172.google.com [209.85.128.172]) by dpdk.org (Postfix) with ESMTP id 64E6C2BE1 for ; Wed, 28 Jun 2017 10:05:53 +0200 (CEST) Received: by mail-wr0-f172.google.com with SMTP id c11so170297091wrc.3 for ; Wed, 28 Jun 2017 01:05:53 -0700 (PDT) Content-Disposition: inline In-Reply-To: <3705717.5YLzOZFs93@xps> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 > > --- > > 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