ib_user_cm.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  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. #ifndef IB_USER_CM_H
  34. #define IB_USER_CM_H
  35. #include <rdma/ib_user_sa.h>
  36. #define IB_USER_CM_ABI_VERSION 5
  37. enum {
  38. IB_USER_CM_CMD_CREATE_ID,
  39. IB_USER_CM_CMD_DESTROY_ID,
  40. IB_USER_CM_CMD_ATTR_ID,
  41. IB_USER_CM_CMD_LISTEN,
  42. IB_USER_CM_CMD_NOTIFY,
  43. IB_USER_CM_CMD_SEND_REQ,
  44. IB_USER_CM_CMD_SEND_REP,
  45. IB_USER_CM_CMD_SEND_RTU,
  46. IB_USER_CM_CMD_SEND_DREQ,
  47. IB_USER_CM_CMD_SEND_DREP,
  48. IB_USER_CM_CMD_SEND_REJ,
  49. IB_USER_CM_CMD_SEND_MRA,
  50. IB_USER_CM_CMD_SEND_LAP,
  51. IB_USER_CM_CMD_SEND_APR,
  52. IB_USER_CM_CMD_SEND_SIDR_REQ,
  53. IB_USER_CM_CMD_SEND_SIDR_REP,
  54. IB_USER_CM_CMD_EVENT,
  55. IB_USER_CM_CMD_INIT_QP_ATTR,
  56. };
  57. /*
  58. * command ABI structures.
  59. */
  60. struct ib_ucm_cmd_hdr {
  61. __u32 cmd;
  62. __u16 in;
  63. __u16 out;
  64. };
  65. struct ib_ucm_create_id {
  66. __u64 uid;
  67. __u64 response;
  68. };
  69. struct ib_ucm_create_id_resp {
  70. __u32 id;
  71. };
  72. struct ib_ucm_destroy_id {
  73. __u64 response;
  74. __u32 id;
  75. __u32 reserved;
  76. };
  77. struct ib_ucm_destroy_id_resp {
  78. __u32 events_reported;
  79. };
  80. struct ib_ucm_attr_id {
  81. __u64 response;
  82. __u32 id;
  83. __u32 reserved;
  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_listen {
  97. __be64 service_id;
  98. __be64 service_mask;
  99. __u32 id;
  100. __u32 reserved;
  101. };
  102. struct ib_ucm_notify {
  103. __u32 id;
  104. __u32 event;
  105. };
  106. struct ib_ucm_private_data {
  107. __u64 data;
  108. __u32 id;
  109. __u8 len;
  110. __u8 reserved[3];
  111. };
  112. struct ib_ucm_req {
  113. __u32 id;
  114. __u32 qpn;
  115. __u32 qp_type;
  116. __u32 psn;
  117. __be64 sid;
  118. __u64 data;
  119. __u64 primary_path;
  120. __u64 alternate_path;
  121. __u8 len;
  122. __u8 peer_to_peer;
  123. __u8 responder_resources;
  124. __u8 initiator_depth;
  125. __u8 remote_cm_response_timeout;
  126. __u8 flow_control;
  127. __u8 local_cm_response_timeout;
  128. __u8 retry_count;
  129. __u8 rnr_retry_count;
  130. __u8 max_cm_retries;
  131. __u8 srq;
  132. __u8 reserved[5];
  133. };
  134. struct ib_ucm_rep {
  135. __u64 uid;
  136. __u64 data;
  137. __u32 id;
  138. __u32 qpn;
  139. __u32 psn;
  140. __u8 len;
  141. __u8 responder_resources;
  142. __u8 initiator_depth;
  143. __u8 target_ack_delay;
  144. __u8 failover_accepted;
  145. __u8 flow_control;
  146. __u8 rnr_retry_count;
  147. __u8 srq;
  148. __u8 reserved[4];
  149. };
  150. struct ib_ucm_info {
  151. __u32 id;
  152. __u32 status;
  153. __u64 info;
  154. __u64 data;
  155. __u8 info_len;
  156. __u8 data_len;
  157. __u8 reserved[6];
  158. };
  159. struct ib_ucm_mra {
  160. __u64 data;
  161. __u32 id;
  162. __u8 len;
  163. __u8 timeout;
  164. __u8 reserved[2];
  165. };
  166. struct ib_ucm_lap {
  167. __u64 path;
  168. __u64 data;
  169. __u32 id;
  170. __u8 len;
  171. __u8 reserved[3];
  172. };
  173. struct ib_ucm_sidr_req {
  174. __u32 id;
  175. __u32 timeout;
  176. __be64 sid;
  177. __u64 data;
  178. __u64 path;
  179. __u16 reserved_pkey;
  180. __u8 len;
  181. __u8 max_cm_retries;
  182. __u8 reserved[4];
  183. };
  184. struct ib_ucm_sidr_rep {
  185. __u32 id;
  186. __u32 qpn;
  187. __u32 qkey;
  188. __u32 status;
  189. __u64 info;
  190. __u64 data;
  191. __u8 info_len;
  192. __u8 data_len;
  193. __u8 reserved[6];
  194. };
  195. /*
  196. * event notification ABI structures.
  197. */
  198. struct ib_ucm_event_get {
  199. __u64 response;
  200. __u64 data;
  201. __u64 info;
  202. __u8 data_len;
  203. __u8 info_len;
  204. __u8 reserved[6];
  205. };
  206. struct ib_ucm_req_event_resp {
  207. struct ib_user_path_rec primary_path;
  208. struct ib_user_path_rec alternate_path;
  209. __be64 remote_ca_guid;
  210. __u32 remote_qkey;
  211. __u32 remote_qpn;
  212. __u32 qp_type;
  213. __u32 starting_psn;
  214. __u8 responder_resources;
  215. __u8 initiator_depth;
  216. __u8 local_cm_response_timeout;
  217. __u8 flow_control;
  218. __u8 remote_cm_response_timeout;
  219. __u8 retry_count;
  220. __u8 rnr_retry_count;
  221. __u8 srq;
  222. __u8 port;
  223. __u8 reserved[7];
  224. };
  225. struct ib_ucm_rep_event_resp {
  226. __be64 remote_ca_guid;
  227. __u32 remote_qkey;
  228. __u32 remote_qpn;
  229. __u32 starting_psn;
  230. __u8 responder_resources;
  231. __u8 initiator_depth;
  232. __u8 target_ack_delay;
  233. __u8 failover_accepted;
  234. __u8 flow_control;
  235. __u8 rnr_retry_count;
  236. __u8 srq;
  237. __u8 reserved[5];
  238. };
  239. struct ib_ucm_rej_event_resp {
  240. __u32 reason;
  241. /* ari in ib_ucm_event_get info field. */
  242. };
  243. struct ib_ucm_mra_event_resp {
  244. __u8 timeout;
  245. __u8 reserved[3];
  246. };
  247. struct ib_ucm_lap_event_resp {
  248. struct ib_user_path_rec path;
  249. };
  250. struct ib_ucm_apr_event_resp {
  251. __u32 status;
  252. /* apr info in ib_ucm_event_get info field. */
  253. };
  254. struct ib_ucm_sidr_req_event_resp {
  255. __u16 pkey;
  256. __u8 port;
  257. __u8 reserved;
  258. };
  259. struct ib_ucm_sidr_rep_event_resp {
  260. __u32 status;
  261. __u32 qkey;
  262. __u32 qpn;
  263. /* info in ib_ucm_event_get info field. */
  264. };
  265. #define IB_UCM_PRES_DATA 0x01
  266. #define IB_UCM_PRES_INFO 0x02
  267. #define IB_UCM_PRES_PRIMARY 0x04
  268. #define IB_UCM_PRES_ALTERNATE 0x08
  269. struct ib_ucm_event_resp {
  270. __u64 uid;
  271. __u32 id;
  272. __u32 event;
  273. __u32 present;
  274. __u32 reserved;
  275. union {
  276. struct ib_ucm_req_event_resp req_resp;
  277. struct ib_ucm_rep_event_resp rep_resp;
  278. struct ib_ucm_rej_event_resp rej_resp;
  279. struct ib_ucm_mra_event_resp mra_resp;
  280. struct ib_ucm_lap_event_resp lap_resp;
  281. struct ib_ucm_apr_event_resp apr_resp;
  282. struct ib_ucm_sidr_req_event_resp sidr_req_resp;
  283. struct ib_ucm_sidr_rep_event_resp sidr_rep_resp;
  284. __u32 send_status;
  285. } u;
  286. };
  287. #endif /* IB_USER_CM_H */