ib_create_send_mad(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ib_create_send_mad(9) β€” a Kernel API Manual moment

okay so bestie, we're diving into the Kernel API Manual today and honestly? this one's a little gem. it's ib_create_send_mad, and it's about to hand you a whole send-ready MAD situation. let's get into it 🫢


✨ NAME ✨

ib_create_send_mad β€” allocate and initialize a data buffer plus a work request, all for sending a MAD. yes, both things, one call. we love an efficient icon πŸ’–


🌸 SYNOPSIS 🌸

struct ib_mad_send_buf * ib_create_send_mad (struct ib_mad_agent
*mad_agent , u32 remote_qpn , u16 pkey_index , int rmpp_active , int
hdr_len , int data_len , gfp_t gfp_mask , u8 base_version );

eight arguments. count 'em. she's thorough πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • mad_agent β€” the registered MAD service you're associating with the MAD. like, who's this MAD for? this guy. 🀝
  • remote_qpn β€” the QPN of the receiving node, i.e. where this thing is headed.
  • pkey_index β€” which PKey the MAD will be sent using. ⚠️ heads up: this field is valid only if the remote_qpn is QP 1. no cap.
  • rmpp_active β€” tells you if the send will enable RMPP.
  • hdr_len β€” the size of the data header of the MAD. and this length should include the common MAD header, the RMPP header, plus any class specific header. yes, all three, don't leave anybody out πŸ’…
  • data_len β€” the size of any user-transferred data. and good news: the call will automatically adjust the allocated buffer size to account for any additional padding that may be necessary. it's giving "we handled it" ✨
  • gfp_mask β€” the GFP mask used for the memory allocation. the allocation lore 🧚
  • base_version β€” Base Version of this MAD. periodt.

πŸ¦‹ DESCRIPTION πŸ¦‹

so this routine allocates a MAD for sending. the returned MAD send buffer will reference a data buffer usable for sending a MAD, along with an initialized work request structure. two-for-one, main character energy πŸ‘‘

and here's the fun part: users may modify the returned MAD data buffer before posting the send. it's yours, customize away 🎨

now the deets you actually need to remember: the returned MAD header, class specific headers, and any padding will be cleared. so who's responsible for initializing the common MAD header, any class specific header, and the MAD data area? that would be you, bestie 😭 don't forget, fr fr.

one lil exception though β€” if rmpp_active is set, the RMPP header will be initialized for sending. so that part's handled. slay πŸ’–

πŸ’œ SEE ALSO πŸ’œ

kernel file ./include/rdma/ib_mad.h, plus this whole friend group right here:


and that's the whole vibe check, bestie 🫢 this page lives in ./include/rdma, dated October 2026, and it'll always answer to the name ib_create_send_mad(9). go forth and send those MADs πŸ’…πŸ’–βœ¨

πŸ“¦ where this page comes from