virtqueue_ma...e_for_device(9)
π NAME π
okay so bestie, welcome to the Kernel API Manual β¨ β today's main character is virtqueue_map_sync_single_range_for_device π and what it does is map sync for device π«Ά
β¨ SYNOPSIS β¨
void virtqueue_map_sync_single_range_for_device (const struct virtqueue
*_vq , dma_addr_t addr , unsigned long offset , size_t size , enum
dma_data_direction dir );
like, that's the whole signature, no cap π
πΈ ARGUMENTS πΈ
_vqβ thestruct virtqueuewe're talking about π« literally the vq in questionaddrβ DMA address πoffsetβ DMA address offset, like how far in we're going π―sizeβ buf size for sync, i.e. how much we're syncing π§dirβ DMA direction, which way the data's vibing β‘οΈ
π¦ DESCRIPTION π¦
okay so listen π₯ before you call this function, you gotta use virtqueue_map_need_sync to confirm that the DMA address really needs to be synchronized π
no fr, do the vibe check first β virtqueue_map_need_sync is the pre-check, don't skip it π
like it's giving "look before you leap" but for DMA addresses π
β SEE ALSO β
the whole friend group π«Ά β kernel file ./drivers/virtio/virtio_ring.c and:
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_map_page_attrs(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)
k byeee π this one came out of ./drivers/virtio dated October 2026, and the page itself is virtqueue_ma...e_for_device(9) β mwah, stan, 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