dma_buf_phys_vec_to_sgt(9)
π¦ dma_buf_phys_vec_to_sgt(9) π¦
okay bestie, welcome to the Kernel API Manual β¨ this one's about dma_buf_phys_vec_to_sgt and it's giving "I turn physical vectors into a scatterlist table" energy, and honestly? iconic.
π NAME π
dma_buf_phys_vec_to_sgt β returns the scatterlist table of the attachment from arrays of physical vectors. This function is intended for MMIO memory only. π
(and yes, the original source spells it "funciton" β we're leaving that typo alone, she's doing her best π )
β¨ SYNOPSIS β¨
struct sg_table * dma_buf_phys_vec_to_sgt (struct dma_buf_attachment
*attach , struct p2pdma_provider *provider , struct phys_vec *phys_vec ,
size_t nr_ranges , size_t size , enum dma_data_direction dir );
π ARGUMENTS π
attach[in] β the attachment whose scatterlist is gonna be returned, bestie. that's the whole assignment.provider[in] β thep2pdmaprovider π«Άphys_vec[in] β an array of physical vectors. like, a whole little squad of them.nr_ranges[in] β how many entries are chillin' in thephys_vecarray π’size[in] β the total size ofphys_vec, no capdir[in] β the direction of the DMA transfer β
πΈ DESCRIPTION πΈ
So what does she actually do? She returns an sg_table containing the scatterlist to be returned π β and on error she returns ERR_PTR. She may also return -EINTR if she gets interrupted by a signal π (relatable, honestly, sometimes you just gotta bail).
On success, the DMA addresses and lengths in the returned scatterlist are PAGE_SIZE aligned β¨ β tidy, lined up, main character energy.
β οΈ heads up bestie: a mapping must be unmapped by using dma_buf_free_sgt. do not leave her hanging, that's not the vibe. π¨
π§ NOTE π§
This function is intended for exporters π. And if direct traffic routing is mandatory, the exporter should call the routing pci_p2pdma_map_type before calling this function β order matters, iykyk π«Ά
π₯ SEE ALSO π₯
- Kernel file
./drivers/dma-buf/dma-buf-mapping.c struct dma_buf_dma(9)dma_buf_free_sgt(9)
okay that's the whole page, bestie, you ate that π π
she lives in ./drivers/dma-buf, she's dated October 2026, and she's part of the Kernel API Manual β go forth and map responsibly, mwah ππ¦β¨
π¦ 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