1 /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
3 * Copyright 2018-2024 Amazon.com, Inc. or its affiliates. All rights reserved.
9 #include <linux/types.h>
10 #include <rdma/ib_user_ioctl_cmds.h>
13 * Increment this value if any changes that break userspace ABI
14 * compatibility are made.
16 #define EFA_UVERBS_ABI_VERSION 1
19 * Keep structs aligned to 8 bytes.
20 * Keep reserved fields as arrays of __u8 named reserved_XXX where XXX is the
21 * hex bit offset of the field.
25 EFA_ALLOC_UCONTEXT_CMD_COMP_TX_BATCH = 1 << 0,
26 EFA_ALLOC_UCONTEXT_CMD_COMP_MIN_SQ_WR = 1 << 1,
29 struct efa_ibv_alloc_ucontext_cmd {
34 enum efa_ibv_user_cmds_supp_udata {
35 EFA_USER_CMDS_SUPP_UDATA_QUERY_DEVICE = 1 << 0,
36 EFA_USER_CMDS_SUPP_UDATA_CREATE_AH = 1 << 1,
39 struct efa_ibv_alloc_ucontext_resp {
41 __u32 cmds_supp_udata_mask;
43 __u16 inline_buf_size;
44 __u32 max_llq_size; /* bytes */
45 __u16 max_tx_batch; /* units of 64 bytes */
50 struct efa_ibv_alloc_pd_resp {
57 EFA_CREATE_CQ_WITH_COMPLETION_CHANNEL = 1 << 0,
58 EFA_CREATE_CQ_WITH_SGID = 1 << 1,
61 struct efa_ibv_create_cq {
70 EFA_CREATE_CQ_RESP_DB_OFF = 1 << 0,
73 struct efa_ibv_create_cq_resp {
76 __aligned_u64 q_mmap_key;
77 __aligned_u64 q_mmap_size;
81 __aligned_u64 db_mmap_key;
85 EFA_QP_DRIVER_TYPE_SRD = 0,
88 struct efa_ibv_create_qp {
90 __u32 rq_ring_size; /* bytes */
91 __u32 sq_ring_size; /* bytes */
95 struct efa_ibv_create_qp_resp {
97 /* the offset inside the page of the rq db */
99 /* the offset inside the page of the sq db */
101 /* the offset inside the page of descriptors buffer */
102 __u32 llq_desc_offset;
103 __aligned_u64 rq_mmap_key;
104 __aligned_u64 rq_mmap_size;
105 __aligned_u64 rq_db_mmap_key;
106 __aligned_u64 sq_db_mmap_key;
107 __aligned_u64 llq_desc_mmap_key;
108 __u16 send_sub_cq_idx;
109 __u16 recv_sub_cq_idx;
110 __u8 reserved_1e0[4];
113 struct efa_ibv_create_ah_resp {
115 __u16 efa_address_handle;
120 EFA_QUERY_DEVICE_CAPS_RDMA_READ = 1 << 0,
121 EFA_QUERY_DEVICE_CAPS_RNR_RETRY = 1 << 1,
122 EFA_QUERY_DEVICE_CAPS_CQ_NOTIFICATIONS = 1 << 2,
123 EFA_QUERY_DEVICE_CAPS_CQ_WITH_SGID = 1 << 3,
124 EFA_QUERY_DEVICE_CAPS_DATA_POLLING_128 = 1 << 4,
125 EFA_QUERY_DEVICE_CAPS_RDMA_WRITE = 1 << 5,
128 struct efa_ibv_ex_query_device_resp {
139 EFA_QUERY_MR_VALIDITY_RECV_IC_ID = 1 << 0,
140 EFA_QUERY_MR_VALIDITY_RDMA_READ_IC_ID = 1 << 1,
141 EFA_QUERY_MR_VALIDITY_RDMA_RECV_IC_ID = 1 << 2,
144 enum efa_query_mr_attrs {
145 EFA_IB_ATTR_QUERY_MR_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
146 EFA_IB_ATTR_QUERY_MR_RESP_IC_ID_VALIDITY,
147 EFA_IB_ATTR_QUERY_MR_RESP_RECV_IC_ID,
148 EFA_IB_ATTR_QUERY_MR_RESP_RDMA_READ_IC_ID,
149 EFA_IB_ATTR_QUERY_MR_RESP_RDMA_RECV_IC_ID,
152 enum efa_mr_methods {
153 EFA_IB_METHOD_MR_QUERY = (1U << UVERBS_ID_NS_SHIFT),
156 #endif /* EFA_ABI_USER_H */