Re: [PATCH v5 2/6] rust: pci: add sriov_get_totalvfs() helper

"Alexandre Courbot" <[email protected]> Thu, 23 Jul 2026 14:30:48 +0900
Newsgroups dev.linux.lists.nova-gpu,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci
Message-ID <[email protected]>
On Wed Jul 22, 2026 at 4:39 PM JST, Zhi Wang wrote:
> Expose pci_sriov_get_totalvfs() to Rust PCI drivers so they can query
> how many SR-IOV VFs a device supports.
>
> Use a conditional C helper because the !CONFIG_PCI_IOV version of
> pci_sriov_get_totalvfs() is a static inline function and is therefore
> not emitted into the Rust bindings. Return Option<NonZero<u16>> so Rust
> callers must handle the zero value that represents unavailable SR-IOV.
>
> Reviewed-by: Alexandre Courbot <[email protected]>
> Cc: Alexandre Courbot <[email protected]>
> Cc: Bjorn Helgaas <[email protected]>
> Cc: David Laight <[email protected]>
> Cc: Gary Guo <[email protected]>
> Cc: [email protected]
> Link: https://lore.kernel.org/all/[email protected]/
> Signed-off-by: Zhi Wang <[email protected]>

The series looks ready to me, but we need a Ack on this patch to take it
through drm-rust-next - Danilo, does this look ok to you?