RDMA_DISCONNECT(3)

πŸ’… RDMA_DISCONNECT πŸ’…

okay so bestie, welcome to RDMA_DISCONNECT(3) from the Librdmacm Programmer's Manual β€” yes it's a section 3 page, yes it's giving library-function realness, and yes we're gonna read it together like the iconic duo we are 🫢


✨ NAME ✨

rdma_disconnect β€” this function disconnects a connection. that's it. that's the whole job. she does one thing and she does it flawlessly πŸ’…


✨ SYNOPSIS ✨

#include <rdma/rdma_cma.h>

int rdma_disconnect (struct rdma_cm_id *id);

look at her. one include, one function call, zero drama (until the disconnect, but we'll get there) ✨


✨ ARGUMENTS ✨

  • id β€” the RDMA identifier. she's the main character here, the whole connection's little passport πŸŽ€

✨ DESCRIPTION ✨

so here's the tea, bestie β˜• β€” rdma_disconnect disconnects a connection, and it also transitions any associated QP (queue pair, iykyk) to the error state. and when a QP goes into the error state, that means it will flush any posted work requests straight to the completion queue. like, everything in flight gets yeeted to the CQ. periodt.

this routine should be called by both the client side and the server side of a connection. not just one. both. it takes two to tango and it takes two to disconnect, apparently πŸ’–

and after successfully disconnecting, an RDMA_CM_EVENT_DISCONNECTED event will be generated on both sides of the connection. so like, mutual closure. we love to see it 🌈


✨ RETURN VALUE ✨

  • returns 0 on success πŸŽ‰
  • returns -1 on error 😭

and if an error occurs, errno will be set to indicate the failure reason. classic. she's not gonna tell you what went wrong out loud, you have to go check errno yourself. mysterious queen energy πŸ‘‘

lowkey important: errno is where the actual truth lives, so always peek at it when you get that -1 bestie, fr fr.

✨ SEE ALSO ✨

the whole friend group 🫢 go read them too, they're all part of the same slay πŸ’œ


librdmacm Β· 2008-01-02 β€” that's the source, the version and the date, babes, and that's the whole page. you now know how to disconnect an RDMA connection like a pro. go forth and close those connections gracefully, bestie, and remember: QP to error state, work requests flushed, both sides get the event. slay πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from