hfi1_kern_exp_rcv_setup(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… hfi1_kern_exp_rcv_setup πŸ’…

okay so bestie, this is a page from the Kernel API Manual and it's all about hfi1_kern_exp_rcv_setup(9) β€” the function that sets up TID's and the flow for one segment of a TID RDMA request. yes it does a LOT. she's an icon, she's a multitasker, let's get into it πŸŽ€


✨ NAME ✨

hfi1_kern_exp_rcv_setup β€” setup TID's and flow for one segment of a TID RDMA request πŸ¦‹


🌸 SYNOPSIS 🌸

int hfi1_kern_exp_rcv_setup (struct tid_rdma_request *req , struct
rvt_sge_state *ss , bool *last );

like, that's the whole signature, copy it exactly please, no typo energy πŸ™ˆ


🫢 ARGUMENTS 🫢

  • req β€” the TID RDMA request that this segment/flow is being set up for, like she's the main character here πŸ‘‘
  • ss β€” the sge state; it's the one holding onto state across successive segments of a single sge, lowkey carrying the memory 🧠
  • last β€” gets set to true after the last sge segment has been processed, so it's the "we're so done here" flag ✨

πŸ’– DESCRIPTION πŸ’–

okay so this function is doing seven whole things and honestly? she ate. here's the rundown, fr fr:

  1. finds a free flow entry in the flow circular buffer πŸŒ€
  2. finds pages and continuous physical chunks constituting one segment of an sge 🧩
  3. allocates TID group entries for those chunks 🎯
  4. programs rcvarray entries in the hardware corresponding to those TID's πŸ–₯️
  5. computes a tidarray with formatted TID entries which can be sent to the sender πŸ“¨
  6. reserves and programs HW flows πŸ”₯
  7. also manages queueing the QP when TID/flow resources are not available 😭

req points to a struct tid_rdma_request of which the segments are a part. The function uses the qp, rcd and seg_len members of req. In the absence of errors, req->flow_idx is the index of the flow which has been prepared in this invocation of the function call. With flow = req->flows[req->flow_idx], flow->tid_entry contains the TID array which the sender can use for TID RDMA sends and flow->npkts contains the number of packets required to send the segment. slay πŸ’…

⭐ important bestie note: hfi1_check_sge_align should be called prior to calling this function and if it signals error, TID RDMA cannot be used for this sge and this function should not be called. like, don't call her if that check said no, she will not be okay with it 🚫

For the queuing, the caller must hold the flow->req->qp s_lock from the send engine and the function will procure the exp_lock. no skipping the locks babes πŸ”


πŸ”₯ RETURN πŸ”₯

The function returns -EAGAIN if a sufficient number of TID/flow resources to map the segment could not be allocated. In that case the function should be called again with previous arguments to retry the TID allocation β€” like a "bestie hold on, try again" moment 😀. There are no other error returns. The function returns 0 on success. periodt. ✨


🌈 SEE ALSO 🌈

iykyk, that's a whole friend group right there πŸ’œ


and that's the page bestie!! πŸŽ€ it lives at ./drivers/infiniband/hw/hfi1 and it's dated October 2026 β€” go off, you're now officially informed πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from