blob: 54fa9072159c836176403b485b839d2a74e58206 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
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 */
Christopher Ferris48af7cb2017-02-21 12:35:09 -08007#ifndef __VMW_PVRDMA_ABI_H__
8#define __VMW_PVRDMA_ABI_H__
9#include <linux/types.h>
10#define PVRDMA_UVERBS_ABI_VERSION 3
Christopher Ferris48af7cb2017-02-21 12:35:09 -080011#define PVRDMA_UAR_HANDLE_MASK 0x00FFFFFF
12#define PVRDMA_UAR_QP_OFFSET 0
Christopher Ferris76a1d452018-06-27 14:12:29 -070013#define PVRDMA_UAR_QP_SEND (1 << 30)
14#define PVRDMA_UAR_QP_RECV (1 << 31)
Christopher Ferris48af7cb2017-02-21 12:35:09 -080015#define PVRDMA_UAR_CQ_OFFSET 4
Christopher Ferris76a1d452018-06-27 14:12:29 -070016#define PVRDMA_UAR_CQ_ARM_SOL (1 << 29)
17#define PVRDMA_UAR_CQ_ARM (1 << 30)
18#define PVRDMA_UAR_CQ_POLL (1 << 31)
19#define PVRDMA_UAR_SRQ_OFFSET 8
20#define PVRDMA_UAR_SRQ_RECV (1 << 30)
Christopher Ferris48af7cb2017-02-21 12:35:09 -080021enum pvrdma_wr_opcode {
22 PVRDMA_WR_RDMA_WRITE,
23 PVRDMA_WR_RDMA_WRITE_WITH_IMM,
24 PVRDMA_WR_SEND,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080025 PVRDMA_WR_SEND_WITH_IMM,
26 PVRDMA_WR_RDMA_READ,
27 PVRDMA_WR_ATOMIC_CMP_AND_SWP,
28 PVRDMA_WR_ATOMIC_FETCH_AND_ADD,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080029 PVRDMA_WR_LSO,
30 PVRDMA_WR_SEND_WITH_INV,
31 PVRDMA_WR_RDMA_READ_WITH_INV,
32 PVRDMA_WR_LOCAL_INV,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080033 PVRDMA_WR_FAST_REG_MR,
34 PVRDMA_WR_MASKED_ATOMIC_CMP_AND_SWP,
35 PVRDMA_WR_MASKED_ATOMIC_FETCH_AND_ADD,
36 PVRDMA_WR_BIND_MW,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080037 PVRDMA_WR_REG_SIG_MR,
Christopher Ferrisd842e432019-03-07 10:21:59 -080038 PVRDMA_WR_ERROR,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080039};
40enum pvrdma_wc_status {
41 PVRDMA_WC_SUCCESS,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080042 PVRDMA_WC_LOC_LEN_ERR,
43 PVRDMA_WC_LOC_QP_OP_ERR,
44 PVRDMA_WC_LOC_EEC_OP_ERR,
45 PVRDMA_WC_LOC_PROT_ERR,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080046 PVRDMA_WC_WR_FLUSH_ERR,
47 PVRDMA_WC_MW_BIND_ERR,
48 PVRDMA_WC_BAD_RESP_ERR,
49 PVRDMA_WC_LOC_ACCESS_ERR,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080050 PVRDMA_WC_REM_INV_REQ_ERR,
51 PVRDMA_WC_REM_ACCESS_ERR,
52 PVRDMA_WC_REM_OP_ERR,
53 PVRDMA_WC_RETRY_EXC_ERR,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080054 PVRDMA_WC_RNR_RETRY_EXC_ERR,
55 PVRDMA_WC_LOC_RDD_VIOL_ERR,
56 PVRDMA_WC_REM_INV_RD_REQ_ERR,
57 PVRDMA_WC_REM_ABORT_ERR,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080058 PVRDMA_WC_INV_EECN_ERR,
59 PVRDMA_WC_INV_EEC_STATE_ERR,
60 PVRDMA_WC_FATAL_ERR,
61 PVRDMA_WC_RESP_TIMEOUT_ERR,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080062 PVRDMA_WC_GENERAL_ERR,
63};
64enum pvrdma_wc_opcode {
65 PVRDMA_WC_SEND,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080066 PVRDMA_WC_RDMA_WRITE,
67 PVRDMA_WC_RDMA_READ,
68 PVRDMA_WC_COMP_SWAP,
69 PVRDMA_WC_FETCH_ADD,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080070 PVRDMA_WC_BIND_MW,
71 PVRDMA_WC_LSO,
72 PVRDMA_WC_LOCAL_INV,
73 PVRDMA_WC_FAST_REG_MR,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080074 PVRDMA_WC_MASKED_COMP_SWAP,
75 PVRDMA_WC_MASKED_FETCH_ADD,
76 PVRDMA_WC_RECV = 1 << 7,
77 PVRDMA_WC_RECV_RDMA_WITH_IMM,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080078};
79enum pvrdma_wc_flags {
80 PVRDMA_WC_GRH = 1 << 0,
81 PVRDMA_WC_WITH_IMM = 1 << 1,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080082 PVRDMA_WC_WITH_INVALIDATE = 1 << 2,
83 PVRDMA_WC_IP_CSUM_OK = 1 << 3,
84 PVRDMA_WC_WITH_SMAC = 1 << 4,
85 PVRDMA_WC_WITH_VLAN = 1 << 5,
Christopher Ferris1308ad32017-11-14 17:32:13 -080086 PVRDMA_WC_WITH_NETWORK_HDR_TYPE = 1 << 6,
87 PVRDMA_WC_FLAGS_MAX = PVRDMA_WC_WITH_NETWORK_HDR_TYPE,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080088};
Christopher Ferris05667cd2021-02-16 16:01:34 -080089enum pvrdma_network_type {
90 PVRDMA_NETWORK_IB,
91 PVRDMA_NETWORK_ROCE_V1 = PVRDMA_NETWORK_IB,
92 PVRDMA_NETWORK_IPV4,
93 PVRDMA_NETWORK_IPV6
94};
Christopher Ferris48af7cb2017-02-21 12:35:09 -080095struct pvrdma_alloc_ucontext_resp {
96 __u32 qp_tab_size;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080097 __u32 reserved;
98};
99struct pvrdma_alloc_pd_resp {
100 __u32 pdn;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800101 __u32 reserved;
102};
103struct pvrdma_create_cq {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700104 __aligned_u64 buf_addr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800105 __u32 buf_size;
106 __u32 reserved;
107};
108struct pvrdma_create_cq_resp {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800109 __u32 cqn;
110 __u32 reserved;
111};
112struct pvrdma_resize_cq {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700113 __aligned_u64 buf_addr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800114 __u32 buf_size;
115 __u32 reserved;
116};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800117struct pvrdma_create_srq {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700118 __aligned_u64 buf_addr;
Christopher Ferris934ec942018-01-31 15:29:16 -0800119 __u32 buf_size;
120 __u32 reserved;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800121};
122struct pvrdma_create_srq_resp {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800123 __u32 srqn;
124 __u32 reserved;
125};
126struct pvrdma_create_qp {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700127 __aligned_u64 rbuf_addr;
128 __aligned_u64 sbuf_addr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800129 __u32 rbuf_size;
130 __u32 sbuf_size;
Christopher Ferris76a1d452018-06-27 14:12:29 -0700131 __aligned_u64 qp_addr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800132};
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800133struct pvrdma_create_qp_resp {
134 __u32 qpn;
135 __u32 qp_handle;
136};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800137struct pvrdma_ex_cmp_swap {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700138 __aligned_u64 swap_val;
139 __aligned_u64 compare_val;
140 __aligned_u64 swap_mask;
141 __aligned_u64 compare_mask;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800142};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800143struct pvrdma_ex_fetch_add {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700144 __aligned_u64 add_val;
145 __aligned_u64 field_boundary;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800146};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800147struct pvrdma_av {
148 __u32 port_pd;
149 __u32 sl_tclass_flowlabel;
150 __u8 dgid[16];
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800151 __u8 src_path_bits;
152 __u8 gid_index;
153 __u8 stat_rate;
154 __u8 hop_limit;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800155 __u8 dmac[6];
156 __u8 reserved[6];
157};
158struct pvrdma_sge {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700159 __aligned_u64 addr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800160 __u32 length;
161 __u32 lkey;
162};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800163struct pvrdma_rq_wqe_hdr {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700164 __aligned_u64 wr_id;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800165 __u32 num_sge;
166 __u32 total_len;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800167};
168struct pvrdma_sq_wqe_hdr {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700169 __aligned_u64 wr_id;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800170 __u32 num_sge;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800171 __u32 total_len;
172 __u32 opcode;
173 __u32 send_flags;
174 union {
Christopher Ferris525ce912017-07-26 13:12:53 -0700175 __be32 imm_data;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800176 __u32 invalidate_rkey;
177 } ex;
178 __u32 reserved;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800179 union {
180 struct {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700181 __aligned_u64 remote_addr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800182 __u32 rkey;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800183 __u8 reserved[4];
184 } rdma;
185 struct {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700186 __aligned_u64 remote_addr;
187 __aligned_u64 compare_add;
188 __aligned_u64 swap;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800189 __u32 rkey;
190 __u32 reserved;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800191 } atomic;
192 struct {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700193 __aligned_u64 remote_addr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800194 __u32 log_arg_sz;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800195 __u32 rkey;
196 union {
197 struct pvrdma_ex_cmp_swap cmp_swap;
198 struct pvrdma_ex_fetch_add fetch_add;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800199 } wr_data;
200 } masked_atomics;
201 struct {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700202 __aligned_u64 iova_start;
203 __aligned_u64 pl_pdir_dma;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800204 __u32 page_shift;
205 __u32 page_list_len;
206 __u32 length;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800207 __u32 access_flags;
208 __u32 rkey;
Christopher Ferris76a1d452018-06-27 14:12:29 -0700209 __u32 reserved;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800210 } fast_reg;
211 struct {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800212 __u32 remote_qpn;
213 __u32 remote_qkey;
214 struct pvrdma_av av;
215 } ud;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800216 } wr;
217};
218struct pvrdma_cqe {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700219 __aligned_u64 wr_id;
220 __aligned_u64 qp;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800221 __u32 opcode;
222 __u32 status;
223 __u32 byte_len;
Christopher Ferris525ce912017-07-26 13:12:53 -0700224 __be32 imm_data;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800225 __u32 src_qp;
226 __u32 wc_flags;
227 __u32 vendor_err;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800228 __u16 pkey_index;
229 __u16 slid;
230 __u8 sl;
231 __u8 dlid_path_bits;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800232 __u8 port_num;
233 __u8 smac[6];
Christopher Ferris1308ad32017-11-14 17:32:13 -0800234 __u8 network_hdr_type;
235 __u8 reserved2[6];
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800236};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800237#endif