xdr_count_read_segments(9)
π 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'sxdr_streamis updated to point to the first byte past the Read list. therc_read_pclandrc_call_pclcl_countfields 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'sxdr_streamis 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 getfalse, don't go trusting thatxdr_streamafter, bestie π
π SEE ALSO π
kernel file ./net/sunrpc/xprtrdma/svc_rdma_recvfrom.c β go read the source, iykyk π
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_write_chunks(9)svc_rdma_xdr_decode_req(9)svc_rdma_recvfrom(9)
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
- 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