ib_user_verbs.h 17 KB

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