1 /*
2  * This file is auto-generated. Modifications will be lost.
3  *
4  * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5  * for more information.
6  */
7 #ifndef EFA_ABI_USER_H
8 #define EFA_ABI_USER_H
9 #include <linux/types.h>
10 #include <rdma/ib_user_ioctl_cmds.h>
11 #define EFA_UVERBS_ABI_VERSION 1
12 enum {
13   EFA_ALLOC_UCONTEXT_CMD_COMP_TX_BATCH = 1 << 0,
14   EFA_ALLOC_UCONTEXT_CMD_COMP_MIN_SQ_WR = 1 << 1,
15 };
16 struct efa_ibv_alloc_ucontext_cmd {
17   __u32 comp_mask;
18   __u8 reserved_20[4];
19 };
20 enum efa_ibv_user_cmds_supp_udata {
21   EFA_USER_CMDS_SUPP_UDATA_QUERY_DEVICE = 1 << 0,
22   EFA_USER_CMDS_SUPP_UDATA_CREATE_AH = 1 << 1,
23 };
24 struct efa_ibv_alloc_ucontext_resp {
25   __u32 comp_mask;
26   __u32 cmds_supp_udata_mask;
27   __u16 sub_cqs_per_cq;
28   __u16 inline_buf_size;
29   __u32 max_llq_size;
30   __u16 max_tx_batch;
31   __u16 min_sq_wr;
32   __u8 reserved_a0[4];
33 };
34 struct efa_ibv_alloc_pd_resp {
35   __u32 comp_mask;
36   __u16 pdn;
37   __u8 reserved_30[2];
38 };
39 enum {
40   EFA_CREATE_CQ_WITH_COMPLETION_CHANNEL = 1 << 0,
41   EFA_CREATE_CQ_WITH_SGID = 1 << 1,
42 };
43 struct efa_ibv_create_cq {
44   __u32 comp_mask;
45   __u32 cq_entry_size;
46   __u16 num_sub_cqs;
47   __u8 flags;
48   __u8 reserved_58[5];
49 };
50 enum {
51   EFA_CREATE_CQ_RESP_DB_OFF = 1 << 0,
52 };
53 struct efa_ibv_create_cq_resp {
54   __u32 comp_mask;
55   __u8 reserved_20[4];
56   __aligned_u64 q_mmap_key;
57   __aligned_u64 q_mmap_size;
58   __u16 cq_idx;
59   __u8 reserved_d0[2];
60   __u32 db_off;
61   __aligned_u64 db_mmap_key;
62 };
63 enum {
64   EFA_QP_DRIVER_TYPE_SRD = 0,
65 };
66 struct efa_ibv_create_qp {
67   __u32 comp_mask;
68   __u32 rq_ring_size;
69   __u32 sq_ring_size;
70   __u32 driver_qp_type;
71 };
72 struct efa_ibv_create_qp_resp {
73   __u32 comp_mask;
74   __u32 rq_db_offset;
75   __u32 sq_db_offset;
76   __u32 llq_desc_offset;
77   __aligned_u64 rq_mmap_key;
78   __aligned_u64 rq_mmap_size;
79   __aligned_u64 rq_db_mmap_key;
80   __aligned_u64 sq_db_mmap_key;
81   __aligned_u64 llq_desc_mmap_key;
82   __u16 send_sub_cq_idx;
83   __u16 recv_sub_cq_idx;
84   __u8 reserved_1e0[4];
85 };
86 struct efa_ibv_create_ah_resp {
87   __u32 comp_mask;
88   __u16 efa_address_handle;
89   __u8 reserved_30[2];
90 };
91 enum {
92   EFA_QUERY_DEVICE_CAPS_RDMA_READ = 1 << 0,
93   EFA_QUERY_DEVICE_CAPS_RNR_RETRY = 1 << 1,
94   EFA_QUERY_DEVICE_CAPS_CQ_NOTIFICATIONS = 1 << 2,
95   EFA_QUERY_DEVICE_CAPS_CQ_WITH_SGID = 1 << 3,
96   EFA_QUERY_DEVICE_CAPS_DATA_POLLING_128 = 1 << 4,
97   EFA_QUERY_DEVICE_CAPS_RDMA_WRITE = 1 << 5,
98 };
99 struct efa_ibv_ex_query_device_resp {
100   __u32 comp_mask;
101   __u32 max_sq_wr;
102   __u32 max_rq_wr;
103   __u16 max_sq_sge;
104   __u16 max_rq_sge;
105   __u32 max_rdma_size;
106   __u32 device_caps;
107 };
108 enum {
109   EFA_QUERY_MR_VALIDITY_RECV_IC_ID = 1 << 0,
110   EFA_QUERY_MR_VALIDITY_RDMA_READ_IC_ID = 1 << 1,
111   EFA_QUERY_MR_VALIDITY_RDMA_RECV_IC_ID = 1 << 2,
112 };
113 enum efa_query_mr_attrs {
114   EFA_IB_ATTR_QUERY_MR_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
115   EFA_IB_ATTR_QUERY_MR_RESP_IC_ID_VALIDITY,
116   EFA_IB_ATTR_QUERY_MR_RESP_RECV_IC_ID,
117   EFA_IB_ATTR_QUERY_MR_RESP_RDMA_READ_IC_ID,
118   EFA_IB_ATTR_QUERY_MR_RESP_RDMA_RECV_IC_ID,
119 };
120 enum efa_mr_methods {
121   EFA_IB_METHOD_MR_QUERY = (1U << UVERBS_ID_NS_SHIFT),
122 };
123 #endif
124