rpcrdma_sendctx_get_locked(9)
π rpcrdma_sendctx_get_locked(9) β a Kernel API Manual moment
okay so bestie, we're in the Kernel API Manual today and the star of the show is rpcrdma_sendctx_get_locked β yes that's a whole mouthful, yes it's iconic, no we're not skipping any of it. let's get into it π«Ά
β¨ NAME β¨
rpcrdma_sendctx_get_locked β Acquire a send context πΈ
like, literally go get yourself a send context. that's the whole vibe.
π¦ SYNOPSIS π¦
struct rpcrdma_sendctx * rpcrdma_sendctx_get_locked (struct rpcrdma_xprt *r_xprt );
she takes exactly one thing and she gives you back a pointer. periodt.
π ARGUMENTS π
r_xprtβ the controlling transport instance π (the main character, honestly β everything happens around her)
π₯ DESCRIPTION π₯
So what does she actually do? She returns a pointer to a free send completion context. that's it, that's the job. no cap. β¨
But β and this is the part where you gotta pay attention β if the queue is empty, she returns NULL. not an error code, not a vibe, just NULL. π so check that pointer, bestie, fr fr.
Usage: she's called to acquire an SGE array before preparing a Send WR. like, you grab the array first, then you do the Send WR thing. order matters. iykyk.
And now the lowkey serious bit π β the caller serializes calls to this function (per transport), and provides an effective memory barrier that flushes the new value of rb_sc_head.
π«Ά real talk: that serialization + memory barrier thing is on you, the caller. she's not doing it for you. that's the deal. keep it locked (the name literally says _locked, she's telling you something π
).
π SEE ALSO π
Kernel file ./net/sunrpc/xprtrdma/verbs.c β and the whole friend group π¦:
rpcrdma_flush_disconnect(9)rpcrdma_wc_send(9)rpcrdma_wc_receive(9)rpcrdma_cm_event_handler(9)rpcrdma_xprt_connect(9)rpcrdma_xprt_disconnect(9)rpcrdma_sendctx_unget_locked(9)rpcrdma_sendctx_put_locked(9)rpcrdma_mrs_refresh(9)rpcrdma_req_create(9)rpcrdma_req_setup(9)rpcrdma_rep_put(9)rpcrdma_buffer_create(9)rpcrdma_req_destroy(9)rpcrdma_mrs_destroy(9)rpcrdma_buffer_destroy(9)rpcrdma_mr_get(9)rpcrdma_reply_put(9)rpcrdma_buffer_get(9)rpcrdma_buffer_put(9)rpcrdma_regbuf_realloc(9)__rpcrdma_regbuf_dma_map(9)rpcrdma_post_recvs(9)
go read them all, they're all slay, i don't make the rules π
and that's the page, bestie!! π sign-off time: this one lives in ./net/sunrpc/xprtrdma, dated October 2026, and it's rpcrdma_sendctx_get_locked(9) through and through. 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