ib_init_ah_attr_from_wc(9)
π 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_wcreturns 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.
- when
π¨ do not skip this part, i'm so serious π¨ the user must invokerdma_cleanup_ah_attr_gid_attrto release the reference to SGID attributes which are initialized usingib_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 π«Άπ
struct rdma_stat_desc(9)struct rdma_hw_stats(9)ib_rate_to_mult(9)ib_rate_to_mbps(9)ib_port_attr_to_speed_info(9)enum ib_mr_type(9)struct ib_mr_status(9)mult_to_ib_rate(9)struct ib_udata(9)struct rdma_netdev(9)struct ib_device_ops(9)ib_get_client_data(9)ib_modify_qp_is_ok(9)rdma_cap_ib_switch(9)rdma_start_port(9)rdma_for_each_port(9)rdma_end_port(9)rdma_cap_ib_mad(9)rdma_cap_opa_mad(9)rdma_cap_ib_smi(9)rdma_cap_ib_cm(9)rdma_cap_iw_cm(9)rdma_cap_ib_sa(9)rdma_cap_ib_mcast(9)rdma_cap_af_ib(9)rdma_cap_eth_ah(9)rdma_cap_opa_ah(9)rdma_max_mad_size(9)rdma_cap_roce_gid_table(9)rdma_core_cap_opa_port(9)rdma_mtu_enum_to_int(9)rdma_mtu_from_attr(9)ib_alloc_pd(9)ib_dealloc_pd(9)rdma_create_ah(9)rdma_create_user_ah(9)ib_get_gids_from_rdma_hdr(9)ib_get_rdma_header_version(9)ib_create_ah_from_wc(9)rdma_modify_ah(9)rdma_query_ah(9)rdma_destroy_ah_user(9)rdma_destroy_ah(9)ib_modify_srq(9)ib_query_srq(9)ib_destroy_srq_user(9)ib_destroy_srq(9)ib_post_srq_recv(9)ib_create_qp(9)ib_modify_qp_with_udata(9)ib_modify_qp(9)ib_query_qp(9)ib_destroy_qp(9)ib_open_qp(9)ib_close_qp(9)ib_post_send(9)ib_post_recv(9)ib_alloc_cq_any(9)rdma_set_cq_moderation(9)ib_destroy_cq_user(9)ib_destroy_cq(9)ib_poll_cq(9)ib_req_notify_cq(9)ib_virt_dma_to_ptr(9)ib_virt_dma_to_page(9)ib_dma_mapping_error(9)ib_dma_map_single(9)ib_dma_unmap_single(9)ib_dma_map_page(9)ib_dma_unmap_page(9)ib_dma_map_bvec(9)ib_dma_unmap_bvec(9)ib_dma_map_sgtable_attrs(9)ib_dma_map_sg(9)ib_dma_unmap_sg(9)ib_dma_max_seg_size(9)ib_dma_sync_single_for_cpu(9)ib_dma_sync_single_for_device(9)ib_dereg_mr_user(9)ib_dereg_mr(9)ib_update_fast_reg_key(9)ib_inc_rkey(9)ib_attach_mcast(9)ib_detach_mcast(9)ib_check_mr_status(9)ib_device_try_get(9)rdma_ah_find_type(9)ib_lid_cpu16(9)ib_lid_be16(9)rdma_roce_rescan_device(9)rdma_device_to_ibdev(9)ibdev_to_node(9)rdma_device_to_drv_device(9)rdma_flow_label_to_udp_sport(9)rdma_calc_flow_label(9)rdma_get_udp_sport(9)
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
- 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