ocrdma-abi.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
  2. /* This file is part of the Emulex RoCE Device Driver for
  3. * RoCE (RDMA over Converged Ethernet) adapters.
  4. * Copyright (C) 2012-2015 Emulex. All rights reserved.
  5. * EMULEX and SLI are trademarks of Emulex.
  6. * www.emulex.com
  7. *
  8. * This software is available to you under a choice of one of two licenses.
  9. * You may choose to be licensed under the terms of the GNU General Public
  10. * License (GPL) Version 2, available from the file COPYING in the main
  11. * directory of this source tree, or the BSD license below:
  12. *
  13. * Redistribution and use in source and binary forms, with or without
  14. * modification, are permitted provided that the following conditions
  15. * are met:
  16. *
  17. * - Redistributions of source code must retain the above copyright notice,
  18. * this list of conditions and the following disclaimer.
  19. *
  20. * - Redistributions in binary form must reproduce the above copyright
  21. * notice, this list of conditions and the following disclaimer in
  22. * the documentation and/or other materials provided with the distribution.
  23. *
  24. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  25. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,THE
  26. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  27. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
  28. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  29. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  30. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  31. * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  32. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  33. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  34. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  35. *
  36. * Contact Information:
  37. * linux-drivers@emulex.com
  38. *
  39. * Emulex
  40. * 3333 Susan Street
  41. * Costa Mesa, CA 92626
  42. */
  43. #ifndef OCRDMA_ABI_USER_H
  44. #define OCRDMA_ABI_USER_H
  45. #include <linux/types.h>
  46. #define OCRDMA_ABI_VERSION 2
  47. #define OCRDMA_BE_ROCE_ABI_VERSION 1
  48. /* user kernel communication data structures. */
  49. struct ocrdma_alloc_ucontext_resp {
  50. __u32 dev_id;
  51. __u32 wqe_size;
  52. __u32 max_inline_data;
  53. __u32 dpp_wqe_size;
  54. __aligned_u64 ah_tbl_page;
  55. __u32 ah_tbl_len;
  56. __u32 rqe_size;
  57. __u8 fw_ver[32];
  58. /* for future use/new features in progress */
  59. __aligned_u64 rsvd1;
  60. __aligned_u64 rsvd2;
  61. };
  62. struct ocrdma_alloc_pd_ureq {
  63. __u32 rsvd[2];
  64. };
  65. struct ocrdma_alloc_pd_uresp {
  66. __u32 id;
  67. __u32 dpp_enabled;
  68. __u32 dpp_page_addr_hi;
  69. __u32 dpp_page_addr_lo;
  70. __u32 rsvd[2];
  71. };
  72. struct ocrdma_create_cq_ureq {
  73. __u32 dpp_cq;
  74. __u32 rsvd; /* pad */
  75. };
  76. #define MAX_CQ_PAGES 8
  77. struct ocrdma_create_cq_uresp {
  78. __u32 cq_id;
  79. __u32 page_size;
  80. __u32 num_pages;
  81. __u32 max_hw_cqe;
  82. __aligned_u64 page_addr[MAX_CQ_PAGES];
  83. __aligned_u64 db_page_addr;
  84. __u32 db_page_size;
  85. __u32 phase_change;
  86. /* for future use/new features in progress */
  87. __aligned_u64 rsvd1;
  88. __aligned_u64 rsvd2;
  89. };
  90. #define MAX_QP_PAGES 8
  91. #define MAX_UD_AV_PAGES 8
  92. struct ocrdma_create_qp_ureq {
  93. __u8 enable_dpp_cq;
  94. __u8 rsvd;
  95. __u16 dpp_cq_id;
  96. __u32 rsvd1; /* pad */
  97. };
  98. struct ocrdma_create_qp_uresp {
  99. __u16 qp_id;
  100. __u16 sq_dbid;
  101. __u16 rq_dbid;
  102. __u16 resv0; /* pad */
  103. __u32 sq_page_size;
  104. __u32 rq_page_size;
  105. __u32 num_sq_pages;
  106. __u32 num_rq_pages;
  107. __aligned_u64 sq_page_addr[MAX_QP_PAGES];
  108. __aligned_u64 rq_page_addr[MAX_QP_PAGES];
  109. __aligned_u64 db_page_addr;
  110. __u32 db_page_size;
  111. __u32 dpp_credit;
  112. __u32 dpp_offset;
  113. __u32 num_wqe_allocated;
  114. __u32 num_rqe_allocated;
  115. __u32 db_sq_offset;
  116. __u32 db_rq_offset;
  117. __u32 db_shift;
  118. __aligned_u64 rsvd[11];
  119. };
  120. struct ocrdma_create_srq_uresp {
  121. __u16 rq_dbid;
  122. __u16 resv0; /* pad */
  123. __u32 resv1;
  124. __u32 rq_page_size;
  125. __u32 num_rq_pages;
  126. __aligned_u64 rq_page_addr[MAX_QP_PAGES];
  127. __aligned_u64 db_page_addr;
  128. __u32 db_page_size;
  129. __u32 num_rqe_allocated;
  130. __u32 db_rq_offset;
  131. __u32 db_shift;
  132. __aligned_u64 rsvd2;
  133. __aligned_u64 rsvd3;
  134. };
  135. #endif /* OCRDMA_ABI_USER_H */