diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/rdma/ib_cm.h | 10 | ||||
-rw-r--r-- | include/rdma/ib_mad.h | 66 | ||||
-rw-r--r-- | include/rdma/ib_user_cm.h | 10 | ||||
-rw-r--r-- | include/rdma/ib_user_verbs.h | 222 | ||||
-rw-r--r-- | include/rdma/ib_verbs.h | 6 |
5 files changed, 223 insertions, 91 deletions
diff --git a/include/rdma/ib_cm.h b/include/rdma/ib_cm.h index 5308683c8c41..0a9fcd59eb43 100644 --- a/include/rdma/ib_cm.h +++ b/include/rdma/ib_cm.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2004 Intel Corporation. All rights reserved. | 2 | * Copyright (c) 2004, 2005 Intel Corporation. All rights reserved. |
3 | * Copyright (c) 2004 Topspin Corporation. All rights reserved. | 3 | * Copyright (c) 2004 Topspin Corporation. All rights reserved. |
4 | * Copyright (c) 2004 Voltaire Corporation. All rights reserved. | 4 | * Copyright (c) 2004 Voltaire Corporation. All rights reserved. |
5 | * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. | 5 | * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. |
@@ -109,7 +109,6 @@ struct ib_cm_id; | |||
109 | 109 | ||
110 | struct ib_cm_req_event_param { | 110 | struct ib_cm_req_event_param { |
111 | struct ib_cm_id *listen_id; | 111 | struct ib_cm_id *listen_id; |
112 | struct ib_device *device; | ||
113 | u8 port; | 112 | u8 port; |
114 | 113 | ||
115 | struct ib_sa_path_rec *primary_path; | 114 | struct ib_sa_path_rec *primary_path; |
@@ -220,7 +219,6 @@ struct ib_cm_apr_event_param { | |||
220 | 219 | ||
221 | struct ib_cm_sidr_req_event_param { | 220 | struct ib_cm_sidr_req_event_param { |
222 | struct ib_cm_id *listen_id; | 221 | struct ib_cm_id *listen_id; |
223 | struct ib_device *device; | ||
224 | u8 port; | 222 | u8 port; |
225 | u16 pkey; | 223 | u16 pkey; |
226 | }; | 224 | }; |
@@ -284,6 +282,7 @@ typedef int (*ib_cm_handler)(struct ib_cm_id *cm_id, | |||
284 | struct ib_cm_id { | 282 | struct ib_cm_id { |
285 | ib_cm_handler cm_handler; | 283 | ib_cm_handler cm_handler; |
286 | void *context; | 284 | void *context; |
285 | struct ib_device *device; | ||
287 | __be64 service_id; | 286 | __be64 service_id; |
288 | __be64 service_mask; | 287 | __be64 service_mask; |
289 | enum ib_cm_state state; /* internal CM/debug use */ | 288 | enum ib_cm_state state; /* internal CM/debug use */ |
@@ -295,6 +294,8 @@ struct ib_cm_id { | |||
295 | 294 | ||
296 | /** | 295 | /** |
297 | * ib_create_cm_id - Allocate a communication identifier. | 296 | * ib_create_cm_id - Allocate a communication identifier. |
297 | * @device: Device associated with the cm_id. All related communication will | ||
298 | * be associated with the specified device. | ||
298 | * @cm_handler: Callback invoked to notify the user of CM events. | 299 | * @cm_handler: Callback invoked to notify the user of CM events. |
299 | * @context: User specified context associated with the communication | 300 | * @context: User specified context associated with the communication |
300 | * identifier. | 301 | * identifier. |
@@ -302,7 +303,8 @@ struct ib_cm_id { | |||
302 | * Communication identifiers are used to track connection states, service | 303 | * Communication identifiers are used to track connection states, service |
303 | * ID resolution requests, and listen requests. | 304 | * ID resolution requests, and listen requests. |
304 | */ | 305 | */ |
305 | struct ib_cm_id *ib_create_cm_id(ib_cm_handler cm_handler, | 306 | struct ib_cm_id *ib_create_cm_id(struct ib_device *device, |
307 | ib_cm_handler cm_handler, | ||
306 | void *context); | 308 | void *context); |
307 | 309 | ||
308 | /** | 310 | /** |
diff --git a/include/rdma/ib_mad.h b/include/rdma/ib_mad.h index 4172e6841e3d..2c133506742b 100644 --- a/include/rdma/ib_mad.h +++ b/include/rdma/ib_mad.h | |||
@@ -109,10 +109,14 @@ | |||
109 | #define IB_QP_SET_QKEY 0x80000000 | 109 | #define IB_QP_SET_QKEY 0x80000000 |
110 | 110 | ||
111 | enum { | 111 | enum { |
112 | IB_MGMT_MAD_HDR = 24, | ||
112 | IB_MGMT_MAD_DATA = 232, | 113 | IB_MGMT_MAD_DATA = 232, |
114 | IB_MGMT_RMPP_HDR = 36, | ||
113 | IB_MGMT_RMPP_DATA = 220, | 115 | IB_MGMT_RMPP_DATA = 220, |
116 | IB_MGMT_VENDOR_HDR = 40, | ||
114 | IB_MGMT_VENDOR_DATA = 216, | 117 | IB_MGMT_VENDOR_DATA = 216, |
115 | IB_MGMT_SA_DATA = 200 | 118 | IB_MGMT_SA_HDR = 56, |
119 | IB_MGMT_SA_DATA = 200, | ||
116 | }; | 120 | }; |
117 | 121 | ||
118 | struct ib_mad_hdr { | 122 | struct ib_mad_hdr { |
@@ -203,26 +207,25 @@ struct ib_class_port_info | |||
203 | 207 | ||
204 | /** | 208 | /** |
205 | * ib_mad_send_buf - MAD data buffer and work request for sends. | 209 | * ib_mad_send_buf - MAD data buffer and work request for sends. |
206 | * @mad: References an allocated MAD data buffer. The size of the data | 210 | * @next: A pointer used to chain together MADs for posting. |
207 | * buffer is specified in the @send_wr.length field. | 211 | * @mad: References an allocated MAD data buffer. |
208 | * @mapping: DMA mapping information. | ||
209 | * @mad_agent: MAD agent that allocated the buffer. | 212 | * @mad_agent: MAD agent that allocated the buffer. |
213 | * @ah: The address handle to use when sending the MAD. | ||
210 | * @context: User-controlled context fields. | 214 | * @context: User-controlled context fields. |
211 | * @send_wr: An initialized work request structure used when sending the MAD. | 215 | * @timeout_ms: Time to wait for a response. |
212 | * The wr_id field of the work request is initialized to reference this | 216 | * @retries: Number of times to retry a request for a response. |
213 | * data structure. | ||
214 | * @sge: A scatter-gather list referenced by the work request. | ||
215 | * | 217 | * |
216 | * Users are responsible for initializing the MAD buffer itself, with the | 218 | * Users are responsible for initializing the MAD buffer itself, with the |
217 | * exception of specifying the payload length field in any RMPP MAD. | 219 | * exception of specifying the payload length field in any RMPP MAD. |
218 | */ | 220 | */ |
219 | struct ib_mad_send_buf { | 221 | struct ib_mad_send_buf { |
220 | struct ib_mad *mad; | 222 | struct ib_mad_send_buf *next; |
221 | DECLARE_PCI_UNMAP_ADDR(mapping) | 223 | void *mad; |
222 | struct ib_mad_agent *mad_agent; | 224 | struct ib_mad_agent *mad_agent; |
225 | struct ib_ah *ah; | ||
223 | void *context[2]; | 226 | void *context[2]; |
224 | struct ib_send_wr send_wr; | 227 | int timeout_ms; |
225 | struct ib_sge sge; | 228 | int retries; |
226 | }; | 229 | }; |
227 | 230 | ||
228 | /** | 231 | /** |
@@ -287,7 +290,7 @@ typedef void (*ib_mad_send_handler)(struct ib_mad_agent *mad_agent, | |||
287 | * or @mad_send_wc. | 290 | * or @mad_send_wc. |
288 | */ | 291 | */ |
289 | typedef void (*ib_mad_snoop_handler)(struct ib_mad_agent *mad_agent, | 292 | typedef void (*ib_mad_snoop_handler)(struct ib_mad_agent *mad_agent, |
290 | struct ib_send_wr *send_wr, | 293 | struct ib_mad_send_buf *send_buf, |
291 | struct ib_mad_send_wc *mad_send_wc); | 294 | struct ib_mad_send_wc *mad_send_wc); |
292 | 295 | ||
293 | /** | 296 | /** |
@@ -334,13 +337,13 @@ struct ib_mad_agent { | |||
334 | 337 | ||
335 | /** | 338 | /** |
336 | * ib_mad_send_wc - MAD send completion information. | 339 | * ib_mad_send_wc - MAD send completion information. |
337 | * @wr_id: Work request identifier associated with the send MAD request. | 340 | * @send_buf: Send MAD data buffer associated with the send MAD request. |
338 | * @status: Completion status. | 341 | * @status: Completion status. |
339 | * @vendor_err: Optional vendor error information returned with a failed | 342 | * @vendor_err: Optional vendor error information returned with a failed |
340 | * request. | 343 | * request. |
341 | */ | 344 | */ |
342 | struct ib_mad_send_wc { | 345 | struct ib_mad_send_wc { |
343 | u64 wr_id; | 346 | struct ib_mad_send_buf *send_buf; |
344 | enum ib_wc_status status; | 347 | enum ib_wc_status status; |
345 | u32 vendor_err; | 348 | u32 vendor_err; |
346 | }; | 349 | }; |
@@ -366,7 +369,7 @@ struct ib_mad_recv_buf { | |||
366 | * @rmpp_list: Specifies a list of RMPP reassembled received MAD buffers. | 369 | * @rmpp_list: Specifies a list of RMPP reassembled received MAD buffers. |
367 | * @mad_len: The length of the received MAD, without duplicated headers. | 370 | * @mad_len: The length of the received MAD, without duplicated headers. |
368 | * | 371 | * |
369 | * For received response, the wr_id field of the wc is set to the wr_id | 372 | * For received response, the wr_id contains a pointer to the ib_mad_send_buf |
370 | * for the corresponding send request. | 373 | * for the corresponding send request. |
371 | */ | 374 | */ |
372 | struct ib_mad_recv_wc { | 375 | struct ib_mad_recv_wc { |
@@ -463,9 +466,9 @@ int ib_unregister_mad_agent(struct ib_mad_agent *mad_agent); | |||
463 | /** | 466 | /** |
464 | * ib_post_send_mad - Posts MAD(s) to the send queue of the QP associated | 467 | * ib_post_send_mad - Posts MAD(s) to the send queue of the QP associated |
465 | * with the registered client. | 468 | * with the registered client. |
466 | * @mad_agent: Specifies the associated registration to post the send to. | 469 | * @send_buf: Specifies the information needed to send the MAD(s). |
467 | * @send_wr: Specifies the information needed to send the MAD(s). | 470 | * @bad_send_buf: Specifies the MAD on which an error was encountered. This |
468 | * @bad_send_wr: Specifies the MAD on which an error was encountered. | 471 | * parameter is optional if only a single MAD is posted. |
469 | * | 472 | * |
470 | * Sent MADs are not guaranteed to complete in the order that they were posted. | 473 | * Sent MADs are not guaranteed to complete in the order that they were posted. |
471 | * | 474 | * |
@@ -479,9 +482,8 @@ int ib_unregister_mad_agent(struct ib_mad_agent *mad_agent); | |||
479 | * defined data being transferred. The paylen_newwin field should be | 482 | * defined data being transferred. The paylen_newwin field should be |
480 | * specified in network-byte order. | 483 | * specified in network-byte order. |
481 | */ | 484 | */ |
482 | int ib_post_send_mad(struct ib_mad_agent *mad_agent, | 485 | int ib_post_send_mad(struct ib_mad_send_buf *send_buf, |
483 | struct ib_send_wr *send_wr, | 486 | struct ib_mad_send_buf **bad_send_buf); |
484 | struct ib_send_wr **bad_send_wr); | ||
485 | 487 | ||
486 | /** | 488 | /** |
487 | * ib_coalesce_recv_mad - Coalesces received MAD data into a single buffer. | 489 | * ib_coalesce_recv_mad - Coalesces received MAD data into a single buffer. |
@@ -507,23 +509,25 @@ void ib_free_recv_mad(struct ib_mad_recv_wc *mad_recv_wc); | |||
507 | /** | 509 | /** |
508 | * ib_cancel_mad - Cancels an outstanding send MAD operation. | 510 | * ib_cancel_mad - Cancels an outstanding send MAD operation. |
509 | * @mad_agent: Specifies the registration associated with sent MAD. | 511 | * @mad_agent: Specifies the registration associated with sent MAD. |
510 | * @wr_id: Indicates the work request identifier of the MAD to cancel. | 512 | * @send_buf: Indicates the MAD to cancel. |
511 | * | 513 | * |
512 | * MADs will be returned to the user through the corresponding | 514 | * MADs will be returned to the user through the corresponding |
513 | * ib_mad_send_handler. | 515 | * ib_mad_send_handler. |
514 | */ | 516 | */ |
515 | void ib_cancel_mad(struct ib_mad_agent *mad_agent, u64 wr_id); | 517 | void ib_cancel_mad(struct ib_mad_agent *mad_agent, |
518 | struct ib_mad_send_buf *send_buf); | ||
516 | 519 | ||
517 | /** | 520 | /** |
518 | * ib_modify_mad - Modifies an outstanding send MAD operation. | 521 | * ib_modify_mad - Modifies an outstanding send MAD operation. |
519 | * @mad_agent: Specifies the registration associated with sent MAD. | 522 | * @mad_agent: Specifies the registration associated with sent MAD. |
520 | * @wr_id: Indicates the work request identifier of the MAD to modify. | 523 | * @send_buf: Indicates the MAD to modify. |
521 | * @timeout_ms: New timeout value for sent MAD. | 524 | * @timeout_ms: New timeout value for sent MAD. |
522 | * | 525 | * |
523 | * This call will reset the timeout value for a sent MAD to the specified | 526 | * This call will reset the timeout value for a sent MAD to the specified |
524 | * value. | 527 | * value. |
525 | */ | 528 | */ |
526 | int ib_modify_mad(struct ib_mad_agent *mad_agent, u64 wr_id, u32 timeout_ms); | 529 | int ib_modify_mad(struct ib_mad_agent *mad_agent, |
530 | struct ib_mad_send_buf *send_buf, u32 timeout_ms); | ||
527 | 531 | ||
528 | /** | 532 | /** |
529 | * ib_redirect_mad_qp - Registers a QP for MAD services. | 533 | * ib_redirect_mad_qp - Registers a QP for MAD services. |
@@ -572,7 +576,6 @@ int ib_process_mad_wc(struct ib_mad_agent *mad_agent, | |||
572 | * @remote_qpn: Specifies the QPN of the receiving node. | 576 | * @remote_qpn: Specifies the QPN of the receiving node. |
573 | * @pkey_index: Specifies which PKey the MAD will be sent using. This field | 577 | * @pkey_index: Specifies which PKey the MAD will be sent using. This field |
574 | * is valid only if the remote_qpn is QP 1. | 578 | * is valid only if the remote_qpn is QP 1. |
575 | * @ah: References the address handle used to transfer to the remote node. | ||
576 | * @rmpp_active: Indicates if the send will enable RMPP. | 579 | * @rmpp_active: Indicates if the send will enable RMPP. |
577 | * @hdr_len: Indicates the size of the data header of the MAD. This length | 580 | * @hdr_len: Indicates the size of the data header of the MAD. This length |
578 | * should include the common MAD header, RMPP header, plus any class | 581 | * should include the common MAD header, RMPP header, plus any class |
@@ -582,11 +585,10 @@ int ib_process_mad_wc(struct ib_mad_agent *mad_agent, | |||
582 | * additional padding that may be necessary. | 585 | * additional padding that may be necessary. |
583 | * @gfp_mask: GFP mask used for the memory allocation. | 586 | * @gfp_mask: GFP mask used for the memory allocation. |
584 | * | 587 | * |
585 | * This is a helper routine that may be used to allocate a MAD. Users are | 588 | * This routine allocates a MAD for sending. The returned MAD send buffer |
586 | * not required to allocate outbound MADs using this call. The returned | 589 | * will reference a data buffer usable for sending a MAD, along |
587 | * MAD send buffer will reference a data buffer usable for sending a MAD, along | ||
588 | * with an initialized work request structure. Users may modify the returned | 590 | * with an initialized work request structure. Users may modify the returned |
589 | * MAD data buffer or work request before posting the send. | 591 | * MAD data buffer before posting the send. |
590 | * | 592 | * |
591 | * The returned data buffer will be cleared. Users are responsible for | 593 | * The returned data buffer will be cleared. Users are responsible for |
592 | * initializing the common MAD and any class specific headers. If @rmpp_active | 594 | * initializing the common MAD and any class specific headers. If @rmpp_active |
@@ -594,7 +596,7 @@ int ib_process_mad_wc(struct ib_mad_agent *mad_agent, | |||
594 | */ | 596 | */ |
595 | struct ib_mad_send_buf * ib_create_send_mad(struct ib_mad_agent *mad_agent, | 597 | struct ib_mad_send_buf * ib_create_send_mad(struct ib_mad_agent *mad_agent, |
596 | u32 remote_qpn, u16 pkey_index, | 598 | u32 remote_qpn, u16 pkey_index, |
597 | struct ib_ah *ah, int rmpp_active, | 599 | int rmpp_active, |
598 | int hdr_len, int data_len, | 600 | int hdr_len, int data_len, |
599 | gfp_t gfp_mask); | 601 | gfp_t gfp_mask); |
600 | 602 | ||
diff --git a/include/rdma/ib_user_cm.h b/include/rdma/ib_user_cm.h index e4d1654276ad..3037588b8464 100644 --- a/include/rdma/ib_user_cm.h +++ b/include/rdma/ib_user_cm.h | |||
@@ -38,7 +38,7 @@ | |||
38 | 38 | ||
39 | #include <linux/types.h> | 39 | #include <linux/types.h> |
40 | 40 | ||
41 | #define IB_USER_CM_ABI_VERSION 2 | 41 | #define IB_USER_CM_ABI_VERSION 3 |
42 | 42 | ||
43 | enum { | 43 | enum { |
44 | IB_USER_CM_CMD_CREATE_ID, | 44 | IB_USER_CM_CMD_CREATE_ID, |
@@ -299,8 +299,6 @@ struct ib_ucm_event_get { | |||
299 | }; | 299 | }; |
300 | 300 | ||
301 | struct ib_ucm_req_event_resp { | 301 | struct ib_ucm_req_event_resp { |
302 | /* device */ | ||
303 | /* port */ | ||
304 | struct ib_ucm_path_rec primary_path; | 302 | struct ib_ucm_path_rec primary_path; |
305 | struct ib_ucm_path_rec alternate_path; | 303 | struct ib_ucm_path_rec alternate_path; |
306 | __be64 remote_ca_guid; | 304 | __be64 remote_ca_guid; |
@@ -316,6 +314,7 @@ struct ib_ucm_req_event_resp { | |||
316 | __u8 retry_count; | 314 | __u8 retry_count; |
317 | __u8 rnr_retry_count; | 315 | __u8 rnr_retry_count; |
318 | __u8 srq; | 316 | __u8 srq; |
317 | __u8 port; | ||
319 | }; | 318 | }; |
320 | 319 | ||
321 | struct ib_ucm_rep_event_resp { | 320 | struct ib_ucm_rep_event_resp { |
@@ -353,10 +352,9 @@ struct ib_ucm_apr_event_resp { | |||
353 | }; | 352 | }; |
354 | 353 | ||
355 | struct ib_ucm_sidr_req_event_resp { | 354 | struct ib_ucm_sidr_req_event_resp { |
356 | /* device */ | ||
357 | /* port */ | ||
358 | __u16 pkey; | 355 | __u16 pkey; |
359 | __u8 reserved[2]; | 356 | __u8 port; |
357 | __u8 reserved; | ||
360 | }; | 358 | }; |
361 | 359 | ||
362 | struct ib_ucm_sidr_rep_event_resp { | 360 | struct ib_ucm_sidr_rep_event_resp { |
diff --git a/include/rdma/ib_user_verbs.h b/include/rdma/ib_user_verbs.h index fd85725391a4..072f3a2edace 100644 --- a/include/rdma/ib_user_verbs.h +++ b/include/rdma/ib_user_verbs.h | |||
@@ -1,6 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2005 Topspin Communications. All rights reserved. | 2 | * Copyright (c) 2005 Topspin Communications. All rights reserved. |
3 | * Copyright (c) 2005 Cisco Systems. All rights reserved. | 3 | * Copyright (c) 2005 Cisco Systems. All rights reserved. |
4 | * Copyright (c) 2005 PathScale, Inc. All rights reserved. | ||
4 | * | 5 | * |
5 | * This software is available to you under a choice of one of two | 6 | * 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 | * licenses. You may choose to be licensed under the terms of the GNU |
@@ -42,15 +43,12 @@ | |||
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_VERBS_ABI_VERSION 2 | 46 | #define IB_USER_VERBS_ABI_VERSION 3 |
46 | 47 | ||
47 | enum { | 48 | enum { |
48 | IB_USER_VERBS_CMD_QUERY_PARAMS, | ||
49 | IB_USER_VERBS_CMD_GET_CONTEXT, | 49 | IB_USER_VERBS_CMD_GET_CONTEXT, |
50 | IB_USER_VERBS_CMD_QUERY_DEVICE, | 50 | IB_USER_VERBS_CMD_QUERY_DEVICE, |
51 | IB_USER_VERBS_CMD_QUERY_PORT, | 51 | IB_USER_VERBS_CMD_QUERY_PORT, |
52 | IB_USER_VERBS_CMD_QUERY_GID, | ||
53 | IB_USER_VERBS_CMD_QUERY_PKEY, | ||
54 | IB_USER_VERBS_CMD_ALLOC_PD, | 52 | IB_USER_VERBS_CMD_ALLOC_PD, |
55 | IB_USER_VERBS_CMD_DEALLOC_PD, | 53 | IB_USER_VERBS_CMD_DEALLOC_PD, |
56 | IB_USER_VERBS_CMD_CREATE_AH, | 54 | IB_USER_VERBS_CMD_CREATE_AH, |
@@ -65,6 +63,7 @@ enum { | |||
65 | IB_USER_VERBS_CMD_ALLOC_MW, | 63 | IB_USER_VERBS_CMD_ALLOC_MW, |
66 | IB_USER_VERBS_CMD_BIND_MW, | 64 | IB_USER_VERBS_CMD_BIND_MW, |
67 | IB_USER_VERBS_CMD_DEALLOC_MW, | 65 | IB_USER_VERBS_CMD_DEALLOC_MW, |
66 | IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL, | ||
68 | IB_USER_VERBS_CMD_CREATE_CQ, | 67 | IB_USER_VERBS_CMD_CREATE_CQ, |
69 | IB_USER_VERBS_CMD_RESIZE_CQ, | 68 | IB_USER_VERBS_CMD_RESIZE_CQ, |
70 | IB_USER_VERBS_CMD_DESTROY_CQ, | 69 | IB_USER_VERBS_CMD_DESTROY_CQ, |
@@ -90,8 +89,11 @@ enum { | |||
90 | * Make sure that all structs defined in this file remain laid out so | 89 | * Make sure that all structs defined in this file remain laid out so |
91 | * that they pack the same way on 32-bit and 64-bit architectures (to | 90 | * that they pack the same way on 32-bit and 64-bit architectures (to |
92 | * avoid incompatibility between 32-bit userspace and 64-bit kernels). | 91 | * avoid incompatibility between 32-bit userspace and 64-bit kernels). |
93 | * In particular do not use pointer types -- pass pointers in __u64 | 92 | * Specifically: |
94 | * instead. | 93 | * - Do not use pointer types -- pass pointers in __u64 instead. |
94 | * - Make sure that any structure larger than 4 bytes is padded to a | ||
95 | * multiple of 8 bytes. Otherwise the structure size will be | ||
96 | * different between 32-bit and 64-bit architectures. | ||
95 | */ | 97 | */ |
96 | 98 | ||
97 | struct ib_uverbs_async_event_desc { | 99 | struct ib_uverbs_async_event_desc { |
@@ -118,27 +120,14 @@ struct ib_uverbs_cmd_hdr { | |||
118 | __u16 out_words; | 120 | __u16 out_words; |
119 | }; | 121 | }; |
120 | 122 | ||
121 | /* | ||
122 | * No driver_data for "query params" command, since this is intended | ||
123 | * to be a core function with no possible device dependence. | ||
124 | */ | ||
125 | struct ib_uverbs_query_params { | ||
126 | __u64 response; | ||
127 | }; | ||
128 | |||
129 | struct ib_uverbs_query_params_resp { | ||
130 | __u32 num_cq_events; | ||
131 | }; | ||
132 | |||
133 | struct ib_uverbs_get_context { | 123 | struct ib_uverbs_get_context { |
134 | __u64 response; | 124 | __u64 response; |
135 | __u64 cq_fd_tab; | ||
136 | __u64 driver_data[0]; | 125 | __u64 driver_data[0]; |
137 | }; | 126 | }; |
138 | 127 | ||
139 | struct ib_uverbs_get_context_resp { | 128 | struct ib_uverbs_get_context_resp { |
140 | __u32 async_fd; | 129 | __u32 async_fd; |
141 | __u32 reserved; | 130 | __u32 num_comp_vectors; |
142 | }; | 131 | }; |
143 | 132 | ||
144 | struct ib_uverbs_query_device { | 133 | struct ib_uverbs_query_device { |
@@ -220,31 +209,6 @@ struct ib_uverbs_query_port_resp { | |||
220 | __u8 reserved[3]; | 209 | __u8 reserved[3]; |
221 | }; | 210 | }; |
222 | 211 | ||
223 | struct ib_uverbs_query_gid { | ||
224 | __u64 response; | ||
225 | __u8 port_num; | ||
226 | __u8 index; | ||
227 | __u8 reserved[6]; | ||
228 | __u64 driver_data[0]; | ||
229 | }; | ||
230 | |||
231 | struct ib_uverbs_query_gid_resp { | ||
232 | __u8 gid[16]; | ||
233 | }; | ||
234 | |||
235 | struct ib_uverbs_query_pkey { | ||
236 | __u64 response; | ||
237 | __u8 port_num; | ||
238 | __u8 index; | ||
239 | __u8 reserved[6]; | ||
240 | __u64 driver_data[0]; | ||
241 | }; | ||
242 | |||
243 | struct ib_uverbs_query_pkey_resp { | ||
244 | __u16 pkey; | ||
245 | __u16 reserved; | ||
246 | }; | ||
247 | |||
248 | struct ib_uverbs_alloc_pd { | 212 | struct ib_uverbs_alloc_pd { |
249 | __u64 response; | 213 | __u64 response; |
250 | __u64 driver_data[0]; | 214 | __u64 driver_data[0]; |
@@ -278,11 +242,21 @@ struct ib_uverbs_dereg_mr { | |||
278 | __u32 mr_handle; | 242 | __u32 mr_handle; |
279 | }; | 243 | }; |
280 | 244 | ||
245 | struct ib_uverbs_create_comp_channel { | ||
246 | __u64 response; | ||
247 | }; | ||
248 | |||
249 | struct ib_uverbs_create_comp_channel_resp { | ||
250 | __u32 fd; | ||
251 | }; | ||
252 | |||
281 | struct ib_uverbs_create_cq { | 253 | struct ib_uverbs_create_cq { |
282 | __u64 response; | 254 | __u64 response; |
283 | __u64 user_handle; | 255 | __u64 user_handle; |
284 | __u32 cqe; | 256 | __u32 cqe; |
285 | __u32 event_handler; | 257 | __u32 comp_vector; |
258 | __s32 comp_channel; | ||
259 | __u32 reserved; | ||
286 | __u64 driver_data[0]; | 260 | __u64 driver_data[0]; |
287 | }; | 261 | }; |
288 | 262 | ||
@@ -291,6 +265,41 @@ struct ib_uverbs_create_cq_resp { | |||
291 | __u32 cqe; | 265 | __u32 cqe; |
292 | }; | 266 | }; |
293 | 267 | ||
268 | struct ib_uverbs_poll_cq { | ||
269 | __u64 response; | ||
270 | __u32 cq_handle; | ||
271 | __u32 ne; | ||
272 | }; | ||
273 | |||
274 | struct ib_uverbs_wc { | ||
275 | __u64 wr_id; | ||
276 | __u32 status; | ||
277 | __u32 opcode; | ||
278 | __u32 vendor_err; | ||
279 | __u32 byte_len; | ||
280 | __u32 imm_data; | ||
281 | __u32 qp_num; | ||
282 | __u32 src_qp; | ||
283 | __u32 wc_flags; | ||
284 | __u16 pkey_index; | ||
285 | __u16 slid; | ||
286 | __u8 sl; | ||
287 | __u8 dlid_path_bits; | ||
288 | __u8 port_num; | ||
289 | __u8 reserved; | ||
290 | }; | ||
291 | |||
292 | struct ib_uverbs_poll_cq_resp { | ||
293 | __u32 count; | ||
294 | __u32 reserved; | ||
295 | struct ib_uverbs_wc wc[0]; | ||
296 | }; | ||
297 | |||
298 | struct ib_uverbs_req_notify_cq { | ||
299 | __u32 cq_handle; | ||
300 | __u32 solicited_only; | ||
301 | }; | ||
302 | |||
294 | struct ib_uverbs_destroy_cq { | 303 | struct ib_uverbs_destroy_cq { |
295 | __u64 response; | 304 | __u64 response; |
296 | __u32 cq_handle; | 305 | __u32 cq_handle; |
@@ -388,6 +397,127 @@ struct ib_uverbs_destroy_qp_resp { | |||
388 | __u32 events_reported; | 397 | __u32 events_reported; |
389 | }; | 398 | }; |
390 | 399 | ||
400 | /* | ||
401 | * The ib_uverbs_sge structure isn't used anywhere, since we assume | ||
402 | * the ib_sge structure is packed the same way on 32-bit and 64-bit | ||
403 | * architectures in both kernel and user space. It's just here to | ||
404 | * document the ABI. | ||
405 | */ | ||
406 | struct ib_uverbs_sge { | ||
407 | __u64 addr; | ||
408 | __u32 length; | ||
409 | __u32 lkey; | ||
410 | }; | ||
411 | |||
412 | struct ib_uverbs_send_wr { | ||
413 | __u64 wr_id; | ||
414 | __u32 num_sge; | ||
415 | __u32 opcode; | ||
416 | __u32 send_flags; | ||
417 | __u32 imm_data; | ||
418 | union { | ||
419 | struct { | ||
420 | __u64 remote_addr; | ||
421 | __u32 rkey; | ||
422 | __u32 reserved; | ||
423 | } rdma; | ||
424 | struct { | ||
425 | __u64 remote_addr; | ||
426 | __u64 compare_add; | ||
427 | __u64 swap; | ||
428 | __u32 rkey; | ||
429 | __u32 reserved; | ||
430 | } atomic; | ||
431 | struct { | ||
432 | __u32 ah; | ||
433 | __u32 remote_qpn; | ||
434 | __u32 remote_qkey; | ||
435 | __u32 reserved; | ||
436 | } ud; | ||
437 | } wr; | ||
438 | }; | ||
439 | |||
440 | struct ib_uverbs_post_send { | ||
441 | __u64 response; | ||
442 | __u32 qp_handle; | ||
443 | __u32 wr_count; | ||
444 | __u32 sge_count; | ||
445 | __u32 wqe_size; | ||
446 | struct ib_uverbs_send_wr send_wr[0]; | ||
447 | }; | ||
448 | |||
449 | struct ib_uverbs_post_send_resp { | ||
450 | __u32 bad_wr; | ||
451 | }; | ||
452 | |||
453 | struct ib_uverbs_recv_wr { | ||
454 | __u64 wr_id; | ||
455 | __u32 num_sge; | ||
456 | __u32 reserved; | ||
457 | }; | ||
458 | |||
459 | struct ib_uverbs_post_recv { | ||
460 | __u64 response; | ||
461 | __u32 qp_handle; | ||
462 | __u32 wr_count; | ||
463 | __u32 sge_count; | ||
464 | __u32 wqe_size; | ||
465 | struct ib_uverbs_recv_wr recv_wr[0]; | ||
466 | }; | ||
467 | |||
468 | struct ib_uverbs_post_recv_resp { | ||
469 | __u32 bad_wr; | ||
470 | }; | ||
471 | |||
472 | struct ib_uverbs_post_srq_recv { | ||
473 | __u64 response; | ||
474 | __u32 srq_handle; | ||
475 | __u32 wr_count; | ||
476 | __u32 sge_count; | ||
477 | __u32 wqe_size; | ||
478 | struct ib_uverbs_recv_wr recv[0]; | ||
479 | }; | ||
480 | |||
481 | struct ib_uverbs_post_srq_recv_resp { | ||
482 | __u32 bad_wr; | ||
483 | }; | ||
484 | |||
485 | struct ib_uverbs_global_route { | ||
486 | __u8 dgid[16]; | ||
487 | __u32 flow_label; | ||
488 | __u8 sgid_index; | ||
489 | __u8 hop_limit; | ||
490 | __u8 traffic_class; | ||
491 | __u8 reserved; | ||
492 | }; | ||
493 | |||
494 | struct ib_uverbs_ah_attr { | ||
495 | struct ib_uverbs_global_route grh; | ||
496 | __u16 dlid; | ||
497 | __u8 sl; | ||
498 | __u8 src_path_bits; | ||
499 | __u8 static_rate; | ||
500 | __u8 is_global; | ||
501 | __u8 port_num; | ||
502 | __u8 reserved; | ||
503 | }; | ||
504 | |||
505 | struct ib_uverbs_create_ah { | ||
506 | __u64 response; | ||
507 | __u64 user_handle; | ||
508 | __u32 pd_handle; | ||
509 | __u32 reserved; | ||
510 | struct ib_uverbs_ah_attr attr; | ||
511 | }; | ||
512 | |||
513 | struct ib_uverbs_create_ah_resp { | ||
514 | __u32 ah_handle; | ||
515 | }; | ||
516 | |||
517 | struct ib_uverbs_destroy_ah { | ||
518 | __u32 ah_handle; | ||
519 | }; | ||
520 | |||
391 | struct ib_uverbs_attach_mcast { | 521 | struct ib_uverbs_attach_mcast { |
392 | __u8 gid[16]; | 522 | __u8 gid[16]; |
393 | __u32 qp_handle; | 523 | __u32 qp_handle; |
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index e6f4c9e55df7..f72d46d54e0a 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
@@ -595,11 +595,8 @@ struct ib_send_wr { | |||
595 | } atomic; | 595 | } atomic; |
596 | struct { | 596 | struct { |
597 | struct ib_ah *ah; | 597 | struct ib_ah *ah; |
598 | struct ib_mad_hdr *mad_hdr; | ||
599 | u32 remote_qpn; | 598 | u32 remote_qpn; |
600 | u32 remote_qkey; | 599 | u32 remote_qkey; |
601 | int timeout_ms; /* valid for MADs only */ | ||
602 | int retries; /* valid for MADs only */ | ||
603 | u16 pkey_index; /* valid for GSI only */ | 600 | u16 pkey_index; /* valid for GSI only */ |
604 | u8 port_num; /* valid for DR SMPs on switch only */ | 601 | u8 port_num; /* valid for DR SMPs on switch only */ |
605 | } ud; | 602 | } ud; |
@@ -951,6 +948,9 @@ struct ib_device { | |||
951 | IB_DEV_UNREGISTERED | 948 | IB_DEV_UNREGISTERED |
952 | } reg_state; | 949 | } reg_state; |
953 | 950 | ||
951 | u64 uverbs_cmd_mask; | ||
952 | int uverbs_abi_ver; | ||
953 | |||
954 | u8 node_type; | 954 | u8 node_type; |
955 | u8 phys_port_cnt; | 955 | u8 phys_port_cnt; |
956 | }; | 956 | }; |