virtqueue_add_inbuf(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ virtqueue_add_inbuf ✨

okay so this is a Kernel API Manual moment and we're about to expose input buffers to the other end, bestie πŸ’…


🌸 SYNOPSIS 🌸

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

πŸŽ€ ARGUMENTS πŸŽ€

  • vq β€” the struct virtqueue we're talking about. literally the main character here πŸ‘‘
  • sg β€” scatterlist. and bestie, it must be well-formed and terminated! no cap, this is not a drill 😭
  • num β€” the number of entries in sg writable by other side. count 'em fr fr
  • data β€” the token identifying the buffer. it's giving name tag at a party 🫢
  • gfp β€” how to do memory allocations (if necessary). y'know, the whole allocation vibe check πŸ’œ

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea: caller must ensure we don't call this with other virtqueue operations at the same time (except where noted). like, one thing at a time, periodt. don't be messy 🌈

it returns zero or a negative error (ie. ENOSPC, ENOMEM, EIO). so like, zero is slay, negative is πŸ’€

ngl this is one of those functions you just gotta respect the concurrency rules on. no exceptions bestie ✨

🧚 SEE ALSO 🧚

kernel file ./drivers/virtio/virtio_ring.c and all these iconic siblings:


and that's the whole vibe, bestie πŸ“ this page came from ./drivers/virtio and it's dated October 2026 β€” go forth and expose those buffers responsibly, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from