virtqueue_a..._cache_clean(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

virtqueue_add_inbuf_cache_clean β€” expose input buffers with cache clean

okay so bestie, welcome to the Kernel API Manual (section 9, the driver-functions girlypop zone ✨). This page is all about virtqueue_add_inbuf_cache_clean, and honestly? it's giving ✨niche but essential✨.


🌸 SYNOPSIS 🌸

int virtqueue_add_inbuf_cache_clean (struct virtqueue *vq , struct
scatterlist *sg , unsigned int num , void *data , gfp_t gfp );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • vq β€” the struct virtqueue we're talking about πŸ’… like, the actual queue, the main character.
  • sg β€” the scatterlist. And listen, it must be well-formed and terminated! no cap, this is not optional 😭
  • num β€” the number of entries in sg that are writable by the other side.
  • data β€” the token identifying the buffer. that's its little name tag πŸŽ€
  • gfp β€” how to do memory allocations (if necessary).

✨ DESCRIPTION ✨

So it's the same as virtqueue_add_inbuf, except it passes DMA_ATTR_DEBUGGING_IGNORE_CACHELINES β€” which is a whole vibe. That flag says: the CPU will not dirty any cacheline overlapping this buffer while it's available πŸ”₯ (iconic of it), and it also suppresses overlapping cacheline warnings in DMA debug builds πŸ™ˆπŸ’€.

⚠️ but fr fr, the caller must ensure we don't call this with other virtqueue operations at the same time (except where noted). lowkey important. don't be that girl πŸ’…

Returns zero or a negative error (ie. ENOSPC, ENOMEM, EIO). periodt. 🫢


πŸ’œ SEE ALSO πŸ’œ

Kernel file ./drivers/virtio/virtio_ring.c β€” plus the whole friend group, in order, no skips: virtqueue_add_sgs(9), virtqueue_add_outbuf(9), virtqueue_add_outbuf_premapped(9), virtqueue_add_inbuf(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) πŸ’–


aaand that's the whole page, bestie πŸŒˆπŸ’« this one came to you straight out of ./drivers/virtio, dated October 2026, by way of the Kernel API Manual β€” mwah, go read some more manpages, ily πŸŽ€πŸ’œ

πŸ“¦ where this page comes from