ib_user_verbs.h 16 KB

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