nova-core does not yet support PCIe Virtual Functions (VFs). Until it does, declare to the Rust PCI driver core that VFs are not supported.
Because the Rust PCI driver core defaults to Driver::SUPPORTS_VF = false, this change is not strictly necessary for functionality. Its purpose is to provide a self-documentating line of code that can be easily changed, when VF support is being added. Cc: Alexandre Courbot <[email protected]> Cc: Alistair Popple <[email protected]> Cc: Joel Fernandes <[email protected]> Cc: Zhi Wang <[email protected]> Cc: Alex Williamson <[email protected]> Cc: Jason Gunthorpe <[email protected]> Suggested-by: Danilo Krummrich <[email protected]> Signed-off-by: John Hubbard <[email protected]> --- drivers/gpu/nova-core/driver.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/nova-core/driver.rs b/drivers/gpu/nova-core/driver.rs index 5d23a91f51dd..4c19b0067862 100644 --- a/drivers/gpu/nova-core/driver.rs +++ b/drivers/gpu/nova-core/driver.rs @@ -51,6 +51,11 @@ impl pci::Driver for NovaCore { type IdInfo = (); const ID_TABLE: pci::IdTable<Self::IdInfo> = &PCI_TABLE; + // PCI probe() will report the same device ID for a PF and its associated VFs. This will cause + // failures when trying to bind to the VFs, until NovaCore adds support to handle that + // situation. Until then, tell the PCI driver core that we don't support VFs. + const SUPPORTS_VF: bool = false; + fn probe(pdev: &pci::Device<Core>, _info: &Self::IdInfo) -> Result<Pin<KBox<Self>>> { dev_dbg!(pdev.as_ref(), "Probe Nova Core GPU driver.\n"); -- 2.51.0
