efa-abi.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
  2. /*
  3. * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All rights reserved.
  4. */
  5. #ifndef EFA_ABI_USER_H
  6. #define EFA_ABI_USER_H
  7. #include <linux/types.h>
  8. /*
  9. * Increment this value if any changes that break userspace ABI
  10. * compatibility are made.
  11. */
  12. #define EFA_UVERBS_ABI_VERSION 1
  13. /*
  14. * Keep structs aligned to 8 bytes.
  15. * Keep reserved fields as arrays of __u8 named reserved_XXX where XXX is the
  16. * hex bit offset of the field.
  17. */
  18. enum {
  19. EFA_ALLOC_UCONTEXT_CMD_COMP_TX_BATCH = 1 << 0,
  20. EFA_ALLOC_UCONTEXT_CMD_COMP_MIN_SQ_WR = 1 << 1,
  21. };
  22. struct efa_ibv_alloc_ucontext_cmd {
  23. __u32 comp_mask;
  24. __u8 reserved_20[4];
  25. };
  26. enum efa_ibv_user_cmds_supp_udata {
  27. EFA_USER_CMDS_SUPP_UDATA_QUERY_DEVICE = 1 << 0,
  28. EFA_USER_CMDS_SUPP_UDATA_CREATE_AH = 1 << 1,
  29. };
  30. struct efa_ibv_alloc_ucontext_resp {
  31. __u32 comp_mask;
  32. __u32 cmds_supp_udata_mask;
  33. __u16 sub_cqs_per_cq;
  34. __u16 inline_buf_size;
  35. __u32 max_llq_size; /* bytes */
  36. __u16 max_tx_batch; /* units of 64 bytes */
  37. __u16 min_sq_wr;
  38. __u8 reserved_a0[4];
  39. };
  40. struct efa_ibv_alloc_pd_resp {
  41. __u32 comp_mask;
  42. __u16 pdn;
  43. __u8 reserved_30[2];
  44. };
  45. enum {
  46. EFA_CREATE_CQ_WITH_COMPLETION_CHANNEL = 1 << 0,
  47. EFA_CREATE_CQ_WITH_SGID = 1 << 1,
  48. };
  49. struct efa_ibv_create_cq {
  50. __u32 comp_mask;
  51. __u32 cq_entry_size;
  52. __u16 num_sub_cqs;
  53. __u8 flags;
  54. __u8 reserved_58[5];
  55. };
  56. enum {
  57. EFA_CREATE_CQ_RESP_DB_OFF = 1 << 0,
  58. };
  59. struct efa_ibv_create_cq_resp {
  60. __u32 comp_mask;
  61. __u8 reserved_20[4];
  62. __aligned_u64 q_mmap_key;
  63. __aligned_u64 q_mmap_size;
  64. __u16 cq_idx;
  65. __u8 reserved_d0[2];
  66. __u32 db_off;
  67. __aligned_u64 db_mmap_key;
  68. };
  69. enum {
  70. EFA_QP_DRIVER_TYPE_SRD = 0,
  71. };
  72. struct efa_ibv_create_qp {
  73. __u32 comp_mask;
  74. __u32 rq_ring_size; /* bytes */
  75. __u32 sq_ring_size; /* bytes */
  76. __u32 driver_qp_type;
  77. };
  78. struct efa_ibv_create_qp_resp {
  79. __u32 comp_mask;
  80. /* the offset inside the page of the rq db */
  81. __u32 rq_db_offset;
  82. /* the offset inside the page of the sq db */
  83. __u32 sq_db_offset;
  84. /* the offset inside the page of descriptors buffer */
  85. __u32 llq_desc_offset;
  86. __aligned_u64 rq_mmap_key;
  87. __aligned_u64 rq_mmap_size;
  88. __aligned_u64 rq_db_mmap_key;
  89. __aligned_u64 sq_db_mmap_key;
  90. __aligned_u64 llq_desc_mmap_key;
  91. __u16 send_sub_cq_idx;
  92. __u16 recv_sub_cq_idx;
  93. __u8 reserved_1e0[4];
  94. };
  95. struct efa_ibv_create_ah_resp {
  96. __u32 comp_mask;
  97. __u16 efa_address_handle;
  98. __u8 reserved_30[2];
  99. };
  100. enum {
  101. EFA_QUERY_DEVICE_CAPS_RDMA_READ = 1 << 0,
  102. EFA_QUERY_DEVICE_CAPS_RNR_RETRY = 1 << 1,
  103. EFA_QUERY_DEVICE_CAPS_CQ_NOTIFICATIONS = 1 << 2,
  104. EFA_QUERY_DEVICE_CAPS_CQ_WITH_SGID = 1 << 3,
  105. EFA_QUERY_DEVICE_CAPS_DATA_POLLING_128 = 1 << 4,
  106. EFA_QUERY_DEVICE_CAPS_RDMA_WRITE = 1 << 5,
  107. };
  108. struct efa_ibv_ex_query_device_resp {
  109. __u32 comp_mask;
  110. __u32 max_sq_wr;
  111. __u32 max_rq_wr;
  112. __u16 max_sq_sge;
  113. __u16 max_rq_sge;
  114. __u32 max_rdma_size;
  115. __u32 device_caps;
  116. };
  117. #endif /* EFA_ABI_USER_H */