ib_user_cm.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. /*
  2. * Copyright (c) 2005 Topspin Communications. 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. * $Id: ib_user_cm.h 2576 2005-06-09 17:00:30Z libor $
  33. */
  34. #ifndef IB_USER_CM_H
  35. #define IB_USER_CM_H
  36. #include <linux/types.h>
  37. #define IB_USER_CM_ABI_VERSION 1
  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_ESTABLISH,
  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. };
  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 response;
  67. };
  68. struct ib_ucm_create_id_resp {
  69. __u32 id;
  70. };
  71. struct ib_ucm_destroy_id {
  72. __u32 id;
  73. };
  74. struct ib_ucm_attr_id {
  75. __u64 response;
  76. __u32 id;
  77. };
  78. struct ib_ucm_attr_id_resp {
  79. __be64 service_id;
  80. __be64 service_mask;
  81. __be32 local_id;
  82. __be32 remote_id;
  83. };
  84. struct ib_ucm_listen {
  85. __be64 service_id;
  86. __be64 service_mask;
  87. __u32 id;
  88. };
  89. struct ib_ucm_establish {
  90. __u32 id;
  91. };
  92. struct ib_ucm_private_data {
  93. __u64 data;
  94. __u32 id;
  95. __u8 len;
  96. __u8 reserved[3];
  97. };
  98. struct ib_ucm_path_rec {
  99. __u8 dgid[16];
  100. __u8 sgid[16];
  101. __be16 dlid;
  102. __be16 slid;
  103. __u32 raw_traffic;
  104. __be32 flow_label;
  105. __u32 reversible;
  106. __u32 mtu;
  107. __be16 pkey;
  108. __u8 hop_limit;
  109. __u8 traffic_class;
  110. __u8 numb_path;
  111. __u8 sl;
  112. __u8 mtu_selector;
  113. __u8 rate_selector;
  114. __u8 rate;
  115. __u8 packet_life_time_selector;
  116. __u8 packet_life_time;
  117. __u8 preference;
  118. };
  119. struct ib_ucm_req {
  120. __u32 id;
  121. __u32 qpn;
  122. __u32 qp_type;
  123. __u32 psn;
  124. __be64 sid;
  125. __u64 data;
  126. __u64 primary_path;
  127. __u64 alternate_path;
  128. __u8 len;
  129. __u8 peer_to_peer;
  130. __u8 responder_resources;
  131. __u8 initiator_depth;
  132. __u8 remote_cm_response_timeout;
  133. __u8 flow_control;
  134. __u8 local_cm_response_timeout;
  135. __u8 retry_count;
  136. __u8 rnr_retry_count;
  137. __u8 max_cm_retries;
  138. __u8 srq;
  139. __u8 reserved[1];
  140. };
  141. struct ib_ucm_rep {
  142. __u64 data;
  143. __u32 id;
  144. __u32 qpn;
  145. __u32 psn;
  146. __u8 len;
  147. __u8 responder_resources;
  148. __u8 initiator_depth;
  149. __u8 target_ack_delay;
  150. __u8 failover_accepted;
  151. __u8 flow_control;
  152. __u8 rnr_retry_count;
  153. __u8 srq;
  154. };
  155. struct ib_ucm_info {
  156. __u32 id;
  157. __u32 status;
  158. __u64 info;
  159. __u64 data;
  160. __u8 info_len;
  161. __u8 data_len;
  162. __u8 reserved[2];
  163. };
  164. struct ib_ucm_mra {
  165. __u64 data;
  166. __u32 id;
  167. __u8 len;
  168. __u8 timeout;
  169. __u8 reserved[2];
  170. };
  171. struct ib_ucm_lap {
  172. __u64 path;
  173. __u64 data;
  174. __u32 id;
  175. __u8 len;
  176. __u8 reserved[3];
  177. };
  178. struct ib_ucm_sidr_req {
  179. __u32 id;
  180. __u32 timeout;
  181. __be64 sid;
  182. __u64 data;
  183. __u64 path;
  184. __u16 pkey;
  185. __u8 len;
  186. __u8 max_cm_retries;
  187. };
  188. struct ib_ucm_sidr_rep {
  189. __u32 id;
  190. __u32 qpn;
  191. __u32 qkey;
  192. __u32 status;
  193. __u64 info;
  194. __u64 data;
  195. __u8 info_len;
  196. __u8 data_len;
  197. __u8 reserved[2];
  198. };
  199. /*
  200. * event notification ABI structures.
  201. */
  202. struct ib_ucm_event_get {
  203. __u64 response;
  204. __u64 data;
  205. __u64 info;
  206. __u8 data_len;
  207. __u8 info_len;
  208. __u8 reserved[2];
  209. };
  210. struct ib_ucm_req_event_resp {
  211. __u32 listen_id;
  212. /* device */
  213. /* port */
  214. struct ib_ucm_path_rec primary_path;
  215. struct ib_ucm_path_rec alternate_path;
  216. __be64 remote_ca_guid;
  217. __u32 remote_qkey;
  218. __u32 remote_qpn;
  219. __u32 qp_type;
  220. __u32 starting_psn;
  221. __u8 responder_resources;
  222. __u8 initiator_depth;
  223. __u8 local_cm_response_timeout;
  224. __u8 flow_control;
  225. __u8 remote_cm_response_timeout;
  226. __u8 retry_count;
  227. __u8 rnr_retry_count;
  228. __u8 srq;
  229. };
  230. struct ib_ucm_rep_event_resp {
  231. __be64 remote_ca_guid;
  232. __u32 remote_qkey;
  233. __u32 remote_qpn;
  234. __u32 starting_psn;
  235. __u8 responder_resources;
  236. __u8 initiator_depth;
  237. __u8 target_ack_delay;
  238. __u8 failover_accepted;
  239. __u8 flow_control;
  240. __u8 rnr_retry_count;
  241. __u8 srq;
  242. __u8 reserved[1];
  243. };
  244. struct ib_ucm_rej_event_resp {
  245. __u32 reason;
  246. /* ari in ib_ucm_event_get info field. */
  247. };
  248. struct ib_ucm_mra_event_resp {
  249. __u8 timeout;
  250. __u8 reserved[3];
  251. };
  252. struct ib_ucm_lap_event_resp {
  253. struct ib_ucm_path_rec path;
  254. };
  255. struct ib_ucm_apr_event_resp {
  256. __u32 status;
  257. /* apr info in ib_ucm_event_get info field. */
  258. };
  259. struct ib_ucm_sidr_req_event_resp {
  260. __u32 listen_id;
  261. /* device */
  262. /* port */
  263. __u16 pkey;
  264. __u8 reserved[2];
  265. };
  266. struct ib_ucm_sidr_rep_event_resp {
  267. __u32 status;
  268. __u32 qkey;
  269. __u32 qpn;
  270. /* info in ib_ucm_event_get info field. */
  271. };
  272. #define IB_UCM_PRES_DATA 0x01
  273. #define IB_UCM_PRES_INFO 0x02
  274. #define IB_UCM_PRES_PRIMARY 0x04
  275. #define IB_UCM_PRES_ALTERNATE 0x08
  276. struct ib_ucm_event_resp {
  277. __u32 id;
  278. __u32 event;
  279. __u32 present;
  280. union {
  281. struct ib_ucm_req_event_resp req_resp;
  282. struct ib_ucm_rep_event_resp rep_resp;
  283. struct ib_ucm_rej_event_resp rej_resp;
  284. struct ib_ucm_mra_event_resp mra_resp;
  285. struct ib_ucm_lap_event_resp lap_resp;
  286. struct ib_ucm_apr_event_resp apr_resp;
  287. struct ib_ucm_sidr_req_event_resp sidr_req_resp;
  288. struct ib_ucm_sidr_rep_event_resp sidr_rep_resp;
  289. __u32 send_status;
  290. } u;
  291. };
  292. #endif /* IB_USER_CM_H */