1 /* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) or BSD-3-Clause */
3 /* Authors: Bernard Metzler <bmt@zurich.ibm.com> */
4 /* Copyright (c) 2008-2019, IBM Corporation */
9 #include <linux/types.h>
11 #define SIW_NODE_DESC_COMMON "Software iWARP stack"
12 #define SIW_ABI_VERSION 1
14 #define SIW_UOBJ_MAX_KEY 0x08FFFF
15 #define SIW_INVAL_UOBJ_KEY (SIW_UOBJ_MAX_KEY + 1)
17 struct siw_uresp_create_cq
{
23 struct siw_uresp_create_qp
{
32 struct siw_ureq_reg_mr
{
38 struct siw_uresp_reg_mr
{
43 struct siw_uresp_create_srq
{
46 __aligned_u64 srq_key
;
49 struct siw_uresp_alloc_ctx
{
57 SIW_OP_READ_LOCAL_INV
,
60 SIW_OP_SEND_REMOTE_INV
,
67 /* provider internal SQE */
70 * below opcodes valid for
71 * in-kernel clients only
78 /* Keep it same as ibv_sge to allow for memcpy */
86 * Inline data are kept within the work request itself occupying
87 * the space of sge[1] .. sge[n]. Therefore, inline data cannot be
88 * supported if SIW_MAX_SGE is below 2 elements.
90 #define SIW_MAX_INLINE (sizeof(struct siw_sge) * (SIW_MAX_SGE - 1))
93 #error "SIW_MAX_SGE must be at least 2"
98 SIW_WQE_INLINE
= (1 << 1),
99 SIW_WQE_SIGNALLED
= (1 << 2),
100 SIW_WQE_SOLICITED
= (1 << 3),
101 SIW_WQE_READ_FENCE
= (1 << 4),
102 SIW_WQE_REM_INVAL
= (1 << 5),
103 SIW_WQE_COMPLETED
= (1 << 6)
106 /* Send Queue Element */
111 /* Contains enum siw_opcode values */
116 __aligned_u64 base_mr
;
119 struct siw_sge sge
[SIW_MAX_SGE
];
120 __aligned_u64 access
;
124 /* Receive Queue Element */
130 * only used by kernel driver,
131 * ignored if set by user
135 struct siw_sge sge
[SIW_MAX_SGE
];
138 enum siw_notify_flags
{
139 SIW_NOTIFY_NOT
= (0),
140 SIW_NOTIFY_SOLICITED
= (1 << 0),
141 SIW_NOTIFY_NEXT_COMPLETION
= (1 << 1),
142 SIW_NOTIFY_MISSED_EVENTS
= (1 << 2),
143 SIW_NOTIFY_ALL
= SIW_NOTIFY_SOLICITED
| SIW_NOTIFY_NEXT_COMPLETION
|
144 SIW_NOTIFY_MISSED_EVENTS
151 SIW_WC_LOC_QP_OP_ERR
,
154 SIW_WC_LOC_ACCESS_ERR
,
155 SIW_WC_REM_ACCESS_ERR
,
156 SIW_WC_REM_INV_REQ_ERR
,
168 __aligned_u64 imm_data
;
171 /* QP number or QP pointer */
173 struct ib_qp
*base_qp
;
179 * Shared structure between user and kernel
180 * to control CQ arming.