GNU Linux-libre 6.1.90-gnu
[releases.git] / include / uapi / rdma / irdma-abi.h
1 /* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB */
2 /*
3  * Copyright (c) 2006 - 2021 Intel Corporation.  All rights reserved.
4  * Copyright (c) 2005 Topspin Communications.  All rights reserved.
5  * Copyright (c) 2005 Cisco Systems.  All rights reserved.
6  * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved.
7  */
8
9 #ifndef IRDMA_ABI_H
10 #define IRDMA_ABI_H
11
12 #include <linux/types.h>
13
14 /* irdma must support legacy GEN_1 i40iw kernel
15  * and user-space whose last ABI ver is 5
16  */
17 #define IRDMA_ABI_VER 5
18
19 enum irdma_memreg_type {
20         IRDMA_MEMREG_TYPE_MEM  = 0,
21         IRDMA_MEMREG_TYPE_QP   = 1,
22         IRDMA_MEMREG_TYPE_CQ   = 2,
23 };
24
25 enum {
26         IRDMA_ALLOC_UCTX_USE_RAW_ATTR = 1 << 0,
27 };
28
29 struct irdma_alloc_ucontext_req {
30         __u32 rsvd32;
31         __u8 userspace_ver;
32         __u8 rsvd8[3];
33         __aligned_u64 comp_mask;
34 };
35
36 struct irdma_alloc_ucontext_resp {
37         __u32 max_pds;
38         __u32 max_qps;
39         __u32 wq_size; /* size of the WQs (SQ+RQ) in the mmaped area */
40         __u8 kernel_ver;
41         __u8 rsvd[3];
42         __aligned_u64 feature_flags;
43         __aligned_u64 db_mmap_key;
44         __u32 max_hw_wq_frags;
45         __u32 max_hw_read_sges;
46         __u32 max_hw_inline;
47         __u32 max_hw_rq_quanta;
48         __u32 max_hw_wq_quanta;
49         __u32 min_hw_cq_size;
50         __u32 max_hw_cq_size;
51         __u16 max_hw_sq_chunk;
52         __u8 hw_rev;
53         __u8 rsvd2;
54         __aligned_u64 comp_mask;
55 };
56
57 struct irdma_alloc_pd_resp {
58         __u32 pd_id;
59         __u8 rsvd[4];
60 };
61
62 struct irdma_resize_cq_req {
63         __aligned_u64 user_cq_buffer;
64 };
65
66 struct irdma_create_cq_req {
67         __aligned_u64 user_cq_buf;
68         __aligned_u64 user_shadow_area;
69 };
70
71 struct irdma_create_qp_req {
72         __aligned_u64 user_wqe_bufs;
73         __aligned_u64 user_compl_ctx;
74 };
75
76 struct irdma_mem_reg_req {
77         __u16 reg_type; /* enum irdma_memreg_type */
78         __u16 cq_pages;
79         __u16 rq_pages;
80         __u16 sq_pages;
81 };
82
83 struct irdma_modify_qp_req {
84         __u8 sq_flush;
85         __u8 rq_flush;
86         __u8 rsvd[6];
87 };
88
89 struct irdma_create_cq_resp {
90         __u32 cq_id;
91         __u32 cq_size;
92 };
93
94 struct irdma_create_qp_resp {
95         __u32 qp_id;
96         __u32 actual_sq_size;
97         __u32 actual_rq_size;
98         __u32 irdma_drv_opt;
99         __u16 push_idx;
100         __u8 lsmm;
101         __u8 rsvd;
102         __u32 qp_caps;
103 };
104
105 struct irdma_modify_qp_resp {
106         __aligned_u64 push_wqe_mmap_key;
107         __aligned_u64 push_db_mmap_key;
108         __u16 push_offset;
109         __u8 push_valid;
110         __u8 rsvd[5];
111 };
112
113 struct irdma_create_ah_resp {
114         __u32 ah_id;
115         __u8 rsvd[4];
116 };
117 #endif /* IRDMA_ABI_H */