User-space PCIe libraries¶
uPCIe is a set of header-only C libraries for user-space PCIe device interaction on Linux. It provides hugepage-backed DMA, MMIO accessors, PCI discovery and BAR mapping, VFIO wrappers, dma-buf helpers, and a minimalist NVMe driver, with no dependencies beyond the Linux UAPI headers.
It started as a way to explore the boundary between safe and unsafe user-space
PCIe practices. It targets both the IOMMU-protected path (vfio-pci) and the
raw-physical path (uio_pci_generic with hugepages). The companion tooling
lives in its own repositories: devbind,
hugepages, and
iommu.
Design goals¶
Header-only
Idiomatic, with a consistent error and ownership model
Zero-dependency, beyond the Linux UAPI headers
Minimalistic
Low-coupling
C11
Topics of interest¶
Mapping PCIe BAR spaces via
vfio-pcianduio_pci_genericIOMMU-protected memory for safe DMA
Hugepages for raw-physical DMA with
uio_pci_genericPCIe driver binding and unbinding
Interrupts and how to handle them
Get started