ib_user_cm.h 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. /*
  2. * Copyright (c) 2005 Topspin Communications. 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. * $Id: ib_user_cm.h 2576 2005-06-09 17:00:30Z libor $
  34. */
  35. #ifndef IB_USER_CM_H
  36. #define IB_USER_CM_H
  37. #include <linux/types.h>
  38. #define IB_USER_CM_ABI_VERSION 2
  39. enum {
  40. IB_USER_CM_CMD_CREATE_ID,
  41. IB_USER_CM_CMD_DESTROY_ID,
  42. IB_USER_CM_CMD_ATTR_ID,
  43. IB_USER_CM_CMD_LISTEN,
  44. IB_USER_CM_CMD_ESTABLISH,
  45. IB_USER_CM_CMD_SEND_REQ,
  46. IB_USER_CM_CMD_SEND_REP,
  47. IB_USER_CM_CMD_SEND_RTU,
  48. IB_USER_CM_CMD_SEND_DREQ,
  49. IB_USER_CM_CMD_SEND_DREP,
  50. IB_USER_CM_CMD_SEND_REJ,
  51. IB_USER_CM_CMD_SEND_MRA,
  52. IB_USER_CM_CMD_SEND_LAP,
  53. IB_USER_CM_CMD_SEND_APR,
  54. IB_USER_CM_CMD_SEND_SIDR_REQ,
  55. IB_USER_CM_CMD_SEND_SIDR_REP,
  56. IB_USER_CM_CMD_EVENT,
  57. IB_USER_CM_CMD_INIT_QP_ATTR,
  58. };
  59. /*
  60. * command ABI structures.
  61. */
  62. struct ib_ucm_cmd_hdr {
  63. __u32 cmd;
  64. __u16 in;
  65. __u16 out;
  66. };
  67. struct ib_ucm_create_id {
  68. __u64 uid;
  69. __u64 response;
  70. };
  71. struct ib_ucm_create_id_resp {
  72. __u32 id;
  73. };
  74. struct ib_ucm_destroy_id {
  75. __u64 response;
  76. __u32 id;
  77. };
  78. struct ib_ucm_destroy_id_resp {
  79. __u32 events_reported;
  80. };
  81. struct ib_ucm_attr_id {
  82. __u64 response;
  83. __u32 id;
  84. };
  85. struct ib_ucm_attr_id_resp {
  86. __be64 service_id;
  87. __be64 service_mask;
  88. __be32 local_id;
  89. __be32 remote_id;
  90. };
  91. struct ib_ucm_init_qp_attr {
  92. __u64 response;
  93. __u32 id;
  94. __u32 qp_state;
  95. };
  96. struct ib_ucm_ah_attr {
  97. __u8 grh_dgid[16];
  98. __u32 grh_flow_label;
  99. __u16 dlid;
  100. __u16 reserved;
  101. __u8 grh_sgid_index;
  102. __u8 grh_hop_limit;
  103. __u8 grh_traffic_class;
  104. __u8 sl;
  105. __u8 src_path_bits;
  106. __u8 static_rate;
  107. __u8 is_global;
  108. __u8 port_num;
  109. };
  110. struct ib_ucm_init_qp_attr_resp {
  111. __u32 qp_attr_mask;
  112. __u32 qp_state;
  113. __u32 cur_qp_state;
  114. __u32 path_mtu;
  115. __u32 path_mig_state;
  116. __u32 qkey;
  117. __u32 rq_psn;
  118. __u32 sq_psn;
  119. __u32 dest_qp_num;
  120. __u32 qp_access_flags;
  121. struct ib_ucm_ah_attr ah_attr;
  122. struct ib_ucm_ah_attr alt_ah_attr;
  123. /* ib_qp_cap */
  124. __u32 max_send_wr;
  125. __u32 max_recv_wr;
  126. __u32 max_send_sge;
  127. __u32 max_recv_sge;
  128. __u32 max_inline_data;
  129. __u16 pkey_index;
  130. __u16 alt_pkey_index;
  131. __u8 en_sqd_async_notify;
  132. __u8 sq_draining;
  133. __u8 max_rd_atomic;
  134. __u8 max_dest_rd_atomic;
  135. __u8 min_rnr_timer;
  136. __u8 port_num;
  137. __u8 timeout;
  138. __u8 retry_cnt;
  139. __u8 rnr_retry;
  140. __u8 alt_port_num;
  141. __u8 alt_timeout;
  142. };
  143. struct ib_ucm_listen {
  144. __be64 service_id;
  145. __be64 service_mask;
  146. __u32 id;
  147. };
  148. struct ib_ucm_establish {
  149. __u32 id;
  150. };
  151. struct ib_ucm_private_data {
  152. __u64 data;
  153. __u32 id;
  154. __u8 len;
  155. __u8 reserved[3];
  156. };
  157. struct ib_ucm_path_rec {
  158. __u8 dgid[16];
  159. __u8 sgid[16];
  160. __be16 dlid;
  161. __be16 slid;
  162. __u32 raw_traffic;
  163. __be32 flow_label;
  164. __u32 reversible;
  165. __u32 mtu;
  166. __be16 pkey;
  167. __u8 hop_limit;
  168. __u8 traffic_class;
  169. __u8 numb_path;
  170. __u8 sl;
  171. __u8 mtu_selector;
  172. __u8 rate_selector;
  173. __u8 rate;
  174. __u8 packet_life_time_selector;
  175. __u8 packet_life_time;
  176. __u8 preference;
  177. };
  178. struct ib_ucm_req {
  179. __u32 id;
  180. __u32 qpn;
  181. __u32 qp_type;
  182. __u32 psn;
  183. __be64 sid;
  184. __u64 data;
  185. __u64 primary_path;
  186. __u64 alternate_path;
  187. __u8 len;
  188. __u8 peer_to_peer;
  189. __u8 responder_resources;
  190. __u8 initiator_depth;
  191. __u8 remote_cm_response_timeout;
  192. __u8 flow_control;
  193. __u8 local_cm_response_timeout;
  194. __u8 retry_count;
  195. __u8 rnr_retry_count;
  196. __u8 max_cm_retries;
  197. __u8 srq;
  198. __u8 reserved[1];
  199. };
  200. struct ib_ucm_rep {
  201. __u64 uid;
  202. __u64 data;
  203. __u32 id;
  204. __u32 qpn;
  205. __u32 psn;
  206. __u8 len;
  207. __u8 responder_resources;
  208. __u8 initiator_depth;
  209. __u8 target_ack_delay;
  210. __u8 failover_accepted;
  211. __u8 flow_control;
  212. __u8 rnr_retry_count;
  213. __u8 srq;
  214. };
  215. struct ib_ucm_info {
  216. __u32 id;
  217. __u32 status;
  218. __u64 info;
  219. __u64 data;
  220. __u8 info_len;
  221. __u8 data_len;
  222. __u8 reserved[2];
  223. };
  224. struct ib_ucm_mra {
  225. __u64 data;
  226. __u32 id;
  227. __u8 len;
  228. __u8 timeout;
  229. __u8 reserved[2];
  230. };
  231. struct ib_ucm_lap {
  232. __u64 path;
  233. __u64 data;
  234. __u32 id;
  235. __u8 len;
  236. __u8 reserved[3];
  237. };
  238. struct ib_ucm_sidr_req {
  239. __u32 id;
  240. __u32 timeout;
  241. __be64 sid;
  242. __u64 data;
  243. __u64 path;
  244. __u16 pkey;
  245. __u8 len;
  246. __u8 max_cm_retries;
  247. };
  248. struct ib_ucm_sidr_rep {
  249. __u32 id;
  250. __u32 qpn;
  251. __u32 qkey;
  252. __u32 status;
  253. __u64 info;
  254. __u64 data;
  255. __u8 info_len;
  256. __u8 data_len;
  257. __u8 reserved[2];
  258. };
  259. /*
  260. * event notification ABI structures.
  261. */
  262. struct ib_ucm_event_get {
  263. __u64 response;
  264. __u64 data;
  265. __u64 info;
  266. __u8 data_len;
  267. __u8 info_len;
  268. __u8 reserved[2];
  269. };
  270. struct ib_ucm_req_event_resp {
  271. /* device */
  272. /* port */
  273. struct ib_ucm_path_rec primary_path;
  274. struct ib_ucm_path_rec alternate_path;
  275. __be64 remote_ca_guid;
  276. __u32 remote_qkey;
  277. __u32 remote_qpn;
  278. __u32 qp_type;
  279. __u32 starting_psn;
  280. __u8 responder_resources;
  281. __u8 initiator_depth;
  282. __u8 local_cm_response_timeout;
  283. __u8 flow_control;
  284. __u8 remote_cm_response_timeout;
  285. __u8 retry_count;
  286. __u8 rnr_retry_count;
  287. __u8 srq;
  288. };
  289. struct ib_ucm_rep_event_resp {
  290. __be64 remote_ca_guid;
  291. __u32 remote_qkey;
  292. __u32 remote_qpn;
  293. __u32 starting_psn;
  294. __u8 responder_resources;
  295. __u8 initiator_depth;
  296. __u8 target_ack_delay;
  297. __u8 failover_accepted;
  298. __u8 flow_control;
  299. __u8 rnr_retry_count;
  300. __u8 srq;
  301. __u8 reserved[1];
  302. };
  303. struct ib_ucm_rej_event_resp {
  304. __u32 reason;
  305. /* ari in ib_ucm_event_get info field. */
  306. };
  307. struct ib_ucm_mra_event_resp {
  308. __u8 timeout;
  309. __u8 reserved[3];
  310. };
  311. struct ib_ucm_lap_event_resp {
  312. struct ib_ucm_path_rec path;
  313. };
  314. struct ib_ucm_apr_event_resp {
  315. __u32 status;
  316. /* apr info in ib_ucm_event_get info field. */
  317. };
  318. struct ib_ucm_sidr_req_event_resp {
  319. /* device */
  320. /* port */
  321. __u16 pkey;
  322. __u8 reserved[2];
  323. };
  324. struct ib_ucm_sidr_rep_event_resp {
  325. __u32 status;
  326. __u32 qkey;
  327. __u32 qpn;
  328. /* info in ib_ucm_event_get info field. */
  329. };
  330. #define IB_UCM_PRES_DATA 0x01
  331. #define IB_UCM_PRES_INFO 0x02
  332. #define IB_UCM_PRES_PRIMARY 0x04
  333. #define IB_UCM_PRES_ALTERNATE 0x08
  334. struct ib_ucm_event_resp {
  335. __u64 uid;
  336. __u32 id;
  337. __u32 event;
  338. __u32 present;
  339. union {
  340. struct ib_ucm_req_event_resp req_resp;
  341. struct ib_ucm_rep_event_resp rep_resp;
  342. struct ib_ucm_rej_event_resp rej_resp;
  343. struct ib_ucm_mra_event_resp mra_resp;
  344. struct ib_ucm_lap_event_resp lap_resp;
  345. struct ib_ucm_apr_event_resp apr_resp;
  346. struct ib_ucm_sidr_req_event_resp sidr_req_resp;
  347. struct ib_ucm_sidr_rep_event_resp sidr_rep_resp;
  348. __u32 send_status;
  349. } u;
  350. };
  351. #endif /* IB_USER_CM_H */