ib_user_verbs.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880
  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_rereg_mr {
  252. __u64 response;
  253. __u32 mr_handle;
  254. __u32 flags;
  255. __u64 start;
  256. __u64 length;
  257. __u64 hca_va;
  258. __u32 pd_handle;
  259. __u32 access_flags;
  260. };
  261. struct ib_uverbs_rereg_mr_resp {
  262. __u32 lkey;
  263. __u32 rkey;
  264. };
  265. struct ib_uverbs_dereg_mr {
  266. __u32 mr_handle;
  267. };
  268. struct ib_uverbs_alloc_mw {
  269. __u64 response;
  270. __u32 pd_handle;
  271. __u8 mw_type;
  272. __u8 reserved[3];
  273. };
  274. struct ib_uverbs_alloc_mw_resp {
  275. __u32 mw_handle;
  276. __u32 rkey;
  277. };
  278. struct ib_uverbs_dealloc_mw {
  279. __u32 mw_handle;
  280. };
  281. struct ib_uverbs_create_comp_channel {
  282. __u64 response;
  283. };
  284. struct ib_uverbs_create_comp_channel_resp {
  285. __u32 fd;
  286. };
  287. struct ib_uverbs_create_cq {
  288. __u64 response;
  289. __u64 user_handle;
  290. __u32 cqe;
  291. __u32 comp_vector;
  292. __s32 comp_channel;
  293. __u32 reserved;
  294. __u64 driver_data[0];
  295. };
  296. struct ib_uverbs_create_cq_resp {
  297. __u32 cq_handle;
  298. __u32 cqe;
  299. };
  300. struct ib_uverbs_resize_cq {
  301. __u64 response;
  302. __u32 cq_handle;
  303. __u32 cqe;
  304. __u64 driver_data[0];
  305. };
  306. struct ib_uverbs_resize_cq_resp {
  307. __u32 cqe;
  308. __u32 reserved;
  309. __u64 driver_data[0];
  310. };
  311. struct ib_uverbs_poll_cq {
  312. __u64 response;
  313. __u32 cq_handle;
  314. __u32 ne;
  315. };
  316. struct ib_uverbs_wc {
  317. __u64 wr_id;
  318. __u32 status;
  319. __u32 opcode;
  320. __u32 vendor_err;
  321. __u32 byte_len;
  322. union {
  323. __u32 imm_data;
  324. __u32 invalidate_rkey;
  325. } ex;
  326. __u32 qp_num;
  327. __u32 src_qp;
  328. __u32 wc_flags;
  329. __u16 pkey_index;
  330. __u16 slid;
  331. __u8 sl;
  332. __u8 dlid_path_bits;
  333. __u8 port_num;
  334. __u8 reserved;
  335. };
  336. struct ib_uverbs_poll_cq_resp {
  337. __u32 count;
  338. __u32 reserved;
  339. struct ib_uverbs_wc wc[0];
  340. };
  341. struct ib_uverbs_req_notify_cq {
  342. __u32 cq_handle;
  343. __u32 solicited_only;
  344. };
  345. struct ib_uverbs_destroy_cq {
  346. __u64 response;
  347. __u32 cq_handle;
  348. __u32 reserved;
  349. };
  350. struct ib_uverbs_destroy_cq_resp {
  351. __u32 comp_events_reported;
  352. __u32 async_events_reported;
  353. };
  354. struct ib_uverbs_global_route {
  355. __u8 dgid[16];
  356. __u32 flow_label;
  357. __u8 sgid_index;
  358. __u8 hop_limit;
  359. __u8 traffic_class;
  360. __u8 reserved;
  361. };
  362. struct ib_uverbs_ah_attr {
  363. struct ib_uverbs_global_route grh;
  364. __u16 dlid;
  365. __u8 sl;
  366. __u8 src_path_bits;
  367. __u8 static_rate;
  368. __u8 is_global;
  369. __u8 port_num;
  370. __u8 reserved;
  371. };
  372. struct ib_uverbs_qp_attr {
  373. __u32 qp_attr_mask;
  374. __u32 qp_state;
  375. __u32 cur_qp_state;
  376. __u32 path_mtu;
  377. __u32 path_mig_state;
  378. __u32 qkey;
  379. __u32 rq_psn;
  380. __u32 sq_psn;
  381. __u32 dest_qp_num;
  382. __u32 qp_access_flags;
  383. struct ib_uverbs_ah_attr ah_attr;
  384. struct ib_uverbs_ah_attr alt_ah_attr;
  385. /* ib_qp_cap */
  386. __u32 max_send_wr;
  387. __u32 max_recv_wr;
  388. __u32 max_send_sge;
  389. __u32 max_recv_sge;
  390. __u32 max_inline_data;
  391. __u16 pkey_index;
  392. __u16 alt_pkey_index;
  393. __u8 en_sqd_async_notify;
  394. __u8 sq_draining;
  395. __u8 max_rd_atomic;
  396. __u8 max_dest_rd_atomic;
  397. __u8 min_rnr_timer;
  398. __u8 port_num;
  399. __u8 timeout;
  400. __u8 retry_cnt;
  401. __u8 rnr_retry;
  402. __u8 alt_port_num;
  403. __u8 alt_timeout;
  404. __u8 reserved[5];
  405. };
  406. struct ib_uverbs_create_qp {
  407. __u64 response;
  408. __u64 user_handle;
  409. __u32 pd_handle;
  410. __u32 send_cq_handle;
  411. __u32 recv_cq_handle;
  412. __u32 srq_handle;
  413. __u32 max_send_wr;
  414. __u32 max_recv_wr;
  415. __u32 max_send_sge;
  416. __u32 max_recv_sge;
  417. __u32 max_inline_data;
  418. __u8 sq_sig_all;
  419. __u8 qp_type;
  420. __u8 is_srq;
  421. __u8 reserved;
  422. __u64 driver_data[0];
  423. };
  424. struct ib_uverbs_open_qp {
  425. __u64 response;
  426. __u64 user_handle;
  427. __u32 pd_handle;
  428. __u32 qpn;
  429. __u8 qp_type;
  430. __u8 reserved[7];
  431. __u64 driver_data[0];
  432. };
  433. /* also used for open response */
  434. struct ib_uverbs_create_qp_resp {
  435. __u32 qp_handle;
  436. __u32 qpn;
  437. __u32 max_send_wr;
  438. __u32 max_recv_wr;
  439. __u32 max_send_sge;
  440. __u32 max_recv_sge;
  441. __u32 max_inline_data;
  442. __u32 reserved;
  443. };
  444. /*
  445. * This struct needs to remain a multiple of 8 bytes to keep the
  446. * alignment of the modify QP parameters.
  447. */
  448. struct ib_uverbs_qp_dest {
  449. __u8 dgid[16];
  450. __u32 flow_label;
  451. __u16 dlid;
  452. __u16 reserved;
  453. __u8 sgid_index;
  454. __u8 hop_limit;
  455. __u8 traffic_class;
  456. __u8 sl;
  457. __u8 src_path_bits;
  458. __u8 static_rate;
  459. __u8 is_global;
  460. __u8 port_num;
  461. };
  462. struct ib_uverbs_query_qp {
  463. __u64 response;
  464. __u32 qp_handle;
  465. __u32 attr_mask;
  466. __u64 driver_data[0];
  467. };
  468. struct ib_uverbs_query_qp_resp {
  469. struct ib_uverbs_qp_dest dest;
  470. struct ib_uverbs_qp_dest alt_dest;
  471. __u32 max_send_wr;
  472. __u32 max_recv_wr;
  473. __u32 max_send_sge;
  474. __u32 max_recv_sge;
  475. __u32 max_inline_data;
  476. __u32 qkey;
  477. __u32 rq_psn;
  478. __u32 sq_psn;
  479. __u32 dest_qp_num;
  480. __u32 qp_access_flags;
  481. __u16 pkey_index;
  482. __u16 alt_pkey_index;
  483. __u8 qp_state;
  484. __u8 cur_qp_state;
  485. __u8 path_mtu;
  486. __u8 path_mig_state;
  487. __u8 sq_draining;
  488. __u8 max_rd_atomic;
  489. __u8 max_dest_rd_atomic;
  490. __u8 min_rnr_timer;
  491. __u8 port_num;
  492. __u8 timeout;
  493. __u8 retry_cnt;
  494. __u8 rnr_retry;
  495. __u8 alt_port_num;
  496. __u8 alt_timeout;
  497. __u8 sq_sig_all;
  498. __u8 reserved[5];
  499. __u64 driver_data[0];
  500. };
  501. struct ib_uverbs_modify_qp {
  502. struct ib_uverbs_qp_dest dest;
  503. struct ib_uverbs_qp_dest alt_dest;
  504. __u32 qp_handle;
  505. __u32 attr_mask;
  506. __u32 qkey;
  507. __u32 rq_psn;
  508. __u32 sq_psn;
  509. __u32 dest_qp_num;
  510. __u32 qp_access_flags;
  511. __u16 pkey_index;
  512. __u16 alt_pkey_index;
  513. __u8 qp_state;
  514. __u8 cur_qp_state;
  515. __u8 path_mtu;
  516. __u8 path_mig_state;
  517. __u8 en_sqd_async_notify;
  518. __u8 max_rd_atomic;
  519. __u8 max_dest_rd_atomic;
  520. __u8 min_rnr_timer;
  521. __u8 port_num;
  522. __u8 timeout;
  523. __u8 retry_cnt;
  524. __u8 rnr_retry;
  525. __u8 alt_port_num;
  526. __u8 alt_timeout;
  527. __u8 reserved[2];
  528. __u64 driver_data[0];
  529. };
  530. struct ib_uverbs_modify_qp_resp {
  531. };
  532. struct ib_uverbs_destroy_qp {
  533. __u64 response;
  534. __u32 qp_handle;
  535. __u32 reserved;
  536. };
  537. struct ib_uverbs_destroy_qp_resp {
  538. __u32 events_reported;
  539. };
  540. /*
  541. * The ib_uverbs_sge structure isn't used anywhere, since we assume
  542. * the ib_sge structure is packed the same way on 32-bit and 64-bit
  543. * architectures in both kernel and user space. It's just here to
  544. * document the ABI.
  545. */
  546. struct ib_uverbs_sge {
  547. __u64 addr;
  548. __u32 length;
  549. __u32 lkey;
  550. };
  551. struct ib_uverbs_send_wr {
  552. __u64 wr_id;
  553. __u32 num_sge;
  554. __u32 opcode;
  555. __u32 send_flags;
  556. union {
  557. __u32 imm_data;
  558. __u32 invalidate_rkey;
  559. } ex;
  560. union {
  561. struct {
  562. __u64 remote_addr;
  563. __u32 rkey;
  564. __u32 reserved;
  565. } rdma;
  566. struct {
  567. __u64 remote_addr;
  568. __u64 compare_add;
  569. __u64 swap;
  570. __u32 rkey;
  571. __u32 reserved;
  572. } atomic;
  573. struct {
  574. __u32 ah;
  575. __u32 remote_qpn;
  576. __u32 remote_qkey;
  577. __u32 reserved;
  578. } ud;
  579. } wr;
  580. };
  581. struct ib_uverbs_post_send {
  582. __u64 response;
  583. __u32 qp_handle;
  584. __u32 wr_count;
  585. __u32 sge_count;
  586. __u32 wqe_size;
  587. struct ib_uverbs_send_wr send_wr[0];
  588. };
  589. struct ib_uverbs_post_send_resp {
  590. __u32 bad_wr;
  591. };
  592. struct ib_uverbs_recv_wr {
  593. __u64 wr_id;
  594. __u32 num_sge;
  595. __u32 reserved;
  596. };
  597. struct ib_uverbs_post_recv {
  598. __u64 response;
  599. __u32 qp_handle;
  600. __u32 wr_count;
  601. __u32 sge_count;
  602. __u32 wqe_size;
  603. struct ib_uverbs_recv_wr recv_wr[0];
  604. };
  605. struct ib_uverbs_post_recv_resp {
  606. __u32 bad_wr;
  607. };
  608. struct ib_uverbs_post_srq_recv {
  609. __u64 response;
  610. __u32 srq_handle;
  611. __u32 wr_count;
  612. __u32 sge_count;
  613. __u32 wqe_size;
  614. struct ib_uverbs_recv_wr recv[0];
  615. };
  616. struct ib_uverbs_post_srq_recv_resp {
  617. __u32 bad_wr;
  618. };
  619. struct ib_uverbs_create_ah {
  620. __u64 response;
  621. __u64 user_handle;
  622. __u32 pd_handle;
  623. __u32 reserved;
  624. struct ib_uverbs_ah_attr attr;
  625. };
  626. struct ib_uverbs_create_ah_resp {
  627. __u32 ah_handle;
  628. };
  629. struct ib_uverbs_destroy_ah {
  630. __u32 ah_handle;
  631. };
  632. struct ib_uverbs_attach_mcast {
  633. __u8 gid[16];
  634. __u32 qp_handle;
  635. __u16 mlid;
  636. __u16 reserved;
  637. __u64 driver_data[0];
  638. };
  639. struct ib_uverbs_detach_mcast {
  640. __u8 gid[16];
  641. __u32 qp_handle;
  642. __u16 mlid;
  643. __u16 reserved;
  644. __u64 driver_data[0];
  645. };
  646. struct ib_uverbs_flow_spec_hdr {
  647. __u32 type;
  648. __u16 size;
  649. __u16 reserved;
  650. /* followed by flow_spec */
  651. __u64 flow_spec_data[0];
  652. };
  653. struct ib_uverbs_flow_eth_filter {
  654. __u8 dst_mac[6];
  655. __u8 src_mac[6];
  656. __be16 ether_type;
  657. __be16 vlan_tag;
  658. };
  659. struct ib_uverbs_flow_spec_eth {
  660. union {
  661. struct ib_uverbs_flow_spec_hdr hdr;
  662. struct {
  663. __u32 type;
  664. __u16 size;
  665. __u16 reserved;
  666. };
  667. };
  668. struct ib_uverbs_flow_eth_filter val;
  669. struct ib_uverbs_flow_eth_filter mask;
  670. };
  671. struct ib_uverbs_flow_ipv4_filter {
  672. __be32 src_ip;
  673. __be32 dst_ip;
  674. };
  675. struct ib_uverbs_flow_spec_ipv4 {
  676. union {
  677. struct ib_uverbs_flow_spec_hdr hdr;
  678. struct {
  679. __u32 type;
  680. __u16 size;
  681. __u16 reserved;
  682. };
  683. };
  684. struct ib_uverbs_flow_ipv4_filter val;
  685. struct ib_uverbs_flow_ipv4_filter mask;
  686. };
  687. struct ib_uverbs_flow_tcp_udp_filter {
  688. __be16 dst_port;
  689. __be16 src_port;
  690. };
  691. struct ib_uverbs_flow_spec_tcp_udp {
  692. union {
  693. struct ib_uverbs_flow_spec_hdr hdr;
  694. struct {
  695. __u32 type;
  696. __u16 size;
  697. __u16 reserved;
  698. };
  699. };
  700. struct ib_uverbs_flow_tcp_udp_filter val;
  701. struct ib_uverbs_flow_tcp_udp_filter mask;
  702. };
  703. struct ib_uverbs_flow_attr {
  704. __u32 type;
  705. __u16 size;
  706. __u16 priority;
  707. __u8 num_of_specs;
  708. __u8 reserved[2];
  709. __u8 port;
  710. __u32 flags;
  711. /* Following are the optional layers according to user request
  712. * struct ib_flow_spec_xxx
  713. * struct ib_flow_spec_yyy
  714. */
  715. struct ib_uverbs_flow_spec_hdr flow_specs[0];
  716. };
  717. struct ib_uverbs_create_flow {
  718. __u32 comp_mask;
  719. __u32 qp_handle;
  720. struct ib_uverbs_flow_attr flow_attr;
  721. };
  722. struct ib_uverbs_create_flow_resp {
  723. __u32 comp_mask;
  724. __u32 flow_handle;
  725. };
  726. struct ib_uverbs_destroy_flow {
  727. __u32 comp_mask;
  728. __u32 flow_handle;
  729. };
  730. struct ib_uverbs_create_srq {
  731. __u64 response;
  732. __u64 user_handle;
  733. __u32 pd_handle;
  734. __u32 max_wr;
  735. __u32 max_sge;
  736. __u32 srq_limit;
  737. __u64 driver_data[0];
  738. };
  739. struct ib_uverbs_create_xsrq {
  740. __u64 response;
  741. __u64 user_handle;
  742. __u32 srq_type;
  743. __u32 pd_handle;
  744. __u32 max_wr;
  745. __u32 max_sge;
  746. __u32 srq_limit;
  747. __u32 reserved;
  748. __u32 xrcd_handle;
  749. __u32 cq_handle;
  750. __u64 driver_data[0];
  751. };
  752. struct ib_uverbs_create_srq_resp {
  753. __u32 srq_handle;
  754. __u32 max_wr;
  755. __u32 max_sge;
  756. __u32 srqn;
  757. };
  758. struct ib_uverbs_modify_srq {
  759. __u32 srq_handle;
  760. __u32 attr_mask;
  761. __u32 max_wr;
  762. __u32 srq_limit;
  763. __u64 driver_data[0];
  764. };
  765. struct ib_uverbs_query_srq {
  766. __u64 response;
  767. __u32 srq_handle;
  768. __u32 reserved;
  769. __u64 driver_data[0];
  770. };
  771. struct ib_uverbs_query_srq_resp {
  772. __u32 max_wr;
  773. __u32 max_sge;
  774. __u32 srq_limit;
  775. __u32 reserved;
  776. };
  777. struct ib_uverbs_destroy_srq {
  778. __u64 response;
  779. __u32 srq_handle;
  780. __u32 reserved;
  781. };
  782. struct ib_uverbs_destroy_srq_resp {
  783. __u32 events_reported;
  784. };
  785. #endif /* IB_USER_VERBS_H */