ib_user_verbs.h 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364
  1. /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
  2. /*
  3. * Copyright (c) 2005 Topspin Communications. All rights reserved.
  4. * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved.
  5. * Copyright (c) 2005 PathScale, Inc. All rights reserved.
  6. * Copyright (c) 2006 Mellanox Technologies. All rights reserved.
  7. *
  8. * This software is available to you under a choice of one of two
  9. * licenses. You may choose to be licensed under the terms of the GNU
  10. * General Public License (GPL) Version 2, available from the file
  11. * COPYING in the main directory of this source tree, or the
  12. * OpenIB.org BSD license below:
  13. *
  14. * Redistribution and use in source and binary forms, with or
  15. * without modification, are permitted provided that the following
  16. * conditions are met:
  17. *
  18. * - Redistributions of source code must retain the above
  19. * copyright notice, this list of conditions and the following
  20. * disclaimer.
  21. *
  22. * - Redistributions in binary form must reproduce the above
  23. * copyright notice, this list of conditions and the following
  24. * disclaimer in the documentation and/or other materials
  25. * provided with the distribution.
  26. *
  27. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  28. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  29. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  30. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  31. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  32. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  33. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  34. * SOFTWARE.
  35. */
  36. #ifndef IB_USER_VERBS_H
  37. #define IB_USER_VERBS_H
  38. #include <linux/types.h>
  39. /*
  40. * Increment this value if any changes that break userspace ABI
  41. * compatibility are made.
  42. */
  43. #define IB_USER_VERBS_ABI_VERSION 6
  44. #define IB_USER_VERBS_CMD_THRESHOLD 50
  45. enum ib_uverbs_write_cmds {
  46. IB_USER_VERBS_CMD_GET_CONTEXT,
  47. IB_USER_VERBS_CMD_QUERY_DEVICE,
  48. IB_USER_VERBS_CMD_QUERY_PORT,
  49. IB_USER_VERBS_CMD_ALLOC_PD,
  50. IB_USER_VERBS_CMD_DEALLOC_PD,
  51. IB_USER_VERBS_CMD_CREATE_AH,
  52. IB_USER_VERBS_CMD_MODIFY_AH,
  53. IB_USER_VERBS_CMD_QUERY_AH,
  54. IB_USER_VERBS_CMD_DESTROY_AH,
  55. IB_USER_VERBS_CMD_REG_MR,
  56. IB_USER_VERBS_CMD_REG_SMR,
  57. IB_USER_VERBS_CMD_REREG_MR,
  58. IB_USER_VERBS_CMD_QUERY_MR,
  59. IB_USER_VERBS_CMD_DEREG_MR,
  60. IB_USER_VERBS_CMD_ALLOC_MW,
  61. IB_USER_VERBS_CMD_BIND_MW,
  62. IB_USER_VERBS_CMD_DEALLOC_MW,
  63. IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL,
  64. IB_USER_VERBS_CMD_CREATE_CQ,
  65. IB_USER_VERBS_CMD_RESIZE_CQ,
  66. IB_USER_VERBS_CMD_DESTROY_CQ,
  67. IB_USER_VERBS_CMD_POLL_CQ,
  68. IB_USER_VERBS_CMD_PEEK_CQ,
  69. IB_USER_VERBS_CMD_REQ_NOTIFY_CQ,
  70. IB_USER_VERBS_CMD_CREATE_QP,
  71. IB_USER_VERBS_CMD_QUERY_QP,
  72. IB_USER_VERBS_CMD_MODIFY_QP,
  73. IB_USER_VERBS_CMD_DESTROY_QP,
  74. IB_USER_VERBS_CMD_POST_SEND,
  75. IB_USER_VERBS_CMD_POST_RECV,
  76. IB_USER_VERBS_CMD_ATTACH_MCAST,
  77. IB_USER_VERBS_CMD_DETACH_MCAST,
  78. IB_USER_VERBS_CMD_CREATE_SRQ,
  79. IB_USER_VERBS_CMD_MODIFY_SRQ,
  80. IB_USER_VERBS_CMD_QUERY_SRQ,
  81. IB_USER_VERBS_CMD_DESTROY_SRQ,
  82. IB_USER_VERBS_CMD_POST_SRQ_RECV,
  83. IB_USER_VERBS_CMD_OPEN_XRCD,
  84. IB_USER_VERBS_CMD_CLOSE_XRCD,
  85. IB_USER_VERBS_CMD_CREATE_XSRQ,
  86. IB_USER_VERBS_CMD_OPEN_QP,
  87. };
  88. enum {
  89. IB_USER_VERBS_EX_CMD_QUERY_DEVICE = IB_USER_VERBS_CMD_QUERY_DEVICE,
  90. IB_USER_VERBS_EX_CMD_CREATE_CQ = IB_USER_VERBS_CMD_CREATE_CQ,
  91. IB_USER_VERBS_EX_CMD_CREATE_QP = IB_USER_VERBS_CMD_CREATE_QP,
  92. IB_USER_VERBS_EX_CMD_MODIFY_QP = IB_USER_VERBS_CMD_MODIFY_QP,
  93. IB_USER_VERBS_EX_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD,
  94. IB_USER_VERBS_EX_CMD_DESTROY_FLOW,
  95. IB_USER_VERBS_EX_CMD_CREATE_WQ,
  96. IB_USER_VERBS_EX_CMD_MODIFY_WQ,
  97. IB_USER_VERBS_EX_CMD_DESTROY_WQ,
  98. IB_USER_VERBS_EX_CMD_CREATE_RWQ_IND_TBL,
  99. IB_USER_VERBS_EX_CMD_DESTROY_RWQ_IND_TBL,
  100. IB_USER_VERBS_EX_CMD_MODIFY_CQ
  101. };
  102. /* see IBA A19.4.1.1 Placement Types */
  103. enum ib_placement_type {
  104. IB_FLUSH_GLOBAL = 1U << 0,
  105. IB_FLUSH_PERSISTENT = 1U << 1,
  106. };
  107. /* see IBA A19.4.1.2 Selectivity Level */
  108. enum ib_selectivity_level {
  109. IB_FLUSH_RANGE = 0,
  110. IB_FLUSH_MR,
  111. };
  112. /*
  113. * Make sure that all structs defined in this file remain laid out so
  114. * that they pack the same way on 32-bit and 64-bit architectures (to
  115. * avoid incompatibility between 32-bit userspace and 64-bit kernels).
  116. * Specifically:
  117. * - Do not use pointer types -- pass pointers in __u64 instead.
  118. * - Make sure that any structure larger than 4 bytes is padded to a
  119. * multiple of 8 bytes. Otherwise the structure size will be
  120. * different between 32-bit and 64-bit architectures.
  121. */
  122. struct ib_uverbs_async_event_desc {
  123. __aligned_u64 element;
  124. __u32 event_type; /* enum ib_event_type */
  125. __u32 reserved;
  126. };
  127. struct ib_uverbs_comp_event_desc {
  128. __aligned_u64 cq_handle;
  129. };
  130. struct ib_uverbs_cq_moderation_caps {
  131. __u16 max_cq_moderation_count;
  132. __u16 max_cq_moderation_period;
  133. __u32 reserved;
  134. };
  135. /*
  136. * All commands from userspace should start with a __u32 command field
  137. * followed by __u16 in_words and out_words fields (which give the
  138. * length of the command block and response buffer if any in 32-bit
  139. * words). The kernel driver will read these fields first and read
  140. * the rest of the command struct based on these value.
  141. */
  142. #define IB_USER_VERBS_CMD_COMMAND_MASK 0xff
  143. #define IB_USER_VERBS_CMD_FLAG_EXTENDED 0x80000000u
  144. struct ib_uverbs_cmd_hdr {
  145. __u32 command;
  146. __u16 in_words;
  147. __u16 out_words;
  148. };
  149. struct ib_uverbs_ex_cmd_hdr {
  150. __aligned_u64 response;
  151. __u16 provider_in_words;
  152. __u16 provider_out_words;
  153. __u32 cmd_hdr_reserved;
  154. };
  155. struct ib_uverbs_get_context {
  156. __aligned_u64 response;
  157. __aligned_u64 driver_data[];
  158. };
  159. struct ib_uverbs_get_context_resp {
  160. __u32 async_fd;
  161. __u32 num_comp_vectors;
  162. __aligned_u64 driver_data[];
  163. };
  164. struct ib_uverbs_query_device {
  165. __aligned_u64 response;
  166. __aligned_u64 driver_data[];
  167. };
  168. struct ib_uverbs_query_device_resp {
  169. __aligned_u64 fw_ver;
  170. __be64 node_guid;
  171. __be64 sys_image_guid;
  172. __aligned_u64 max_mr_size;
  173. __aligned_u64 page_size_cap;
  174. __u32 vendor_id;
  175. __u32 vendor_part_id;
  176. __u32 hw_ver;
  177. __u32 max_qp;
  178. __u32 max_qp_wr;
  179. __u32 device_cap_flags;
  180. __u32 max_sge;
  181. __u32 max_sge_rd;
  182. __u32 max_cq;
  183. __u32 max_cqe;
  184. __u32 max_mr;
  185. __u32 max_pd;
  186. __u32 max_qp_rd_atom;
  187. __u32 max_ee_rd_atom;
  188. __u32 max_res_rd_atom;
  189. __u32 max_qp_init_rd_atom;
  190. __u32 max_ee_init_rd_atom;
  191. __u32 atomic_cap;
  192. __u32 max_ee;
  193. __u32 max_rdd;
  194. __u32 max_mw;
  195. __u32 max_raw_ipv6_qp;
  196. __u32 max_raw_ethy_qp;
  197. __u32 max_mcast_grp;
  198. __u32 max_mcast_qp_attach;
  199. __u32 max_total_mcast_qp_attach;
  200. __u32 max_ah;
  201. __u32 max_fmr;
  202. __u32 max_map_per_fmr;
  203. __u32 max_srq;
  204. __u32 max_srq_wr;
  205. __u32 max_srq_sge;
  206. __u16 max_pkeys;
  207. __u8 local_ca_ack_delay;
  208. __u8 phys_port_cnt;
  209. __u8 reserved[4];
  210. };
  211. struct ib_uverbs_ex_query_device {
  212. __u32 comp_mask;
  213. __u32 reserved;
  214. };
  215. struct ib_uverbs_odp_caps {
  216. __aligned_u64 general_caps;
  217. struct {
  218. __u32 rc_odp_caps;
  219. __u32 uc_odp_caps;
  220. __u32 ud_odp_caps;
  221. } per_transport_caps;
  222. __u32 reserved;
  223. };
  224. struct ib_uverbs_rss_caps {
  225. /* Corresponding bit will be set if qp type from
  226. * 'enum ib_qp_type' is supported, e.g.
  227. * supported_qpts |= 1 << IB_QPT_UD
  228. */
  229. __u32 supported_qpts;
  230. __u32 max_rwq_indirection_tables;
  231. __u32 max_rwq_indirection_table_size;
  232. __u32 reserved;
  233. };
  234. struct ib_uverbs_tm_caps {
  235. /* Max size of rendezvous request message */
  236. __u32 max_rndv_hdr_size;
  237. /* Max number of entries in tag matching list */
  238. __u32 max_num_tags;
  239. /* TM flags */
  240. __u32 flags;
  241. /* Max number of outstanding list operations */
  242. __u32 max_ops;
  243. /* Max number of SGE in tag matching entry */
  244. __u32 max_sge;
  245. __u32 reserved;
  246. };
  247. struct ib_uverbs_ex_query_device_resp {
  248. struct ib_uverbs_query_device_resp base;
  249. __u32 comp_mask;
  250. __u32 response_length;
  251. struct ib_uverbs_odp_caps odp_caps;
  252. __aligned_u64 timestamp_mask;
  253. __aligned_u64 hca_core_clock; /* in KHZ */
  254. __aligned_u64 device_cap_flags_ex;
  255. struct ib_uverbs_rss_caps rss_caps;
  256. __u32 max_wq_type_rq;
  257. __u32 raw_packet_caps;
  258. struct ib_uverbs_tm_caps tm_caps;
  259. struct ib_uverbs_cq_moderation_caps cq_moderation_caps;
  260. __aligned_u64 max_dm_size;
  261. __u32 xrc_odp_caps;
  262. __u32 reserved;
  263. };
  264. struct ib_uverbs_query_port {
  265. __aligned_u64 response;
  266. __u8 port_num;
  267. __u8 reserved[7];
  268. __aligned_u64 driver_data[];
  269. };
  270. struct ib_uverbs_query_port_resp {
  271. __u32 port_cap_flags; /* see ib_uverbs_query_port_cap_flags */
  272. __u32 max_msg_sz;
  273. __u32 bad_pkey_cntr;
  274. __u32 qkey_viol_cntr;
  275. __u32 gid_tbl_len;
  276. __u16 pkey_tbl_len;
  277. __u16 lid;
  278. __u16 sm_lid;
  279. __u8 state;
  280. __u8 max_mtu;
  281. __u8 active_mtu;
  282. __u8 lmc;
  283. __u8 max_vl_num;
  284. __u8 sm_sl;
  285. __u8 subnet_timeout;
  286. __u8 init_type_reply;
  287. __u8 active_width;
  288. __u8 active_speed;
  289. __u8 phys_state;
  290. __u8 link_layer;
  291. __u8 flags; /* see ib_uverbs_query_port_flags */
  292. __u8 reserved;
  293. };
  294. struct ib_uverbs_alloc_pd {
  295. __aligned_u64 response;
  296. __aligned_u64 driver_data[];
  297. };
  298. struct ib_uverbs_alloc_pd_resp {
  299. __u32 pd_handle;
  300. __u32 driver_data[];
  301. };
  302. struct ib_uverbs_dealloc_pd {
  303. __u32 pd_handle;
  304. };
  305. struct ib_uverbs_open_xrcd {
  306. __aligned_u64 response;
  307. __u32 fd;
  308. __u32 oflags;
  309. __aligned_u64 driver_data[];
  310. };
  311. struct ib_uverbs_open_xrcd_resp {
  312. __u32 xrcd_handle;
  313. __u32 driver_data[];
  314. };
  315. struct ib_uverbs_close_xrcd {
  316. __u32 xrcd_handle;
  317. };
  318. struct ib_uverbs_reg_mr {
  319. __aligned_u64 response;
  320. __aligned_u64 start;
  321. __aligned_u64 length;
  322. __aligned_u64 hca_va;
  323. __u32 pd_handle;
  324. __u32 access_flags;
  325. __aligned_u64 driver_data[];
  326. };
  327. struct ib_uverbs_reg_mr_resp {
  328. __u32 mr_handle;
  329. __u32 lkey;
  330. __u32 rkey;
  331. __u32 driver_data[];
  332. };
  333. struct ib_uverbs_rereg_mr {
  334. __aligned_u64 response;
  335. __u32 mr_handle;
  336. __u32 flags;
  337. __aligned_u64 start;
  338. __aligned_u64 length;
  339. __aligned_u64 hca_va;
  340. __u32 pd_handle;
  341. __u32 access_flags;
  342. __aligned_u64 driver_data[];
  343. };
  344. struct ib_uverbs_rereg_mr_resp {
  345. __u32 lkey;
  346. __u32 rkey;
  347. __aligned_u64 driver_data[];
  348. };
  349. struct ib_uverbs_dereg_mr {
  350. __u32 mr_handle;
  351. };
  352. struct ib_uverbs_alloc_mw {
  353. __aligned_u64 response;
  354. __u32 pd_handle;
  355. __u8 mw_type;
  356. __u8 reserved[3];
  357. __aligned_u64 driver_data[];
  358. };
  359. struct ib_uverbs_alloc_mw_resp {
  360. __u32 mw_handle;
  361. __u32 rkey;
  362. __aligned_u64 driver_data[];
  363. };
  364. struct ib_uverbs_dealloc_mw {
  365. __u32 mw_handle;
  366. };
  367. struct ib_uverbs_create_comp_channel {
  368. __aligned_u64 response;
  369. };
  370. struct ib_uverbs_create_comp_channel_resp {
  371. __u32 fd;
  372. };
  373. struct ib_uverbs_create_cq {
  374. __aligned_u64 response;
  375. __aligned_u64 user_handle;
  376. __u32 cqe;
  377. __u32 comp_vector;
  378. __s32 comp_channel;
  379. __u32 reserved;
  380. __aligned_u64 driver_data[];
  381. };
  382. enum ib_uverbs_ex_create_cq_flags {
  383. IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION = 1 << 0,
  384. IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN = 1 << 1,
  385. };
  386. struct ib_uverbs_ex_create_cq {
  387. __aligned_u64 user_handle;
  388. __u32 cqe;
  389. __u32 comp_vector;
  390. __s32 comp_channel;
  391. __u32 comp_mask;
  392. __u32 flags; /* bitmask of ib_uverbs_ex_create_cq_flags */
  393. __u32 reserved;
  394. };
  395. struct ib_uverbs_create_cq_resp {
  396. __u32 cq_handle;
  397. __u32 cqe;
  398. __aligned_u64 driver_data[0];
  399. };
  400. struct ib_uverbs_ex_create_cq_resp {
  401. struct ib_uverbs_create_cq_resp base;
  402. __u32 comp_mask;
  403. __u32 response_length;
  404. };
  405. struct ib_uverbs_resize_cq {
  406. __aligned_u64 response;
  407. __u32 cq_handle;
  408. __u32 cqe;
  409. __aligned_u64 driver_data[];
  410. };
  411. struct ib_uverbs_resize_cq_resp {
  412. __u32 cqe;
  413. __u32 reserved;
  414. __aligned_u64 driver_data[];
  415. };
  416. struct ib_uverbs_poll_cq {
  417. __aligned_u64 response;
  418. __u32 cq_handle;
  419. __u32 ne;
  420. };
  421. enum ib_uverbs_wc_opcode {
  422. IB_UVERBS_WC_SEND = 0,
  423. IB_UVERBS_WC_RDMA_WRITE = 1,
  424. IB_UVERBS_WC_RDMA_READ = 2,
  425. IB_UVERBS_WC_COMP_SWAP = 3,
  426. IB_UVERBS_WC_FETCH_ADD = 4,
  427. IB_UVERBS_WC_BIND_MW = 5,
  428. IB_UVERBS_WC_LOCAL_INV = 6,
  429. IB_UVERBS_WC_TSO = 7,
  430. IB_UVERBS_WC_FLUSH = 8,
  431. IB_UVERBS_WC_ATOMIC_WRITE = 9,
  432. };
  433. struct ib_uverbs_wc {
  434. __aligned_u64 wr_id;
  435. __u32 status;
  436. __u32 opcode;
  437. __u32 vendor_err;
  438. __u32 byte_len;
  439. union {
  440. __be32 imm_data;
  441. __u32 invalidate_rkey;
  442. } ex;
  443. __u32 qp_num;
  444. __u32 src_qp;
  445. __u32 wc_flags;
  446. __u16 pkey_index;
  447. __u16 slid;
  448. __u8 sl;
  449. __u8 dlid_path_bits;
  450. __u8 port_num;
  451. __u8 reserved;
  452. };
  453. struct ib_uverbs_poll_cq_resp {
  454. __u32 count;
  455. __u32 reserved;
  456. struct ib_uverbs_wc wc[];
  457. };
  458. struct ib_uverbs_req_notify_cq {
  459. __u32 cq_handle;
  460. __u32 solicited_only;
  461. };
  462. struct ib_uverbs_destroy_cq {
  463. __aligned_u64 response;
  464. __u32 cq_handle;
  465. __u32 reserved;
  466. };
  467. struct ib_uverbs_destroy_cq_resp {
  468. __u32 comp_events_reported;
  469. __u32 async_events_reported;
  470. };
  471. struct ib_uverbs_global_route {
  472. __u8 dgid[16];
  473. __u32 flow_label;
  474. __u8 sgid_index;
  475. __u8 hop_limit;
  476. __u8 traffic_class;
  477. __u8 reserved;
  478. };
  479. struct ib_uverbs_ah_attr {
  480. struct ib_uverbs_global_route grh;
  481. __u16 dlid;
  482. __u8 sl;
  483. __u8 src_path_bits;
  484. __u8 static_rate;
  485. __u8 is_global;
  486. __u8 port_num;
  487. __u8 reserved;
  488. };
  489. struct ib_uverbs_qp_attr {
  490. __u32 qp_attr_mask;
  491. __u32 qp_state;
  492. __u32 cur_qp_state;
  493. __u32 path_mtu;
  494. __u32 path_mig_state;
  495. __u32 qkey;
  496. __u32 rq_psn;
  497. __u32 sq_psn;
  498. __u32 dest_qp_num;
  499. __u32 qp_access_flags;
  500. struct ib_uverbs_ah_attr ah_attr;
  501. struct ib_uverbs_ah_attr alt_ah_attr;
  502. /* ib_qp_cap */
  503. __u32 max_send_wr;
  504. __u32 max_recv_wr;
  505. __u32 max_send_sge;
  506. __u32 max_recv_sge;
  507. __u32 max_inline_data;
  508. __u16 pkey_index;
  509. __u16 alt_pkey_index;
  510. __u8 en_sqd_async_notify;
  511. __u8 sq_draining;
  512. __u8 max_rd_atomic;
  513. __u8 max_dest_rd_atomic;
  514. __u8 min_rnr_timer;
  515. __u8 port_num;
  516. __u8 timeout;
  517. __u8 retry_cnt;
  518. __u8 rnr_retry;
  519. __u8 alt_port_num;
  520. __u8 alt_timeout;
  521. __u8 reserved[5];
  522. };
  523. struct ib_uverbs_create_qp {
  524. __aligned_u64 response;
  525. __aligned_u64 user_handle;
  526. __u32 pd_handle;
  527. __u32 send_cq_handle;
  528. __u32 recv_cq_handle;
  529. __u32 srq_handle;
  530. __u32 max_send_wr;
  531. __u32 max_recv_wr;
  532. __u32 max_send_sge;
  533. __u32 max_recv_sge;
  534. __u32 max_inline_data;
  535. __u8 sq_sig_all;
  536. __u8 qp_type;
  537. __u8 is_srq;
  538. __u8 reserved;
  539. __aligned_u64 driver_data[];
  540. };
  541. enum ib_uverbs_create_qp_mask {
  542. IB_UVERBS_CREATE_QP_MASK_IND_TABLE = 1UL << 0,
  543. };
  544. enum {
  545. IB_UVERBS_CREATE_QP_SUP_COMP_MASK = IB_UVERBS_CREATE_QP_MASK_IND_TABLE,
  546. };
  547. struct ib_uverbs_ex_create_qp {
  548. __aligned_u64 user_handle;
  549. __u32 pd_handle;
  550. __u32 send_cq_handle;
  551. __u32 recv_cq_handle;
  552. __u32 srq_handle;
  553. __u32 max_send_wr;
  554. __u32 max_recv_wr;
  555. __u32 max_send_sge;
  556. __u32 max_recv_sge;
  557. __u32 max_inline_data;
  558. __u8 sq_sig_all;
  559. __u8 qp_type;
  560. __u8 is_srq;
  561. __u8 reserved;
  562. __u32 comp_mask;
  563. __u32 create_flags;
  564. __u32 rwq_ind_tbl_handle;
  565. __u32 source_qpn;
  566. };
  567. struct ib_uverbs_open_qp {
  568. __aligned_u64 response;
  569. __aligned_u64 user_handle;
  570. __u32 pd_handle;
  571. __u32 qpn;
  572. __u8 qp_type;
  573. __u8 reserved[7];
  574. __aligned_u64 driver_data[];
  575. };
  576. /* also used for open response */
  577. struct ib_uverbs_create_qp_resp {
  578. __u32 qp_handle;
  579. __u32 qpn;
  580. __u32 max_send_wr;
  581. __u32 max_recv_wr;
  582. __u32 max_send_sge;
  583. __u32 max_recv_sge;
  584. __u32 max_inline_data;
  585. __u32 reserved;
  586. __u32 driver_data[0];
  587. };
  588. struct ib_uverbs_ex_create_qp_resp {
  589. struct ib_uverbs_create_qp_resp base;
  590. __u32 comp_mask;
  591. __u32 response_length;
  592. };
  593. /*
  594. * This struct needs to remain a multiple of 8 bytes to keep the
  595. * alignment of the modify QP parameters.
  596. */
  597. struct ib_uverbs_qp_dest {
  598. __u8 dgid[16];
  599. __u32 flow_label;
  600. __u16 dlid;
  601. __u16 reserved;
  602. __u8 sgid_index;
  603. __u8 hop_limit;
  604. __u8 traffic_class;
  605. __u8 sl;
  606. __u8 src_path_bits;
  607. __u8 static_rate;
  608. __u8 is_global;
  609. __u8 port_num;
  610. };
  611. struct ib_uverbs_query_qp {
  612. __aligned_u64 response;
  613. __u32 qp_handle;
  614. __u32 attr_mask;
  615. __aligned_u64 driver_data[];
  616. };
  617. struct ib_uverbs_query_qp_resp {
  618. struct ib_uverbs_qp_dest dest;
  619. struct ib_uverbs_qp_dest alt_dest;
  620. __u32 max_send_wr;
  621. __u32 max_recv_wr;
  622. __u32 max_send_sge;
  623. __u32 max_recv_sge;
  624. __u32 max_inline_data;
  625. __u32 qkey;
  626. __u32 rq_psn;
  627. __u32 sq_psn;
  628. __u32 dest_qp_num;
  629. __u32 qp_access_flags;
  630. __u16 pkey_index;
  631. __u16 alt_pkey_index;
  632. __u8 qp_state;
  633. __u8 cur_qp_state;
  634. __u8 path_mtu;
  635. __u8 path_mig_state;
  636. __u8 sq_draining;
  637. __u8 max_rd_atomic;
  638. __u8 max_dest_rd_atomic;
  639. __u8 min_rnr_timer;
  640. __u8 port_num;
  641. __u8 timeout;
  642. __u8 retry_cnt;
  643. __u8 rnr_retry;
  644. __u8 alt_port_num;
  645. __u8 alt_timeout;
  646. __u8 sq_sig_all;
  647. __u8 reserved[5];
  648. __aligned_u64 driver_data[];
  649. };
  650. struct ib_uverbs_modify_qp {
  651. struct ib_uverbs_qp_dest dest;
  652. struct ib_uverbs_qp_dest alt_dest;
  653. __u32 qp_handle;
  654. __u32 attr_mask;
  655. __u32 qkey;
  656. __u32 rq_psn;
  657. __u32 sq_psn;
  658. __u32 dest_qp_num;
  659. __u32 qp_access_flags;
  660. __u16 pkey_index;
  661. __u16 alt_pkey_index;
  662. __u8 qp_state;
  663. __u8 cur_qp_state;
  664. __u8 path_mtu;
  665. __u8 path_mig_state;
  666. __u8 en_sqd_async_notify;
  667. __u8 max_rd_atomic;
  668. __u8 max_dest_rd_atomic;
  669. __u8 min_rnr_timer;
  670. __u8 port_num;
  671. __u8 timeout;
  672. __u8 retry_cnt;
  673. __u8 rnr_retry;
  674. __u8 alt_port_num;
  675. __u8 alt_timeout;
  676. __u8 reserved[2];
  677. __aligned_u64 driver_data[0];
  678. };
  679. struct ib_uverbs_ex_modify_qp {
  680. struct ib_uverbs_modify_qp base;
  681. __u32 rate_limit;
  682. __u32 reserved;
  683. };
  684. struct ib_uverbs_ex_modify_qp_resp {
  685. __u32 comp_mask;
  686. __u32 response_length;
  687. };
  688. struct ib_uverbs_destroy_qp {
  689. __aligned_u64 response;
  690. __u32 qp_handle;
  691. __u32 reserved;
  692. };
  693. struct ib_uverbs_destroy_qp_resp {
  694. __u32 events_reported;
  695. };
  696. /*
  697. * The ib_uverbs_sge structure isn't used anywhere, since we assume
  698. * the ib_sge structure is packed the same way on 32-bit and 64-bit
  699. * architectures in both kernel and user space. It's just here to
  700. * document the ABI.
  701. */
  702. struct ib_uverbs_sge {
  703. __aligned_u64 addr;
  704. __u32 length;
  705. __u32 lkey;
  706. };
  707. enum ib_uverbs_wr_opcode {
  708. IB_UVERBS_WR_RDMA_WRITE = 0,
  709. IB_UVERBS_WR_RDMA_WRITE_WITH_IMM = 1,
  710. IB_UVERBS_WR_SEND = 2,
  711. IB_UVERBS_WR_SEND_WITH_IMM = 3,
  712. IB_UVERBS_WR_RDMA_READ = 4,
  713. IB_UVERBS_WR_ATOMIC_CMP_AND_SWP = 5,
  714. IB_UVERBS_WR_ATOMIC_FETCH_AND_ADD = 6,
  715. IB_UVERBS_WR_LOCAL_INV = 7,
  716. IB_UVERBS_WR_BIND_MW = 8,
  717. IB_UVERBS_WR_SEND_WITH_INV = 9,
  718. IB_UVERBS_WR_TSO = 10,
  719. IB_UVERBS_WR_RDMA_READ_WITH_INV = 11,
  720. IB_UVERBS_WR_MASKED_ATOMIC_CMP_AND_SWP = 12,
  721. IB_UVERBS_WR_MASKED_ATOMIC_FETCH_AND_ADD = 13,
  722. IB_UVERBS_WR_FLUSH = 14,
  723. IB_UVERBS_WR_ATOMIC_WRITE = 15,
  724. /* Review enum ib_wr_opcode before modifying this */
  725. };
  726. struct ib_uverbs_send_wr {
  727. __aligned_u64 wr_id;
  728. __u32 num_sge;
  729. __u32 opcode; /* see enum ib_uverbs_wr_opcode */
  730. __u32 send_flags;
  731. union {
  732. __be32 imm_data;
  733. __u32 invalidate_rkey;
  734. } ex;
  735. union {
  736. struct {
  737. __aligned_u64 remote_addr;
  738. __u32 rkey;
  739. __u32 reserved;
  740. } rdma;
  741. struct {
  742. __aligned_u64 remote_addr;
  743. __aligned_u64 compare_add;
  744. __aligned_u64 swap;
  745. __u32 rkey;
  746. __u32 reserved;
  747. } atomic;
  748. struct {
  749. __u32 ah;
  750. __u32 remote_qpn;
  751. __u32 remote_qkey;
  752. __u32 reserved;
  753. } ud;
  754. } wr;
  755. };
  756. struct ib_uverbs_post_send {
  757. __aligned_u64 response;
  758. __u32 qp_handle;
  759. __u32 wr_count;
  760. __u32 sge_count;
  761. __u32 wqe_size;
  762. struct ib_uverbs_send_wr send_wr[];
  763. };
  764. struct ib_uverbs_post_send_resp {
  765. __u32 bad_wr;
  766. };
  767. struct ib_uverbs_recv_wr {
  768. __aligned_u64 wr_id;
  769. __u32 num_sge;
  770. __u32 reserved;
  771. };
  772. struct ib_uverbs_post_recv {
  773. __aligned_u64 response;
  774. __u32 qp_handle;
  775. __u32 wr_count;
  776. __u32 sge_count;
  777. __u32 wqe_size;
  778. struct ib_uverbs_recv_wr recv_wr[];
  779. };
  780. struct ib_uverbs_post_recv_resp {
  781. __u32 bad_wr;
  782. };
  783. struct ib_uverbs_post_srq_recv {
  784. __aligned_u64 response;
  785. __u32 srq_handle;
  786. __u32 wr_count;
  787. __u32 sge_count;
  788. __u32 wqe_size;
  789. struct ib_uverbs_recv_wr recv[];
  790. };
  791. struct ib_uverbs_post_srq_recv_resp {
  792. __u32 bad_wr;
  793. };
  794. struct ib_uverbs_create_ah {
  795. __aligned_u64 response;
  796. __aligned_u64 user_handle;
  797. __u32 pd_handle;
  798. __u32 reserved;
  799. struct ib_uverbs_ah_attr attr;
  800. __aligned_u64 driver_data[];
  801. };
  802. struct ib_uverbs_create_ah_resp {
  803. __u32 ah_handle;
  804. __u32 driver_data[];
  805. };
  806. struct ib_uverbs_destroy_ah {
  807. __u32 ah_handle;
  808. };
  809. struct ib_uverbs_attach_mcast {
  810. __u8 gid[16];
  811. __u32 qp_handle;
  812. __u16 mlid;
  813. __u16 reserved;
  814. __aligned_u64 driver_data[];
  815. };
  816. struct ib_uverbs_detach_mcast {
  817. __u8 gid[16];
  818. __u32 qp_handle;
  819. __u16 mlid;
  820. __u16 reserved;
  821. __aligned_u64 driver_data[];
  822. };
  823. struct ib_uverbs_flow_spec_hdr {
  824. __u32 type;
  825. __u16 size;
  826. __u16 reserved;
  827. /* followed by flow_spec */
  828. __aligned_u64 flow_spec_data[0];
  829. };
  830. struct ib_uverbs_flow_eth_filter {
  831. __u8 dst_mac[6];
  832. __u8 src_mac[6];
  833. __be16 ether_type;
  834. __be16 vlan_tag;
  835. };
  836. struct ib_uverbs_flow_spec_eth {
  837. union {
  838. struct ib_uverbs_flow_spec_hdr hdr;
  839. struct {
  840. __u32 type;
  841. __u16 size;
  842. __u16 reserved;
  843. };
  844. };
  845. struct ib_uverbs_flow_eth_filter val;
  846. struct ib_uverbs_flow_eth_filter mask;
  847. };
  848. struct ib_uverbs_flow_ipv4_filter {
  849. __be32 src_ip;
  850. __be32 dst_ip;
  851. __u8 proto;
  852. __u8 tos;
  853. __u8 ttl;
  854. __u8 flags;
  855. };
  856. struct ib_uverbs_flow_spec_ipv4 {
  857. union {
  858. struct ib_uverbs_flow_spec_hdr hdr;
  859. struct {
  860. __u32 type;
  861. __u16 size;
  862. __u16 reserved;
  863. };
  864. };
  865. struct ib_uverbs_flow_ipv4_filter val;
  866. struct ib_uverbs_flow_ipv4_filter mask;
  867. };
  868. struct ib_uverbs_flow_tcp_udp_filter {
  869. __be16 dst_port;
  870. __be16 src_port;
  871. };
  872. struct ib_uverbs_flow_spec_tcp_udp {
  873. union {
  874. struct ib_uverbs_flow_spec_hdr hdr;
  875. struct {
  876. __u32 type;
  877. __u16 size;
  878. __u16 reserved;
  879. };
  880. };
  881. struct ib_uverbs_flow_tcp_udp_filter val;
  882. struct ib_uverbs_flow_tcp_udp_filter mask;
  883. };
  884. struct ib_uverbs_flow_ipv6_filter {
  885. __u8 src_ip[16];
  886. __u8 dst_ip[16];
  887. __be32 flow_label;
  888. __u8 next_hdr;
  889. __u8 traffic_class;
  890. __u8 hop_limit;
  891. __u8 reserved;
  892. };
  893. struct ib_uverbs_flow_spec_ipv6 {
  894. union {
  895. struct ib_uverbs_flow_spec_hdr hdr;
  896. struct {
  897. __u32 type;
  898. __u16 size;
  899. __u16 reserved;
  900. };
  901. };
  902. struct ib_uverbs_flow_ipv6_filter val;
  903. struct ib_uverbs_flow_ipv6_filter mask;
  904. };
  905. struct ib_uverbs_flow_spec_action_tag {
  906. union {
  907. struct ib_uverbs_flow_spec_hdr hdr;
  908. struct {
  909. __u32 type;
  910. __u16 size;
  911. __u16 reserved;
  912. };
  913. };
  914. __u32 tag_id;
  915. __u32 reserved1;
  916. };
  917. struct ib_uverbs_flow_spec_action_drop {
  918. union {
  919. struct ib_uverbs_flow_spec_hdr hdr;
  920. struct {
  921. __u32 type;
  922. __u16 size;
  923. __u16 reserved;
  924. };
  925. };
  926. };
  927. struct ib_uverbs_flow_spec_action_handle {
  928. union {
  929. struct ib_uverbs_flow_spec_hdr hdr;
  930. struct {
  931. __u32 type;
  932. __u16 size;
  933. __u16 reserved;
  934. };
  935. };
  936. __u32 handle;
  937. __u32 reserved1;
  938. };
  939. struct ib_uverbs_flow_spec_action_count {
  940. union {
  941. struct ib_uverbs_flow_spec_hdr hdr;
  942. struct {
  943. __u32 type;
  944. __u16 size;
  945. __u16 reserved;
  946. };
  947. };
  948. __u32 handle;
  949. __u32 reserved1;
  950. };
  951. struct ib_uverbs_flow_tunnel_filter {
  952. __be32 tunnel_id;
  953. };
  954. struct ib_uverbs_flow_spec_tunnel {
  955. union {
  956. struct ib_uverbs_flow_spec_hdr hdr;
  957. struct {
  958. __u32 type;
  959. __u16 size;
  960. __u16 reserved;
  961. };
  962. };
  963. struct ib_uverbs_flow_tunnel_filter val;
  964. struct ib_uverbs_flow_tunnel_filter mask;
  965. };
  966. struct ib_uverbs_flow_spec_esp_filter {
  967. __u32 spi;
  968. __u32 seq;
  969. };
  970. struct ib_uverbs_flow_spec_esp {
  971. union {
  972. struct ib_uverbs_flow_spec_hdr hdr;
  973. struct {
  974. __u32 type;
  975. __u16 size;
  976. __u16 reserved;
  977. };
  978. };
  979. struct ib_uverbs_flow_spec_esp_filter val;
  980. struct ib_uverbs_flow_spec_esp_filter mask;
  981. };
  982. struct ib_uverbs_flow_gre_filter {
  983. /* c_ks_res0_ver field is bits 0-15 in offset 0 of a standard GRE header:
  984. * bit 0 - C - checksum bit.
  985. * bit 1 - reserved. set to 0.
  986. * bit 2 - key bit.
  987. * bit 3 - sequence number bit.
  988. * bits 4:12 - reserved. set to 0.
  989. * bits 13:15 - GRE version.
  990. */
  991. __be16 c_ks_res0_ver;
  992. __be16 protocol;
  993. __be32 key;
  994. };
  995. struct ib_uverbs_flow_spec_gre {
  996. union {
  997. struct ib_uverbs_flow_spec_hdr hdr;
  998. struct {
  999. __u32 type;
  1000. __u16 size;
  1001. __u16 reserved;
  1002. };
  1003. };
  1004. struct ib_uverbs_flow_gre_filter val;
  1005. struct ib_uverbs_flow_gre_filter mask;
  1006. };
  1007. struct ib_uverbs_flow_mpls_filter {
  1008. /* The field includes the entire MPLS label:
  1009. * bits 0:19 - label field.
  1010. * bits 20:22 - traffic class field.
  1011. * bits 23 - bottom of stack bit.
  1012. * bits 24:31 - ttl field.
  1013. */
  1014. __be32 label;
  1015. };
  1016. struct ib_uverbs_flow_spec_mpls {
  1017. union {
  1018. struct ib_uverbs_flow_spec_hdr hdr;
  1019. struct {
  1020. __u32 type;
  1021. __u16 size;
  1022. __u16 reserved;
  1023. };
  1024. };
  1025. struct ib_uverbs_flow_mpls_filter val;
  1026. struct ib_uverbs_flow_mpls_filter mask;
  1027. };
  1028. struct ib_uverbs_flow_attr {
  1029. __u32 type;
  1030. __u16 size;
  1031. __u16 priority;
  1032. __u8 num_of_specs;
  1033. __u8 reserved[2];
  1034. __u8 port;
  1035. __u32 flags;
  1036. /* Following are the optional layers according to user request
  1037. * struct ib_flow_spec_xxx
  1038. * struct ib_flow_spec_yyy
  1039. */
  1040. struct ib_uverbs_flow_spec_hdr flow_specs[];
  1041. };
  1042. struct ib_uverbs_create_flow {
  1043. __u32 comp_mask;
  1044. __u32 qp_handle;
  1045. struct ib_uverbs_flow_attr flow_attr;
  1046. };
  1047. struct ib_uverbs_create_flow_resp {
  1048. __u32 comp_mask;
  1049. __u32 flow_handle;
  1050. };
  1051. struct ib_uverbs_destroy_flow {
  1052. __u32 comp_mask;
  1053. __u32 flow_handle;
  1054. };
  1055. struct ib_uverbs_create_srq {
  1056. __aligned_u64 response;
  1057. __aligned_u64 user_handle;
  1058. __u32 pd_handle;
  1059. __u32 max_wr;
  1060. __u32 max_sge;
  1061. __u32 srq_limit;
  1062. __aligned_u64 driver_data[];
  1063. };
  1064. struct ib_uverbs_create_xsrq {
  1065. __aligned_u64 response;
  1066. __aligned_u64 user_handle;
  1067. __u32 srq_type;
  1068. __u32 pd_handle;
  1069. __u32 max_wr;
  1070. __u32 max_sge;
  1071. __u32 srq_limit;
  1072. __u32 max_num_tags;
  1073. __u32 xrcd_handle;
  1074. __u32 cq_handle;
  1075. __aligned_u64 driver_data[];
  1076. };
  1077. struct ib_uverbs_create_srq_resp {
  1078. __u32 srq_handle;
  1079. __u32 max_wr;
  1080. __u32 max_sge;
  1081. __u32 srqn;
  1082. __u32 driver_data[];
  1083. };
  1084. struct ib_uverbs_modify_srq {
  1085. __u32 srq_handle;
  1086. __u32 attr_mask;
  1087. __u32 max_wr;
  1088. __u32 srq_limit;
  1089. __aligned_u64 driver_data[];
  1090. };
  1091. struct ib_uverbs_query_srq {
  1092. __aligned_u64 response;
  1093. __u32 srq_handle;
  1094. __u32 reserved;
  1095. __aligned_u64 driver_data[];
  1096. };
  1097. struct ib_uverbs_query_srq_resp {
  1098. __u32 max_wr;
  1099. __u32 max_sge;
  1100. __u32 srq_limit;
  1101. __u32 reserved;
  1102. };
  1103. struct ib_uverbs_destroy_srq {
  1104. __aligned_u64 response;
  1105. __u32 srq_handle;
  1106. __u32 reserved;
  1107. };
  1108. struct ib_uverbs_destroy_srq_resp {
  1109. __u32 events_reported;
  1110. };
  1111. struct ib_uverbs_ex_create_wq {
  1112. __u32 comp_mask;
  1113. __u32 wq_type;
  1114. __aligned_u64 user_handle;
  1115. __u32 pd_handle;
  1116. __u32 cq_handle;
  1117. __u32 max_wr;
  1118. __u32 max_sge;
  1119. __u32 create_flags; /* Use enum ib_wq_flags */
  1120. __u32 reserved;
  1121. };
  1122. struct ib_uverbs_ex_create_wq_resp {
  1123. __u32 comp_mask;
  1124. __u32 response_length;
  1125. __u32 wq_handle;
  1126. __u32 max_wr;
  1127. __u32 max_sge;
  1128. __u32 wqn;
  1129. };
  1130. struct ib_uverbs_ex_destroy_wq {
  1131. __u32 comp_mask;
  1132. __u32 wq_handle;
  1133. };
  1134. struct ib_uverbs_ex_destroy_wq_resp {
  1135. __u32 comp_mask;
  1136. __u32 response_length;
  1137. __u32 events_reported;
  1138. __u32 reserved;
  1139. };
  1140. struct ib_uverbs_ex_modify_wq {
  1141. __u32 attr_mask;
  1142. __u32 wq_handle;
  1143. __u32 wq_state;
  1144. __u32 curr_wq_state;
  1145. __u32 flags; /* Use enum ib_wq_flags */
  1146. __u32 flags_mask; /* Use enum ib_wq_flags */
  1147. };
  1148. /* Prevent memory allocation rather than max expected size */
  1149. #define IB_USER_VERBS_MAX_LOG_IND_TBL_SIZE 0x0d
  1150. struct ib_uverbs_ex_create_rwq_ind_table {
  1151. __u32 comp_mask;
  1152. __u32 log_ind_tbl_size;
  1153. /* Following are the wq handles according to log_ind_tbl_size
  1154. * wq_handle1
  1155. * wq_handle2
  1156. */
  1157. __u32 wq_handles[];
  1158. };
  1159. struct ib_uverbs_ex_create_rwq_ind_table_resp {
  1160. __u32 comp_mask;
  1161. __u32 response_length;
  1162. __u32 ind_tbl_handle;
  1163. __u32 ind_tbl_num;
  1164. };
  1165. struct ib_uverbs_ex_destroy_rwq_ind_table {
  1166. __u32 comp_mask;
  1167. __u32 ind_tbl_handle;
  1168. };
  1169. struct ib_uverbs_cq_moderation {
  1170. __u16 cq_count;
  1171. __u16 cq_period;
  1172. };
  1173. struct ib_uverbs_ex_modify_cq {
  1174. __u32 cq_handle;
  1175. __u32 attr_mask;
  1176. struct ib_uverbs_cq_moderation attr;
  1177. __u32 reserved;
  1178. };
  1179. #define IB_DEVICE_NAME_MAX 64
  1180. /*
  1181. * bits 9, 15, 16, 19, 22, 27, 30, 31, 32, 33, 35 and 37 may be set by old
  1182. * kernels and should not be used.
  1183. */
  1184. enum ib_uverbs_device_cap_flags {
  1185. IB_UVERBS_DEVICE_RESIZE_MAX_WR = 1 << 0,
  1186. IB_UVERBS_DEVICE_BAD_PKEY_CNTR = 1 << 1,
  1187. IB_UVERBS_DEVICE_BAD_QKEY_CNTR = 1 << 2,
  1188. IB_UVERBS_DEVICE_RAW_MULTI = 1 << 3,
  1189. IB_UVERBS_DEVICE_AUTO_PATH_MIG = 1 << 4,
  1190. IB_UVERBS_DEVICE_CHANGE_PHY_PORT = 1 << 5,
  1191. IB_UVERBS_DEVICE_UD_AV_PORT_ENFORCE = 1 << 6,
  1192. IB_UVERBS_DEVICE_CURR_QP_STATE_MOD = 1 << 7,
  1193. IB_UVERBS_DEVICE_SHUTDOWN_PORT = 1 << 8,
  1194. /* IB_UVERBS_DEVICE_INIT_TYPE = 1 << 9, (not in use) */
  1195. IB_UVERBS_DEVICE_PORT_ACTIVE_EVENT = 1 << 10,
  1196. IB_UVERBS_DEVICE_SYS_IMAGE_GUID = 1 << 11,
  1197. IB_UVERBS_DEVICE_RC_RNR_NAK_GEN = 1 << 12,
  1198. IB_UVERBS_DEVICE_SRQ_RESIZE = 1 << 13,
  1199. IB_UVERBS_DEVICE_N_NOTIFY_CQ = 1 << 14,
  1200. IB_UVERBS_DEVICE_MEM_WINDOW = 1 << 17,
  1201. IB_UVERBS_DEVICE_UD_IP_CSUM = 1 << 18,
  1202. IB_UVERBS_DEVICE_XRC = 1 << 20,
  1203. IB_UVERBS_DEVICE_MEM_MGT_EXTENSIONS = 1 << 21,
  1204. IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2A = 1 << 23,
  1205. IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2B = 1 << 24,
  1206. IB_UVERBS_DEVICE_RC_IP_CSUM = 1 << 25,
  1207. /* Deprecated. Please use IB_UVERBS_RAW_PACKET_CAP_IP_CSUM. */
  1208. IB_UVERBS_DEVICE_RAW_IP_CSUM = 1 << 26,
  1209. IB_UVERBS_DEVICE_MANAGED_FLOW_STEERING = 1 << 29,
  1210. /* Deprecated. Please use IB_UVERBS_RAW_PACKET_CAP_SCATTER_FCS. */
  1211. IB_UVERBS_DEVICE_RAW_SCATTER_FCS = 1ULL << 34,
  1212. IB_UVERBS_DEVICE_PCI_WRITE_END_PADDING = 1ULL << 36,
  1213. /* Flush placement types */
  1214. IB_UVERBS_DEVICE_FLUSH_GLOBAL = 1ULL << 38,
  1215. IB_UVERBS_DEVICE_FLUSH_PERSISTENT = 1ULL << 39,
  1216. /* Atomic write attributes */
  1217. IB_UVERBS_DEVICE_ATOMIC_WRITE = 1ULL << 40,
  1218. };
  1219. enum ib_uverbs_raw_packet_caps {
  1220. IB_UVERBS_RAW_PACKET_CAP_CVLAN_STRIPPING = 1 << 0,
  1221. IB_UVERBS_RAW_PACKET_CAP_SCATTER_FCS = 1 << 1,
  1222. IB_UVERBS_RAW_PACKET_CAP_IP_CSUM = 1 << 2,
  1223. IB_UVERBS_RAW_PACKET_CAP_DELAY_DROP = 1 << 3,
  1224. };
  1225. #endif /* IB_USER_VERBS_H */