svc_rdma_recvfrom(9)
π svc_rdma_recvfrom(9) β like, the Kernel API Manual era π
okay so bestie, welcome to the glow-up of svc_rdma_recvfrom(9) β yes that's the manual name, and yes it's a whole vibe. Grab a strawberry π and let's get into it.
β¨ NAME β¨
svc_rdma_recvfrom β Receive an RPC call
π¦ SYNOPSIS π¦
int svc_rdma_recvfrom (struct svc_rqst *rqstp );
πΈ ARGUMENTS πΈ
rqstpβ the request structure you're receiving an RPC Call into. that's it, that's the whole argument, she's lowkey simple like that π«Ά
π RETURN π
okay so this function has range, here's every single thing it can hand back to you:
- the positive number of bytes in the RPC Call message β slay, we got data π
0if there were no Calls ready to return β not a flop, just nothing to serve yet-EINVALif the Read chunk data is too large β she's doing too much, respectfully π-ENOMEMif therdma_rwcontext pool was exhausted β no memory left in the pool, tragic-ENOTCONNif posting failed (connection is lost) π-EIOifrdma_rwinitialization failed (DMA mapping, etc) β maps failed, not the vibe
π₯ DESCRIPTION π₯
so here's what's actually happening π
This gets called in a loop when XPT_DATA is set. And XPT_DATA is cleared only when there are no remaining ctxt's to process β that's the exit condition, no shortcuts, periodt.
The next ctxt gets removed from the "receive" lists. Then it's giving three paths:
- If the ctxt completes a Receive, then construct the Call message from the contents of the Receive buffer. π§
- If there are no Read chunks in this message, then finish assembling the Call message and return the number of bytes in the message. easy, done, iconic.
- If there are Read chunks in this message, post Read WRs to pull that payload. When the Read WRs complete, build the full message and return the number of bytes in it. π¦ (the way that this one takes the scenic route fr fr)
ngl the whole thing is a little state machine and she eats every single time π
π SEE ALSO π
kernel file ./net/sunrpc/xprtrdma/svc_rdma_recvfrom.c β that's where she lives π
and her whole friend group, matching energy:
svc_rdma_recv_ctxts_destroy(9)svc_rdma_recv_ctxt_get(9)svc_rdma_recv_ctxt_put(9)svc_rdma_release_ctxt(9)svc_rdma_post_recvs(9)svc_rdma_wc_receive(9)svc_rdma_flush_recv_queues(9)xdr_count_read_segments(9)xdr_count_write_chunks(9)svc_rdma_xdr_decode_req(9)
and that's the whole page bestie π this masterpiece came from ./net/sunrpc/xprtrdma and it's stamped October 2026 β future icon behavior honestly β go read some kernel source, ily, bye πβ¨
π¦ 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