1 .\" Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md
2 .TH "RDMA_CM" 7 "2010-07-19" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
4 rdma_cm \- RDMA communication manager.
6 .B "#include <rdma/rdma_cma.h>"
8 Used to establish communication over RDMA transports.
10 The RDMA CM is a communication manager used to setup reliable, connected
11 and unreliable datagram data transfers. It provides an RDMA transport
12 neutral interface for establishing connections. The API concepts are
13 based on sockets, but adapted for queue pair (QP) based semantics:
14 communication must be over a specific RDMA device, and data transfers
17 The RDMA CM can control both the QP and communication management (connection setup /
18 teardown) portions of an RDMA API, or only the communication management
19 piece. It works in conjunction with the verbs
20 API defined by the libibverbs library. The libibverbs library provides the
21 underlying interfaces needed to send and receive data.
23 The RDMA CM can operate asynchronously or synchronously. The mode of
24 operation is controlled by the user through the use of the rdma_cm event channel
25 parameter in specific calls. If an event channel is provided, an rdma_cm identifier
26 will report its event data (results of connecting, for example), on that channel.
27 If a channel is not provided, then all rdma_cm operations for the selected
28 rdma_cm identifier will block until they complete.
30 The rdma_cm supports the full range of verbs available through the libibverbs
31 library and interfaces. However, it also provides wrapper functions for some
32 of the more commonly used verbs funcationality. The full set of abstracted
35 rdma_reg_msgs - register an array of buffers for sending and receiving
37 rdma_reg_read - registers a buffer for RDMA read operations
39 rdma_reg_write - registers a buffer for RDMA write operations
41 rdma_dereg_mr - deregisters a memory region
43 rdma_post_recv - post a buffer to receive a message
45 rdma_post_send - post a buffer to send a message
47 rdma_post_read - post an RDMA to read data into a buffer
49 rdma_post_write - post an RDMA to send data from a buffer
51 rdma_post_recvv - post a vector of buffers to receive a message
53 rdma_post_sendv - post a vector of buffers to send a message
55 rdma_post_readv - post a vector of buffers to receive an RDMA read
57 rdma_post_writev - post a vector of buffers to send an RDMA write
59 rdma_post_ud_send - post a buffer to send a message on a UD QP
61 rdma_get_send_comp - get completion status for a send or RDMA operation
63 rdma_get_recv_comp - get information about a completed receive
64 .SH "CLIENT OPERATION"
65 This section provides a general overview of the basic operation for the active,
66 or client, side of communication. This flow assume asynchronous operation with
67 low level call details shown. For
68 synchronous operation, calls to rdma_create_event_channel, rdma_get_cm_event,
69 rdma_ack_cm_event, and rdma_destroy_event_channel
70 would be eliminated. Abstracted calls, such as rdma_create_ep encapsulate
71 several of these calls under a single API.
72 Users may also refer to the example applications for
73 code samples. A general connection flow would be:
75 retrieve address information of the destination
76 .IP rdma_create_event_channel
77 create channel to receive events
79 allocate an rdma_cm_id, this is conceptually similar to a socket
81 obtain a local RDMA device to reach the remote address
83 wait for RDMA_CM_EVENT_ADDR_RESOLVED event
87 allocate a QP for the communication
88 .IP rdma_resolve_route
89 determine the route to the remote address
91 wait for RDMA_CM_EVENT_ROUTE_RESOLVED event
95 connect to the remote server
97 wait for RDMA_CM_EVENT_ESTABLISHED event
101 Perform data transfers over connection
104 .IP rdma_get_cm_event
105 wait for RDMA_CM_EVENT_DISCONNECTED event
106 .IP rdma_ack_cm_event
111 release the rdma_cm_id
112 .IP rdma_destroy_event_channel
113 release the event channel
115 An almost identical process is used to setup unreliable datagram (UD)
116 communication between nodes. No actual connection is formed between QPs
117 however, so disconnection is not needed.
119 Although this example shows the client initiating the disconnect, either side
120 of a connection may initiate the disconnect.
121 .SH "SERVER OPERATION"
122 This section provides a general overview of the basic operation for the passive,
123 or server, side of communication. A general connection flow would be:
124 .IP rdma_create_event_channel
125 create channel to receive events
127 allocate an rdma_cm_id, this is conceptually similar to a socket
129 set the local port number to listen on
131 begin listening for connection requests
132 .IP rdma_get_cm_event
133 wait for RDMA_CM_EVENT_CONNECT_REQUEST event with a new rdma_cm_id
135 allocate a QP for the communication on the new rdma_cm_id
137 accept the connection request
138 .IP rdma_ack_cm_event
140 .IP rdma_get_cm_event
141 wait for RDMA_CM_EVENT_ESTABLISHED event
142 .IP rdma_ack_cm_event
145 Perform data transfers over connection
146 .IP rdma_get_cm_event
147 wait for RDMA_CM_EVENT_DISCONNECTED event
148 .IP rdma_ack_cm_event
155 release the connected rdma_cm_id
157 release the listening rdma_cm_id
158 .IP rdma_destroy_event_channel
159 release the event channel
164 error - see errno for more details
166 Most librdmacm functions return 0 to indicate success, and a -1 return value
167 to indicate failure. If a function operates asynchronously, a return value of 0
168 means that the operation was successfully started. The operation could still
169 complete in error; users should check the status of the related event. If the
170 return value is -1, then errno will contain additional information
171 regarding the reason for the failure.
173 Prior versions of the library would return -errno and not set errno for some cases
174 related to ENOMEM, ENODEV, ENODATA, EINVAL, and EADDRNOTAVAIL codes. Applications
175 that want to check these codes and have compatibility with prior library versions
176 must manually set errno to the negative of the return code if it is < -1.
179 rdma_ack_cm_event(3),
183 rdma_create_event_channel(3),
188 rdma_destroy_event_channel(3),
193 rdma_free_devices(3),
195 rdma_get_cm_event(3),
197 rdma_get_dst_port(3),
198 rdma_get_local_addr(3),
199 rdma_get_peer_addr(3),
200 rdma_get_recv_comp(3),
202 rdma_get_send_comp(3),
203 rdma_get_src_port(3),
204 rdma_join_multicast(3),
205 rdma_leave_multicast(3),
215 rdma_post_ud_send(3),
222 rdma_resolve_addr(3),
223 rdma_resolve_route(3),