ib_user_verbs.h 17 KB

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