From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v11 09/13] pci: add bus driver Date: Wed, 15 Feb 2017 12:20:37 +0100 Message-ID: <3443176.du41bGMhrB@xps13> References: <1484748329-5418-1-git-send-email-shreyansh.jain@nxp.com> <1484801117-779-10-git-send-email-thomas.monjalon@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: Shreyansh Jain , dev@dpdk.org To: Jan Blunck Return-path: Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by dpdk.org (Postfix) with ESMTP id DD87C9E7 for ; Wed, 15 Feb 2017 12:20:39 +0100 (CET) Received: by mail-wm0-f54.google.com with SMTP id v186so39285531wmd.0 for ; Wed, 15 Feb 2017 03:20:39 -0800 (PST) In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2017-02-15 11:42, Jan Blunck: > > /** > > + * Add a PCI device to the PCI Bus (append to PCI Device list). This function > > + * also updates the bus references of the PCI Device (and the generic device > > + * object embedded within. > > + * > > + * @param pci_dev > > + * PCI device to add > > + * @return void > > + */ > > +void rte_eal_pci_add_device(struct rte_pci_device *pci_dev); > > + > > Who would be the user of this? > > From my understanding a device will show up on the bus if: > 1. bus->scan() finds it > 2. bus->attach(devargs) explicitly adds it to the whitelist > > Both methods shouldn't require us to expose the API outside of eal. I agree > > +struct rte_pci_bus rte_pci_bus = { > > + .bus = { > > + .scan = rte_eal_pci_scan, > > + .probe = rte_eal_pci_probe, > > + }, > > + .device_list = TAILQ_HEAD_INITIALIZER(rte_pci_bus.device_list), > > + .driver_list = TAILQ_HEAD_INITIALIZER(rte_pci_bus.driver_list), > > I don't see why this is necessary and I believe it makes people think > we might want to model topology. It's better to keep it simple and > have it locally in eal_common_pci.c. I agree