ib_user_verbs.h 17 KB

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