diff options
author | Sean Hefty <sean.hefty@intel.com> | 2006-06-17 23:37:27 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-06-17 23:37:27 -0400 |
commit | 6a9af2e18a5c6ebcf8283309d20ac0e9fa35e346 (patch) | |
tree | 550bf42e4fff6b89160224fdf130085fefd0fe2e /include/rdma | |
parent | 4e56ea794ec8636991e21942fc2e0d071ea8ee1d (diff) |
IB: common handling for marshalling parameters to/from userspace
Provide common handling for marshalling data between userspace clients
and kernel InfiniBand drivers.
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'include/rdma')
-rw-r--r-- | include/rdma/ib_marshall.h | 50 | ||||
-rw-r--r-- | include/rdma/ib_user_cm.h | 84 | ||||
-rw-r--r-- | include/rdma/ib_user_sa.h | 60 | ||||
-rw-r--r-- | include/rdma/ib_user_verbs.h | 80 |
4 files changed, 174 insertions, 100 deletions
diff --git a/include/rdma/ib_marshall.h b/include/rdma/ib_marshall.h new file mode 100644 index 000000000000..66bf4d7d0dfb --- /dev/null +++ b/include/rdma/ib_marshall.h | |||
@@ -0,0 +1,50 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2005 Intel Corporation. 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 | |||
33 | #if !defined(IB_USER_MARSHALL_H) | ||
34 | #define IB_USER_MARSHALL_H | ||
35 | |||
36 | #include <rdma/ib_verbs.h> | ||
37 | #include <rdma/ib_sa.h> | ||
38 | #include <rdma/ib_user_verbs.h> | ||
39 | #include <rdma/ib_user_sa.h> | ||
40 | |||
41 | void ib_copy_qp_attr_to_user(struct ib_uverbs_qp_attr *dst, | ||
42 | struct ib_qp_attr *src); | ||
43 | |||
44 | void ib_copy_path_rec_to_user(struct ib_user_path_rec *dst, | ||
45 | struct ib_sa_path_rec *src); | ||
46 | |||
47 | void ib_copy_path_rec_from_user(struct ib_sa_path_rec *dst, | ||
48 | struct ib_user_path_rec *src); | ||
49 | |||
50 | #endif /* IB_USER_MARSHALL_H */ | ||
diff --git a/include/rdma/ib_user_cm.h b/include/rdma/ib_user_cm.h index 19be116047f6..a9e1b22d245c 100644 --- a/include/rdma/ib_user_cm.h +++ b/include/rdma/ib_user_cm.h | |||
@@ -30,13 +30,13 @@ | |||
30 | * 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 |
31 | * SOFTWARE. | 31 | * SOFTWARE. |
32 | * | 32 | * |
33 | * $Id: ib_user_cm.h 2576 2005-06-09 17:00:30Z libor $ | 33 | * $Id: ib_user_cm.h 4019 2005-11-11 00:33:09Z sean.hefty $ |
34 | */ | 34 | */ |
35 | 35 | ||
36 | #ifndef IB_USER_CM_H | 36 | #ifndef IB_USER_CM_H |
37 | #define IB_USER_CM_H | 37 | #define IB_USER_CM_H |
38 | 38 | ||
39 | #include <linux/types.h> | 39 | #include <rdma/ib_user_sa.h> |
40 | 40 | ||
41 | #define IB_USER_CM_ABI_VERSION 4 | 41 | #define IB_USER_CM_ABI_VERSION 4 |
42 | 42 | ||
@@ -110,58 +110,6 @@ struct ib_ucm_init_qp_attr { | |||
110 | __u32 qp_state; | 110 | __u32 qp_state; |
111 | }; | 111 | }; |
112 | 112 | ||
113 | struct ib_ucm_ah_attr { | ||
114 | __u8 grh_dgid[16]; | ||
115 | __u32 grh_flow_label; | ||
116 | __u16 dlid; | ||
117 | __u16 reserved; | ||
118 | __u8 grh_sgid_index; | ||
119 | __u8 grh_hop_limit; | ||
120 | __u8 grh_traffic_class; | ||
121 | __u8 sl; | ||
122 | __u8 src_path_bits; | ||
123 | __u8 static_rate; | ||
124 | __u8 is_global; | ||
125 | __u8 port_num; | ||
126 | }; | ||
127 | |||
128 | struct ib_ucm_init_qp_attr_resp { | ||
129 | __u32 qp_attr_mask; | ||
130 | __u32 qp_state; | ||
131 | __u32 cur_qp_state; | ||
132 | __u32 path_mtu; | ||
133 | __u32 path_mig_state; | ||
134 | __u32 qkey; | ||
135 | __u32 rq_psn; | ||
136 | __u32 sq_psn; | ||
137 | __u32 dest_qp_num; | ||
138 | __u32 qp_access_flags; | ||
139 | |||
140 | struct ib_ucm_ah_attr ah_attr; | ||
141 | struct ib_ucm_ah_attr alt_ah_attr; | ||
142 | |||
143 | /* ib_qp_cap */ | ||
144 | __u32 max_send_wr; | ||
145 | __u32 max_recv_wr; | ||
146 | __u32 max_send_sge; | ||
147 | __u32 max_recv_sge; | ||
148 | __u32 max_inline_data; | ||
149 | |||
150 | __u16 pkey_index; | ||
151 | __u16 alt_pkey_index; | ||
152 | __u8 en_sqd_async_notify; | ||
153 | __u8 sq_draining; | ||
154 | __u8 max_rd_atomic; | ||
155 | __u8 max_dest_rd_atomic; | ||
156 | __u8 min_rnr_timer; | ||
157 | __u8 port_num; | ||
158 | __u8 timeout; | ||
159 | __u8 retry_cnt; | ||
160 | __u8 rnr_retry; | ||
161 | __u8 alt_port_num; | ||
162 | __u8 alt_timeout; | ||
163 | }; | ||
164 | |||
165 | struct ib_ucm_listen { | 113 | struct ib_ucm_listen { |
166 | __be64 service_id; | 114 | __be64 service_id; |
167 | __be64 service_mask; | 115 | __be64 service_mask; |
@@ -180,28 +128,6 @@ struct ib_ucm_private_data { | |||
180 | __u8 reserved[3]; | 128 | __u8 reserved[3]; |
181 | }; | 129 | }; |
182 | 130 | ||
183 | struct ib_ucm_path_rec { | ||
184 | __u8 dgid[16]; | ||
185 | __u8 sgid[16]; | ||
186 | __be16 dlid; | ||
187 | __be16 slid; | ||
188 | __u32 raw_traffic; | ||
189 | __be32 flow_label; | ||
190 | __u32 reversible; | ||
191 | __u32 mtu; | ||
192 | __be16 pkey; | ||
193 | __u8 hop_limit; | ||
194 | __u8 traffic_class; | ||
195 | __u8 numb_path; | ||
196 | __u8 sl; | ||
197 | __u8 mtu_selector; | ||
198 | __u8 rate_selector; | ||
199 | __u8 rate; | ||
200 | __u8 packet_life_time_selector; | ||
201 | __u8 packet_life_time; | ||
202 | __u8 preference; | ||
203 | }; | ||
204 | |||
205 | struct ib_ucm_req { | 131 | struct ib_ucm_req { |
206 | __u32 id; | 132 | __u32 id; |
207 | __u32 qpn; | 133 | __u32 qpn; |
@@ -304,8 +230,8 @@ struct ib_ucm_event_get { | |||
304 | }; | 230 | }; |
305 | 231 | ||
306 | struct ib_ucm_req_event_resp { | 232 | struct ib_ucm_req_event_resp { |
307 | struct ib_ucm_path_rec primary_path; | 233 | struct ib_user_path_rec primary_path; |
308 | struct ib_ucm_path_rec alternate_path; | 234 | struct ib_user_path_rec alternate_path; |
309 | __be64 remote_ca_guid; | 235 | __be64 remote_ca_guid; |
310 | __u32 remote_qkey; | 236 | __u32 remote_qkey; |
311 | __u32 remote_qpn; | 237 | __u32 remote_qpn; |
@@ -349,7 +275,7 @@ struct ib_ucm_mra_event_resp { | |||
349 | }; | 275 | }; |
350 | 276 | ||
351 | struct ib_ucm_lap_event_resp { | 277 | struct ib_ucm_lap_event_resp { |
352 | struct ib_ucm_path_rec path; | 278 | struct ib_user_path_rec path; |
353 | }; | 279 | }; |
354 | 280 | ||
355 | struct ib_ucm_apr_event_resp { | 281 | struct ib_ucm_apr_event_resp { |
diff --git a/include/rdma/ib_user_sa.h b/include/rdma/ib_user_sa.h new file mode 100644 index 000000000000..659120157e14 --- /dev/null +++ b/include/rdma/ib_user_sa.h | |||
@@ -0,0 +1,60 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2005 Intel Corporation. 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 | |||
33 | #ifndef IB_USER_SA_H | ||
34 | #define IB_USER_SA_H | ||
35 | |||
36 | #include <linux/types.h> | ||
37 | |||
38 | struct ib_user_path_rec { | ||
39 | __u8 dgid[16]; | ||
40 | __u8 sgid[16]; | ||
41 | __be16 dlid; | ||
42 | __be16 slid; | ||
43 | __u32 raw_traffic; | ||
44 | __be32 flow_label; | ||
45 | __u32 reversible; | ||
46 | __u32 mtu; | ||
47 | __be16 pkey; | ||
48 | __u8 hop_limit; | ||
49 | __u8 traffic_class; | ||
50 | __u8 numb_path; | ||
51 | __u8 sl; | ||
52 | __u8 mtu_selector; | ||
53 | __u8 rate_selector; | ||
54 | __u8 rate; | ||
55 | __u8 packet_life_time_selector; | ||
56 | __u8 packet_life_time; | ||
57 | __u8 preference; | ||
58 | }; | ||
59 | |||
60 | #endif /* IB_USER_SA_H */ | ||
diff --git a/include/rdma/ib_user_verbs.h b/include/rdma/ib_user_verbs.h index 338ed4333063..7b5372010f4b 100644 --- a/include/rdma/ib_user_verbs.h +++ b/include/rdma/ib_user_verbs.h | |||
@@ -32,7 +32,7 @@ | |||
32 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | 32 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
33 | * SOFTWARE. | 33 | * SOFTWARE. |
34 | * | 34 | * |
35 | * $Id: ib_user_verbs.h 2708 2005-06-24 17:27:21Z roland $ | 35 | * $Id: ib_user_verbs.h 4019 2005-11-11 00:33:09Z sean.hefty $ |
36 | */ | 36 | */ |
37 | 37 | ||
38 | #ifndef IB_USER_VERBS_H | 38 | #ifndef IB_USER_VERBS_H |
@@ -323,6 +323,64 @@ struct ib_uverbs_destroy_cq_resp { | |||
323 | __u32 async_events_reported; | 323 | __u32 async_events_reported; |
324 | }; | 324 | }; |
325 | 325 | ||
326 | struct ib_uverbs_global_route { | ||
327 | __u8 dgid[16]; | ||
328 | __u32 flow_label; | ||
329 | __u8 sgid_index; | ||
330 | __u8 hop_limit; | ||
331 | __u8 traffic_class; | ||
332 | __u8 reserved; | ||
333 | }; | ||
334 | |||
335 | struct ib_uverbs_ah_attr { | ||
336 | struct ib_uverbs_global_route grh; | ||
337 | __u16 dlid; | ||
338 | __u8 sl; | ||
339 | __u8 src_path_bits; | ||
340 | __u8 static_rate; | ||
341 | __u8 is_global; | ||
342 | __u8 port_num; | ||
343 | __u8 reserved; | ||
344 | }; | ||
345 | |||
346 | struct ib_uverbs_qp_attr { | ||
347 | __u32 qp_attr_mask; | ||
348 | __u32 qp_state; | ||
349 | __u32 cur_qp_state; | ||
350 | __u32 path_mtu; | ||
351 | __u32 path_mig_state; | ||
352 | __u32 qkey; | ||
353 | __u32 rq_psn; | ||
354 | __u32 sq_psn; | ||
355 | __u32 dest_qp_num; | ||
356 | __u32 qp_access_flags; | ||
357 | |||
358 | struct ib_uverbs_ah_attr ah_attr; | ||
359 | struct ib_uverbs_ah_attr alt_ah_attr; | ||
360 | |||
361 | /* ib_qp_cap */ | ||
362 | __u32 max_send_wr; | ||
363 | __u32 max_recv_wr; | ||
364 | __u32 max_send_sge; | ||
365 | __u32 max_recv_sge; | ||
366 | __u32 max_inline_data; | ||
367 | |||
368 | __u16 pkey_index; | ||
369 | __u16 alt_pkey_index; | ||
370 | __u8 en_sqd_async_notify; | ||
371 | __u8 sq_draining; | ||
372 | __u8 max_rd_atomic; | ||
373 | __u8 max_dest_rd_atomic; | ||
374 | __u8 min_rnr_timer; | ||
375 | __u8 port_num; | ||
376 | __u8 timeout; | ||
377 | __u8 retry_cnt; | ||
378 | __u8 rnr_retry; | ||
379 | __u8 alt_port_num; | ||
380 | __u8 alt_timeout; | ||
381 | __u8 reserved[5]; | ||
382 | }; | ||
383 | |||
326 | struct ib_uverbs_create_qp { | 384 | struct ib_uverbs_create_qp { |
327 | __u64 response; | 385 | __u64 response; |
328 | __u64 user_handle; | 386 | __u64 user_handle; |
@@ -541,26 +599,6 @@ struct ib_uverbs_post_srq_recv_resp { | |||
541 | __u32 bad_wr; | 599 | __u32 bad_wr; |
542 | }; | 600 | }; |
543 | 601 | ||
544 | struct ib_uverbs_global_route { | ||
545 | __u8 dgid[16]; | ||
546 | __u32 flow_label; | ||
547 | __u8 sgid_index; | ||
548 | __u8 hop_limit; | ||
549 | __u8 traffic_class; | ||
550 | __u8 reserved; | ||
551 | }; | ||
552 | |||
553 | struct ib_uverbs_ah_attr { | ||
554 | struct ib_uverbs_global_route grh; | ||
555 | __u16 dlid; | ||
556 | __u8 sl; | ||
557 | __u8 src_path_bits; | ||
558 | __u8 static_rate; | ||
559 | __u8 is_global; | ||
560 | __u8 port_num; | ||
561 | __u8 reserved; | ||
562 | }; | ||
563 | |||
564 | struct ib_uverbs_create_ah { | 602 | struct ib_uverbs_create_ah { |
565 | __u64 response; | 603 | __u64 response; |
566 | __u64 user_handle; | 604 | __u64 user_handle; |