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

David Marchand david.marchand at redhat.com
Wed May 31 11:52:53 CEST 2023


(I reformatted the mail a bit)

On Wed, May 31, 2023 at 10:51 AM Elena Agostini <eagostini at nvidia.com> wrote:
> > On Wed, May 31, 2023 at 10:44 AM Elena Agostini eagostini at nvidia.com wrote:
> > > > On Tue, May 30, 2023 at 1:48 PM eagostini at nvidia.com wrote:
> > > > > From: Elena Agostini 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

> > > > 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.
> > > > 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.

> > I am curious. Can you explain why you would need such information?

> Use-case is the Aerial 5G where two processes have to exchange info
> about PCI devices sending messages according to some specific format.

It seems strange that different processes need to exchange this bus
level information.
For dataplane, having a simpler metadata (like a portid maybe?) is
better than a domain/bus/devid/function quartet.
For controlplane, having an abstraction or a human readable string is
probably better too.

In any case, for what you request here, the application can parse the
generic device name into a rte_pci_addr via rte_pci_addr_parse().
Is it not enough?


-- 
David Marchand



More information about the dev mailing list