[PATCH v1] bus/pci: get PCI address from rte_device

Elena Agostini eagostini at nvidia.com
Wed May 31 10:44:16 CEST 2023


> On Tue, May 30, 2023 at 1:48 PM eagostini at nvidia.com<mailto:eagostini at nvidia.com> wrote:
> >
> > From: Elena Agostini eagostini at nvidia.com<mailto:eagostini at 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 at nvidia.com<mailto:eagostini at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/dev/attachments/20230531/e4d40646/attachment.htm>


More information about the dev mailing list