Linux Kernel
3.7.1
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
include
rdma
rdma_cm.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2005 Voltaire Inc. All rights reserved.
3
* Copyright (c) 2005 Intel Corporation. All rights reserved.
4
*
5
* This software is available to you under a choice of one of two
6
* licenses. You may choose to be licensed under the terms of the GNU
7
* General Public License (GPL) Version 2, available from the file
8
* COPYING in the main directory of this source tree, or the
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
34
#if !defined(RDMA_CM_H)
35
#define RDMA_CM_H
36
37
#include <linux/socket.h>
38
#include <linux/in6.h>
39
#include <
rdma/ib_addr.h
>
40
#include <
rdma/ib_sa.h
>
41
42
/*
43
* Upon receiving a device removal event, users must destroy the associated
44
* RDMA identifier and release all resources allocated with the device.
45
*/
46
enum
rdma_cm_event_type
{
47
RDMA_CM_EVENT_ADDR_RESOLVED
,
48
RDMA_CM_EVENT_ADDR_ERROR
,
49
RDMA_CM_EVENT_ROUTE_RESOLVED
,
50
RDMA_CM_EVENT_ROUTE_ERROR
,
51
RDMA_CM_EVENT_CONNECT_REQUEST
,
52
RDMA_CM_EVENT_CONNECT_RESPONSE
,
53
RDMA_CM_EVENT_CONNECT_ERROR
,
54
RDMA_CM_EVENT_UNREACHABLE
,
55
RDMA_CM_EVENT_REJECTED
,
56
RDMA_CM_EVENT_ESTABLISHED
,
57
RDMA_CM_EVENT_DISCONNECTED
,
58
RDMA_CM_EVENT_DEVICE_REMOVAL
,
59
RDMA_CM_EVENT_MULTICAST_JOIN
,
60
RDMA_CM_EVENT_MULTICAST_ERROR
,
61
RDMA_CM_EVENT_ADDR_CHANGE
,
62
RDMA_CM_EVENT_TIMEWAIT_EXIT
63
};
64
65
enum
rdma_port_space
{
66
RDMA_PS_SDP
= 0x0001,
67
RDMA_PS_IPOIB
= 0x0002,
68
RDMA_PS_IB
= 0x013F,
69
RDMA_PS_TCP
= 0x0106,
70
RDMA_PS_UDP
= 0x0111,
71
};
72
73
struct
rdma_addr
{
74
struct
sockaddr_storage
src_addr
;
75
struct
sockaddr_storage
dst_addr
;
76
struct
rdma_dev_addr
dev_addr
;
77
};
78
79
struct
rdma_route
{
80
struct
rdma_addr
addr
;
81
struct
ib_sa_path_rec
*
path_rec
;
82
int
num_paths
;
83
};
84
85
struct
rdma_conn_param
{
86
const
void
*
private_data
;
87
u8
private_data_len
;
88
u8
responder_resources
;
89
u8
initiator_depth
;
90
u8
flow_control
;
91
u8
retry_count
;
/* ignored when accepting */
92
u8
rnr_retry_count
;
93
/* Fields below ignored if a QP is created on the rdma_cm_id. */
94
u8
srq
;
95
u32
qp_num
;
96
};
97
98
struct
rdma_ud_param
{
99
const
void
*
private_data
;
100
u8
private_data_len
;
101
struct
ib_ah_attr
ah_attr
;
102
u32
qp_num
;
103
u32
qkey
;
104
};
105
106
struct
rdma_cm_event
{
107
enum
rdma_cm_event_type
event
;
108
int
status
;
109
union
{
110
struct
rdma_conn_param
conn
;
111
struct
rdma_ud_param
ud
;
112
}
param
;
113
};
114
115
enum
rdma_cm_state
{
116
RDMA_CM_IDLE
,
117
RDMA_CM_ADDR_QUERY
,
118
RDMA_CM_ADDR_RESOLVED
,
119
RDMA_CM_ROUTE_QUERY
,
120
RDMA_CM_ROUTE_RESOLVED
,
121
RDMA_CM_CONNECT
,
122
RDMA_CM_DISCONNECT
,
123
RDMA_CM_ADDR_BOUND
,
124
RDMA_CM_LISTEN
,
125
RDMA_CM_DEVICE_REMOVAL
,
126
RDMA_CM_DESTROYING
127
};
128
129
struct
rdma_cm_id
;
130
138
typedef
int
(*
rdma_cm_event_handler
)(
struct
rdma_cm_id
*
id
,
139
struct
rdma_cm_event
*
event
);
140
141
struct
rdma_cm_id
{
142
struct
ib_device
*
device
;
143
void
*
context
;
144
struct
ib_qp
*
qp
;
145
rdma_cm_event_handler
event_handler
;
146
struct
rdma_route
route
;
147
enum
rdma_port_space
ps
;
148
enum
ib_qp_type
qp_type
;
149
u8
port_num
;
150
};
151
161
struct
rdma_cm_id
*
rdma_create_id
(
rdma_cm_event_handler
event_handler
,
162
void
*
context
,
enum
rdma_port_space
ps
,
163
enum
ib_qp_type
qp_type
);
164
173
void
rdma_destroy_id
(
struct
rdma_cm_id
*
id
);
174
186
int
rdma_bind_addr
(
struct
rdma_cm_id
*
id
,
struct
sockaddr
*
addr
);
187
198
int
rdma_resolve_addr
(
struct
rdma_cm_id
*
id
,
struct
sockaddr
*
src_addr
,
199
struct
sockaddr
*
dst_addr
,
int
timeout_ms
);
200
209
int
rdma_resolve_route
(
struct
rdma_cm_id
*
id
,
int
timeout_ms
);
210
218
int
rdma_create_qp
(
struct
rdma_cm_id
*
id
,
struct
ib_pd
*pd,
219
struct
ib_qp_init_attr
*qp_init_attr);
220
228
void
rdma_destroy_qp
(
struct
rdma_cm_id
*
id
);
229
249
int
rdma_init_qp_attr
(
struct
rdma_cm_id
*
id
,
struct
ib_qp_attr
*qp_attr,
250
int
*qp_attr_mask);
251
264
int
rdma_connect
(
struct
rdma_cm_id
*
id
,
struct
rdma_conn_param
*conn_param);
265
273
int
rdma_listen
(
struct
rdma_cm_id
*
id
,
int
backlog
);
274
290
int
rdma_accept
(
struct
rdma_cm_id
*
id
,
struct
rdma_conn_param
*conn_param);
291
305
int
rdma_notify
(
struct
rdma_cm_id
*
id
,
enum
ib_event_type
event
);
306
310
int
rdma_reject
(
struct
rdma_cm_id
*
id
,
const
void
*
private_data
,
311
u8
private_data_len);
312
317
int
rdma_disconnect
(
struct
rdma_cm_id
*
id
);
318
327
int
rdma_join_multicast
(
struct
rdma_cm_id
*
id
,
struct
sockaddr
*
addr
,
328
void
*
context
);
329
334
void
rdma_leave_multicast
(
struct
rdma_cm_id
*
id
,
struct
sockaddr
*
addr
);
335
348
void
rdma_set_service_type
(
struct
rdma_cm_id
*
id
,
int
tos);
349
358
int
rdma_set_reuseaddr
(
struct
rdma_cm_id
*
id
,
int
reuse);
359
368
int
rdma_set_afonly
(
struct
rdma_cm_id
*
id
,
int
afonly);
369
370
#endif
/* RDMA_CM_H */
Generated on Thu Jan 10 2013 14:53:23 for Linux Kernel by
1.8.2