RDMA_GET_CM_EVENT(3)
π RDMA_GET_CM_EVENT(3) β from the Librdmacm Programmer's Manual π
okay bestie, sit down, hydrate, and let me tell you about the single most important little function in your whole RDMA CM era. this is rdma_get_cm_event and it is literally how you find out that anything at all has happened to your connection. no cap.
β¨ NAME β¨
rdma_get_cm_event β Retrieves the next pending communication event.
like... it gets you the next event. that's the whole job. she's a queen for that. π
πΈ SYNOPSIS πΈ
#include <rdma/rdma_cma.h>
int rdma_get_cm_event (struct rdma_event_channel *channel, struct
rdma_cm_event **event);
π ARGUMENTS π
channelβ Event channel to check for events. this is the lil mailbox you're peeking into.eventβ Allocated information about the next communication event. the library fills this pointer in for you, so you're passing a pointer-to-a-pointer. yes it's giving double pointer energy. it's fine. breathe.
π¦ DESCRIPTION π¦
Retrieves a communication event. If no events are pending, by default, the call will block until an event is received. so she'll just sit there. patiently. waiting. like a bestie holding your spot in line.
π RETURN VALUE π
Returns 0 on success, or -1 on error. If an error occurs, errno will be set to indicate the failure reason. check your errno, bestie, she always knows what went wrong.
π₯ NOTES π₯
The default synchronous behavior of this routine can be changed by modifying the file descriptor associated with the given channel. (yes, the channel has a file descriptor. yes, you can mess with it. yes, that changes the blocking vibe.)
All events that are reported must be acknowledged by calling rdma_ack_cm_event. Destruction of an rdma_cm_id will block until related events have been acknowledged.
β οΈ bestie listen to me. if you don't ack your events, rdma_destroy_id will just sit there and BLOCK. forever. no cap. ack your events. π
π EVENT DATA π
Communication event details are returned in the rdma_cm_event structure. This structure is allocated by the rdma_cm and released by the rdma_ack_cm_event routine. Details of the rdma_cm_event structure are given below.
idβ Therdma_cmidentifier associated with the event. If the event type isRDMA_CM_EVENT_CONNECT_REQUEST, then this references a new id for that communication. fresh id just dropped β¨listen_idβ ForRDMA_CM_EVENT_CONNECT_REQUESTevent types, this references the corresponding listening request identifier.eventβ Specifies the type of communication event which occurred. See EVENT TYPES below.statusβ Returns any asynchronous error information associated with an event. The status is zero if the operation was successful, otherwise the status value is non-zero and is either set to a negativeerrnoor a transport specific value. For details on transport specific status values, see the event type information below.paramβ Provides additional details based on the type of event. Users should select theconnorudsubfields based on therdma_port_spaceof therdma_cm_idassociated with the event. See UD EVENT DATA and CONN EVENT DATA below.
π«Ά UD EVENT DATA π«Ά
Event parameters related to unreliable datagram (UD) services: RDMA_PS_UDP and RDMA_PS_IPOIB. The UD event data is valid for RDMA_CM_EVENT_ESTABLISHED and RDMA_CM_EVENT_MULTICAST_JOIN events, unless stated otherwise.
private_dataβ References any user-specified data associated withRDMA_CM_EVENT_CONNECT_REQUESTorRDMA_CM_EVENT_ESTABLISHEDevents. The data referenced by this field matches that specified by the remote side when callingrdma_connectorrdma_accept. This field isNULLif the event does not include private data. The buffer referenced by this pointer is deallocated when callingrdma_ack_cm_event.private_data_lenβ The size of the private data buffer. Users should note that the size of the private data buffer may be larger than the amount of private data sent by the remote side. Any additional space in the buffer will be zeroed out. so don't go reading past the actual data and then acting surprised, okay?ah_attrβ Address information needed to send data to the remote endpoint(s). Users should use this structure when allocating their address handle.qp_numβ QP number of the remote endpoint or multicast group.qkeyβ QKey needed to send data to the remote endpoint(s).
π CONN EVENT DATA π
Event parameters related to connected QP services: RDMA_PS_TCP. The connection related event data is valid for RDMA_CM_EVENT_CONNECT_REQUEST and RDMA_CM_EVENT_ESTABLISHED events, unless stated otherwise.
private_dataβ References any user-specified data associated with the event. The data referenced by this field matches that specified by the remote side when callingrdma_connectorrdma_accept. This field isNULLif the event does not include private data. The buffer referenced by this pointer is deallocated when callingrdma_ack_cm_event.private_data_lenβ The size of the private data buffer. Users should note that the size of the private data buffer may be larger than the amount of private data sent by the remote side. Any additional space in the buffer will be zeroed out.responder_resourcesβ The number of responder resources requested of the recipient. This field matches the initiator depth specified by the remote node when callingrdma_connectandrdma_accept.initiator_depthβ The maximum number of outstanding RDMA read/atomic operations that the recipient may have outstanding. This field matches the responder resources specified by the remote node when callingrdma_connectandrdma_accept.flow_controlβ Indicates if hardware level flow control is provided by the sender.retry_countβ ForRDMA_CM_EVENT_CONNECT_REQUESTevents only, indicates the number of times that the recipient should retry send operations.rnr_retry_countβ The number of times that the recipient should retry receiver not ready (RNR) NACK errors.srqβ Specifies if the sender is using a shared-receive queue.qp_numβ Indicates the remote QP number for the connection.
β EVENT TYPES β
The following types of communication events may be reported. the whole menu, bestie. every single one. don't skip a bite. π
RDMA_CM_EVENT_ADDR_RESOLVEDβ Address resolution (rdma_resolve_addr) completed successfully.RDMA_CM_EVENT_ADDR_ERRORβ Address resolution (rdma_resolve_addr) failed.RDMA_CM_EVENT_ROUTE_RESOLVEDβ Route resolution (rdma_resolve_route) completed successfully.RDMA_CM_EVENT_ROUTE_ERRORβ Route resolution (rdma_resolve_route) failed.RDMA_CM_EVENT_CONNECT_REQUESTβ Generated on the passive side to notify the user of a new connection request.RDMA_CM_EVENT_CONNECT_RESPONSEβ Generated on the active side to notify the user of a successful response to a connection request. It is only generated onrdma_cm_id's that do not have a QP associated with them.RDMA_CM_EVENT_CONNECT_ERRORβ Indicates that an error has occurred trying to establish or a connection. May be generated on the active or passive side of a connection.RDMA_CM_EVENT_UNREACHABLEβ Generated on the active side to notify the user that the remote server is not reachable or unable to respond to a connection request. If this event is generated in response to a UD QP resolution request over InfiniBand, the event status field will contain anerrno, if negative, or the status result carried in the IB CM SIDR REP message.RDMA_CM_EVENT_REJECTEDβ Indicates that a connection request or response was rejected by the remote end point. The event status field will contain the transport specific reject reason if available. Under InfiniBand, this is the reject reason carried in the IB CM REJ message. it's giving... rejected. πRDMA_CM_EVENT_ESTABLISHEDβ Indicates that a connection has been established with the remote end point. WE'RE SO BACK. πRDMA_CM_EVENT_DISCONNECTEDβ The connection has been disconnected.RDMA_CM_EVENT_DEVICE_REMOVALβ The local RDMA device associated with therdma_cm_idhas been removed. Upon receiving this event, the user must destroy the relatedrdma_cm_id.RDMA_CM_EVENT_MULTICAST_JOINβ The multicast join operation (rdma_join_multicast) completed successfully.RDMA_CM_EVENT_MULTICAST_ERRORβ An error either occurred joining a multicast group, or, if the group had already been joined, on an existing group. The specified multicast group is no longer accessible and should be rejoined, if desired.RDMA_CM_EVENT_ADDR_CHANGEβ The network device associated with this ID through address resolution changed its HW address, eg following of bonding failover. This event can serve as a hint for applications who want the links used for their RDMA sessions to align with the network stack.RDMA_CM_EVENT_TIMEWAIT_EXITβ The QP associated with a connection has exited its timewait state and is now ready to be re-used. After a QP has been disconnected, it is maintained in a timewait state to allow any in flight packets to exit the network. After the timewait state has completed, therdma_cmwill report this event.RDMA_CM_EVENT_ADDRINFO_RESOLVEDβ Address information resolution (rdma_resolve_addrinfo) completed successfully.RDMA_CM_EVENT_ADDRINFO_ERRORβ Address information resolution (rdma_resolve_addrinfo) failed.RDMA_CM_EVENT_USERβ This allows a user-defined event to be written to the RDMA CM event channel. Event details are specified by the user and not interpreted by thelibrdmacm. This event is useful for a multi-threaded application to signal a thread which may be waiting on the RDMA CM event channel. a little "hey bestie wake up" ping for your thread. iconic behavior honestly. π«Ά
π SEE ALSO π
rdma_ack_cm_event(3), rdma_create_event_channel(3), rdma_resolve_addr(3), rdma_resolve_route(3), rdma_connect(3), rdma_listen(3), rdma_join_multicast(3), rdma_destroy_id(3), rdma_event_str(3),rdma_write_cm_event(3)
and that's the whole page, bestie!! this one's brought to you by librdmacm, dated 2007-10-31 β she's been serving cunt since 2007 and she's still the main character of your event loop. go ack your events. mwah. πβ¨π¦
π¦ where this page comes from
- alpine 3.24: rdma-core-doc 61.0-r0 Β· GPL-2.0-only OR BSD-2-Clause
- arch rolling: rdma-core 65.0-1 Β· GPL-2.0-or-later OR LicenseRef-OpenIB.org-BSD-MIT AND GPL-2.0-or-later OR LicenseRef-OpenIB.org-BSD-FreeBSD AND GPL-2.0-or-later OR LicenseRef-Intel-BSD-3-Clause AND GPL-2.0-or-later OR LicenseRef-PathScale-BSD-Patent-License AND CC0-1.0 AND MIT AND BSD-2-Clause AND CPL-1.0 OR BSD-2-Clause OR GPL-2.0-or-later
- centos-stream 10: rdma-core-devel 62.0-3.el10 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- fedora 44: rdma-core-devel 61.0-2.fc44 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 44: rdma-core-devel 61.0-2.fc44 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 44: rdma-core-devel 61.1^20260812git975bdaf-1.fc44 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 44: rdma-core-devel 61.1^20260812git975bdaf-1.fc44 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- nixos 26.05: rdma-core 62.0
- nixpkgs unstable: rdma-core 65.0
- ubuntu resolute: librdmacm-dev 61.0-2ubuntu3 Β· BSD-MIT OR GPL-2.0-only
- ubuntu stonking: librdmacm-dev 64.0-1ubuntu1 Β· BSD-MIT OR GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms