ib_user_verbs.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864
  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_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD,
  89. IB_USER_VERBS_EX_CMD_DESTROY_FLOW
  90. };
  91. /*
  92. * Make sure that all structs defined in this file remain laid out so
  93. * that they pack the same way on 32-bit and 64-bit architectures (to
  94. * avoid incompatibility between 32-bit userspace and 64-bit kernels).
  95. * Specifically:
  96. * - Do not use pointer types -- pass pointers in __u64 instead.
  97. * - Make sure that any structure larger than 4 bytes is padded to a
  98. * multiple of 8 bytes. Otherwise the structure size will be
  99. * different between 32-bit and 64-bit architectures.
  100. */
  101. struct ib_uverbs_async_event_desc {
  102. __u64 element;
  103. __u32 event_type; /* enum ib_event_type */
  104. __u32 reserved;
  105. };
  106. struct ib_uverbs_comp_event_desc {
  107. __u64 cq_handle;
  108. };
  109. /*
  110. * All commands from userspace should start with a __u32 command field
  111. * followed by __u16 in_words and out_words fields (which give the
  112. * length of the command block and response buffer if any in 32-bit
  113. * words). The kernel driver will read these fields first and read
  114. * the rest of the command struct based on these value.
  115. */
  116. #define IB_USER_VERBS_CMD_COMMAND_MASK 0xff
  117. #define IB_USER_VERBS_CMD_FLAGS_MASK 0xff000000u
  118. #define IB_USER_VERBS_CMD_FLAGS_SHIFT 24
  119. #define IB_USER_VERBS_CMD_FLAG_EXTENDED 0x80
  120. struct ib_uverbs_cmd_hdr {
  121. __u32 command;
  122. __u16 in_words;
  123. __u16 out_words;
  124. };
  125. struct ib_uverbs_ex_cmd_hdr {
  126. __u64 response;
  127. __u16 provider_in_words;
  128. __u16 provider_out_words;
  129. __u32 cmd_hdr_reserved;
  130. };
  131. struct ib_uverbs_get_context {
  132. __u64 response;
  133. __u64 driver_data[0];
  134. };
  135. struct ib_uverbs_get_context_resp {
  136. __u32 async_fd;
  137. __u32 num_comp_vectors;
  138. };
  139. struct ib_uverbs_query_device {
  140. __u64 response;
  141. __u64 driver_data[0];
  142. };
  143. struct ib_uverbs_query_device_resp {
  144. __u64 fw_ver;
  145. __be64 node_guid;
  146. __be64 sys_image_guid;
  147. __u64 max_mr_size;
  148. __u64 page_size_cap;
  149. __u32 vendor_id;
  150. __u32 vendor_part_id;
  151. __u32 hw_ver;
  152. __u32 max_qp;
  153. __u32 max_qp_wr;
  154. __u32 device_cap_flags;
  155. __u32 max_sge;
  156. __u32 max_sge_rd;
  157. __u32 max_cq;
  158. __u32 max_cqe;
  159. __u32 max_mr;
  160. __u32 max_pd;
  161. __u32 max_qp_rd_atom;
  162. __u32 max_ee_rd_atom;
  163. __u32 max_res_rd_atom;
  164. __u32 max_qp_init_rd_atom;
  165. __u32 max_ee_init_rd_atom;
  166. __u32 atomic_cap;
  167. __u32 max_ee;
  168. __u32 max_rdd;
  169. __u32 max_mw;
  170. __u32 max_raw_ipv6_qp;
  171. __u32 max_raw_ethy_qp;
  172. __u32 max_mcast_grp;
  173. __u32 max_mcast_qp_attach;
  174. __u32 max_total_mcast_qp_attach;
  175. __u32 max_ah;
  176. __u32 max_fmr;
  177. __u32 max_map_per_fmr;
  178. __u32 max_srq;
  179. __u32 max_srq_wr;
  180. __u32 max_srq_sge;
  181. __u16 max_pkeys;
  182. __u8 local_ca_ack_delay;
  183. __u8 phys_port_cnt;
  184. __u8 reserved[4];
  185. };
  186. struct ib_uverbs_query_port {
  187. __u64 response;
  188. __u8 port_num;
  189. __u8 reserved[7];
  190. __u64 driver_data[0];
  191. };
  192. struct ib_uverbs_query_port_resp {
  193. __u32 port_cap_flags;
  194. __u32 max_msg_sz;
  195. __u32 bad_pkey_cntr;
  196. __u32 qkey_viol_cntr;
  197. __u32 gid_tbl_len;
  198. __u16 pkey_tbl_len;
  199. __u16 lid;
  200. __u16 sm_lid;
  201. __u8 state;
  202. __u8 max_mtu;
  203. __u8 active_mtu;
  204. __u8 lmc;
  205. __u8 max_vl_num;
  206. __u8 sm_sl;
  207. __u8 subnet_timeout;
  208. __u8 init_type_reply;
  209. __u8 active_width;
  210. __u8 active_speed;
  211. __u8 phys_state;
  212. __u8 link_layer;
  213. __u8 reserved[2];
  214. };
  215. struct ib_uverbs_alloc_pd {
  216. __u64 response;
  217. __u64 driver_data[0];
  218. };
  219. struct ib_uverbs_alloc_pd_resp {
  220. __u32 pd_handle;
  221. };
  222. struct ib_uverbs_dealloc_pd {
  223. __u32 pd_handle;
  224. };
  225. struct ib_uverbs_open_xrcd {
  226. __u64 response;
  227. __u32 fd;
  228. __u32 oflags;
  229. __u64 driver_data[0];
  230. };
  231. struct ib_uverbs_open_xrcd_resp {
  232. __u32 xrcd_handle;
  233. };
  234. struct ib_uverbs_close_xrcd {
  235. __u32 xrcd_handle;
  236. };
  237. struct ib_uverbs_reg_mr {
  238. __u64 response;
  239. __u64 start;
  240. __u64 length;
  241. __u64 hca_va;
  242. __u32 pd_handle;
  243. __u32 access_flags;
  244. __u64 driver_data[0];
  245. };
  246. struct ib_uverbs_reg_mr_resp {
  247. __u32 mr_handle;
  248. __u32 lkey;
  249. __u32 rkey;
  250. };
  251. struct ib_uverbs_dereg_mr {
  252. __u32 mr_handle;
  253. };
  254. struct ib_uverbs_alloc_mw {
  255. __u64 response;
  256. __u32 pd_handle;
  257. __u8 mw_type;
  258. __u8 reserved[3];
  259. };
  260. struct ib_uverbs_alloc_mw_resp {
  261. __u32 mw_handle;
  262. __u32 rkey;
  263. };
  264. struct ib_uverbs_dealloc_mw {
  265. __u32 mw_handle;
  266. };
  267. struct ib_uverbs_create_comp_channel {
  268. __u64 response;
  269. };
  270. struct ib_uverbs_create_comp_channel_resp {
  271. __u32 fd;
  272. };
  273. struct ib_uverbs_create_cq {
  274. __u64 response;
  275. __u64 user_handle;
  276. __u32 cqe;
  277. __u32 comp_vector;
  278. __s32 comp_channel;
  279. __u32 reserved;
  280. __u64 driver_data[0];
  281. };
  282. struct ib_uverbs_create_cq_resp {
  283. __u32 cq_handle;
  284. __u32 cqe;
  285. };
  286. struct ib_uverbs_resize_cq {
  287. __u64 response;
  288. __u32 cq_handle;
  289. __u32 cqe;
  290. __u64 driver_data[0];
  291. };
  292. struct ib_uverbs_resize_cq_resp {
  293. __u32 cqe;
  294. __u32 reserved;
  295. __u64 driver_data[0];
  296. };
  297. struct ib_uverbs_poll_cq {
  298. __u64 response;
  299. __u32 cq_handle;
  300. __u32 ne;
  301. };
  302. struct ib_uverbs_wc {
  303. __u64 wr_id;
  304. __u32 status;
  305. __u32 opcode;
  306. __u32 vendor_err;
  307. __u32 byte_len;
  308. union {
  309. __u32 imm_data;
  310. __u32 invalidate_rkey;
  311. } ex;
  312. __u32 qp_num;
  313. __u32 src_qp;
  314. __u32 wc_flags;
  315. __u16 pkey_index;
  316. __u16 slid;
  317. __u8 sl;
  318. __u8 dlid_path_bits;
  319. __u8 port_num;
  320. __u8 reserved;
  321. };
  322. struct ib_uverbs_poll_cq_resp {
  323. __u32 count;
  324. __u32 reserved;
  325. struct ib_uverbs_wc wc[0];
  326. };
  327. struct ib_uverbs_req_notify_cq {
  328. __u32 cq_handle;
  329. __u32 solicited_only;
  330. };
  331. struct ib_uverbs_destroy_cq {
  332. __u64 response;
  333. __u32 cq_handle;
  334. __u32 reserved;
  335. };
  336. struct ib_uverbs_destroy_cq_resp {
  337. __u32 comp_events_reported;
  338. __u32 async_events_reported;
  339. };
  340. struct ib_uverbs_global_route {
  341. __u8 dgid[16];
  342. __u32 flow_label;
  343. __u8 sgid_index;
  344. __u8 hop_limit;
  345. __u8 traffic_class;
  346. __u8 reserved;
  347. };
  348. struct ib_uverbs_ah_attr {
  349. struct ib_uverbs_global_route grh;
  350. __u16 dlid;
  351. __u8 sl;
  352. __u8 src_path_bits;
  353. __u8 static_rate;
  354. __u8 is_global;
  355. __u8 port_num;
  356. __u8 reserved;
  357. };
  358. struct ib_uverbs_qp_attr {
  359. __u32 qp_attr_mask;
  360. __u32 qp_state;
  361. __u32 cur_qp_state;
  362. __u32 path_mtu;
  363. __u32 path_mig_state;
  364. __u32 qkey;
  365. __u32 rq_psn;
  366. __u32 sq_psn;
  367. __u32 dest_qp_num;
  368. __u32 qp_access_flags;
  369. struct ib_uverbs_ah_attr ah_attr;
  370. struct ib_uverbs_ah_attr alt_ah_attr;
  371. /* ib_qp_cap */
  372. __u32 max_send_wr;
  373. __u32 max_recv_wr;
  374. __u32 max_send_sge;
  375. __u32 max_recv_sge;
  376. __u32 max_inline_data;
  377. __u16 pkey_index;
  378. __u16 alt_pkey_index;
  379. __u8 en_sqd_async_notify;
  380. __u8 sq_draining;
  381. __u8 max_rd_atomic;
  382. __u8 max_dest_rd_atomic;
  383. __u8 min_rnr_timer;
  384. __u8 port_num;
  385. __u8 timeout;
  386. __u8 retry_cnt;
  387. __u8 rnr_retry;
  388. __u8 alt_port_num;
  389. __u8 alt_timeout;
  390. __u8 reserved[5];
  391. };
  392. struct ib_uverbs_create_qp {
  393. __u64 response;
  394. __u64 user_handle;
  395. __u32 pd_handle;
  396. __u32 send_cq_handle;
  397. __u32 recv_cq_handle;
  398. __u32 srq_handle;
  399. __u32 max_send_wr;
  400. __u32 max_recv_wr;
  401. __u32 max_send_sge;
  402. __u32 max_recv_sge;
  403. __u32 max_inline_data;
  404. __u8 sq_sig_all;
  405. __u8 qp_type;
  406. __u8 is_srq;
  407. __u8 reserved;
  408. __u64 driver_data[0];
  409. };
  410. struct ib_uverbs_open_qp {
  411. __u64 response;
  412. __u64 user_handle;
  413. __u32 pd_handle;
  414. __u32 qpn;
  415. __u8 qp_type;
  416. __u8 reserved[7];
  417. __u64 driver_data[0];
  418. };
  419. /* also used for open response */
  420. struct ib_uverbs_create_qp_resp {
  421. __u32 qp_handle;
  422. __u32 qpn;
  423. __u32 max_send_wr;
  424. __u32 max_recv_wr;
  425. __u32 max_send_sge;
  426. __u32 max_recv_sge;
  427. __u32 max_inline_data;
  428. __u32 reserved;
  429. };
  430. /*
  431. * This struct needs to remain a multiple of 8 bytes to keep the
  432. * alignment of the modify QP parameters.
  433. */
  434. struct ib_uverbs_qp_dest {
  435. __u8 dgid[16];
  436. __u32 flow_label;
  437. __u16 dlid;
  438. __u16 reserved;
  439. __u8 sgid_index;
  440. __u8 hop_limit;
  441. __u8 traffic_class;
  442. __u8 sl;
  443. __u8 src_path_bits;
  444. __u8 static_rate;
  445. __u8 is_global;
  446. __u8 port_num;
  447. };
  448. struct ib_uverbs_query_qp {
  449. __u64 response;
  450. __u32 qp_handle;
  451. __u32 attr_mask;
  452. __u64 driver_data[0];
  453. };
  454. struct ib_uverbs_query_qp_resp {
  455. struct ib_uverbs_qp_dest dest;
  456. struct ib_uverbs_qp_dest alt_dest;
  457. __u32 max_send_wr;
  458. __u32 max_recv_wr;
  459. __u32 max_send_sge;
  460. __u32 max_recv_sge;
  461. __u32 max_inline_data;
  462. __u32 qkey;
  463. __u32 rq_psn;
  464. __u32 sq_psn;
  465. __u32 dest_qp_num;
  466. __u32 qp_access_flags;
  467. __u16 pkey_index;
  468. __u16 alt_pkey_index;
  469. __u8 qp_state;
  470. __u8 cur_qp_state;
  471. __u8 path_mtu;
  472. __u8 path_mig_state;
  473. __u8 sq_draining;
  474. __u8 max_rd_atomic;
  475. __u8 max_dest_rd_atomic;
  476. __u8 min_rnr_timer;
  477. __u8 port_num;
  478. __u8 timeout;
  479. __u8 retry_cnt;
  480. __u8 rnr_retry;
  481. __u8 alt_port_num;
  482. __u8 alt_timeout;
  483. __u8 sq_sig_all;
  484. __u8 reserved[5];
  485. __u64 driver_data[0];
  486. };
  487. struct ib_uverbs_modify_qp {
  488. struct ib_uverbs_qp_dest dest;
  489. struct ib_uverbs_qp_dest alt_dest;
  490. __u32 qp_handle;
  491. __u32 attr_mask;
  492. __u32 qkey;
  493. __u32 rq_psn;
  494. __u32 sq_psn;
  495. __u32 dest_qp_num;
  496. __u32 qp_access_flags;
  497. __u16 pkey_index;
  498. __u16 alt_pkey_index;
  499. __u8 qp_state;
  500. __u8 cur_qp_state;
  501. __u8 path_mtu;
  502. __u8 path_mig_state;
  503. __u8 en_sqd_async_notify;
  504. __u8 max_rd_atomic;
  505. __u8 max_dest_rd_atomic;
  506. __u8 min_rnr_timer;
  507. __u8 port_num;
  508. __u8 timeout;
  509. __u8 retry_cnt;
  510. __u8 rnr_retry;
  511. __u8 alt_port_num;
  512. __u8 alt_timeout;
  513. __u8 reserved[2];
  514. __u64 driver_data[0];
  515. };
  516. struct ib_uverbs_modify_qp_resp {
  517. };
  518. struct ib_uverbs_destroy_qp {
  519. __u64 response;
  520. __u32 qp_handle;
  521. __u32 reserved;
  522. };
  523. struct ib_uverbs_destroy_qp_resp {
  524. __u32 events_reported;
  525. };
  526. /*
  527. * The ib_uverbs_sge structure isn't used anywhere, since we assume
  528. * the ib_sge structure is packed the same way on 32-bit and 64-bit
  529. * architectures in both kernel and user space. It's just here to
  530. * document the ABI.
  531. */
  532. struct ib_uverbs_sge {
  533. __u64 addr;
  534. __u32 length;
  535. __u32 lkey;
  536. };
  537. struct ib_uverbs_send_wr {
  538. __u64 wr_id;
  539. __u32 num_sge;
  540. __u32 opcode;
  541. __u32 send_flags;
  542. union {
  543. __u32 imm_data;
  544. __u32 invalidate_rkey;
  545. } ex;
  546. union {
  547. struct {
  548. __u64 remote_addr;
  549. __u32 rkey;
  550. __u32 reserved;
  551. } rdma;
  552. struct {
  553. __u64 remote_addr;
  554. __u64 compare_add;
  555. __u64 swap;
  556. __u32 rkey;
  557. __u32 reserved;
  558. } atomic;
  559. struct {
  560. __u32 ah;
  561. __u32 remote_qpn;
  562. __u32 remote_qkey;
  563. __u32 reserved;
  564. } ud;
  565. } wr;
  566. };
  567. struct ib_uverbs_post_send {
  568. __u64 response;
  569. __u32 qp_handle;
  570. __u32 wr_count;
  571. __u32 sge_count;
  572. __u32 wqe_size;
  573. struct ib_uverbs_send_wr send_wr[0];
  574. };
  575. struct ib_uverbs_post_send_resp {
  576. __u32 bad_wr;
  577. };
  578. struct ib_uverbs_recv_wr {
  579. __u64 wr_id;
  580. __u32 num_sge;
  581. __u32 reserved;
  582. };
  583. struct ib_uverbs_post_recv {
  584. __u64 response;
  585. __u32 qp_handle;
  586. __u32 wr_count;
  587. __u32 sge_count;
  588. __u32 wqe_size;
  589. struct ib_uverbs_recv_wr recv_wr[0];
  590. };
  591. struct ib_uverbs_post_recv_resp {
  592. __u32 bad_wr;
  593. };
  594. struct ib_uverbs_post_srq_recv {
  595. __u64 response;
  596. __u32 srq_handle;
  597. __u32 wr_count;
  598. __u32 sge_count;
  599. __u32 wqe_size;
  600. struct ib_uverbs_recv_wr recv[0];
  601. };
  602. struct ib_uverbs_post_srq_recv_resp {
  603. __u32 bad_wr;
  604. };
  605. struct ib_uverbs_create_ah {
  606. __u64 response;
  607. __u64 user_handle;
  608. __u32 pd_handle;
  609. __u32 reserved;
  610. struct ib_uverbs_ah_attr attr;
  611. };
  612. struct ib_uverbs_create_ah_resp {
  613. __u32 ah_handle;
  614. };
  615. struct ib_uverbs_destroy_ah {
  616. __u32 ah_handle;
  617. };
  618. struct ib_uverbs_attach_mcast {
  619. __u8 gid[16];
  620. __u32 qp_handle;
  621. __u16 mlid;
  622. __u16 reserved;
  623. __u64 driver_data[0];
  624. };
  625. struct ib_uverbs_detach_mcast {
  626. __u8 gid[16];
  627. __u32 qp_handle;
  628. __u16 mlid;
  629. __u16 reserved;
  630. __u64 driver_data[0];
  631. };
  632. struct ib_uverbs_flow_spec_hdr {
  633. __u32 type;
  634. __u16 size;
  635. __u16 reserved;
  636. /* followed by flow_spec */
  637. __u64 flow_spec_data[0];
  638. };
  639. struct ib_uverbs_flow_eth_filter {
  640. __u8 dst_mac[6];
  641. __u8 src_mac[6];
  642. __be16 ether_type;
  643. __be16 vlan_tag;
  644. };
  645. struct ib_uverbs_flow_spec_eth {
  646. union {
  647. struct ib_uverbs_flow_spec_hdr hdr;
  648. struct {
  649. __u32 type;
  650. __u16 size;
  651. __u16 reserved;
  652. };
  653. };
  654. struct ib_uverbs_flow_eth_filter val;
  655. struct ib_uverbs_flow_eth_filter mask;
  656. };
  657. struct ib_uverbs_flow_ipv4_filter {
  658. __be32 src_ip;
  659. __be32 dst_ip;
  660. };
  661. struct ib_uverbs_flow_spec_ipv4 {
  662. union {
  663. struct ib_uverbs_flow_spec_hdr hdr;
  664. struct {
  665. __u32 type;
  666. __u16 size;
  667. __u16 reserved;
  668. };
  669. };
  670. struct ib_uverbs_flow_ipv4_filter val;
  671. struct ib_uverbs_flow_ipv4_filter mask;
  672. };
  673. struct ib_uverbs_flow_tcp_udp_filter {
  674. __be16 dst_port;
  675. __be16 src_port;
  676. };
  677. struct ib_uverbs_flow_spec_tcp_udp {
  678. union {
  679. struct ib_uverbs_flow_spec_hdr hdr;
  680. struct {
  681. __u32 type;
  682. __u16 size;
  683. __u16 reserved;
  684. };
  685. };
  686. struct ib_uverbs_flow_tcp_udp_filter val;
  687. struct ib_uverbs_flow_tcp_udp_filter mask;
  688. };
  689. struct ib_uverbs_flow_attr {
  690. __u32 type;
  691. __u16 size;
  692. __u16 priority;
  693. __u8 num_of_specs;
  694. __u8 reserved[2];
  695. __u8 port;
  696. __u32 flags;
  697. /* Following are the optional layers according to user request
  698. * struct ib_flow_spec_xxx
  699. * struct ib_flow_spec_yyy
  700. */
  701. struct ib_uverbs_flow_spec_hdr flow_specs[0];
  702. };
  703. struct ib_uverbs_create_flow {
  704. __u32 comp_mask;
  705. __u32 qp_handle;
  706. struct ib_uverbs_flow_attr flow_attr;
  707. };
  708. struct ib_uverbs_create_flow_resp {
  709. __u32 comp_mask;
  710. __u32 flow_handle;
  711. };
  712. struct ib_uverbs_destroy_flow {
  713. __u32 comp_mask;
  714. __u32 flow_handle;
  715. };
  716. struct ib_uverbs_create_srq {
  717. __u64 response;
  718. __u64 user_handle;
  719. __u32 pd_handle;
  720. __u32 max_wr;
  721. __u32 max_sge;
  722. __u32 srq_limit;
  723. __u64 driver_data[0];
  724. };
  725. struct ib_uverbs_create_xsrq {
  726. __u64 response;
  727. __u64 user_handle;
  728. __u32 srq_type;
  729. __u32 pd_handle;
  730. __u32 max_wr;
  731. __u32 max_sge;
  732. __u32 srq_limit;
  733. __u32 reserved;
  734. __u32 xrcd_handle;
  735. __u32 cq_handle;
  736. __u64 driver_data[0];
  737. };
  738. struct ib_uverbs_create_srq_resp {
  739. __u32 srq_handle;
  740. __u32 max_wr;
  741. __u32 max_sge;
  742. __u32 srqn;
  743. };
  744. struct ib_uverbs_modify_srq {
  745. __u32 srq_handle;
  746. __u32 attr_mask;
  747. __u32 max_wr;
  748. __u32 srq_limit;
  749. __u64 driver_data[0];
  750. };
  751. struct ib_uverbs_query_srq {
  752. __u64 response;
  753. __u32 srq_handle;
  754. __u32 reserved;
  755. __u64 driver_data[0];
  756. };
  757. struct ib_uverbs_query_srq_resp {
  758. __u32 max_wr;
  759. __u32 max_sge;
  760. __u32 srq_limit;
  761. __u32 reserved;
  762. };
  763. struct ib_uverbs_destroy_srq {
  764. __u64 response;
  765. __u32 srq_handle;
  766. __u32 reserved;
  767. };
  768. struct ib_uverbs_destroy_srq_resp {
  769. __u32 events_reported;
  770. };
  771. #endif /* IB_USER_VERBS_H */