ib_sa_service_rec_get(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

okay so this is ib_sa_service_rec_get(9) from the Kernel API Manual, and the whole assignment is literally Start a Service get query πŸ’…βœ¨. That’s the name, that’s the vibe, we’re moving.

🌸 SYNOPSIS 🌸

the signature is giving long boi, but every type and comma stays exactly where it belongs:

       int ib_sa_service_rec_get (struct ib_sa_client *client , struct
       ib_device *device , u32 port_num , struct sa_service_rec *rec ,
       ib_sa_comp_mask comp_mask , unsigned long timeout_ms , gfp_t gfp_mask ,
       void (*callback)(int status, struct sa_service_rec *resp, unsigned int
       num_services, void *context) , void *context , struct ib_sa_query
       **sa_query );

πŸ’– ARGUMENTS πŸ’–

  • client β€” SA client πŸ‘‘
  • device β€” device to send query on πŸ¦‹
  • port_num β€” port number to send query on πŸŽ€
  • rec β€” Service Record to send in query πŸ’Œ
  • comp_mask β€” component mask to send in query 🧚
  • timeout_ms β€” time to wait for response ⏳
  • gfp_mask β€” GFP mask to use for internal allocations 🌱
  • callback β€” function called when query completes, times out or is canceled 😭
  • context β€” opaque user context passed to callback 🫢
  • sa_query β€” query context, used to cancel query πŸ’€

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so what this actually does: send a Service Record Get query to the SA to look up a path 🌈. The callback function will be called when the query completes (or fails), and status is the tea: 0 for a successful response, -EINTR if the query is canceled, -ETIMEDOUT if the query timed out, or -EIO if an error occurred sending the query. And bestie, important: the resp parameter of the callback is only valid if status is 0 β€” no cap 🧒.

If the return value of ib_sa_service_rec_get is negative, it is an error code. Otherwise it is a query ID that can be used to cancel the query πŸ‘‘βœ¨.

πŸŽ€ SEE ALSO πŸŽ€

Kernel file ./drivers/infiniband/core/sa_query.c and these besties: ib_sa_cancel_query(9), ib_init_ah_attr_from_path(9), ib_sa_path_rec_get(9) πŸ’–


mwah πŸ’‹ β€” source/version: ./drivers/infiniband/core, dated October 2026. periodt. 🫢

πŸ“¦ where this page comes from