mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC v2 0/1] Rust PCI capability infrastructure and SR-IOV support
@ 2026-02-25 18:04 Zhi Wang
  2026-02-25 18:04 ` [RFC v2 1/1] rust: pci: add extended capability " Zhi Wang
  0 siblings, 1 reply; 2+ messages in thread
From: Zhi Wang @ 2026-02-25 18:04 UTC (permalink / raw)
  To: rust-for-linux, linux-pci, linux-kernel
  Cc: dakr, aliceryhl, bhelgaas, kwilczynski, ojeda, alex.gaynor,
	boqun.feng, gary, bjorn3_gh, lossin, a.hindborg, tmgross,
	markus.probst, helgaas, cjia, smitra, ankita, aniketa, kwankhede,
	targupta, acourbot, joelagnelf, jhubbard, kjaju, zhiwang,
	Zhi Wang

This is a follow-up to the RFC series [1], reworked on top of Gary's
io_projection branch [2] to use the Io/IoCapable/View infrastructure.

Patch 1 from the RFC (fallible config space I/O) is no longer needed,
as it is already covered by Alex's "IoCapable to functional trait" change.

This patch introduces ExtCapability<T>, which implements the Io trait
for PCI extended capability regions. It delegates IoCapable to the
underlying ConfigSpace, so io_project!/io_read!/io_write! work directly
on capability register structs. ExtSriovRegs provides the #[repr(C)]
SR-IOV register layout, and ExtSriovCapability is a convenience alias.

Changes since RFC:
- Rebased on io_projection branch, using Gary's Io/IoCapable traits
- ExtCapability implements Io and delegates IoCapable to ConfigSpace
  instead of duplicating config read/write logic
- Dropped the fallible I/O patch (now upstream in this tree)
- Added rust helper for PCI_EXT_CAP_NEXT() macro
- Replaced raw `as` casts with From conversions where possible
- Renamed SriovRegs/SriovCapability to ExtSriovRegs/ExtSriovCapability

[1] https://lore.kernel.org/rust-for-linux/20260126215957.541180-1-zhiw@nvidia.com/
[2] https://github.com/nbdd0121/linux/tree/io_projection

Zhi Wang (1):
  rust: pci: add extended capability and SR-IOV support

 rust/helpers/pci.c     |   5 +
 rust/kernel/pci.rs     |   7 ++
 rust/kernel/pci/cap.rs | 244 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 256 insertions(+)
 create mode 100644 rust/kernel/pci/cap.rs


base-commit: d6d357817b3fea5798607d04ee5668894705a0e1
-- 
2.51.0


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

end of thread, other threads:[~2026-02-25 18:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-25 18:04 [RFC v2 0/1] Rust PCI capability infrastructure and SR-IOV support Zhi Wang
2026-02-25 18:04 ` [RFC v2 1/1] rust: pci: add extended capability " 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®