dma_iova_link(9)
π dma_iova_link(9)
okay so this is a page straight out of the Kernel API Manual, and honestly? it's giving "small function, big responsibilities" energy. bestie, let's get into it π«Ά
β¨ NAME β¨
dma_iova_link β link a range of IOVA space π
πΈ SYNOPSIS πΈ
int dma_iova_link (struct device *dev , struct dma_iova_state *state ,
phys_addr_t phys , size_t offset , size_t size , enum dma_data_direction
dir , unsigned long attrs );
π ARGUMENTS π
devβ the DMA device. the main character of this whole situation π«stateβ the IOVA state. she's holding the vibe together.physβ the physical address you're linking. literally the address. no cap.offsetβ the offset into the IOVA state that you're mapping into π―sizeβ how big the buffer is. size matters, bestie.dirβ the DMA direction. pick one, be decisive πattrsβ the attributes of the mapping properties β¨
π¦ DESCRIPTION π¦
so basically: this function links a range of IOVA space for the given IOVA state, and it does it without IOTLB sync. none. zero. nada. π
the whole point? you use this to link multiple physical addresses into contiguous IOVA space without doing the costly IOTLB sync every single time. it's the batch-it-and-save-yourself-the-pain move π₯
β οΈ ok but listen β the caller is responsible for calling dma_iova_sync to sync the IOTLB at the end of the linkage. don't just walk away after linking, that's not the vibe. fr fr. π
π SEE ALSO π
kernel file ./drivers/iommu/dma-iommu.c, plus the whole squad:
iommu_get_dma_cookie(9)iommu_get_msi_cookie(9)iommu_put_dma_cookie(9)iommu_put_msi_cookie(9)iommu_dma_get_resv_regions(9)iommu_dma_init_options(9)iommu_dma_init_domain(9)dma_info_to_prot(9)dma_iova_try_alloc(9)dma_iova_free(9)dma_iova_sync(9)dma_iova_unlink(9)dma_iova_destroy(9)
that's the whole page, bestie π this one lives over in ./drivers/iommu and it's dated October 2026 β so mark your calendar, remember where you found her, and go sync that IOTLB. 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