pvrdma_dev_api.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  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_UNQUIESCE, /* Unquiesce 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_gos_bits {
  132. PVRDMA_GOS_BITS_UNK, /* Unknown. */
  133. PVRDMA_GOS_BITS_32, /* 32-bit. */
  134. PVRDMA_GOS_BITS_64, /* 64-bit. */
  135. };
  136. enum pvrdma_gos_type {
  137. PVRDMA_GOS_TYPE_UNK, /* Unknown. */
  138. PVRDMA_GOS_TYPE_LINUX, /* Linux. */
  139. };
  140. enum pvrdma_device_mode {
  141. PVRDMA_DEVICE_MODE_ROCE, /* RoCE. */
  142. PVRDMA_DEVICE_MODE_IWARP, /* iWarp. */
  143. PVRDMA_DEVICE_MODE_IB, /* InfiniBand. */
  144. };
  145. struct pvrdma_gos_info {
  146. u32 gos_bits:2; /* W: PVRDMA_GOS_BITS_ */
  147. u32 gos_type:4; /* W: PVRDMA_GOS_TYPE_ */
  148. u32 gos_ver:16; /* W: Guest OS version. */
  149. u32 gos_misc:10; /* W: Other. */
  150. u32 pad; /* Pad to 8-byte alignment. */
  151. };
  152. struct pvrdma_device_caps {
  153. u64 fw_ver; /* R: Query device. */
  154. __be64 node_guid;
  155. __be64 sys_image_guid;
  156. u64 max_mr_size;
  157. u64 page_size_cap;
  158. u64 atomic_arg_sizes; /* EX verbs. */
  159. u32 ex_comp_mask; /* EX verbs. */
  160. u32 device_cap_flags2; /* EX verbs. */
  161. u32 max_fa_bit_boundary; /* EX verbs. */
  162. u32 log_max_atomic_inline_arg; /* EX verbs. */
  163. u32 vendor_id;
  164. u32 vendor_part_id;
  165. u32 hw_ver;
  166. u32 max_qp;
  167. u32 max_qp_wr;
  168. u32 device_cap_flags;
  169. u32 max_sge;
  170. u32 max_sge_rd;
  171. u32 max_cq;
  172. u32 max_cqe;
  173. u32 max_mr;
  174. u32 max_pd;
  175. u32 max_qp_rd_atom;
  176. u32 max_ee_rd_atom;
  177. u32 max_res_rd_atom;
  178. u32 max_qp_init_rd_atom;
  179. u32 max_ee_init_rd_atom;
  180. u32 max_ee;
  181. u32 max_rdd;
  182. u32 max_mw;
  183. u32 max_raw_ipv6_qp;
  184. u32 max_raw_ethy_qp;
  185. u32 max_mcast_grp;
  186. u32 max_mcast_qp_attach;
  187. u32 max_total_mcast_qp_attach;
  188. u32 max_ah;
  189. u32 max_fmr;
  190. u32 max_map_per_fmr;
  191. u32 max_srq;
  192. u32 max_srq_wr;
  193. u32 max_srq_sge;
  194. u32 max_uar;
  195. u32 gid_tbl_len;
  196. u16 max_pkeys;
  197. u8 local_ca_ack_delay;
  198. u8 phys_port_cnt;
  199. u8 mode; /* PVRDMA_DEVICE_MODE_ */
  200. u8 atomic_ops; /* PVRDMA_ATOMIC_OP_* bits */
  201. u8 bmme_flags; /* FRWR Mem Mgmt Extensions */
  202. u8 gid_types; /* PVRDMA_GID_TYPE_FLAG_ */
  203. u8 reserved[4];
  204. };
  205. struct pvrdma_ring_page_info {
  206. u32 num_pages; /* Num pages incl. header. */
  207. u32 reserved; /* Reserved. */
  208. u64 pdir_dma; /* Page directory PA. */
  209. };
  210. #pragma pack(push, 1)
  211. struct pvrdma_device_shared_region {
  212. u32 driver_version; /* W: Driver version. */
  213. u32 pad; /* Pad to 8-byte align. */
  214. struct pvrdma_gos_info gos_info; /* W: Guest OS information. */
  215. u64 cmd_slot_dma; /* W: Command slot address. */
  216. u64 resp_slot_dma; /* W: Response slot address. */
  217. struct pvrdma_ring_page_info async_ring_pages;
  218. /* W: Async ring page info. */
  219. struct pvrdma_ring_page_info cq_ring_pages;
  220. /* W: CQ ring page info. */
  221. u32 uar_pfn; /* W: UAR pageframe. */
  222. u32 pad2; /* Pad to 8-byte align. */
  223. struct pvrdma_device_caps caps; /* R: Device capabilities. */
  224. };
  225. #pragma pack(pop)
  226. /* Event types. Currently a 1:1 mapping with enum ib_event. */
  227. enum pvrdma_eqe_type {
  228. PVRDMA_EVENT_CQ_ERR,
  229. PVRDMA_EVENT_QP_FATAL,
  230. PVRDMA_EVENT_QP_REQ_ERR,
  231. PVRDMA_EVENT_QP_ACCESS_ERR,
  232. PVRDMA_EVENT_COMM_EST,
  233. PVRDMA_EVENT_SQ_DRAINED,
  234. PVRDMA_EVENT_PATH_MIG,
  235. PVRDMA_EVENT_PATH_MIG_ERR,
  236. PVRDMA_EVENT_DEVICE_FATAL,
  237. PVRDMA_EVENT_PORT_ACTIVE,
  238. PVRDMA_EVENT_PORT_ERR,
  239. PVRDMA_EVENT_LID_CHANGE,
  240. PVRDMA_EVENT_PKEY_CHANGE,
  241. PVRDMA_EVENT_SM_CHANGE,
  242. PVRDMA_EVENT_SRQ_ERR,
  243. PVRDMA_EVENT_SRQ_LIMIT_REACHED,
  244. PVRDMA_EVENT_QP_LAST_WQE_REACHED,
  245. PVRDMA_EVENT_CLIENT_REREGISTER,
  246. PVRDMA_EVENT_GID_CHANGE,
  247. };
  248. /* Event queue element. */
  249. struct pvrdma_eqe {
  250. u32 type; /* Event type. */
  251. u32 info; /* Handle, other. */
  252. };
  253. /* CQ notification queue element. */
  254. struct pvrdma_cqne {
  255. u32 info; /* Handle */
  256. };
  257. enum {
  258. PVRDMA_CMD_FIRST,
  259. PVRDMA_CMD_QUERY_PORT = PVRDMA_CMD_FIRST,
  260. PVRDMA_CMD_QUERY_PKEY,
  261. PVRDMA_CMD_CREATE_PD,
  262. PVRDMA_CMD_DESTROY_PD,
  263. PVRDMA_CMD_CREATE_MR,
  264. PVRDMA_CMD_DESTROY_MR,
  265. PVRDMA_CMD_CREATE_CQ,
  266. PVRDMA_CMD_RESIZE_CQ,
  267. PVRDMA_CMD_DESTROY_CQ,
  268. PVRDMA_CMD_CREATE_QP,
  269. PVRDMA_CMD_MODIFY_QP,
  270. PVRDMA_CMD_QUERY_QP,
  271. PVRDMA_CMD_DESTROY_QP,
  272. PVRDMA_CMD_CREATE_UC,
  273. PVRDMA_CMD_DESTROY_UC,
  274. PVRDMA_CMD_CREATE_BIND,
  275. PVRDMA_CMD_DESTROY_BIND,
  276. PVRDMA_CMD_MAX,
  277. };
  278. enum {
  279. PVRDMA_CMD_FIRST_RESP = (1 << 31),
  280. PVRDMA_CMD_QUERY_PORT_RESP = PVRDMA_CMD_FIRST_RESP,
  281. PVRDMA_CMD_QUERY_PKEY_RESP,
  282. PVRDMA_CMD_CREATE_PD_RESP,
  283. PVRDMA_CMD_DESTROY_PD_RESP_NOOP,
  284. PVRDMA_CMD_CREATE_MR_RESP,
  285. PVRDMA_CMD_DESTROY_MR_RESP_NOOP,
  286. PVRDMA_CMD_CREATE_CQ_RESP,
  287. PVRDMA_CMD_RESIZE_CQ_RESP,
  288. PVRDMA_CMD_DESTROY_CQ_RESP_NOOP,
  289. PVRDMA_CMD_CREATE_QP_RESP,
  290. PVRDMA_CMD_MODIFY_QP_RESP,
  291. PVRDMA_CMD_QUERY_QP_RESP,
  292. PVRDMA_CMD_DESTROY_QP_RESP,
  293. PVRDMA_CMD_CREATE_UC_RESP,
  294. PVRDMA_CMD_DESTROY_UC_RESP_NOOP,
  295. PVRDMA_CMD_CREATE_BIND_RESP_NOOP,
  296. PVRDMA_CMD_DESTROY_BIND_RESP_NOOP,
  297. PVRDMA_CMD_MAX_RESP,
  298. };
  299. struct pvrdma_cmd_hdr {
  300. u64 response; /* Key for response lookup. */
  301. u32 cmd; /* PVRDMA_CMD_ */
  302. u32 reserved; /* Reserved. */
  303. };
  304. struct pvrdma_cmd_resp_hdr {
  305. u64 response; /* From cmd hdr. */
  306. u32 ack; /* PVRDMA_CMD_XXX_RESP */
  307. u8 err; /* Error. */
  308. u8 reserved[3]; /* Reserved. */
  309. };
  310. struct pvrdma_cmd_query_port {
  311. struct pvrdma_cmd_hdr hdr;
  312. u8 port_num;
  313. u8 reserved[7];
  314. };
  315. struct pvrdma_cmd_query_port_resp {
  316. struct pvrdma_cmd_resp_hdr hdr;
  317. struct pvrdma_port_attr attrs;
  318. };
  319. struct pvrdma_cmd_query_pkey {
  320. struct pvrdma_cmd_hdr hdr;
  321. u8 port_num;
  322. u8 index;
  323. u8 reserved[6];
  324. };
  325. struct pvrdma_cmd_query_pkey_resp {
  326. struct pvrdma_cmd_resp_hdr hdr;
  327. u16 pkey;
  328. u8 reserved[6];
  329. };
  330. struct pvrdma_cmd_create_uc {
  331. struct pvrdma_cmd_hdr hdr;
  332. u32 pfn; /* UAR page frame number */
  333. u8 reserved[4];
  334. };
  335. struct pvrdma_cmd_create_uc_resp {
  336. struct pvrdma_cmd_resp_hdr hdr;
  337. u32 ctx_handle;
  338. u8 reserved[4];
  339. };
  340. struct pvrdma_cmd_destroy_uc {
  341. struct pvrdma_cmd_hdr hdr;
  342. u32 ctx_handle;
  343. u8 reserved[4];
  344. };
  345. struct pvrdma_cmd_create_pd {
  346. struct pvrdma_cmd_hdr hdr;
  347. u32 ctx_handle;
  348. u8 reserved[4];
  349. };
  350. struct pvrdma_cmd_create_pd_resp {
  351. struct pvrdma_cmd_resp_hdr hdr;
  352. u32 pd_handle;
  353. u8 reserved[4];
  354. };
  355. struct pvrdma_cmd_destroy_pd {
  356. struct pvrdma_cmd_hdr hdr;
  357. u32 pd_handle;
  358. u8 reserved[4];
  359. };
  360. struct pvrdma_cmd_create_mr {
  361. struct pvrdma_cmd_hdr hdr;
  362. u64 start;
  363. u64 length;
  364. u64 pdir_dma;
  365. u32 pd_handle;
  366. u32 access_flags;
  367. u32 flags;
  368. u32 nchunks;
  369. };
  370. struct pvrdma_cmd_create_mr_resp {
  371. struct pvrdma_cmd_resp_hdr hdr;
  372. u32 mr_handle;
  373. u32 lkey;
  374. u32 rkey;
  375. u8 reserved[4];
  376. };
  377. struct pvrdma_cmd_destroy_mr {
  378. struct pvrdma_cmd_hdr hdr;
  379. u32 mr_handle;
  380. u8 reserved[4];
  381. };
  382. struct pvrdma_cmd_create_cq {
  383. struct pvrdma_cmd_hdr hdr;
  384. u64 pdir_dma;
  385. u32 ctx_handle;
  386. u32 cqe;
  387. u32 nchunks;
  388. u8 reserved[4];
  389. };
  390. struct pvrdma_cmd_create_cq_resp {
  391. struct pvrdma_cmd_resp_hdr hdr;
  392. u32 cq_handle;
  393. u32 cqe;
  394. };
  395. struct pvrdma_cmd_resize_cq {
  396. struct pvrdma_cmd_hdr hdr;
  397. u32 cq_handle;
  398. u32 cqe;
  399. };
  400. struct pvrdma_cmd_resize_cq_resp {
  401. struct pvrdma_cmd_resp_hdr hdr;
  402. u32 cqe;
  403. u8 reserved[4];
  404. };
  405. struct pvrdma_cmd_destroy_cq {
  406. struct pvrdma_cmd_hdr hdr;
  407. u32 cq_handle;
  408. u8 reserved[4];
  409. };
  410. struct pvrdma_cmd_create_qp {
  411. struct pvrdma_cmd_hdr hdr;
  412. u64 pdir_dma;
  413. u32 pd_handle;
  414. u32 send_cq_handle;
  415. u32 recv_cq_handle;
  416. u32 srq_handle;
  417. u32 max_send_wr;
  418. u32 max_recv_wr;
  419. u32 max_send_sge;
  420. u32 max_recv_sge;
  421. u32 max_inline_data;
  422. u32 lkey;
  423. u32 access_flags;
  424. u16 total_chunks;
  425. u16 send_chunks;
  426. u16 max_atomic_arg;
  427. u8 sq_sig_all;
  428. u8 qp_type;
  429. u8 is_srq;
  430. u8 reserved[3];
  431. };
  432. struct pvrdma_cmd_create_qp_resp {
  433. struct pvrdma_cmd_resp_hdr hdr;
  434. u32 qpn;
  435. u32 max_send_wr;
  436. u32 max_recv_wr;
  437. u32 max_send_sge;
  438. u32 max_recv_sge;
  439. u32 max_inline_data;
  440. };
  441. struct pvrdma_cmd_modify_qp {
  442. struct pvrdma_cmd_hdr hdr;
  443. u32 qp_handle;
  444. u32 attr_mask;
  445. struct pvrdma_qp_attr attrs;
  446. };
  447. struct pvrdma_cmd_query_qp {
  448. struct pvrdma_cmd_hdr hdr;
  449. u32 qp_handle;
  450. u32 attr_mask;
  451. };
  452. struct pvrdma_cmd_query_qp_resp {
  453. struct pvrdma_cmd_resp_hdr hdr;
  454. struct pvrdma_qp_attr attrs;
  455. };
  456. struct pvrdma_cmd_destroy_qp {
  457. struct pvrdma_cmd_hdr hdr;
  458. u32 qp_handle;
  459. u8 reserved[4];
  460. };
  461. struct pvrdma_cmd_destroy_qp_resp {
  462. struct pvrdma_cmd_resp_hdr hdr;
  463. u32 events_reported;
  464. u8 reserved[4];
  465. };
  466. struct pvrdma_cmd_create_bind {
  467. struct pvrdma_cmd_hdr hdr;
  468. u32 mtu;
  469. u32 vlan;
  470. u32 index;
  471. u8 new_gid[16];
  472. u8 gid_type;
  473. u8 reserved[3];
  474. };
  475. struct pvrdma_cmd_destroy_bind {
  476. struct pvrdma_cmd_hdr hdr;
  477. u32 index;
  478. u8 dest_gid[16];
  479. u8 reserved[4];
  480. };
  481. union pvrdma_cmd_req {
  482. struct pvrdma_cmd_hdr hdr;
  483. struct pvrdma_cmd_query_port query_port;
  484. struct pvrdma_cmd_query_pkey query_pkey;
  485. struct pvrdma_cmd_create_uc create_uc;
  486. struct pvrdma_cmd_destroy_uc destroy_uc;
  487. struct pvrdma_cmd_create_pd create_pd;
  488. struct pvrdma_cmd_destroy_pd destroy_pd;
  489. struct pvrdma_cmd_create_mr create_mr;
  490. struct pvrdma_cmd_destroy_mr destroy_mr;
  491. struct pvrdma_cmd_create_cq create_cq;
  492. struct pvrdma_cmd_resize_cq resize_cq;
  493. struct pvrdma_cmd_destroy_cq destroy_cq;
  494. struct pvrdma_cmd_create_qp create_qp;
  495. struct pvrdma_cmd_modify_qp modify_qp;
  496. struct pvrdma_cmd_query_qp query_qp;
  497. struct pvrdma_cmd_destroy_qp destroy_qp;
  498. struct pvrdma_cmd_create_bind create_bind;
  499. struct pvrdma_cmd_destroy_bind destroy_bind;
  500. };
  501. union pvrdma_cmd_resp {
  502. struct pvrdma_cmd_resp_hdr hdr;
  503. struct pvrdma_cmd_query_port_resp query_port_resp;
  504. struct pvrdma_cmd_query_pkey_resp query_pkey_resp;
  505. struct pvrdma_cmd_create_uc_resp create_uc_resp;
  506. struct pvrdma_cmd_create_pd_resp create_pd_resp;
  507. struct pvrdma_cmd_create_mr_resp create_mr_resp;
  508. struct pvrdma_cmd_create_cq_resp create_cq_resp;
  509. struct pvrdma_cmd_resize_cq_resp resize_cq_resp;
  510. struct pvrdma_cmd_create_qp_resp create_qp_resp;
  511. struct pvrdma_cmd_query_qp_resp query_qp_resp;
  512. struct pvrdma_cmd_destroy_qp_resp destroy_qp_resp;
  513. };
  514. #endif /* __PVRDMA_DEV_API_H__ */