ib_user_verbs.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948
  1. /*
  2. * Copyright (c) 2005 Topspin Communications. All rights reserved.
  3. * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved.
  4. * Copyright (c) 2005 PathScale, Inc. All rights reserved.
  5. * Copyright (c) 2006 Mellanox Technologies. All rights reserved.
  6. *
  7. * This software is available to you under a choice of one of two
  8. * licenses. You may choose to be licensed under the terms of the GNU
  9. * General Public License (GPL) Version 2, available from the file
  10. * COPYING in the main directory of this source tree, or the
  11. * OpenIB.org BSD license below:
  12. *
  13. * Redistribution and use in source and binary forms, with or
  14. * without modification, are permitted provided that the following
  15. * conditions are met:
  16. *
  17. * - Redistributions of source code must retain the above
  18. * copyright notice, this list of conditions and the following
  19. * disclaimer.
  20. *
  21. * - Redistributions in binary form must reproduce the above
  22. * copyright notice, this list of conditions and the following
  23. * disclaimer in the documentation and/or other materials
  24. * provided with the distribution.
  25. *
  26. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  27. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  28. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  29. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  30. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  31. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  32. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  33. * SOFTWARE.
  34. */
  35. #ifndef IB_USER_VERBS_H
  36. #define IB_USER_VERBS_H
  37. #include <linux/types.h>
  38. /*
  39. * Increment this value if any changes that break userspace ABI
  40. * compatibility are made.
  41. */
  42. #define IB_USER_VERBS_ABI_VERSION 6
  43. #define IB_USER_VERBS_CMD_THRESHOLD 50
  44. enum {
  45. IB_USER_VERBS_CMD_GET_CONTEXT,
  46. IB_USER_VERBS_CMD_QUERY_DEVICE,
  47. IB_USER_VERBS_CMD_QUERY_PORT,
  48. IB_USER_VERBS_CMD_ALLOC_PD,
  49. IB_USER_VERBS_CMD_DEALLOC_PD,
  50. IB_USER_VERBS_CMD_CREATE_AH,
  51. IB_USER_VERBS_CMD_MODIFY_AH,
  52. IB_USER_VERBS_CMD_QUERY_AH,
  53. IB_USER_VERBS_CMD_DESTROY_AH,
  54. IB_USER_VERBS_CMD_REG_MR,
  55. IB_USER_VERBS_CMD_REG_SMR,
  56. IB_USER_VERBS_CMD_REREG_MR,
  57. IB_USER_VERBS_CMD_QUERY_MR,
  58. IB_USER_VERBS_CMD_DEREG_MR,
  59. IB_USER_VERBS_CMD_ALLOC_MW,
  60. IB_USER_VERBS_CMD_BIND_MW,
  61. IB_USER_VERBS_CMD_DEALLOC_MW,
  62. IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL,
  63. IB_USER_VERBS_CMD_CREATE_CQ,
  64. IB_USER_VERBS_CMD_RESIZE_CQ,
  65. IB_USER_VERBS_CMD_DESTROY_CQ,
  66. IB_USER_VERBS_CMD_POLL_CQ,
  67. IB_USER_VERBS_CMD_PEEK_CQ,
  68. IB_USER_VERBS_CMD_REQ_NOTIFY_CQ,
  69. IB_USER_VERBS_CMD_CREATE_QP,
  70. IB_USER_VERBS_CMD_QUERY_QP,
  71. IB_USER_VERBS_CMD_MODIFY_QP,
  72. IB_USER_VERBS_CMD_DESTROY_QP,
  73. IB_USER_VERBS_CMD_POST_SEND,
  74. IB_USER_VERBS_CMD_POST_RECV,
  75. IB_USER_VERBS_CMD_ATTACH_MCAST,
  76. IB_USER_VERBS_CMD_DETACH_MCAST,
  77. IB_USER_VERBS_CMD_CREATE_SRQ,
  78. IB_USER_VERBS_CMD_MODIFY_SRQ,
  79. IB_USER_VERBS_CMD_QUERY_SRQ,
  80. IB_USER_VERBS_CMD_DESTROY_SRQ,
  81. IB_USER_VERBS_CMD_POST_SRQ_RECV,
  82. IB_USER_VERBS_CMD_OPEN_XRCD,
  83. IB_USER_VERBS_CMD_CLOSE_XRCD,
  84. IB_USER_VERBS_CMD_CREATE_XSRQ,
  85. IB_USER_VERBS_CMD_OPEN_QP,
  86. };
  87. enum {
  88. IB_USER_VERBS_EX_CMD_QUERY_DEVICE = IB_USER_VERBS_CMD_QUERY_DEVICE,
  89. IB_USER_VERBS_EX_CMD_CREATE_CQ = IB_USER_VERBS_CMD_CREATE_CQ,
  90. IB_USER_VERBS_EX_CMD_CREATE_QP = IB_USER_VERBS_CMD_CREATE_QP,
  91. IB_USER_VERBS_EX_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD,
  92. IB_USER_VERBS_EX_CMD_DESTROY_FLOW,
  93. };
  94. /*
  95. * Make sure that all structs defined in this file remain laid out so
  96. * that they pack the same way on 32-bit and 64-bit architectures (to
  97. * avoid incompatibility between 32-bit userspace and 64-bit kernels).
  98. * Specifically:
  99. * - Do not use pointer types -- pass pointers in __u64 instead.
  100. * - Make sure that any structure larger than 4 bytes is padded to a
  101. * multiple of 8 bytes. Otherwise the structure size will be
  102. * different between 32-bit and 64-bit architectures.
  103. */
  104. struct ib_uverbs_async_event_desc {
  105. __u64 element;
  106. __u32 event_type; /* enum ib_event_type */
  107. __u32 reserved;
  108. };
  109. struct ib_uverbs_comp_event_desc {
  110. __u64 cq_handle;
  111. };
  112. /*
  113. * All commands from userspace should start with a __u32 command field
  114. * followed by __u16 in_words and out_words fields (which give the
  115. * length of the command block and response buffer if any in 32-bit
  116. * words). The kernel driver will read these fields first and read
  117. * the rest of the command struct based on these value.
  118. */
  119. #define IB_USER_VERBS_CMD_COMMAND_MASK 0xff
  120. #define IB_USER_VERBS_CMD_FLAGS_MASK 0xff000000u
  121. #define IB_USER_VERBS_CMD_FLAGS_SHIFT 24
  122. #define IB_USER_VERBS_CMD_FLAG_EXTENDED 0x80
  123. struct ib_uverbs_cmd_hdr {
  124. __u32 command;
  125. __u16 in_words;
  126. __u16 out_words;
  127. };
  128. struct ib_uverbs_ex_cmd_hdr {
  129. __u64 response;
  130. __u16 provider_in_words;
  131. __u16 provider_out_words;
  132. __u32 cmd_hdr_reserved;
  133. };
  134. struct ib_uverbs_get_context {
  135. __u64 response;
  136. __u64 driver_data[0];
  137. };
  138. struct ib_uverbs_get_context_resp {
  139. __u32 async_fd;
  140. __u32 num_comp_vectors;
  141. };
  142. struct ib_uverbs_query_device {
  143. __u64 response;
  144. __u64 driver_data[0];
  145. };
  146. struct ib_uverbs_query_device_resp {
  147. __u64 fw_ver;
  148. __be64 node_guid;
  149. __be64 sys_image_guid;
  150. __u64 max_mr_size;
  151. __u64 page_size_cap;
  152. __u32 vendor_id;
  153. __u32 vendor_part_id;
  154. __u32 hw_ver;
  155. __u32 max_qp;
  156. __u32 max_qp_wr;
  157. __u32 device_cap_flags;
  158. __u32 max_sge;
  159. __u32 max_sge_rd;
  160. __u32 max_cq;
  161. __u32 max_cqe;
  162. __u32 max_mr;
  163. __u32 max_pd;
  164. __u32 max_qp_rd_atom;
  165. __u32 max_ee_rd_atom;
  166. __u32 max_res_rd_atom;
  167. __u32 max_qp_init_rd_atom;
  168. __u32 max_ee_init_rd_atom;
  169. __u32 atomic_cap;
  170. __u32 max_ee;
  171. __u32 max_rdd;
  172. __u32 max_mw;
  173. __u32 max_raw_ipv6_qp;
  174. __u32 max_raw_ethy_qp;
  175. __u32 max_mcast_grp;
  176. __u32 max_mcast_qp_attach;
  177. __u32 max_total_mcast_qp_attach;
  178. __u32 max_ah;
  179. __u32 max_fmr;
  180. __u32 max_map_per_fmr;
  181. __u32 max_srq;
  182. __u32 max_srq_wr;
  183. __u32 max_srq_sge;
  184. __u16 max_pkeys;
  185. __u8 local_ca_ack_delay;
  186. __u8 phys_port_cnt;
  187. __u8 reserved[4];
  188. };
  189. struct ib_uverbs_ex_query_device {
  190. __u32 comp_mask;
  191. __u32 reserved;
  192. };
  193. struct ib_uverbs_odp_caps {
  194. __u64 general_caps;
  195. struct {
  196. __u32 rc_odp_caps;
  197. __u32 uc_odp_caps;
  198. __u32 ud_odp_caps;
  199. } per_transport_caps;
  200. __u32 reserved;
  201. };
  202. struct ib_uverbs_ex_query_device_resp {
  203. struct ib_uverbs_query_device_resp base;
  204. __u32 comp_mask;
  205. __u32 response_length;
  206. struct ib_uverbs_odp_caps odp_caps;
  207. __u64 timestamp_mask;
  208. __u64 hca_core_clock; /* in KHZ */
  209. };
  210. struct ib_uverbs_query_port {
  211. __u64 response;
  212. __u8 port_num;
  213. __u8 reserved[7];
  214. __u64 driver_data[0];
  215. };
  216. struct ib_uverbs_query_port_resp {
  217. __u32 port_cap_flags;
  218. __u32 max_msg_sz;
  219. __u32 bad_pkey_cntr;
  220. __u32 qkey_viol_cntr;
  221. __u32 gid_tbl_len;
  222. __u16 pkey_tbl_len;
  223. __u16 lid;
  224. __u16 sm_lid;
  225. __u8 state;
  226. __u8 max_mtu;
  227. __u8 active_mtu;
  228. __u8 lmc;
  229. __u8 max_vl_num;
  230. __u8 sm_sl;
  231. __u8 subnet_timeout;
  232. __u8 init_type_reply;
  233. __u8 active_width;
  234. __u8 active_speed;
  235. __u8 phys_state;
  236. __u8 link_layer;
  237. __u8 reserved[2];
  238. };
  239. struct ib_uverbs_alloc_pd {
  240. __u64 response;
  241. __u64 driver_data[0];
  242. };
  243. struct ib_uverbs_alloc_pd_resp {
  244. __u32 pd_handle;
  245. };
  246. struct ib_uverbs_dealloc_pd {
  247. __u32 pd_handle;
  248. };
  249. struct ib_uverbs_open_xrcd {
  250. __u64 response;
  251. __u32 fd;
  252. __u32 oflags;
  253. __u64 driver_data[0];
  254. };
  255. struct ib_uverbs_open_xrcd_resp {
  256. __u32 xrcd_handle;
  257. };
  258. struct ib_uverbs_close_xrcd {
  259. __u32 xrcd_handle;
  260. };
  261. struct ib_uverbs_reg_mr {
  262. __u64 response;
  263. __u64 start;
  264. __u64 length;
  265. __u64 hca_va;
  266. __u32 pd_handle;
  267. __u32 access_flags;
  268. __u64 driver_data[0];
  269. };
  270. struct ib_uverbs_reg_mr_resp {
  271. __u32 mr_handle;
  272. __u32 lkey;
  273. __u32 rkey;
  274. };
  275. struct ib_uverbs_rereg_mr {
  276. __u64 response;
  277. __u32 mr_handle;
  278. __u32 flags;
  279. __u64 start;
  280. __u64 length;
  281. __u64 hca_va;
  282. __u32 pd_handle;
  283. __u32 access_flags;
  284. };
  285. struct ib_uverbs_rereg_mr_resp {
  286. __u32 lkey;
  287. __u32 rkey;
  288. };
  289. struct ib_uverbs_dereg_mr {
  290. __u32 mr_handle;
  291. };
  292. struct ib_uverbs_alloc_mw {
  293. __u64 response;
  294. __u32 pd_handle;
  295. __u8 mw_type;
  296. __u8 reserved[3];
  297. };
  298. struct ib_uverbs_alloc_mw_resp {
  299. __u32 mw_handle;
  300. __u32 rkey;
  301. };
  302. struct ib_uverbs_dealloc_mw {
  303. __u32 mw_handle;
  304. };
  305. struct ib_uverbs_create_comp_channel {
  306. __u64 response;
  307. };
  308. struct ib_uverbs_create_comp_channel_resp {
  309. __u32 fd;
  310. };
  311. struct ib_uverbs_create_cq {
  312. __u64 response;
  313. __u64 user_handle;
  314. __u32 cqe;
  315. __u32 comp_vector;
  316. __s32 comp_channel;
  317. __u32 reserved;
  318. __u64 driver_data[0];
  319. };
  320. struct ib_uverbs_ex_create_cq {
  321. __u64 user_handle;
  322. __u32 cqe;
  323. __u32 comp_vector;
  324. __s32 comp_channel;
  325. __u32 comp_mask;
  326. __u32 flags;
  327. __u32 reserved;
  328. };
  329. struct ib_uverbs_create_cq_resp {
  330. __u32 cq_handle;
  331. __u32 cqe;
  332. };
  333. struct ib_uverbs_ex_create_cq_resp {
  334. struct ib_uverbs_create_cq_resp base;
  335. __u32 comp_mask;
  336. __u32 response_length;
  337. };
  338. struct ib_uverbs_resize_cq {
  339. __u64 response;
  340. __u32 cq_handle;
  341. __u32 cqe;
  342. __u64 driver_data[0];
  343. };
  344. struct ib_uverbs_resize_cq_resp {
  345. __u32 cqe;
  346. __u32 reserved;
  347. __u64 driver_data[0];
  348. };
  349. struct ib_uverbs_poll_cq {
  350. __u64 response;
  351. __u32 cq_handle;
  352. __u32 ne;
  353. };
  354. struct ib_uverbs_wc {
  355. __u64 wr_id;
  356. __u32 status;
  357. __u32 opcode;
  358. __u32 vendor_err;
  359. __u32 byte_len;
  360. union {
  361. __u32 imm_data;
  362. __u32 invalidate_rkey;
  363. } ex;
  364. __u32 qp_num;
  365. __u32 src_qp;
  366. __u32 wc_flags;
  367. __u16 pkey_index;
  368. __u16 slid;
  369. __u8 sl;
  370. __u8 dlid_path_bits;
  371. __u8 port_num;
  372. __u8 reserved;
  373. };
  374. struct ib_uverbs_poll_cq_resp {
  375. __u32 count;
  376. __u32 reserved;
  377. struct ib_uverbs_wc wc[0];
  378. };
  379. struct ib_uverbs_req_notify_cq {
  380. __u32 cq_handle;
  381. __u32 solicited_only;
  382. };
  383. struct ib_uverbs_destroy_cq {
  384. __u64 response;
  385. __u32 cq_handle;
  386. __u32 reserved;
  387. };
  388. struct ib_uverbs_destroy_cq_resp {
  389. __u32 comp_events_reported;
  390. __u32 async_events_reported;
  391. };
  392. struct ib_uverbs_global_route {
  393. __u8 dgid[16];
  394. __u32 flow_label;
  395. __u8 sgid_index;
  396. __u8 hop_limit;
  397. __u8 traffic_class;
  398. __u8 reserved;
  399. };
  400. struct ib_uverbs_ah_attr {
  401. struct ib_uverbs_global_route grh;
  402. __u16 dlid;
  403. __u8 sl;
  404. __u8 src_path_bits;
  405. __u8 static_rate;
  406. __u8 is_global;
  407. __u8 port_num;
  408. __u8 reserved;
  409. };
  410. struct ib_uverbs_qp_attr {
  411. __u32 qp_attr_mask;
  412. __u32 qp_state;
  413. __u32 cur_qp_state;
  414. __u32 path_mtu;
  415. __u32 path_mig_state;
  416. __u32 qkey;
  417. __u32 rq_psn;
  418. __u32 sq_psn;
  419. __u32 dest_qp_num;
  420. __u32 qp_access_flags;
  421. struct ib_uverbs_ah_attr ah_attr;
  422. struct ib_uverbs_ah_attr alt_ah_attr;
  423. /* ib_qp_cap */
  424. __u32 max_send_wr;
  425. __u32 max_recv_wr;
  426. __u32 max_send_sge;
  427. __u32 max_recv_sge;
  428. __u32 max_inline_data;
  429. __u16 pkey_index;
  430. __u16 alt_pkey_index;
  431. __u8 en_sqd_async_notify;
  432. __u8 sq_draining;
  433. __u8 max_rd_atomic;
  434. __u8 max_dest_rd_atomic;
  435. __u8 min_rnr_timer;
  436. __u8 port_num;
  437. __u8 timeout;
  438. __u8 retry_cnt;
  439. __u8 rnr_retry;
  440. __u8 alt_port_num;
  441. __u8 alt_timeout;
  442. __u8 reserved[5];
  443. };
  444. struct ib_uverbs_create_qp {
  445. __u64 response;
  446. __u64 user_handle;
  447. __u32 pd_handle;
  448. __u32 send_cq_handle;
  449. __u32 recv_cq_handle;
  450. __u32 srq_handle;
  451. __u32 max_send_wr;
  452. __u32 max_recv_wr;
  453. __u32 max_send_sge;
  454. __u32 max_recv_sge;
  455. __u32 max_inline_data;
  456. __u8 sq_sig_all;
  457. __u8 qp_type;
  458. __u8 is_srq;
  459. __u8 reserved;
  460. __u64 driver_data[0];
  461. };
  462. struct ib_uverbs_ex_create_qp {
  463. __u64 user_handle;
  464. __u32 pd_handle;
  465. __u32 send_cq_handle;
  466. __u32 recv_cq_handle;
  467. __u32 srq_handle;
  468. __u32 max_send_wr;
  469. __u32 max_recv_wr;
  470. __u32 max_send_sge;
  471. __u32 max_recv_sge;
  472. __u32 max_inline_data;
  473. __u8 sq_sig_all;
  474. __u8 qp_type;
  475. __u8 is_srq;
  476. __u8 reserved;
  477. __u32 comp_mask;
  478. __u32 create_flags;
  479. };
  480. struct ib_uverbs_open_qp {
  481. __u64 response;
  482. __u64 user_handle;
  483. __u32 pd_handle;
  484. __u32 qpn;
  485. __u8 qp_type;
  486. __u8 reserved[7];
  487. __u64 driver_data[0];
  488. };
  489. /* also used for open response */
  490. struct ib_uverbs_create_qp_resp {
  491. __u32 qp_handle;
  492. __u32 qpn;
  493. __u32 max_send_wr;
  494. __u32 max_recv_wr;
  495. __u32 max_send_sge;
  496. __u32 max_recv_sge;
  497. __u32 max_inline_data;
  498. __u32 reserved;
  499. };
  500. struct ib_uverbs_ex_create_qp_resp {
  501. struct ib_uverbs_create_qp_resp base;
  502. __u32 comp_mask;
  503. __u32 response_length;
  504. };
  505. /*
  506. * This struct needs to remain a multiple of 8 bytes to keep the
  507. * alignment of the modify QP parameters.
  508. */
  509. struct ib_uverbs_qp_dest {
  510. __u8 dgid[16];
  511. __u32 flow_label;
  512. __u16 dlid;
  513. __u16 reserved;
  514. __u8 sgid_index;
  515. __u8 hop_limit;
  516. __u8 traffic_class;
  517. __u8 sl;
  518. __u8 src_path_bits;
  519. __u8 static_rate;
  520. __u8 is_global;
  521. __u8 port_num;
  522. };
  523. struct ib_uverbs_query_qp {
  524. __u64 response;
  525. __u32 qp_handle;
  526. __u32 attr_mask;
  527. __u64 driver_data[0];
  528. };
  529. struct ib_uverbs_query_qp_resp {
  530. struct ib_uverbs_qp_dest dest;
  531. struct ib_uverbs_qp_dest alt_dest;
  532. __u32 max_send_wr;
  533. __u32 max_recv_wr;
  534. __u32 max_send_sge;
  535. __u32 max_recv_sge;
  536. __u32 max_inline_data;
  537. __u32 qkey;
  538. __u32 rq_psn;
  539. __u32 sq_psn;
  540. __u32 dest_qp_num;
  541. __u32 qp_access_flags;
  542. __u16 pkey_index;
  543. __u16 alt_pkey_index;
  544. __u8 qp_state;
  545. __u8 cur_qp_state;
  546. __u8 path_mtu;
  547. __u8 path_mig_state;
  548. __u8 sq_draining;
  549. __u8 max_rd_atomic;
  550. __u8 max_dest_rd_atomic;
  551. __u8 min_rnr_timer;
  552. __u8 port_num;
  553. __u8 timeout;
  554. __u8 retry_cnt;
  555. __u8 rnr_retry;
  556. __u8 alt_port_num;
  557. __u8 alt_timeout;
  558. __u8 sq_sig_all;
  559. __u8 reserved[5];
  560. __u64 driver_data[0];
  561. };
  562. struct ib_uverbs_modify_qp {
  563. struct ib_uverbs_qp_dest dest;
  564. struct ib_uverbs_qp_dest alt_dest;
  565. __u32 qp_handle;
  566. __u32 attr_mask;
  567. __u32 qkey;
  568. __u32 rq_psn;
  569. __u32 sq_psn;
  570. __u32 dest_qp_num;
  571. __u32 qp_access_flags;
  572. __u16 pkey_index;
  573. __u16 alt_pkey_index;
  574. __u8 qp_state;
  575. __u8 cur_qp_state;
  576. __u8 path_mtu;
  577. __u8 path_mig_state;
  578. __u8 en_sqd_async_notify;
  579. __u8 max_rd_atomic;
  580. __u8 max_dest_rd_atomic;
  581. __u8 min_rnr_timer;
  582. __u8 port_num;
  583. __u8 timeout;
  584. __u8 retry_cnt;
  585. __u8 rnr_retry;
  586. __u8 alt_port_num;
  587. __u8 alt_timeout;
  588. __u8 reserved[2];
  589. __u64 driver_data[0];
  590. };
  591. struct ib_uverbs_modify_qp_resp {
  592. };
  593. struct ib_uverbs_destroy_qp {
  594. __u64 response;
  595. __u32 qp_handle;
  596. __u32 reserved;
  597. };
  598. struct ib_uverbs_destroy_qp_resp {
  599. __u32 events_reported;
  600. };
  601. /*
  602. * The ib_uverbs_sge structure isn't used anywhere, since we assume
  603. * the ib_sge structure is packed the same way on 32-bit and 64-bit
  604. * architectures in both kernel and user space. It's just here to
  605. * document the ABI.
  606. */
  607. struct ib_uverbs_sge {
  608. __u64 addr;
  609. __u32 length;
  610. __u32 lkey;
  611. };
  612. struct ib_uverbs_send_wr {
  613. __u64 wr_id;
  614. __u32 num_sge;
  615. __u32 opcode;
  616. __u32 send_flags;
  617. union {
  618. __u32 imm_data;
  619. __u32 invalidate_rkey;
  620. } ex;
  621. union {
  622. struct {
  623. __u64 remote_addr;
  624. __u32 rkey;
  625. __u32 reserved;
  626. } rdma;
  627. struct {
  628. __u64 remote_addr;
  629. __u64 compare_add;
  630. __u64 swap;
  631. __u32 rkey;
  632. __u32 reserved;
  633. } atomic;
  634. struct {
  635. __u32 ah;
  636. __u32 remote_qpn;
  637. __u32 remote_qkey;
  638. __u32 reserved;
  639. } ud;
  640. } wr;
  641. };
  642. struct ib_uverbs_post_send {
  643. __u64 response;
  644. __u32 qp_handle;
  645. __u32 wr_count;
  646. __u32 sge_count;
  647. __u32 wqe_size;
  648. struct ib_uverbs_send_wr send_wr[0];
  649. };
  650. struct ib_uverbs_post_send_resp {
  651. __u32 bad_wr;
  652. };
  653. struct ib_uverbs_recv_wr {
  654. __u64 wr_id;
  655. __u32 num_sge;
  656. __u32 reserved;
  657. };
  658. struct ib_uverbs_post_recv {
  659. __u64 response;
  660. __u32 qp_handle;
  661. __u32 wr_count;
  662. __u32 sge_count;
  663. __u32 wqe_size;
  664. struct ib_uverbs_recv_wr recv_wr[0];
  665. };
  666. struct ib_uverbs_post_recv_resp {
  667. __u32 bad_wr;
  668. };
  669. struct ib_uverbs_post_srq_recv {
  670. __u64 response;
  671. __u32 srq_handle;
  672. __u32 wr_count;
  673. __u32 sge_count;
  674. __u32 wqe_size;
  675. struct ib_uverbs_recv_wr recv[0];
  676. };
  677. struct ib_uverbs_post_srq_recv_resp {
  678. __u32 bad_wr;
  679. };
  680. struct ib_uverbs_create_ah {
  681. __u64 response;
  682. __u64 user_handle;
  683. __u32 pd_handle;
  684. __u32 reserved;
  685. struct ib_uverbs_ah_attr attr;
  686. };
  687. struct ib_uverbs_create_ah_resp {
  688. __u32 ah_handle;
  689. };
  690. struct ib_uverbs_destroy_ah {
  691. __u32 ah_handle;
  692. };
  693. struct ib_uverbs_attach_mcast {
  694. __u8 gid[16];
  695. __u32 qp_handle;
  696. __u16 mlid;
  697. __u16 reserved;
  698. __u64 driver_data[0];
  699. };
  700. struct ib_uverbs_detach_mcast {
  701. __u8 gid[16];
  702. __u32 qp_handle;
  703. __u16 mlid;
  704. __u16 reserved;
  705. __u64 driver_data[0];
  706. };
  707. struct ib_uverbs_flow_spec_hdr {
  708. __u32 type;
  709. __u16 size;
  710. __u16 reserved;
  711. /* followed by flow_spec */
  712. __u64 flow_spec_data[0];
  713. };
  714. struct ib_uverbs_flow_eth_filter {
  715. __u8 dst_mac[6];
  716. __u8 src_mac[6];
  717. __be16 ether_type;
  718. __be16 vlan_tag;
  719. };
  720. struct ib_uverbs_flow_spec_eth {
  721. union {
  722. struct ib_uverbs_flow_spec_hdr hdr;
  723. struct {
  724. __u32 type;
  725. __u16 size;
  726. __u16 reserved;
  727. };
  728. };
  729. struct ib_uverbs_flow_eth_filter val;
  730. struct ib_uverbs_flow_eth_filter mask;
  731. };
  732. struct ib_uverbs_flow_ipv4_filter {
  733. __be32 src_ip;
  734. __be32 dst_ip;
  735. };
  736. struct ib_uverbs_flow_spec_ipv4 {
  737. union {
  738. struct ib_uverbs_flow_spec_hdr hdr;
  739. struct {
  740. __u32 type;
  741. __u16 size;
  742. __u16 reserved;
  743. };
  744. };
  745. struct ib_uverbs_flow_ipv4_filter val;
  746. struct ib_uverbs_flow_ipv4_filter mask;
  747. };
  748. struct ib_uverbs_flow_tcp_udp_filter {
  749. __be16 dst_port;
  750. __be16 src_port;
  751. };
  752. struct ib_uverbs_flow_spec_tcp_udp {
  753. union {
  754. struct ib_uverbs_flow_spec_hdr hdr;
  755. struct {
  756. __u32 type;
  757. __u16 size;
  758. __u16 reserved;
  759. };
  760. };
  761. struct ib_uverbs_flow_tcp_udp_filter val;
  762. struct ib_uverbs_flow_tcp_udp_filter mask;
  763. };
  764. struct ib_uverbs_flow_attr {
  765. __u32 type;
  766. __u16 size;
  767. __u16 priority;
  768. __u8 num_of_specs;
  769. __u8 reserved[2];
  770. __u8 port;
  771. __u32 flags;
  772. /* Following are the optional layers according to user request
  773. * struct ib_flow_spec_xxx
  774. * struct ib_flow_spec_yyy
  775. */
  776. struct ib_uverbs_flow_spec_hdr flow_specs[0];
  777. };
  778. struct ib_uverbs_create_flow {
  779. __u32 comp_mask;
  780. __u32 qp_handle;
  781. struct ib_uverbs_flow_attr flow_attr;
  782. };
  783. struct ib_uverbs_create_flow_resp {
  784. __u32 comp_mask;
  785. __u32 flow_handle;
  786. };
  787. struct ib_uverbs_destroy_flow {
  788. __u32 comp_mask;
  789. __u32 flow_handle;
  790. };
  791. struct ib_uverbs_create_srq {
  792. __u64 response;
  793. __u64 user_handle;
  794. __u32 pd_handle;
  795. __u32 max_wr;
  796. __u32 max_sge;
  797. __u32 srq_limit;
  798. __u64 driver_data[0];
  799. };
  800. struct ib_uverbs_create_xsrq {
  801. __u64 response;
  802. __u64 user_handle;
  803. __u32 srq_type;
  804. __u32 pd_handle;
  805. __u32 max_wr;
  806. __u32 max_sge;
  807. __u32 srq_limit;
  808. __u32 reserved;
  809. __u32 xrcd_handle;
  810. __u32 cq_handle;
  811. __u64 driver_data[0];
  812. };
  813. struct ib_uverbs_create_srq_resp {
  814. __u32 srq_handle;
  815. __u32 max_wr;
  816. __u32 max_sge;
  817. __u32 srqn;
  818. };
  819. struct ib_uverbs_modify_srq {
  820. __u32 srq_handle;
  821. __u32 attr_mask;
  822. __u32 max_wr;
  823. __u32 srq_limit;
  824. __u64 driver_data[0];
  825. };
  826. struct ib_uverbs_query_srq {
  827. __u64 response;
  828. __u32 srq_handle;
  829. __u32 reserved;
  830. __u64 driver_data[0];
  831. };
  832. struct ib_uverbs_query_srq_resp {
  833. __u32 max_wr;
  834. __u32 max_sge;
  835. __u32 srq_limit;
  836. __u32 reserved;
  837. };
  838. struct ib_uverbs_destroy_srq {
  839. __u64 response;
  840. __u32 srq_handle;
  841. __u32 reserved;
  842. };
  843. struct ib_uverbs_destroy_srq_resp {
  844. __u32 events_reported;
  845. };
  846. #endif /* IB_USER_VERBS_H */