Jason Gunthorpe
2025-Oct-02 12:11 UTC
[PATCH v2 1/2] rust: pci: skip probing VFs if driver doesn't support VFs
On Wed, Oct 01, 2025 at 07:00:09PM -0700, John Hubbard wrote:> Add a "supports_vf" flag to struct pci_driver to let drivers declare > Virtual Function (VF) support. If a driver does not support VFs, then > the PCI driver core will not probe() any VFs for that driver's devices. > > On the Rust side, add a const "SUPPORTS_VF" Driver trait, defaulting to > false: drivers must explicitly opt into VF support.As I said in the other thread - please no. Linux drivers are expected to run on their VFs. This temporary weirdness of novacore should not be elevated to a core behavior that people will misuse. Jason
Danilo Krummrich
2025-Oct-02 12:18 UTC
[PATCH v2 1/2] rust: pci: skip probing VFs if driver doesn't support VFs
On Thu Oct 2, 2025 at 2:11 PM CEST, Jason Gunthorpe wrote:> On Wed, Oct 01, 2025 at 07:00:09PM -0700, John Hubbard wrote: >> Add a "supports_vf" flag to struct pci_driver to let drivers declare >> Virtual Function (VF) support. If a driver does not support VFs, then >> the PCI driver core will not probe() any VFs for that driver's devices. >> >> On the Rust side, add a const "SUPPORTS_VF" Driver trait, defaulting to >> false: drivers must explicitly opt into VF support. > > As I said in the other thread - please no. > > Linux drivers are expected to run on their VFs.The consequence would be that drivers for HW that can export VFs would need to be rejected upstream if they only support the PF, but no VFs. IMHO, that's an unreasonable requirement. Don't get me wrong, I agree that it'd be great if all drivers would (be able to) support the corresponding VFs. But in practice that's not always the case, so I'd rather have a common way to let drivers assert what they support over going back to the "old model" of probing drivers, where we just rely on probe() to fail.> This temporary > weirdness of novacore should not be elevated to a core behavior that > people will misuse.It's not just nova-core, please see [1]. [1] https://lore.kernel.org/lkml/DD7TP31FEE92.2E0AKAHUOHVVF at kernel.org/