irdma-abi.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB */
  2. /*
  3. * Copyright (c) 2006 - 2021 Intel Corporation. All rights reserved.
  4. * Copyright (c) 2005 Topspin Communications. All rights reserved.
  5. * Copyright (c) 2005 Cisco Systems. All rights reserved.
  6. * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved.
  7. */
  8. #ifndef IRDMA_ABI_H
  9. #define IRDMA_ABI_H
  10. #include <linux/types.h>
  11. /* irdma must support legacy GEN_1 i40iw kernel
  12. * and user-space whose last ABI ver is 5
  13. */
  14. #define IRDMA_ABI_VER 5
  15. enum irdma_memreg_type {
  16. IRDMA_MEMREG_TYPE_MEM = 0,
  17. IRDMA_MEMREG_TYPE_QP = 1,
  18. IRDMA_MEMREG_TYPE_CQ = 2,
  19. IRDMA_MEMREG_TYPE_SRQ = 3,
  20. };
  21. enum {
  22. IRDMA_ALLOC_UCTX_USE_RAW_ATTR = 1 << 0,
  23. IRDMA_ALLOC_UCTX_MIN_HW_WQ_SIZE = 1 << 1,
  24. IRDMA_ALLOC_UCTX_MAX_HW_SRQ_QUANTA = 1 << 2,
  25. IRDMA_SUPPORT_WQE_FORMAT_V2 = 1 << 3,
  26. };
  27. struct irdma_alloc_ucontext_req {
  28. __u32 rsvd32;
  29. __u8 userspace_ver;
  30. __u8 rsvd8[3];
  31. __aligned_u64 comp_mask;
  32. };
  33. struct irdma_alloc_ucontext_resp {
  34. __u32 max_pds;
  35. __u32 max_qps;
  36. __u32 wq_size; /* size of the WQs (SQ+RQ) in the mmaped area */
  37. __u8 kernel_ver;
  38. __u8 rsvd[3];
  39. __aligned_u64 feature_flags;
  40. __aligned_u64 db_mmap_key;
  41. __u32 max_hw_wq_frags;
  42. __u32 max_hw_read_sges;
  43. __u32 max_hw_inline;
  44. __u32 max_hw_rq_quanta;
  45. __u32 max_hw_wq_quanta;
  46. __u32 min_hw_cq_size;
  47. __u32 max_hw_cq_size;
  48. __u16 max_hw_sq_chunk;
  49. __u8 hw_rev;
  50. __u8 rsvd2;
  51. __aligned_u64 comp_mask;
  52. __u16 min_hw_wq_size;
  53. __u8 revd3[2];
  54. __u32 max_hw_srq_quanta;
  55. };
  56. struct irdma_alloc_pd_resp {
  57. __u32 pd_id;
  58. __u8 rsvd[4];
  59. };
  60. struct irdma_resize_cq_req {
  61. __aligned_u64 user_cq_buffer;
  62. };
  63. struct irdma_create_cq_req {
  64. __aligned_u64 user_cq_buf;
  65. __aligned_u64 user_shadow_area;
  66. };
  67. struct irdma_create_srq_req {
  68. __aligned_u64 user_srq_buf;
  69. __aligned_u64 user_shadow_area;
  70. };
  71. struct irdma_create_srq_resp {
  72. __u32 srq_id;
  73. __u32 srq_size;
  74. };
  75. struct irdma_create_qp_req {
  76. __aligned_u64 user_wqe_bufs;
  77. __aligned_u64 user_compl_ctx;
  78. };
  79. struct irdma_mem_reg_req {
  80. __u16 reg_type; /* enum irdma_memreg_type */
  81. __u16 cq_pages;
  82. __u16 rq_pages;
  83. __u16 sq_pages;
  84. };
  85. struct irdma_modify_qp_req {
  86. __u8 sq_flush;
  87. __u8 rq_flush;
  88. __u8 rsvd[6];
  89. };
  90. struct irdma_create_cq_resp {
  91. __u32 cq_id;
  92. __u32 cq_size;
  93. };
  94. struct irdma_create_qp_resp {
  95. __u32 qp_id;
  96. __u32 actual_sq_size;
  97. __u32 actual_rq_size;
  98. __u32 irdma_drv_opt;
  99. __u16 push_idx;
  100. __u8 lsmm;
  101. __u8 rsvd;
  102. __u32 qp_caps;
  103. };
  104. struct irdma_modify_qp_resp {
  105. __aligned_u64 push_wqe_mmap_key;
  106. __aligned_u64 push_db_mmap_key;
  107. __u16 push_offset;
  108. __u8 push_valid;
  109. __u8 rsvd[5];
  110. };
  111. struct irdma_create_ah_resp {
  112. __u32 ah_id;
  113. __u8 rsvd[4];
  114. };
  115. #endif /* IRDMA_ABI_H */