xdr_count_read_segments(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… xdr_count_read_segments β€” Kernel API Manual, bestie edition ✨

okay so this is a page from the Kernel API Manual (yes, that one, the big serious one) and it's about xdr_count_read_segments, which lowkey has one job and does it slayfully.

πŸŽ€ NAME πŸŽ€

xdr_count_read_segments β€” counts the number of Read segments in a Read list. that's it, that's the whole vibe check πŸ¦‹

✨ SYNOPSIS ✨

bool xdr_count_read_segments (struct svc_rdma_recv_ctxt *rctxt , __be32
*p );

🫢 ARGUMENTS 🫢

  • rctxt β€” the ingress receive context. it's giving "the situation we're looking at" 🌸
  • p β€” start of an un-decoded Read list. the raw tea, not yet decoded β˜•

πŸ‘‘ DESCRIPTION πŸ‘‘

so the whole point: before allocating anything, make sure the ingress Read list is safe to use. like, don't go spending memory before you know the list isn't gonna jump you. periodt πŸ’…

the segment count is limited to how many segments can fit in the transport header without overflowing the buffer. that's about 40 Read segments for a 1KB inline threshold β€” literally the ceiling, no cap 🧒

return values, and this part matters so read it:

  • true: the Read list is valid. rctxt's xdr_stream is updated to point to the first byte past the Read list. the rc_read_pcl and rc_call_pcl cl_count fields are set to the number of Read segments in the list. everything's iconic, we move πŸŽ‰
  • false: the Read list is corrupt or exceeds the page budget. rctxt's xdr_stream is left in an unknown state 😭 not great, not terrible, just undefined-ish β€” treat it with suspicion.
fr fr the unknown-state thing is a real one β€” if you get false, don't go trusting that xdr_stream after, bestie πŸ™ˆ

🌈 SEE ALSO 🌈

kernel file ./net/sunrpc/xprtrdma/svc_rdma_recvfrom.c β€” go read the source, iykyk πŸ“–


and that's the page!! sourced from ./net/sunrpc/xprtrdma, dated October 2026, filed under xdr_count_read_segments(9) β€” catch you in the next manpage, mwah πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from