ib_cm_handler(9)
β¨ ib_cm_handler(9) β¨
okay bestie, we're in the Kernel API Manual today and this one is ib_cm_handler β the user-defined callback that processes communication events π
like, you write it, the kernel calls it, it's giving "you're the main character of this event loop" energy π
πΈ SYNOPSIS πΈ
int ib_cm_handler (struct ib_cm_id *cm_id , const struct ib_cm_event
*event );
literally just one function signature, no cap π«Ά
π¦ ARGUMENTS π¦
cm_idβ the communication identifier that's associated with the event being reported. that's your girl πeventβ the actual info about the communication event that went down π
π DESCRIPTION π
okay so here's the tea β β when IB_CM_REQ_RECEIVED and IB_CM_SIDR_REQ_RECEIVED communication events get generated as a result of listen requests, that results in the allocation of a new cm_id β¨ and that shiny new cm_id gets returned to the user through this callback. and heads up: clients are responsible for destroying the new cm_id β yes, you, bestie, it's your job π
for peer-to-peer IB_CM_REQ_RECEIVED and all other events, the returned cm_id corresponds to a user's existing communication identifier. so no new allocation, it's just the one you already had π«
π¨ important safety moment π¨ users may not callib_destroy_cm_idwhile in the context of this callback. like, do not do it, fr fr π however β returning a non-zero value instructs the communication manager to destroy thecm_idafter the callback completes. so that's the slay way to do it π
π SEE ALSO π
Kernel file ./include/rdma/ib_cm.h and all these iconic siblings:
ib_create_cm_id(9)ib_destroy_cm_id(9)ib_cm_listen(9)ib_send_cm_req(9)ib_send_cm_rep(9)ib_send_cm_rtu(9)ib_send_cm_dreq(9)ib_send_cm_drep(9)ib_cm_notify(9)ib_send_cm_rej(9)ib_prepare_cm_mra(9)ib_cm_init_qp_attr(9)ib_send_cm_sidr_req(9)ib_send_cm_sidr_rep(9)ibcm_reject_msg(9)
and that's the whole page, bestie, you ate that π this came out of ./include/rdma and it's dated October 2026 β yeah, the future, we stay ahead ππ bye pookie, go destroy your cm_id responsibly πΈβ¨π«Ά
π¦ 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