pcim_p2pdma_provider(9)
π pcim_p2pdma_provider π
okay so this is a page from the Kernel API Manual (section 9, kernel-space girlies rise up) and it's literally all about grabbing a peer-to-peer DMA provider for a PCI device. stay with me bestie, it's giving niche-but-important π«Ά
β¨ NAME β¨
pcim_p2pdma_provider β get peer-to-peer DMA provider π
β¨ SYNOPSIS β¨
struct p2pdma_provider * pcim_p2pdma_provider (struct pci_dev *pdev ,
int bar );
β¨ ARGUMENTS β¨
pdevβ the PCI device you wanna enable P2PDMA for πbarβ the BAR index you're getting the provider from, iykyk
β¨ DESCRIPTION β¨
so this function gets you the peer-to-peer DMA provider for a PCI device. cute! π
but here's the tea: the lifetime of the provider (and obviously the MMIO too, like, they're bonded fr fr) is bound to the lifetime of the driver. so if you're a driver calling this function, you must make sure that every single reference to the provider β and any DMA mappings you created for any MMIO β are all cleaned up before your driver remove completes. not optional. not a vibe check you can skip. π
and because P2P is almost always shared with a second driver (the way it's always shared π), that means you need some kind of system to notify, invalidate and revoke the MMIO's DMA in place to actually use this function. for example, a revoke can be built using DMABUF. slay, that's your escape hatch. π¦
bestie please don't leak the provider or the mappings β that's the whole warning, and it's real. π₯
β¨ SEE ALSO β¨
- Kernel file
./drivers/pci/p2pdma.c pcim_p2pdma_init(9)pci_p2pdma_add_resource(9)pci_p2pdma_distance_many(9)pci_has_p2pmem(9)pci_p2pmem_find_many(9)pci_alloc_p2pmem(9)pci_free_p2pmem(9)pci_p2pmem_virt_to_bus(9)pci_p2pmem_alloc_sgl(9)pci_p2pmem_free_sgl(9)pci_p2pmem_publish(9)pci_p2pdma_map_type(9)pci_p2pdma_enable_store(9)pci_p2pdma_enable_show(9)
okay that's the whole page, no cap π
this icon comes from ./drivers/pci, dated October 2026, and it's filed under pcim_p2pdma_provider(9) β periodt. πΈβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms