Deleted Added
full compact
rdma_cm.h (219820) rdma_cm.h (278886)
1/*
2 * Copyright (c) 2005 Voltaire Inc. All rights reserved.
3 * Copyright (c) 2005 Intel Corporation. All rights reserved.
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the

--- 45 unchanged lines hidden (view full) ---

54 RDMA_CM_EVENT_UNREACHABLE,
55 RDMA_CM_EVENT_REJECTED,
56 RDMA_CM_EVENT_ESTABLISHED,
57 RDMA_CM_EVENT_DISCONNECTED,
58 RDMA_CM_EVENT_DEVICE_REMOVAL,
59 RDMA_CM_EVENT_MULTICAST_JOIN,
60 RDMA_CM_EVENT_MULTICAST_ERROR,
61 RDMA_CM_EVENT_ADDR_CHANGE,
1/*
2 * Copyright (c) 2005 Voltaire Inc. All rights reserved.
3 * Copyright (c) 2005 Intel Corporation. All rights reserved.
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the

--- 45 unchanged lines hidden (view full) ---

54 RDMA_CM_EVENT_UNREACHABLE,
55 RDMA_CM_EVENT_REJECTED,
56 RDMA_CM_EVENT_ESTABLISHED,
57 RDMA_CM_EVENT_DISCONNECTED,
58 RDMA_CM_EVENT_DEVICE_REMOVAL,
59 RDMA_CM_EVENT_MULTICAST_JOIN,
60 RDMA_CM_EVENT_MULTICAST_ERROR,
61 RDMA_CM_EVENT_ADDR_CHANGE,
62 RDMA_CM_EVENT_TIMEWAIT_EXIT
62 RDMA_CM_EVENT_TIMEWAIT_EXIT,
63 RDMA_CM_EVENT_ALT_ROUTE_RESOLVED,
64 RDMA_CM_EVENT_ALT_ROUTE_ERROR,
65 RDMA_CM_EVENT_LOAD_ALT_PATH,
66 RDMA_CM_EVENT_ALT_PATH_LOADED,
63};
64
65enum rdma_port_space {
66 RDMA_PS_SDP = 0x0001,
67 RDMA_PS_IPOIB = 0x0002,
67};
68
69enum rdma_port_space {
70 RDMA_PS_SDP = 0x0001,
71 RDMA_PS_IPOIB = 0x0002,
72 RDMA_PS_IB = 0x013F,
68 RDMA_PS_TCP = 0x0106,
69 RDMA_PS_UDP = 0x0111,
73 RDMA_PS_TCP = 0x0106,
74 RDMA_PS_UDP = 0x0111,
70 RDMA_PS_SCTP = 0x0183
71};
72
75};
76
77enum alt_path_type {
78 RDMA_ALT_PATH_NONE,
79 RDMA_ALT_PATH_PORT,
80 RDMA_ALT_PATH_LID,
81 RDMA_ALT_PATH_BEST
82};
83
73struct rdma_addr {
74 struct sockaddr_storage src_addr;
75 struct sockaddr_storage dst_addr;
76 struct rdma_dev_addr dev_addr;
77};
78
79struct rdma_route {
80 struct rdma_addr addr;

--- 15 unchanged lines hidden (view full) ---

96};
97
98struct rdma_ud_param {
99 const void *private_data;
100 u8 private_data_len;
101 struct ib_ah_attr ah_attr;
102 u32 qp_num;
103 u32 qkey;
84struct rdma_addr {
85 struct sockaddr_storage src_addr;
86 struct sockaddr_storage dst_addr;
87 struct rdma_dev_addr dev_addr;
88};
89
90struct rdma_route {
91 struct rdma_addr addr;

--- 15 unchanged lines hidden (view full) ---

107};
108
109struct rdma_ud_param {
110 const void *private_data;
111 u8 private_data_len;
112 struct ib_ah_attr ah_attr;
113 u32 qp_num;
114 u32 qkey;
115 u8 alt_path_index;
104};
105
106struct rdma_cm_event {
107 enum rdma_cm_event_type event;
108 int status;
109 union {
110 struct rdma_conn_param conn;
111 struct rdma_ud_param ud;
112 } param;
113};
114
116};
117
118struct rdma_cm_event {
119 enum rdma_cm_event_type event;
120 int status;
121 union {
122 struct rdma_conn_param conn;
123 struct rdma_ud_param ud;
124 } param;
125};
126
127enum rdma_cm_state {
128 RDMA_CM_IDLE,
129 RDMA_CM_ADDR_QUERY,
130 RDMA_CM_ADDR_RESOLVED,
131 RDMA_CM_ROUTE_QUERY,
132 RDMA_CM_ROUTE_RESOLVED,
133 RDMA_CM_CONNECT,
134 RDMA_CM_DISCONNECT,
135 RDMA_CM_ADDR_BOUND,
136 RDMA_CM_LISTEN,
137 RDMA_CM_DEVICE_REMOVAL,
138 RDMA_CM_DESTROYING
139};
140
115struct rdma_cm_id;
116
117/**
118 * rdma_cm_event_handler - Callback used to report user events.
119 *
120 * Notes: Users may not call rdma_destroy_id from this callback to destroy
121 * the passed in id, or a corresponding listen id. Returning a
122 * non-zero value from the callback will destroy the passed in id.
123 */
124typedef int (*rdma_cm_event_handler)(struct rdma_cm_id *id,
125 struct rdma_cm_event *event);
126
127struct rdma_cm_id {
128 struct ib_device *device;
129 void *context;
130 struct ib_qp *qp;
131 rdma_cm_event_handler event_handler;
132 struct rdma_route route;
133 enum rdma_port_space ps;
141struct rdma_cm_id;
142
143/**
144 * rdma_cm_event_handler - Callback used to report user events.
145 *
146 * Notes: Users may not call rdma_destroy_id from this callback to destroy
147 * the passed in id, or a corresponding listen id. Returning a
148 * non-zero value from the callback will destroy the passed in id.
149 */
150typedef int (*rdma_cm_event_handler)(struct rdma_cm_id *id,
151 struct rdma_cm_event *event);
152
153struct rdma_cm_id {
154 struct ib_device *device;
155 void *context;
156 struct ib_qp *qp;
157 rdma_cm_event_handler event_handler;
158 struct rdma_route route;
159 enum rdma_port_space ps;
160 enum ib_qp_type qp_type;
134 u8 port_num;
161 u8 port_num;
162 void *ucontext;
135};
136
137/**
138 * rdma_create_id - Create an RDMA identifier.
139 *
140 * @event_handler: User callback invoked to report events associated with the
141 * returned rdma_id.
142 * @context: User specified context associated with the id.
143 * @ps: RDMA port space.
163};
164
165/**
166 * rdma_create_id - Create an RDMA identifier.
167 *
168 * @event_handler: User callback invoked to report events associated with the
169 * returned rdma_id.
170 * @context: User specified context associated with the id.
171 * @ps: RDMA port space.
172 * @qp_type: type of queue pair associated with the id.
144 */
145struct rdma_cm_id *rdma_create_id(rdma_cm_event_handler event_handler,
173 */
174struct rdma_cm_id *rdma_create_id(rdma_cm_event_handler event_handler,
146 void *context, enum rdma_port_space ps);
175 void *context, enum rdma_port_space ps,
176 enum ib_qp_type qp_type);
147
148/**
149 * rdma_destroy_id - Destroys an RDMA identifier.
150 *
151 * @id: RDMA identifier.
152 *
153 * Note: calling this function has the effect of canceling in-flight
154 * asynchronous operations associated with the id.

--- 32 unchanged lines hidden (view full) ---

187 *
188 * This is called on the client side of a connection.
189 * Users must have first called rdma_resolve_addr to resolve a dst_addr
190 * into an RDMA address before calling this routine.
191 */
192int rdma_resolve_route(struct rdma_cm_id *id, int timeout_ms);
193
194/**
177
178/**
179 * rdma_destroy_id - Destroys an RDMA identifier.
180 *
181 * @id: RDMA identifier.
182 *
183 * Note: calling this function has the effect of canceling in-flight
184 * asynchronous operations associated with the id.

--- 32 unchanged lines hidden (view full) ---

217 *
218 * This is called on the client side of a connection.
219 * Users must have first called rdma_resolve_addr to resolve a dst_addr
220 * into an RDMA address before calling this routine.
221 */
222int rdma_resolve_route(struct rdma_cm_id *id, int timeout_ms);
223
224/**
225 * rdma_enable_apm - Get ready to use APM for the given ID.
226 * Actual Alternate path discovery and load will take place only
227 * after a connection has been established.
228 *
229 * Calling this function only has an effect on the connection's client side.
230 * It should be called after rdma_resolve_route and before rdma_connect.
231 *
232 * @id: RDMA identifier.
233 * @alt_type: Alternate path type to resolve.
234 */
235int rdma_enable_apm(struct rdma_cm_id *id, enum alt_path_type alt_type);
236
237/**
195 * rdma_create_qp - Allocate a QP and associate it with the specified RDMA
196 * identifier.
197 *
198 * QPs allocated to an rdma_cm_id will automatically be transitioned by the CMA
199 * through their states.
200 */
201int rdma_create_qp(struct rdma_cm_id *id, struct ib_pd *pd,
202 struct ib_qp_init_attr *qp_init_attr);

--- 122 unchanged lines hidden (view full) ---

325 * The type of service is interpretted as a differentiated service
326 * field (RFC 2474). The service type should be specified before
327 * performing route resolution, as existing communication on the
328 * connection identifier may be unaffected. The type of service
329 * requested may not be supported by the network to all destinations.
330 */
331void rdma_set_service_type(struct rdma_cm_id *id, int tos);
332
238 * rdma_create_qp - Allocate a QP and associate it with the specified RDMA
239 * identifier.
240 *
241 * QPs allocated to an rdma_cm_id will automatically be transitioned by the CMA
242 * through their states.
243 */
244int rdma_create_qp(struct rdma_cm_id *id, struct ib_pd *pd,
245 struct ib_qp_init_attr *qp_init_attr);

--- 122 unchanged lines hidden (view full) ---

368 * The type of service is interpretted as a differentiated service
369 * field (RFC 2474). The service type should be specified before
370 * performing route resolution, as existing communication on the
371 * connection identifier may be unaffected. The type of service
372 * requested may not be supported by the network to all destinations.
373 */
374void rdma_set_service_type(struct rdma_cm_id *id, int tos);
375
376/**
377 * rdma_set_reuseaddr - Allow the reuse of local addresses when binding
378 * the rdma_cm_id.
379 * @id: Communication identifier to configure.
380 * @reuse: Value indicating if the bound address is reusable.
381 *
382 * Reuse must be set before an address is bound to the id.
383 */
384int rdma_set_reuseaddr(struct rdma_cm_id *id, int reuse);
385
386/**
387 * rdma_set_afonly - Specify that listens are restricted to the
388 * bound address family only.
389 * @id: Communication identifer to configure.
390 * @afonly: Value indicating if listens are restricted.
391 *
392 * Must be set before identifier is in the listening state.
393 */
394int rdma_set_afonly(struct rdma_cm_id *id, int afonly);
395
396/**
397 * rdma_set_timeout - Set the QP timeout associated with a connection
398 * identifier.
399 * @id: Communication identifier to associated with service type.
400 * @timeout: QP timeout
401 */
402void rdma_set_timeout(struct rdma_cm_id *id, int timeout);
403
333#endif /* RDMA_CM_H */
404#endif /* RDMA_CM_H */