device.h 24 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175
  1. /*
  2. * Copyright (c) 2013-2015, Mellanox Technologies. All rights reserved.
  3. *
  4. * This software is available to you under a choice of one of two
  5. * licenses. You may choose to be licensed under the terms of the GNU
  6. * General Public License (GPL) Version 2, available from the file
  7. * COPYING in the main directory of this source tree, or the
  8. * OpenIB.org BSD license below:
  9. *
  10. * Redistribution and use in source and binary forms, with or
  11. * without modification, are permitted provided that the following
  12. * conditions are met:
  13. *
  14. * - Redistributions of source code must retain the above
  15. * copyright notice, this list of conditions and the following
  16. * disclaimer.
  17. *
  18. * - Redistributions in binary form must reproduce the above
  19. * copyright notice, this list of conditions and the following
  20. * disclaimer in the documentation and/or other materials
  21. * provided with the distribution.
  22. *
  23. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  24. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  25. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  26. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  27. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  28. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  29. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  30. * SOFTWARE.
  31. */
  32. #ifndef MLX5_DEVICE_H
  33. #define MLX5_DEVICE_H
  34. #include <linux/types.h>
  35. #include <rdma/ib_verbs.h>
  36. #include <linux/mlx5/mlx5_ifc.h>
  37. #if defined(__LITTLE_ENDIAN)
  38. #define MLX5_SET_HOST_ENDIANNESS 0
  39. #elif defined(__BIG_ENDIAN)
  40. #define MLX5_SET_HOST_ENDIANNESS 0x80
  41. #else
  42. #error Host endianness not defined
  43. #endif
  44. /* helper macros */
  45. #define __mlx5_nullp(typ) ((struct mlx5_ifc_##typ##_bits *)0)
  46. #define __mlx5_bit_sz(typ, fld) sizeof(__mlx5_nullp(typ)->fld)
  47. #define __mlx5_bit_off(typ, fld) ((unsigned)(unsigned long)(&(__mlx5_nullp(typ)->fld)))
  48. #define __mlx5_dw_off(typ, fld) (__mlx5_bit_off(typ, fld) / 32)
  49. #define __mlx5_64_off(typ, fld) (__mlx5_bit_off(typ, fld) / 64)
  50. #define __mlx5_dw_bit_off(typ, fld) (32 - __mlx5_bit_sz(typ, fld) - (__mlx5_bit_off(typ, fld) & 0x1f))
  51. #define __mlx5_mask(typ, fld) ((u32)((1ull << __mlx5_bit_sz(typ, fld)) - 1))
  52. #define __mlx5_dw_mask(typ, fld) (__mlx5_mask(typ, fld) << __mlx5_dw_bit_off(typ, fld))
  53. #define __mlx5_st_sz_bits(typ) sizeof(struct mlx5_ifc_##typ##_bits)
  54. #define MLX5_FLD_SZ_BYTES(typ, fld) (__mlx5_bit_sz(typ, fld) / 8)
  55. #define MLX5_ST_SZ_BYTES(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 8)
  56. #define MLX5_ST_SZ_DW(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 32)
  57. #define MLX5_UN_SZ_BYTES(typ) (sizeof(union mlx5_ifc_##typ##_bits) / 8)
  58. #define MLX5_UN_SZ_DW(typ) (sizeof(union mlx5_ifc_##typ##_bits) / 32)
  59. #define MLX5_BYTE_OFF(typ, fld) (__mlx5_bit_off(typ, fld) / 8)
  60. #define MLX5_ADDR_OF(typ, p, fld) ((char *)(p) + MLX5_BYTE_OFF(typ, fld))
  61. /* insert a value to a struct */
  62. #define MLX5_SET(typ, p, fld, v) do { \
  63. BUILD_BUG_ON(__mlx5_st_sz_bits(typ) % 32); \
  64. *((__be32 *)(p) + __mlx5_dw_off(typ, fld)) = \
  65. cpu_to_be32((be32_to_cpu(*((__be32 *)(p) + __mlx5_dw_off(typ, fld))) & \
  66. (~__mlx5_dw_mask(typ, fld))) | (((v) & __mlx5_mask(typ, fld)) \
  67. << __mlx5_dw_bit_off(typ, fld))); \
  68. } while (0)
  69. #define MLX5_SET_TO_ONES(typ, p, fld) do { \
  70. BUILD_BUG_ON(__mlx5_st_sz_bits(typ) % 32); \
  71. *((__be32 *)(p) + __mlx5_dw_off(typ, fld)) = \
  72. cpu_to_be32((be32_to_cpu(*((__be32 *)(p) + __mlx5_dw_off(typ, fld))) & \
  73. (~__mlx5_dw_mask(typ, fld))) | ((__mlx5_mask(typ, fld)) \
  74. << __mlx5_dw_bit_off(typ, fld))); \
  75. } while (0)
  76. #define MLX5_GET(typ, p, fld) ((be32_to_cpu(*((__be32 *)(p) +\
  77. __mlx5_dw_off(typ, fld))) >> __mlx5_dw_bit_off(typ, fld)) & \
  78. __mlx5_mask(typ, fld))
  79. #define MLX5_GET_PR(typ, p, fld) ({ \
  80. u32 ___t = MLX5_GET(typ, p, fld); \
  81. pr_debug(#fld " = 0x%x\n", ___t); \
  82. ___t; \
  83. })
  84. #define MLX5_SET64(typ, p, fld, v) do { \
  85. BUILD_BUG_ON(__mlx5_bit_sz(typ, fld) != 64); \
  86. BUILD_BUG_ON(__mlx5_bit_off(typ, fld) % 64); \
  87. *((__be64 *)(p) + __mlx5_64_off(typ, fld)) = cpu_to_be64(v); \
  88. } while (0)
  89. #define MLX5_GET64(typ, p, fld) be64_to_cpu(*((__be64 *)(p) + __mlx5_64_off(typ, fld)))
  90. enum {
  91. MLX5_MAX_COMMANDS = 32,
  92. MLX5_CMD_DATA_BLOCK_SIZE = 512,
  93. MLX5_PCI_CMD_XPORT = 7,
  94. MLX5_MKEY_BSF_OCTO_SIZE = 4,
  95. MLX5_MAX_PSVS = 4,
  96. };
  97. enum {
  98. MLX5_EXTENDED_UD_AV = 0x80000000,
  99. };
  100. enum {
  101. MLX5_CQ_STATE_ARMED = 9,
  102. MLX5_CQ_STATE_ALWAYS_ARMED = 0xb,
  103. MLX5_CQ_STATE_FIRED = 0xa,
  104. };
  105. enum {
  106. MLX5_STAT_RATE_OFFSET = 5,
  107. };
  108. enum {
  109. MLX5_INLINE_SEG = 0x80000000,
  110. };
  111. enum {
  112. MLX5_MIN_PKEY_TABLE_SIZE = 128,
  113. MLX5_MAX_LOG_PKEY_TABLE = 5,
  114. };
  115. enum {
  116. MLX5_MKEY_INBOX_PG_ACCESS = 1 << 31
  117. };
  118. enum {
  119. MLX5_PFAULT_SUBTYPE_WQE = 0,
  120. MLX5_PFAULT_SUBTYPE_RDMA = 1,
  121. };
  122. enum {
  123. MLX5_PERM_LOCAL_READ = 1 << 2,
  124. MLX5_PERM_LOCAL_WRITE = 1 << 3,
  125. MLX5_PERM_REMOTE_READ = 1 << 4,
  126. MLX5_PERM_REMOTE_WRITE = 1 << 5,
  127. MLX5_PERM_ATOMIC = 1 << 6,
  128. MLX5_PERM_UMR_EN = 1 << 7,
  129. };
  130. enum {
  131. MLX5_PCIE_CTRL_SMALL_FENCE = 1 << 0,
  132. MLX5_PCIE_CTRL_RELAXED_ORDERING = 1 << 2,
  133. MLX5_PCIE_CTRL_NO_SNOOP = 1 << 3,
  134. MLX5_PCIE_CTRL_TLP_PROCE_EN = 1 << 6,
  135. MLX5_PCIE_CTRL_TPH_MASK = 3 << 4,
  136. };
  137. enum {
  138. MLX5_ACCESS_MODE_PA = 0,
  139. MLX5_ACCESS_MODE_MTT = 1,
  140. MLX5_ACCESS_MODE_KLM = 2
  141. };
  142. enum {
  143. MLX5_MKEY_REMOTE_INVAL = 1 << 24,
  144. MLX5_MKEY_FLAG_SYNC_UMR = 1 << 29,
  145. MLX5_MKEY_BSF_EN = 1 << 30,
  146. MLX5_MKEY_LEN64 = 1 << 31,
  147. };
  148. enum {
  149. MLX5_EN_RD = (u64)1,
  150. MLX5_EN_WR = (u64)2
  151. };
  152. enum {
  153. MLX5_BF_REGS_PER_PAGE = 4,
  154. MLX5_MAX_UAR_PAGES = 1 << 8,
  155. MLX5_NON_FP_BF_REGS_PER_PAGE = 2,
  156. MLX5_MAX_UUARS = MLX5_MAX_UAR_PAGES * MLX5_NON_FP_BF_REGS_PER_PAGE,
  157. };
  158. enum {
  159. MLX5_MKEY_MASK_LEN = 1ull << 0,
  160. MLX5_MKEY_MASK_PAGE_SIZE = 1ull << 1,
  161. MLX5_MKEY_MASK_START_ADDR = 1ull << 6,
  162. MLX5_MKEY_MASK_PD = 1ull << 7,
  163. MLX5_MKEY_MASK_EN_RINVAL = 1ull << 8,
  164. MLX5_MKEY_MASK_EN_SIGERR = 1ull << 9,
  165. MLX5_MKEY_MASK_BSF_EN = 1ull << 12,
  166. MLX5_MKEY_MASK_KEY = 1ull << 13,
  167. MLX5_MKEY_MASK_QPN = 1ull << 14,
  168. MLX5_MKEY_MASK_LR = 1ull << 17,
  169. MLX5_MKEY_MASK_LW = 1ull << 18,
  170. MLX5_MKEY_MASK_RR = 1ull << 19,
  171. MLX5_MKEY_MASK_RW = 1ull << 20,
  172. MLX5_MKEY_MASK_A = 1ull << 21,
  173. MLX5_MKEY_MASK_SMALL_FENCE = 1ull << 23,
  174. MLX5_MKEY_MASK_FREE = 1ull << 29,
  175. };
  176. enum {
  177. MLX5_UMR_TRANSLATION_OFFSET_EN = (1 << 4),
  178. MLX5_UMR_CHECK_NOT_FREE = (1 << 5),
  179. MLX5_UMR_CHECK_FREE = (2 << 5),
  180. MLX5_UMR_INLINE = (1 << 7),
  181. };
  182. #define MLX5_UMR_MTT_ALIGNMENT 0x40
  183. #define MLX5_UMR_MTT_MASK (MLX5_UMR_MTT_ALIGNMENT - 1)
  184. #define MLX5_UMR_MTT_MIN_CHUNK_SIZE MLX5_UMR_MTT_ALIGNMENT
  185. enum mlx5_event {
  186. MLX5_EVENT_TYPE_COMP = 0x0,
  187. MLX5_EVENT_TYPE_PATH_MIG = 0x01,
  188. MLX5_EVENT_TYPE_COMM_EST = 0x02,
  189. MLX5_EVENT_TYPE_SQ_DRAINED = 0x03,
  190. MLX5_EVENT_TYPE_SRQ_LAST_WQE = 0x13,
  191. MLX5_EVENT_TYPE_SRQ_RQ_LIMIT = 0x14,
  192. MLX5_EVENT_TYPE_CQ_ERROR = 0x04,
  193. MLX5_EVENT_TYPE_WQ_CATAS_ERROR = 0x05,
  194. MLX5_EVENT_TYPE_PATH_MIG_FAILED = 0x07,
  195. MLX5_EVENT_TYPE_WQ_INVAL_REQ_ERROR = 0x10,
  196. MLX5_EVENT_TYPE_WQ_ACCESS_ERROR = 0x11,
  197. MLX5_EVENT_TYPE_SRQ_CATAS_ERROR = 0x12,
  198. MLX5_EVENT_TYPE_INTERNAL_ERROR = 0x08,
  199. MLX5_EVENT_TYPE_PORT_CHANGE = 0x09,
  200. MLX5_EVENT_TYPE_GPIO_EVENT = 0x15,
  201. MLX5_EVENT_TYPE_REMOTE_CONFIG = 0x19,
  202. MLX5_EVENT_TYPE_DB_BF_CONGESTION = 0x1a,
  203. MLX5_EVENT_TYPE_STALL_EVENT = 0x1b,
  204. MLX5_EVENT_TYPE_CMD = 0x0a,
  205. MLX5_EVENT_TYPE_PAGE_REQUEST = 0xb,
  206. MLX5_EVENT_TYPE_PAGE_FAULT = 0xc,
  207. };
  208. enum {
  209. MLX5_PORT_CHANGE_SUBTYPE_DOWN = 1,
  210. MLX5_PORT_CHANGE_SUBTYPE_ACTIVE = 4,
  211. MLX5_PORT_CHANGE_SUBTYPE_INITIALIZED = 5,
  212. MLX5_PORT_CHANGE_SUBTYPE_LID = 6,
  213. MLX5_PORT_CHANGE_SUBTYPE_PKEY = 7,
  214. MLX5_PORT_CHANGE_SUBTYPE_GUID = 8,
  215. MLX5_PORT_CHANGE_SUBTYPE_CLIENT_REREG = 9,
  216. };
  217. enum {
  218. MLX5_DEV_CAP_FLAG_XRC = 1LL << 3,
  219. MLX5_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1LL << 8,
  220. MLX5_DEV_CAP_FLAG_BAD_QKEY_CNTR = 1LL << 9,
  221. MLX5_DEV_CAP_FLAG_APM = 1LL << 17,
  222. MLX5_DEV_CAP_FLAG_ATOMIC = 1LL << 18,
  223. MLX5_DEV_CAP_FLAG_BLOCK_MCAST = 1LL << 23,
  224. MLX5_DEV_CAP_FLAG_ON_DMND_PG = 1LL << 24,
  225. MLX5_DEV_CAP_FLAG_CQ_MODER = 1LL << 29,
  226. MLX5_DEV_CAP_FLAG_RESIZE_CQ = 1LL << 30,
  227. MLX5_DEV_CAP_FLAG_DCT = 1LL << 37,
  228. MLX5_DEV_CAP_FLAG_SIG_HAND_OVER = 1LL << 40,
  229. MLX5_DEV_CAP_FLAG_CMDIF_CSUM = 3LL << 46,
  230. };
  231. enum {
  232. MLX5_OPCODE_NOP = 0x00,
  233. MLX5_OPCODE_SEND_INVAL = 0x01,
  234. MLX5_OPCODE_RDMA_WRITE = 0x08,
  235. MLX5_OPCODE_RDMA_WRITE_IMM = 0x09,
  236. MLX5_OPCODE_SEND = 0x0a,
  237. MLX5_OPCODE_SEND_IMM = 0x0b,
  238. MLX5_OPCODE_LSO = 0x0e,
  239. MLX5_OPCODE_RDMA_READ = 0x10,
  240. MLX5_OPCODE_ATOMIC_CS = 0x11,
  241. MLX5_OPCODE_ATOMIC_FA = 0x12,
  242. MLX5_OPCODE_ATOMIC_MASKED_CS = 0x14,
  243. MLX5_OPCODE_ATOMIC_MASKED_FA = 0x15,
  244. MLX5_OPCODE_BIND_MW = 0x18,
  245. MLX5_OPCODE_CONFIG_CMD = 0x1f,
  246. MLX5_RECV_OPCODE_RDMA_WRITE_IMM = 0x00,
  247. MLX5_RECV_OPCODE_SEND = 0x01,
  248. MLX5_RECV_OPCODE_SEND_IMM = 0x02,
  249. MLX5_RECV_OPCODE_SEND_INVAL = 0x03,
  250. MLX5_CQE_OPCODE_ERROR = 0x1e,
  251. MLX5_CQE_OPCODE_RESIZE = 0x16,
  252. MLX5_OPCODE_SET_PSV = 0x20,
  253. MLX5_OPCODE_GET_PSV = 0x21,
  254. MLX5_OPCODE_CHECK_PSV = 0x22,
  255. MLX5_OPCODE_RGET_PSV = 0x26,
  256. MLX5_OPCODE_RCHECK_PSV = 0x27,
  257. MLX5_OPCODE_UMR = 0x25,
  258. };
  259. enum {
  260. MLX5_SET_PORT_RESET_QKEY = 0,
  261. MLX5_SET_PORT_GUID0 = 16,
  262. MLX5_SET_PORT_NODE_GUID = 17,
  263. MLX5_SET_PORT_SYS_GUID = 18,
  264. MLX5_SET_PORT_GID_TABLE = 19,
  265. MLX5_SET_PORT_PKEY_TABLE = 20,
  266. };
  267. enum {
  268. MLX5_MAX_PAGE_SHIFT = 31
  269. };
  270. enum {
  271. MLX5_ADAPTER_PAGE_SHIFT = 12,
  272. MLX5_ADAPTER_PAGE_SIZE = 1 << MLX5_ADAPTER_PAGE_SHIFT,
  273. };
  274. enum {
  275. MLX5_CAP_OFF_CMDIF_CSUM = 46,
  276. };
  277. struct mlx5_inbox_hdr {
  278. __be16 opcode;
  279. u8 rsvd[4];
  280. __be16 opmod;
  281. };
  282. struct mlx5_outbox_hdr {
  283. u8 status;
  284. u8 rsvd[3];
  285. __be32 syndrome;
  286. };
  287. struct mlx5_cmd_query_adapter_mbox_in {
  288. struct mlx5_inbox_hdr hdr;
  289. u8 rsvd[8];
  290. };
  291. struct mlx5_cmd_query_adapter_mbox_out {
  292. struct mlx5_outbox_hdr hdr;
  293. u8 rsvd0[24];
  294. u8 intapin;
  295. u8 rsvd1[13];
  296. __be16 vsd_vendor_id;
  297. u8 vsd[208];
  298. u8 vsd_psid[16];
  299. };
  300. enum mlx5_odp_transport_cap_bits {
  301. MLX5_ODP_SUPPORT_SEND = 1 << 31,
  302. MLX5_ODP_SUPPORT_RECV = 1 << 30,
  303. MLX5_ODP_SUPPORT_WRITE = 1 << 29,
  304. MLX5_ODP_SUPPORT_READ = 1 << 28,
  305. };
  306. struct mlx5_odp_caps {
  307. char reserved[0x10];
  308. struct {
  309. __be32 rc_odp_caps;
  310. __be32 uc_odp_caps;
  311. __be32 ud_odp_caps;
  312. } per_transport_caps;
  313. char reserved2[0xe4];
  314. };
  315. struct mlx5_cmd_init_hca_mbox_in {
  316. struct mlx5_inbox_hdr hdr;
  317. u8 rsvd0[2];
  318. __be16 profile;
  319. u8 rsvd1[4];
  320. };
  321. struct mlx5_cmd_init_hca_mbox_out {
  322. struct mlx5_outbox_hdr hdr;
  323. u8 rsvd[8];
  324. };
  325. struct mlx5_cmd_teardown_hca_mbox_in {
  326. struct mlx5_inbox_hdr hdr;
  327. u8 rsvd0[2];
  328. __be16 profile;
  329. u8 rsvd1[4];
  330. };
  331. struct mlx5_cmd_teardown_hca_mbox_out {
  332. struct mlx5_outbox_hdr hdr;
  333. u8 rsvd[8];
  334. };
  335. struct mlx5_cmd_layout {
  336. u8 type;
  337. u8 rsvd0[3];
  338. __be32 inlen;
  339. __be64 in_ptr;
  340. __be32 in[4];
  341. __be32 out[4];
  342. __be64 out_ptr;
  343. __be32 outlen;
  344. u8 token;
  345. u8 sig;
  346. u8 rsvd1;
  347. u8 status_own;
  348. };
  349. struct health_buffer {
  350. __be32 assert_var[5];
  351. __be32 rsvd0[3];
  352. __be32 assert_exit_ptr;
  353. __be32 assert_callra;
  354. __be32 rsvd1[2];
  355. __be32 fw_ver;
  356. __be32 hw_id;
  357. __be32 rsvd2;
  358. u8 irisc_index;
  359. u8 synd;
  360. __be16 ext_sync;
  361. };
  362. struct mlx5_init_seg {
  363. __be32 fw_rev;
  364. __be32 cmdif_rev_fw_sub;
  365. __be32 rsvd0[2];
  366. __be32 cmdq_addr_h;
  367. __be32 cmdq_addr_l_sz;
  368. __be32 cmd_dbell;
  369. __be32 rsvd1[121];
  370. struct health_buffer health;
  371. __be32 rsvd2[884];
  372. __be32 health_counter;
  373. __be32 rsvd3[1019];
  374. __be64 ieee1588_clk;
  375. __be32 ieee1588_clk_type;
  376. __be32 clr_intx;
  377. };
  378. struct mlx5_eqe_comp {
  379. __be32 reserved[6];
  380. __be32 cqn;
  381. };
  382. struct mlx5_eqe_qp_srq {
  383. __be32 reserved[6];
  384. __be32 qp_srq_n;
  385. };
  386. struct mlx5_eqe_cq_err {
  387. __be32 cqn;
  388. u8 reserved1[7];
  389. u8 syndrome;
  390. };
  391. struct mlx5_eqe_port_state {
  392. u8 reserved0[8];
  393. u8 port;
  394. };
  395. struct mlx5_eqe_gpio {
  396. __be32 reserved0[2];
  397. __be64 gpio_event;
  398. };
  399. struct mlx5_eqe_congestion {
  400. u8 type;
  401. u8 rsvd0;
  402. u8 congestion_level;
  403. };
  404. struct mlx5_eqe_stall_vl {
  405. u8 rsvd0[3];
  406. u8 port_vl;
  407. };
  408. struct mlx5_eqe_cmd {
  409. __be32 vector;
  410. __be32 rsvd[6];
  411. };
  412. struct mlx5_eqe_page_req {
  413. u8 rsvd0[2];
  414. __be16 func_id;
  415. __be32 num_pages;
  416. __be32 rsvd1[5];
  417. };
  418. struct mlx5_eqe_page_fault {
  419. __be32 bytes_committed;
  420. union {
  421. struct {
  422. u16 reserved1;
  423. __be16 wqe_index;
  424. u16 reserved2;
  425. __be16 packet_length;
  426. u8 reserved3[12];
  427. } __packed wqe;
  428. struct {
  429. __be32 r_key;
  430. u16 reserved1;
  431. __be16 packet_length;
  432. __be32 rdma_op_len;
  433. __be64 rdma_va;
  434. } __packed rdma;
  435. } __packed;
  436. __be32 flags_qpn;
  437. } __packed;
  438. union ev_data {
  439. __be32 raw[7];
  440. struct mlx5_eqe_cmd cmd;
  441. struct mlx5_eqe_comp comp;
  442. struct mlx5_eqe_qp_srq qp_srq;
  443. struct mlx5_eqe_cq_err cq_err;
  444. struct mlx5_eqe_port_state port;
  445. struct mlx5_eqe_gpio gpio;
  446. struct mlx5_eqe_congestion cong;
  447. struct mlx5_eqe_stall_vl stall_vl;
  448. struct mlx5_eqe_page_req req_pages;
  449. struct mlx5_eqe_page_fault page_fault;
  450. } __packed;
  451. struct mlx5_eqe {
  452. u8 rsvd0;
  453. u8 type;
  454. u8 rsvd1;
  455. u8 sub_type;
  456. __be32 rsvd2[7];
  457. union ev_data data;
  458. __be16 rsvd3;
  459. u8 signature;
  460. u8 owner;
  461. } __packed;
  462. struct mlx5_cmd_prot_block {
  463. u8 data[MLX5_CMD_DATA_BLOCK_SIZE];
  464. u8 rsvd0[48];
  465. __be64 next;
  466. __be32 block_num;
  467. u8 rsvd1;
  468. u8 token;
  469. u8 ctrl_sig;
  470. u8 sig;
  471. };
  472. enum {
  473. MLX5_CQE_SYND_FLUSHED_IN_ERROR = 5,
  474. };
  475. struct mlx5_err_cqe {
  476. u8 rsvd0[32];
  477. __be32 srqn;
  478. u8 rsvd1[18];
  479. u8 vendor_err_synd;
  480. u8 syndrome;
  481. __be32 s_wqe_opcode_qpn;
  482. __be16 wqe_counter;
  483. u8 signature;
  484. u8 op_own;
  485. };
  486. struct mlx5_cqe64 {
  487. u8 rsvd0[4];
  488. u8 lro_tcppsh_abort_dupack;
  489. u8 lro_min_ttl;
  490. __be16 lro_tcp_win;
  491. __be32 lro_ack_seq_num;
  492. __be32 rss_hash_result;
  493. u8 rss_hash_type;
  494. u8 ml_path;
  495. u8 rsvd20[2];
  496. __be16 check_sum;
  497. __be16 slid;
  498. __be32 flags_rqpn;
  499. u8 hds_ip_ext;
  500. u8 l4_hdr_type_etc;
  501. __be16 vlan_info;
  502. __be32 srqn; /* [31:24]: lro_num_seg, [23:0]: srqn */
  503. __be32 imm_inval_pkey;
  504. u8 rsvd40[4];
  505. __be32 byte_cnt;
  506. __be64 timestamp;
  507. __be32 sop_drop_qpn;
  508. __be16 wqe_counter;
  509. u8 signature;
  510. u8 op_own;
  511. };
  512. static inline int get_cqe_lro_tcppsh(struct mlx5_cqe64 *cqe)
  513. {
  514. return (cqe->lro_tcppsh_abort_dupack >> 6) & 1;
  515. }
  516. static inline u8 get_cqe_l4_hdr_type(struct mlx5_cqe64 *cqe)
  517. {
  518. return (cqe->l4_hdr_type_etc >> 4) & 0x7;
  519. }
  520. static inline int cqe_has_vlan(struct mlx5_cqe64 *cqe)
  521. {
  522. return !!(cqe->l4_hdr_type_etc & 0x1);
  523. }
  524. enum {
  525. CQE_L4_HDR_TYPE_NONE = 0x0,
  526. CQE_L4_HDR_TYPE_TCP_NO_ACK = 0x1,
  527. CQE_L4_HDR_TYPE_UDP = 0x2,
  528. CQE_L4_HDR_TYPE_TCP_ACK_NO_DATA = 0x3,
  529. CQE_L4_HDR_TYPE_TCP_ACK_AND_DATA = 0x4,
  530. };
  531. enum {
  532. CQE_RSS_HTYPE_IP = 0x3 << 6,
  533. CQE_RSS_HTYPE_L4 = 0x3 << 2,
  534. };
  535. enum {
  536. CQE_L2_OK = 1 << 0,
  537. CQE_L3_OK = 1 << 1,
  538. CQE_L4_OK = 1 << 2,
  539. };
  540. struct mlx5_sig_err_cqe {
  541. u8 rsvd0[16];
  542. __be32 expected_trans_sig;
  543. __be32 actual_trans_sig;
  544. __be32 expected_reftag;
  545. __be32 actual_reftag;
  546. __be16 syndrome;
  547. u8 rsvd22[2];
  548. __be32 mkey;
  549. __be64 err_offset;
  550. u8 rsvd30[8];
  551. __be32 qpn;
  552. u8 rsvd38[2];
  553. u8 signature;
  554. u8 op_own;
  555. };
  556. struct mlx5_wqe_srq_next_seg {
  557. u8 rsvd0[2];
  558. __be16 next_wqe_index;
  559. u8 signature;
  560. u8 rsvd1[11];
  561. };
  562. union mlx5_ext_cqe {
  563. struct ib_grh grh;
  564. u8 inl[64];
  565. };
  566. struct mlx5_cqe128 {
  567. union mlx5_ext_cqe inl_grh;
  568. struct mlx5_cqe64 cqe64;
  569. };
  570. struct mlx5_srq_ctx {
  571. u8 state_log_sz;
  572. u8 rsvd0[3];
  573. __be32 flags_xrcd;
  574. __be32 pgoff_cqn;
  575. u8 rsvd1[4];
  576. u8 log_pg_sz;
  577. u8 rsvd2[7];
  578. __be32 pd;
  579. __be16 lwm;
  580. __be16 wqe_cnt;
  581. u8 rsvd3[8];
  582. __be64 db_record;
  583. };
  584. struct mlx5_create_srq_mbox_in {
  585. struct mlx5_inbox_hdr hdr;
  586. __be32 input_srqn;
  587. u8 rsvd0[4];
  588. struct mlx5_srq_ctx ctx;
  589. u8 rsvd1[208];
  590. __be64 pas[0];
  591. };
  592. struct mlx5_create_srq_mbox_out {
  593. struct mlx5_outbox_hdr hdr;
  594. __be32 srqn;
  595. u8 rsvd[4];
  596. };
  597. struct mlx5_destroy_srq_mbox_in {
  598. struct mlx5_inbox_hdr hdr;
  599. __be32 srqn;
  600. u8 rsvd[4];
  601. };
  602. struct mlx5_destroy_srq_mbox_out {
  603. struct mlx5_outbox_hdr hdr;
  604. u8 rsvd[8];
  605. };
  606. struct mlx5_query_srq_mbox_in {
  607. struct mlx5_inbox_hdr hdr;
  608. __be32 srqn;
  609. u8 rsvd0[4];
  610. };
  611. struct mlx5_query_srq_mbox_out {
  612. struct mlx5_outbox_hdr hdr;
  613. u8 rsvd0[8];
  614. struct mlx5_srq_ctx ctx;
  615. u8 rsvd1[32];
  616. __be64 pas[0];
  617. };
  618. struct mlx5_arm_srq_mbox_in {
  619. struct mlx5_inbox_hdr hdr;
  620. __be32 srqn;
  621. __be16 rsvd;
  622. __be16 lwm;
  623. };
  624. struct mlx5_arm_srq_mbox_out {
  625. struct mlx5_outbox_hdr hdr;
  626. u8 rsvd[8];
  627. };
  628. struct mlx5_cq_context {
  629. u8 status;
  630. u8 cqe_sz_flags;
  631. u8 st;
  632. u8 rsvd3;
  633. u8 rsvd4[6];
  634. __be16 page_offset;
  635. __be32 log_sz_usr_page;
  636. __be16 cq_period;
  637. __be16 cq_max_count;
  638. __be16 rsvd20;
  639. __be16 c_eqn;
  640. u8 log_pg_sz;
  641. u8 rsvd25[7];
  642. __be32 last_notified_index;
  643. __be32 solicit_producer_index;
  644. __be32 consumer_counter;
  645. __be32 producer_counter;
  646. u8 rsvd48[8];
  647. __be64 db_record_addr;
  648. };
  649. struct mlx5_create_cq_mbox_in {
  650. struct mlx5_inbox_hdr hdr;
  651. __be32 input_cqn;
  652. u8 rsvdx[4];
  653. struct mlx5_cq_context ctx;
  654. u8 rsvd6[192];
  655. __be64 pas[0];
  656. };
  657. struct mlx5_create_cq_mbox_out {
  658. struct mlx5_outbox_hdr hdr;
  659. __be32 cqn;
  660. u8 rsvd0[4];
  661. };
  662. struct mlx5_destroy_cq_mbox_in {
  663. struct mlx5_inbox_hdr hdr;
  664. __be32 cqn;
  665. u8 rsvd0[4];
  666. };
  667. struct mlx5_destroy_cq_mbox_out {
  668. struct mlx5_outbox_hdr hdr;
  669. u8 rsvd0[8];
  670. };
  671. struct mlx5_query_cq_mbox_in {
  672. struct mlx5_inbox_hdr hdr;
  673. __be32 cqn;
  674. u8 rsvd0[4];
  675. };
  676. struct mlx5_query_cq_mbox_out {
  677. struct mlx5_outbox_hdr hdr;
  678. u8 rsvd0[8];
  679. struct mlx5_cq_context ctx;
  680. u8 rsvd6[16];
  681. __be64 pas[0];
  682. };
  683. struct mlx5_modify_cq_mbox_in {
  684. struct mlx5_inbox_hdr hdr;
  685. __be32 cqn;
  686. __be32 field_select;
  687. struct mlx5_cq_context ctx;
  688. u8 rsvd[192];
  689. __be64 pas[0];
  690. };
  691. struct mlx5_modify_cq_mbox_out {
  692. struct mlx5_outbox_hdr hdr;
  693. u8 rsvd[8];
  694. };
  695. struct mlx5_enable_hca_mbox_in {
  696. struct mlx5_inbox_hdr hdr;
  697. u8 rsvd[8];
  698. };
  699. struct mlx5_enable_hca_mbox_out {
  700. struct mlx5_outbox_hdr hdr;
  701. u8 rsvd[8];
  702. };
  703. struct mlx5_disable_hca_mbox_in {
  704. struct mlx5_inbox_hdr hdr;
  705. u8 rsvd[8];
  706. };
  707. struct mlx5_disable_hca_mbox_out {
  708. struct mlx5_outbox_hdr hdr;
  709. u8 rsvd[8];
  710. };
  711. struct mlx5_eq_context {
  712. u8 status;
  713. u8 ec_oi;
  714. u8 st;
  715. u8 rsvd2[7];
  716. __be16 page_pffset;
  717. __be32 log_sz_usr_page;
  718. u8 rsvd3[7];
  719. u8 intr;
  720. u8 log_page_size;
  721. u8 rsvd4[15];
  722. __be32 consumer_counter;
  723. __be32 produser_counter;
  724. u8 rsvd5[16];
  725. };
  726. struct mlx5_create_eq_mbox_in {
  727. struct mlx5_inbox_hdr hdr;
  728. u8 rsvd0[3];
  729. u8 input_eqn;
  730. u8 rsvd1[4];
  731. struct mlx5_eq_context ctx;
  732. u8 rsvd2[8];
  733. __be64 events_mask;
  734. u8 rsvd3[176];
  735. __be64 pas[0];
  736. };
  737. struct mlx5_create_eq_mbox_out {
  738. struct mlx5_outbox_hdr hdr;
  739. u8 rsvd0[3];
  740. u8 eq_number;
  741. u8 rsvd1[4];
  742. };
  743. struct mlx5_destroy_eq_mbox_in {
  744. struct mlx5_inbox_hdr hdr;
  745. u8 rsvd0[3];
  746. u8 eqn;
  747. u8 rsvd1[4];
  748. };
  749. struct mlx5_destroy_eq_mbox_out {
  750. struct mlx5_outbox_hdr hdr;
  751. u8 rsvd[8];
  752. };
  753. struct mlx5_map_eq_mbox_in {
  754. struct mlx5_inbox_hdr hdr;
  755. __be64 mask;
  756. u8 mu;
  757. u8 rsvd0[2];
  758. u8 eqn;
  759. u8 rsvd1[24];
  760. };
  761. struct mlx5_map_eq_mbox_out {
  762. struct mlx5_outbox_hdr hdr;
  763. u8 rsvd[8];
  764. };
  765. struct mlx5_query_eq_mbox_in {
  766. struct mlx5_inbox_hdr hdr;
  767. u8 rsvd0[3];
  768. u8 eqn;
  769. u8 rsvd1[4];
  770. };
  771. struct mlx5_query_eq_mbox_out {
  772. struct mlx5_outbox_hdr hdr;
  773. u8 rsvd[8];
  774. struct mlx5_eq_context ctx;
  775. };
  776. enum {
  777. MLX5_MKEY_STATUS_FREE = 1 << 6,
  778. };
  779. struct mlx5_mkey_seg {
  780. /* This is a two bit field occupying bits 31-30.
  781. * bit 31 is always 0,
  782. * bit 30 is zero for regular MRs and 1 (e.g free) for UMRs that do not have tanslation
  783. */
  784. u8 status;
  785. u8 pcie_control;
  786. u8 flags;
  787. u8 version;
  788. __be32 qpn_mkey7_0;
  789. u8 rsvd1[4];
  790. __be32 flags_pd;
  791. __be64 start_addr;
  792. __be64 len;
  793. __be32 bsfs_octo_size;
  794. u8 rsvd2[16];
  795. __be32 xlt_oct_size;
  796. u8 rsvd3[3];
  797. u8 log2_page_size;
  798. u8 rsvd4[4];
  799. };
  800. struct mlx5_query_special_ctxs_mbox_in {
  801. struct mlx5_inbox_hdr hdr;
  802. u8 rsvd[8];
  803. };
  804. struct mlx5_query_special_ctxs_mbox_out {
  805. struct mlx5_outbox_hdr hdr;
  806. __be32 dump_fill_mkey;
  807. __be32 reserved_lkey;
  808. };
  809. struct mlx5_create_mkey_mbox_in {
  810. struct mlx5_inbox_hdr hdr;
  811. __be32 input_mkey_index;
  812. __be32 flags;
  813. struct mlx5_mkey_seg seg;
  814. u8 rsvd1[16];
  815. __be32 xlat_oct_act_size;
  816. __be32 rsvd2;
  817. u8 rsvd3[168];
  818. __be64 pas[0];
  819. };
  820. struct mlx5_create_mkey_mbox_out {
  821. struct mlx5_outbox_hdr hdr;
  822. __be32 mkey;
  823. u8 rsvd[4];
  824. };
  825. struct mlx5_destroy_mkey_mbox_in {
  826. struct mlx5_inbox_hdr hdr;
  827. __be32 mkey;
  828. u8 rsvd[4];
  829. };
  830. struct mlx5_destroy_mkey_mbox_out {
  831. struct mlx5_outbox_hdr hdr;
  832. u8 rsvd[8];
  833. };
  834. struct mlx5_query_mkey_mbox_in {
  835. struct mlx5_inbox_hdr hdr;
  836. __be32 mkey;
  837. };
  838. struct mlx5_query_mkey_mbox_out {
  839. struct mlx5_outbox_hdr hdr;
  840. __be64 pas[0];
  841. };
  842. struct mlx5_modify_mkey_mbox_in {
  843. struct mlx5_inbox_hdr hdr;
  844. __be32 mkey;
  845. __be64 pas[0];
  846. };
  847. struct mlx5_modify_mkey_mbox_out {
  848. struct mlx5_outbox_hdr hdr;
  849. u8 rsvd[8];
  850. };
  851. struct mlx5_dump_mkey_mbox_in {
  852. struct mlx5_inbox_hdr hdr;
  853. };
  854. struct mlx5_dump_mkey_mbox_out {
  855. struct mlx5_outbox_hdr hdr;
  856. __be32 mkey;
  857. };
  858. struct mlx5_mad_ifc_mbox_in {
  859. struct mlx5_inbox_hdr hdr;
  860. __be16 remote_lid;
  861. u8 rsvd0;
  862. u8 port;
  863. u8 rsvd1[4];
  864. u8 data[256];
  865. };
  866. struct mlx5_mad_ifc_mbox_out {
  867. struct mlx5_outbox_hdr hdr;
  868. u8 rsvd[8];
  869. u8 data[256];
  870. };
  871. struct mlx5_access_reg_mbox_in {
  872. struct mlx5_inbox_hdr hdr;
  873. u8 rsvd0[2];
  874. __be16 register_id;
  875. __be32 arg;
  876. __be32 data[0];
  877. };
  878. struct mlx5_access_reg_mbox_out {
  879. struct mlx5_outbox_hdr hdr;
  880. u8 rsvd[8];
  881. __be32 data[0];
  882. };
  883. #define MLX5_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90)
  884. enum {
  885. MLX_EXT_PORT_CAP_FLAG_EXTENDED_PORT_INFO = 1 << 0
  886. };
  887. struct mlx5_allocate_psv_in {
  888. struct mlx5_inbox_hdr hdr;
  889. __be32 npsv_pd;
  890. __be32 rsvd_psv0;
  891. };
  892. struct mlx5_allocate_psv_out {
  893. struct mlx5_outbox_hdr hdr;
  894. u8 rsvd[8];
  895. __be32 psv_idx[4];
  896. };
  897. struct mlx5_destroy_psv_in {
  898. struct mlx5_inbox_hdr hdr;
  899. __be32 psv_number;
  900. u8 rsvd[4];
  901. };
  902. struct mlx5_destroy_psv_out {
  903. struct mlx5_outbox_hdr hdr;
  904. u8 rsvd[8];
  905. };
  906. #define MLX5_CMD_OP_MAX 0x920
  907. enum {
  908. VPORT_STATE_DOWN = 0x0,
  909. VPORT_STATE_UP = 0x1,
  910. };
  911. enum {
  912. MLX5_L3_PROT_TYPE_IPV4 = 0,
  913. MLX5_L3_PROT_TYPE_IPV6 = 1,
  914. };
  915. enum {
  916. MLX5_L4_PROT_TYPE_TCP = 0,
  917. MLX5_L4_PROT_TYPE_UDP = 1,
  918. };
  919. enum {
  920. MLX5_HASH_FIELD_SEL_SRC_IP = 1 << 0,
  921. MLX5_HASH_FIELD_SEL_DST_IP = 1 << 1,
  922. MLX5_HASH_FIELD_SEL_L4_SPORT = 1 << 2,
  923. MLX5_HASH_FIELD_SEL_L4_DPORT = 1 << 3,
  924. MLX5_HASH_FIELD_SEL_IPSEC_SPI = 1 << 4,
  925. };
  926. enum {
  927. MLX5_MATCH_OUTER_HEADERS = 1 << 0,
  928. MLX5_MATCH_MISC_PARAMETERS = 1 << 1,
  929. MLX5_MATCH_INNER_HEADERS = 1 << 2,
  930. };
  931. enum {
  932. MLX5_FLOW_TABLE_TYPE_NIC_RCV = 0,
  933. MLX5_FLOW_TABLE_TYPE_ESWITCH = 4,
  934. };
  935. enum {
  936. MLX5_FLOW_CONTEXT_DEST_TYPE_VPORT = 0,
  937. MLX5_FLOW_CONTEXT_DEST_TYPE_FLOW_TABLE = 1,
  938. MLX5_FLOW_CONTEXT_DEST_TYPE_TIR = 2,
  939. };
  940. enum {
  941. MLX5_RQC_RQ_TYPE_MEMORY_RQ_INLINE = 0x0,
  942. MLX5_RQC_RQ_TYPE_MEMORY_RQ_RPM = 0x1,
  943. };
  944. /* MLX5 DEV CAPs */
  945. /* TODO: EAT.ME */
  946. enum mlx5_cap_mode {
  947. HCA_CAP_OPMOD_GET_MAX = 0,
  948. HCA_CAP_OPMOD_GET_CUR = 1,
  949. };
  950. enum mlx5_cap_type {
  951. MLX5_CAP_GENERAL = 0,
  952. MLX5_CAP_ETHERNET_OFFLOADS,
  953. MLX5_CAP_ODP,
  954. MLX5_CAP_ATOMIC,
  955. MLX5_CAP_ROCE,
  956. MLX5_CAP_IPOIB_OFFLOADS,
  957. MLX5_CAP_EOIB_OFFLOADS,
  958. MLX5_CAP_FLOW_TABLE,
  959. /* NUM OF CAP Types */
  960. MLX5_CAP_NUM
  961. };
  962. /* GET Dev Caps macros */
  963. #define MLX5_CAP_GEN(mdev, cap) \
  964. MLX5_GET(cmd_hca_cap, mdev->hca_caps_cur[MLX5_CAP_GENERAL], cap)
  965. #define MLX5_CAP_GEN_MAX(mdev, cap) \
  966. MLX5_GET(cmd_hca_cap, mdev->hca_caps_max[MLX5_CAP_GENERAL], cap)
  967. #define MLX5_CAP_ETH(mdev, cap) \
  968. MLX5_GET(per_protocol_networking_offload_caps,\
  969. mdev->hca_caps_cur[MLX5_CAP_ETHERNET_OFFLOADS], cap)
  970. #define MLX5_CAP_ETH_MAX(mdev, cap) \
  971. MLX5_GET(per_protocol_networking_offload_caps,\
  972. mdev->hca_caps_max[MLX5_CAP_ETHERNET_OFFLOADS], cap)
  973. #define MLX5_CAP_ROCE(mdev, cap) \
  974. MLX5_GET(roce_cap, mdev->hca_caps_cur[MLX5_CAP_ROCE], cap)
  975. #define MLX5_CAP_ROCE_MAX(mdev, cap) \
  976. MLX5_GET(roce_cap, mdev->hca_caps_max[MLX5_CAP_ROCE], cap)
  977. #define MLX5_CAP_ATOMIC(mdev, cap) \
  978. MLX5_GET(atomic_caps, mdev->hca_caps_cur[MLX5_CAP_ATOMIC], cap)
  979. #define MLX5_CAP_ATOMIC_MAX(mdev, cap) \
  980. MLX5_GET(atomic_caps, mdev->hca_caps_max[MLX5_CAP_ATOMIC], cap)
  981. #define MLX5_CAP_FLOWTABLE(mdev, cap) \
  982. MLX5_GET(flow_table_nic_cap, mdev->hca_caps_cur[MLX5_CAP_FLOW_TABLE], cap)
  983. #define MLX5_CAP_FLOWTABLE_MAX(mdev, cap) \
  984. MLX5_GET(flow_table_nic_cap, mdev->hca_caps_max[MLX5_CAP_FLOW_TABLE], cap)
  985. #define MLX5_CAP_ODP(mdev, cap)\
  986. MLX5_GET(odp_cap, mdev->hca_caps_cur[MLX5_CAP_ODP], cap)
  987. enum {
  988. MLX5_CMD_STAT_OK = 0x0,
  989. MLX5_CMD_STAT_INT_ERR = 0x1,
  990. MLX5_CMD_STAT_BAD_OP_ERR = 0x2,
  991. MLX5_CMD_STAT_BAD_PARAM_ERR = 0x3,
  992. MLX5_CMD_STAT_BAD_SYS_STATE_ERR = 0x4,
  993. MLX5_CMD_STAT_BAD_RES_ERR = 0x5,
  994. MLX5_CMD_STAT_RES_BUSY = 0x6,
  995. MLX5_CMD_STAT_LIM_ERR = 0x8,
  996. MLX5_CMD_STAT_BAD_RES_STATE_ERR = 0x9,
  997. MLX5_CMD_STAT_IX_ERR = 0xa,
  998. MLX5_CMD_STAT_NO_RES_ERR = 0xf,
  999. MLX5_CMD_STAT_BAD_INP_LEN_ERR = 0x50,
  1000. MLX5_CMD_STAT_BAD_OUTP_LEN_ERR = 0x51,
  1001. MLX5_CMD_STAT_BAD_QP_STATE_ERR = 0x10,
  1002. MLX5_CMD_STAT_BAD_PKT_ERR = 0x30,
  1003. MLX5_CMD_STAT_BAD_SIZE_OUTS_CQES_ERR = 0x40,
  1004. };
  1005. #endif /* MLX5_DEVICE_H */