ib_user_verbs.h 28 KB

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