pcim_p2pdma_provider(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 ✨


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