virtqueue_resize(9)
β¨ virtqueue_resize β Kernel API Manual β¨
Okay bestie, this is the virtqueue_resize(9) page, and we're about to make vring resizing make sense π
No cap, it's a whole main-character operation.
πΈ NAME πΈ
virtqueue_resize β resize the vring of vq π¦
β¨ SYNOPSIS β¨
int virtqueue_resize (struct virtqueue *_vq , u32 num , void
(*recycle)(struct virtqueue *vq, void *buf) , void
(*recycle_done)(struct virtqueue *vq) );
π ARGUMENTS π
_vqβ thestruct virtqueuewe're talking about. That's the one, bestie.numβ new ring num.recycleβ callback to recycle unused buffers.recycle_doneβ callback to be invoked when recycle for all unused buffers done.
π DESCRIPTION π
When it is really necessary to create a new vring, it will set the current vq into the reset state. Then call the passed callback to recycle the buffer that is no longer used. Only after the new vring is successfully created, the old vring will be released.
Caller must ensure we don't call this with other virtqueue operations at the same time (except where noted).
Returns zero or a negative error.
0β success.-ENOMEMβ Failed to allocate a new ring, fall back to the original ring size.vqcan still work normally.-EBUSYβ Failed to sync with device,vqmay not work properly.-ENOENTβ Transport or device not supported.-E2BIG/-EINVALβnumerror.-EPERMβ Operation not permitted.
π SEE ALSO π
Kernel file: ./drivers/virtio/virtio_ring.c
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_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)
Signed off from source/version ./drivers/virtio Β· dated October 2026 Β· virtqueue_resize(9) β bye bestie, slay your vrings π
β¨
π¦ 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