hfi1_kern_exp_rcv_setup(9)
π
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 totrueafter 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:
- finds a free flow entry in the flow circular buffer π
- finds pages and continuous physical chunks constituting one segment of an sge π§©
- allocates TID group entries for those chunks π―
- programs
rcvarrayentries in the hardware corresponding to those TID's π₯οΈ - computes a tidarray with formatted TID entries which can be sent to the sender π¨
- reserves and programs HW flows π₯
- 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 π
- 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)kern_reserve_flow(9)tid_rdma_find_phys_blocks_4k(9)tid_flush_pages(9)tid_rdma_find_phys_blocks_8k(9)hfi1_kern_exp_rcv_free_flows(9)__trdma_clean_swqe(9)hfi1_schedule_tid_send(9)
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
- 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