From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [dpdk-stable] [PATCH v2 5/8] pci: use given name as generic name Date: Wed, 12 Jul 2017 00:05:16 +0200 Message-ID: <3649906.Oe0negFerb@xps> References: <846173ac225560e48d665fb1d6d847919694d3e8.1499728330.git.gaetan.rivet@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Gaetan Rivet Return-path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 58AB9374C for ; Wed, 12 Jul 2017 00:05:18 +0200 (CEST) In-Reply-To: <846173ac225560e48d665fb1d6d847919694d3e8.1499728330.git.gaetan.rivet@6wind.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 11/07/2017 01:19, Gaetan Rivet: > The PCI device is referenced by other DPDK systems by the name of its > parameter, not by the system name. I don't understand this sentence. Please give an example. > Moreover, this name should be set once and for all, as early as > possible. This means linking the rte_devargs associated with the PCI > device during its scan, making available other metadatas used afterward > upon probing and device search for plugging. Which other metadatas? Please give an example. [...] > +void > +pci_name_set(struct rte_pci_device *dev) > +{ > + struct rte_devargs *devargs; > + > + rte_pci_device_name(&dev->addr, > + dev->name, sizeof(dev->name)); > + devargs = pci_devargs_lookup(dev); > + dev->device.devargs = devargs; > + if (devargs != NULL) > + dev->device.name = dev->device.devargs->name; > + else > + dev->device.name = dev->name; > +} I think this function deserves some comments. The relation between rte_pci_device_name and pci_devargs_lookup is not obvious. Moreover, this function is not just setting the name: it is also setting the devargs in the rte_device. How dev->device.devargs->name is different from dev->name?