kern_reserve_flow(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… kern_reserve_flow(9) β€” like, the flow-reserving girlie of the kernel API manual

okay so bestie, welcome to kern_reserve_flow(9) β€” yes that's the manual name, section 9, kernel API manual vibes, we're in the big leagues now πŸŽ€. This is the page where the kernel gets a hardware flow reserved for itself, and honestly? it ate. let me walk you through it ✨


🌸 NAME 🌸

kern_reserve_flow β€” allocate a hardware flow πŸ¦‹

like, that's literally the whole thing. allocate. a hardware. flow. periodt.


✨ SYNOPSIS ✨

int kern_reserve_flow (struct hfi1_ctxtdata *rcd , int last );

that's the signature, copy it exactly bestie, no cap, don't be out here renaming anything πŸ™ˆ


πŸŽ€ ARGUMENTS πŸŽ€

  • rcd β€” the context you're using for the allocation, i.e. your struct hfi1_ctxtdata * moment. it's giving main character context energy πŸ’œ
  • last β€” the index of the preferred flow, your little wishlist entry. and if you literally don't care? pass RXE_NUM_TID_FLOWS to signify "don't care" ✨ (yes that's the exact sentinel, write it down, iykyk)

πŸ’– DESCRIPTION πŸ’–

so here's the tea: this function uses a bit mask based allocation to reserve a hardware flow for use in receiving KDETH data packets. cute, efficient, iconic. 🧚

and if you did specify a preferred flow (last, the little fave), the function will attempt to reserve that flow again β€” but only if it's available. if it's taken? tough luck babe, it moves on. πŸ’€

⚠️ okay this part is important and i'm not gonna soften it: the exp_lock must be held. not optional. not a suggestion. hold the lock, bestie. πŸ”₯

⭐ RETURN ⭐

  • On success: a positive value between 0 and RXE_NUM_TID_FLOWS - 1 🌈
  • On failure: -EAGAIN 😭

that's it, that's the whole return contract, no surprises, we love a clear API 🫢


πŸ¦‹ SEE ALSO πŸ¦‹

okay this list is long and honestly kind of a flex, so let's go through it together πŸ’…

go read them. all of them. you'll be smarter, i promise. πŸ‘‘


and that's the page, bestie!! πŸ’– this little beauty lives over in ./drivers/infiniband/hw/hfi1 and the version we're reading is dated October 2026 🌸 so like, fresh off the press fr fr. mwah, go reserve some flows, you've got this πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from