pci_p2pmem_alloc_sgl(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– pci_p2pmem_alloc_sgl(9) πŸ’–

okay bestie, welcome to the Kernel API Manual β€” this one's literally pci_p2pmem_alloc_sgl, and it's giving "let me grab you some peer-to-peer DMA memory, in a scatterlist, no big deal" ✨


🌸 NAME 🌸

pci_p2pmem_alloc_sgl β€” allocate peer-to-peer DMA memory in a scatterlist 🧚


✨ SYNOPSIS ✨

struct scatterlist * pci_p2pmem_alloc_sgl (struct pci_dev *pdev ,
unsigned int *nents , u32 length );

like, that's the whole signature, copy it exactly bestie, don't freestyle πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • pdev β€” the device you're allocating memory from 🫢 (yes, from. it's its whole thing.)
  • nents β€” the number of SG entries in the list, i.e. how many little scatterlist slices we're working with ⭐
  • length β€” number of bytes to allocate, the actual size ask πŸ’œ

πŸ”₯ RETURN πŸ”₯

NULL on error 😭 β€” or, when it slays, a struct scatterlist pointer and nents on success πŸ‘‘

bestie please check the return value, NULL is real and it will absolutely humble you πŸ™ˆ

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./drivers/pci/p2pdma.c and honestly the whole p2pdma friend group:


and that's the vibe check, periodt πŸ’… this cutie lives in ./drivers/pci, dated October 2026, and it answers to the name pci_p2pmem_alloc_sgl(9) πŸŽ€βœ¨ go forth and allocate responsibly bestie πŸ¦‹πŸ’–

πŸ“¦ where this page comes from