[PATCH] doc: announce some raw/ifpga API removal

David Marchand david.marchand at redhat.com
Fri Jul 1 10:09:48 CEST 2022


On Fri, Jul 1, 2022 at 10:02 AM Huang, Wei <wei.huang at intel.com> wrote:
>
>
>
> > -----Original Message-----
> > From: David Marchand <david.marchand at redhat.com>
> > Sent: Friday, July 1, 2022 15:22
> > To: Huang, Wei <wei.huang at intel.com>
> > Cc: Xu, Rosen <rosen.xu at intel.com>; Zhang, Tianfei <tianfei.zhang at intel.com>;
> > dev at dpdk.org; Ray Kinsella <mdr at ashroe.eu>
> > Subject: Re: [PATCH] doc: announce some raw/ifpga API removal
> >
> > On Fri, Jul 1, 2022 at 9:16 AM Huang, Wei <wei.huang at intel.com> wrote:
> > > > What is the PCI bus used for, in this application?
> > > >
> > > In this application, target PCI device is Intel FPGA, it supports some
> > > special operation like removing it from PCI bus and rescanning it back from PCI
> > bus, So there are two things need to be done directly on rte_pci_bus:
> > > 1. Rescan PCI bus
> > >      pci_bus->bus.scan()
> > > 2. Get pci_dev by specified PCI address, and remove it
> > >     TAILQ_FOREACH(pci_dev, &pci_bus->device_list, next) {
> > >         if (!rte_pci_addr_cmp(&pci_dev->addr, &addr))
> > >                 return pci_dev;
> > >     }
> > >     ....
> > >     pci_drv = pci_dev->driver;
> > >     pci_drv->remove(pci_dev);
> >
> > Can't this application use rte_dev_remove and rte_dev_probe?
> > If not, we should add the missing parts in the API.
> >
> Both rte_dev_remove and rte_dev_probe need rte_device pointer. In this application, it only know the device's PCI address, is there an
> existing API to get the rte_pci_device pointer by its PCI address ?

rte_dev_probe takes a devargs string as input.
int rte_dev_probe(const char *devargs);

You need the rte_device for removing which can be retrieved from
rte_rawdev_info_get.

>
> For PCI rescan, I know there is an API called rte_bus_scan(), which seems to be able to replace pci_bus->bus.scan(). But is it reasonable to scan all buses
> when I want to only scan PCI ?
> Why I need to rescan PCI bus, the answer is current PCI scan only add PCI device to rte_pci_bus when it is bound to kernel driver. In our case, a FPGA
> may not bind to any driver, this application bind vfio-pci to it and call bus scan to add it to rte_pci_bus.

Scanning is called on the relevant bus when probing, see local_dev_probe.


-- 
David Marchand



More information about the dev mailing list