svc_rdma_recvfrom(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 πŸ’–
  • 0 if there were no Calls ready to return β€” not a flop, just nothing to serve yet
  • -EINVAL if the Read chunk data is too large β€” she's doing too much, respectfully πŸ™ˆ
  • -ENOMEM if the rdma_rw context pool was exhausted β€” no memory left in the pool, tragic
  • -ENOTCONN if posting failed (connection is lost) πŸ’€
  • -EIO if rdma_rw initialization 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:


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