hfi1_rcd_get_by_index(9)
π hfi1_rcd_get_by_index(9) β Kernel API Manual π
okay so bestie, we're in the Kernel API Manual, section 9, and today's main character is hfi1_rcd_get_by_index. She's a little lookup function and honestly she's serving "bouncer at the club but the club is an array" π stay with me, it'll make sense.
π NAME π
hfi1_rcd_get_by_index β get by index
Like, that's literally the whole job. Get. By. Index. Periodt. β¨
π¦ SYNOPSIS π¦
struct hfi1_ctxtdata * hfi1_rcd_get_by_index (struct hfi1_devdata *dd ,
u16 ctxt );
πΈ ARGUMENTS πΈ
ddβ a pointer to a validdevdatastructure. Valid, bestie. Valid. Don't come at her with a fake one πctxtβ the index of an possilbe rcd π (their spelling, not mine, but the vibe is "a slot that might be an rcd")
β¨ DESCRIPTION β¨
so here's the tea: the rcd array needs protection. You can't just be grabbing at it whenever, that's not the energy we're bringing π«Ά
If you need access to one or more index, you get the protecting spinlock first, and then you increment the kref. That's the whole ritual. Lock, increment, done. No cap.
β οΈ And this part is on you, bestie: the caller is responsible for making the _put. She's not gonna do it for you. You got the ref, you release the ref. That's the deal π
π SEE ALSO π
Kernel file ./drivers/infiniband/hw/hfi1/init.c β that's the home base π and honestly the whole friend group is here:
hfi1_rcd_free(9)hfi1_rcd_put(9)hfi1_rcd_get(9)allocate_rcd_index(9)hfi1_rcd_get_by_index_safe(9)hfi1_free_ctxt(9)init_after_reset(9)create_workqueues(9)destroy_workqueues(9)enable_general_intr(9)hfi1_init(9)shutdown_device(9)hfi1_free_ctxtdata(9)hfi1_free_devdata(9)hfi1_alloc_devdata(9)hfi1_create_rcvhdrq(9)hfi1_setup_eagerbufs(9)
the way that's basically a whole group chat π go say hi to all of them.
mwah π this lil page lives in ./drivers/infiniband/hw/hfi1, dated October 2026 β that's the source, that's the version, that's the timestamp, iconic, and that's the whole man page bestie, slay πβ¨
π¦ 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