diff options
Diffstat (limited to 'drivers/infiniband/include')
-rw-r--r-- | drivers/infiniband/include/ib_cm.h | 569 | ||||
-rw-r--r-- | drivers/infiniband/include/ib_fmr_pool.h | 5 | ||||
-rw-r--r-- | drivers/infiniband/include/ib_mad.h | 213 | ||||
-rw-r--r-- | drivers/infiniband/include/ib_sa.h | 87 | ||||
-rw-r--r-- | drivers/infiniband/include/ib_user_cm.h | 328 | ||||
-rw-r--r-- | drivers/infiniband/include/ib_user_mad.h | 28 | ||||
-rw-r--r-- | drivers/infiniband/include/ib_verbs.h | 25 |
7 files changed, 1216 insertions, 39 deletions
diff --git a/drivers/infiniband/include/ib_cm.h b/drivers/infiniband/include/ib_cm.h new file mode 100644 index 000000000000..da650115e79a --- /dev/null +++ b/drivers/infiniband/include/ib_cm.h | |||
@@ -0,0 +1,569 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2004 Intel Corporation. All rights reserved. | ||
3 | * Copyright (c) 2004 Topspin Corporation. All rights reserved. | ||
4 | * Copyright (c) 2004 Voltaire Corporation. All rights reserved. | ||
5 | * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. | ||
6 | * | ||
7 | * This software is available to you under a choice of one of two | ||
8 | * licenses. You may choose to be licensed under the terms of the GNU | ||
9 | * General Public License (GPL) Version 2, available from the file | ||
10 | * COPYING in the main directory of this source tree, or the | ||
11 | * OpenIB.org BSD license below: | ||
12 | * | ||
13 | * Redistribution and use in source and binary forms, with or | ||
14 | * without modification, are permitted provided that the following | ||
15 | * conditions are met: | ||
16 | * | ||
17 | * - Redistributions of source code must retain the above | ||
18 | * copyright notice, this list of conditions and the following | ||
19 | * disclaimer. | ||
20 | * | ||
21 | * - Redistributions in binary form must reproduce the above | ||
22 | * copyright notice, this list of conditions and the following | ||
23 | * disclaimer in the documentation and/or other materials | ||
24 | * provided with the distribution. | ||
25 | * | ||
26 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
27 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
28 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
29 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
30 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
31 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
32 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
33 | * SOFTWARE. | ||
34 | * | ||
35 | * $Id: ib_cm.h 2730 2005-06-28 16:43:03Z sean.hefty $ | ||
36 | */ | ||
37 | #if !defined(IB_CM_H) | ||
38 | #define IB_CM_H | ||
39 | |||
40 | #include <ib_mad.h> | ||
41 | #include <ib_sa.h> | ||
42 | |||
43 | enum ib_cm_state { | ||
44 | IB_CM_IDLE, | ||
45 | IB_CM_LISTEN, | ||
46 | IB_CM_REQ_SENT, | ||
47 | IB_CM_REQ_RCVD, | ||
48 | IB_CM_MRA_REQ_SENT, | ||
49 | IB_CM_MRA_REQ_RCVD, | ||
50 | IB_CM_REP_SENT, | ||
51 | IB_CM_REP_RCVD, | ||
52 | IB_CM_MRA_REP_SENT, | ||
53 | IB_CM_MRA_REP_RCVD, | ||
54 | IB_CM_ESTABLISHED, | ||
55 | IB_CM_DREQ_SENT, | ||
56 | IB_CM_DREQ_RCVD, | ||
57 | IB_CM_TIMEWAIT, | ||
58 | IB_CM_SIDR_REQ_SENT, | ||
59 | IB_CM_SIDR_REQ_RCVD | ||
60 | }; | ||
61 | |||
62 | enum ib_cm_lap_state { | ||
63 | IB_CM_LAP_IDLE, | ||
64 | IB_CM_LAP_SENT, | ||
65 | IB_CM_LAP_RCVD, | ||
66 | IB_CM_MRA_LAP_SENT, | ||
67 | IB_CM_MRA_LAP_RCVD, | ||
68 | }; | ||
69 | |||
70 | enum ib_cm_event_type { | ||
71 | IB_CM_REQ_ERROR, | ||
72 | IB_CM_REQ_RECEIVED, | ||
73 | IB_CM_REP_ERROR, | ||
74 | IB_CM_REP_RECEIVED, | ||
75 | IB_CM_RTU_RECEIVED, | ||
76 | IB_CM_USER_ESTABLISHED, | ||
77 | IB_CM_DREQ_ERROR, | ||
78 | IB_CM_DREQ_RECEIVED, | ||
79 | IB_CM_DREP_RECEIVED, | ||
80 | IB_CM_TIMEWAIT_EXIT, | ||
81 | IB_CM_MRA_RECEIVED, | ||
82 | IB_CM_REJ_RECEIVED, | ||
83 | IB_CM_LAP_ERROR, | ||
84 | IB_CM_LAP_RECEIVED, | ||
85 | IB_CM_APR_RECEIVED, | ||
86 | IB_CM_SIDR_REQ_ERROR, | ||
87 | IB_CM_SIDR_REQ_RECEIVED, | ||
88 | IB_CM_SIDR_REP_RECEIVED | ||
89 | }; | ||
90 | |||
91 | enum ib_cm_data_size { | ||
92 | IB_CM_REQ_PRIVATE_DATA_SIZE = 92, | ||
93 | IB_CM_MRA_PRIVATE_DATA_SIZE = 222, | ||
94 | IB_CM_REJ_PRIVATE_DATA_SIZE = 148, | ||
95 | IB_CM_REP_PRIVATE_DATA_SIZE = 196, | ||
96 | IB_CM_RTU_PRIVATE_DATA_SIZE = 224, | ||
97 | IB_CM_DREQ_PRIVATE_DATA_SIZE = 220, | ||
98 | IB_CM_DREP_PRIVATE_DATA_SIZE = 224, | ||
99 | IB_CM_REJ_ARI_LENGTH = 72, | ||
100 | IB_CM_LAP_PRIVATE_DATA_SIZE = 168, | ||
101 | IB_CM_APR_PRIVATE_DATA_SIZE = 148, | ||
102 | IB_CM_APR_INFO_LENGTH = 72, | ||
103 | IB_CM_SIDR_REQ_PRIVATE_DATA_SIZE = 216, | ||
104 | IB_CM_SIDR_REP_PRIVATE_DATA_SIZE = 136, | ||
105 | IB_CM_SIDR_REP_INFO_LENGTH = 72 | ||
106 | }; | ||
107 | |||
108 | struct ib_cm_id; | ||
109 | |||
110 | struct ib_cm_req_event_param { | ||
111 | struct ib_cm_id *listen_id; | ||
112 | struct ib_device *device; | ||
113 | u8 port; | ||
114 | |||
115 | struct ib_sa_path_rec *primary_path; | ||
116 | struct ib_sa_path_rec *alternate_path; | ||
117 | |||
118 | u64 remote_ca_guid; | ||
119 | u32 remote_qkey; | ||
120 | u32 remote_qpn; | ||
121 | enum ib_qp_type qp_type; | ||
122 | |||
123 | u32 starting_psn; | ||
124 | u8 responder_resources; | ||
125 | u8 initiator_depth; | ||
126 | unsigned int local_cm_response_timeout:5; | ||
127 | unsigned int flow_control:1; | ||
128 | unsigned int remote_cm_response_timeout:5; | ||
129 | unsigned int retry_count:3; | ||
130 | unsigned int rnr_retry_count:3; | ||
131 | unsigned int srq:1; | ||
132 | }; | ||
133 | |||
134 | struct ib_cm_rep_event_param { | ||
135 | u64 remote_ca_guid; | ||
136 | u32 remote_qkey; | ||
137 | u32 remote_qpn; | ||
138 | u32 starting_psn; | ||
139 | u8 responder_resources; | ||
140 | u8 initiator_depth; | ||
141 | unsigned int target_ack_delay:5; | ||
142 | unsigned int failover_accepted:2; | ||
143 | unsigned int flow_control:1; | ||
144 | unsigned int rnr_retry_count:3; | ||
145 | unsigned int srq:1; | ||
146 | }; | ||
147 | |||
148 | enum ib_cm_rej_reason { | ||
149 | IB_CM_REJ_NO_QP = __constant_htons(1), | ||
150 | IB_CM_REJ_NO_EEC = __constant_htons(2), | ||
151 | IB_CM_REJ_NO_RESOURCES = __constant_htons(3), | ||
152 | IB_CM_REJ_TIMEOUT = __constant_htons(4), | ||
153 | IB_CM_REJ_UNSUPPORTED = __constant_htons(5), | ||
154 | IB_CM_REJ_INVALID_COMM_ID = __constant_htons(6), | ||
155 | IB_CM_REJ_INVALID_COMM_INSTANCE = __constant_htons(7), | ||
156 | IB_CM_REJ_INVALID_SERVICE_ID = __constant_htons(8), | ||
157 | IB_CM_REJ_INVALID_TRANSPORT_TYPE = __constant_htons(9), | ||
158 | IB_CM_REJ_STALE_CONN = __constant_htons(10), | ||
159 | IB_CM_REJ_RDC_NOT_EXIST = __constant_htons(11), | ||
160 | IB_CM_REJ_INVALID_GID = __constant_htons(12), | ||
161 | IB_CM_REJ_INVALID_LID = __constant_htons(13), | ||
162 | IB_CM_REJ_INVALID_SL = __constant_htons(14), | ||
163 | IB_CM_REJ_INVALID_TRAFFIC_CLASS = __constant_htons(15), | ||
164 | IB_CM_REJ_INVALID_HOP_LIMIT = __constant_htons(16), | ||
165 | IB_CM_REJ_INVALID_PACKET_RATE = __constant_htons(17), | ||
166 | IB_CM_REJ_INVALID_ALT_GID = __constant_htons(18), | ||
167 | IB_CM_REJ_INVALID_ALT_LID = __constant_htons(19), | ||
168 | IB_CM_REJ_INVALID_ALT_SL = __constant_htons(20), | ||
169 | IB_CM_REJ_INVALID_ALT_TRAFFIC_CLASS = __constant_htons(21), | ||
170 | IB_CM_REJ_INVALID_ALT_HOP_LIMIT = __constant_htons(22), | ||
171 | IB_CM_REJ_INVALID_ALT_PACKET_RATE = __constant_htons(23), | ||
172 | IB_CM_REJ_PORT_CM_REDIRECT = __constant_htons(24), | ||
173 | IB_CM_REJ_PORT_REDIRECT = __constant_htons(25), | ||
174 | IB_CM_REJ_INVALID_MTU = __constant_htons(26), | ||
175 | IB_CM_REJ_INSUFFICIENT_RESP_RESOURCES = __constant_htons(27), | ||
176 | IB_CM_REJ_CONSUMER_DEFINED = __constant_htons(28), | ||
177 | IB_CM_REJ_INVALID_RNR_RETRY = __constant_htons(29), | ||
178 | IB_CM_REJ_DUPLICATE_LOCAL_COMM_ID = __constant_htons(30), | ||
179 | IB_CM_REJ_INVALID_CLASS_VERSION = __constant_htons(31), | ||
180 | IB_CM_REJ_INVALID_FLOW_LABEL = __constant_htons(32), | ||
181 | IB_CM_REJ_INVALID_ALT_FLOW_LABEL = __constant_htons(33) | ||
182 | }; | ||
183 | |||
184 | struct ib_cm_rej_event_param { | ||
185 | enum ib_cm_rej_reason reason; | ||
186 | void *ari; | ||
187 | u8 ari_length; | ||
188 | }; | ||
189 | |||
190 | struct ib_cm_mra_event_param { | ||
191 | u8 service_timeout; | ||
192 | }; | ||
193 | |||
194 | struct ib_cm_lap_event_param { | ||
195 | struct ib_sa_path_rec *alternate_path; | ||
196 | }; | ||
197 | |||
198 | enum ib_cm_apr_status { | ||
199 | IB_CM_APR_SUCCESS, | ||
200 | IB_CM_APR_INVALID_COMM_ID, | ||
201 | IB_CM_APR_UNSUPPORTED, | ||
202 | IB_CM_APR_REJECT, | ||
203 | IB_CM_APR_REDIRECT, | ||
204 | IB_CM_APR_IS_CURRENT, | ||
205 | IB_CM_APR_INVALID_QPN_EECN, | ||
206 | IB_CM_APR_INVALID_LID, | ||
207 | IB_CM_APR_INVALID_GID, | ||
208 | IB_CM_APR_INVALID_FLOW_LABEL, | ||
209 | IB_CM_APR_INVALID_TCLASS, | ||
210 | IB_CM_APR_INVALID_HOP_LIMIT, | ||
211 | IB_CM_APR_INVALID_PACKET_RATE, | ||
212 | IB_CM_APR_INVALID_SL | ||
213 | }; | ||
214 | |||
215 | struct ib_cm_apr_event_param { | ||
216 | enum ib_cm_apr_status ap_status; | ||
217 | void *apr_info; | ||
218 | u8 info_len; | ||
219 | }; | ||
220 | |||
221 | struct ib_cm_sidr_req_event_param { | ||
222 | struct ib_cm_id *listen_id; | ||
223 | struct ib_device *device; | ||
224 | u8 port; | ||
225 | |||
226 | u16 pkey; | ||
227 | }; | ||
228 | |||
229 | enum ib_cm_sidr_status { | ||
230 | IB_SIDR_SUCCESS, | ||
231 | IB_SIDR_UNSUPPORTED, | ||
232 | IB_SIDR_REJECT, | ||
233 | IB_SIDR_NO_QP, | ||
234 | IB_SIDR_REDIRECT, | ||
235 | IB_SIDR_UNSUPPORTED_VERSION | ||
236 | }; | ||
237 | |||
238 | struct ib_cm_sidr_rep_event_param { | ||
239 | enum ib_cm_sidr_status status; | ||
240 | u32 qkey; | ||
241 | u32 qpn; | ||
242 | void *info; | ||
243 | u8 info_len; | ||
244 | |||
245 | }; | ||
246 | |||
247 | struct ib_cm_event { | ||
248 | enum ib_cm_event_type event; | ||
249 | union { | ||
250 | struct ib_cm_req_event_param req_rcvd; | ||
251 | struct ib_cm_rep_event_param rep_rcvd; | ||
252 | /* No data for RTU received events. */ | ||
253 | struct ib_cm_rej_event_param rej_rcvd; | ||
254 | struct ib_cm_mra_event_param mra_rcvd; | ||
255 | struct ib_cm_lap_event_param lap_rcvd; | ||
256 | struct ib_cm_apr_event_param apr_rcvd; | ||
257 | /* No data for DREQ/DREP received events. */ | ||
258 | struct ib_cm_sidr_req_event_param sidr_req_rcvd; | ||
259 | struct ib_cm_sidr_rep_event_param sidr_rep_rcvd; | ||
260 | enum ib_wc_status send_status; | ||
261 | } param; | ||
262 | |||
263 | void *private_data; | ||
264 | }; | ||
265 | |||
266 | /** | ||
267 | * ib_cm_handler - User-defined callback to process communication events. | ||
268 | * @cm_id: Communication identifier associated with the reported event. | ||
269 | * @event: Information about the communication event. | ||
270 | * | ||
271 | * IB_CM_REQ_RECEIVED and IB_CM_SIDR_REQ_RECEIVED communication events | ||
272 | * generated as a result of listen requests result in the allocation of a | ||
273 | * new @cm_id. The new @cm_id is returned to the user through this callback. | ||
274 | * Clients are responsible for destroying the new @cm_id. For peer-to-peer | ||
275 | * IB_CM_REQ_RECEIVED and all other events, the returned @cm_id corresponds | ||
276 | * to a user's existing communication identifier. | ||
277 | * | ||
278 | * Users may not call ib_destroy_cm_id while in the context of this callback; | ||
279 | * however, returning a non-zero value instructs the communication manager to | ||
280 | * destroy the @cm_id after the callback completes. | ||
281 | */ | ||
282 | typedef int (*ib_cm_handler)(struct ib_cm_id *cm_id, | ||
283 | struct ib_cm_event *event); | ||
284 | |||
285 | struct ib_cm_id { | ||
286 | ib_cm_handler cm_handler; | ||
287 | void *context; | ||
288 | u64 service_id; | ||
289 | u64 service_mask; | ||
290 | enum ib_cm_state state; /* internal CM/debug use */ | ||
291 | enum ib_cm_lap_state lap_state; /* internal CM/debug use */ | ||
292 | u32 local_id; | ||
293 | u32 remote_id; | ||
294 | }; | ||
295 | |||
296 | /** | ||
297 | * ib_create_cm_id - Allocate a communication identifier. | ||
298 | * @cm_handler: Callback invoked to notify the user of CM events. | ||
299 | * @context: User specified context associated with the communication | ||
300 | * identifier. | ||
301 | * | ||
302 | * Communication identifiers are used to track connection states, service | ||
303 | * ID resolution requests, and listen requests. | ||
304 | */ | ||
305 | struct ib_cm_id *ib_create_cm_id(ib_cm_handler cm_handler, | ||
306 | void *context); | ||
307 | |||
308 | /** | ||
309 | * ib_destroy_cm_id - Destroy a connection identifier. | ||
310 | * @cm_id: Connection identifier to destroy. | ||
311 | * | ||
312 | * This call blocks until the connection identifier is destroyed. | ||
313 | */ | ||
314 | void ib_destroy_cm_id(struct ib_cm_id *cm_id); | ||
315 | |||
316 | #define IB_SERVICE_ID_AGN_MASK __constant_cpu_to_be64(0xFF00000000000000ULL) | ||
317 | #define IB_CM_ASSIGN_SERVICE_ID __constant_cpu_to_be64(0x0200000000000000ULL) | ||
318 | |||
319 | /** | ||
320 | * ib_cm_listen - Initiates listening on the specified service ID for | ||
321 | * connection and service ID resolution requests. | ||
322 | * @cm_id: Connection identifier associated with the listen request. | ||
323 | * @service_id: Service identifier matched against incoming connection | ||
324 | * and service ID resolution requests. The service ID should be specified | ||
325 | * network-byte order. If set to IB_CM_ASSIGN_SERVICE_ID, the CM will | ||
326 | * assign a service ID to the caller. | ||
327 | * @service_mask: Mask applied to service ID used to listen across a | ||
328 | * range of service IDs. If set to 0, the service ID is matched | ||
329 | * exactly. This parameter is ignored if %service_id is set to | ||
330 | * IB_CM_ASSIGN_SERVICE_ID. | ||
331 | */ | ||
332 | int ib_cm_listen(struct ib_cm_id *cm_id, | ||
333 | u64 service_id, | ||
334 | u64 service_mask); | ||
335 | |||
336 | struct ib_cm_req_param { | ||
337 | struct ib_sa_path_rec *primary_path; | ||
338 | struct ib_sa_path_rec *alternate_path; | ||
339 | u64 service_id; | ||
340 | u32 qp_num; | ||
341 | enum ib_qp_type qp_type; | ||
342 | u32 starting_psn; | ||
343 | const void *private_data; | ||
344 | u8 private_data_len; | ||
345 | u8 peer_to_peer; | ||
346 | u8 responder_resources; | ||
347 | u8 initiator_depth; | ||
348 | u8 remote_cm_response_timeout; | ||
349 | u8 flow_control; | ||
350 | u8 local_cm_response_timeout; | ||
351 | u8 retry_count; | ||
352 | u8 rnr_retry_count; | ||
353 | u8 max_cm_retries; | ||
354 | u8 srq; | ||
355 | }; | ||
356 | |||
357 | /** | ||
358 | * ib_send_cm_req - Sends a connection request to the remote node. | ||
359 | * @cm_id: Connection identifier that will be associated with the | ||
360 | * connection request. | ||
361 | * @param: Connection request information needed to establish the | ||
362 | * connection. | ||
363 | */ | ||
364 | int ib_send_cm_req(struct ib_cm_id *cm_id, | ||
365 | struct ib_cm_req_param *param); | ||
366 | |||
367 | struct ib_cm_rep_param { | ||
368 | u32 qp_num; | ||
369 | u32 starting_psn; | ||
370 | const void *private_data; | ||
371 | u8 private_data_len; | ||
372 | u8 responder_resources; | ||
373 | u8 initiator_depth; | ||
374 | u8 target_ack_delay; | ||
375 | u8 failover_accepted; | ||
376 | u8 flow_control; | ||
377 | u8 rnr_retry_count; | ||
378 | u8 srq; | ||
379 | }; | ||
380 | |||
381 | /** | ||
382 | * ib_send_cm_rep - Sends a connection reply in response to a connection | ||
383 | * request. | ||
384 | * @cm_id: Connection identifier that will be associated with the | ||
385 | * connection request. | ||
386 | * @param: Connection reply information needed to establish the | ||
387 | * connection. | ||
388 | */ | ||
389 | int ib_send_cm_rep(struct ib_cm_id *cm_id, | ||
390 | struct ib_cm_rep_param *param); | ||
391 | |||
392 | /** | ||
393 | * ib_send_cm_rtu - Sends a connection ready to use message in response | ||
394 | * to a connection reply message. | ||
395 | * @cm_id: Connection identifier associated with the connection request. | ||
396 | * @private_data: Optional user-defined private data sent with the | ||
397 | * ready to use message. | ||
398 | * @private_data_len: Size of the private data buffer, in bytes. | ||
399 | */ | ||
400 | int ib_send_cm_rtu(struct ib_cm_id *cm_id, | ||
401 | const void *private_data, | ||
402 | u8 private_data_len); | ||
403 | |||
404 | /** | ||
405 | * ib_send_cm_dreq - Sends a disconnection request for an existing | ||
406 | * connection. | ||
407 | * @cm_id: Connection identifier associated with the connection being | ||
408 | * released. | ||
409 | * @private_data: Optional user-defined private data sent with the | ||
410 | * disconnection request message. | ||
411 | * @private_data_len: Size of the private data buffer, in bytes. | ||
412 | */ | ||
413 | int ib_send_cm_dreq(struct ib_cm_id *cm_id, | ||
414 | const void *private_data, | ||
415 | u8 private_data_len); | ||
416 | |||
417 | /** | ||
418 | * ib_send_cm_drep - Sends a disconnection reply to a disconnection request. | ||
419 | * @cm_id: Connection identifier associated with the connection being | ||
420 | * released. | ||
421 | * @private_data: Optional user-defined private data sent with the | ||
422 | * disconnection reply message. | ||
423 | * @private_data_len: Size of the private data buffer, in bytes. | ||
424 | * | ||
425 | * If the cm_id is in the correct state, the CM will transition the connection | ||
426 | * to the timewait state, even if an error occurs sending the DREP message. | ||
427 | */ | ||
428 | int ib_send_cm_drep(struct ib_cm_id *cm_id, | ||
429 | const void *private_data, | ||
430 | u8 private_data_len); | ||
431 | |||
432 | /** | ||
433 | * ib_cm_establish - Forces a connection state to established. | ||
434 | * @cm_id: Connection identifier to transition to established. | ||
435 | * | ||
436 | * This routine should be invoked by users who receive messages on a | ||
437 | * connected QP before an RTU has been received. | ||
438 | */ | ||
439 | int ib_cm_establish(struct ib_cm_id *cm_id); | ||
440 | |||
441 | /** | ||
442 | * ib_send_cm_rej - Sends a connection rejection message to the | ||
443 | * remote node. | ||
444 | * @cm_id: Connection identifier associated with the connection being | ||
445 | * rejected. | ||
446 | * @reason: Reason for the connection request rejection. | ||
447 | * @ari: Optional additional rejection information. | ||
448 | * @ari_length: Size of the additional rejection information, in bytes. | ||
449 | * @private_data: Optional user-defined private data sent with the | ||
450 | * rejection message. | ||
451 | * @private_data_len: Size of the private data buffer, in bytes. | ||
452 | */ | ||
453 | int ib_send_cm_rej(struct ib_cm_id *cm_id, | ||
454 | enum ib_cm_rej_reason reason, | ||
455 | void *ari, | ||
456 | u8 ari_length, | ||
457 | const void *private_data, | ||
458 | u8 private_data_len); | ||
459 | |||
460 | /** | ||
461 | * ib_send_cm_mra - Sends a message receipt acknowledgement to a connection | ||
462 | * message. | ||
463 | * @cm_id: Connection identifier associated with the connection message. | ||
464 | * @service_timeout: The maximum time required for the sender to reply to | ||
465 | * to the connection message. | ||
466 | * @private_data: Optional user-defined private data sent with the | ||
467 | * message receipt acknowledgement. | ||
468 | * @private_data_len: Size of the private data buffer, in bytes. | ||
469 | */ | ||
470 | int ib_send_cm_mra(struct ib_cm_id *cm_id, | ||
471 | u8 service_timeout, | ||
472 | const void *private_data, | ||
473 | u8 private_data_len); | ||
474 | |||
475 | /** | ||
476 | * ib_send_cm_lap - Sends a load alternate path request. | ||
477 | * @cm_id: Connection identifier associated with the load alternate path | ||
478 | * message. | ||
479 | * @alternate_path: A path record that identifies the alternate path to | ||
480 | * load. | ||
481 | * @private_data: Optional user-defined private data sent with the | ||
482 | * load alternate path message. | ||
483 | * @private_data_len: Size of the private data buffer, in bytes. | ||
484 | */ | ||
485 | int ib_send_cm_lap(struct ib_cm_id *cm_id, | ||
486 | struct ib_sa_path_rec *alternate_path, | ||
487 | const void *private_data, | ||
488 | u8 private_data_len); | ||
489 | |||
490 | /** | ||
491 | * ib_cm_init_qp_attr - Initializes the QP attributes for use in transitioning | ||
492 | * to a specified QP state. | ||
493 | * @cm_id: Communication identifier associated with the QP attributes to | ||
494 | * initialize. | ||
495 | * @qp_attr: On input, specifies the desired QP state. On output, the | ||
496 | * mandatory and desired optional attributes will be set in order to | ||
497 | * modify the QP to the specified state. | ||
498 | * @qp_attr_mask: The QP attribute mask that may be used to transition the | ||
499 | * QP to the specified state. | ||
500 | * | ||
501 | * Users must set the @qp_attr->qp_state to the desired QP state. This call | ||
502 | * will set all required attributes for the given transition, along with | ||
503 | * known optional attributes. Users may override the attributes returned from | ||
504 | * this call before calling ib_modify_qp. | ||
505 | */ | ||
506 | int ib_cm_init_qp_attr(struct ib_cm_id *cm_id, | ||
507 | struct ib_qp_attr *qp_attr, | ||
508 | int *qp_attr_mask); | ||
509 | |||
510 | /** | ||
511 | * ib_send_cm_apr - Sends an alternate path response message in response to | ||
512 | * a load alternate path request. | ||
513 | * @cm_id: Connection identifier associated with the alternate path response. | ||
514 | * @status: Reply status sent with the alternate path response. | ||
515 | * @info: Optional additional information sent with the alternate path | ||
516 | * response. | ||
517 | * @info_length: Size of the additional information, in bytes. | ||
518 | * @private_data: Optional user-defined private data sent with the | ||
519 | * alternate path response message. | ||
520 | * @private_data_len: Size of the private data buffer, in bytes. | ||
521 | */ | ||
522 | int ib_send_cm_apr(struct ib_cm_id *cm_id, | ||
523 | enum ib_cm_apr_status status, | ||
524 | void *info, | ||
525 | u8 info_length, | ||
526 | const void *private_data, | ||
527 | u8 private_data_len); | ||
528 | |||
529 | struct ib_cm_sidr_req_param { | ||
530 | struct ib_sa_path_rec *path; | ||
531 | u64 service_id; | ||
532 | int timeout_ms; | ||
533 | const void *private_data; | ||
534 | u8 private_data_len; | ||
535 | u8 max_cm_retries; | ||
536 | u16 pkey; | ||
537 | }; | ||
538 | |||
539 | /** | ||
540 | * ib_send_cm_sidr_req - Sends a service ID resolution request to the | ||
541 | * remote node. | ||
542 | * @cm_id: Communication identifier that will be associated with the | ||
543 | * service ID resolution request. | ||
544 | * @param: Service ID resolution request information. | ||
545 | */ | ||
546 | int ib_send_cm_sidr_req(struct ib_cm_id *cm_id, | ||
547 | struct ib_cm_sidr_req_param *param); | ||
548 | |||
549 | struct ib_cm_sidr_rep_param { | ||
550 | u32 qp_num; | ||
551 | u32 qkey; | ||
552 | enum ib_cm_sidr_status status; | ||
553 | const void *info; | ||
554 | u8 info_length; | ||
555 | const void *private_data; | ||
556 | u8 private_data_len; | ||
557 | }; | ||
558 | |||
559 | /** | ||
560 | * ib_send_cm_sidr_rep - Sends a service ID resolution request to the | ||
561 | * remote node. | ||
562 | * @cm_id: Communication identifier associated with the received service ID | ||
563 | * resolution request. | ||
564 | * @param: Service ID resolution reply information. | ||
565 | */ | ||
566 | int ib_send_cm_sidr_rep(struct ib_cm_id *cm_id, | ||
567 | struct ib_cm_sidr_rep_param *param); | ||
568 | |||
569 | #endif /* IB_CM_H */ | ||
diff --git a/drivers/infiniband/include/ib_fmr_pool.h b/drivers/infiniband/include/ib_fmr_pool.h index e8769657cbbb..6c9e24d6e144 100644 --- a/drivers/infiniband/include/ib_fmr_pool.h +++ b/drivers/infiniband/include/ib_fmr_pool.h | |||
@@ -1,5 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2004 Topspin Corporation. All rights reserved. | 2 | * Copyright (c) 2004 Topspin Corporation. All rights reserved. |
3 | * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. | ||
3 | * | 4 | * |
4 | * This software is available to you under a choice of one of two | 5 | * This software is available to you under a choice of one of two |
5 | * licenses. You may choose to be licensed under the terms of the GNU | 6 | * licenses. You may choose to be licensed under the terms of the GNU |
@@ -29,7 +30,7 @@ | |||
29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | 30 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
30 | * SOFTWARE. | 31 | * SOFTWARE. |
31 | * | 32 | * |
32 | * $Id: ib_fmr_pool.h 1349 2004-12-16 21:09:43Z roland $ | 33 | * $Id: ib_fmr_pool.h 2730 2005-06-28 16:43:03Z sean.hefty $ |
33 | */ | 34 | */ |
34 | 35 | ||
35 | #if !defined(IB_FMR_POOL_H) | 36 | #if !defined(IB_FMR_POOL_H) |
@@ -78,7 +79,7 @@ struct ib_pool_fmr { | |||
78 | struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd, | 79 | struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd, |
79 | struct ib_fmr_pool_param *params); | 80 | struct ib_fmr_pool_param *params); |
80 | 81 | ||
81 | int ib_destroy_fmr_pool(struct ib_fmr_pool *pool); | 82 | void ib_destroy_fmr_pool(struct ib_fmr_pool *pool); |
82 | 83 | ||
83 | int ib_flush_fmr_pool(struct ib_fmr_pool *pool); | 84 | int ib_flush_fmr_pool(struct ib_fmr_pool *pool); |
84 | 85 | ||
diff --git a/drivers/infiniband/include/ib_mad.h b/drivers/infiniband/include/ib_mad.h index 4a6bf6763a97..491b6f25b3b8 100644 --- a/drivers/infiniband/include/ib_mad.h +++ b/drivers/infiniband/include/ib_mad.h | |||
@@ -33,12 +33,14 @@ | |||
33 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | 33 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
34 | * SOFTWARE. | 34 | * SOFTWARE. |
35 | * | 35 | * |
36 | * $Id: ib_mad.h 1389 2004-12-27 22:56:47Z roland $ | 36 | * $Id: ib_mad.h 2775 2005-07-02 13:42:12Z halr $ |
37 | */ | 37 | */ |
38 | 38 | ||
39 | #if !defined( IB_MAD_H ) | 39 | #if !defined( IB_MAD_H ) |
40 | #define IB_MAD_H | 40 | #define IB_MAD_H |
41 | 41 | ||
42 | #include <linux/pci.h> | ||
43 | |||
42 | #include <ib_verbs.h> | 44 | #include <ib_verbs.h> |
43 | 45 | ||
44 | /* Management base version */ | 46 | /* Management base version */ |
@@ -56,6 +58,8 @@ | |||
56 | #define IB_MGMT_CLASS_VENDOR_RANGE2_START 0x30 | 58 | #define IB_MGMT_CLASS_VENDOR_RANGE2_START 0x30 |
57 | #define IB_MGMT_CLASS_VENDOR_RANGE2_END 0x4F | 59 | #define IB_MGMT_CLASS_VENDOR_RANGE2_END 0x4F |
58 | 60 | ||
61 | #define IB_OPENIB_OUI (0x001405) | ||
62 | |||
59 | /* Management methods */ | 63 | /* Management methods */ |
60 | #define IB_MGMT_METHOD_GET 0x01 | 64 | #define IB_MGMT_METHOD_GET 0x01 |
61 | #define IB_MGMT_METHOD_SET 0x02 | 65 | #define IB_MGMT_METHOD_SET 0x02 |
@@ -70,18 +74,37 @@ | |||
70 | 74 | ||
71 | #define IB_MGMT_MAX_METHODS 128 | 75 | #define IB_MGMT_MAX_METHODS 128 |
72 | 76 | ||
77 | /* RMPP information */ | ||
78 | #define IB_MGMT_RMPP_VERSION 1 | ||
79 | |||
80 | #define IB_MGMT_RMPP_TYPE_DATA 1 | ||
81 | #define IB_MGMT_RMPP_TYPE_ACK 2 | ||
82 | #define IB_MGMT_RMPP_TYPE_STOP 3 | ||
83 | #define IB_MGMT_RMPP_TYPE_ABORT 4 | ||
84 | |||
85 | #define IB_MGMT_RMPP_FLAG_ACTIVE 1 | ||
86 | #define IB_MGMT_RMPP_FLAG_FIRST (1<<1) | ||
87 | #define IB_MGMT_RMPP_FLAG_LAST (1<<2) | ||
88 | |||
89 | #define IB_MGMT_RMPP_NO_RESPTIME 0x1F | ||
90 | |||
91 | #define IB_MGMT_RMPP_STATUS_SUCCESS 0 | ||
92 | #define IB_MGMT_RMPP_STATUS_RESX 1 | ||
93 | #define IB_MGMT_RMPP_STATUS_T2L 118 | ||
94 | #define IB_MGMT_RMPP_STATUS_BAD_LEN 119 | ||
95 | #define IB_MGMT_RMPP_STATUS_BAD_SEG 120 | ||
96 | #define IB_MGMT_RMPP_STATUS_BADT 121 | ||
97 | #define IB_MGMT_RMPP_STATUS_W2S 122 | ||
98 | #define IB_MGMT_RMPP_STATUS_S2B 123 | ||
99 | #define IB_MGMT_RMPP_STATUS_BAD_STATUS 124 | ||
100 | #define IB_MGMT_RMPP_STATUS_UNV 125 | ||
101 | #define IB_MGMT_RMPP_STATUS_TMR 126 | ||
102 | #define IB_MGMT_RMPP_STATUS_UNSPEC 127 | ||
103 | |||
73 | #define IB_QP0 0 | 104 | #define IB_QP0 0 |
74 | #define IB_QP1 __constant_htonl(1) | 105 | #define IB_QP1 __constant_htonl(1) |
75 | #define IB_QP1_QKEY 0x80010000 | 106 | #define IB_QP1_QKEY 0x80010000 |
76 | 107 | #define IB_QP_SET_QKEY 0x80000000 | |
77 | struct ib_grh { | ||
78 | u32 version_tclass_flow; | ||
79 | u16 paylen; | ||
80 | u8 next_hdr; | ||
81 | u8 hop_limit; | ||
82 | union ib_gid sgid; | ||
83 | union ib_gid dgid; | ||
84 | } __attribute__ ((packed)); | ||
85 | 108 | ||
86 | struct ib_mad_hdr { | 109 | struct ib_mad_hdr { |
87 | u8 base_version; | 110 | u8 base_version; |
@@ -94,7 +117,7 @@ struct ib_mad_hdr { | |||
94 | u16 attr_id; | 117 | u16 attr_id; |
95 | u16 resv; | 118 | u16 resv; |
96 | u32 attr_mod; | 119 | u32 attr_mod; |
97 | } __attribute__ ((packed)); | 120 | }; |
98 | 121 | ||
99 | struct ib_rmpp_hdr { | 122 | struct ib_rmpp_hdr { |
100 | u8 rmpp_version; | 123 | u8 rmpp_version; |
@@ -103,17 +126,41 @@ struct ib_rmpp_hdr { | |||
103 | u8 rmpp_status; | 126 | u8 rmpp_status; |
104 | u32 seg_num; | 127 | u32 seg_num; |
105 | u32 paylen_newwin; | 128 | u32 paylen_newwin; |
129 | }; | ||
130 | |||
131 | typedef u64 __bitwise ib_sa_comp_mask; | ||
132 | |||
133 | #define IB_SA_COMP_MASK(n) ((__force ib_sa_comp_mask) cpu_to_be64(1ull << n)) | ||
134 | |||
135 | /* | ||
136 | * ib_sa_hdr and ib_sa_mad structures must be packed because they have | ||
137 | * 64-bit fields that are only 32-bit aligned. 64-bit architectures will | ||
138 | * lay them out wrong otherwise. (And unfortunately they are sent on | ||
139 | * the wire so we can't change the layout) | ||
140 | */ | ||
141 | struct ib_sa_hdr { | ||
142 | u64 sm_key; | ||
143 | u16 attr_offset; | ||
144 | u16 reserved; | ||
145 | ib_sa_comp_mask comp_mask; | ||
106 | } __attribute__ ((packed)); | 146 | } __attribute__ ((packed)); |
107 | 147 | ||
108 | struct ib_mad { | 148 | struct ib_mad { |
109 | struct ib_mad_hdr mad_hdr; | 149 | struct ib_mad_hdr mad_hdr; |
110 | u8 data[232]; | 150 | u8 data[232]; |
111 | } __attribute__ ((packed)); | 151 | }; |
112 | 152 | ||
113 | struct ib_rmpp_mad { | 153 | struct ib_rmpp_mad { |
114 | struct ib_mad_hdr mad_hdr; | 154 | struct ib_mad_hdr mad_hdr; |
115 | struct ib_rmpp_hdr rmpp_hdr; | 155 | struct ib_rmpp_hdr rmpp_hdr; |
116 | u8 data[220]; | 156 | u8 data[220]; |
157 | }; | ||
158 | |||
159 | struct ib_sa_mad { | ||
160 | struct ib_mad_hdr mad_hdr; | ||
161 | struct ib_rmpp_hdr rmpp_hdr; | ||
162 | struct ib_sa_hdr sa_hdr; | ||
163 | u8 data[200]; | ||
117 | } __attribute__ ((packed)); | 164 | } __attribute__ ((packed)); |
118 | 165 | ||
119 | struct ib_vendor_mad { | 166 | struct ib_vendor_mad { |
@@ -122,7 +169,70 @@ struct ib_vendor_mad { | |||
122 | u8 reserved; | 169 | u8 reserved; |
123 | u8 oui[3]; | 170 | u8 oui[3]; |
124 | u8 data[216]; | 171 | u8 data[216]; |
125 | } __attribute__ ((packed)); | 172 | }; |
173 | |||
174 | /** | ||
175 | * ib_mad_send_buf - MAD data buffer and work request for sends. | ||
176 | * @mad: References an allocated MAD data buffer. The size of the data | ||
177 | * buffer is specified in the @send_wr.length field. | ||
178 | * @mapping: DMA mapping information. | ||
179 | * @mad_agent: MAD agent that allocated the buffer. | ||
180 | * @context: User-controlled context fields. | ||
181 | * @send_wr: An initialized work request structure used when sending the MAD. | ||
182 | * The wr_id field of the work request is initialized to reference this | ||
183 | * data structure. | ||
184 | * @sge: A scatter-gather list referenced by the work request. | ||
185 | * | ||
186 | * Users are responsible for initializing the MAD buffer itself, with the | ||
187 | * exception of specifying the payload length field in any RMPP MAD. | ||
188 | */ | ||
189 | struct ib_mad_send_buf { | ||
190 | struct ib_mad *mad; | ||
191 | DECLARE_PCI_UNMAP_ADDR(mapping) | ||
192 | struct ib_mad_agent *mad_agent; | ||
193 | void *context[2]; | ||
194 | struct ib_send_wr send_wr; | ||
195 | struct ib_sge sge; | ||
196 | }; | ||
197 | |||
198 | /** | ||
199 | * ib_get_rmpp_resptime - Returns the RMPP response time. | ||
200 | * @rmpp_hdr: An RMPP header. | ||
201 | */ | ||
202 | static inline u8 ib_get_rmpp_resptime(struct ib_rmpp_hdr *rmpp_hdr) | ||
203 | { | ||
204 | return rmpp_hdr->rmpp_rtime_flags >> 3; | ||
205 | } | ||
206 | |||
207 | /** | ||
208 | * ib_get_rmpp_flags - Returns the RMPP flags. | ||
209 | * @rmpp_hdr: An RMPP header. | ||
210 | */ | ||
211 | static inline u8 ib_get_rmpp_flags(struct ib_rmpp_hdr *rmpp_hdr) | ||
212 | { | ||
213 | return rmpp_hdr->rmpp_rtime_flags & 0x7; | ||
214 | } | ||
215 | |||
216 | /** | ||
217 | * ib_set_rmpp_resptime - Sets the response time in an RMPP header. | ||
218 | * @rmpp_hdr: An RMPP header. | ||
219 | * @rtime: The response time to set. | ||
220 | */ | ||
221 | static inline void ib_set_rmpp_resptime(struct ib_rmpp_hdr *rmpp_hdr, u8 rtime) | ||
222 | { | ||
223 | rmpp_hdr->rmpp_rtime_flags = ib_get_rmpp_flags(rmpp_hdr) | (rtime << 3); | ||
224 | } | ||
225 | |||
226 | /** | ||
227 | * ib_set_rmpp_flags - Sets the flags in an RMPP header. | ||
228 | * @rmpp_hdr: An RMPP header. | ||
229 | * @flags: The flags to set. | ||
230 | */ | ||
231 | static inline void ib_set_rmpp_flags(struct ib_rmpp_hdr *rmpp_hdr, u8 flags) | ||
232 | { | ||
233 | rmpp_hdr->rmpp_rtime_flags = (rmpp_hdr->rmpp_rtime_flags & 0xF1) | | ||
234 | (flags & 0x7); | ||
235 | } | ||
126 | 236 | ||
127 | struct ib_mad_agent; | 237 | struct ib_mad_agent; |
128 | struct ib_mad_send_wc; | 238 | struct ib_mad_send_wc; |
@@ -168,6 +278,7 @@ typedef void (*ib_mad_recv_handler)(struct ib_mad_agent *mad_agent, | |||
168 | * ib_mad_agent - Used to track MAD registration with the access layer. | 278 | * ib_mad_agent - Used to track MAD registration with the access layer. |
169 | * @device: Reference to device registration is on. | 279 | * @device: Reference to device registration is on. |
170 | * @qp: Reference to QP used for sending and receiving MADs. | 280 | * @qp: Reference to QP used for sending and receiving MADs. |
281 | * @mr: Memory region for system memory usable for DMA. | ||
171 | * @recv_handler: Callback handler for a received MAD. | 282 | * @recv_handler: Callback handler for a received MAD. |
172 | * @send_handler: Callback handler for a sent MAD. | 283 | * @send_handler: Callback handler for a sent MAD. |
173 | * @snoop_handler: Callback handler for snooped sent MADs. | 284 | * @snoop_handler: Callback handler for snooped sent MADs. |
@@ -176,16 +287,19 @@ typedef void (*ib_mad_recv_handler)(struct ib_mad_agent *mad_agent, | |||
176 | * Unsolicited MADs sent by this client will have the upper 32-bits | 287 | * Unsolicited MADs sent by this client will have the upper 32-bits |
177 | * of their TID set to this value. | 288 | * of their TID set to this value. |
178 | * @port_num: Port number on which QP is registered | 289 | * @port_num: Port number on which QP is registered |
290 | * @rmpp_version: If set, indicates the RMPP version used by this agent. | ||
179 | */ | 291 | */ |
180 | struct ib_mad_agent { | 292 | struct ib_mad_agent { |
181 | struct ib_device *device; | 293 | struct ib_device *device; |
182 | struct ib_qp *qp; | 294 | struct ib_qp *qp; |
295 | struct ib_mr *mr; | ||
183 | ib_mad_recv_handler recv_handler; | 296 | ib_mad_recv_handler recv_handler; |
184 | ib_mad_send_handler send_handler; | 297 | ib_mad_send_handler send_handler; |
185 | ib_mad_snoop_handler snoop_handler; | 298 | ib_mad_snoop_handler snoop_handler; |
186 | void *context; | 299 | void *context; |
187 | u32 hi_tid; | 300 | u32 hi_tid; |
188 | u8 port_num; | 301 | u8 port_num; |
302 | u8 rmpp_version; | ||
189 | }; | 303 | }; |
190 | 304 | ||
191 | /** | 305 | /** |
@@ -219,6 +333,7 @@ struct ib_mad_recv_buf { | |||
219 | * ib_mad_recv_wc - received MAD information. | 333 | * ib_mad_recv_wc - received MAD information. |
220 | * @wc: Completion information for the received data. | 334 | * @wc: Completion information for the received data. |
221 | * @recv_buf: Specifies the location of the received data buffer(s). | 335 | * @recv_buf: Specifies the location of the received data buffer(s). |
336 | * @rmpp_list: Specifies a list of RMPP reassembled received MAD buffers. | ||
222 | * @mad_len: The length of the received MAD, without duplicated headers. | 337 | * @mad_len: The length of the received MAD, without duplicated headers. |
223 | * | 338 | * |
224 | * For received response, the wr_id field of the wc is set to the wr_id | 339 | * For received response, the wr_id field of the wc is set to the wr_id |
@@ -227,6 +342,7 @@ struct ib_mad_recv_buf { | |||
227 | struct ib_mad_recv_wc { | 342 | struct ib_mad_recv_wc { |
228 | struct ib_wc *wc; | 343 | struct ib_wc *wc; |
229 | struct ib_mad_recv_buf recv_buf; | 344 | struct ib_mad_recv_buf recv_buf; |
345 | struct list_head rmpp_list; | ||
230 | int mad_len; | 346 | int mad_len; |
231 | }; | 347 | }; |
232 | 348 | ||
@@ -322,6 +438,16 @@ int ib_unregister_mad_agent(struct ib_mad_agent *mad_agent); | |||
322 | * @bad_send_wr: Specifies the MAD on which an error was encountered. | 438 | * @bad_send_wr: Specifies the MAD on which an error was encountered. |
323 | * | 439 | * |
324 | * Sent MADs are not guaranteed to complete in the order that they were posted. | 440 | * Sent MADs are not guaranteed to complete in the order that they were posted. |
441 | * | ||
442 | * If the MAD requires RMPP, the data buffer should contain a single copy | ||
443 | * of the common MAD, RMPP, and class specific headers, followed by the class | ||
444 | * defined data. If the class defined data would not divide evenly into | ||
445 | * RMPP segments, then space must be allocated at the end of the referenced | ||
446 | * buffer for any required padding. To indicate the amount of class defined | ||
447 | * data being transferred, the paylen_newwin field in the RMPP header should | ||
448 | * be set to the size of the class specific header plus the amount of class | ||
449 | * defined data being transferred. The paylen_newwin field should be | ||
450 | * specified in network-byte order. | ||
325 | */ | 451 | */ |
326 | int ib_post_send_mad(struct ib_mad_agent *mad_agent, | 452 | int ib_post_send_mad(struct ib_mad_agent *mad_agent, |
327 | struct ib_send_wr *send_wr, | 453 | struct ib_send_wr *send_wr, |
@@ -334,15 +460,13 @@ int ib_post_send_mad(struct ib_mad_agent *mad_agent, | |||
334 | * referenced buffer should be at least the size of the mad_len specified | 460 | * referenced buffer should be at least the size of the mad_len specified |
335 | * by @mad_recv_wc. | 461 | * by @mad_recv_wc. |
336 | * | 462 | * |
337 | * This call copies a chain of received RMPP MADs into a single data buffer, | 463 | * This call copies a chain of received MAD segments into a single data buffer, |
338 | * removing duplicated headers. | 464 | * removing duplicated headers. |
339 | */ | 465 | */ |
340 | void ib_coalesce_recv_mad(struct ib_mad_recv_wc *mad_recv_wc, | 466 | void ib_coalesce_recv_mad(struct ib_mad_recv_wc *mad_recv_wc, void *buf); |
341 | void *buf); | ||
342 | 467 | ||
343 | /** | 468 | /** |
344 | * ib_free_recv_mad - Returns data buffers used to receive a MAD to the | 469 | * ib_free_recv_mad - Returns data buffers used to receive a MAD. |
345 | * access layer. | ||
346 | * @mad_recv_wc: Work completion information for a received MAD. | 470 | * @mad_recv_wc: Work completion information for a received MAD. |
347 | * | 471 | * |
348 | * Clients receiving MADs through their ib_mad_recv_handler must call this | 472 | * Clients receiving MADs through their ib_mad_recv_handler must call this |
@@ -358,8 +482,18 @@ void ib_free_recv_mad(struct ib_mad_recv_wc *mad_recv_wc); | |||
358 | * MADs will be returned to the user through the corresponding | 482 | * MADs will be returned to the user through the corresponding |
359 | * ib_mad_send_handler. | 483 | * ib_mad_send_handler. |
360 | */ | 484 | */ |
361 | void ib_cancel_mad(struct ib_mad_agent *mad_agent, | 485 | void ib_cancel_mad(struct ib_mad_agent *mad_agent, u64 wr_id); |
362 | u64 wr_id); | 486 | |
487 | /** | ||
488 | * ib_modify_mad - Modifies an outstanding send MAD operation. | ||
489 | * @mad_agent: Specifies the registration associated with sent MAD. | ||
490 | * @wr_id: Indicates the work request identifier of the MAD to modify. | ||
491 | * @timeout_ms: New timeout value for sent MAD. | ||
492 | * | ||
493 | * This call will reset the timeout value for a sent MAD to the specified | ||
494 | * value. | ||
495 | */ | ||
496 | int ib_modify_mad(struct ib_mad_agent *mad_agent, u64 wr_id, u32 timeout_ms); | ||
363 | 497 | ||
364 | /** | 498 | /** |
365 | * ib_redirect_mad_qp - Registers a QP for MAD services. | 499 | * ib_redirect_mad_qp - Registers a QP for MAD services. |
@@ -401,4 +535,43 @@ struct ib_mad_agent *ib_redirect_mad_qp(struct ib_qp *qp, | |||
401 | int ib_process_mad_wc(struct ib_mad_agent *mad_agent, | 535 | int ib_process_mad_wc(struct ib_mad_agent *mad_agent, |
402 | struct ib_wc *wc); | 536 | struct ib_wc *wc); |
403 | 537 | ||
538 | /** | ||
539 | * ib_create_send_mad - Allocate and initialize a data buffer and work request | ||
540 | * for sending a MAD. | ||
541 | * @mad_agent: Specifies the registered MAD service to associate with the MAD. | ||
542 | * @remote_qpn: Specifies the QPN of the receiving node. | ||
543 | * @pkey_index: Specifies which PKey the MAD will be sent using. This field | ||
544 | * is valid only if the remote_qpn is QP 1. | ||
545 | * @ah: References the address handle used to transfer to the remote node. | ||
546 | * @rmpp_active: Indicates if the send will enable RMPP. | ||
547 | * @hdr_len: Indicates the size of the data header of the MAD. This length | ||
548 | * should include the common MAD header, RMPP header, plus any class | ||
549 | * specific header. | ||
550 | * @data_len: Indicates the size of any user-transferred data. The call will | ||
551 | * automatically adjust the allocated buffer size to account for any | ||
552 | * additional padding that may be necessary. | ||
553 | * @gfp_mask: GFP mask used for the memory allocation. | ||
554 | * | ||
555 | * This is a helper routine that may be used to allocate a MAD. Users are | ||
556 | * not required to allocate outbound MADs using this call. The returned | ||
557 | * MAD send buffer will reference a data buffer usable for sending a MAD, along | ||
558 | * with an initialized work request structure. Users may modify the returned | ||
559 | * MAD data buffer or work request before posting the send. | ||
560 | * | ||
561 | * The returned data buffer will be cleared. Users are responsible for | ||
562 | * initializing the common MAD and any class specific headers. If @rmpp_active | ||
563 | * is set, the RMPP header will be initialized for sending. | ||
564 | */ | ||
565 | struct ib_mad_send_buf * ib_create_send_mad(struct ib_mad_agent *mad_agent, | ||
566 | u32 remote_qpn, u16 pkey_index, | ||
567 | struct ib_ah *ah, int rmpp_active, | ||
568 | int hdr_len, int data_len, | ||
569 | unsigned int __nocast gfp_mask); | ||
570 | |||
571 | /** | ||
572 | * ib_free_send_mad - Returns data buffers used to send a MAD. | ||
573 | * @send_buf: Previously allocated send data buffer. | ||
574 | */ | ||
575 | void ib_free_send_mad(struct ib_mad_send_buf *send_buf); | ||
576 | |||
404 | #endif /* IB_MAD_H */ | 577 | #endif /* IB_MAD_H */ |
diff --git a/drivers/infiniband/include/ib_sa.h b/drivers/infiniband/include/ib_sa.h index 00222285eb9a..6d999f7b5d93 100644 --- a/drivers/infiniband/include/ib_sa.h +++ b/drivers/infiniband/include/ib_sa.h | |||
@@ -1,5 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2004 Topspin Communications. All rights reserved. | 2 | * Copyright (c) 2004 Topspin Communications. All rights reserved. |
3 | * Copyright (c) 2005 Voltaire, Inc. All rights reserved. | ||
3 | * | 4 | * |
4 | * This software is available to you under a choice of one of two | 5 | * This software is available to you under a choice of one of two |
5 | * licenses. You may choose to be licensed under the terms of the GNU | 6 | * licenses. You may choose to be licensed under the terms of the GNU |
@@ -29,7 +30,7 @@ | |||
29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | 30 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
30 | * SOFTWARE. | 31 | * SOFTWARE. |
31 | * | 32 | * |
32 | * $Id: ib_sa.h 1389 2004-12-27 22:56:47Z roland $ | 33 | * $Id: ib_sa.h 2811 2005-07-06 18:11:43Z halr $ |
33 | */ | 34 | */ |
34 | 35 | ||
35 | #ifndef IB_SA_H | 36 | #ifndef IB_SA_H |
@@ -41,9 +42,11 @@ | |||
41 | #include <ib_mad.h> | 42 | #include <ib_mad.h> |
42 | 43 | ||
43 | enum { | 44 | enum { |
44 | IB_SA_CLASS_VERSION = 2, /* IB spec version 1.1/1.2 */ | 45 | IB_SA_CLASS_VERSION = 2, /* IB spec version 1.1/1.2 */ |
45 | 46 | ||
46 | IB_SA_METHOD_DELETE = 0x15 | 47 | IB_SA_METHOD_GET_TABLE = 0x12, |
48 | IB_SA_METHOD_GET_TABLE_RESP = 0x92, | ||
49 | IB_SA_METHOD_DELETE = 0x15 | ||
47 | }; | 50 | }; |
48 | 51 | ||
49 | enum ib_sa_selector { | 52 | enum ib_sa_selector { |
@@ -87,10 +90,6 @@ static inline int ib_sa_rate_enum_to_int(enum ib_sa_rate rate) | |||
87 | } | 90 | } |
88 | } | 91 | } |
89 | 92 | ||
90 | typedef u64 __bitwise ib_sa_comp_mask; | ||
91 | |||
92 | #define IB_SA_COMP_MASK(n) ((__force ib_sa_comp_mask) cpu_to_be64(1ull << n)) | ||
93 | |||
94 | /* | 93 | /* |
95 | * Structures for SA records are named "struct ib_sa_xxx_rec." No | 94 | * Structures for SA records are named "struct ib_sa_xxx_rec." No |
96 | * attempt is made to pack structures to match the physical layout of | 95 | * attempt is made to pack structures to match the physical layout of |
@@ -195,6 +194,61 @@ struct ib_sa_mcmember_rec { | |||
195 | int proxy_join; | 194 | int proxy_join; |
196 | }; | 195 | }; |
197 | 196 | ||
197 | /* Service Record Component Mask Sec 15.2.5.14 Ver 1.1 */ | ||
198 | #define IB_SA_SERVICE_REC_SERVICE_ID IB_SA_COMP_MASK( 0) | ||
199 | #define IB_SA_SERVICE_REC_SERVICE_GID IB_SA_COMP_MASK( 1) | ||
200 | #define IB_SA_SERVICE_REC_SERVICE_PKEY IB_SA_COMP_MASK( 2) | ||
201 | /* reserved: 3 */ | ||
202 | #define IB_SA_SERVICE_REC_SERVICE_LEASE IB_SA_COMP_MASK( 4) | ||
203 | #define IB_SA_SERVICE_REC_SERVICE_KEY IB_SA_COMP_MASK( 5) | ||
204 | #define IB_SA_SERVICE_REC_SERVICE_NAME IB_SA_COMP_MASK( 6) | ||
205 | #define IB_SA_SERVICE_REC_SERVICE_DATA8_0 IB_SA_COMP_MASK( 7) | ||
206 | #define IB_SA_SERVICE_REC_SERVICE_DATA8_1 IB_SA_COMP_MASK( 8) | ||
207 | #define IB_SA_SERVICE_REC_SERVICE_DATA8_2 IB_SA_COMP_MASK( 9) | ||
208 | #define IB_SA_SERVICE_REC_SERVICE_DATA8_3 IB_SA_COMP_MASK(10) | ||
209 | #define IB_SA_SERVICE_REC_SERVICE_DATA8_4 IB_SA_COMP_MASK(11) | ||
210 | #define IB_SA_SERVICE_REC_SERVICE_DATA8_5 IB_SA_COMP_MASK(12) | ||
211 | #define IB_SA_SERVICE_REC_SERVICE_DATA8_6 IB_SA_COMP_MASK(13) | ||
212 | #define IB_SA_SERVICE_REC_SERVICE_DATA8_7 IB_SA_COMP_MASK(14) | ||
213 | #define IB_SA_SERVICE_REC_SERVICE_DATA8_8 IB_SA_COMP_MASK(15) | ||
214 | #define IB_SA_SERVICE_REC_SERVICE_DATA8_9 IB_SA_COMP_MASK(16) | ||
215 | #define IB_SA_SERVICE_REC_SERVICE_DATA8_10 IB_SA_COMP_MASK(17) | ||
216 | #define IB_SA_SERVICE_REC_SERVICE_DATA8_11 IB_SA_COMP_MASK(18) | ||
217 | #define IB_SA_SERVICE_REC_SERVICE_DATA8_12 IB_SA_COMP_MASK(19) | ||
218 | #define IB_SA_SERVICE_REC_SERVICE_DATA8_13 IB_SA_COMP_MASK(20) | ||
219 | #define IB_SA_SERVICE_REC_SERVICE_DATA8_14 IB_SA_COMP_MASK(21) | ||
220 | #define IB_SA_SERVICE_REC_SERVICE_DATA8_15 IB_SA_COMP_MASK(22) | ||
221 | #define IB_SA_SERVICE_REC_SERVICE_DATA16_0 IB_SA_COMP_MASK(23) | ||
222 | #define IB_SA_SERVICE_REC_SERVICE_DATA16_1 IB_SA_COMP_MASK(24) | ||
223 | #define IB_SA_SERVICE_REC_SERVICE_DATA16_2 IB_SA_COMP_MASK(25) | ||
224 | #define IB_SA_SERVICE_REC_SERVICE_DATA16_3 IB_SA_COMP_MASK(26) | ||
225 | #define IB_SA_SERVICE_REC_SERVICE_DATA16_4 IB_SA_COMP_MASK(27) | ||
226 | #define IB_SA_SERVICE_REC_SERVICE_DATA16_5 IB_SA_COMP_MASK(28) | ||
227 | #define IB_SA_SERVICE_REC_SERVICE_DATA16_6 IB_SA_COMP_MASK(29) | ||
228 | #define IB_SA_SERVICE_REC_SERVICE_DATA16_7 IB_SA_COMP_MASK(30) | ||
229 | #define IB_SA_SERVICE_REC_SERVICE_DATA32_0 IB_SA_COMP_MASK(31) | ||
230 | #define IB_SA_SERVICE_REC_SERVICE_DATA32_1 IB_SA_COMP_MASK(32) | ||
231 | #define IB_SA_SERVICE_REC_SERVICE_DATA32_2 IB_SA_COMP_MASK(33) | ||
232 | #define IB_SA_SERVICE_REC_SERVICE_DATA32_3 IB_SA_COMP_MASK(34) | ||
233 | #define IB_SA_SERVICE_REC_SERVICE_DATA64_0 IB_SA_COMP_MASK(35) | ||
234 | #define IB_SA_SERVICE_REC_SERVICE_DATA64_1 IB_SA_COMP_MASK(36) | ||
235 | |||
236 | #define IB_DEFAULT_SERVICE_LEASE 0xFFFFFFFF | ||
237 | |||
238 | struct ib_sa_service_rec { | ||
239 | u64 id; | ||
240 | union ib_gid gid; | ||
241 | u16 pkey; | ||
242 | /* reserved */ | ||
243 | u32 lease; | ||
244 | u8 key[16]; | ||
245 | u8 name[64]; | ||
246 | u8 data8[16]; | ||
247 | u16 data16[8]; | ||
248 | u32 data32[4]; | ||
249 | u64 data64[2]; | ||
250 | }; | ||
251 | |||
198 | struct ib_sa_query; | 252 | struct ib_sa_query; |
199 | 253 | ||
200 | void ib_sa_cancel_query(int id, struct ib_sa_query *query); | 254 | void ib_sa_cancel_query(int id, struct ib_sa_query *query); |
@@ -202,7 +256,7 @@ void ib_sa_cancel_query(int id, struct ib_sa_query *query); | |||
202 | int ib_sa_path_rec_get(struct ib_device *device, u8 port_num, | 256 | int ib_sa_path_rec_get(struct ib_device *device, u8 port_num, |
203 | struct ib_sa_path_rec *rec, | 257 | struct ib_sa_path_rec *rec, |
204 | ib_sa_comp_mask comp_mask, | 258 | ib_sa_comp_mask comp_mask, |
205 | int timeout_ms, int gfp_mask, | 259 | int timeout_ms, unsigned int __nocast gfp_mask, |
206 | void (*callback)(int status, | 260 | void (*callback)(int status, |
207 | struct ib_sa_path_rec *resp, | 261 | struct ib_sa_path_rec *resp, |
208 | void *context), | 262 | void *context), |
@@ -213,13 +267,24 @@ int ib_sa_mcmember_rec_query(struct ib_device *device, u8 port_num, | |||
213 | u8 method, | 267 | u8 method, |
214 | struct ib_sa_mcmember_rec *rec, | 268 | struct ib_sa_mcmember_rec *rec, |
215 | ib_sa_comp_mask comp_mask, | 269 | ib_sa_comp_mask comp_mask, |
216 | int timeout_ms, int gfp_mask, | 270 | int timeout_ms, unsigned int __nocast gfp_mask, |
217 | void (*callback)(int status, | 271 | void (*callback)(int status, |
218 | struct ib_sa_mcmember_rec *resp, | 272 | struct ib_sa_mcmember_rec *resp, |
219 | void *context), | 273 | void *context), |
220 | void *context, | 274 | void *context, |
221 | struct ib_sa_query **query); | 275 | struct ib_sa_query **query); |
222 | 276 | ||
277 | int ib_sa_service_rec_query(struct ib_device *device, u8 port_num, | ||
278 | u8 method, | ||
279 | struct ib_sa_service_rec *rec, | ||
280 | ib_sa_comp_mask comp_mask, | ||
281 | int timeout_ms, unsigned int __nocast gfp_mask, | ||
282 | void (*callback)(int status, | ||
283 | struct ib_sa_service_rec *resp, | ||
284 | void *context), | ||
285 | void *context, | ||
286 | struct ib_sa_query **sa_query); | ||
287 | |||
223 | /** | 288 | /** |
224 | * ib_sa_mcmember_rec_set - Start an MCMember set query | 289 | * ib_sa_mcmember_rec_set - Start an MCMember set query |
225 | * @device:device to send query on | 290 | * @device:device to send query on |
@@ -248,7 +313,7 @@ static inline int | |||
248 | ib_sa_mcmember_rec_set(struct ib_device *device, u8 port_num, | 313 | ib_sa_mcmember_rec_set(struct ib_device *device, u8 port_num, |
249 | struct ib_sa_mcmember_rec *rec, | 314 | struct ib_sa_mcmember_rec *rec, |
250 | ib_sa_comp_mask comp_mask, | 315 | ib_sa_comp_mask comp_mask, |
251 | int timeout_ms, int gfp_mask, | 316 | int timeout_ms, unsigned int __nocast gfp_mask, |
252 | void (*callback)(int status, | 317 | void (*callback)(int status, |
253 | struct ib_sa_mcmember_rec *resp, | 318 | struct ib_sa_mcmember_rec *resp, |
254 | void *context), | 319 | void *context), |
@@ -290,7 +355,7 @@ static inline int | |||
290 | ib_sa_mcmember_rec_delete(struct ib_device *device, u8 port_num, | 355 | ib_sa_mcmember_rec_delete(struct ib_device *device, u8 port_num, |
291 | struct ib_sa_mcmember_rec *rec, | 356 | struct ib_sa_mcmember_rec *rec, |
292 | ib_sa_comp_mask comp_mask, | 357 | ib_sa_comp_mask comp_mask, |
293 | int timeout_ms, int gfp_mask, | 358 | int timeout_ms, unsigned int __nocast gfp_mask, |
294 | void (*callback)(int status, | 359 | void (*callback)(int status, |
295 | struct ib_sa_mcmember_rec *resp, | 360 | struct ib_sa_mcmember_rec *resp, |
296 | void *context), | 361 | void *context), |
diff --git a/drivers/infiniband/include/ib_user_cm.h b/drivers/infiniband/include/ib_user_cm.h new file mode 100644 index 000000000000..500b1af6ff77 --- /dev/null +++ b/drivers/infiniband/include/ib_user_cm.h | |||
@@ -0,0 +1,328 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2005 Topspin Communications. All rights reserved. | ||
3 | * | ||
4 | * This software is available to you under a choice of one of two | ||
5 | * licenses. You may choose to be licensed under the terms of the GNU | ||
6 | * General Public License (GPL) Version 2, available from the file | ||
7 | * COPYING in the main directory of this source tree, or the | ||
8 | * OpenIB.org BSD license below: | ||
9 | * | ||
10 | * Redistribution and use in source and binary forms, with or | ||
11 | * without modification, are permitted provided that the following | ||
12 | * conditions are met: | ||
13 | * | ||
14 | * - Redistributions of source code must retain the above | ||
15 | * copyright notice, this list of conditions and the following | ||
16 | * disclaimer. | ||
17 | * | ||
18 | * - Redistributions in binary form must reproduce the above | ||
19 | * copyright notice, this list of conditions and the following | ||
20 | * disclaimer in the documentation and/or other materials | ||
21 | * provided with the distribution. | ||
22 | * | ||
23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
30 | * SOFTWARE. | ||
31 | * | ||
32 | * $Id: ib_user_cm.h 2576 2005-06-09 17:00:30Z libor $ | ||
33 | */ | ||
34 | |||
35 | #ifndef IB_USER_CM_H | ||
36 | #define IB_USER_CM_H | ||
37 | |||
38 | #include <linux/types.h> | ||
39 | |||
40 | #define IB_USER_CM_ABI_VERSION 1 | ||
41 | |||
42 | enum { | ||
43 | IB_USER_CM_CMD_CREATE_ID, | ||
44 | IB_USER_CM_CMD_DESTROY_ID, | ||
45 | IB_USER_CM_CMD_ATTR_ID, | ||
46 | |||
47 | IB_USER_CM_CMD_LISTEN, | ||
48 | IB_USER_CM_CMD_ESTABLISH, | ||
49 | |||
50 | IB_USER_CM_CMD_SEND_REQ, | ||
51 | IB_USER_CM_CMD_SEND_REP, | ||
52 | IB_USER_CM_CMD_SEND_RTU, | ||
53 | IB_USER_CM_CMD_SEND_DREQ, | ||
54 | IB_USER_CM_CMD_SEND_DREP, | ||
55 | IB_USER_CM_CMD_SEND_REJ, | ||
56 | IB_USER_CM_CMD_SEND_MRA, | ||
57 | IB_USER_CM_CMD_SEND_LAP, | ||
58 | IB_USER_CM_CMD_SEND_APR, | ||
59 | IB_USER_CM_CMD_SEND_SIDR_REQ, | ||
60 | IB_USER_CM_CMD_SEND_SIDR_REP, | ||
61 | |||
62 | IB_USER_CM_CMD_EVENT, | ||
63 | }; | ||
64 | /* | ||
65 | * command ABI structures. | ||
66 | */ | ||
67 | struct ib_ucm_cmd_hdr { | ||
68 | __u32 cmd; | ||
69 | __u16 in; | ||
70 | __u16 out; | ||
71 | }; | ||
72 | |||
73 | struct ib_ucm_create_id { | ||
74 | __u64 response; | ||
75 | }; | ||
76 | |||
77 | struct ib_ucm_create_id_resp { | ||
78 | __u32 id; | ||
79 | }; | ||
80 | |||
81 | struct ib_ucm_destroy_id { | ||
82 | __u32 id; | ||
83 | }; | ||
84 | |||
85 | struct ib_ucm_attr_id { | ||
86 | __u64 response; | ||
87 | __u32 id; | ||
88 | }; | ||
89 | |||
90 | struct ib_ucm_attr_id_resp { | ||
91 | __u64 service_id; | ||
92 | __u64 service_mask; | ||
93 | __u32 local_id; | ||
94 | __u32 remote_id; | ||
95 | }; | ||
96 | |||
97 | struct ib_ucm_listen { | ||
98 | __u64 service_id; | ||
99 | __u64 service_mask; | ||
100 | __u32 id; | ||
101 | }; | ||
102 | |||
103 | struct ib_ucm_establish { | ||
104 | __u32 id; | ||
105 | }; | ||
106 | |||
107 | struct ib_ucm_private_data { | ||
108 | __u64 data; | ||
109 | __u32 id; | ||
110 | __u8 len; | ||
111 | __u8 reserved[3]; | ||
112 | }; | ||
113 | |||
114 | struct ib_ucm_path_rec { | ||
115 | __u8 dgid[16]; | ||
116 | __u8 sgid[16]; | ||
117 | __u16 dlid; | ||
118 | __u16 slid; | ||
119 | __u32 raw_traffic; | ||
120 | __u32 flow_label; | ||
121 | __u32 reversible; | ||
122 | __u32 mtu; | ||
123 | __u16 pkey; | ||
124 | __u8 hop_limit; | ||
125 | __u8 traffic_class; | ||
126 | __u8 numb_path; | ||
127 | __u8 sl; | ||
128 | __u8 mtu_selector; | ||
129 | __u8 rate_selector; | ||
130 | __u8 rate; | ||
131 | __u8 packet_life_time_selector; | ||
132 | __u8 packet_life_time; | ||
133 | __u8 preference; | ||
134 | }; | ||
135 | |||
136 | struct ib_ucm_req { | ||
137 | __u32 id; | ||
138 | __u32 qpn; | ||
139 | __u32 qp_type; | ||
140 | __u32 psn; | ||
141 | __u64 sid; | ||
142 | __u64 data; | ||
143 | __u64 primary_path; | ||
144 | __u64 alternate_path; | ||
145 | __u8 len; | ||
146 | __u8 peer_to_peer; | ||
147 | __u8 responder_resources; | ||
148 | __u8 initiator_depth; | ||
149 | __u8 remote_cm_response_timeout; | ||
150 | __u8 flow_control; | ||
151 | __u8 local_cm_response_timeout; | ||
152 | __u8 retry_count; | ||
153 | __u8 rnr_retry_count; | ||
154 | __u8 max_cm_retries; | ||
155 | __u8 srq; | ||
156 | __u8 reserved[1]; | ||
157 | }; | ||
158 | |||
159 | struct ib_ucm_rep { | ||
160 | __u64 data; | ||
161 | __u32 id; | ||
162 | __u32 qpn; | ||
163 | __u32 psn; | ||
164 | __u8 len; | ||
165 | __u8 responder_resources; | ||
166 | __u8 initiator_depth; | ||
167 | __u8 target_ack_delay; | ||
168 | __u8 failover_accepted; | ||
169 | __u8 flow_control; | ||
170 | __u8 rnr_retry_count; | ||
171 | __u8 srq; | ||
172 | }; | ||
173 | |||
174 | struct ib_ucm_info { | ||
175 | __u32 id; | ||
176 | __u32 status; | ||
177 | __u64 info; | ||
178 | __u64 data; | ||
179 | __u8 info_len; | ||
180 | __u8 data_len; | ||
181 | __u8 reserved[2]; | ||
182 | }; | ||
183 | |||
184 | struct ib_ucm_mra { | ||
185 | __u64 data; | ||
186 | __u32 id; | ||
187 | __u8 len; | ||
188 | __u8 timeout; | ||
189 | __u8 reserved[2]; | ||
190 | }; | ||
191 | |||
192 | struct ib_ucm_lap { | ||
193 | __u64 path; | ||
194 | __u64 data; | ||
195 | __u32 id; | ||
196 | __u8 len; | ||
197 | __u8 reserved[3]; | ||
198 | }; | ||
199 | |||
200 | struct ib_ucm_sidr_req { | ||
201 | __u32 id; | ||
202 | __u32 timeout; | ||
203 | __u64 sid; | ||
204 | __u64 data; | ||
205 | __u64 path; | ||
206 | __u16 pkey; | ||
207 | __u8 len; | ||
208 | __u8 max_cm_retries; | ||
209 | }; | ||
210 | |||
211 | struct ib_ucm_sidr_rep { | ||
212 | __u32 id; | ||
213 | __u32 qpn; | ||
214 | __u32 qkey; | ||
215 | __u32 status; | ||
216 | __u64 info; | ||
217 | __u64 data; | ||
218 | __u8 info_len; | ||
219 | __u8 data_len; | ||
220 | __u8 reserved[2]; | ||
221 | }; | ||
222 | /* | ||
223 | * event notification ABI structures. | ||
224 | */ | ||
225 | struct ib_ucm_event_get { | ||
226 | __u64 response; | ||
227 | __u64 data; | ||
228 | __u64 info; | ||
229 | __u8 data_len; | ||
230 | __u8 info_len; | ||
231 | __u8 reserved[2]; | ||
232 | }; | ||
233 | |||
234 | struct ib_ucm_req_event_resp { | ||
235 | __u32 listen_id; | ||
236 | /* device */ | ||
237 | /* port */ | ||
238 | struct ib_ucm_path_rec primary_path; | ||
239 | struct ib_ucm_path_rec alternate_path; | ||
240 | __u64 remote_ca_guid; | ||
241 | __u32 remote_qkey; | ||
242 | __u32 remote_qpn; | ||
243 | __u32 qp_type; | ||
244 | __u32 starting_psn; | ||
245 | __u8 responder_resources; | ||
246 | __u8 initiator_depth; | ||
247 | __u8 local_cm_response_timeout; | ||
248 | __u8 flow_control; | ||
249 | __u8 remote_cm_response_timeout; | ||
250 | __u8 retry_count; | ||
251 | __u8 rnr_retry_count; | ||
252 | __u8 srq; | ||
253 | }; | ||
254 | |||
255 | struct ib_ucm_rep_event_resp { | ||
256 | __u64 remote_ca_guid; | ||
257 | __u32 remote_qkey; | ||
258 | __u32 remote_qpn; | ||
259 | __u32 starting_psn; | ||
260 | __u8 responder_resources; | ||
261 | __u8 initiator_depth; | ||
262 | __u8 target_ack_delay; | ||
263 | __u8 failover_accepted; | ||
264 | __u8 flow_control; | ||
265 | __u8 rnr_retry_count; | ||
266 | __u8 srq; | ||
267 | __u8 reserved[1]; | ||
268 | }; | ||
269 | |||
270 | struct ib_ucm_rej_event_resp { | ||
271 | __u32 reason; | ||
272 | /* ari in ib_ucm_event_get info field. */ | ||
273 | }; | ||
274 | |||
275 | struct ib_ucm_mra_event_resp { | ||
276 | __u8 timeout; | ||
277 | __u8 reserved[3]; | ||
278 | }; | ||
279 | |||
280 | struct ib_ucm_lap_event_resp { | ||
281 | struct ib_ucm_path_rec path; | ||
282 | }; | ||
283 | |||
284 | struct ib_ucm_apr_event_resp { | ||
285 | __u32 status; | ||
286 | /* apr info in ib_ucm_event_get info field. */ | ||
287 | }; | ||
288 | |||
289 | struct ib_ucm_sidr_req_event_resp { | ||
290 | __u32 listen_id; | ||
291 | /* device */ | ||
292 | /* port */ | ||
293 | __u16 pkey; | ||
294 | __u8 reserved[2]; | ||
295 | }; | ||
296 | |||
297 | struct ib_ucm_sidr_rep_event_resp { | ||
298 | __u32 status; | ||
299 | __u32 qkey; | ||
300 | __u32 qpn; | ||
301 | /* info in ib_ucm_event_get info field. */ | ||
302 | }; | ||
303 | |||
304 | #define IB_UCM_PRES_DATA 0x01 | ||
305 | #define IB_UCM_PRES_INFO 0x02 | ||
306 | #define IB_UCM_PRES_PRIMARY 0x04 | ||
307 | #define IB_UCM_PRES_ALTERNATE 0x08 | ||
308 | |||
309 | struct ib_ucm_event_resp { | ||
310 | __u32 id; | ||
311 | __u32 event; | ||
312 | __u32 present; | ||
313 | union { | ||
314 | struct ib_ucm_req_event_resp req_resp; | ||
315 | struct ib_ucm_rep_event_resp rep_resp; | ||
316 | struct ib_ucm_rej_event_resp rej_resp; | ||
317 | struct ib_ucm_mra_event_resp mra_resp; | ||
318 | struct ib_ucm_lap_event_resp lap_resp; | ||
319 | struct ib_ucm_apr_event_resp apr_resp; | ||
320 | |||
321 | struct ib_ucm_sidr_req_event_resp sidr_req_resp; | ||
322 | struct ib_ucm_sidr_rep_event_resp sidr_rep_resp; | ||
323 | |||
324 | __u32 send_status; | ||
325 | } u; | ||
326 | }; | ||
327 | |||
328 | #endif /* IB_USER_CM_H */ | ||
diff --git a/drivers/infiniband/include/ib_user_mad.h b/drivers/infiniband/include/ib_user_mad.h index 06ad4a6075fa..a9a56b50aacc 100644 --- a/drivers/infiniband/include/ib_user_mad.h +++ b/drivers/infiniband/include/ib_user_mad.h | |||
@@ -1,5 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2004 Topspin Communications. All rights reserved. | 2 | * Copyright (c) 2004 Topspin Communications. All rights reserved. |
3 | * Copyright (c) 2005 Voltaire, Inc. All rights reserved. | ||
3 | * | 4 | * |
4 | * This software is available to you under a choice of one of two | 5 | * This software is available to you under a choice of one of two |
5 | * licenses. You may choose to be licensed under the terms of the GNU | 6 | * licenses. You may choose to be licensed under the terms of the GNU |
@@ -29,7 +30,7 @@ | |||
29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | 30 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
30 | * SOFTWARE. | 31 | * SOFTWARE. |
31 | * | 32 | * |
32 | * $Id: ib_user_mad.h 1389 2004-12-27 22:56:47Z roland $ | 33 | * $Id: ib_user_mad.h 2814 2005-07-06 19:14:09Z halr $ |
33 | */ | 34 | */ |
34 | 35 | ||
35 | #ifndef IB_USER_MAD_H | 36 | #ifndef IB_USER_MAD_H |
@@ -42,7 +43,7 @@ | |||
42 | * Increment this value if any changes that break userspace ABI | 43 | * Increment this value if any changes that break userspace ABI |
43 | * compatibility are made. | 44 | * compatibility are made. |
44 | */ | 45 | */ |
45 | #define IB_USER_MAD_ABI_VERSION 2 | 46 | #define IB_USER_MAD_ABI_VERSION 5 |
46 | 47 | ||
47 | /* | 48 | /* |
48 | * Make sure that all structs defined in this file remain laid out so | 49 | * Make sure that all structs defined in this file remain laid out so |
@@ -51,13 +52,13 @@ | |||
51 | */ | 52 | */ |
52 | 53 | ||
53 | /** | 54 | /** |
54 | * ib_user_mad - MAD packet | 55 | * ib_user_mad_hdr - MAD packet header |
55 | * @data - Contents of MAD | ||
56 | * @id - ID of agent MAD received with/to be sent with | 56 | * @id - ID of agent MAD received with/to be sent with |
57 | * @status - 0 on successful receive, ETIMEDOUT if no response | 57 | * @status - 0 on successful receive, ETIMEDOUT if no response |
58 | * received (transaction ID in data[] will be set to TID of original | 58 | * received (transaction ID in data[] will be set to TID of original |
59 | * request) (ignored on send) | 59 | * request) (ignored on send) |
60 | * @timeout_ms - Milliseconds to wait for response (unset on receive) | 60 | * @timeout_ms - Milliseconds to wait for response (unset on receive) |
61 | * @retries - Number of automatic retries to attempt | ||
61 | * @qpn - Remote QP number received from/to be sent to | 62 | * @qpn - Remote QP number received from/to be sent to |
62 | * @qkey - Remote Q_Key to be sent with (unset on receive) | 63 | * @qkey - Remote Q_Key to be sent with (unset on receive) |
63 | * @lid - Remote lid received from/to be sent to | 64 | * @lid - Remote lid received from/to be sent to |
@@ -72,11 +73,12 @@ | |||
72 | * | 73 | * |
73 | * All multi-byte quantities are stored in network (big endian) byte order. | 74 | * All multi-byte quantities are stored in network (big endian) byte order. |
74 | */ | 75 | */ |
75 | struct ib_user_mad { | 76 | struct ib_user_mad_hdr { |
76 | __u8 data[256]; | ||
77 | __u32 id; | 77 | __u32 id; |
78 | __u32 status; | 78 | __u32 status; |
79 | __u32 timeout_ms; | 79 | __u32 timeout_ms; |
80 | __u32 retries; | ||
81 | __u32 length; | ||
80 | __u32 qpn; | 82 | __u32 qpn; |
81 | __u32 qkey; | 83 | __u32 qkey; |
82 | __u16 lid; | 84 | __u16 lid; |
@@ -91,6 +93,17 @@ struct ib_user_mad { | |||
91 | }; | 93 | }; |
92 | 94 | ||
93 | /** | 95 | /** |
96 | * ib_user_mad - MAD packet | ||
97 | * @hdr - MAD packet header | ||
98 | * @data - Contents of MAD | ||
99 | * | ||
100 | */ | ||
101 | struct ib_user_mad { | ||
102 | struct ib_user_mad_hdr hdr; | ||
103 | __u8 data[0]; | ||
104 | }; | ||
105 | |||
106 | /** | ||
94 | * ib_user_mad_reg_req - MAD registration request | 107 | * ib_user_mad_reg_req - MAD registration request |
95 | * @id - Set by the kernel; used to identify agent in future requests. | 108 | * @id - Set by the kernel; used to identify agent in future requests. |
96 | * @qpn - Queue pair number; must be 0 or 1. | 109 | * @qpn - Queue pair number; must be 0 or 1. |
@@ -103,6 +116,8 @@ struct ib_user_mad { | |||
103 | * management class to receive. | 116 | * management class to receive. |
104 | * @oui: Indicates IEEE OUI when mgmt_class is a vendor class | 117 | * @oui: Indicates IEEE OUI when mgmt_class is a vendor class |
105 | * in the range from 0x30 to 0x4f. Otherwise not used. | 118 | * in the range from 0x30 to 0x4f. Otherwise not used. |
119 | * @rmpp_version: If set, indicates the RMPP version used. | ||
120 | * | ||
106 | */ | 121 | */ |
107 | struct ib_user_mad_reg_req { | 122 | struct ib_user_mad_reg_req { |
108 | __u32 id; | 123 | __u32 id; |
@@ -111,6 +126,7 @@ struct ib_user_mad_reg_req { | |||
111 | __u8 mgmt_class; | 126 | __u8 mgmt_class; |
112 | __u8 mgmt_class_version; | 127 | __u8 mgmt_class_version; |
113 | __u8 oui[3]; | 128 | __u8 oui[3]; |
129 | __u8 rmpp_version; | ||
114 | }; | 130 | }; |
115 | 131 | ||
116 | #define IB_IOCTL_MAGIC 0x1b | 132 | #define IB_IOCTL_MAGIC 0x1b |
diff --git a/drivers/infiniband/include/ib_verbs.h b/drivers/infiniband/include/ib_verbs.h index e5bd9a10c201..5d24edaa66e6 100644 --- a/drivers/infiniband/include/ib_verbs.h +++ b/drivers/infiniband/include/ib_verbs.h | |||
@@ -289,6 +289,15 @@ struct ib_global_route { | |||
289 | u8 traffic_class; | 289 | u8 traffic_class; |
290 | }; | 290 | }; |
291 | 291 | ||
292 | struct ib_grh { | ||
293 | u32 version_tclass_flow; | ||
294 | u16 paylen; | ||
295 | u8 next_hdr; | ||
296 | u8 hop_limit; | ||
297 | union ib_gid sgid; | ||
298 | union ib_gid dgid; | ||
299 | }; | ||
300 | |||
292 | enum { | 301 | enum { |
293 | IB_MULTICAST_QPN = 0xffffff | 302 | IB_MULTICAST_QPN = 0xffffff |
294 | }; | 303 | }; |
@@ -566,6 +575,7 @@ struct ib_send_wr { | |||
566 | u32 remote_qpn; | 575 | u32 remote_qpn; |
567 | u32 remote_qkey; | 576 | u32 remote_qkey; |
568 | int timeout_ms; /* valid for MADs only */ | 577 | int timeout_ms; /* valid for MADs only */ |
578 | int retries; /* valid for MADs only */ | ||
569 | u16 pkey_index; /* valid for GSI only */ | 579 | u16 pkey_index; /* valid for GSI only */ |
570 | u8 port_num; /* valid for DR SMPs on switch only */ | 580 | u8 port_num; /* valid for DR SMPs on switch only */ |
571 | } ud; | 581 | } ud; |
@@ -990,6 +1000,21 @@ int ib_dealloc_pd(struct ib_pd *pd); | |||
990 | struct ib_ah *ib_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr); | 1000 | struct ib_ah *ib_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr); |
991 | 1001 | ||
992 | /** | 1002 | /** |
1003 | * ib_create_ah_from_wc - Creates an address handle associated with the | ||
1004 | * sender of the specified work completion. | ||
1005 | * @pd: The protection domain associated with the address handle. | ||
1006 | * @wc: Work completion information associated with a received message. | ||
1007 | * @grh: References the received global route header. This parameter is | ||
1008 | * ignored unless the work completion indicates that the GRH is valid. | ||
1009 | * @port_num: The outbound port number to associate with the address. | ||
1010 | * | ||
1011 | * The address handle is used to reference a local or global destination | ||
1012 | * in all UD QP post sends. | ||
1013 | */ | ||
1014 | struct ib_ah *ib_create_ah_from_wc(struct ib_pd *pd, struct ib_wc *wc, | ||
1015 | struct ib_grh *grh, u8 port_num); | ||
1016 | |||
1017 | /** | ||
993 | * ib_modify_ah - Modifies the address vector associated with an address | 1018 | * ib_modify_ah - Modifies the address vector associated with an address |
994 | * handle. | 1019 | * handle. |
995 | * @ah: The address handle to modify. | 1020 | * @ah: The address handle to modify. |