ib_user_cm.h 7.7 KB

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