Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2005 Topspin Communications. All rights reserved. |
Sean Hefty | 0b2b35f | 2005-09-01 09:28:03 -0700 | [diff] [blame] | 3 | * Copyright (c) 2005 Intel Corporation. All rights reserved. |
Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 4 | * |
| 5 | * This software is available to you under a choice of one of two |
| 6 | * licenses. You may choose to be licensed under the terms of the GNU |
| 7 | * General Public License (GPL) Version 2, available from the file |
| 8 | * COPYING in the main directory of this source tree, or the |
| 9 | * OpenIB.org BSD license below: |
| 10 | * |
| 11 | * Redistribution and use in source and binary forms, with or |
| 12 | * without modification, are permitted provided that the following |
| 13 | * conditions are met: |
| 14 | * |
| 15 | * - Redistributions of source code must retain the above |
| 16 | * copyright notice, this list of conditions and the following |
| 17 | * disclaimer. |
| 18 | * |
| 19 | * - Redistributions in binary form must reproduce the above |
| 20 | * copyright notice, this list of conditions and the following |
| 21 | * disclaimer in the documentation and/or other materials |
| 22 | * provided with the distribution. |
| 23 | * |
| 24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 25 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 26 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 27 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 28 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 29 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 30 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 31 | * SOFTWARE. |
| 32 | * |
| 33 | * $Id: ib_user_cm.h 2576 2005-06-09 17:00:30Z libor $ |
| 34 | */ |
| 35 | |
| 36 | #ifndef IB_USER_CM_H |
| 37 | #define IB_USER_CM_H |
| 38 | |
| 39 | #include <linux/types.h> |
| 40 | |
Sean Hefty | 07d357d | 2005-10-17 15:37:43 -0700 | [diff] [blame^] | 41 | #define IB_USER_CM_ABI_VERSION 3 |
Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 42 | |
| 43 | enum { |
| 44 | IB_USER_CM_CMD_CREATE_ID, |
| 45 | IB_USER_CM_CMD_DESTROY_ID, |
| 46 | IB_USER_CM_CMD_ATTR_ID, |
| 47 | |
| 48 | IB_USER_CM_CMD_LISTEN, |
| 49 | IB_USER_CM_CMD_ESTABLISH, |
| 50 | |
| 51 | IB_USER_CM_CMD_SEND_REQ, |
| 52 | IB_USER_CM_CMD_SEND_REP, |
| 53 | IB_USER_CM_CMD_SEND_RTU, |
| 54 | IB_USER_CM_CMD_SEND_DREQ, |
| 55 | IB_USER_CM_CMD_SEND_DREP, |
| 56 | IB_USER_CM_CMD_SEND_REJ, |
| 57 | IB_USER_CM_CMD_SEND_MRA, |
| 58 | IB_USER_CM_CMD_SEND_LAP, |
| 59 | IB_USER_CM_CMD_SEND_APR, |
| 60 | IB_USER_CM_CMD_SEND_SIDR_REQ, |
| 61 | IB_USER_CM_CMD_SEND_SIDR_REP, |
| 62 | |
| 63 | IB_USER_CM_CMD_EVENT, |
Sean Hefty | 0b2b35f | 2005-09-01 09:28:03 -0700 | [diff] [blame] | 64 | IB_USER_CM_CMD_INIT_QP_ATTR, |
Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 65 | }; |
| 66 | /* |
| 67 | * command ABI structures. |
| 68 | */ |
| 69 | struct ib_ucm_cmd_hdr { |
| 70 | __u32 cmd; |
| 71 | __u16 in; |
| 72 | __u16 out; |
| 73 | }; |
| 74 | |
| 75 | struct ib_ucm_create_id { |
Sean Hefty | 0b2b35f | 2005-09-01 09:28:03 -0700 | [diff] [blame] | 76 | __u64 uid; |
Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 77 | __u64 response; |
| 78 | }; |
| 79 | |
| 80 | struct ib_ucm_create_id_resp { |
| 81 | __u32 id; |
| 82 | }; |
| 83 | |
| 84 | struct ib_ucm_destroy_id { |
Sean Hefty | 0b2b35f | 2005-09-01 09:28:03 -0700 | [diff] [blame] | 85 | __u64 response; |
Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 86 | __u32 id; |
| 87 | }; |
| 88 | |
Sean Hefty | 0b2b35f | 2005-09-01 09:28:03 -0700 | [diff] [blame] | 89 | struct ib_ucm_destroy_id_resp { |
| 90 | __u32 events_reported; |
| 91 | }; |
| 92 | |
Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 93 | struct ib_ucm_attr_id { |
| 94 | __u64 response; |
| 95 | __u32 id; |
| 96 | }; |
| 97 | |
| 98 | struct ib_ucm_attr_id_resp { |
Sean Hefty | 97f52eb | 2005-08-13 21:05:57 -0700 | [diff] [blame] | 99 | __be64 service_id; |
| 100 | __be64 service_mask; |
| 101 | __be32 local_id; |
| 102 | __be32 remote_id; |
Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 103 | }; |
| 104 | |
Sean Hefty | 0b2b35f | 2005-09-01 09:28:03 -0700 | [diff] [blame] | 105 | struct ib_ucm_init_qp_attr { |
| 106 | __u64 response; |
| 107 | __u32 id; |
| 108 | __u32 qp_state; |
| 109 | }; |
| 110 | |
| 111 | struct ib_ucm_ah_attr { |
| 112 | __u8 grh_dgid[16]; |
| 113 | __u32 grh_flow_label; |
| 114 | __u16 dlid; |
| 115 | __u16 reserved; |
| 116 | __u8 grh_sgid_index; |
| 117 | __u8 grh_hop_limit; |
| 118 | __u8 grh_traffic_class; |
| 119 | __u8 sl; |
| 120 | __u8 src_path_bits; |
| 121 | __u8 static_rate; |
| 122 | __u8 is_global; |
| 123 | __u8 port_num; |
| 124 | }; |
| 125 | |
| 126 | struct ib_ucm_init_qp_attr_resp { |
| 127 | __u32 qp_attr_mask; |
| 128 | __u32 qp_state; |
| 129 | __u32 cur_qp_state; |
| 130 | __u32 path_mtu; |
| 131 | __u32 path_mig_state; |
| 132 | __u32 qkey; |
| 133 | __u32 rq_psn; |
| 134 | __u32 sq_psn; |
| 135 | __u32 dest_qp_num; |
| 136 | __u32 qp_access_flags; |
| 137 | |
| 138 | struct ib_ucm_ah_attr ah_attr; |
| 139 | struct ib_ucm_ah_attr alt_ah_attr; |
| 140 | |
| 141 | /* ib_qp_cap */ |
| 142 | __u32 max_send_wr; |
| 143 | __u32 max_recv_wr; |
| 144 | __u32 max_send_sge; |
| 145 | __u32 max_recv_sge; |
| 146 | __u32 max_inline_data; |
| 147 | |
| 148 | __u16 pkey_index; |
| 149 | __u16 alt_pkey_index; |
| 150 | __u8 en_sqd_async_notify; |
| 151 | __u8 sq_draining; |
| 152 | __u8 max_rd_atomic; |
| 153 | __u8 max_dest_rd_atomic; |
| 154 | __u8 min_rnr_timer; |
| 155 | __u8 port_num; |
| 156 | __u8 timeout; |
| 157 | __u8 retry_cnt; |
| 158 | __u8 rnr_retry; |
| 159 | __u8 alt_port_num; |
| 160 | __u8 alt_timeout; |
| 161 | }; |
| 162 | |
Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 163 | struct ib_ucm_listen { |
Sean Hefty | 97f52eb | 2005-08-13 21:05:57 -0700 | [diff] [blame] | 164 | __be64 service_id; |
| 165 | __be64 service_mask; |
Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 166 | __u32 id; |
| 167 | }; |
| 168 | |
| 169 | struct ib_ucm_establish { |
| 170 | __u32 id; |
| 171 | }; |
| 172 | |
| 173 | struct ib_ucm_private_data { |
| 174 | __u64 data; |
| 175 | __u32 id; |
| 176 | __u8 len; |
| 177 | __u8 reserved[3]; |
| 178 | }; |
| 179 | |
| 180 | struct ib_ucm_path_rec { |
| 181 | __u8 dgid[16]; |
| 182 | __u8 sgid[16]; |
Sean Hefty | 97f52eb | 2005-08-13 21:05:57 -0700 | [diff] [blame] | 183 | __be16 dlid; |
| 184 | __be16 slid; |
Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 185 | __u32 raw_traffic; |
Sean Hefty | 97f52eb | 2005-08-13 21:05:57 -0700 | [diff] [blame] | 186 | __be32 flow_label; |
Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 187 | __u32 reversible; |
| 188 | __u32 mtu; |
Sean Hefty | 97f52eb | 2005-08-13 21:05:57 -0700 | [diff] [blame] | 189 | __be16 pkey; |
Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 190 | __u8 hop_limit; |
| 191 | __u8 traffic_class; |
| 192 | __u8 numb_path; |
| 193 | __u8 sl; |
| 194 | __u8 mtu_selector; |
| 195 | __u8 rate_selector; |
| 196 | __u8 rate; |
| 197 | __u8 packet_life_time_selector; |
| 198 | __u8 packet_life_time; |
| 199 | __u8 preference; |
| 200 | }; |
| 201 | |
| 202 | struct ib_ucm_req { |
| 203 | __u32 id; |
| 204 | __u32 qpn; |
| 205 | __u32 qp_type; |
| 206 | __u32 psn; |
Sean Hefty | 97f52eb | 2005-08-13 21:05:57 -0700 | [diff] [blame] | 207 | __be64 sid; |
Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 208 | __u64 data; |
| 209 | __u64 primary_path; |
| 210 | __u64 alternate_path; |
| 211 | __u8 len; |
| 212 | __u8 peer_to_peer; |
| 213 | __u8 responder_resources; |
| 214 | __u8 initiator_depth; |
| 215 | __u8 remote_cm_response_timeout; |
| 216 | __u8 flow_control; |
| 217 | __u8 local_cm_response_timeout; |
| 218 | __u8 retry_count; |
| 219 | __u8 rnr_retry_count; |
| 220 | __u8 max_cm_retries; |
| 221 | __u8 srq; |
| 222 | __u8 reserved[1]; |
| 223 | }; |
| 224 | |
| 225 | struct ib_ucm_rep { |
Sean Hefty | 0b2b35f | 2005-09-01 09:28:03 -0700 | [diff] [blame] | 226 | __u64 uid; |
Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 227 | __u64 data; |
| 228 | __u32 id; |
| 229 | __u32 qpn; |
| 230 | __u32 psn; |
| 231 | __u8 len; |
| 232 | __u8 responder_resources; |
| 233 | __u8 initiator_depth; |
| 234 | __u8 target_ack_delay; |
| 235 | __u8 failover_accepted; |
| 236 | __u8 flow_control; |
| 237 | __u8 rnr_retry_count; |
| 238 | __u8 srq; |
| 239 | }; |
| 240 | |
| 241 | struct ib_ucm_info { |
| 242 | __u32 id; |
| 243 | __u32 status; |
| 244 | __u64 info; |
| 245 | __u64 data; |
| 246 | __u8 info_len; |
| 247 | __u8 data_len; |
| 248 | __u8 reserved[2]; |
| 249 | }; |
| 250 | |
| 251 | struct ib_ucm_mra { |
| 252 | __u64 data; |
| 253 | __u32 id; |
| 254 | __u8 len; |
| 255 | __u8 timeout; |
| 256 | __u8 reserved[2]; |
| 257 | }; |
| 258 | |
| 259 | struct ib_ucm_lap { |
| 260 | __u64 path; |
| 261 | __u64 data; |
| 262 | __u32 id; |
| 263 | __u8 len; |
| 264 | __u8 reserved[3]; |
| 265 | }; |
| 266 | |
| 267 | struct ib_ucm_sidr_req { |
| 268 | __u32 id; |
| 269 | __u32 timeout; |
Sean Hefty | 97f52eb | 2005-08-13 21:05:57 -0700 | [diff] [blame] | 270 | __be64 sid; |
Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 271 | __u64 data; |
| 272 | __u64 path; |
| 273 | __u16 pkey; |
| 274 | __u8 len; |
| 275 | __u8 max_cm_retries; |
| 276 | }; |
| 277 | |
| 278 | struct ib_ucm_sidr_rep { |
| 279 | __u32 id; |
| 280 | __u32 qpn; |
| 281 | __u32 qkey; |
| 282 | __u32 status; |
| 283 | __u64 info; |
| 284 | __u64 data; |
| 285 | __u8 info_len; |
| 286 | __u8 data_len; |
| 287 | __u8 reserved[2]; |
| 288 | }; |
| 289 | /* |
| 290 | * event notification ABI structures. |
| 291 | */ |
| 292 | struct ib_ucm_event_get { |
| 293 | __u64 response; |
| 294 | __u64 data; |
| 295 | __u64 info; |
| 296 | __u8 data_len; |
| 297 | __u8 info_len; |
| 298 | __u8 reserved[2]; |
| 299 | }; |
| 300 | |
| 301 | struct ib_ucm_req_event_resp { |
Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 302 | struct ib_ucm_path_rec primary_path; |
| 303 | struct ib_ucm_path_rec alternate_path; |
Sean Hefty | 97f52eb | 2005-08-13 21:05:57 -0700 | [diff] [blame] | 304 | __be64 remote_ca_guid; |
Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 305 | __u32 remote_qkey; |
| 306 | __u32 remote_qpn; |
| 307 | __u32 qp_type; |
| 308 | __u32 starting_psn; |
| 309 | __u8 responder_resources; |
| 310 | __u8 initiator_depth; |
| 311 | __u8 local_cm_response_timeout; |
| 312 | __u8 flow_control; |
| 313 | __u8 remote_cm_response_timeout; |
| 314 | __u8 retry_count; |
| 315 | __u8 rnr_retry_count; |
| 316 | __u8 srq; |
Sean Hefty | 07d357d | 2005-10-17 15:37:43 -0700 | [diff] [blame^] | 317 | __u8 port; |
Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 318 | }; |
| 319 | |
| 320 | struct ib_ucm_rep_event_resp { |
Sean Hefty | 97f52eb | 2005-08-13 21:05:57 -0700 | [diff] [blame] | 321 | __be64 remote_ca_guid; |
Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 322 | __u32 remote_qkey; |
| 323 | __u32 remote_qpn; |
| 324 | __u32 starting_psn; |
| 325 | __u8 responder_resources; |
| 326 | __u8 initiator_depth; |
| 327 | __u8 target_ack_delay; |
| 328 | __u8 failover_accepted; |
| 329 | __u8 flow_control; |
| 330 | __u8 rnr_retry_count; |
| 331 | __u8 srq; |
| 332 | __u8 reserved[1]; |
| 333 | }; |
| 334 | |
| 335 | struct ib_ucm_rej_event_resp { |
| 336 | __u32 reason; |
| 337 | /* ari in ib_ucm_event_get info field. */ |
| 338 | }; |
| 339 | |
| 340 | struct ib_ucm_mra_event_resp { |
| 341 | __u8 timeout; |
| 342 | __u8 reserved[3]; |
| 343 | }; |
| 344 | |
| 345 | struct ib_ucm_lap_event_resp { |
| 346 | struct ib_ucm_path_rec path; |
| 347 | }; |
| 348 | |
| 349 | struct ib_ucm_apr_event_resp { |
| 350 | __u32 status; |
| 351 | /* apr info in ib_ucm_event_get info field. */ |
| 352 | }; |
| 353 | |
| 354 | struct ib_ucm_sidr_req_event_resp { |
Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 355 | __u16 pkey; |
Sean Hefty | 07d357d | 2005-10-17 15:37:43 -0700 | [diff] [blame^] | 356 | __u8 port; |
| 357 | __u8 reserved; |
Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 358 | }; |
| 359 | |
| 360 | struct ib_ucm_sidr_rep_event_resp { |
| 361 | __u32 status; |
| 362 | __u32 qkey; |
| 363 | __u32 qpn; |
| 364 | /* info in ib_ucm_event_get info field. */ |
| 365 | }; |
| 366 | |
| 367 | #define IB_UCM_PRES_DATA 0x01 |
| 368 | #define IB_UCM_PRES_INFO 0x02 |
| 369 | #define IB_UCM_PRES_PRIMARY 0x04 |
| 370 | #define IB_UCM_PRES_ALTERNATE 0x08 |
| 371 | |
| 372 | struct ib_ucm_event_resp { |
Sean Hefty | 0b2b35f | 2005-09-01 09:28:03 -0700 | [diff] [blame] | 373 | __u64 uid; |
Hal Rosenstock | 8aa0091 | 2005-07-27 11:45:43 -0700 | [diff] [blame] | 374 | __u32 id; |
| 375 | __u32 event; |
| 376 | __u32 present; |
| 377 | union { |
| 378 | struct ib_ucm_req_event_resp req_resp; |
| 379 | struct ib_ucm_rep_event_resp rep_resp; |
| 380 | struct ib_ucm_rej_event_resp rej_resp; |
| 381 | struct ib_ucm_mra_event_resp mra_resp; |
| 382 | struct ib_ucm_lap_event_resp lap_resp; |
| 383 | struct ib_ucm_apr_event_resp apr_resp; |
| 384 | |
| 385 | struct ib_ucm_sidr_req_event_resp sidr_req_resp; |
| 386 | struct ib_ucm_sidr_rep_event_resp sidr_rep_resp; |
| 387 | |
| 388 | __u32 send_status; |
| 389 | } u; |
| 390 | }; |
| 391 | |
| 392 | #endif /* IB_USER_CM_H */ |