> On Tue, May 30, 2023 at 1:48 PM
eagostini@nvidia.com wrote:
> >
> > From: Elena Agostini
eagostini@nvidia.com
> >
> > In DPDK 22.11 pci bus related structure have been hidden internally
> > so the application doesn't have a direct access to those info anymore.
> >
> > This patch introduces a get function to retrieve a PCI address
> > from an rte_device handler.
> >
> > Signed-off-by: Elena Agostini
eagostini@nvidia.com
>
> (no need to Cc: stable, I removed it)
>
> I would prefer we don't add specific bus API when there is an alternative.
>
> The PCI address is already reported as a string in the generic device
> object name.
> I checked the different ways this name is set and afaics, it is consistent:
> - devarg case
https://git.dpdk.org/dpdk/tree/drivers/bus/pci/pci_common.c#n112
> +
https://git.dpdk.org/dpdk/tree/drivers/bus/pci/pci_params.c#n117
> - no devarg case
>
https://git.dpdk.org/dpdk/tree/drivers/bus/pci/pci_common.c#n115 +
>
https://git.dpdk.org/dpdk/tree/drivers/bus/pci/pci_common.c#n100
>
> Would that be enough for your usecase?
No as I need to parse anyway the PCI address string in the form of domain/bus/devid/function.
DPDK already does it through a well-organized and exposed structure like rte_pci_addr.
Why not to use it?
Also, the device name can be changed as it’s exposed to application level.
>
>
> --
> David Marchand