[dpdk-dev] [dpdk-stable] [PATCH v2 5/8] pci: use given name as generic name

Thomas Monjalon thomas at monjalon.net
Wed Jul 12 00:05:16 CEST 2017


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?


More information about the dev mailing list