2 * Copyright (c) 2005-2011 Intel Corporation. All rights reserved.
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:
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
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.
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
33 #ifndef RDMA_CMA_ABI_H
34 #define RDMA_CMA_ABI_H
36 #include <infiniband/kern-abi.h>
37 #include <rdma/ib_user_sa.h>
38 #include <infiniband/sa.h>
39 #include <netinet/in.h>
42 * This file must be kept in sync with the kernel's version of rdma_user_cm.h
45 #define RDMA_USER_CM_MIN_ABI_VERSION 3
46 #define RDMA_USER_CM_MAX_ABI_VERSION 4
48 #define RDMA_MAX_PRIVATE_DATA 256
55 UCMA_CMD_RESOLVE_ROUTE,
62 UCMA_CMD_INIT_QP_ATTR,
67 UCMA_CMD_JOIN_IP_MCAST,
72 UCMA_CMD_RESOLVE_ADDR,
76 struct ucma_abi_cmd_hdr {
82 struct ucma_abi_create_id {
93 struct ucma_abi_create_id_resp {
97 struct ucma_abi_destroy_id {
106 struct ucma_abi_destroy_id_resp {
107 __u32 events_reported;
110 struct ucma_abi_bind_ip {
115 struct sockaddr_in6 addr;
119 struct ucma_abi_bind {
126 struct sockaddr_storage addr;
129 struct ucma_abi_resolve_ip {
133 struct sockaddr_in6 src_addr;
134 struct sockaddr_in6 dst_addr;
139 struct ucma_abi_resolve_addr {
148 struct sockaddr_storage src_addr;
149 struct sockaddr_storage dst_addr;
152 struct ucma_abi_resolve_route {
166 struct ucma_abi_query {
175 struct ucma_abi_query_route_resp {
177 struct ib_user_path_rec ib_route[2];
178 struct sockaddr_in6 src_addr;
179 struct sockaddr_in6 dst_addr;
185 struct ucma_abi_query_addr_resp {
192 struct sockaddr_storage src_addr;
193 struct sockaddr_storage dst_addr;
196 struct ucma_abi_query_path_resp {
199 struct ibv_path_data path_data[0];
202 struct ucma_abi_conn_param {
205 __u8 private_data[RDMA_MAX_PRIVATE_DATA];
206 __u8 private_data_len;
208 __u8 responder_resources;
209 __u8 initiator_depth;
212 __u8 rnr_retry_count;
216 struct ucma_abi_ud_param {
219 struct ibv_kern_ah_attr ah_attr;
220 __u8 private_data[RDMA_MAX_PRIVATE_DATA];
221 __u8 private_data_len;
223 __u8 reserved2[4]; /* Round to 8-byte boundary to support 32/64 */
226 struct ucma_abi_connect {
230 struct ucma_abi_conn_param conn_param;
235 struct ucma_abi_listen {
243 struct ucma_abi_accept {
248 struct ucma_abi_conn_param conn_param;
253 struct ucma_abi_reject {
258 __u8 private_data_len;
260 __u8 private_data[RDMA_MAX_PRIVATE_DATA];
263 struct ucma_abi_disconnect {
270 struct ucma_abi_init_qp_attr {
279 struct ucma_abi_notify {
287 struct ucma_abi_join_ip_mcast {
291 __u64 response; /* ucma_abi_create_id_resp */
293 struct sockaddr_in6 addr;
297 struct ucma_abi_join_mcast {
301 __u64 response; /* rdma_ucma_create_id_resp */
306 struct sockaddr_storage addr;
309 struct ucma_abi_get_event {
316 struct ucma_abi_event_resp {
322 struct ucma_abi_conn_param conn;
323 struct ucma_abi_ud_param ud;
327 struct ucma_abi_set_option {
338 struct ucma_abi_migrate_id {
347 struct ucma_abi_migrate_resp {
348 __u32 events_reported;
351 #endif /* RDMA_CMA_ABI_H */