rvt_alloc_device(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ rvt_alloc_device(9) β€” the Kernel API Manual moment we've all been waiting for πŸ¦‹

okay bestie, welcome to the rvt_alloc_device(9) page, from the Kernel API Manual, and honestly? she's short, she's sweet, and she's about to make your whole day πŸ’…


✨ NAME ✨

rvt_alloc_device β€” allocate rdi πŸŽ€


✨ SYNOPSIS ✨

struct rvt_dev_info * rvt_alloc_device (size_t size , int nports );

that's it. that's the whole vibe. two args, one returned pointer, zero drama 🫢


✨ ARGUMENTS ✨

  • size β€” how big of a structure you want to allocate. like, the actual size, bestie, not a guess πŸ’–
  • nports β€” the number of ports you want array slots for. count them. fr fr πŸ”’

πŸ’œ DESCRIPTION πŸ’œ

so here's the tea β˜• β€” you use the IB core device alloc to allocate space for the rdi, and the rdi is assumed to be inside of the ib_device. that's the whole premise. that's canon. no cap.

any extra space that you, the driver author, require? that's on you to fold into size. like, we're not psychic, we can't magically know how much room your little extra bits need β€” you include it in size yourself, okay? 😭

we also allocate a port array based on the number of ports. yes, based on nports. the one you passed in. that one. iconic behaviour honestly πŸ‘‘


🌈 RETURN 🌈

on success you get a pointer to the allocated rdi ✨ that's the whole return value. a pointer. to the rdi. slay.


πŸ”₯ SEE ALSO πŸ”₯

kernel file ./drivers/infiniband/sw/rdmavt/vt.c β€” and like, all of her friends:

it's giving family reunion and we love that for them πŸ§šπŸ’œ


okay and finally, the cute lil sign-off: this whole page lives under ./drivers/infiniband/sw/rdmavt and the date on her birth certificate says October 2026 πŸŽ€ go forth, allocate responsibly, and remember β€” you allocate it, you dealloc it. balance. πŸŒΈπŸ’–

πŸ“¦ where this page comes from