srpt_cm_handler(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 🌈


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