Files
linux/rust/helpers
Zhi Wang 6afbbc27f5 rust: pci: add sriov_get_totalvfs() helper
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 <acourbot@nvidia.com>
Cc: Alexandre Courbot <acourbot@nvidia.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: David Laight <david.laight.linux@gmail.com>
Cc: Gary Guo <gary@garyguo.net>
Cc: linux-pci@vger.kernel.org
Link: https://lore.kernel.org/all/DJHPRE4TGGT8.BUTMYOF5YE05@nvidia.com/
Signed-off-by: Zhi Wang <zhiw@nvidia.com>
Link: https://patch.msgid.link/20260722073913.1807677-3-zhiw@nvidia.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-07-23 14:20:24 +02:00
..
2026-01-09 19:01:41 +08:00
2026-01-26 03:48:25 +01:00
2026-03-10 11:29:00 +01:00
2026-01-09 19:01:41 +08:00
2026-03-24 23:51:23 +01:00
2026-01-26 03:49:04 +01:00
2025-12-15 14:13:03 +01:00
2026-07-11 18:09:04 +02:00
2025-12-15 22:26:10 +01:00
2026-01-26 03:49:56 +01:00
2026-01-26 03:50:21 +01:00
2026-01-26 03:49:56 +01:00
2026-01-20 18:52:43 +01:00
2026-01-09 19:01:42 +08:00
2026-01-07 16:12:15 +01:00