kern_reserve_flow(9)
π 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. yourstruct 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? passRXE_NUM_TID_FLOWSto 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
0andRXE_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 π
- Kernel file
./drivers/infiniband/hw/hfi1/tid_rdma.c - TID RDMA READ protocol(9)
qp_to_rcd(9)- lock ordering(9)
kernel_tid_waiters(9)dequeue_tid_waiter(9)queue_qp_for_tid_wait(9)__trigger_tid_waiter(9)tid_rdma_schedule_tid_wakeup(9)tid_rdma_trigger_resume(9)tid_rdma_find_phys_blocks_4k(9)tid_flush_pages(9)tid_rdma_find_phys_blocks_8k(9)hfi1_kern_exp_rcv_setup(9)hfi1_kern_exp_rcv_free_flows(9)__trdma_clean_swqe(9)hfi1_schedule_tid_send(9)
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
- 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