virtqueue_poll(9)
π virtqueue_poll(9) β like, the manual page, but make it make sense π
okay so bestie, welcome to virtqueue_poll, which lives in section 9 (the Kernel API Manual, iykyk). This is a tiny little function and honestly it's giving "main character energy" for how much it doesn't do. Let's get into it π«Ά
β¨ NAME β¨
virtqueue_poll β query pending used buffers π
πΈ SYNOPSIS πΈ
bool virtqueue_poll (struct virtqueue *_vq , unsigned int last_used_idx
);
π ARGUMENTS π
_vqβ thestruct virtqueuewe're talking about. Your queue. Your icon. Your moment.last_used_idxβ the virtqueue state, which you get from a call tovirtqueue_enable_cb_prepare. Yes, that exact one β don't come at me with a different function, it's literally not going to work out π
π¦ DESCRIPTION π¦
Returns "true" if there are pending used buffers in the queue. That's it. That's the whole vibe check π₯
This does not need to be serialized. Fr fr β no locking drama, no "hold my hand while I take the mutex" situation. You can just call it. Slay.
π SEE ALSO π
The kernel file lives at ./drivers/virtio/virtio_ring.c, and here's the whole friend group β every single one of them, not skipping a single bestie:
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_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)
literally all of them. every single one. I counted. don't @ me π
and that's the page, bestie π This one came from ./drivers/virtio, dated October 2026, and the whole thing is filed under virtqueue_poll(9) β go forth and poll those buffers, you absolute icon πβ
π¦ 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