ib_sa_path_rec_get(9)
π ib_sa_path_rec_get β the Kernel API Manual moment
okay so bestie, we're in the Kernel API Manual today and the function is ib_sa_path_rec_get(9) β¨
πΈ NAME πΈ
ib_sa_path_rec_get β start a Path get query π¦ like, you're kicking off a whole quest to find a path, no big deal
β¨ SYNOPSIS β¨
int ib_sa_path_rec_get (struct ib_sa_client *client , struct ib_device
*device , u32 port_num , struct sa_path_rec *rec , ib_sa_comp_mask
comp_mask , unsigned long timeout_ms , gfp_t gfp_mask , void
(*callback)(int status, struct sa_path_rec *resp, unsigned int
num_paths, void *context) , void *context , struct ib_sa_query
**sa_query );
likeβ¦ that's a lot of parameters, but we love a thorough icon π
π ARGUMENTS π
clientβ the SA client, your lil membership card to the whole operation π«Άdeviceβ which device we're sending the query on, bestie, pick oneport_numβ and the port number to send it on, obvi πrecβ the Path Record that actually goes inside the query, the main character of this whole thing πcomp_maskβ the component mask that goes in the query tootimeout_msβ how long we're willing to wait for a response before we're like "okay this is taking forever π" (it's in ms, keep up)gfp_maskβ the GFP mask used for internal allocations, lowkey importantcallbackβ the function that gets called when the query completes, times out, or is canceled βcontextβ an opaque user context that gets passed straight to the callback, like a little gift you hand forward πsa_queryβ the query context, which is how you cancel the query later if you change your mind π
π DESCRIPTION π
okay so what this does: it sends a Path Record Get query to the SA so it can look up a path π₯
Then when the query completes (or fails, ngl it happens), your callback function gets called. And the status it hands you tells the whole story:
0β slay, successful response π-EINTRβ the query was canceled, fair enough-ETIMEDOUTβ the query timed out, we waited and waited π-EIOβ an error happened while sending the query, tragic π
β οΈ super important bestie: therespparameter of the callback is only valid ifstatusis0. Like, do not touch it otherwise, I'm begging π
And about the return value of ib_sa_path_rec_get itself:
- if it's negative, that's an error code, periodt π
- otherwise it's a query ID β and you keep that, because that's the thing you use to cancel the query later π
π¦ SEE ALSO π¦
- Kernel file
./drivers/infiniband/core/sa_query.c ib_sa_cancel_query(9)β the cancel-this-query bestieib_init_ah_attr_from_path(9)ib_sa_service_rec_get(9)
and that's the vibe check on this one, bestie π§ this page came from the ./drivers/infiniband/core corner of the kernel, dated October 2026, and it's filed under ib_sa_path_rec_get(9) β iconic, no cap ππ
π¦ 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