virtqueue_ad...uf_premapped(9)
π virtqueue_ad...uf_premapped(9) β from the Kernel API Manual, bestie β¨
okay so picture this: you're deep in kernel land, you've got a struct virtqueue, and you want the other side to be able to see some output buffers. That's it. That's the whole gig. Welcome to virtqueue_add_outbuf_premapped, my love π«Ά
πΈ NAME πΈ
virtqueue_add_outbuf_premapped β expose output buffers to other end
β¨ SYNOPSIS β¨
int virtqueue_add_outbuf_premapped (struct virtqueue *vq , struct scatterlist *sg , unsigned int num , void *data , gfp_t gfp );
π ARGUMENTS π
vqβ thestruct virtqueuewe're talking about. the main character, basically πsgβ the scatterlist. and bestie, it must be well-formed and terminated! no cap, this is not optional πnumβ the number of entries insgthat are readable by the other side.dataβ the token identifying the buffer. your little name tag for it π·οΈgfpβ how to do memory allocations (if necessary). iykyk π
π DESCRIPTION π
Caller must ensure we don't call this with other virtqueue operations at the same time (except where noted).
fr fr, read that again. it's giving "one at a time, queen." no overlapping virtqueue ops unless the docs explicitly say otherwise π
π₯ RETURN π₯
Returns zero or a negative error (ie. ENOSPC, ENOMEM, EIO).
so: 0 = slayed β¨, negative = it's giving struggle π
π¦ SEE ALSO π¦
Kernel file ./drivers/virtio/virtio_ring.c, plus the whole friend group:
virtqueue_add_sgs(9)virtqueue_add_outbuf(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)virtqueue_map_sync_single_range_for_device(9)
and that's the whole page, bestie ππ live from ./drivers/virtio, dated October 2026, courtesy of the Kernel API Manual β go forth and map those buffers responsibly π§ββοΈβ
π¦ 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