rdma_read_gids(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– rdma_read_gids(9) β€” like, the Kernel API Manual page, bestie πŸ’–

okay so this is rdma_read_gids, and it lives in the rdma_read_gids(9) section of the Kernel API Manual β€” yes that's the manual name, I'm not making it up ✨. Sit down, grab a boba, and let me tell you about the little function that hands you your GIDs.


πŸŽ€ NAME πŸŽ€

rdma_read_gids β€” returns the SGID and DGID that were used for establishing the connection, and honestly? iconic behaviour πŸ’….

so like, the way this works: you can use it after rdma_resolve_addr() on the client side. You can also use it on a new connection on the server side. It's applicable to IB, RoCE, and iWarp β€” it's giving versatile, fr fr πŸ¦‹.

big caveat though, don't skip this: if cm_id isn't bound yet to the RDMA device, it doesn't copy any SGID or DGID to the given pointers. Nothing. Nada. Ghosted 😭.


✨ SYNOPSIS ✨

void rdma_read_gids (struct rdma_cm_id *cm_id , union ib_gid *sgid ,
union ib_gid *dgid );

that's the whole signature, she's cute, she's small, she does exactly one thing 🫢


🌸 ARGUMENTS 🌸

  • cm_id β€” -- undescribed -- πŸ’€ yeah that's literally what the page says, the docs really said "not me forgetting to describe this one." I'm not gonna invent lore for it, no cap.
  • sgid β€” pointer to SGID where the SGID will be returned. It is optional, so if you're not feeling it, pass on it, queen πŸ‘‘.
  • dgid β€” pointer to DGID where the DGID will be returned. Also optional. Also can be skipped. We love a flexible parameter ✨.

⭐ NOTE ⭐

listen. listen. this API should not be used by any new ULPs or new code. nope. nope. not you. πŸ™ˆ

If you're a user interested in querying GIDs, you should instead refer to the path record of the rdma_cm_id to query the GIDs. That's the move, that's the vibe, that's the current timeline 🌈.

This API is provided for compatibility for existing users β€” so it's like that one friend who's still on the old app version. We keep them around, we love them, but don't join them πŸ’€.


πŸ¦‹ SEE ALSO πŸ¦‹

okay this list is LONG and I'm obsessed with her for it β€” kernel file ./include/rdma/rdma_cm.h plus a whole entourage:

go read them all, iykyk πŸ§šβ€β™€οΈ


fr fr reminder bestie: new code? don't touch this one. path record of the rdma_cm_id is the way. periodt. πŸ’œ

and that's the page!! πŸŽ€ sign-off time: this came out of ./include/rdma, dated October 2026, and the whole thing is rdma_read_gids(9) β€” slay, bye, go resolve some addresses responsibly πŸ’–πŸ”₯

πŸ“¦ where this page comes from