On Wed, Feb 5, 2025 at 5:44 PM Renyong Wan <wa...@yunsilicon.com> wrote:
> >> That's how we designed it.
> >> We designed a low-level device operations framework named xsc_dev_ops to
> >> support both VFIO drivers and kernel drivers. Each xsc_dev_ops is
> >> registered before the main function runs. During the PCI device probe
> >> phase, the XSC PMD selects the corresponding xsc_dev_ops based on
> >> rte_pci_device->driver, therefore, there is no need for devargs.
> > I don't understand.
> > If both VFIO and the kernel driver are loaded,
> > we'll scan the device twice?
> > Will it be probed 2 times?
> >
> >
> No, it won't probe twice.
> I suppose that each PCI device will only be bound to either the VFIO
> driver or a kernel driver. The drv_flags of the xsc_pmd PCI driver will
> not preset with RTE_PCI_DRV_NEED_MAPPING. Therefore, in the
> rte_pci_probe_one_driver function, rte_pci_map_device() will not be
> called. After entering the probe phase of the xsc PMD PCI driver,
> rte_pci_map_device() will be called in xsc_dev_ops->init() based on
> whether it is a VFIO driver.

(side note, this means that this driver should probably call
rte_pci_unmap_device() in its release path, though I see none)


-- 
David Marchand

Reply via email to