mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/8] Add Rust PCI SR-IOV support
@ 2026-09-24 19:05 Zhi Wang
  2026-09-24 19:05 ` [PATCH v2 1/8] rust: pci: add {enable,disable}_sriov(), to control SR-IOV capability Zhi Wang
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Zhi Wang @ 2026-09-24 19:05 UTC (permalink / raw)
  To: rust-for-linux, linux-pci, linux-kernel
  Cc: dakr, aliceryhl, bhelgaas, kwilczynski, ojeda, boqun, gary,
	bjorn3_gh, lossin, a.hindborg, tmgross, markus.probst, cjia,
	smitra, ankita, aniketa, kwankhede, targupta, kjaju, alkumar,
	acourbot, jhubbard, zhiwang, jgg, alex, Zhi Wang

Rust PCI drivers need to enable and disable SR-IOV and share selected
PF-owned functionality with their VF drivers. The shared data must remain
valid while a VF driver is bound.

This series builds on Peter Colberg's Rust PCI SR-IOV v3 series [1],
extending it with typed PF registration data. The registration design
follows Danilo Krummrich's Rust vGPU/VFIO PoC [2].

Add the PCI SR-IOV operations and callback, VF removal before PF unbind,
and typed PF registration data. A pinned VfRegistration publishes the PF
data before VFs are enabled. Rust VF drivers borrow that data after a
type check. Include a Rust PF/VF sample that demonstrates a VF calling
an operation provided by its PF, using QEMU's 82576 emulation.

Changes since v1 [3]:
- Rebase the generic PCI support and Rust sample onto driver-core-testing.
- Drop the generic C FFI descriptors, C PF-data accessor and C VF sample.
- Remove the managed_sriov driver flag and PF/VF device links. With VFs
  enabled, the Rust PCI remove callback invokes sriov_configure(0), when
  implemented, and disables any remaining VFs before calling the PF
  driver's unbind.
- Use pci::Device directly for SR-IOV operations and callbacks, removing
  the separate pci::sriov::Device wrapper. Update the sample accordingly.

[1] https://lore.kernel.org/rust-for-linux/20260303-rust-pci-sriov-v3-0-4443c35f0c88@redhat.com/
[2] https://lore.kernel.org/nova-gpu/DLCRZLO06SIO.LS7TWQXIPZSQ@kernel.org/
[3] https://lore.kernel.org/all/20260915205659.76841-1-zhiw@nvidia.com/

John Hubbard (1):
  rust: pci: add is_virtfn(), to check for VFs

Peter Colberg (6):
  rust: pci: add {enable,disable}_sriov(), to control SR-IOV capability
  rust: pci: add vtable attribute to pci::Driver trait
  rust: pci: add is_physfn(), to check for PFs
  rust: pci: add num_vf(), to return number of VFs
  rust: pci: add bus callback sriov_configure(), to control SR-IOV from
    sysfs
  samples: rust: add Rust SR-IOV VF driver sample

Zhi Wang (1):
  rust: pci: add typed SR-IOV PF registration data

 MAINTAINERS                           |   1 +
 drivers/gpu/nova-core/driver.rs       |   1 +
 include/linux/pci.h                   |   7 +
 rust/kernel/pci.rs                    | 145 +++++++++++++++
 rust/kernel/pci/sriov.rs              | 253 ++++++++++++++++++++++++++
 samples/rust/Kconfig                  |  11 ++
 samples/rust/Makefile                 |   1 +
 samples/rust/rust_dma.rs              |   1 +
 samples/rust/rust_driver_auxiliary.rs |   1 +
 samples/rust/rust_driver_pci.rs       |   1 +
 samples/rust/rust_driver_sriov.rs     | 241 ++++++++++++++++++++++++
 11 files changed, 663 insertions(+)
 create mode 100644 rust/kernel/pci/sriov.rs
 create mode 100644 samples/rust/rust_driver_sriov.rs


base-commit: c15c5befd6d6150e92ab7c6c7fde1088e0f543e6
-- 
2.53.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-09-25 20:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-24 19:05 [PATCH v2 0/8] Add Rust PCI SR-IOV support Zhi Wang
2026-09-24 19:05 ` [PATCH v2 1/8] rust: pci: add {enable,disable}_sriov(), to control SR-IOV capability Zhi Wang
2026-09-25 20:43   ` Peter Colberg
2026-09-24 19:05 ` [PATCH v2 2/8] rust: pci: add vtable attribute to pci::Driver trait Zhi Wang
2026-09-24 19:05 ` [PATCH v2 3/8] rust: pci: add is_virtfn(), to check for VFs Zhi Wang
2026-09-24 19:05 ` [PATCH v2 4/8] rust: pci: add is_physfn(), to check for PFs Zhi Wang
2026-09-24 19:05 ` [PATCH v2 5/8] rust: pci: add num_vf(), to return number of VFs Zhi Wang
2026-09-24 19:05 ` [PATCH v2 6/8] rust: pci: add bus callback sriov_configure(), to control SR-IOV from sysfs Zhi Wang
2026-09-24 19:05 ` [PATCH v2 7/8] rust: pci: add typed SR-IOV PF registration data Zhi Wang
2026-09-24 19:05 ` [PATCH v2 8/8] samples: rust: add Rust SR-IOV VF driver sample Zhi Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®