efa-abi.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
  2. /*
  3. * Copyright 2018-2019 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 efa_ibv_user_cmds_supp_udata {
  19. EFA_USER_CMDS_SUPP_UDATA_QUERY_DEVICE = 1 << 0,
  20. EFA_USER_CMDS_SUPP_UDATA_CREATE_AH = 1 << 1,
  21. };
  22. struct efa_ibv_alloc_ucontext_resp {
  23. __u32 comp_mask;
  24. __u32 cmds_supp_udata_mask;
  25. __u16 sub_cqs_per_cq;
  26. __u16 inline_buf_size;
  27. __u32 max_llq_size; /* bytes */
  28. };
  29. struct efa_ibv_alloc_pd_resp {
  30. __u32 comp_mask;
  31. __u16 pdn;
  32. __u8 reserved_30[2];
  33. };
  34. struct efa_ibv_create_cq {
  35. __u32 comp_mask;
  36. __u32 cq_entry_size;
  37. __u16 num_sub_cqs;
  38. __u8 reserved_50[6];
  39. };
  40. struct efa_ibv_create_cq_resp {
  41. __u32 comp_mask;
  42. __u8 reserved_20[4];
  43. __aligned_u64 q_mmap_key;
  44. __aligned_u64 q_mmap_size;
  45. __u16 cq_idx;
  46. __u8 reserved_d0[6];
  47. };
  48. enum {
  49. EFA_QP_DRIVER_TYPE_SRD = 0,
  50. };
  51. struct efa_ibv_create_qp {
  52. __u32 comp_mask;
  53. __u32 rq_ring_size; /* bytes */
  54. __u32 sq_ring_size; /* bytes */
  55. __u32 driver_qp_type;
  56. };
  57. struct efa_ibv_create_qp_resp {
  58. __u32 comp_mask;
  59. /* the offset inside the page of the rq db */
  60. __u32 rq_db_offset;
  61. /* the offset inside the page of the sq db */
  62. __u32 sq_db_offset;
  63. /* the offset inside the page of descriptors buffer */
  64. __u32 llq_desc_offset;
  65. __aligned_u64 rq_mmap_key;
  66. __aligned_u64 rq_mmap_size;
  67. __aligned_u64 rq_db_mmap_key;
  68. __aligned_u64 sq_db_mmap_key;
  69. __aligned_u64 llq_desc_mmap_key;
  70. __u16 send_sub_cq_idx;
  71. __u16 recv_sub_cq_idx;
  72. __u8 reserved_1e0[4];
  73. };
  74. struct efa_ibv_create_ah_resp {
  75. __u32 comp_mask;
  76. __u16 efa_address_handle;
  77. __u8 reserved_30[2];
  78. };
  79. struct efa_ibv_ex_query_device_resp {
  80. __u32 comp_mask;
  81. __u32 max_sq_wr;
  82. __u32 max_rq_wr;
  83. __u16 max_sq_sge;
  84. __u16 max_rq_sge;
  85. };
  86. #endif /* EFA_ABI_USER_H */