Home

rdmagetcmevent

rdma_get_cm_event is a function in the librdmacm library used to retrieve a completion manager (CM) event from a specified event channel. It blocks until a CM event becomes available or an error occurs, returning the event through a pointer parameter. The function is typically used in the management loop of RDMA applications to respond to changes in connection state or CM activity.

To use it, an application first creates an event channel with rdma_create_event_channel and then initiates an

The events delivered by rdma_get_cm_event are represented by a struct rdma_cm_event, which includes the event type

This function is a core part of the RDMA Connection Manager API and is used in user-space

RDMA
connection
lifecycle
using
the
librdmacm
API
(for
example,
creating
a
rdma_cm_id,
resolving
addresses,
and
initiating
or
accepting
connections).
The
main
loop
repeatedly
calls
rdma_get_cm_event,
processes
the
returned
event,
and
then
acknowledges
the
event
with
rdma_ack_cm_event
to
free
resources.
This
pattern
allows
the
application
to
react
to
various
lifecycle
events
such
as
connection
requests,
establishments,
or
disconnections.
in
event
and
a
pointer
to
an
associated
rdma_cm_id
in
id.
Event
types
cover
stages
such
as
address
and
route
resolution,
connect
requests,
established
connections,
and
disconnections,
along
with
other
lifecycle
changes
like
a
connection
being
rejected
or
error
conditions.
Proper
handling
typically
involves
inspecting
the
event
type,
taking
appropriate
actions
(e.g.,
creating
resources,
initiating
connections,
or
cleaning
up),
and
then
acknowledging
the
event
before
retrieving
the
next
one.
networking
code
to
manage
RDMA
connections
through
a
structured
event-driven
model.
It
requires
including
the
header
rdma/rdma_cma.h
and
linking
against
the
librdmacm
library.