STRUCT IB_USER_MAD_HDR(9)
β¨ struct ib_user_mad_hdr(9) β¨
okay bestie, welcome to the Kernel API Manual entry for struct ib_user_mad_hdr β she's giving MAD packet header energy and honestly? iconic. π
This layout is the whole reason you can specify and receive the P_Key index. But listen β to actually use that capability, your app must call the IB_USER_MAD_ENABLE_PKEY ioctl on the user MAD file handle before it does literally anything else with that file handle. no cap. first move or nothing. π
β¨ SYNOPSIS β¨
struct ib_user_mad_hdr {
__u32 id;
__u32 status;
__u32 timeout_ms;
__u32 retries;
__u32 length;
__be32 qpn;
__be32 qkey;
__be16 lid;
__u8 sl;
__u8 path_bits;
__u8 grh_present;
__u8 gid_index;
__u8 hop_limit;
__u8 traffic_class;
__u8 gid[16];
__be32 flow_label;
__u16 pkey_index;
__u8 reserved[6];
};
π¦ Members π¦
time for the member-by-member vibe check, and every single one of them ate:
idβ the ID of the agent MAD, whether it's coming in or going out.statusβ0on a successful receive,ETIMEDOUTif no response ever showed up (in that case the transaction ID indata[]gets set to the TID of the original request). On send? this one's ignored, she's not relevant.timeout_msβ how many milliseconds to wait for a response. Unset on receive.retriesβ the number of automatic retries to attempt. go get 'em.qpnβ the remote QP number, received from or to be sent to.qkeyβ the remote Q_Key to be sent with. Unset on receive.lidβ the remote lid, received from or to be sent to.slβ the service level, received with or to be sent with.path_bitsβ the local path bits, received with or to be sent with.grh_presentβ if this is set, a GRH was received / should be sent. π₯gid_indexβ the local GID index to send with. Unset on receive.hop_limitβ the hop limit in the GRH.traffic_classβ the traffic class in the GRH.gidβ the remote GID in the GRH.flow_labelβ the flow label in the GRH.pkey_indexβ the P_Key index. (the moment we've all been waiting for π)reserved[6]β reserved. she's just sitting there, minding her business, do not touch.
π SEE ALSO π
go read these next, i'm obsessed:
- the kernel file
./include/uapi/rdma/ib_user_mad.h struct ib_user_mad_hdr_old(9)struct ib_user_mad(9)struct ib_user_mad_reg_req(9)struct ib_user_mad_reg_req2(9)
and that's the whole page, bestie π«Ά huge shoutout to ./include/uapi/rdma for housing this masterpiece, dated October 2026 β literally stamped and everything. periodt. ππΈ
π¦ 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