hfi1_rcd_get_by_index(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 valid devdata structure. 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:

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