ib_user_cm.h 6.4 KB

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