ib_user_verbs.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922
  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_CQ = IB_USER_VERBS_CMD_CREATE_CQ,
  90. IB_USER_VERBS_EX_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD,
  91. IB_USER_VERBS_EX_CMD_DESTROY_FLOW,
  92. };
  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. struct ib_uverbs_ex_cmd_hdr {
  128. __u64 response;
  129. __u16 provider_in_words;
  130. __u16 provider_out_words;
  131. __u32 cmd_hdr_reserved;
  132. };
  133. struct ib_uverbs_get_context {
  134. __u64 response;
  135. __u64 driver_data[0];
  136. };
  137. struct ib_uverbs_get_context_resp {
  138. __u32 async_fd;
  139. __u32 num_comp_vectors;
  140. };
  141. struct ib_uverbs_query_device {
  142. __u64 response;
  143. __u64 driver_data[0];
  144. };
  145. struct ib_uverbs_query_device_resp {
  146. __u64 fw_ver;
  147. __be64 node_guid;
  148. __be64 sys_image_guid;
  149. __u64 max_mr_size;
  150. __u64 page_size_cap;
  151. __u32 vendor_id;
  152. __u32 vendor_part_id;
  153. __u32 hw_ver;
  154. __u32 max_qp;
  155. __u32 max_qp_wr;
  156. __u32 device_cap_flags;
  157. __u32 max_sge;
  158. __u32 max_sge_rd;
  159. __u32 max_cq;
  160. __u32 max_cqe;
  161. __u32 max_mr;
  162. __u32 max_pd;
  163. __u32 max_qp_rd_atom;
  164. __u32 max_ee_rd_atom;
  165. __u32 max_res_rd_atom;
  166. __u32 max_qp_init_rd_atom;
  167. __u32 max_ee_init_rd_atom;
  168. __u32 atomic_cap;
  169. __u32 max_ee;
  170. __u32 max_rdd;
  171. __u32 max_mw;
  172. __u32 max_raw_ipv6_qp;
  173. __u32 max_raw_ethy_qp;
  174. __u32 max_mcast_grp;
  175. __u32 max_mcast_qp_attach;
  176. __u32 max_total_mcast_qp_attach;
  177. __u32 max_ah;
  178. __u32 max_fmr;
  179. __u32 max_map_per_fmr;
  180. __u32 max_srq;
  181. __u32 max_srq_wr;
  182. __u32 max_srq_sge;
  183. __u16 max_pkeys;
  184. __u8 local_ca_ack_delay;
  185. __u8 phys_port_cnt;
  186. __u8 reserved[4];
  187. };
  188. struct ib_uverbs_ex_query_device {
  189. __u32 comp_mask;
  190. __u32 reserved;
  191. };
  192. struct ib_uverbs_odp_caps {
  193. __u64 general_caps;
  194. struct {
  195. __u32 rc_odp_caps;
  196. __u32 uc_odp_caps;
  197. __u32 ud_odp_caps;
  198. } per_transport_caps;
  199. __u32 reserved;
  200. };
  201. struct ib_uverbs_ex_query_device_resp {
  202. struct ib_uverbs_query_device_resp base;
  203. __u32 comp_mask;
  204. __u32 response_length;
  205. struct ib_uverbs_odp_caps odp_caps;
  206. __u64 timestamp_mask;
  207. __u64 hca_core_clock; /* in KHZ */
  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_ex_create_cq {
  320. __u64 user_handle;
  321. __u32 cqe;
  322. __u32 comp_vector;
  323. __s32 comp_channel;
  324. __u32 comp_mask;
  325. __u32 flags;
  326. __u32 reserved;
  327. };
  328. struct ib_uverbs_create_cq_resp {
  329. __u32 cq_handle;
  330. __u32 cqe;
  331. };
  332. struct ib_uverbs_ex_create_cq_resp {
  333. struct ib_uverbs_create_cq_resp base;
  334. __u32 comp_mask;
  335. __u32 response_length;
  336. };
  337. struct ib_uverbs_resize_cq {
  338. __u64 response;
  339. __u32 cq_handle;
  340. __u32 cqe;
  341. __u64 driver_data[0];
  342. };
  343. struct ib_uverbs_resize_cq_resp {
  344. __u32 cqe;
  345. __u32 reserved;
  346. __u64 driver_data[0];
  347. };
  348. struct ib_uverbs_poll_cq {
  349. __u64 response;
  350. __u32 cq_handle;
  351. __u32 ne;
  352. };
  353. struct ib_uverbs_wc {
  354. __u64 wr_id;
  355. __u32 status;
  356. __u32 opcode;
  357. __u32 vendor_err;
  358. __u32 byte_len;
  359. union {
  360. __u32 imm_data;
  361. __u32 invalidate_rkey;
  362. } ex;
  363. __u32 qp_num;
  364. __u32 src_qp;
  365. __u32 wc_flags;
  366. __u16 pkey_index;
  367. __u16 slid;
  368. __u8 sl;
  369. __u8 dlid_path_bits;
  370. __u8 port_num;
  371. __u8 reserved;
  372. };
  373. struct ib_uverbs_poll_cq_resp {
  374. __u32 count;
  375. __u32 reserved;
  376. struct ib_uverbs_wc wc[0];
  377. };
  378. struct ib_uverbs_req_notify_cq {
  379. __u32 cq_handle;
  380. __u32 solicited_only;
  381. };
  382. struct ib_uverbs_destroy_cq {
  383. __u64 response;
  384. __u32 cq_handle;
  385. __u32 reserved;
  386. };
  387. struct ib_uverbs_destroy_cq_resp {
  388. __u32 comp_events_reported;
  389. __u32 async_events_reported;
  390. };
  391. struct ib_uverbs_global_route {
  392. __u8 dgid[16];
  393. __u32 flow_label;
  394. __u8 sgid_index;
  395. __u8 hop_limit;
  396. __u8 traffic_class;
  397. __u8 reserved;
  398. };
  399. struct ib_uverbs_ah_attr {
  400. struct ib_uverbs_global_route grh;
  401. __u16 dlid;
  402. __u8 sl;
  403. __u8 src_path_bits;
  404. __u8 static_rate;
  405. __u8 is_global;
  406. __u8 port_num;
  407. __u8 reserved;
  408. };
  409. struct ib_uverbs_qp_attr {
  410. __u32 qp_attr_mask;
  411. __u32 qp_state;
  412. __u32 cur_qp_state;
  413. __u32 path_mtu;
  414. __u32 path_mig_state;
  415. __u32 qkey;
  416. __u32 rq_psn;
  417. __u32 sq_psn;
  418. __u32 dest_qp_num;
  419. __u32 qp_access_flags;
  420. struct ib_uverbs_ah_attr ah_attr;
  421. struct ib_uverbs_ah_attr alt_ah_attr;
  422. /* ib_qp_cap */
  423. __u32 max_send_wr;
  424. __u32 max_recv_wr;
  425. __u32 max_send_sge;
  426. __u32 max_recv_sge;
  427. __u32 max_inline_data;
  428. __u16 pkey_index;
  429. __u16 alt_pkey_index;
  430. __u8 en_sqd_async_notify;
  431. __u8 sq_draining;
  432. __u8 max_rd_atomic;
  433. __u8 max_dest_rd_atomic;
  434. __u8 min_rnr_timer;
  435. __u8 port_num;
  436. __u8 timeout;
  437. __u8 retry_cnt;
  438. __u8 rnr_retry;
  439. __u8 alt_port_num;
  440. __u8 alt_timeout;
  441. __u8 reserved[5];
  442. };
  443. struct ib_uverbs_create_qp {
  444. __u64 response;
  445. __u64 user_handle;
  446. __u32 pd_handle;
  447. __u32 send_cq_handle;
  448. __u32 recv_cq_handle;
  449. __u32 srq_handle;
  450. __u32 max_send_wr;
  451. __u32 max_recv_wr;
  452. __u32 max_send_sge;
  453. __u32 max_recv_sge;
  454. __u32 max_inline_data;
  455. __u8 sq_sig_all;
  456. __u8 qp_type;
  457. __u8 is_srq;
  458. __u8 reserved;
  459. __u64 driver_data[0];
  460. };
  461. struct ib_uverbs_open_qp {
  462. __u64 response;
  463. __u64 user_handle;
  464. __u32 pd_handle;
  465. __u32 qpn;
  466. __u8 qp_type;
  467. __u8 reserved[7];
  468. __u64 driver_data[0];
  469. };
  470. /* also used for open response */
  471. struct ib_uverbs_create_qp_resp {
  472. __u32 qp_handle;
  473. __u32 qpn;
  474. __u32 max_send_wr;
  475. __u32 max_recv_wr;
  476. __u32 max_send_sge;
  477. __u32 max_recv_sge;
  478. __u32 max_inline_data;
  479. __u32 reserved;
  480. };
  481. /*
  482. * This struct needs to remain a multiple of 8 bytes to keep the
  483. * alignment of the modify QP parameters.
  484. */
  485. struct ib_uverbs_qp_dest {
  486. __u8 dgid[16];
  487. __u32 flow_label;
  488. __u16 dlid;
  489. __u16 reserved;
  490. __u8 sgid_index;
  491. __u8 hop_limit;
  492. __u8 traffic_class;
  493. __u8 sl;
  494. __u8 src_path_bits;
  495. __u8 static_rate;
  496. __u8 is_global;
  497. __u8 port_num;
  498. };
  499. struct ib_uverbs_query_qp {
  500. __u64 response;
  501. __u32 qp_handle;
  502. __u32 attr_mask;
  503. __u64 driver_data[0];
  504. };
  505. struct ib_uverbs_query_qp_resp {
  506. struct ib_uverbs_qp_dest dest;
  507. struct ib_uverbs_qp_dest alt_dest;
  508. __u32 max_send_wr;
  509. __u32 max_recv_wr;
  510. __u32 max_send_sge;
  511. __u32 max_recv_sge;
  512. __u32 max_inline_data;
  513. __u32 qkey;
  514. __u32 rq_psn;
  515. __u32 sq_psn;
  516. __u32 dest_qp_num;
  517. __u32 qp_access_flags;
  518. __u16 pkey_index;
  519. __u16 alt_pkey_index;
  520. __u8 qp_state;
  521. __u8 cur_qp_state;
  522. __u8 path_mtu;
  523. __u8 path_mig_state;
  524. __u8 sq_draining;
  525. __u8 max_rd_atomic;
  526. __u8 max_dest_rd_atomic;
  527. __u8 min_rnr_timer;
  528. __u8 port_num;
  529. __u8 timeout;
  530. __u8 retry_cnt;
  531. __u8 rnr_retry;
  532. __u8 alt_port_num;
  533. __u8 alt_timeout;
  534. __u8 sq_sig_all;
  535. __u8 reserved[5];
  536. __u64 driver_data[0];
  537. };
  538. struct ib_uverbs_modify_qp {
  539. struct ib_uverbs_qp_dest dest;
  540. struct ib_uverbs_qp_dest alt_dest;
  541. __u32 qp_handle;
  542. __u32 attr_mask;
  543. __u32 qkey;
  544. __u32 rq_psn;
  545. __u32 sq_psn;
  546. __u32 dest_qp_num;
  547. __u32 qp_access_flags;
  548. __u16 pkey_index;
  549. __u16 alt_pkey_index;
  550. __u8 qp_state;
  551. __u8 cur_qp_state;
  552. __u8 path_mtu;
  553. __u8 path_mig_state;
  554. __u8 en_sqd_async_notify;
  555. __u8 max_rd_atomic;
  556. __u8 max_dest_rd_atomic;
  557. __u8 min_rnr_timer;
  558. __u8 port_num;
  559. __u8 timeout;
  560. __u8 retry_cnt;
  561. __u8 rnr_retry;
  562. __u8 alt_port_num;
  563. __u8 alt_timeout;
  564. __u8 reserved[2];
  565. __u64 driver_data[0];
  566. };
  567. struct ib_uverbs_modify_qp_resp {
  568. };
  569. struct ib_uverbs_destroy_qp {
  570. __u64 response;
  571. __u32 qp_handle;
  572. __u32 reserved;
  573. };
  574. struct ib_uverbs_destroy_qp_resp {
  575. __u32 events_reported;
  576. };
  577. /*
  578. * The ib_uverbs_sge structure isn't used anywhere, since we assume
  579. * the ib_sge structure is packed the same way on 32-bit and 64-bit
  580. * architectures in both kernel and user space. It's just here to
  581. * document the ABI.
  582. */
  583. struct ib_uverbs_sge {
  584. __u64 addr;
  585. __u32 length;
  586. __u32 lkey;
  587. };
  588. struct ib_uverbs_send_wr {
  589. __u64 wr_id;
  590. __u32 num_sge;
  591. __u32 opcode;
  592. __u32 send_flags;
  593. union {
  594. __u32 imm_data;
  595. __u32 invalidate_rkey;
  596. } ex;
  597. union {
  598. struct {
  599. __u64 remote_addr;
  600. __u32 rkey;
  601. __u32 reserved;
  602. } rdma;
  603. struct {
  604. __u64 remote_addr;
  605. __u64 compare_add;
  606. __u64 swap;
  607. __u32 rkey;
  608. __u32 reserved;
  609. } atomic;
  610. struct {
  611. __u32 ah;
  612. __u32 remote_qpn;
  613. __u32 remote_qkey;
  614. __u32 reserved;
  615. } ud;
  616. } wr;
  617. };
  618. struct ib_uverbs_post_send {
  619. __u64 response;
  620. __u32 qp_handle;
  621. __u32 wr_count;
  622. __u32 sge_count;
  623. __u32 wqe_size;
  624. struct ib_uverbs_send_wr send_wr[0];
  625. };
  626. struct ib_uverbs_post_send_resp {
  627. __u32 bad_wr;
  628. };
  629. struct ib_uverbs_recv_wr {
  630. __u64 wr_id;
  631. __u32 num_sge;
  632. __u32 reserved;
  633. };
  634. struct ib_uverbs_post_recv {
  635. __u64 response;
  636. __u32 qp_handle;
  637. __u32 wr_count;
  638. __u32 sge_count;
  639. __u32 wqe_size;
  640. struct ib_uverbs_recv_wr recv_wr[0];
  641. };
  642. struct ib_uverbs_post_recv_resp {
  643. __u32 bad_wr;
  644. };
  645. struct ib_uverbs_post_srq_recv {
  646. __u64 response;
  647. __u32 srq_handle;
  648. __u32 wr_count;
  649. __u32 sge_count;
  650. __u32 wqe_size;
  651. struct ib_uverbs_recv_wr recv[0];
  652. };
  653. struct ib_uverbs_post_srq_recv_resp {
  654. __u32 bad_wr;
  655. };
  656. struct ib_uverbs_create_ah {
  657. __u64 response;
  658. __u64 user_handle;
  659. __u32 pd_handle;
  660. __u32 reserved;
  661. struct ib_uverbs_ah_attr attr;
  662. };
  663. struct ib_uverbs_create_ah_resp {
  664. __u32 ah_handle;
  665. };
  666. struct ib_uverbs_destroy_ah {
  667. __u32 ah_handle;
  668. };
  669. struct ib_uverbs_attach_mcast {
  670. __u8 gid[16];
  671. __u32 qp_handle;
  672. __u16 mlid;
  673. __u16 reserved;
  674. __u64 driver_data[0];
  675. };
  676. struct ib_uverbs_detach_mcast {
  677. __u8 gid[16];
  678. __u32 qp_handle;
  679. __u16 mlid;
  680. __u16 reserved;
  681. __u64 driver_data[0];
  682. };
  683. struct ib_uverbs_flow_spec_hdr {
  684. __u32 type;
  685. __u16 size;
  686. __u16 reserved;
  687. /* followed by flow_spec */
  688. __u64 flow_spec_data[0];
  689. };
  690. struct ib_uverbs_flow_eth_filter {
  691. __u8 dst_mac[6];
  692. __u8 src_mac[6];
  693. __be16 ether_type;
  694. __be16 vlan_tag;
  695. };
  696. struct ib_uverbs_flow_spec_eth {
  697. union {
  698. struct ib_uverbs_flow_spec_hdr hdr;
  699. struct {
  700. __u32 type;
  701. __u16 size;
  702. __u16 reserved;
  703. };
  704. };
  705. struct ib_uverbs_flow_eth_filter val;
  706. struct ib_uverbs_flow_eth_filter mask;
  707. };
  708. struct ib_uverbs_flow_ipv4_filter {
  709. __be32 src_ip;
  710. __be32 dst_ip;
  711. };
  712. struct ib_uverbs_flow_spec_ipv4 {
  713. union {
  714. struct ib_uverbs_flow_spec_hdr hdr;
  715. struct {
  716. __u32 type;
  717. __u16 size;
  718. __u16 reserved;
  719. };
  720. };
  721. struct ib_uverbs_flow_ipv4_filter val;
  722. struct ib_uverbs_flow_ipv4_filter mask;
  723. };
  724. struct ib_uverbs_flow_tcp_udp_filter {
  725. __be16 dst_port;
  726. __be16 src_port;
  727. };
  728. struct ib_uverbs_flow_spec_tcp_udp {
  729. union {
  730. struct ib_uverbs_flow_spec_hdr hdr;
  731. struct {
  732. __u32 type;
  733. __u16 size;
  734. __u16 reserved;
  735. };
  736. };
  737. struct ib_uverbs_flow_tcp_udp_filter val;
  738. struct ib_uverbs_flow_tcp_udp_filter mask;
  739. };
  740. struct ib_uverbs_flow_attr {
  741. __u32 type;
  742. __u16 size;
  743. __u16 priority;
  744. __u8 num_of_specs;
  745. __u8 reserved[2];
  746. __u8 port;
  747. __u32 flags;
  748. /* Following are the optional layers according to user request
  749. * struct ib_flow_spec_xxx
  750. * struct ib_flow_spec_yyy
  751. */
  752. struct ib_uverbs_flow_spec_hdr flow_specs[0];
  753. };
  754. struct ib_uverbs_create_flow {
  755. __u32 comp_mask;
  756. __u32 qp_handle;
  757. struct ib_uverbs_flow_attr flow_attr;
  758. };
  759. struct ib_uverbs_create_flow_resp {
  760. __u32 comp_mask;
  761. __u32 flow_handle;
  762. };
  763. struct ib_uverbs_destroy_flow {
  764. __u32 comp_mask;
  765. __u32 flow_handle;
  766. };
  767. struct ib_uverbs_create_srq {
  768. __u64 response;
  769. __u64 user_handle;
  770. __u32 pd_handle;
  771. __u32 max_wr;
  772. __u32 max_sge;
  773. __u32 srq_limit;
  774. __u64 driver_data[0];
  775. };
  776. struct ib_uverbs_create_xsrq {
  777. __u64 response;
  778. __u64 user_handle;
  779. __u32 srq_type;
  780. __u32 pd_handle;
  781. __u32 max_wr;
  782. __u32 max_sge;
  783. __u32 srq_limit;
  784. __u32 reserved;
  785. __u32 xrcd_handle;
  786. __u32 cq_handle;
  787. __u64 driver_data[0];
  788. };
  789. struct ib_uverbs_create_srq_resp {
  790. __u32 srq_handle;
  791. __u32 max_wr;
  792. __u32 max_sge;
  793. __u32 srqn;
  794. };
  795. struct ib_uverbs_modify_srq {
  796. __u32 srq_handle;
  797. __u32 attr_mask;
  798. __u32 max_wr;
  799. __u32 srq_limit;
  800. __u64 driver_data[0];
  801. };
  802. struct ib_uverbs_query_srq {
  803. __u64 response;
  804. __u32 srq_handle;
  805. __u32 reserved;
  806. __u64 driver_data[0];
  807. };
  808. struct ib_uverbs_query_srq_resp {
  809. __u32 max_wr;
  810. __u32 max_sge;
  811. __u32 srq_limit;
  812. __u32 reserved;
  813. };
  814. struct ib_uverbs_destroy_srq {
  815. __u64 response;
  816. __u32 srq_handle;
  817. __u32 reserved;
  818. };
  819. struct ib_uverbs_destroy_srq_resp {
  820. __u32 events_reported;
  821. };
  822. #endif /* IB_USER_VERBS_H */