srpt_cm_handler(9)
π srpt_cm_handler(9) β¨
okay so bestie, welcome to the kernel API manual, this one's srpt_cm_handler and it is literally the IB connection manager callback function π so if you're living in the SRPT driver (that's the SCSI RDMA protocol target, iykyk) this is the little guy the connection manager rings up when stuff happens.
πΈ SYNOPSIS πΈ
int srpt_cm_handler (struct ib_cm_id *cm_id , const struct ib_cm_event
*event );
that's the whole vibe. no cap, that's it. π
π¦ ARGUMENTS π¦
cm_idβ the IB/CM connection identifier. like, which connection are we even talking about, bestie? this one. πeventβ the IB/CM event. the whole reason we're here, the main character of the situation. β¨
π« DESCRIPTION π«
so here's the thing: a non-zero return value will cause the caller to destroy the CM ID. that's it, that's the deal, that's the tea. π a non-zero return = the CM ID gets yeeted by whoever called you.
π NOTE π
ok this part is highkey important so pay attention, bestie π
srpt_cm_handler must only return a non-zero value when transferring ownership of the cm_id to a channel by srpt_cm_req_recv failed. like, that specific case, and literally nothing else.
Returning a non-zero value in any other case will trigger a race with the ib_destroy_cm_id call in srpt_release_channel. π«Ά and we do NOT want a race, races are not slay, races are giving "3am debugging session" energy. do not do it. periodt.
π§ SEE ALSO π§
Kernel file ./drivers/infiniband/ulp/srpt/ib_srpt.c β that's where the source lives, go look, it's fine, it's a lot but it's fine π
and now the whole friend group, because kernel functions travel in packs apparently π
srpt_event_handler(9),srpt_srq_event(9),srpt_qp_event(9)srpt_set_ioc(9),srpt_get_class_port_info(9),srpt_get_iou(9),srpt_get_ioc(9),srpt_get_svc_entries(9),srpt_mgmt_method_get(9)srpt_mad_send_handler(9),srpt_mad_recv_handler(9),srpt_refresh_port(9),srpt_unregister_mad_agent(9)srpt_alloc_ioctx(9),srpt_free_ioctx(9),srpt_alloc_ioctx_ring(9),srpt_free_ioctx_ring(9)srpt_set_cmd_state(9),srpt_test_and_set_cmd_state(9)srpt_post_recv(9),srpt_zerolength_write(9),srpt_get_desc_tbl(9)srpt_init_ch_qp(9),srpt_ch_qp_rtr(9),srpt_ch_qp_rts(9),srpt_ch_qp_err(9)srpt_get_send_ioctx(9),srpt_abort_cmd(9),srpt_rdma_read_done(9)srpt_build_cmd_rsp(9),srpt_build_tskmgmt_rsp(9),srpt_handle_cmd(9),srpt_handle_tsk_mgmt(9),srpt_handle_new_iu(9),srpt_send_done(9)srpt_create_ch_ib(9),srpt_close_ch(9),srpt_cm_req_recv(9),srpt_cm_rtu_recv(9)srpt_queue_response(9),srpt_release_sport(9),srpt_lookup_port(9)srpt_add_one(9),srpt_remove_one(9),srpt_close_session(9),srpt_parse_i_port_id(9)srpt_make_tpg(9),srpt_drop_tpg(9),srpt_make_tport(9),srpt_drop_tport(9),srpt_init_module(9)
and that's the page, bestie π«Ά that's the whole thing. this one came out of ./drivers/infiniband/ulp/srpt, dated October 2026, and it is iconic for it. mwah. ππ
./drivers/infiniband/ulp/srpt October 2026 srpt_cm_handler(9)
π¦ 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