ib_sa_path_rec_get(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 one
  • port_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 too
  • timeout_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 important
  • callback β€” 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: the resp parameter of the callback is only valid if status is 0. 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 πŸ¦‹


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