update_num_rd_atomic(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… update_num_rd_atomic(9) πŸ’…

Okay bestie, welcome to the Kernel API Manual β€” this one's a little hfi1 deep-dive and honestly it's giving "small function, big responsibilities". Let's get into it 🫢


✨ NAME ✨

update_num_rd_atomic β€” the function whose whole entire job is to update the qp->s_num_rd_atomic. That's it. That's the gig. Iconic, honestly πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

void update_num_rd_atomic (struct rvt_qp *qp , u32 psn , struct rvt_swqe
*wqe );

Three args, returns nothing (void), no cap. Copy it exactly like that, don't get creative πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • qp β€” the QP, obvs. The main character of this whole situation.
  • psn β€” the packet sequence number to restart at. Yes, restart. We're picking up where we left off ✨
  • wqe β€” the wqe. That's the wqe. It's right there. Love that for us πŸ“

🌸 DESCRIPTION 🌸

So here's the tea: this function gets called from reset_psn, and its whole purpose in life is to update qp->s_num_rd_atomic for the current wqe. That's the assignment. That's what we're doing here πŸ”₯

⚠️ Important vibe check: this one is called at interrupt level with the QP s_lock held. So like... be normal about it. Don't go doing anything spicy in there. The lock is literally being held, bestie 😭

πŸ‘‘ SEE ALSO πŸ‘‘

If you're going down the rabbit hole (and you know you are, iykyk), the kernel file to look at is ./drivers/infiniband/hw/hfi1/rc.c, plus all these besties:


πŸ’– and that's the whole page, bestie πŸ’–

Cute lil sign-off: this one lives over in ./drivers/infiniband/hw/hfi1, dated October 2026 β€” same energy as ever, update_num_rd_atomic(9), we love her, periodt πŸ§šπŸ’œ

πŸ“¦ where this page comes from