virtqueue_map_page_attrs(9)
π« NAME π«
virtqueue_map_page_attrs β ok so this is the one that maps a page to the device, bestie π
Quick vibe check: this page lives in the Kernel API Manual section 9, and it's about handing a page over to your device so it can do DMA things with it β¨
π¦ SYNOPSIS π¦
dma_addr_t virtqueue_map_page_attrs (const struct virtqueue *_vq ,
struct page *page , unsigned long offset , size_t size , enum
dma_data_direction dir , unsigned long attrs );
Like, that's the whole signature, no cap π
πΈ ARGUMENTS πΈ
_vqβ the virtqueue we are talking to π«Ά like, which queue are we doing this forpageβ the page that will be mapped by the device, the actual star of the show πoffsetβ the offset in the page for a buffer, so we know where in that page the good stuff startssizeβ the buffer size, literally how much we're mapping πdirβ mapping direction, iykyk πattrsβ mapping attributes, the little extras β¨
π₯ DESCRIPTION π₯
So it returns the mapped address β that's the whole delivery π
β οΈ But fr fr, caller should check that by virtqueue_map_mapping_error β don't just trust the address, do the vibe check first or you're gonna have a bad time π
π SEE ALSO π
So there's a kernel file involved: ./drivers/virtio/virtio_ring.c π β that's where the magic lives, go read it, it's giving main character energy.
And now, the whole squad of friends, no one left behind π«Ά:
virtqueue_add_sgs(9)virtqueue_add_outbuf(9)virtqueue_add_outbuf_premapped(9)virtqueue_add_inbuf(9)virtqueue_add_inbuf_cache_clean(9)virtqueue_add_inbuf_ctx(9)virtqueue_add_inbuf_premapped(9)virtqueue_dma_dev(9)virtqueue_kick_prepare(9)virtqueue_notify(9)virtqueue_kick(9)virtqueue_get_buf_ctx(9)virtqueue_disable_cb(9)virtqueue_enable_cb_prepare(9)virtqueue_poll(9)virtqueue_enable_cb(9)virtqueue_enable_cb_delayed(9)virtqueue_detach_unused_buf(9)vring_interrupt(9)virtqueue_resize(9)virtqueue_reset(9)virtqueue_get_vring_size(9)virtqueue_map_alloc_coherent(9)virtqueue_map_free_coherent(9)virtqueue_unmap_page_attrs(9)virtqueue_map_single_attrs(9)virtqueue_unmap_single_attrs(9)virtqueue_map_mapping_error(9)virtqueue_map_need_sync(9)virtqueue_map_sync_single_range_for_cpu(9)virtqueue_map_sync_single_range_for_device(9)
okay that's the whole page bestie, you ate that π
Signed off from the ./drivers/virtio corner of the kernel π, dated October 2026, manual section 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