rpcrdma_sendctx_get_locked(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 πŸ¦‹:

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