2 * Broadcom NetXtreme-E RoCE driver.
4 * Copyright (c) 2016 - 2017, Broadcom. All rights reserved. The term
5 * Broadcom refers to Broadcom Limited and/or its subsidiaries.
7 * This software is available to you under a choice of one of two
8 * licenses. You may choose to be licensed under the terms of the GNU
9 * General Public License (GPL) Version 2, available from the file
10 * COPYING in the main directory of this source tree, or the
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in
21 * the documentation and/or other materials provided with the
24 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
26 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
28 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
31 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
32 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
33 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
34 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 * Description: RoCE HSI File - Autogenerated
39 #ifndef __BNXT_RE_HSI_H__
40 #define __BNXT_RE_HSI_H__
42 /* include bnxt_hsi.h from bnxt_en driver */
45 /* CMP Door Bell Format (4 bytes) */
46 struct cmpl_doorbell
{
47 __le32 key_mask_valid_idx
;
48 #define CMPL_DOORBELL_IDX_MASK 0xffffffUL
49 #define CMPL_DOORBELL_IDX_SFT 0
50 #define CMPL_DOORBELL_RESERVED_MASK 0x3000000UL
51 #define CMPL_DOORBELL_RESERVED_SFT 24
52 #define CMPL_DOORBELL_IDX_VALID 0x4000000UL
53 #define CMPL_DOORBELL_MASK 0x8000000UL
54 #define CMPL_DOORBELL_KEY_MASK 0xf0000000UL
55 #define CMPL_DOORBELL_KEY_SFT 28
56 #define CMPL_DOORBELL_KEY_CMPL (0x2UL << 28)
59 /* Status Door Bell Format (4 bytes) */
60 struct status_doorbell
{
62 #define STATUS_DOORBELL_IDX_MASK 0xffffffUL
63 #define STATUS_DOORBELL_IDX_SFT 0
64 #define STATUS_DOORBELL_RESERVED_MASK 0xf000000UL
65 #define STATUS_DOORBELL_RESERVED_SFT 24
66 #define STATUS_DOORBELL_KEY_MASK 0xf0000000UL
67 #define STATUS_DOORBELL_KEY_SFT 28
68 #define STATUS_DOORBELL_KEY_STAT (0x3UL << 28)
71 /* RoCE Host Structures */
73 /* Doorbell Structures */
74 /* dbc_dbc (size:64b/8B) */
77 #define DBC_DBC_INDEX_MASK 0xffffffUL
78 #define DBC_DBC_INDEX_SFT 0
80 #define DBC_DBC_XID_MASK 0xfffffUL
81 #define DBC_DBC_XID_SFT 0
82 #define DBC_DBC_PATH_MASK 0x3000000UL
83 #define DBC_DBC_PATH_SFT 24
84 #define DBC_DBC_PATH_ROCE (0x0UL << 24)
85 #define DBC_DBC_PATH_L2 (0x1UL << 24)
86 #define DBC_DBC_PATH_ENGINE (0x2UL << 24)
87 #define DBC_DBC_PATH_LAST DBC_DBC_PATH_ENGINE
88 #define DBC_DBC_DEBUG_TRACE 0x8000000UL
89 #define DBC_DBC_TYPE_MASK 0xf0000000UL
90 #define DBC_DBC_TYPE_SFT 28
91 #define DBC_DBC_TYPE_SQ (0x0UL << 28)
92 #define DBC_DBC_TYPE_RQ (0x1UL << 28)
93 #define DBC_DBC_TYPE_SRQ (0x2UL << 28)
94 #define DBC_DBC_TYPE_SRQ_ARM (0x3UL << 28)
95 #define DBC_DBC_TYPE_CQ (0x4UL << 28)
96 #define DBC_DBC_TYPE_CQ_ARMSE (0x5UL << 28)
97 #define DBC_DBC_TYPE_CQ_ARMALL (0x6UL << 28)
98 #define DBC_DBC_TYPE_CQ_ARMENA (0x7UL << 28)
99 #define DBC_DBC_TYPE_SRQ_ARMENA (0x8UL << 28)
100 #define DBC_DBC_TYPE_CQ_CUTOFF_ACK (0x9UL << 28)
101 #define DBC_DBC_TYPE_NQ (0xaUL << 28)
102 #define DBC_DBC_TYPE_NQ_ARM (0xbUL << 28)
103 #define DBC_DBC_TYPE_NULL (0xfUL << 28)
104 #define DBC_DBC_TYPE_LAST DBC_DBC_TYPE_NULL
107 /* dbc_dbc32 (size:32b/4B) */
109 __le32 type_abs_incr_xid
;
110 #define DBC_DBC32_XID_MASK 0xfffffUL
111 #define DBC_DBC32_XID_SFT 0
112 #define DBC_DBC32_PATH_MASK 0xc00000UL
113 #define DBC_DBC32_PATH_SFT 22
114 #define DBC_DBC32_PATH_ROCE (0x0UL << 22)
115 #define DBC_DBC32_PATH_L2 (0x1UL << 22)
116 #define DBC_DBC32_PATH_LAST DBC_DBC32_PATH_L2
117 #define DBC_DBC32_INCR_MASK 0xf000000UL
118 #define DBC_DBC32_INCR_SFT 24
119 #define DBC_DBC32_ABS 0x10000000UL
120 #define DBC_DBC32_TYPE_MASK 0xe0000000UL
121 #define DBC_DBC32_TYPE_SFT 29
122 #define DBC_DBC32_TYPE_SQ (0x0UL << 29)
123 #define DBC_DBC32_TYPE_LAST DBC_DBC32_TYPE_SQ
126 /* SQ WQE Structures */
127 /* Base SQ WQE (8 bytes) */
130 #define SQ_BASE_WQE_TYPE_SEND 0x0UL
131 #define SQ_BASE_WQE_TYPE_SEND_W_IMMEAD 0x1UL
132 #define SQ_BASE_WQE_TYPE_SEND_W_INVALID 0x2UL
133 #define SQ_BASE_WQE_TYPE_WRITE_WQE 0x4UL
134 #define SQ_BASE_WQE_TYPE_WRITE_W_IMMEAD 0x5UL
135 #define SQ_BASE_WQE_TYPE_READ_WQE 0x6UL
136 #define SQ_BASE_WQE_TYPE_ATOMIC_CS 0x8UL
137 #define SQ_BASE_WQE_TYPE_ATOMIC_FA 0xbUL
138 #define SQ_BASE_WQE_TYPE_LOCAL_INVALID 0xcUL
139 #define SQ_BASE_WQE_TYPE_FR_PMR 0xdUL
140 #define SQ_BASE_WQE_TYPE_BIND 0xeUL
144 /* WQE SGE (16 bytes) */
151 /* PSN Search Structure (8 bytes) */
152 struct sq_psn_search
{
153 __le32 opcode_start_psn
;
154 #define SQ_PSN_SEARCH_START_PSN_MASK 0xffffffUL
155 #define SQ_PSN_SEARCH_START_PSN_SFT 0
156 #define SQ_PSN_SEARCH_OPCODE_MASK 0xff000000UL
157 #define SQ_PSN_SEARCH_OPCODE_SFT 24
158 __le32 flags_next_psn
;
159 #define SQ_PSN_SEARCH_NEXT_PSN_MASK 0xffffffUL
160 #define SQ_PSN_SEARCH_NEXT_PSN_SFT 0
161 #define SQ_PSN_SEARCH_FLAGS_MASK 0xff000000UL
162 #define SQ_PSN_SEARCH_FLAGS_SFT 24
165 /* sq_psn_search_ext (size:128b/16B) */
166 struct sq_psn_search_ext
{
167 __le32 opcode_start_psn
;
168 #define SQ_PSN_SEARCH_EXT_START_PSN_MASK 0xffffffUL
169 #define SQ_PSN_SEARCH_EXT_START_PSN_SFT 0
170 #define SQ_PSN_SEARCH_EXT_OPCODE_MASK 0xff000000UL
171 #define SQ_PSN_SEARCH_EXT_OPCODE_SFT 24
172 __le32 flags_next_psn
;
173 #define SQ_PSN_SEARCH_EXT_NEXT_PSN_MASK 0xffffffUL
174 #define SQ_PSN_SEARCH_EXT_NEXT_PSN_SFT 0
175 #define SQ_PSN_SEARCH_EXT_FLAGS_MASK 0xff000000UL
176 #define SQ_PSN_SEARCH_EXT_FLAGS_SFT 24
177 __le16 start_slot_idx
;
182 /* Send SQ WQE (40 bytes) */
185 #define SQ_SEND_WQE_TYPE_SEND 0x0UL
186 #define SQ_SEND_WQE_TYPE_SEND_W_IMMEAD 0x1UL
187 #define SQ_SEND_WQE_TYPE_SEND_W_INVALID 0x2UL
189 #define SQ_SEND_FLAGS_SIGNAL_COMP 0x1UL
190 #define SQ_SEND_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL
191 #define SQ_SEND_FLAGS_UC_FENCE 0x4UL
192 #define SQ_SEND_FLAGS_SE 0x8UL
193 #define SQ_SEND_FLAGS_INLINE 0x10UL
196 __le32 inv_key_or_imm_data
;
200 #define SQ_SEND_DST_QP_MASK 0xffffffUL
201 #define SQ_SEND_DST_QP_SFT 0
202 #define SQ_SEND_RESERVED8_2_MASK 0xff000000UL
203 #define SQ_SEND_RESERVED8_2_SFT 24
205 #define SQ_SEND_AVID_MASK 0xfffffUL
206 #define SQ_SEND_AVID_SFT 0
207 #define SQ_SEND_RESERVED_AVID_MASK 0xfff00000UL
208 #define SQ_SEND_RESERVED_AVID_SFT 20
213 /* Send Raw Ethernet and QP1 SQ WQE (40 bytes) */
214 struct sq_send_raweth_qp1
{
216 #define SQ_SEND_RAWETH_QP1_WQE_TYPE_SEND 0x0UL
218 #define SQ_SEND_RAWETH_QP1_FLAGS_SIGNAL_COMP 0x1UL
219 #define SQ_SEND_RAWETH_QP1_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL
220 #define SQ_SEND_RAWETH_QP1_FLAGS_UC_FENCE 0x4UL
221 #define SQ_SEND_RAWETH_QP1_FLAGS_SE 0x8UL
222 #define SQ_SEND_RAWETH_QP1_FLAGS_INLINE 0x10UL
226 #define SQ_SEND_RAWETH_QP1_LFLAGS_TCP_UDP_CHKSUM 0x1UL
227 #define SQ_SEND_RAWETH_QP1_LFLAGS_IP_CHKSUM 0x2UL
228 #define SQ_SEND_RAWETH_QP1_LFLAGS_NOCRC 0x4UL
229 #define SQ_SEND_RAWETH_QP1_LFLAGS_STAMP 0x8UL
230 #define SQ_SEND_RAWETH_QP1_LFLAGS_T_IP_CHKSUM 0x10UL
231 #define SQ_SEND_RAWETH_QP1_LFLAGS_RESERVED1_1 0x20UL
232 #define SQ_SEND_RAWETH_QP1_LFLAGS_RESERVED1_2 0x40UL
233 #define SQ_SEND_RAWETH_QP1_LFLAGS_RESERVED1_3 0x80UL
234 #define SQ_SEND_RAWETH_QP1_LFLAGS_ROCE_CRC 0x100UL
235 #define SQ_SEND_RAWETH_QP1_LFLAGS_FCOE_CRC 0x200UL
240 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_VID_MASK 0xfffUL
241 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_VID_SFT 0
242 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_DE 0x1000UL
243 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_PRI_MASK 0xe000UL
244 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_PRI_SFT 13
245 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_MASK 0x70000UL
246 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_SFT 16
247 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID88A8 (0x0UL << 16)
248 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID8100 (0x1UL << 16)
249 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID9100 (0x2UL << 16)
250 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID9200 (0x3UL << 16)
251 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID9300 (0x4UL << 16)
252 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPIDCFG (0x5UL << 16)
253 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_LAST \
254 SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPIDCFG
255 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_RESERVED_MASK 0xff80000UL
256 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_RESERVED_SFT 19
257 #define SQ_SEND_RAWETH_QP1_CFA_META_KEY_MASK 0xf0000000UL
258 #define SQ_SEND_RAWETH_QP1_CFA_META_KEY_SFT 28
259 #define SQ_SEND_RAWETH_QP1_CFA_META_KEY_NONE (0x0UL << 28)
260 #define SQ_SEND_RAWETH_QP1_CFA_META_KEY_VLAN_TAG (0x1UL << 28)
261 #define SQ_SEND_RAWETH_QP1_CFA_META_KEY_LAST \
262 SQ_SEND_RAWETH_QP1_CFA_META_KEY_VLAN_TAG
268 /* RDMA SQ WQE (40 bytes) */
271 #define SQ_RDMA_WQE_TYPE_WRITE_WQE 0x4UL
272 #define SQ_RDMA_WQE_TYPE_WRITE_W_IMMEAD 0x5UL
273 #define SQ_RDMA_WQE_TYPE_READ_WQE 0x6UL
275 #define SQ_RDMA_FLAGS_SIGNAL_COMP 0x1UL
276 #define SQ_RDMA_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL
277 #define SQ_RDMA_FLAGS_UC_FENCE 0x4UL
278 #define SQ_RDMA_FLAGS_SE 0x8UL
279 #define SQ_RDMA_FLAGS_INLINE 0x10UL
291 /* Atomic SQ WQE (40 bytes) */
294 #define SQ_ATOMIC_WQE_TYPE_ATOMIC_CS 0x8UL
295 #define SQ_ATOMIC_WQE_TYPE_ATOMIC_FA 0xbUL
297 #define SQ_ATOMIC_FLAGS_SIGNAL_COMP 0x1UL
298 #define SQ_ATOMIC_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL
299 #define SQ_ATOMIC_FLAGS_UC_FENCE 0x4UL
300 #define SQ_ATOMIC_FLAGS_SE 0x8UL
301 #define SQ_ATOMIC_FLAGS_INLINE 0x10UL
310 /* Local Invalidate SQ WQE (40 bytes) */
311 struct sq_localinvalidate
{
313 #define SQ_LOCALINVALIDATE_WQE_TYPE_LOCAL_INVALID 0xcUL
315 #define SQ_LOCALINVALIDATE_FLAGS_SIGNAL_COMP 0x1UL
316 #define SQ_LOCALINVALIDATE_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL
317 #define SQ_LOCALINVALIDATE_FLAGS_UC_FENCE 0x4UL
318 #define SQ_LOCALINVALIDATE_FLAGS_SE 0x8UL
319 #define SQ_LOCALINVALIDATE_FLAGS_INLINE 0x10UL
323 __le32 reserved128
[4];
327 /* FR-PMR SQ WQE (40 bytes) */
330 #define SQ_FR_PMR_WQE_TYPE_FR_PMR 0xdUL
332 #define SQ_FR_PMR_FLAGS_SIGNAL_COMP 0x1UL
333 #define SQ_FR_PMR_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL
334 #define SQ_FR_PMR_FLAGS_UC_FENCE 0x4UL
335 #define SQ_FR_PMR_FLAGS_SE 0x8UL
336 #define SQ_FR_PMR_FLAGS_INLINE 0x10UL
338 #define SQ_FR_PMR_ACCESS_CNTL_LOCAL_WRITE 0x1UL
339 #define SQ_FR_PMR_ACCESS_CNTL_REMOTE_READ 0x2UL
340 #define SQ_FR_PMR_ACCESS_CNTL_REMOTE_WRITE 0x4UL
341 #define SQ_FR_PMR_ACCESS_CNTL_REMOTE_ATOMIC 0x8UL
342 #define SQ_FR_PMR_ACCESS_CNTL_WINDOW_BIND 0x10UL
343 u8 zero_based_page_size_log
;
344 #define SQ_FR_PMR_PAGE_SIZE_LOG_MASK 0x1fUL
345 #define SQ_FR_PMR_PAGE_SIZE_LOG_SFT 0
346 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4K 0x0UL
347 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8K 0x1UL
348 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_64K 0x4UL
349 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_256K 0x6UL
350 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_1M 0x8UL
351 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_2M 0x9UL
352 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4M 0xaUL
353 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_1G 0x12UL
354 #define SQ_FR_PMR_ZERO_BASED 0x20UL
355 #define SQ_FR_PMR_RESERVED2_MASK 0xc0UL
356 #define SQ_FR_PMR_RESERVED2_SFT 6
361 u8 numlevels_pbl_page_size_log
;
362 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_MASK 0x1fUL
363 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_SFT 0
364 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4K 0x0UL
365 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8K 0x1UL
366 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_64K 0x4UL
367 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_256K 0x6UL
368 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_1M 0x8UL
369 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_2M 0x9UL
370 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4M 0xaUL
371 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_1G 0x12UL
372 #define SQ_FR_PMR_RESERVED1 0x20UL
373 #define SQ_FR_PMR_NUMLEVELS_MASK 0xc0UL
374 #define SQ_FR_PMR_NUMLEVELS_SFT 6
375 #define SQ_FR_PMR_NUMLEVELS_PHYSICAL (0x0UL << 6)
376 #define SQ_FR_PMR_NUMLEVELS_LAYER1 (0x1UL << 6)
377 #define SQ_FR_PMR_NUMLEVELS_LAYER2 (0x2UL << 6)
383 /* Bind SQ WQE (40 bytes) */
386 #define SQ_BIND_WQE_TYPE_BIND 0xeUL
388 #define SQ_BIND_FLAGS_SIGNAL_COMP 0x1UL
389 #define SQ_BIND_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL
390 #define SQ_BIND_FLAGS_UC_FENCE 0x4UL
391 #define SQ_BIND_FLAGS_SE 0x8UL
392 #define SQ_BIND_FLAGS_INLINE 0x10UL
394 #define SQ_BIND_ACCESS_CNTL_LOCAL_WRITE 0x1UL
395 #define SQ_BIND_ACCESS_CNTL_REMOTE_READ 0x2UL
396 #define SQ_BIND_ACCESS_CNTL_REMOTE_WRITE 0x4UL
397 #define SQ_BIND_ACCESS_CNTL_REMOTE_ATOMIC 0x8UL
398 #define SQ_BIND_ACCESS_CNTL_WINDOW_BIND 0x10UL
400 u8 mw_type_zero_based
;
401 #define SQ_BIND_ZERO_BASED 0x1UL
402 #define SQ_BIND_MW_TYPE 0x2UL
403 #define SQ_BIND_MW_TYPE_TYPE1 (0x0UL << 1)
404 #define SQ_BIND_MW_TYPE_TYPE2 (0x1UL << 1)
405 #define SQ_BIND_RESERVED6_MASK 0xfcUL
406 #define SQ_BIND_RESERVED6_SFT 2
413 u8 data_reserved24
[99];
414 #define SQ_BIND_RESERVED24_MASK 0xffffff00UL
415 #define SQ_BIND_RESERVED24_SFT 8
416 #define SQ_BIND_DATA_MASK 0xffffffffUL
417 #define SQ_BIND_DATA_SFT 0
420 /* RQ/SRQ WQE Structures */
421 /* RQ/SRQ WQE (40 bytes) */
424 #define RQ_WQE_WQE_TYPE_RCV 0x80UL
430 #define RQ_WQE_WR_ID_MASK 0xfffffUL
431 #define RQ_WQE_WR_ID_SFT 0
432 #define RQ_WQE_RESERVED44_MASK 0xfff00000UL
433 #define RQ_WQE_RESERVED44_SFT 20
434 __le32 reserved128
[4];
438 /* CQ CQE Structures */
439 /* Base CQE (32 bytes) */
445 #define CQ_BASE_TOGGLE 0x1UL
446 #define CQ_BASE_CQE_TYPE_MASK 0x1eUL
447 #define CQ_BASE_CQE_TYPE_SFT 1
448 #define CQ_BASE_CQE_TYPE_REQ (0x0UL << 1)
449 #define CQ_BASE_CQE_TYPE_RES_RC (0x1UL << 1)
450 #define CQ_BASE_CQE_TYPE_RES_UD (0x2UL << 1)
451 #define CQ_BASE_CQE_TYPE_RES_RAWETH_QP1 (0x3UL << 1)
452 #define CQ_BASE_CQE_TYPE_TERMINAL (0xeUL << 1)
453 #define CQ_BASE_CQE_TYPE_CUT_OFF (0xfUL << 1)
454 #define CQ_BASE_RESERVED3_MASK 0xe0UL
455 #define CQ_BASE_RESERVED3_SFT 5
461 /* Requester CQ CQE (32 bytes) */
469 #define CQ_REQ_TOGGLE 0x1UL
470 #define CQ_REQ_CQE_TYPE_MASK 0x1eUL
471 #define CQ_REQ_CQE_TYPE_SFT 1
472 #define CQ_REQ_CQE_TYPE_REQ (0x0UL << 1)
473 #define CQ_REQ_RESERVED3_MASK 0xe0UL
474 #define CQ_REQ_RESERVED3_SFT 5
476 #define CQ_REQ_STATUS_OK 0x0UL
477 #define CQ_REQ_STATUS_BAD_RESPONSE_ERR 0x1UL
478 #define CQ_REQ_STATUS_LOCAL_LENGTH_ERR 0x2UL
479 #define CQ_REQ_STATUS_LOCAL_QP_OPERATION_ERR 0x3UL
480 #define CQ_REQ_STATUS_LOCAL_PROTECTION_ERR 0x4UL
481 #define CQ_REQ_STATUS_MEMORY_MGT_OPERATION_ERR 0x5UL
482 #define CQ_REQ_STATUS_REMOTE_INVALID_REQUEST_ERR 0x6UL
483 #define CQ_REQ_STATUS_REMOTE_ACCESS_ERR 0x7UL
484 #define CQ_REQ_STATUS_REMOTE_OPERATION_ERR 0x8UL
485 #define CQ_REQ_STATUS_RNR_NAK_RETRY_CNT_ERR 0x9UL
486 #define CQ_REQ_STATUS_TRANSPORT_RETRY_CNT_ERR 0xaUL
487 #define CQ_REQ_STATUS_WORK_REQUEST_FLUSHED_ERR 0xbUL
492 /* Responder RC CQE (32 bytes) */
495 __le32 imm_data_or_inv_r_key
;
499 #define CQ_RES_RC_TOGGLE 0x1UL
500 #define CQ_RES_RC_CQE_TYPE_MASK 0x1eUL
501 #define CQ_RES_RC_CQE_TYPE_SFT 1
502 #define CQ_RES_RC_CQE_TYPE_RES_RC (0x1UL << 1)
503 #define CQ_RES_RC_RESERVED3_MASK 0xe0UL
504 #define CQ_RES_RC_RESERVED3_SFT 5
506 #define CQ_RES_RC_STATUS_OK 0x0UL
507 #define CQ_RES_RC_STATUS_LOCAL_ACCESS_ERROR 0x1UL
508 #define CQ_RES_RC_STATUS_LOCAL_LENGTH_ERR 0x2UL
509 #define CQ_RES_RC_STATUS_LOCAL_PROTECTION_ERR 0x3UL
510 #define CQ_RES_RC_STATUS_LOCAL_QP_OPERATION_ERR 0x4UL
511 #define CQ_RES_RC_STATUS_MEMORY_MGT_OPERATION_ERR 0x5UL
512 #define CQ_RES_RC_STATUS_REMOTE_INVALID_REQUEST_ERR 0x6UL
513 #define CQ_RES_RC_STATUS_WORK_REQUEST_FLUSHED_ERR 0x7UL
514 #define CQ_RES_RC_STATUS_HW_FLUSH_ERR 0x8UL
516 #define CQ_RES_RC_FLAGS_SRQ 0x1UL
517 #define CQ_RES_RC_FLAGS_SRQ_RQ (0x0UL << 0)
518 #define CQ_RES_RC_FLAGS_SRQ_SRQ (0x1UL << 0)
519 #define CQ_RES_RC_FLAGS_SRQ_LAST CQ_RES_RC_FLAGS_SRQ_SRQ
520 #define CQ_RES_RC_FLAGS_IMM 0x2UL
521 #define CQ_RES_RC_FLAGS_INV 0x4UL
522 #define CQ_RES_RC_FLAGS_RDMA 0x8UL
523 #define CQ_RES_RC_FLAGS_RDMA_SEND (0x0UL << 3)
524 #define CQ_RES_RC_FLAGS_RDMA_RDMA_WRITE (0x1UL << 3)
525 #define CQ_RES_RC_FLAGS_RDMA_LAST CQ_RES_RC_FLAGS_RDMA_RDMA_WRITE
526 __le32 srq_or_rq_wr_id
;
527 #define CQ_RES_RC_SRQ_OR_RQ_WR_ID_MASK 0xfffffUL
528 #define CQ_RES_RC_SRQ_OR_RQ_WR_ID_SFT 0
529 #define CQ_RES_RC_RESERVED12_MASK 0xfff00000UL
530 #define CQ_RES_RC_RESERVED12_SFT 20
533 /* Responder UD CQE (32 bytes) */
536 #define CQ_RES_UD_LENGTH_MASK 0x3fffUL
537 #define CQ_RES_UD_LENGTH_SFT 0
539 #define CQ_RES_UD_CFA_METADATA_VID_MASK 0xfffUL
540 #define CQ_RES_UD_CFA_METADATA_VID_SFT 0
541 #define CQ_RES_UD_CFA_METADATA_DE 0x1000UL
542 #define CQ_RES_UD_CFA_METADATA_PRI_MASK 0xe000UL
543 #define CQ_RES_UD_CFA_METADATA_PRI_SFT 13
549 #define CQ_RES_UD_TOGGLE 0x1UL
550 #define CQ_RES_UD_CQE_TYPE_MASK 0x1eUL
551 #define CQ_RES_UD_CQE_TYPE_SFT 1
552 #define CQ_RES_UD_CQE_TYPE_RES_UD (0x2UL << 1)
554 #define CQ_RES_UD_STATUS_OK 0x0UL
555 #define CQ_RES_UD_STATUS_LOCAL_ACCESS_ERROR 0x1UL
556 #define CQ_RES_UD_STATUS_HW_LOCAL_LENGTH_ERR 0x2UL
557 #define CQ_RES_UD_STATUS_LOCAL_PROTECTION_ERR 0x3UL
558 #define CQ_RES_UD_STATUS_LOCAL_QP_OPERATION_ERR 0x4UL
559 #define CQ_RES_UD_STATUS_MEMORY_MGT_OPERATION_ERR 0x5UL
560 #define CQ_RES_UD_STATUS_WORK_REQUEST_FLUSHED_ERR 0x7UL
561 #define CQ_RES_UD_STATUS_HW_FLUSH_ERR 0x8UL
563 #define CQ_RES_UD_FLAGS_SRQ 0x1UL
564 #define CQ_RES_UD_FLAGS_SRQ_RQ (0x0UL << 0)
565 #define CQ_RES_UD_FLAGS_SRQ_SRQ (0x1UL << 0)
566 #define CQ_RES_UD_FLAGS_SRQ_LAST CQ_RES_UD_FLAGS_SRQ_SRQ
567 #define CQ_RES_UD_FLAGS_IMM 0x2UL
568 #define CQ_RES_UD_FLAGS_UNUSED_MASK 0xcUL
569 #define CQ_RES_UD_FLAGS_UNUSED_SFT 2
570 #define CQ_RES_UD_FLAGS_ROCE_IP_VER_MASK 0x30UL
571 #define CQ_RES_UD_FLAGS_ROCE_IP_VER_SFT 4
572 #define CQ_RES_UD_FLAGS_ROCE_IP_VER_V1 (0x0UL << 4)
573 #define CQ_RES_UD_FLAGS_ROCE_IP_VER_V2IPV4 (0x2UL << 4)
574 #define CQ_RES_UD_FLAGS_ROCE_IP_VER_V2IPV6 (0x3UL << 4)
575 #define CQ_RES_UD_FLAGS_ROCE_IP_VER_LAST \
576 CQ_RES_UD_FLAGS_ROCE_IP_VER_V2IPV6
577 #define CQ_RES_UD_FLAGS_META_FORMAT_MASK 0x3c0UL
578 #define CQ_RES_UD_FLAGS_META_FORMAT_SFT 6
579 #define CQ_RES_UD_FLAGS_META_FORMAT_NONE (0x0UL << 6)
580 #define CQ_RES_UD_FLAGS_META_FORMAT_VLAN (0x1UL << 6)
581 #define CQ_RES_UD_FLAGS_META_FORMAT_TUNNEL_ID (0x2UL << 6)
582 #define CQ_RES_UD_FLAGS_META_FORMAT_CHDR_DATA (0x3UL << 6)
583 #define CQ_RES_UD_FLAGS_META_FORMAT_HDR_OFFSET (0x4UL << 6)
584 #define CQ_RES_UD_FLAGS_META_FORMAT_LAST \
585 CQ_RES_UD_FLAGS_META_FORMAT_HDR_OFFSET
586 #define CQ_RES_UD_FLAGS_EXT_META_FORMAT_MASK 0xc00UL
587 #define CQ_RES_UD_FLAGS_EXT_META_FORMAT_SFT 10
589 __le32 src_qp_high_srq_or_rq_wr_id
;
590 #define CQ_RES_UD_SRQ_OR_RQ_WR_ID_MASK 0xfffffUL
591 #define CQ_RES_UD_SRQ_OR_RQ_WR_ID_SFT 0
592 #define CQ_RES_UD_SRC_QP_HIGH_MASK 0xff000000UL
593 #define CQ_RES_UD_SRC_QP_HIGH_SFT 24
596 /* Responder RawEth and QP1 CQE (32 bytes) */
597 struct cq_res_raweth_qp1
{
599 #define CQ_RES_RAWETH_QP1_LENGTH_MASK 0x3fffUL
600 #define CQ_RES_RAWETH_QP1_LENGTH_SFT 0
601 #define CQ_RES_RAWETH_QP1_RESERVED2_MASK 0xc000UL
602 #define CQ_RES_RAWETH_QP1_RESERVED2_SFT 14
603 __le16 raweth_qp1_flags
;
604 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ERROR 0x1UL
605 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_RESERVED5_1_MASK 0x3eUL
606 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_RESERVED5_1_SFT 1
607 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_MASK 0x3c0UL
608 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_SFT 6
609 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_NOT_KNOWN (0x0UL << 6)
610 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_IP (0x1UL << 6)
611 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_TCP (0x2UL << 6)
612 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_UDP (0x3UL << 6)
613 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_FCOE (0x4UL << 6)
614 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_ROCE (0x5UL << 6)
615 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_ICMP (0x7UL << 6)
616 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_PTP_WO_TIMESTAMP \
618 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP \
620 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_LAST \
621 CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP
622 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_MASK 0x3ffUL
623 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_SFT 0
624 #define CQ_RES_RAWETH_QP1_RESERVED6_MASK 0xfc00UL
625 #define CQ_RES_RAWETH_QP1_RESERVED6_SFT 10
626 __le16 raweth_qp1_errors
;
627 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_RESERVED4_MASK 0xfUL
628 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_RESERVED4_SFT 0
629 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_IP_CS_ERROR 0x10UL
630 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_L4_CS_ERROR 0x20UL
631 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_IP_CS_ERROR 0x40UL
632 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_L4_CS_ERROR 0x80UL
633 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_CRC_ERROR 0x100UL
634 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_MASK 0xe00UL
635 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_SFT 9
636 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_NO_ERROR \
639 CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION \
642 CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN \
645 CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR \
648 CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR \
651 CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR \
654 CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL \
656 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_LAST \
657 CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL
658 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_MASK 0xf000UL
659 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_SFT 12
660 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_NO_ERROR \
662 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_VERSION \
664 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN \
666 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_TTL \
668 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_IP_TOTAL_ERROR \
670 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR \
672 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN \
675 CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL\
677 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN \
679 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_LAST \
680 CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
681 __le16 raweth_qp1_cfa_code
;
683 __le32 raweth_qp1_flags2
;
684 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_IP_CS_CALC 0x1UL
685 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_L4_CS_CALC 0x2UL
686 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_T_IP_CS_CALC 0x4UL
687 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_T_L4_CS_CALC 0x8UL
688 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_MASK 0xf0UL
689 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_SFT 4
690 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_NONE \
692 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_VLAN \
694 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_LAST\
695 CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_VLAN
696 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_IP_TYPE 0x100UL
697 __le32 raweth_qp1_metadata
;
698 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_VID_MASK 0xfffUL
699 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_VID_SFT 0
700 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_DE 0x1000UL
701 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_MASK 0xe000UL
702 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_SFT 13
703 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_TPID_MASK 0xffff0000UL
704 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_TPID_SFT 16
706 #define CQ_RES_RAWETH_QP1_TOGGLE 0x1UL
707 #define CQ_RES_RAWETH_QP1_CQE_TYPE_MASK 0x1eUL
708 #define CQ_RES_RAWETH_QP1_CQE_TYPE_SFT 1
709 #define CQ_RES_RAWETH_QP1_CQE_TYPE_RES_RAWETH_QP1 (0x3UL << 1)
710 #define CQ_RES_RAWETH_QP1_RESERVED3_MASK 0xe0UL
711 #define CQ_RES_RAWETH_QP1_RESERVED3_SFT 5
713 #define CQ_RES_RAWETH_QP1_STATUS_OK 0x0UL
714 #define CQ_RES_RAWETH_QP1_STATUS_LOCAL_ACCESS_ERROR 0x1UL
715 #define CQ_RES_RAWETH_QP1_STATUS_HW_LOCAL_LENGTH_ERR 0x2UL
716 #define CQ_RES_RAWETH_QP1_STATUS_LOCAL_PROTECTION_ERR 0x3UL
717 #define CQ_RES_RAWETH_QP1_STATUS_LOCAL_QP_OPERATION_ERR 0x4UL
718 #define CQ_RES_RAWETH_QP1_STATUS_MEMORY_MGT_OPERATION_ERR 0x5UL
719 #define CQ_RES_RAWETH_QP1_STATUS_WORK_REQUEST_FLUSHED_ERR 0x7UL
720 #define CQ_RES_RAWETH_QP1_STATUS_HW_FLUSH_ERR 0x8UL
722 #define CQ_RES_RAWETH_QP1_FLAGS_SRQ 0x1UL
723 #define CQ_RES_RAWETH_QP1_FLAGS_SRQ_RQ 0x0UL
724 #define CQ_RES_RAWETH_QP1_FLAGS_SRQ_SRQ 0x1UL
725 #define CQ_RES_RAWETH_QP1_FLAGS_SRQ_LAST \
726 CQ_RES_RAWETH_QP1_FLAGS_SRQ_SRQ
727 __le32 raweth_qp1_payload_offset_srq_or_rq_wr_id
;
728 #define CQ_RES_RAWETH_QP1_SRQ_OR_RQ_WR_ID_MASK 0xfffffUL
729 #define CQ_RES_RAWETH_QP1_SRQ_OR_RQ_WR_ID_SFT 0
730 #define CQ_RES_RAWETH_QP1_RESERVED4_MASK 0xf00000UL
731 #define CQ_RES_RAWETH_QP1_RESERVED4_SFT 20
732 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_PAYLOAD_OFFSET_MASK 0xff000000UL
733 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_PAYLOAD_OFFSET_SFT 24
736 /* Terminal CQE (32 bytes) */
744 #define CQ_TERMINAL_TOGGLE 0x1UL
745 #define CQ_TERMINAL_CQE_TYPE_MASK 0x1eUL
746 #define CQ_TERMINAL_CQE_TYPE_SFT 1
747 #define CQ_TERMINAL_CQE_TYPE_TERMINAL (0xeUL << 1)
748 #define CQ_TERMINAL_RESERVED3_MASK 0xe0UL
749 #define CQ_TERMINAL_RESERVED3_SFT 5
751 #define CQ_TERMINAL_STATUS_OK 0x0UL
756 /* Cutoff CQE (32 bytes) */
762 #define CQ_CUTOFF_TOGGLE 0x1UL
763 #define CQ_CUTOFF_CQE_TYPE_MASK 0x1eUL
764 #define CQ_CUTOFF_CQE_TYPE_SFT 1
765 #define CQ_CUTOFF_CQE_TYPE_CUT_OFF (0xfUL << 1)
766 #define CQ_CUTOFF_RESERVED3_MASK 0xe0UL
767 #define CQ_CUTOFF_RESERVED3_SFT 5
769 #define CQ_CUTOFF_STATUS_OK 0x0UL
774 /* Notification Queue (NQ) Structures */
775 /* Base NQ Record (16 bytes) */
778 #define NQ_BASE_TYPE_MASK 0x3fUL
779 #define NQ_BASE_TYPE_SFT 0
780 #define NQ_BASE_TYPE_CQ_NOTIFICATION 0x30UL
781 #define NQ_BASE_TYPE_SRQ_EVENT 0x32UL
782 #define NQ_BASE_TYPE_DBQ_EVENT 0x34UL
783 #define NQ_BASE_TYPE_QP_EVENT 0x38UL
784 #define NQ_BASE_TYPE_FUNC_EVENT 0x3aUL
785 #define NQ_BASE_INFO10_MASK 0xffc0UL
786 #define NQ_BASE_INFO10_SFT 6
790 #define NQ_BASE_V 0x1UL
791 #define NQ_BASE_INFO63_MASK 0xfffffffeUL
792 #define NQ_BASE_INFO63_SFT 1
795 /* Completion Queue Notification (16 bytes) */
798 #define NQ_CN_TYPE_MASK 0x3fUL
799 #define NQ_CN_TYPE_SFT 0
800 #define NQ_CN_TYPE_CQ_NOTIFICATION 0x30UL
801 #define NQ_CN_RESERVED9_MASK 0xffc0UL
802 #define NQ_CN_RESERVED9_SFT 6
804 __le32 cq_handle_low
;
806 #define NQ_CN_V 0x1UL
807 #define NQ_CN_RESERVED31_MASK 0xfffffffeUL
808 #define NQ_CN_RESERVED31_SFT 1
809 __le32 cq_handle_high
;
812 /* SRQ Event Notification (16 bytes) */
813 struct nq_srq_event
{
815 #define NQ_SRQ_EVENT_TYPE_MASK 0x3fUL
816 #define NQ_SRQ_EVENT_TYPE_SFT 0
817 #define NQ_SRQ_EVENT_TYPE_SRQ_EVENT 0x32UL
818 #define NQ_SRQ_EVENT_RESERVED1_MASK 0xc0UL
819 #define NQ_SRQ_EVENT_RESERVED1_SFT 6
821 #define NQ_SRQ_EVENT_EVENT_SRQ_THRESHOLD_EVENT 0x1UL
823 __le32 srq_handle_low
;
825 #define NQ_SRQ_EVENT_V 0x1UL
826 #define NQ_SRQ_EVENT_RESERVED31_MASK 0xfffffffeUL
827 #define NQ_SRQ_EVENT_RESERVED31_SFT 1
828 __le32 srq_handle_high
;
831 /* DBQ Async Event Notification (16 bytes) */
832 struct nq_dbq_event
{
834 #define NQ_DBQ_EVENT_TYPE_MASK 0x3fUL
835 #define NQ_DBQ_EVENT_TYPE_SFT 0
836 #define NQ_DBQ_EVENT_TYPE_DBQ_EVENT 0x34UL
837 #define NQ_DBQ_EVENT_RESERVED1_MASK 0xc0UL
838 #define NQ_DBQ_EVENT_RESERVED1_SFT 6
840 #define NQ_DBQ_EVENT_EVENT_DBQ_THRESHOLD_EVENT 0x1UL
842 #define NQ_DBQ_EVENT_DB_PFID_MASK 0xfUL
843 #define NQ_DBQ_EVENT_DB_PFID_SFT 0
844 #define NQ_DBQ_EVENT_RESERVED12_MASK 0xfff0UL
845 #define NQ_DBQ_EVENT_RESERVED12_SFT 4
847 #define NQ_DBQ_EVENT_DB_DPI_MASK 0xfffffUL
848 #define NQ_DBQ_EVENT_DB_DPI_SFT 0
849 #define NQ_DBQ_EVENT_RESERVED12_2_MASK 0xfff00000UL
850 #define NQ_DBQ_EVENT_RESERVED12_2_SFT 20
852 #define NQ_DBQ_EVENT_V 0x1UL
853 #define NQ_DBQ_EVENT_RESERVED32_MASK 0xfffffffeUL
854 #define NQ_DBQ_EVENT_RESERVED32_SFT 1
855 __le32 db_type_db_xid
;
856 #define NQ_DBQ_EVENT_DB_XID_MASK 0xfffffUL
857 #define NQ_DBQ_EVENT_DB_XID_SFT 0
858 #define NQ_DBQ_EVENT_RESERVED8_MASK 0xff00000UL
859 #define NQ_DBQ_EVENT_RESERVED8_SFT 20
860 #define NQ_DBQ_EVENT_DB_TYPE_MASK 0xf0000000UL
861 #define NQ_DBQ_EVENT_DB_TYPE_SFT 28
864 /* Read Request/Response Queue Structures */
865 /* Input Read Request Queue (IRRQ) Message (32 bytes) */
868 #define XRRQ_IRRQ_TYPE 0x1UL
869 #define XRRQ_IRRQ_TYPE_READ_REQ 0x0UL
870 #define XRRQ_IRRQ_TYPE_ATOMIC_REQ 0x1UL
871 #define XRRQ_IRRQ_RESERVED10_MASK 0x7feUL
872 #define XRRQ_IRRQ_RESERVED10_SFT 1
873 #define XRRQ_IRRQ_CREDITS_MASK 0xf800UL
874 #define XRRQ_IRRQ_CREDITS_SFT 11
878 #define XRRQ_IRRQ_PSN_MASK 0xffffffUL
879 #define XRRQ_IRRQ_PSN_SFT 0
880 #define XRRQ_IRRQ_RESERVED8_1_MASK 0xff000000UL
881 #define XRRQ_IRRQ_RESERVED8_1_SFT 24
883 #define XRRQ_IRRQ_MSN_MASK 0xffffffUL
884 #define XRRQ_IRRQ_MSN_SFT 0
885 #define XRRQ_IRRQ_RESERVED8_2_MASK 0xff000000UL
886 #define XRRQ_IRRQ_RESERVED8_2_SFT 24
887 __le64 va_or_atomic_result
;
892 /* Output Read Request Queue (ORRQ) Message (32 bytes) */
894 __le16 num_sges_type
;
895 #define XRRQ_ORRQ_TYPE 0x1UL
896 #define XRRQ_ORRQ_TYPE_READ_REQ 0x0UL
897 #define XRRQ_ORRQ_TYPE_ATOMIC_REQ 0x1UL
898 #define XRRQ_ORRQ_RESERVED10_MASK 0x7feUL
899 #define XRRQ_ORRQ_RESERVED10_SFT 1
900 #define XRRQ_ORRQ_NUM_SGES_MASK 0xf800UL
901 #define XRRQ_ORRQ_NUM_SGES_SFT 11
905 #define XRRQ_ORRQ_PSN_MASK 0xffffffUL
906 #define XRRQ_ORRQ_PSN_SFT 0
907 #define XRRQ_ORRQ_RESERVED8_1_MASK 0xff000000UL
908 #define XRRQ_ORRQ_RESERVED8_1_SFT 24
910 #define XRRQ_ORRQ_END_PSN_MASK 0xffffffUL
911 #define XRRQ_ORRQ_END_PSN_SFT 0
912 #define XRRQ_ORRQ_RESERVED8_2_MASK 0xff000000UL
913 #define XRRQ_ORRQ_RESERVED8_2_SFT 24
914 __le64 first_sge_phy_or_sing_sge_va
;
915 __le32 single_sge_l_key
;
916 __le32 single_sge_size
;
919 /* Page Buffer List Memory Structures (PBL) */
920 /* Page Table Entry (PTE) (8 bytes) */
922 __le32 page_next_to_last_last_valid
[2];
923 #define PTU_PTE_VALID 0x1UL
924 #define PTU_PTE_LAST 0x2UL
925 #define PTU_PTE_NEXT_TO_LAST 0x4UL
926 #define PTU_PTE_PAGE_MASK 0xfffff000UL
927 #define PTU_PTE_PAGE_SFT 12
930 /* Page Directory Entry (PDE) (8 bytes) */
932 __le32 page_valid
[2];
933 #define PTU_PDE_VALID 0x1UL
934 #define PTU_PDE_PAGE_MASK 0xfffff000UL
935 #define PTU_PDE_PAGE_SFT 12
938 /* RoCE Fastpath Host Structures */
939 /* Command Queue (CMDQ) Interface */
940 /* Init CMDQ (16 bytes) */
943 __le16 cmdq_size_cmdq_lvl
;
944 #define CMDQ_INIT_CMDQ_LVL_MASK 0x3UL
945 #define CMDQ_INIT_CMDQ_LVL_SFT 0
946 #define CMDQ_INIT_CMDQ_SIZE_MASK 0xfffcUL
947 #define CMDQ_INIT_CMDQ_SIZE_SFT 2
952 /* Update CMDQ producer index (16 bytes) */
959 /* CMDQ common header structure (16 bytes) */
962 #define CMDQ_BASE_OPCODE_CREATE_QP 0x1UL
963 #define CMDQ_BASE_OPCODE_DESTROY_QP 0x2UL
964 #define CMDQ_BASE_OPCODE_MODIFY_QP 0x3UL
965 #define CMDQ_BASE_OPCODE_QUERY_QP 0x4UL
966 #define CMDQ_BASE_OPCODE_CREATE_SRQ 0x5UL
967 #define CMDQ_BASE_OPCODE_DESTROY_SRQ 0x6UL
968 #define CMDQ_BASE_OPCODE_QUERY_SRQ 0x8UL
969 #define CMDQ_BASE_OPCODE_CREATE_CQ 0x9UL
970 #define CMDQ_BASE_OPCODE_DESTROY_CQ 0xaUL
971 #define CMDQ_BASE_OPCODE_RESIZE_CQ 0xcUL
972 #define CMDQ_BASE_OPCODE_ALLOCATE_MRW 0xdUL
973 #define CMDQ_BASE_OPCODE_DEALLOCATE_KEY 0xeUL
974 #define CMDQ_BASE_OPCODE_REGISTER_MR 0xfUL
975 #define CMDQ_BASE_OPCODE_DEREGISTER_MR 0x10UL
976 #define CMDQ_BASE_OPCODE_ADD_GID 0x11UL
977 #define CMDQ_BASE_OPCODE_DELETE_GID 0x12UL
978 #define CMDQ_BASE_OPCODE_MODIFY_GID 0x17UL
979 #define CMDQ_BASE_OPCODE_QUERY_GID 0x18UL
980 #define CMDQ_BASE_OPCODE_CREATE_QP1 0x13UL
981 #define CMDQ_BASE_OPCODE_DESTROY_QP1 0x14UL
982 #define CMDQ_BASE_OPCODE_CREATE_AH 0x15UL
983 #define CMDQ_BASE_OPCODE_DESTROY_AH 0x16UL
984 #define CMDQ_BASE_OPCODE_INITIALIZE_FW 0x80UL
985 #define CMDQ_BASE_OPCODE_DEINITIALIZE_FW 0x81UL
986 #define CMDQ_BASE_OPCODE_STOP_FUNC 0x82UL
987 #define CMDQ_BASE_OPCODE_QUERY_FUNC 0x83UL
988 #define CMDQ_BASE_OPCODE_SET_FUNC_RESOURCES 0x84UL
989 #define CMDQ_BASE_OPCODE_READ_CONTEXT 0x85UL
990 #define CMDQ_BASE_OPCODE_VF_BACKCHANNEL_REQUEST 0x86UL
991 #define CMDQ_BASE_OPCODE_READ_VF_MEMORY 0x87UL
992 #define CMDQ_BASE_OPCODE_COMPLETE_VF_REQUEST 0x88UL
993 #define CMDQ_BASE_OPCODE_EXTEND_CONTEXT_ARRRAY 0x89UL
994 #define CMDQ_BASE_OPCODE_MAP_TC_TO_COS 0x8aUL
995 #define CMDQ_BASE_OPCODE_QUERY_VERSION 0x8bUL
996 #define CMDQ_BASE_OPCODE_MODIFY_CC 0x8cUL
997 #define CMDQ_BASE_OPCODE_QUERY_CC 0x8dUL
998 #define CMDQ_BASE_OPCODE_QUERY_ROCE_STATS 0x8eUL
1007 /* Create QP command (96 bytes) */
1008 struct cmdq_create_qp
{
1010 #define CMDQ_CREATE_QP_OPCODE_CREATE_QP 0x1UL
1019 #define CMDQ_CREATE_QP_QP_FLAGS_SRQ_USED 0x1UL
1020 #define CMDQ_CREATE_QP_QP_FLAGS_FORCE_COMPLETION 0x2UL
1021 #define CMDQ_CREATE_QP_QP_FLAGS_RESERVED_LKEY_ENABLE 0x4UL
1022 #define CMDQ_CREATE_QP_QP_FLAGS_FR_PMR_ENABLED 0x8UL
1024 #define CMDQ_CREATE_QP_TYPE_RC 0x2UL
1025 #define CMDQ_CREATE_QP_TYPE_UD 0x4UL
1026 #define CMDQ_CREATE_QP_TYPE_RAW_ETHERTYPE 0x6UL
1027 #define CMDQ_CREATE_QP_TYPE_GSI 0x7UL
1028 u8 sq_pg_size_sq_lvl
;
1029 #define CMDQ_CREATE_QP_SQ_LVL_MASK 0xfUL
1030 #define CMDQ_CREATE_QP_SQ_LVL_SFT 0
1031 #define CMDQ_CREATE_QP_SQ_LVL_LVL_0 0x0UL
1032 #define CMDQ_CREATE_QP_SQ_LVL_LVL_1 0x1UL
1033 #define CMDQ_CREATE_QP_SQ_LVL_LVL_2 0x2UL
1034 #define CMDQ_CREATE_QP_SQ_PG_SIZE_MASK 0xf0UL
1035 #define CMDQ_CREATE_QP_SQ_PG_SIZE_SFT 4
1036 #define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_4K (0x0UL << 4)
1037 #define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_8K (0x1UL << 4)
1038 #define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_64K (0x2UL << 4)
1039 #define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_2M (0x3UL << 4)
1040 #define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_8M (0x4UL << 4)
1041 #define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_1G (0x5UL << 4)
1042 u8 rq_pg_size_rq_lvl
;
1043 #define CMDQ_CREATE_QP_RQ_LVL_MASK 0xfUL
1044 #define CMDQ_CREATE_QP_RQ_LVL_SFT 0
1045 #define CMDQ_CREATE_QP_RQ_LVL_LVL_0 0x0UL
1046 #define CMDQ_CREATE_QP_RQ_LVL_LVL_1 0x1UL
1047 #define CMDQ_CREATE_QP_RQ_LVL_LVL_2 0x2UL
1048 #define CMDQ_CREATE_QP_RQ_PG_SIZE_MASK 0xf0UL
1049 #define CMDQ_CREATE_QP_RQ_PG_SIZE_SFT 4
1050 #define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_4K (0x0UL << 4)
1051 #define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_8K (0x1UL << 4)
1052 #define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_64K (0x2UL << 4)
1053 #define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_2M (0x3UL << 4)
1054 #define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_8M (0x4UL << 4)
1055 #define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_1G (0x5UL << 4)
1060 __le16 sq_fwo_sq_sge
;
1061 #define CMDQ_CREATE_QP_SQ_SGE_MASK 0xfUL
1062 #define CMDQ_CREATE_QP_SQ_SGE_SFT 0
1063 #define CMDQ_CREATE_QP_SQ_FWO_MASK 0xfff0UL
1064 #define CMDQ_CREATE_QP_SQ_FWO_SFT 4
1065 __le16 rq_fwo_rq_sge
;
1066 #define CMDQ_CREATE_QP_RQ_SGE_MASK 0xfUL
1067 #define CMDQ_CREATE_QP_RQ_SGE_SFT 0
1068 #define CMDQ_CREATE_QP_RQ_FWO_MASK 0xfff0UL
1069 #define CMDQ_CREATE_QP_RQ_FWO_SFT 4
1080 /* Destroy QP command (24 bytes) */
1081 struct cmdq_destroy_qp
{
1083 #define CMDQ_DESTROY_QP_OPCODE_DESTROY_QP 0x2UL
1094 /* Modify QP command (112 bytes) */
1095 struct cmdq_modify_qp
{
1097 #define CMDQ_MODIFY_QP_OPCODE_MODIFY_QP 0x3UL
1105 #define CMDQ_MODIFY_QP_MODIFY_MASK_STATE 0x1UL
1106 #define CMDQ_MODIFY_QP_MODIFY_MASK_EN_SQD_ASYNC_NOTIFY 0x2UL
1107 #define CMDQ_MODIFY_QP_MODIFY_MASK_ACCESS 0x4UL
1108 #define CMDQ_MODIFY_QP_MODIFY_MASK_PKEY 0x8UL
1109 #define CMDQ_MODIFY_QP_MODIFY_MASK_QKEY 0x10UL
1110 #define CMDQ_MODIFY_QP_MODIFY_MASK_DGID 0x20UL
1111 #define CMDQ_MODIFY_QP_MODIFY_MASK_FLOW_LABEL 0x40UL
1112 #define CMDQ_MODIFY_QP_MODIFY_MASK_SGID_INDEX 0x80UL
1113 #define CMDQ_MODIFY_QP_MODIFY_MASK_HOP_LIMIT 0x100UL
1114 #define CMDQ_MODIFY_QP_MODIFY_MASK_TRAFFIC_CLASS 0x200UL
1115 #define CMDQ_MODIFY_QP_MODIFY_MASK_DEST_MAC 0x400UL
1116 #define CMDQ_MODIFY_QP_MODIFY_MASK_PATH_MTU 0x1000UL
1117 #define CMDQ_MODIFY_QP_MODIFY_MASK_TIMEOUT 0x2000UL
1118 #define CMDQ_MODIFY_QP_MODIFY_MASK_RETRY_CNT 0x4000UL
1119 #define CMDQ_MODIFY_QP_MODIFY_MASK_RNR_RETRY 0x8000UL
1120 #define CMDQ_MODIFY_QP_MODIFY_MASK_RQ_PSN 0x10000UL
1121 #define CMDQ_MODIFY_QP_MODIFY_MASK_MAX_RD_ATOMIC 0x20000UL
1122 #define CMDQ_MODIFY_QP_MODIFY_MASK_MIN_RNR_TIMER 0x40000UL
1123 #define CMDQ_MODIFY_QP_MODIFY_MASK_SQ_PSN 0x80000UL
1124 #define CMDQ_MODIFY_QP_MODIFY_MASK_MAX_DEST_RD_ATOMIC 0x100000UL
1125 #define CMDQ_MODIFY_QP_MODIFY_MASK_SQ_SIZE 0x200000UL
1126 #define CMDQ_MODIFY_QP_MODIFY_MASK_RQ_SIZE 0x400000UL
1127 #define CMDQ_MODIFY_QP_MODIFY_MASK_SQ_SGE 0x800000UL
1128 #define CMDQ_MODIFY_QP_MODIFY_MASK_RQ_SGE 0x1000000UL
1129 #define CMDQ_MODIFY_QP_MODIFY_MASK_MAX_INLINE_DATA 0x2000000UL
1130 #define CMDQ_MODIFY_QP_MODIFY_MASK_DEST_QP_ID 0x4000000UL
1131 #define CMDQ_MODIFY_QP_MODIFY_MASK_SRC_MAC 0x8000000UL
1132 #define CMDQ_MODIFY_QP_MODIFY_MASK_VLAN_ID 0x10000000UL
1133 #define CMDQ_MODIFY_QP_MODIFY_MASK_ENABLE_CC 0x20000000UL
1134 #define CMDQ_MODIFY_QP_MODIFY_MASK_TOS_ECN 0x40000000UL
1135 #define CMDQ_MODIFY_QP_MODIFY_MASK_TOS_DSCP 0x80000000UL
1137 u8 network_type_en_sqd_async_notify_new_state
;
1138 #define CMDQ_MODIFY_QP_NEW_STATE_MASK 0xfUL
1139 #define CMDQ_MODIFY_QP_NEW_STATE_SFT 0
1140 #define CMDQ_MODIFY_QP_NEW_STATE_RESET 0x0UL
1141 #define CMDQ_MODIFY_QP_NEW_STATE_INIT 0x1UL
1142 #define CMDQ_MODIFY_QP_NEW_STATE_RTR 0x2UL
1143 #define CMDQ_MODIFY_QP_NEW_STATE_RTS 0x3UL
1144 #define CMDQ_MODIFY_QP_NEW_STATE_SQD 0x4UL
1145 #define CMDQ_MODIFY_QP_NEW_STATE_SQE 0x5UL
1146 #define CMDQ_MODIFY_QP_NEW_STATE_ERR 0x6UL
1147 #define CMDQ_MODIFY_QP_EN_SQD_ASYNC_NOTIFY 0x10UL
1148 #define CMDQ_MODIFY_QP_NETWORK_TYPE_MASK 0xc0UL
1149 #define CMDQ_MODIFY_QP_NETWORK_TYPE_SFT 6
1150 #define CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV1 (0x0UL << 6)
1151 #define CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV2_IPV4 (0x2UL << 6)
1152 #define CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV2_IPV6 (0x3UL << 6)
1154 #define CMDQ_MODIFY_QP_ACCESS_LOCAL_WRITE 0x1UL
1155 #define CMDQ_MODIFY_QP_ACCESS_REMOTE_WRITE 0x2UL
1156 #define CMDQ_MODIFY_QP_ACCESS_REMOTE_READ 0x4UL
1157 #define CMDQ_MODIFY_QP_ACCESS_REMOTE_ATOMIC 0x8UL
1166 u8 tos_dscp_tos_ecn
;
1167 #define CMDQ_MODIFY_QP_TOS_ECN_MASK 0x3UL
1168 #define CMDQ_MODIFY_QP_TOS_ECN_SFT 0
1169 #define CMDQ_MODIFY_QP_TOS_DSCP_MASK 0xfcUL
1170 #define CMDQ_MODIFY_QP_TOS_DSCP_SFT 2
1172 #define CMDQ_MODIFY_QP_PATH_MTU_MASK 0xf0UL
1173 #define CMDQ_MODIFY_QP_PATH_MTU_SFT 4
1174 #define CMDQ_MODIFY_QP_PATH_MTU_MTU_256 (0x0UL << 4)
1175 #define CMDQ_MODIFY_QP_PATH_MTU_MTU_512 (0x1UL << 4)
1176 #define CMDQ_MODIFY_QP_PATH_MTU_MTU_1024 (0x2UL << 4)
1177 #define CMDQ_MODIFY_QP_PATH_MTU_MTU_2048 (0x3UL << 4)
1178 #define CMDQ_MODIFY_QP_PATH_MTU_MTU_4096 (0x4UL << 4)
1179 #define CMDQ_MODIFY_QP_PATH_MTU_MTU_8192 (0x5UL << 4)
1187 u8 max_dest_rd_atomic
;
1189 #define CMDQ_MODIFY_QP_ENABLE_CC 0x1UL
1194 __le32 max_inline_data
;
1198 __le16 vlan_pcp_vlan_dei_vlan_id
;
1199 #define CMDQ_MODIFY_QP_VLAN_ID_MASK 0xfffUL
1200 #define CMDQ_MODIFY_QP_VLAN_ID_SFT 0
1201 #define CMDQ_MODIFY_QP_VLAN_DEI 0x1000UL
1202 #define CMDQ_MODIFY_QP_VLAN_PCP_MASK 0xe000UL
1203 #define CMDQ_MODIFY_QP_VLAN_PCP_SFT 13
1206 /* Query QP command (24 bytes) */
1207 struct cmdq_query_qp
{
1209 #define CMDQ_QUERY_QP_OPCODE_QUERY_QP 0x4UL
1220 /* Create SRQ command (48 bytes) */
1221 struct cmdq_create_srq
{
1223 #define CMDQ_CREATE_SRQ_OPCODE_CREATE_SRQ 0x5UL
1232 #define CMDQ_CREATE_SRQ_LVL_MASK 0x3UL
1233 #define CMDQ_CREATE_SRQ_LVL_SFT 0
1234 #define CMDQ_CREATE_SRQ_LVL_LVL_0 0x0UL
1235 #define CMDQ_CREATE_SRQ_LVL_LVL_1 0x1UL
1236 #define CMDQ_CREATE_SRQ_LVL_LVL_2 0x2UL
1237 #define CMDQ_CREATE_SRQ_PG_SIZE_MASK 0x1cUL
1238 #define CMDQ_CREATE_SRQ_PG_SIZE_SFT 2
1239 #define CMDQ_CREATE_SRQ_PG_SIZE_PG_4K (0x0UL << 2)
1240 #define CMDQ_CREATE_SRQ_PG_SIZE_PG_8K (0x1UL << 2)
1241 #define CMDQ_CREATE_SRQ_PG_SIZE_PG_64K (0x2UL << 2)
1242 #define CMDQ_CREATE_SRQ_PG_SIZE_PG_2M (0x3UL << 2)
1243 #define CMDQ_CREATE_SRQ_PG_SIZE_PG_8M (0x4UL << 2)
1244 #define CMDQ_CREATE_SRQ_PG_SIZE_PG_1G (0x5UL << 2)
1246 #define CMDQ_CREATE_SRQ_EVENTQ_ID_MASK 0xfffUL
1247 #define CMDQ_CREATE_SRQ_EVENTQ_ID_SFT 0
1255 /* Destroy SRQ command (24 bytes) */
1256 struct cmdq_destroy_srq
{
1258 #define CMDQ_DESTROY_SRQ_OPCODE_DESTROY_SRQ 0x6UL
1269 /* Query SRQ command (24 bytes) */
1270 struct cmdq_query_srq
{
1272 #define CMDQ_QUERY_SRQ_OPCODE_QUERY_SRQ 0x8UL
1283 /* Create CQ command (48 bytes) */
1284 struct cmdq_create_cq
{
1286 #define CMDQ_CREATE_CQ_OPCODE_CREATE_CQ 0x9UL
1295 #define CMDQ_CREATE_CQ_LVL_MASK 0x3UL
1296 #define CMDQ_CREATE_CQ_LVL_SFT 0
1297 #define CMDQ_CREATE_CQ_LVL_LVL_0 0x0UL
1298 #define CMDQ_CREATE_CQ_LVL_LVL_1 0x1UL
1299 #define CMDQ_CREATE_CQ_LVL_LVL_2 0x2UL
1300 #define CMDQ_CREATE_CQ_PG_SIZE_MASK 0x1cUL
1301 #define CMDQ_CREATE_CQ_PG_SIZE_SFT 2
1302 #define CMDQ_CREATE_CQ_PG_SIZE_PG_4K (0x0UL << 2)
1303 #define CMDQ_CREATE_CQ_PG_SIZE_PG_8K (0x1UL << 2)
1304 #define CMDQ_CREATE_CQ_PG_SIZE_PG_64K (0x2UL << 2)
1305 #define CMDQ_CREATE_CQ_PG_SIZE_PG_2M (0x3UL << 2)
1306 #define CMDQ_CREATE_CQ_PG_SIZE_PG_8M (0x4UL << 2)
1307 #define CMDQ_CREATE_CQ_PG_SIZE_PG_1G (0x5UL << 2)
1308 __le32 cq_fco_cnq_id
;
1309 #define CMDQ_CREATE_CQ_CNQ_ID_MASK 0xfffUL
1310 #define CMDQ_CREATE_CQ_CNQ_ID_SFT 0
1311 #define CMDQ_CREATE_CQ_CQ_FCO_MASK 0xfffff000UL
1312 #define CMDQ_CREATE_CQ_CQ_FCO_SFT 12
1318 /* Destroy CQ command (24 bytes) */
1319 struct cmdq_destroy_cq
{
1321 #define CMDQ_DESTROY_CQ_OPCODE_DESTROY_CQ 0xaUL
1332 /* Resize CQ command (40 bytes) */
1333 struct cmdq_resize_cq
{
1335 #define CMDQ_RESIZE_CQ_OPCODE_RESIZE_CQ 0xcUL
1343 __le32 new_cq_size_pg_size_lvl
;
1344 #define CMDQ_RESIZE_CQ_LVL_MASK 0x3UL
1345 #define CMDQ_RESIZE_CQ_LVL_SFT 0
1346 #define CMDQ_RESIZE_CQ_LVL_LVL_0 0x0UL
1347 #define CMDQ_RESIZE_CQ_LVL_LVL_1 0x1UL
1348 #define CMDQ_RESIZE_CQ_LVL_LVL_2 0x2UL
1349 #define CMDQ_RESIZE_CQ_PG_SIZE_MASK 0x1cUL
1350 #define CMDQ_RESIZE_CQ_PG_SIZE_SFT 2
1351 #define CMDQ_RESIZE_CQ_PG_SIZE_PG_4K (0x0UL << 2)
1352 #define CMDQ_RESIZE_CQ_PG_SIZE_PG_8K (0x1UL << 2)
1353 #define CMDQ_RESIZE_CQ_PG_SIZE_PG_64K (0x2UL << 2)
1354 #define CMDQ_RESIZE_CQ_PG_SIZE_PG_2M (0x3UL << 2)
1355 #define CMDQ_RESIZE_CQ_PG_SIZE_PG_8M (0x4UL << 2)
1356 #define CMDQ_RESIZE_CQ_PG_SIZE_PG_1G (0x5UL << 2)
1357 #define CMDQ_RESIZE_CQ_NEW_CQ_SIZE_MASK 0x1fffe0UL
1358 #define CMDQ_RESIZE_CQ_NEW_CQ_SIZE_SFT 5
1364 /* Allocate MRW command (32 bytes) */
1365 struct cmdq_allocate_mrw
{
1367 #define CMDQ_ALLOCATE_MRW_OPCODE_ALLOCATE_MRW 0xdUL
1376 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MASK 0xfUL
1377 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_SFT 0
1378 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MR 0x0UL
1379 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_PMR 0x1UL
1380 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1 0x2UL
1381 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A 0x3UL
1382 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B 0x4UL
1384 #define CMDQ_ALLOCATE_MRW_ACCESS_RESERVED_MASK 0x1fUL
1385 #define CMDQ_ALLOCATE_MRW_ACCESS_RESERVED_SFT 0
1386 #define CMDQ_ALLOCATE_MRW_ACCESS_CONSUMER_OWNED_KEY 0x20UL
1391 /* De-allocate key command (24 bytes) */
1392 struct cmdq_deallocate_key
{
1394 #define CMDQ_DEALLOCATE_KEY_OPCODE_DEALLOCATE_KEY 0xeUL
1402 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MASK 0xfUL
1403 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_SFT 0
1404 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MR 0x0UL
1405 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_PMR 0x1UL
1406 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE1 0x2UL
1407 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE2A 0x3UL
1408 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE2B 0x4UL
1413 /* Register MR command (48 bytes) */
1414 struct cmdq_register_mr
{
1416 #define CMDQ_REGISTER_MR_OPCODE_REGISTER_MR 0xfUL
1423 u8 log2_pg_size_lvl
;
1424 #define CMDQ_REGISTER_MR_LVL_MASK 0x3UL
1425 #define CMDQ_REGISTER_MR_LVL_SFT 0
1426 #define CMDQ_REGISTER_MR_LVL_LVL_0 0x0UL
1427 #define CMDQ_REGISTER_MR_LVL_LVL_1 0x1UL
1428 #define CMDQ_REGISTER_MR_LVL_LVL_2 0x2UL
1429 #define CMDQ_REGISTER_MR_LVL_LAST CMDQ_REGISTER_MR_LVL_LVL_2
1430 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_MASK 0x7cUL
1431 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_SFT 2
1432 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_4K (0xcUL << 2)
1433 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_8K (0xdUL << 2)
1434 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_64K (0x10UL << 2)
1435 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_256K (0x12UL << 2)
1436 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_1M (0x14UL << 2)
1437 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_2M (0x15UL << 2)
1438 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_4M (0x16UL << 2)
1439 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_1G (0x1eUL << 2)
1440 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_LAST \
1441 CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_1G
1442 #define CMDQ_REGISTER_MR_UNUSED1 0x80UL
1444 #define CMDQ_REGISTER_MR_ACCESS_LOCAL_WRITE 0x1UL
1445 #define CMDQ_REGISTER_MR_ACCESS_REMOTE_READ 0x2UL
1446 #define CMDQ_REGISTER_MR_ACCESS_REMOTE_WRITE 0x4UL
1447 #define CMDQ_REGISTER_MR_ACCESS_REMOTE_ATOMIC 0x8UL
1448 #define CMDQ_REGISTER_MR_ACCESS_MW_BIND 0x10UL
1449 #define CMDQ_REGISTER_MR_ACCESS_ZERO_BASED 0x20UL
1450 __le16 log2_pbl_pg_size
;
1451 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_MASK 0x1fUL
1452 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_SFT 0
1453 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_4K 0xcUL
1454 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_8K 0xdUL
1455 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_64K 0x10UL
1456 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_256K 0x12UL
1457 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_1M 0x14UL
1458 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_2M 0x15UL
1459 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_4M 0x16UL
1460 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_1G 0x1eUL
1461 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_LAST \
1462 CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_1G
1463 #define CMDQ_REGISTER_MR_UNUSED11_MASK 0xffe0UL
1464 #define CMDQ_REGISTER_MR_UNUSED11_SFT 5
1471 /* Deregister MR command (24 bytes) */
1472 struct cmdq_deregister_mr
{
1474 #define CMDQ_DEREGISTER_MR_OPCODE_DEREGISTER_MR 0x10UL
1485 /* Add GID command (48 bytes) */
1486 struct cmdq_add_gid
{
1488 #define CMDQ_ADD_GID_OPCODE_ADD_GID 0x11UL
1498 #define CMDQ_ADD_GID_VLAN_VLAN_ID_MASK 0xfffUL
1499 #define CMDQ_ADD_GID_VLAN_VLAN_ID_SFT 0
1500 #define CMDQ_ADD_GID_VLAN_TPID_MASK 0x7000UL
1501 #define CMDQ_ADD_GID_VLAN_TPID_SFT 12
1502 #define CMDQ_ADD_GID_VLAN_TPID_TPID_88A8 (0x0UL << 12)
1503 #define CMDQ_ADD_GID_VLAN_TPID_TPID_8100 (0x1UL << 12)
1504 #define CMDQ_ADD_GID_VLAN_TPID_TPID_9100 (0x2UL << 12)
1505 #define CMDQ_ADD_GID_VLAN_TPID_TPID_9200 (0x3UL << 12)
1506 #define CMDQ_ADD_GID_VLAN_TPID_TPID_9300 (0x4UL << 12)
1507 #define CMDQ_ADD_GID_VLAN_TPID_TPID_CFG1 (0x5UL << 12)
1508 #define CMDQ_ADD_GID_VLAN_TPID_TPID_CFG2 (0x6UL << 12)
1509 #define CMDQ_ADD_GID_VLAN_TPID_TPID_CFG3 (0x7UL << 12)
1510 #define CMDQ_ADD_GID_VLAN_TPID_LAST CMDQ_ADD_GID_VLAN_TPID_TPID_CFG3
1511 #define CMDQ_ADD_GID_VLAN_VLAN_EN 0x8000UL
1514 #define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_ID_MASK 0x7fffUL
1515 #define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_ID_SFT 0
1516 #define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_VALID 0x8000UL
1520 /* Delete GID command (24 bytes) */
1521 struct cmdq_delete_gid
{
1523 #define CMDQ_DELETE_GID_OPCODE_DELETE_GID 0x12UL
1535 /* Modify GID command (48 bytes) */
1536 struct cmdq_modify_gid
{
1538 #define CMDQ_MODIFY_GID_OPCODE_MODIFY_GID 0x17UL
1548 #define CMDQ_MODIFY_GID_VLAN_VLAN_ID_MASK 0xfffUL
1549 #define CMDQ_MODIFY_GID_VLAN_VLAN_ID_SFT 0
1550 #define CMDQ_MODIFY_GID_VLAN_TPID_MASK 0x7000UL
1551 #define CMDQ_MODIFY_GID_VLAN_TPID_SFT 12
1552 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_88A8 (0x0UL << 12)
1553 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_8100 (0x1UL << 12)
1554 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_9100 (0x2UL << 12)
1555 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_9200 (0x3UL << 12)
1556 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_9300 (0x4UL << 12)
1557 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG1 (0x5UL << 12)
1558 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG2 (0x6UL << 12)
1559 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG3 (0x7UL << 12)
1560 #define CMDQ_MODIFY_GID_VLAN_TPID_LAST \
1561 CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG3
1562 #define CMDQ_MODIFY_GID_VLAN_VLAN_EN 0x8000UL
1566 #define CMDQ_MODIFY_GID_STATS_CTX_STATS_CTX_ID_MASK 0x7fffUL
1567 #define CMDQ_MODIFY_GID_STATS_CTX_STATS_CTX_ID_SFT 0
1568 #define CMDQ_MODIFY_GID_STATS_CTX_STATS_CTX_VALID 0x8000UL
1572 /* Query GID command (24 bytes) */
1573 struct cmdq_query_gid
{
1575 #define CMDQ_QUERY_GID_OPCODE_QUERY_GID 0x18UL
1587 /* Create QP1 command (80 bytes) */
1588 struct cmdq_create_qp1
{
1590 #define CMDQ_CREATE_QP1_OPCODE_CREATE_QP1 0x13UL
1599 #define CMDQ_CREATE_QP1_QP_FLAGS_SRQ_USED 0x1UL
1600 #define CMDQ_CREATE_QP1_QP_FLAGS_FORCE_COMPLETION 0x2UL
1601 #define CMDQ_CREATE_QP1_QP_FLAGS_RESERVED_LKEY_ENABLE 0x4UL
1603 #define CMDQ_CREATE_QP1_TYPE_GSI 0x1UL
1604 u8 sq_pg_size_sq_lvl
;
1605 #define CMDQ_CREATE_QP1_SQ_LVL_MASK 0xfUL
1606 #define CMDQ_CREATE_QP1_SQ_LVL_SFT 0
1607 #define CMDQ_CREATE_QP1_SQ_LVL_LVL_0 0x0UL
1608 #define CMDQ_CREATE_QP1_SQ_LVL_LVL_1 0x1UL
1609 #define CMDQ_CREATE_QP1_SQ_LVL_LVL_2 0x2UL
1610 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_MASK 0xf0UL
1611 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_SFT 4
1612 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_4K (0x0UL << 4)
1613 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_8K (0x1UL << 4)
1614 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_64K (0x2UL << 4)
1615 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_2M (0x3UL << 4)
1616 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_8M (0x4UL << 4)
1617 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_1G (0x5UL << 4)
1618 u8 rq_pg_size_rq_lvl
;
1619 #define CMDQ_CREATE_QP1_RQ_LVL_MASK 0xfUL
1620 #define CMDQ_CREATE_QP1_RQ_LVL_SFT 0
1621 #define CMDQ_CREATE_QP1_RQ_LVL_LVL_0 0x0UL
1622 #define CMDQ_CREATE_QP1_RQ_LVL_LVL_1 0x1UL
1623 #define CMDQ_CREATE_QP1_RQ_LVL_LVL_2 0x2UL
1624 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_MASK 0xf0UL
1625 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_SFT 4
1626 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_4K (0x0UL << 4)
1627 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_8K (0x1UL << 4)
1628 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_64K (0x2UL << 4)
1629 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_2M (0x3UL << 4)
1630 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_8M (0x4UL << 4)
1631 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_1G (0x5UL << 4)
1636 __le16 sq_fwo_sq_sge
;
1637 #define CMDQ_CREATE_QP1_SQ_SGE_MASK 0xfUL
1638 #define CMDQ_CREATE_QP1_SQ_SGE_SFT 0
1639 #define CMDQ_CREATE_QP1_SQ_FWO_MASK 0xfff0UL
1640 #define CMDQ_CREATE_QP1_SQ_FWO_SFT 4
1641 __le16 rq_fwo_rq_sge
;
1642 #define CMDQ_CREATE_QP1_RQ_SGE_MASK 0xfUL
1643 #define CMDQ_CREATE_QP1_RQ_SGE_SFT 0
1644 #define CMDQ_CREATE_QP1_RQ_FWO_MASK 0xfff0UL
1645 #define CMDQ_CREATE_QP1_RQ_FWO_SFT 4
1654 /* Destroy QP1 command (24 bytes) */
1655 struct cmdq_destroy_qp1
{
1657 #define CMDQ_DESTROY_QP1_OPCODE_DESTROY_QP1 0x14UL
1668 /* Create AH command (64 bytes) */
1669 struct cmdq_create_ah
{
1671 #define CMDQ_CREATE_AH_OPCODE_CREATE_AH 0x15UL
1681 #define CMDQ_CREATE_AH_TYPE_V1 0x0UL
1682 #define CMDQ_CREATE_AH_TYPE_V2IPV4 0x2UL
1683 #define CMDQ_CREATE_AH_TYPE_V2IPV6 0x3UL
1686 __le32 dest_vlan_id_flow_label
;
1687 #define CMDQ_CREATE_AH_FLOW_LABEL_MASK 0xfffffUL
1688 #define CMDQ_CREATE_AH_FLOW_LABEL_SFT 0
1689 #define CMDQ_CREATE_AH_DEST_VLAN_ID_MASK 0xfff00000UL
1690 #define CMDQ_CREATE_AH_DEST_VLAN_ID_SFT 20
1698 /* Destroy AH command (24 bytes) */
1699 struct cmdq_destroy_ah
{
1701 #define CMDQ_DESTROY_AH_OPCODE_DESTROY_AH 0x16UL
1712 /* Initialize Firmware command (112 bytes) */
1713 struct cmdq_initialize_fw
{
1715 #define CMDQ_INITIALIZE_FW_OPCODE_INITIALIZE_FW 0x80UL
1722 u8 qpc_pg_size_qpc_lvl
;
1723 #define CMDQ_INITIALIZE_FW_QPC_LVL_MASK 0xfUL
1724 #define CMDQ_INITIALIZE_FW_QPC_LVL_SFT 0
1725 #define CMDQ_INITIALIZE_FW_QPC_LVL_LVL_0 0x0UL
1726 #define CMDQ_INITIALIZE_FW_QPC_LVL_LVL_1 0x1UL
1727 #define CMDQ_INITIALIZE_FW_QPC_LVL_LVL_2 0x2UL
1728 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_MASK 0xf0UL
1729 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_SFT 4
1730 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_4K (0x0UL << 4)
1731 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_8K (0x1UL << 4)
1732 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_64K (0x2UL << 4)
1733 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_2M (0x3UL << 4)
1734 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_8M (0x4UL << 4)
1735 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_1G (0x5UL << 4)
1736 u8 mrw_pg_size_mrw_lvl
;
1737 #define CMDQ_INITIALIZE_FW_MRW_LVL_MASK 0xfUL
1738 #define CMDQ_INITIALIZE_FW_MRW_LVL_SFT 0
1739 #define CMDQ_INITIALIZE_FW_MRW_LVL_LVL_0 0x0UL
1740 #define CMDQ_INITIALIZE_FW_MRW_LVL_LVL_1 0x1UL
1741 #define CMDQ_INITIALIZE_FW_MRW_LVL_LVL_2 0x2UL
1742 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_MASK 0xf0UL
1743 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_SFT 4
1744 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_4K (0x0UL << 4)
1745 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_8K (0x1UL << 4)
1746 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_64K (0x2UL << 4)
1747 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_2M (0x3UL << 4)
1748 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_8M (0x4UL << 4)
1749 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_1G (0x5UL << 4)
1750 u8 srq_pg_size_srq_lvl
;
1751 #define CMDQ_INITIALIZE_FW_SRQ_LVL_MASK 0xfUL
1752 #define CMDQ_INITIALIZE_FW_SRQ_LVL_SFT 0
1753 #define CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_0 0x0UL
1754 #define CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_1 0x1UL
1755 #define CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_2 0x2UL
1756 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_MASK 0xf0UL
1757 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_SFT 4
1758 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_4K (0x0UL << 4)
1759 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_8K (0x1UL << 4)
1760 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_64K (0x2UL << 4)
1761 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_2M (0x3UL << 4)
1762 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_8M (0x4UL << 4)
1763 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_1G (0x5UL << 4)
1764 u8 cq_pg_size_cq_lvl
;
1765 #define CMDQ_INITIALIZE_FW_CQ_LVL_MASK 0xfUL
1766 #define CMDQ_INITIALIZE_FW_CQ_LVL_SFT 0
1767 #define CMDQ_INITIALIZE_FW_CQ_LVL_LVL_0 0x0UL
1768 #define CMDQ_INITIALIZE_FW_CQ_LVL_LVL_1 0x1UL
1769 #define CMDQ_INITIALIZE_FW_CQ_LVL_LVL_2 0x2UL
1770 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_MASK 0xf0UL
1771 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_SFT 4
1772 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_4K (0x0UL << 4)
1773 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_8K (0x1UL << 4)
1774 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_64K (0x2UL << 4)
1775 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_2M (0x3UL << 4)
1776 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_8M (0x4UL << 4)
1777 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_1G (0x5UL << 4)
1778 u8 tqm_pg_size_tqm_lvl
;
1779 #define CMDQ_INITIALIZE_FW_TQM_LVL_MASK 0xfUL
1780 #define CMDQ_INITIALIZE_FW_TQM_LVL_SFT 0
1781 #define CMDQ_INITIALIZE_FW_TQM_LVL_LVL_0 0x0UL
1782 #define CMDQ_INITIALIZE_FW_TQM_LVL_LVL_1 0x1UL
1783 #define CMDQ_INITIALIZE_FW_TQM_LVL_LVL_2 0x2UL
1784 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_MASK 0xf0UL
1785 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_SFT 4
1786 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_4K (0x0UL << 4)
1787 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_8K (0x1UL << 4)
1788 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_64K (0x2UL << 4)
1789 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_2M (0x3UL << 4)
1790 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_8M (0x4UL << 4)
1791 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_1G (0x5UL << 4)
1792 u8 tim_pg_size_tim_lvl
;
1793 #define CMDQ_INITIALIZE_FW_TIM_LVL_MASK 0xfUL
1794 #define CMDQ_INITIALIZE_FW_TIM_LVL_SFT 0
1795 #define CMDQ_INITIALIZE_FW_TIM_LVL_LVL_0 0x0UL
1796 #define CMDQ_INITIALIZE_FW_TIM_LVL_LVL_1 0x1UL
1797 #define CMDQ_INITIALIZE_FW_TIM_LVL_LVL_2 0x2UL
1798 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_MASK 0xf0UL
1799 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_SFT 4
1800 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_4K (0x0UL << 4)
1801 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_8K (0x1UL << 4)
1802 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_64K (0x2UL << 4)
1803 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_2M (0x3UL << 4)
1804 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_8M (0x4UL << 4)
1805 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_1G (0x5UL << 4)
1806 /* This value is (log-base-2-of-DBR-page-size - 12).
1807 * 0 for 4KB. HW supported values are enumerated below.
1809 __le16 log2_dbr_pg_size
;
1810 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_MASK 0xfUL
1811 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_SFT 0
1812 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_4K 0x0UL
1813 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_8K 0x1UL
1814 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_16K 0x2UL
1815 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_32K 0x3UL
1816 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_64K 0x4UL
1817 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_128K 0x5UL
1818 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_256K 0x6UL
1819 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_512K 0x7UL
1820 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_1M 0x8UL
1821 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_2M 0x9UL
1822 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_4M 0xaUL
1823 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_8M 0xbUL
1824 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_16M 0xcUL
1825 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_32M 0xdUL
1826 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_64M 0xeUL
1827 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_128M 0xfUL
1828 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_LAST \
1829 CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_128M
1830 __le64 qpc_page_dir
;
1831 __le64 mrw_page_dir
;
1832 __le64 srq_page_dir
;
1834 __le64 tqm_page_dir
;
1835 __le64 tim_page_dir
;
1836 __le32 number_of_qp
;
1837 __le32 number_of_mrw
;
1838 __le32 number_of_srq
;
1839 __le32 number_of_cq
;
1840 __le32 max_qp_per_vf
;
1841 __le32 max_mrw_per_vf
;
1842 __le32 max_srq_per_vf
;
1843 __le32 max_cq_per_vf
;
1844 __le32 max_gid_per_vf
;
1848 /* De-initialize Firmware command (16 bytes) */
1849 struct cmdq_deinitialize_fw
{
1851 #define CMDQ_DEINITIALIZE_FW_OPCODE_DEINITIALIZE_FW 0x81UL
1860 /* Stop function command (16 bytes) */
1861 struct cmdq_stop_func
{
1863 #define CMDQ_STOP_FUNC_OPCODE_STOP_FUNC 0x82UL
1872 /* Query function command (16 bytes) */
1873 struct cmdq_query_func
{
1875 #define CMDQ_QUERY_FUNC_OPCODE_QUERY_FUNC 0x83UL
1884 /* Set function resources command (16 bytes) */
1885 struct cmdq_set_func_resources
{
1887 #define CMDQ_SET_FUNC_RESOURCES_OPCODE_SET_FUNC_RESOURCES 0x84UL
1894 __le32 number_of_qp
;
1895 __le32 number_of_mrw
;
1896 __le32 number_of_srq
;
1897 __le32 number_of_cq
;
1898 __le32 max_qp_per_vf
;
1899 __le32 max_mrw_per_vf
;
1900 __le32 max_srq_per_vf
;
1901 __le32 max_cq_per_vf
;
1902 __le32 max_gid_per_vf
;
1906 /* Read hardware resource context command (24 bytes) */
1907 struct cmdq_read_context
{
1909 #define CMDQ_READ_CONTEXT_OPCODE_READ_CONTEXT 0x85UL
1917 #define CMDQ_READ_CONTEXT_XID_MASK 0xffffffUL
1918 #define CMDQ_READ_CONTEXT_XID_SFT 0
1919 #define CMDQ_READ_CONTEXT_TYPE_MASK 0xff000000UL
1920 #define CMDQ_READ_CONTEXT_TYPE_SFT 24
1921 #define CMDQ_READ_CONTEXT_TYPE_QPC (0x0UL << 24)
1922 #define CMDQ_READ_CONTEXT_TYPE_CQ (0x1UL << 24)
1923 #define CMDQ_READ_CONTEXT_TYPE_MRW (0x2UL << 24)
1924 #define CMDQ_READ_CONTEXT_TYPE_SRQ (0x3UL << 24)
1928 /* Map TC to COS. Can only be issued from a PF (24 bytes) */
1929 struct cmdq_map_tc_to_cos
{
1931 #define CMDQ_MAP_TC_TO_COS_OPCODE_MAP_TC_TO_COS 0x8aUL
1939 #define CMDQ_MAP_TC_TO_COS_COS0_NO_CHANGE 0xffffUL
1941 #define CMDQ_MAP_TC_TO_COS_COS1_DISABLE 0x8000UL
1942 #define CMDQ_MAP_TC_TO_COS_COS1_NO_CHANGE 0xffffUL
1946 /* Query version command (16 bytes) */
1947 struct cmdq_query_version
{
1949 #define CMDQ_QUERY_VERSION_OPCODE_QUERY_VERSION 0x8bUL
1958 /* Command-Response Event Queue (CREQ) Structures */
1959 /* Base CREQ Record (16 bytes) */
1962 #define CREQ_BASE_TYPE_MASK 0x3fUL
1963 #define CREQ_BASE_TYPE_SFT 0
1964 #define CREQ_BASE_TYPE_QP_EVENT 0x38UL
1965 #define CREQ_BASE_TYPE_FUNC_EVENT 0x3aUL
1966 #define CREQ_BASE_RESERVED2_MASK 0xc0UL
1967 #define CREQ_BASE_RESERVED2_SFT 6
1970 #define CREQ_BASE_V 0x1UL
1971 #define CREQ_BASE_RESERVED7_MASK 0xfeUL
1972 #define CREQ_BASE_RESERVED7_SFT 1
1974 __le16 reserved48
[3];
1977 /* RoCE Function Async Event Notification (16 bytes) */
1978 struct creq_func_event
{
1980 #define CREQ_FUNC_EVENT_TYPE_MASK 0x3fUL
1981 #define CREQ_FUNC_EVENT_TYPE_SFT 0
1982 #define CREQ_FUNC_EVENT_TYPE_FUNC_EVENT 0x3aUL
1983 #define CREQ_FUNC_EVENT_RESERVED2_MASK 0xc0UL
1984 #define CREQ_FUNC_EVENT_RESERVED2_SFT 6
1987 #define CREQ_FUNC_EVENT_V 0x1UL
1988 #define CREQ_FUNC_EVENT_RESERVED7_MASK 0xfeUL
1989 #define CREQ_FUNC_EVENT_RESERVED7_SFT 1
1991 #define CREQ_FUNC_EVENT_EVENT_TX_WQE_ERROR 0x1UL
1992 #define CREQ_FUNC_EVENT_EVENT_TX_DATA_ERROR 0x2UL
1993 #define CREQ_FUNC_EVENT_EVENT_RX_WQE_ERROR 0x3UL
1994 #define CREQ_FUNC_EVENT_EVENT_RX_DATA_ERROR 0x4UL
1995 #define CREQ_FUNC_EVENT_EVENT_CQ_ERROR 0x5UL
1996 #define CREQ_FUNC_EVENT_EVENT_TQM_ERROR 0x6UL
1997 #define CREQ_FUNC_EVENT_EVENT_CFCQ_ERROR 0x7UL
1998 #define CREQ_FUNC_EVENT_EVENT_CFCS_ERROR 0x8UL
1999 #define CREQ_FUNC_EVENT_EVENT_CFCC_ERROR 0x9UL
2000 #define CREQ_FUNC_EVENT_EVENT_CFCM_ERROR 0xaUL
2001 #define CREQ_FUNC_EVENT_EVENT_TIM_ERROR 0xbUL
2002 #define CREQ_FUNC_EVENT_EVENT_VF_COMM_REQUEST 0x80UL
2003 #define CREQ_FUNC_EVENT_EVENT_RESOURCE_EXHAUSTED 0x81UL
2004 __le16 reserved48
[3];
2007 /* RoCE Slowpath Command Completion (16 bytes) */
2008 struct creq_qp_event
{
2010 #define CREQ_QP_EVENT_TYPE_MASK 0x3fUL
2011 #define CREQ_QP_EVENT_TYPE_SFT 0
2012 #define CREQ_QP_EVENT_TYPE_QP_EVENT 0x38UL
2013 #define CREQ_QP_EVENT_RESERVED2_MASK 0xc0UL
2014 #define CREQ_QP_EVENT_RESERVED2_SFT 6
2019 #define CREQ_QP_EVENT_V 0x1UL
2020 #define CREQ_QP_EVENT_RESERVED7_MASK 0xfeUL
2021 #define CREQ_QP_EVENT_RESERVED7_SFT 1
2023 #define CREQ_QP_EVENT_EVENT_CREATE_QP 0x1UL
2024 #define CREQ_QP_EVENT_EVENT_DESTROY_QP 0x2UL
2025 #define CREQ_QP_EVENT_EVENT_MODIFY_QP 0x3UL
2026 #define CREQ_QP_EVENT_EVENT_QUERY_QP 0x4UL
2027 #define CREQ_QP_EVENT_EVENT_CREATE_SRQ 0x5UL
2028 #define CREQ_QP_EVENT_EVENT_DESTROY_SRQ 0x6UL
2029 #define CREQ_QP_EVENT_EVENT_QUERY_SRQ 0x8UL
2030 #define CREQ_QP_EVENT_EVENT_CREATE_CQ 0x9UL
2031 #define CREQ_QP_EVENT_EVENT_DESTROY_CQ 0xaUL
2032 #define CREQ_QP_EVENT_EVENT_RESIZE_CQ 0xcUL
2033 #define CREQ_QP_EVENT_EVENT_ALLOCATE_MRW 0xdUL
2034 #define CREQ_QP_EVENT_EVENT_DEALLOCATE_KEY 0xeUL
2035 #define CREQ_QP_EVENT_EVENT_REGISTER_MR 0xfUL
2036 #define CREQ_QP_EVENT_EVENT_DEREGISTER_MR 0x10UL
2037 #define CREQ_QP_EVENT_EVENT_ADD_GID 0x11UL
2038 #define CREQ_QP_EVENT_EVENT_DELETE_GID 0x12UL
2039 #define CREQ_QP_EVENT_EVENT_MODIFY_GID 0x17UL
2040 #define CREQ_QP_EVENT_EVENT_QUERY_GID 0x18UL
2041 #define CREQ_QP_EVENT_EVENT_CREATE_QP1 0x13UL
2042 #define CREQ_QP_EVENT_EVENT_DESTROY_QP1 0x14UL
2043 #define CREQ_QP_EVENT_EVENT_CREATE_AH 0x15UL
2044 #define CREQ_QP_EVENT_EVENT_DESTROY_AH 0x16UL
2045 #define CREQ_QP_EVENT_EVENT_INITIALIZE_FW 0x80UL
2046 #define CREQ_QP_EVENT_EVENT_DEINITIALIZE_FW 0x81UL
2047 #define CREQ_QP_EVENT_EVENT_STOP_FUNC 0x82UL
2048 #define CREQ_QP_EVENT_EVENT_QUERY_FUNC 0x83UL
2049 #define CREQ_QP_EVENT_EVENT_SET_FUNC_RESOURCES 0x84UL
2050 #define CREQ_QP_EVENT_EVENT_MAP_TC_TO_COS 0x8aUL
2051 #define CREQ_QP_EVENT_EVENT_QUERY_VERSION 0x8bUL
2052 #define CREQ_QP_EVENT_EVENT_MODIFY_CC 0x8cUL
2053 #define CREQ_QP_EVENT_EVENT_QUERY_CC 0x8dUL
2054 #define CREQ_QP_EVENT_EVENT_QP_ERROR_NOTIFICATION 0xc0UL
2055 __le16 reserved48
[3];
2058 /* Create QP command response (16 bytes) */
2059 struct creq_create_qp_resp
{
2061 #define CREQ_CREATE_QP_RESP_TYPE_MASK 0x3fUL
2062 #define CREQ_CREATE_QP_RESP_TYPE_SFT 0
2063 #define CREQ_CREATE_QP_RESP_TYPE_QP_EVENT 0x38UL
2064 #define CREQ_CREATE_QP_RESP_RESERVED2_MASK 0xc0UL
2065 #define CREQ_CREATE_QP_RESP_RESERVED2_SFT 6
2070 #define CREQ_CREATE_QP_RESP_V 0x1UL
2071 #define CREQ_CREATE_QP_RESP_RESERVED7_MASK 0xfeUL
2072 #define CREQ_CREATE_QP_RESP_RESERVED7_SFT 1
2074 #define CREQ_CREATE_QP_RESP_EVENT_CREATE_QP 0x1UL
2075 __le16 reserved48
[3];
2078 /* Destroy QP command response (16 bytes) */
2079 struct creq_destroy_qp_resp
{
2081 #define CREQ_DESTROY_QP_RESP_TYPE_MASK 0x3fUL
2082 #define CREQ_DESTROY_QP_RESP_TYPE_SFT 0
2083 #define CREQ_DESTROY_QP_RESP_TYPE_QP_EVENT 0x38UL
2084 #define CREQ_DESTROY_QP_RESP_RESERVED2_MASK 0xc0UL
2085 #define CREQ_DESTROY_QP_RESP_RESERVED2_SFT 6
2090 #define CREQ_DESTROY_QP_RESP_V 0x1UL
2091 #define CREQ_DESTROY_QP_RESP_RESERVED7_MASK 0xfeUL
2092 #define CREQ_DESTROY_QP_RESP_RESERVED7_SFT 1
2094 #define CREQ_DESTROY_QP_RESP_EVENT_DESTROY_QP 0x2UL
2095 __le16 reserved48
[3];
2098 /* Modify QP command response (16 bytes) */
2099 struct creq_modify_qp_resp
{
2101 #define CREQ_MODIFY_QP_RESP_TYPE_MASK 0x3fUL
2102 #define CREQ_MODIFY_QP_RESP_TYPE_SFT 0
2103 #define CREQ_MODIFY_QP_RESP_TYPE_QP_EVENT 0x38UL
2104 #define CREQ_MODIFY_QP_RESP_RESERVED2_MASK 0xc0UL
2105 #define CREQ_MODIFY_QP_RESP_RESERVED2_SFT 6
2110 #define CREQ_MODIFY_QP_RESP_V 0x1UL
2111 #define CREQ_MODIFY_QP_RESP_RESERVED7_MASK 0xfeUL
2112 #define CREQ_MODIFY_QP_RESP_RESERVED7_SFT 1
2114 #define CREQ_MODIFY_QP_RESP_EVENT_MODIFY_QP 0x3UL
2115 __le16 reserved48
[3];
2118 /* cmdq_query_roce_stats (size:128b/16B) */
2119 struct cmdq_query_roce_stats
{
2121 #define CMDQ_QUERY_ROCE_STATS_OPCODE_QUERY_ROCE_STATS 0x8eUL
2122 #define CMDQ_QUERY_ROCE_STATS_OPCODE_LAST \
2123 CMDQ_QUERY_ROCE_STATS_OPCODE_QUERY_ROCE_STATS
2132 /* Query QP command response (16 bytes) */
2133 struct creq_query_qp_resp
{
2135 #define CREQ_QUERY_QP_RESP_TYPE_MASK 0x3fUL
2136 #define CREQ_QUERY_QP_RESP_TYPE_SFT 0
2137 #define CREQ_QUERY_QP_RESP_TYPE_QP_EVENT 0x38UL
2138 #define CREQ_QUERY_QP_RESP_RESERVED2_MASK 0xc0UL
2139 #define CREQ_QUERY_QP_RESP_RESERVED2_SFT 6
2144 #define CREQ_QUERY_QP_RESP_V 0x1UL
2145 #define CREQ_QUERY_QP_RESP_RESERVED7_MASK 0xfeUL
2146 #define CREQ_QUERY_QP_RESP_RESERVED7_SFT 1
2148 #define CREQ_QUERY_QP_RESP_EVENT_QUERY_QP 0x4UL
2149 __le16 reserved48
[3];
2152 /* Query QP command response side buffer structure (104 bytes) */
2153 struct creq_query_qp_resp_sb
{
2155 #define CREQ_QUERY_QP_RESP_SB_OPCODE_QUERY_QP 0x4UL
2162 u8 en_sqd_async_notify_state
;
2163 #define CREQ_QUERY_QP_RESP_SB_STATE_MASK 0xfUL
2164 #define CREQ_QUERY_QP_RESP_SB_STATE_SFT 0
2165 #define CREQ_QUERY_QP_RESP_SB_STATE_RESET 0x0UL
2166 #define CREQ_QUERY_QP_RESP_SB_STATE_INIT 0x1UL
2167 #define CREQ_QUERY_QP_RESP_SB_STATE_RTR 0x2UL
2168 #define CREQ_QUERY_QP_RESP_SB_STATE_RTS 0x3UL
2169 #define CREQ_QUERY_QP_RESP_SB_STATE_SQD 0x4UL
2170 #define CREQ_QUERY_QP_RESP_SB_STATE_SQE 0x5UL
2171 #define CREQ_QUERY_QP_RESP_SB_STATE_ERR 0x6UL
2172 #define CREQ_QUERY_QP_RESP_SB_EN_SQD_ASYNC_NOTIFY 0x10UL
2174 #define CREQ_QUERY_QP_RESP_SB_ACCESS_LOCAL_WRITE 0x1UL
2175 #define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_WRITE 0x2UL
2176 #define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_READ 0x4UL
2177 #define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_ATOMIC 0x8UL
2187 __le16 path_mtu_dest_vlan_id
;
2188 #define CREQ_QUERY_QP_RESP_SB_DEST_VLAN_ID_MASK 0xfffUL
2189 #define CREQ_QUERY_QP_RESP_SB_DEST_VLAN_ID_SFT 0
2190 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MASK 0xf000UL
2191 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_SFT 12
2192 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_256 (0x0UL << 12)
2193 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_512 (0x1UL << 12)
2194 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_1024 (0x2UL << 12)
2195 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_2048 (0x3UL << 12)
2196 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_4096 (0x4UL << 12)
2197 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_8192 (0x5UL << 12)
2205 u8 max_dest_rd_atomic
;
2206 u8 tos_dscp_tos_ecn
;
2207 #define CREQ_QUERY_QP_RESP_SB_TOS_ECN_MASK 0x3UL
2208 #define CREQ_QUERY_QP_RESP_SB_TOS_ECN_SFT 0
2209 #define CREQ_QUERY_QP_RESP_SB_TOS_DSCP_MASK 0xfcUL
2210 #define CREQ_QUERY_QP_RESP_SB_TOS_DSCP_SFT 2
2212 #define CREQ_QUERY_QP_RESP_SB_ENABLE_CC 0x1UL
2213 #define CREQ_QUERY_QP_RESP_SB_RESERVED7_MASK 0xfeUL
2214 #define CREQ_QUERY_QP_RESP_SB_RESERVED7_SFT 1
2219 __le32 max_inline_data
;
2223 __le16 vlan_pcp_vlan_dei_vlan_id
;
2224 #define CREQ_QUERY_QP_RESP_SB_VLAN_ID_MASK 0xfffUL
2225 #define CREQ_QUERY_QP_RESP_SB_VLAN_ID_SFT 0
2226 #define CREQ_QUERY_QP_RESP_SB_VLAN_DEI 0x1000UL
2227 #define CREQ_QUERY_QP_RESP_SB_VLAN_PCP_MASK 0xe000UL
2228 #define CREQ_QUERY_QP_RESP_SB_VLAN_PCP_SFT 13
2231 /* Create SRQ command response (16 bytes) */
2232 struct creq_create_srq_resp
{
2234 #define CREQ_CREATE_SRQ_RESP_TYPE_MASK 0x3fUL
2235 #define CREQ_CREATE_SRQ_RESP_TYPE_SFT 0
2236 #define CREQ_CREATE_SRQ_RESP_TYPE_QP_EVENT 0x38UL
2237 #define CREQ_CREATE_SRQ_RESP_RESERVED2_MASK 0xc0UL
2238 #define CREQ_CREATE_SRQ_RESP_RESERVED2_SFT 6
2243 #define CREQ_CREATE_SRQ_RESP_V 0x1UL
2244 #define CREQ_CREATE_SRQ_RESP_RESERVED7_MASK 0xfeUL
2245 #define CREQ_CREATE_SRQ_RESP_RESERVED7_SFT 1
2247 #define CREQ_CREATE_SRQ_RESP_EVENT_CREATE_SRQ 0x5UL
2248 __le16 reserved48
[3];
2251 /* Destroy SRQ command response (16 bytes) */
2252 struct creq_destroy_srq_resp
{
2254 #define CREQ_DESTROY_SRQ_RESP_TYPE_MASK 0x3fUL
2255 #define CREQ_DESTROY_SRQ_RESP_TYPE_SFT 0
2256 #define CREQ_DESTROY_SRQ_RESP_TYPE_QP_EVENT 0x38UL
2257 #define CREQ_DESTROY_SRQ_RESP_RESERVED2_MASK 0xc0UL
2258 #define CREQ_DESTROY_SRQ_RESP_RESERVED2_SFT 6
2263 #define CREQ_DESTROY_SRQ_RESP_V 0x1UL
2264 #define CREQ_DESTROY_SRQ_RESP_RESERVED7_MASK 0xfeUL
2265 #define CREQ_DESTROY_SRQ_RESP_RESERVED7_SFT 1
2267 #define CREQ_DESTROY_SRQ_RESP_EVENT_DESTROY_SRQ 0x6UL
2268 __le16 enable_for_arm
[3];
2269 #define CREQ_DESTROY_SRQ_RESP_ENABLE_FOR_ARM_MASK 0x30000UL
2270 #define CREQ_DESTROY_SRQ_RESP_ENABLE_FOR_ARM_SFT 16
2271 #define CREQ_DESTROY_SRQ_RESP_RESERVED46_MASK 0xfffc0000UL
2272 #define CREQ_DESTROY_SRQ_RESP_RESERVED46_SFT 18
2275 /* Query SRQ command response (16 bytes) */
2276 struct creq_query_srq_resp
{
2278 #define CREQ_QUERY_SRQ_RESP_TYPE_MASK 0x3fUL
2279 #define CREQ_QUERY_SRQ_RESP_TYPE_SFT 0
2280 #define CREQ_QUERY_SRQ_RESP_TYPE_QP_EVENT 0x38UL
2281 #define CREQ_QUERY_SRQ_RESP_RESERVED2_MASK 0xc0UL
2282 #define CREQ_QUERY_SRQ_RESP_RESERVED2_SFT 6
2287 #define CREQ_QUERY_SRQ_RESP_V 0x1UL
2288 #define CREQ_QUERY_SRQ_RESP_RESERVED7_MASK 0xfeUL
2289 #define CREQ_QUERY_SRQ_RESP_RESERVED7_SFT 1
2291 #define CREQ_QUERY_SRQ_RESP_EVENT_QUERY_SRQ 0x8UL
2292 __le16 reserved48
[3];
2295 /* Query SRQ command response side buffer structure (24 bytes) */
2296 struct creq_query_srq_resp_sb
{
2298 #define CREQ_QUERY_SRQ_RESP_SB_OPCODE_QUERY_SRQ 0x8UL
2310 /* Create CQ command Response (16 bytes) */
2311 struct creq_create_cq_resp
{
2313 #define CREQ_CREATE_CQ_RESP_TYPE_MASK 0x3fUL
2314 #define CREQ_CREATE_CQ_RESP_TYPE_SFT 0
2315 #define CREQ_CREATE_CQ_RESP_TYPE_QP_EVENT 0x38UL
2316 #define CREQ_CREATE_CQ_RESP_RESERVED2_MASK 0xc0UL
2317 #define CREQ_CREATE_CQ_RESP_RESERVED2_SFT 6
2322 #define CREQ_CREATE_CQ_RESP_V 0x1UL
2323 #define CREQ_CREATE_CQ_RESP_RESERVED7_MASK 0xfeUL
2324 #define CREQ_CREATE_CQ_RESP_RESERVED7_SFT 1
2326 #define CREQ_CREATE_CQ_RESP_EVENT_CREATE_CQ 0x9UL
2327 __le16 reserved48
[3];
2330 /* Destroy CQ command response (16 bytes) */
2331 struct creq_destroy_cq_resp
{
2333 #define CREQ_DESTROY_CQ_RESP_TYPE_MASK 0x3fUL
2334 #define CREQ_DESTROY_CQ_RESP_TYPE_SFT 0
2335 #define CREQ_DESTROY_CQ_RESP_TYPE_QP_EVENT 0x38UL
2336 #define CREQ_DESTROY_CQ_RESP_RESERVED2_MASK 0xc0UL
2337 #define CREQ_DESTROY_CQ_RESP_RESERVED2_SFT 6
2342 #define CREQ_DESTROY_CQ_RESP_V 0x1UL
2343 #define CREQ_DESTROY_CQ_RESP_RESERVED7_MASK 0xfeUL
2344 #define CREQ_DESTROY_CQ_RESP_RESERVED7_SFT 1
2346 #define CREQ_DESTROY_CQ_RESP_EVENT_DESTROY_CQ 0xaUL
2348 #define CREQ_DESTROY_CQ_RESP_CQ_ARM_LVL_MASK 0x3UL
2349 #define CREQ_DESTROY_CQ_RESP_CQ_ARM_LVL_SFT 0
2350 #define CREQ_DESTROY_CQ_RESP_RESERVED14_MASK 0xfffcUL
2351 #define CREQ_DESTROY_CQ_RESP_RESERVED14_SFT 2
2352 __le16 total_cnq_events
;
2356 /* Resize CQ command response (16 bytes) */
2357 struct creq_resize_cq_resp
{
2359 #define CREQ_RESIZE_CQ_RESP_TYPE_MASK 0x3fUL
2360 #define CREQ_RESIZE_CQ_RESP_TYPE_SFT 0
2361 #define CREQ_RESIZE_CQ_RESP_TYPE_QP_EVENT 0x38UL
2362 #define CREQ_RESIZE_CQ_RESP_RESERVED2_MASK 0xc0UL
2363 #define CREQ_RESIZE_CQ_RESP_RESERVED2_SFT 6
2368 #define CREQ_RESIZE_CQ_RESP_V 0x1UL
2369 #define CREQ_RESIZE_CQ_RESP_RESERVED7_MASK 0xfeUL
2370 #define CREQ_RESIZE_CQ_RESP_RESERVED7_SFT 1
2372 #define CREQ_RESIZE_CQ_RESP_EVENT_RESIZE_CQ 0xcUL
2373 __le16 reserved48
[3];
2376 /* Allocate MRW command response (16 bytes) */
2377 struct creq_allocate_mrw_resp
{
2379 #define CREQ_ALLOCATE_MRW_RESP_TYPE_MASK 0x3fUL
2380 #define CREQ_ALLOCATE_MRW_RESP_TYPE_SFT 0
2381 #define CREQ_ALLOCATE_MRW_RESP_TYPE_QP_EVENT 0x38UL
2382 #define CREQ_ALLOCATE_MRW_RESP_RESERVED2_MASK 0xc0UL
2383 #define CREQ_ALLOCATE_MRW_RESP_RESERVED2_SFT 6
2388 #define CREQ_ALLOCATE_MRW_RESP_V 0x1UL
2389 #define CREQ_ALLOCATE_MRW_RESP_RESERVED7_MASK 0xfeUL
2390 #define CREQ_ALLOCATE_MRW_RESP_RESERVED7_SFT 1
2392 #define CREQ_ALLOCATE_MRW_RESP_EVENT_ALLOCATE_MRW 0xdUL
2393 __le16 reserved48
[3];
2396 /* De-allocate key command response (16 bytes) */
2397 struct creq_deallocate_key_resp
{
2399 #define CREQ_DEALLOCATE_KEY_RESP_TYPE_MASK 0x3fUL
2400 #define CREQ_DEALLOCATE_KEY_RESP_TYPE_SFT 0
2401 #define CREQ_DEALLOCATE_KEY_RESP_TYPE_QP_EVENT 0x38UL
2402 #define CREQ_DEALLOCATE_KEY_RESP_RESERVED2_MASK 0xc0UL
2403 #define CREQ_DEALLOCATE_KEY_RESP_RESERVED2_SFT 6
2408 #define CREQ_DEALLOCATE_KEY_RESP_V 0x1UL
2409 #define CREQ_DEALLOCATE_KEY_RESP_RESERVED7_MASK 0xfeUL
2410 #define CREQ_DEALLOCATE_KEY_RESP_RESERVED7_SFT 1
2412 #define CREQ_DEALLOCATE_KEY_RESP_EVENT_DEALLOCATE_KEY 0xeUL
2414 __le32 bound_window_info
;
2417 /* Register MR command response (16 bytes) */
2418 struct creq_register_mr_resp
{
2420 #define CREQ_REGISTER_MR_RESP_TYPE_MASK 0x3fUL
2421 #define CREQ_REGISTER_MR_RESP_TYPE_SFT 0
2422 #define CREQ_REGISTER_MR_RESP_TYPE_QP_EVENT 0x38UL
2423 #define CREQ_REGISTER_MR_RESP_RESERVED2_MASK 0xc0UL
2424 #define CREQ_REGISTER_MR_RESP_RESERVED2_SFT 6
2429 #define CREQ_REGISTER_MR_RESP_V 0x1UL
2430 #define CREQ_REGISTER_MR_RESP_RESERVED7_MASK 0xfeUL
2431 #define CREQ_REGISTER_MR_RESP_RESERVED7_SFT 1
2433 #define CREQ_REGISTER_MR_RESP_EVENT_REGISTER_MR 0xfUL
2434 __le16 reserved48
[3];
2437 /* Deregister MR command response (16 bytes) */
2438 struct creq_deregister_mr_resp
{
2440 #define CREQ_DEREGISTER_MR_RESP_TYPE_MASK 0x3fUL
2441 #define CREQ_DEREGISTER_MR_RESP_TYPE_SFT 0
2442 #define CREQ_DEREGISTER_MR_RESP_TYPE_QP_EVENT 0x38UL
2443 #define CREQ_DEREGISTER_MR_RESP_RESERVED2_MASK 0xc0UL
2444 #define CREQ_DEREGISTER_MR_RESP_RESERVED2_SFT 6
2449 #define CREQ_DEREGISTER_MR_RESP_V 0x1UL
2450 #define CREQ_DEREGISTER_MR_RESP_RESERVED7_MASK 0xfeUL
2451 #define CREQ_DEREGISTER_MR_RESP_RESERVED7_SFT 1
2453 #define CREQ_DEREGISTER_MR_RESP_EVENT_DEREGISTER_MR 0x10UL
2455 __le32 bound_windows
;
2458 /* Add GID command response (16 bytes) */
2459 struct creq_add_gid_resp
{
2461 #define CREQ_ADD_GID_RESP_TYPE_MASK 0x3fUL
2462 #define CREQ_ADD_GID_RESP_TYPE_SFT 0
2463 #define CREQ_ADD_GID_RESP_TYPE_QP_EVENT 0x38UL
2464 #define CREQ_ADD_GID_RESP_RESERVED2_MASK 0xc0UL
2465 #define CREQ_ADD_GID_RESP_RESERVED2_SFT 6
2470 #define CREQ_ADD_GID_RESP_V 0x1UL
2471 #define CREQ_ADD_GID_RESP_RESERVED7_MASK 0xfeUL
2472 #define CREQ_ADD_GID_RESP_RESERVED7_SFT 1
2474 #define CREQ_ADD_GID_RESP_EVENT_ADD_GID 0x11UL
2475 __le16 reserved48
[3];
2478 /* Delete GID command response (16 bytes) */
2479 struct creq_delete_gid_resp
{
2481 #define CREQ_DELETE_GID_RESP_TYPE_MASK 0x3fUL
2482 #define CREQ_DELETE_GID_RESP_TYPE_SFT 0
2483 #define CREQ_DELETE_GID_RESP_TYPE_QP_EVENT 0x38UL
2484 #define CREQ_DELETE_GID_RESP_RESERVED2_MASK 0xc0UL
2485 #define CREQ_DELETE_GID_RESP_RESERVED2_SFT 6
2490 #define CREQ_DELETE_GID_RESP_V 0x1UL
2491 #define CREQ_DELETE_GID_RESP_RESERVED7_MASK 0xfeUL
2492 #define CREQ_DELETE_GID_RESP_RESERVED7_SFT 1
2494 #define CREQ_DELETE_GID_RESP_EVENT_DELETE_GID 0x12UL
2495 __le16 reserved48
[3];
2498 /* Modify GID command response (16 bytes) */
2499 struct creq_modify_gid_resp
{
2501 #define CREQ_MODIFY_GID_RESP_TYPE_MASK 0x3fUL
2502 #define CREQ_MODIFY_GID_RESP_TYPE_SFT 0
2503 #define CREQ_MODIFY_GID_RESP_TYPE_QP_EVENT 0x38UL
2504 #define CREQ_MODIFY_GID_RESP_RESERVED2_MASK 0xc0UL
2505 #define CREQ_MODIFY_GID_RESP_RESERVED2_SFT 6
2510 #define CREQ_MODIFY_GID_RESP_V 0x1UL
2511 #define CREQ_MODIFY_GID_RESP_RESERVED7_MASK 0xfeUL
2512 #define CREQ_MODIFY_GID_RESP_RESERVED7_SFT 1
2514 #define CREQ_MODIFY_GID_RESP_EVENT_ADD_GID 0x11UL
2515 __le16 reserved48
[3];
2518 /* Query GID command response (16 bytes) */
2519 struct creq_query_gid_resp
{
2521 #define CREQ_QUERY_GID_RESP_TYPE_MASK 0x3fUL
2522 #define CREQ_QUERY_GID_RESP_TYPE_SFT 0
2523 #define CREQ_QUERY_GID_RESP_TYPE_QP_EVENT 0x38UL
2524 #define CREQ_QUERY_GID_RESP_RESERVED2_MASK 0xc0UL
2525 #define CREQ_QUERY_GID_RESP_RESERVED2_SFT 6
2530 #define CREQ_QUERY_GID_RESP_V 0x1UL
2531 #define CREQ_QUERY_GID_RESP_RESERVED7_MASK 0xfeUL
2532 #define CREQ_QUERY_GID_RESP_RESERVED7_SFT 1
2534 #define CREQ_QUERY_GID_RESP_EVENT_QUERY_GID 0x18UL
2535 __le16 reserved48
[3];
2538 /* Query GID command response side buffer structure (40 bytes) */
2539 struct creq_query_gid_resp_sb
{
2541 #define CREQ_QUERY_GID_RESP_SB_OPCODE_QUERY_GID 0x18UL
2550 #define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_ID_MASK 0xfffUL
2551 #define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_ID_SFT 0
2552 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_MASK 0x7000UL
2553 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_SFT 12
2554 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_88A8 (0x0UL << 12)
2555 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_8100 (0x1UL << 12)
2556 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_9100 (0x2UL << 12)
2557 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_9200 (0x3UL << 12)
2558 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_9300 (0x4UL << 12)
2559 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG1 (0x5UL << 12)
2560 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG2 (0x6UL << 12)
2561 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG3 (0x7UL << 12)
2562 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_LAST \
2563 CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG3
2564 #define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_EN 0x8000UL
2570 /* Create QP1 command response (16 bytes) */
2571 struct creq_create_qp1_resp
{
2573 #define CREQ_CREATE_QP1_RESP_TYPE_MASK 0x3fUL
2574 #define CREQ_CREATE_QP1_RESP_TYPE_SFT 0
2575 #define CREQ_CREATE_QP1_RESP_TYPE_QP_EVENT 0x38UL
2576 #define CREQ_CREATE_QP1_RESP_RESERVED2_MASK 0xc0UL
2577 #define CREQ_CREATE_QP1_RESP_RESERVED2_SFT 6
2582 #define CREQ_CREATE_QP1_RESP_V 0x1UL
2583 #define CREQ_CREATE_QP1_RESP_RESERVED7_MASK 0xfeUL
2584 #define CREQ_CREATE_QP1_RESP_RESERVED7_SFT 1
2586 #define CREQ_CREATE_QP1_RESP_EVENT_CREATE_QP1 0x13UL
2587 __le16 reserved48
[3];
2590 /* Destroy QP1 command response (16 bytes) */
2591 struct creq_destroy_qp1_resp
{
2593 #define CREQ_DESTROY_QP1_RESP_TYPE_MASK 0x3fUL
2594 #define CREQ_DESTROY_QP1_RESP_TYPE_SFT 0
2595 #define CREQ_DESTROY_QP1_RESP_TYPE_QP_EVENT 0x38UL
2596 #define CREQ_DESTROY_QP1_RESP_RESERVED2_MASK 0xc0UL
2597 #define CREQ_DESTROY_QP1_RESP_RESERVED2_SFT 6
2602 #define CREQ_DESTROY_QP1_RESP_V 0x1UL
2603 #define CREQ_DESTROY_QP1_RESP_RESERVED7_MASK 0xfeUL
2604 #define CREQ_DESTROY_QP1_RESP_RESERVED7_SFT 1
2606 #define CREQ_DESTROY_QP1_RESP_EVENT_DESTROY_QP1 0x14UL
2607 __le16 reserved48
[3];
2610 /* Create AH command response (16 bytes) */
2611 struct creq_create_ah_resp
{
2613 #define CREQ_CREATE_AH_RESP_TYPE_MASK 0x3fUL
2614 #define CREQ_CREATE_AH_RESP_TYPE_SFT 0
2615 #define CREQ_CREATE_AH_RESP_TYPE_QP_EVENT 0x38UL
2616 #define CREQ_CREATE_AH_RESP_RESERVED2_MASK 0xc0UL
2617 #define CREQ_CREATE_AH_RESP_RESERVED2_SFT 6
2622 #define CREQ_CREATE_AH_RESP_V 0x1UL
2623 #define CREQ_CREATE_AH_RESP_RESERVED7_MASK 0xfeUL
2624 #define CREQ_CREATE_AH_RESP_RESERVED7_SFT 1
2626 #define CREQ_CREATE_AH_RESP_EVENT_CREATE_AH 0x15UL
2627 __le16 reserved48
[3];
2630 /* Destroy AH command response (16 bytes) */
2631 struct creq_destroy_ah_resp
{
2633 #define CREQ_DESTROY_AH_RESP_TYPE_MASK 0x3fUL
2634 #define CREQ_DESTROY_AH_RESP_TYPE_SFT 0
2635 #define CREQ_DESTROY_AH_RESP_TYPE_QP_EVENT 0x38UL
2636 #define CREQ_DESTROY_AH_RESP_RESERVED2_MASK 0xc0UL
2637 #define CREQ_DESTROY_AH_RESP_RESERVED2_SFT 6
2642 #define CREQ_DESTROY_AH_RESP_V 0x1UL
2643 #define CREQ_DESTROY_AH_RESP_RESERVED7_MASK 0xfeUL
2644 #define CREQ_DESTROY_AH_RESP_RESERVED7_SFT 1
2646 #define CREQ_DESTROY_AH_RESP_EVENT_DESTROY_AH 0x16UL
2647 __le16 reserved48
[3];
2650 /* Initialize Firmware command response (16 bytes) */
2651 struct creq_initialize_fw_resp
{
2653 #define CREQ_INITIALIZE_FW_RESP_TYPE_MASK 0x3fUL
2654 #define CREQ_INITIALIZE_FW_RESP_TYPE_SFT 0
2655 #define CREQ_INITIALIZE_FW_RESP_TYPE_QP_EVENT 0x38UL
2656 #define CREQ_INITIALIZE_FW_RESP_RESERVED2_MASK 0xc0UL
2657 #define CREQ_INITIALIZE_FW_RESP_RESERVED2_SFT 6
2662 #define CREQ_INITIALIZE_FW_RESP_V 0x1UL
2663 #define CREQ_INITIALIZE_FW_RESP_RESERVED7_MASK 0xfeUL
2664 #define CREQ_INITIALIZE_FW_RESP_RESERVED7_SFT 1
2666 #define CREQ_INITIALIZE_FW_RESP_EVENT_INITIALIZE_FW 0x80UL
2667 __le16 reserved48
[3];
2670 /* De-initialize Firmware command response (16 bytes) */
2671 struct creq_deinitialize_fw_resp
{
2673 #define CREQ_DEINITIALIZE_FW_RESP_TYPE_MASK 0x3fUL
2674 #define CREQ_DEINITIALIZE_FW_RESP_TYPE_SFT 0
2675 #define CREQ_DEINITIALIZE_FW_RESP_TYPE_QP_EVENT 0x38UL
2676 #define CREQ_DEINITIALIZE_FW_RESP_RESERVED2_MASK 0xc0UL
2677 #define CREQ_DEINITIALIZE_FW_RESP_RESERVED2_SFT 6
2682 #define CREQ_DEINITIALIZE_FW_RESP_V 0x1UL
2683 #define CREQ_DEINITIALIZE_FW_RESP_RESERVED7_MASK 0xfeUL
2684 #define CREQ_DEINITIALIZE_FW_RESP_RESERVED7_SFT 1
2686 #define CREQ_DEINITIALIZE_FW_RESP_EVENT_DEINITIALIZE_FW 0x81UL
2687 __le16 reserved48
[3];
2690 /* Stop function command response (16 bytes) */
2691 struct creq_stop_func_resp
{
2693 #define CREQ_STOP_FUNC_RESP_TYPE_MASK 0x3fUL
2694 #define CREQ_STOP_FUNC_RESP_TYPE_SFT 0
2695 #define CREQ_STOP_FUNC_RESP_TYPE_QP_EVENT 0x38UL
2696 #define CREQ_STOP_FUNC_RESP_RESERVED2_MASK 0xc0UL
2697 #define CREQ_STOP_FUNC_RESP_RESERVED2_SFT 6
2702 #define CREQ_STOP_FUNC_RESP_V 0x1UL
2703 #define CREQ_STOP_FUNC_RESP_RESERVED7_MASK 0xfeUL
2704 #define CREQ_STOP_FUNC_RESP_RESERVED7_SFT 1
2706 #define CREQ_STOP_FUNC_RESP_EVENT_STOP_FUNC 0x82UL
2707 __le16 reserved48
[3];
2710 /* Query function command response (16 bytes) */
2711 struct creq_query_func_resp
{
2713 #define CREQ_QUERY_FUNC_RESP_TYPE_MASK 0x3fUL
2714 #define CREQ_QUERY_FUNC_RESP_TYPE_SFT 0
2715 #define CREQ_QUERY_FUNC_RESP_TYPE_QP_EVENT 0x38UL
2716 #define CREQ_QUERY_FUNC_RESP_RESERVED2_MASK 0xc0UL
2717 #define CREQ_QUERY_FUNC_RESP_RESERVED2_SFT 6
2722 #define CREQ_QUERY_FUNC_RESP_V 0x1UL
2723 #define CREQ_QUERY_FUNC_RESP_RESERVED7_MASK 0xfeUL
2724 #define CREQ_QUERY_FUNC_RESP_RESERVED7_SFT 1
2726 #define CREQ_QUERY_FUNC_RESP_EVENT_QUERY_FUNC 0x83UL
2727 __le16 reserved48
[3];
2730 /* Query function command response side buffer structure (88 bytes) */
2731 struct creq_query_func_resp_sb
{
2733 #define CREQ_QUERY_FUNC_RESP_SB_OPCODE_QUERY_FUNC 0x83UL
2742 __le16 dev_cap_flags
;
2743 #define CREQ_QUERY_FUNC_RESP_SB_DEV_CAP_FLAGS_RESIZE_QP 0x1UL
2750 u8 max_qp_init_rd_atom
;
2753 __le32 max_raw_eth_qp
;
2758 __le32 max_inline_data
;
2760 u8 l2_db_space_size
;
2763 __le32 tqm_alloc_reqs
[12];
2768 /* Set resources command response (16 bytes) */
2769 struct creq_set_func_resources_resp
{
2771 #define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_MASK 0x3fUL
2772 #define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_SFT 0
2773 #define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_QP_EVENT 0x38UL
2774 #define CREQ_SET_FUNC_RESOURCES_RESP_RESERVED2_MASK 0xc0UL
2775 #define CREQ_SET_FUNC_RESOURCES_RESP_RESERVED2_SFT 6
2780 #define CREQ_SET_FUNC_RESOURCES_RESP_V 0x1UL
2781 #define CREQ_SET_FUNC_RESOURCES_RESP_RESERVED7_MASK 0xfeUL
2782 #define CREQ_SET_FUNC_RESOURCES_RESP_RESERVED7_SFT 1
2784 #define CREQ_SET_FUNC_RESOURCES_RESP_EVENT_SET_FUNC_RESOURCES 0x84UL
2785 __le16 reserved48
[3];
2788 /* Map TC to COS response (16 bytes) */
2789 struct creq_map_tc_to_cos_resp
{
2791 #define CREQ_MAP_TC_TO_COS_RESP_TYPE_MASK 0x3fUL
2792 #define CREQ_MAP_TC_TO_COS_RESP_TYPE_SFT 0
2793 #define CREQ_MAP_TC_TO_COS_RESP_TYPE_QP_EVENT 0x38UL
2794 #define CREQ_MAP_TC_TO_COS_RESP_RESERVED2_MASK 0xc0UL
2795 #define CREQ_MAP_TC_TO_COS_RESP_RESERVED2_SFT 6
2800 #define CREQ_MAP_TC_TO_COS_RESP_V 0x1UL
2801 #define CREQ_MAP_TC_TO_COS_RESP_RESERVED7_MASK 0xfeUL
2802 #define CREQ_MAP_TC_TO_COS_RESP_RESERVED7_SFT 1
2804 #define CREQ_MAP_TC_TO_COS_RESP_EVENT_MAP_TC_TO_COS 0x8aUL
2805 __le16 reserved48
[3];
2808 /* Query version response (16 bytes) */
2809 struct creq_query_version_resp
{
2811 #define CREQ_QUERY_VERSION_RESP_TYPE_MASK 0x3fUL
2812 #define CREQ_QUERY_VERSION_RESP_TYPE_SFT 0
2813 #define CREQ_QUERY_VERSION_RESP_TYPE_QP_EVENT 0x38UL
2814 #define CREQ_QUERY_VERSION_RESP_RESERVED2_MASK 0xc0UL
2815 #define CREQ_QUERY_VERSION_RESP_RESERVED2_SFT 6
2823 #define CREQ_QUERY_VERSION_RESP_V 0x1UL
2824 #define CREQ_QUERY_VERSION_RESP_RESERVED7_MASK 0xfeUL
2825 #define CREQ_QUERY_VERSION_RESP_RESERVED7_SFT 1
2827 #define CREQ_QUERY_VERSION_RESP_EVENT_QUERY_VERSION 0x8bUL
2835 /* Modify congestion control command response (16 bytes) */
2836 struct creq_modify_cc_resp
{
2838 #define CREQ_MODIFY_CC_RESP_TYPE_MASK 0x3fUL
2839 #define CREQ_MODIFY_CC_RESP_TYPE_SFT 0
2840 #define CREQ_MODIFY_CC_RESP_TYPE_QP_EVENT 0x38UL
2841 #define CREQ_MODIFY_CC_RESP_RESERVED2_MASK 0xc0UL
2842 #define CREQ_MODIFY_CC_RESP_RESERVED2_SFT 6
2847 #define CREQ_MODIFY_CC_RESP_V 0x1UL
2848 #define CREQ_MODIFY_CC_RESP_RESERVED7_MASK 0xfeUL
2849 #define CREQ_MODIFY_CC_RESP_RESERVED7_SFT 1
2851 #define CREQ_MODIFY_CC_RESP_EVENT_MODIFY_CC 0x8cUL
2852 __le16 reserved48
[3];
2855 /* Query congestion control command response (16 bytes) */
2856 struct creq_query_cc_resp
{
2858 #define CREQ_QUERY_CC_RESP_TYPE_MASK 0x3fUL
2859 #define CREQ_QUERY_CC_RESP_TYPE_SFT 0
2860 #define CREQ_QUERY_CC_RESP_TYPE_QP_EVENT 0x38UL
2861 #define CREQ_QUERY_CC_RESP_RESERVED2_MASK 0xc0UL
2862 #define CREQ_QUERY_CC_RESP_RESERVED2_SFT 6
2867 #define CREQ_QUERY_CC_RESP_V 0x1UL
2868 #define CREQ_QUERY_CC_RESP_RESERVED7_MASK 0xfeUL
2869 #define CREQ_QUERY_CC_RESP_RESERVED7_SFT 1
2871 #define CREQ_QUERY_CC_RESP_EVENT_QUERY_CC 0x8dUL
2872 __le16 reserved48
[3];
2875 /* Query congestion control command response side buffer structure (32 bytes) */
2876 struct creq_query_cc_resp_sb
{
2878 #define CREQ_QUERY_CC_RESP_SB_OPCODE_QUERY_CC 0x8dUL
2885 #define CREQ_QUERY_CC_RESP_SB_ENABLE_CC 0x1UL
2887 #define CREQ_QUERY_CC_RESP_SB_G_MASK 0x7UL
2888 #define CREQ_QUERY_CC_RESP_SB_G_SFT 0
2889 u8 num_phases_per_state
;
2895 u8 tos_dscp_tos_ecn
;
2896 #define CREQ_QUERY_CC_RESP_SB_TOS_ECN_MASK 0x3UL
2897 #define CREQ_QUERY_CC_RESP_SB_TOS_ECN_SFT 0
2898 #define CREQ_QUERY_CC_RESP_SB_TOS_DSCP_MASK 0xfcUL
2899 #define CREQ_QUERY_CC_RESP_SB_TOS_DSCP_SFT 2
2901 __le64 reserved64_1
;
2904 /* creq_query_roce_stats_resp (size:128b/16B) */
2905 struct creq_query_roce_stats_resp
{
2907 #define CREQ_QUERY_ROCE_STATS_RESP_TYPE_MASK 0x3fUL
2908 #define CREQ_QUERY_ROCE_STATS_RESP_TYPE_SFT 0
2909 #define CREQ_QUERY_ROCE_STATS_RESP_TYPE_QP_EVENT 0x38UL
2910 #define CREQ_QUERY_ROCE_STATS_RESP_TYPE_LAST \
2911 CREQ_QUERY_ROCE_STATS_RESP_TYPE_QP_EVENT
2916 #define CREQ_QUERY_ROCE_STATS_RESP_V 0x1UL
2918 #define CREQ_QUERY_ROCE_STATS_RESP_EVENT_QUERY_ROCE_STATS 0x8eUL
2919 #define CREQ_QUERY_ROCE_STATS_RESP_EVENT_LAST \
2920 CREQ_QUERY_ROCE_STATS_RESP_EVENT_QUERY_ROCE_STATS
2924 /* creq_query_roce_stats_resp_sb (size:2624b/328B) */
2925 struct creq_query_roce_stats_resp_sb
{
2927 #define CREQ_QUERY_ROCE_STATS_RESP_SB_OPCODE_QUERY_ROCE_STATS 0x8eUL
2928 #define CREQ_QUERY_ROCE_STATS_RESP_SB_OPCODE_LAST \
2929 CREQ_QUERY_ROCE_STATS_RESP_SB_OPCODE_QUERY_ROCE_STATS
2935 __le32 num_counters
;
2937 __le64 to_retransmits
;
2938 __le64 seq_err_naks_rcvd
;
2939 __le64 max_retry_exceeded
;
2940 __le64 rnr_naks_rcvd
;
2941 __le64 missing_resp
;
2942 __le64 unrecoverable_err
;
2943 __le64 bad_resp_err
;
2944 __le64 local_qp_op_err
;
2945 __le64 local_protection_err
;
2946 __le64 mem_mgmt_op_err
;
2947 __le64 remote_invalid_req_err
;
2948 __le64 remote_access_err
;
2949 __le64 remote_op_err
;
2951 __le64 res_exceed_max
;
2952 __le64 res_length_mismatch
;
2953 __le64 res_exceeds_wqe
;
2954 __le64 res_opcode_err
;
2955 __le64 res_rx_invalid_rkey
;
2956 __le64 res_rx_domain_err
;
2957 __le64 res_rx_no_perm
;
2958 __le64 res_rx_range_err
;
2959 __le64 res_tx_invalid_rkey
;
2960 __le64 res_tx_domain_err
;
2961 __le64 res_tx_no_perm
;
2962 __le64 res_tx_range_err
;
2963 __le64 res_irrq_oflow
;
2964 __le64 res_unsup_opcode
;
2965 __le64 res_unaligned_atomic
;
2966 __le64 res_rem_inv_err
;
2967 __le64 res_mem_error
;
2970 __le64 res_invalid_dup_rkey
;
2971 __le64 res_wqe_format_err
;
2972 __le64 res_cq_load_err
;
2973 __le64 res_srq_load_err
;
2974 __le64 res_tx_pci_err
;
2975 __le64 res_rx_pci_err
;
2976 __le64 res_oos_drop_count
;
2977 __le64 active_qp_count_p0
;
2978 __le64 active_qp_count_p1
;
2979 __le64 active_qp_count_p2
;
2980 __le64 active_qp_count_p3
;
2983 /* QP error notification event (16 bytes) */
2984 struct creq_qp_error_notification
{
2986 #define CREQ_QP_ERROR_NOTIFICATION_TYPE_MASK 0x3fUL
2987 #define CREQ_QP_ERROR_NOTIFICATION_TYPE_SFT 0
2988 #define CREQ_QP_ERROR_NOTIFICATION_TYPE_QP_EVENT 0x38UL
2989 #define CREQ_QP_ERROR_NOTIFICATION_RESERVED2_MASK 0xc0UL
2990 #define CREQ_QP_ERROR_NOTIFICATION_RESERVED2_SFT 6
2992 u8 req_slow_path_state
;
2993 u8 req_err_state_reason
;
2996 #define CREQ_QP_ERROR_NOTIFICATION_V 0x1UL
2997 #define CREQ_QP_ERROR_NOTIFICATION_RESERVED7_MASK 0xfeUL
2998 #define CREQ_QP_ERROR_NOTIFICATION_RESERVED7_SFT 1
3000 #define CREQ_QP_ERROR_NOTIFICATION_EVENT_QP_ERROR_NOTIFICATION 0xc0UL
3001 u8 res_slow_path_state
;
3002 u8 res_err_state_reason
;
3007 /* RoCE Slowpath HSI Specification 1.6.0 */
3008 #define ROCE_SP_HSI_VERSION_MAJOR 1
3009 #define ROCE_SP_HSI_VERSION_MINOR 6
3010 #define ROCE_SP_HSI_VERSION_UPDATE 0
3012 #define ROCE_SP_HSI_VERSION_STR "1.6.0"
3014 * Following is the signature for ROCE_SP_HSI message field that indicates not
3015 * applicable (All F's). Need to cast it the size of the field if needed.
3017 #define ROCE_SP_HSI_NA_SIGNATURE ((__le32)(-1))
3018 #endif /* __BNXT_RE_HSI_H__ */