ib_init_ah_attr_from_wc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ ib_init_ah_attr_from_wc β€” like, the Kernel API Manual page, bestie πŸŽ€

okay so picture this: you're deep in ./include/rdma/ib_verbs.h, you just got a work completion, and now you need address handle attributes. yeah. that's the whole vibe of this page. it's giving "kernel API manual" energy and honestly? iconic. let's get into it ✨


πŸ’– NAME πŸ’–

ib_init_ah_attr_from_wc β€” literally initializes address handle attributes from a work completion. that's it. that's the job. no cap 🫢


🌸 SYNOPSIS 🌸

int ib_init_ah_attr_from_wc (struct ib_device *device , u32 port_num ,
const struct ib_wc *wc , const struct ib_grh *grh , struct rdma_ah_attr
*ah_attr );

five params, one int back. slay. πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

here's the breakdown, bestie, one by one πŸ‘‘

  • device β€” the device the received message arrived on. like, which device. that one. πŸ–₯️
  • port_num β€” the port the received message arrived on. (u32, for the record.) πŸ”Œ
  • wc β€” the work completion that's associated with the received message. your main character struct tbh. πŸ“¬
  • grh β€” references the received global route header. important: this parameter is ignored unless the work completion indicates that the GRH is valid. so don't come at it if it's not valid, it's literally not listening πŸ™ˆ
  • ah_attr β€” the returned attributes, the ones you can use when creating an address handle for replying to the message. now here's the tea, and it's a two-parter:
    • when ib_init_ah_attr_from_wc returns success, (a) for IB link layer it optionally contains a reference to SGID attribute when GRH is present for IB link layer.
    • (b) for RoCE link layer it contains a reference to SGID attribute.
🚨 do not skip this part, i'm so serious 🚨 the user must invoke rdma_cleanup_ah_attr_gid_attr to release the reference to SGID attributes which are initialized using ib_init_ah_attr_from_wc. like… you gotta. it's not optional. memory leaks are not the vibe. 😭πŸ”₯

🌈 SEE ALSO 🌈

the kernel file up in here is ./include/rdma/ib_verbs.h, and buckle up bestie because this list is long β€” everyone in the RDMA friend group showed up to the party πŸ«ΆπŸ’œ

like, ninety-something entries. we're literally so full. but we ate. periodt. πŸ‘‘πŸ”₯


🧚 the cute lil sign-off 🧚

and that's the page!! sourced from ./include/rdma, dated October 2026, and it lives under the Kernel API Manual umbrella. go init those ah attrs bestie, and don't forget the cleanup πŸ’– bye!! β­πŸ“πŸ’œ

πŸ“¦ where this page comes from