pvrdma_dev_api.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  1. /*
  2. * Copyright (c) 2012-2016 VMware, Inc. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of EITHER the GNU General Public License
  6. * version 2 as published by the Free Software Foundation or the BSD
  7. * 2-Clause License. This program is distributed in the hope that it
  8. * will be useful, but WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED
  9. * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  10. * See the GNU General Public License version 2 for more details at
  11. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program available in the file COPYING in the main
  15. * directory of this source tree.
  16. *
  17. * The BSD 2-Clause License
  18. *
  19. * Redistribution and use in source and binary forms, with or
  20. * without modification, are permitted provided that the following
  21. * conditions are met:
  22. *
  23. * - Redistributions of source code must retain the above
  24. * copyright notice, this list of conditions and the following
  25. * disclaimer.
  26. *
  27. * - Redistributions in binary form must reproduce the above
  28. * copyright notice, this list of conditions and the following
  29. * disclaimer in the documentation and/or other materials
  30. * provided with the distribution.
  31. *
  32. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  33. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  34. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  35. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  36. * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  37. * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  38. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  39. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  40. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  41. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  42. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  43. * OF THE POSSIBILITY OF SUCH DAMAGE.
  44. */
  45. #ifndef __PVRDMA_DEV_API_H__
  46. #define __PVRDMA_DEV_API_H__
  47. #include <linux/types.h>
  48. #include "pvrdma_verbs.h"
  49. #define PVRDMA_VERSION 17
  50. #define PVRDMA_BOARD_ID 1
  51. #define PVRDMA_REV_ID 1
  52. /*
  53. * Masks and accessors for page directory, which is a two-level lookup:
  54. * page directory -> page table -> page. Only one directory for now, but we
  55. * could expand that easily. 9 bits for tables, 9 bits for pages, gives one
  56. * gigabyte for memory regions and so forth.
  57. */
  58. #define PVRDMA_PDIR_SHIFT 18
  59. #define PVRDMA_PTABLE_SHIFT 9
  60. #define PVRDMA_PAGE_DIR_DIR(x) (((x) >> PVRDMA_PDIR_SHIFT) & 0x1)
  61. #define PVRDMA_PAGE_DIR_TABLE(x) (((x) >> PVRDMA_PTABLE_SHIFT) & 0x1ff)
  62. #define PVRDMA_PAGE_DIR_PAGE(x) ((x) & 0x1ff)
  63. #define PVRDMA_PAGE_DIR_MAX_PAGES (1 * 512 * 512)
  64. #define PVRDMA_MAX_FAST_REG_PAGES 128
  65. /*
  66. * Max MSI-X vectors.
  67. */
  68. #define PVRDMA_MAX_INTERRUPTS 3
  69. /* Register offsets within PCI resource on BAR1. */
  70. #define PVRDMA_REG_VERSION 0x00 /* R: Version of device. */
  71. #define PVRDMA_REG_DSRLOW 0x04 /* W: Device shared region low PA. */
  72. #define PVRDMA_REG_DSRHIGH 0x08 /* W: Device shared region high PA. */
  73. #define PVRDMA_REG_CTL 0x0c /* W: PVRDMA_DEVICE_CTL */
  74. #define PVRDMA_REG_REQUEST 0x10 /* W: Indicate device request. */
  75. #define PVRDMA_REG_ERR 0x14 /* R: Device error. */
  76. #define PVRDMA_REG_ICR 0x18 /* R: Interrupt cause. */
  77. #define PVRDMA_REG_IMR 0x1c /* R/W: Interrupt mask. */
  78. #define PVRDMA_REG_MACL 0x20 /* R/W: MAC address low. */
  79. #define PVRDMA_REG_MACH 0x24 /* R/W: MAC address high. */
  80. /* Object flags. */
  81. #define PVRDMA_CQ_FLAG_ARMED_SOL BIT(0) /* Armed for solicited-only. */
  82. #define PVRDMA_CQ_FLAG_ARMED BIT(1) /* Armed. */
  83. #define PVRDMA_MR_FLAG_DMA BIT(0) /* DMA region. */
  84. #define PVRDMA_MR_FLAG_FRMR BIT(1) /* Fast reg memory region. */
  85. /*
  86. * Atomic operation capability (masked versions are extended atomic
  87. * operations.
  88. */
  89. #define PVRDMA_ATOMIC_OP_COMP_SWAP BIT(0) /* Compare and swap. */
  90. #define PVRDMA_ATOMIC_OP_FETCH_ADD BIT(1) /* Fetch and add. */
  91. #define PVRDMA_ATOMIC_OP_MASK_COMP_SWAP BIT(2) /* Masked compare and swap. */
  92. #define PVRDMA_ATOMIC_OP_MASK_FETCH_ADD BIT(3) /* Masked fetch and add. */
  93. /*
  94. * Base Memory Management Extension flags to support Fast Reg Memory Regions
  95. * and Fast Reg Work Requests. Each flag represents a verb operation and we
  96. * must support all of them to qualify for the BMME device cap.
  97. */
  98. #define PVRDMA_BMME_FLAG_LOCAL_INV BIT(0) /* Local Invalidate. */
  99. #define PVRDMA_BMME_FLAG_REMOTE_INV BIT(1) /* Remote Invalidate. */
  100. #define PVRDMA_BMME_FLAG_FAST_REG_WR BIT(2) /* Fast Reg Work Request. */
  101. /*
  102. * GID types. The interpretation of the gid_types bit field in the device
  103. * capabilities will depend on the device mode. For now, the device only
  104. * supports RoCE as mode, so only the different GID types for RoCE are
  105. * defined.
  106. */
  107. #define PVRDMA_GID_TYPE_FLAG_ROCE_V1 BIT(0)
  108. #define PVRDMA_GID_TYPE_FLAG_ROCE_V2 BIT(1)
  109. enum pvrdma_pci_resource {
  110. PVRDMA_PCI_RESOURCE_MSIX, /* BAR0: MSI-X, MMIO. */
  111. PVRDMA_PCI_RESOURCE_REG, /* BAR1: Registers, MMIO. */
  112. PVRDMA_PCI_RESOURCE_UAR, /* BAR2: UAR pages, MMIO, 64-bit. */
  113. PVRDMA_PCI_RESOURCE_LAST, /* Last. */
  114. };
  115. enum pvrdma_device_ctl {
  116. PVRDMA_DEVICE_CTL_ACTIVATE, /* Activate device. */
  117. PVRDMA_DEVICE_CTL_QUIESCE, /* Quiesce device. */
  118. PVRDMA_DEVICE_CTL_RESET, /* Reset device. */
  119. };
  120. enum pvrdma_intr_vector {
  121. PVRDMA_INTR_VECTOR_RESPONSE, /* Command response. */
  122. PVRDMA_INTR_VECTOR_ASYNC, /* Async events. */
  123. PVRDMA_INTR_VECTOR_CQ, /* CQ notification. */
  124. /* Additional CQ notification vectors. */
  125. };
  126. enum pvrdma_intr_cause {
  127. PVRDMA_INTR_CAUSE_RESPONSE = (1 << PVRDMA_INTR_VECTOR_RESPONSE),
  128. PVRDMA_INTR_CAUSE_ASYNC = (1 << PVRDMA_INTR_VECTOR_ASYNC),
  129. PVRDMA_INTR_CAUSE_CQ = (1 << PVRDMA_INTR_VECTOR_CQ),
  130. };
  131. enum pvrdma_intr_type {
  132. PVRDMA_INTR_TYPE_INTX, /* Legacy. */
  133. PVRDMA_INTR_TYPE_MSI, /* MSI. */
  134. PVRDMA_INTR_TYPE_MSIX, /* MSI-X. */
  135. };
  136. enum pvrdma_gos_bits {
  137. PVRDMA_GOS_BITS_UNK, /* Unknown. */
  138. PVRDMA_GOS_BITS_32, /* 32-bit. */
  139. PVRDMA_GOS_BITS_64, /* 64-bit. */
  140. };
  141. enum pvrdma_gos_type {
  142. PVRDMA_GOS_TYPE_UNK, /* Unknown. */
  143. PVRDMA_GOS_TYPE_LINUX, /* Linux. */
  144. };
  145. enum pvrdma_device_mode {
  146. PVRDMA_DEVICE_MODE_ROCE, /* RoCE. */
  147. PVRDMA_DEVICE_MODE_IWARP, /* iWarp. */
  148. PVRDMA_DEVICE_MODE_IB, /* InfiniBand. */
  149. };
  150. struct pvrdma_gos_info {
  151. u32 gos_bits:2; /* W: PVRDMA_GOS_BITS_ */
  152. u32 gos_type:4; /* W: PVRDMA_GOS_TYPE_ */
  153. u32 gos_ver:16; /* W: Guest OS version. */
  154. u32 gos_misc:10; /* W: Other. */
  155. u32 pad; /* Pad to 8-byte alignment. */
  156. };
  157. struct pvrdma_device_caps {
  158. u64 fw_ver; /* R: Query device. */
  159. __be64 node_guid;
  160. __be64 sys_image_guid;
  161. u64 max_mr_size;
  162. u64 page_size_cap;
  163. u64 atomic_arg_sizes; /* EX verbs. */
  164. u32 ex_comp_mask; /* EX verbs. */
  165. u32 device_cap_flags2; /* EX verbs. */
  166. u32 max_fa_bit_boundary; /* EX verbs. */
  167. u32 log_max_atomic_inline_arg; /* EX verbs. */
  168. u32 vendor_id;
  169. u32 vendor_part_id;
  170. u32 hw_ver;
  171. u32 max_qp;
  172. u32 max_qp_wr;
  173. u32 device_cap_flags;
  174. u32 max_sge;
  175. u32 max_sge_rd;
  176. u32 max_cq;
  177. u32 max_cqe;
  178. u32 max_mr;
  179. u32 max_pd;
  180. u32 max_qp_rd_atom;
  181. u32 max_ee_rd_atom;
  182. u32 max_res_rd_atom;
  183. u32 max_qp_init_rd_atom;
  184. u32 max_ee_init_rd_atom;
  185. u32 max_ee;
  186. u32 max_rdd;
  187. u32 max_mw;
  188. u32 max_raw_ipv6_qp;
  189. u32 max_raw_ethy_qp;
  190. u32 max_mcast_grp;
  191. u32 max_mcast_qp_attach;
  192. u32 max_total_mcast_qp_attach;
  193. u32 max_ah;
  194. u32 max_fmr;
  195. u32 max_map_per_fmr;
  196. u32 max_srq;
  197. u32 max_srq_wr;
  198. u32 max_srq_sge;
  199. u32 max_uar;
  200. u32 gid_tbl_len;
  201. u16 max_pkeys;
  202. u8 local_ca_ack_delay;
  203. u8 phys_port_cnt;
  204. u8 mode; /* PVRDMA_DEVICE_MODE_ */
  205. u8 atomic_ops; /* PVRDMA_ATOMIC_OP_* bits */
  206. u8 bmme_flags; /* FRWR Mem Mgmt Extensions */
  207. u8 gid_types; /* PVRDMA_GID_TYPE_FLAG_ */
  208. u8 reserved[4];
  209. };
  210. struct pvrdma_ring_page_info {
  211. u32 num_pages; /* Num pages incl. header. */
  212. u32 reserved; /* Reserved. */
  213. u64 pdir_dma; /* Page directory PA. */
  214. };
  215. #pragma pack(push, 1)
  216. struct pvrdma_device_shared_region {
  217. u32 driver_version; /* W: Driver version. */
  218. u32 pad; /* Pad to 8-byte align. */
  219. struct pvrdma_gos_info gos_info; /* W: Guest OS information. */
  220. u64 cmd_slot_dma; /* W: Command slot address. */
  221. u64 resp_slot_dma; /* W: Response slot address. */
  222. struct pvrdma_ring_page_info async_ring_pages;
  223. /* W: Async ring page info. */
  224. struct pvrdma_ring_page_info cq_ring_pages;
  225. /* W: CQ ring page info. */
  226. u32 uar_pfn; /* W: UAR pageframe. */
  227. u32 pad2; /* Pad to 8-byte align. */
  228. struct pvrdma_device_caps caps; /* R: Device capabilities. */
  229. };
  230. #pragma pack(pop)
  231. /* Event types. Currently a 1:1 mapping with enum ib_event. */
  232. enum pvrdma_eqe_type {
  233. PVRDMA_EVENT_CQ_ERR,
  234. PVRDMA_EVENT_QP_FATAL,
  235. PVRDMA_EVENT_QP_REQ_ERR,
  236. PVRDMA_EVENT_QP_ACCESS_ERR,
  237. PVRDMA_EVENT_COMM_EST,
  238. PVRDMA_EVENT_SQ_DRAINED,
  239. PVRDMA_EVENT_PATH_MIG,
  240. PVRDMA_EVENT_PATH_MIG_ERR,
  241. PVRDMA_EVENT_DEVICE_FATAL,
  242. PVRDMA_EVENT_PORT_ACTIVE,
  243. PVRDMA_EVENT_PORT_ERR,
  244. PVRDMA_EVENT_LID_CHANGE,
  245. PVRDMA_EVENT_PKEY_CHANGE,
  246. PVRDMA_EVENT_SM_CHANGE,
  247. PVRDMA_EVENT_SRQ_ERR,
  248. PVRDMA_EVENT_SRQ_LIMIT_REACHED,
  249. PVRDMA_EVENT_QP_LAST_WQE_REACHED,
  250. PVRDMA_EVENT_CLIENT_REREGISTER,
  251. PVRDMA_EVENT_GID_CHANGE,
  252. };
  253. /* Event queue element. */
  254. struct pvrdma_eqe {
  255. u32 type; /* Event type. */
  256. u32 info; /* Handle, other. */
  257. };
  258. /* CQ notification queue element. */
  259. struct pvrdma_cqne {
  260. u32 info; /* Handle */
  261. };
  262. enum {
  263. PVRDMA_CMD_FIRST,
  264. PVRDMA_CMD_QUERY_PORT = PVRDMA_CMD_FIRST,
  265. PVRDMA_CMD_QUERY_PKEY,
  266. PVRDMA_CMD_CREATE_PD,
  267. PVRDMA_CMD_DESTROY_PD,
  268. PVRDMA_CMD_CREATE_MR,
  269. PVRDMA_CMD_DESTROY_MR,
  270. PVRDMA_CMD_CREATE_CQ,
  271. PVRDMA_CMD_RESIZE_CQ,
  272. PVRDMA_CMD_DESTROY_CQ,
  273. PVRDMA_CMD_CREATE_QP,
  274. PVRDMA_CMD_MODIFY_QP,
  275. PVRDMA_CMD_QUERY_QP,
  276. PVRDMA_CMD_DESTROY_QP,
  277. PVRDMA_CMD_CREATE_UC,
  278. PVRDMA_CMD_DESTROY_UC,
  279. PVRDMA_CMD_CREATE_BIND,
  280. PVRDMA_CMD_DESTROY_BIND,
  281. PVRDMA_CMD_MAX,
  282. };
  283. enum {
  284. PVRDMA_CMD_FIRST_RESP = (1 << 31),
  285. PVRDMA_CMD_QUERY_PORT_RESP = PVRDMA_CMD_FIRST_RESP,
  286. PVRDMA_CMD_QUERY_PKEY_RESP,
  287. PVRDMA_CMD_CREATE_PD_RESP,
  288. PVRDMA_CMD_DESTROY_PD_RESP_NOOP,
  289. PVRDMA_CMD_CREATE_MR_RESP,
  290. PVRDMA_CMD_DESTROY_MR_RESP_NOOP,
  291. PVRDMA_CMD_CREATE_CQ_RESP,
  292. PVRDMA_CMD_RESIZE_CQ_RESP,
  293. PVRDMA_CMD_DESTROY_CQ_RESP_NOOP,
  294. PVRDMA_CMD_CREATE_QP_RESP,
  295. PVRDMA_CMD_MODIFY_QP_RESP,
  296. PVRDMA_CMD_QUERY_QP_RESP,
  297. PVRDMA_CMD_DESTROY_QP_RESP,
  298. PVRDMA_CMD_CREATE_UC_RESP,
  299. PVRDMA_CMD_DESTROY_UC_RESP_NOOP,
  300. PVRDMA_CMD_CREATE_BIND_RESP_NOOP,
  301. PVRDMA_CMD_DESTROY_BIND_RESP_NOOP,
  302. PVRDMA_CMD_MAX_RESP,
  303. };
  304. struct pvrdma_cmd_hdr {
  305. u64 response; /* Key for response lookup. */
  306. u32 cmd; /* PVRDMA_CMD_ */
  307. u32 reserved; /* Reserved. */
  308. };
  309. struct pvrdma_cmd_resp_hdr {
  310. u64 response; /* From cmd hdr. */
  311. u32 ack; /* PVRDMA_CMD_XXX_RESP */
  312. u8 err; /* Error. */
  313. u8 reserved[3]; /* Reserved. */
  314. };
  315. struct pvrdma_cmd_query_port {
  316. struct pvrdma_cmd_hdr hdr;
  317. u8 port_num;
  318. u8 reserved[7];
  319. };
  320. struct pvrdma_cmd_query_port_resp {
  321. struct pvrdma_cmd_resp_hdr hdr;
  322. struct pvrdma_port_attr attrs;
  323. };
  324. struct pvrdma_cmd_query_pkey {
  325. struct pvrdma_cmd_hdr hdr;
  326. u8 port_num;
  327. u8 index;
  328. u8 reserved[6];
  329. };
  330. struct pvrdma_cmd_query_pkey_resp {
  331. struct pvrdma_cmd_resp_hdr hdr;
  332. u16 pkey;
  333. u8 reserved[6];
  334. };
  335. struct pvrdma_cmd_create_uc {
  336. struct pvrdma_cmd_hdr hdr;
  337. u32 pfn; /* UAR page frame number */
  338. u8 reserved[4];
  339. };
  340. struct pvrdma_cmd_create_uc_resp {
  341. struct pvrdma_cmd_resp_hdr hdr;
  342. u32 ctx_handle;
  343. u8 reserved[4];
  344. };
  345. struct pvrdma_cmd_destroy_uc {
  346. struct pvrdma_cmd_hdr hdr;
  347. u32 ctx_handle;
  348. u8 reserved[4];
  349. };
  350. struct pvrdma_cmd_create_pd {
  351. struct pvrdma_cmd_hdr hdr;
  352. u32 ctx_handle;
  353. u8 reserved[4];
  354. };
  355. struct pvrdma_cmd_create_pd_resp {
  356. struct pvrdma_cmd_resp_hdr hdr;
  357. u32 pd_handle;
  358. u8 reserved[4];
  359. };
  360. struct pvrdma_cmd_destroy_pd {
  361. struct pvrdma_cmd_hdr hdr;
  362. u32 pd_handle;
  363. u8 reserved[4];
  364. };
  365. struct pvrdma_cmd_create_mr {
  366. struct pvrdma_cmd_hdr hdr;
  367. u64 start;
  368. u64 length;
  369. u64 pdir_dma;
  370. u32 pd_handle;
  371. u32 access_flags;
  372. u32 flags;
  373. u32 nchunks;
  374. };
  375. struct pvrdma_cmd_create_mr_resp {
  376. struct pvrdma_cmd_resp_hdr hdr;
  377. u32 mr_handle;
  378. u32 lkey;
  379. u32 rkey;
  380. u8 reserved[4];
  381. };
  382. struct pvrdma_cmd_destroy_mr {
  383. struct pvrdma_cmd_hdr hdr;
  384. u32 mr_handle;
  385. u8 reserved[4];
  386. };
  387. struct pvrdma_cmd_create_cq {
  388. struct pvrdma_cmd_hdr hdr;
  389. u64 pdir_dma;
  390. u32 ctx_handle;
  391. u32 cqe;
  392. u32 nchunks;
  393. u8 reserved[4];
  394. };
  395. struct pvrdma_cmd_create_cq_resp {
  396. struct pvrdma_cmd_resp_hdr hdr;
  397. u32 cq_handle;
  398. u32 cqe;
  399. };
  400. struct pvrdma_cmd_resize_cq {
  401. struct pvrdma_cmd_hdr hdr;
  402. u32 cq_handle;
  403. u32 cqe;
  404. };
  405. struct pvrdma_cmd_resize_cq_resp {
  406. struct pvrdma_cmd_resp_hdr hdr;
  407. u32 cqe;
  408. u8 reserved[4];
  409. };
  410. struct pvrdma_cmd_destroy_cq {
  411. struct pvrdma_cmd_hdr hdr;
  412. u32 cq_handle;
  413. u8 reserved[4];
  414. };
  415. struct pvrdma_cmd_create_qp {
  416. struct pvrdma_cmd_hdr hdr;
  417. u64 pdir_dma;
  418. u32 pd_handle;
  419. u32 send_cq_handle;
  420. u32 recv_cq_handle;
  421. u32 srq_handle;
  422. u32 max_send_wr;
  423. u32 max_recv_wr;
  424. u32 max_send_sge;
  425. u32 max_recv_sge;
  426. u32 max_inline_data;
  427. u32 lkey;
  428. u32 access_flags;
  429. u16 total_chunks;
  430. u16 send_chunks;
  431. u16 max_atomic_arg;
  432. u8 sq_sig_all;
  433. u8 qp_type;
  434. u8 is_srq;
  435. u8 reserved[3];
  436. };
  437. struct pvrdma_cmd_create_qp_resp {
  438. struct pvrdma_cmd_resp_hdr hdr;
  439. u32 qpn;
  440. u32 max_send_wr;
  441. u32 max_recv_wr;
  442. u32 max_send_sge;
  443. u32 max_recv_sge;
  444. u32 max_inline_data;
  445. };
  446. struct pvrdma_cmd_modify_qp {
  447. struct pvrdma_cmd_hdr hdr;
  448. u32 qp_handle;
  449. u32 attr_mask;
  450. struct pvrdma_qp_attr attrs;
  451. };
  452. struct pvrdma_cmd_query_qp {
  453. struct pvrdma_cmd_hdr hdr;
  454. u32 qp_handle;
  455. u32 attr_mask;
  456. };
  457. struct pvrdma_cmd_query_qp_resp {
  458. struct pvrdma_cmd_resp_hdr hdr;
  459. struct pvrdma_qp_attr attrs;
  460. };
  461. struct pvrdma_cmd_destroy_qp {
  462. struct pvrdma_cmd_hdr hdr;
  463. u32 qp_handle;
  464. u8 reserved[4];
  465. };
  466. struct pvrdma_cmd_destroy_qp_resp {
  467. struct pvrdma_cmd_resp_hdr hdr;
  468. u32 events_reported;
  469. u8 reserved[4];
  470. };
  471. struct pvrdma_cmd_create_bind {
  472. struct pvrdma_cmd_hdr hdr;
  473. u32 mtu;
  474. u32 vlan;
  475. u32 index;
  476. u8 new_gid[16];
  477. u8 gid_type;
  478. u8 reserved[3];
  479. };
  480. struct pvrdma_cmd_destroy_bind {
  481. struct pvrdma_cmd_hdr hdr;
  482. u32 index;
  483. u8 dest_gid[16];
  484. u8 reserved[4];
  485. };
  486. union pvrdma_cmd_req {
  487. struct pvrdma_cmd_hdr hdr;
  488. struct pvrdma_cmd_query_port query_port;
  489. struct pvrdma_cmd_query_pkey query_pkey;
  490. struct pvrdma_cmd_create_uc create_uc;
  491. struct pvrdma_cmd_destroy_uc destroy_uc;
  492. struct pvrdma_cmd_create_pd create_pd;
  493. struct pvrdma_cmd_destroy_pd destroy_pd;
  494. struct pvrdma_cmd_create_mr create_mr;
  495. struct pvrdma_cmd_destroy_mr destroy_mr;
  496. struct pvrdma_cmd_create_cq create_cq;
  497. struct pvrdma_cmd_resize_cq resize_cq;
  498. struct pvrdma_cmd_destroy_cq destroy_cq;
  499. struct pvrdma_cmd_create_qp create_qp;
  500. struct pvrdma_cmd_modify_qp modify_qp;
  501. struct pvrdma_cmd_query_qp query_qp;
  502. struct pvrdma_cmd_destroy_qp destroy_qp;
  503. struct pvrdma_cmd_create_bind create_bind;
  504. struct pvrdma_cmd_destroy_bind destroy_bind;
  505. };
  506. union pvrdma_cmd_resp {
  507. struct pvrdma_cmd_resp_hdr hdr;
  508. struct pvrdma_cmd_query_port_resp query_port_resp;
  509. struct pvrdma_cmd_query_pkey_resp query_pkey_resp;
  510. struct pvrdma_cmd_create_uc_resp create_uc_resp;
  511. struct pvrdma_cmd_create_pd_resp create_pd_resp;
  512. struct pvrdma_cmd_create_mr_resp create_mr_resp;
  513. struct pvrdma_cmd_create_cq_resp create_cq_resp;
  514. struct pvrdma_cmd_resize_cq_resp resize_cq_resp;
  515. struct pvrdma_cmd_create_qp_resp create_qp_resp;
  516. struct pvrdma_cmd_query_qp_resp query_qp_resp;
  517. struct pvrdma_cmd_destroy_qp_resp destroy_qp_resp;
  518. };
  519. #endif /* __PVRDMA_DEV_API_H__ */