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 /* sq_send_hdr (size:256b/32B) */
219 __le32 inv_key_or_imm_data
;
227 /* Send Raw Ethernet and QP1 SQ WQE (40 bytes) */
228 struct sq_send_raweth_qp1
{
230 #define SQ_SEND_RAWETH_QP1_WQE_TYPE_SEND 0x0UL
232 #define SQ_SEND_RAWETH_QP1_FLAGS_SIGNAL_COMP 0x1UL
233 #define SQ_SEND_RAWETH_QP1_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL
234 #define SQ_SEND_RAWETH_QP1_FLAGS_UC_FENCE 0x4UL
235 #define SQ_SEND_RAWETH_QP1_FLAGS_SE 0x8UL
236 #define SQ_SEND_RAWETH_QP1_FLAGS_INLINE 0x10UL
240 #define SQ_SEND_RAWETH_QP1_LFLAGS_TCP_UDP_CHKSUM 0x1UL
241 #define SQ_SEND_RAWETH_QP1_LFLAGS_IP_CHKSUM 0x2UL
242 #define SQ_SEND_RAWETH_QP1_LFLAGS_NOCRC 0x4UL
243 #define SQ_SEND_RAWETH_QP1_LFLAGS_STAMP 0x8UL
244 #define SQ_SEND_RAWETH_QP1_LFLAGS_T_IP_CHKSUM 0x10UL
245 #define SQ_SEND_RAWETH_QP1_LFLAGS_RESERVED1_1 0x20UL
246 #define SQ_SEND_RAWETH_QP1_LFLAGS_RESERVED1_2 0x40UL
247 #define SQ_SEND_RAWETH_QP1_LFLAGS_RESERVED1_3 0x80UL
248 #define SQ_SEND_RAWETH_QP1_LFLAGS_ROCE_CRC 0x100UL
249 #define SQ_SEND_RAWETH_QP1_LFLAGS_FCOE_CRC 0x200UL
254 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_VID_MASK 0xfffUL
255 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_VID_SFT 0
256 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_DE 0x1000UL
257 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_PRI_MASK 0xe000UL
258 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_PRI_SFT 13
259 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_MASK 0x70000UL
260 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_SFT 16
261 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID88A8 (0x0UL << 16)
262 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID8100 (0x1UL << 16)
263 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID9100 (0x2UL << 16)
264 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID9200 (0x3UL << 16)
265 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID9300 (0x4UL << 16)
266 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPIDCFG (0x5UL << 16)
267 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_LAST \
268 SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPIDCFG
269 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_RESERVED_MASK 0xff80000UL
270 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_RESERVED_SFT 19
271 #define SQ_SEND_RAWETH_QP1_CFA_META_KEY_MASK 0xf0000000UL
272 #define SQ_SEND_RAWETH_QP1_CFA_META_KEY_SFT 28
273 #define SQ_SEND_RAWETH_QP1_CFA_META_KEY_NONE (0x0UL << 28)
274 #define SQ_SEND_RAWETH_QP1_CFA_META_KEY_VLAN_TAG (0x1UL << 28)
275 #define SQ_SEND_RAWETH_QP1_CFA_META_KEY_LAST \
276 SQ_SEND_RAWETH_QP1_CFA_META_KEY_VLAN_TAG
282 /* sq_send_raweth_qp1_hdr (size:256b/32B) */
283 struct sq_send_raweth_qp1_hdr
{
297 /* RDMA SQ WQE (40 bytes) */
300 #define SQ_RDMA_WQE_TYPE_WRITE_WQE 0x4UL
301 #define SQ_RDMA_WQE_TYPE_WRITE_W_IMMEAD 0x5UL
302 #define SQ_RDMA_WQE_TYPE_READ_WQE 0x6UL
304 #define SQ_RDMA_FLAGS_SIGNAL_COMP 0x1UL
305 #define SQ_RDMA_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL
306 #define SQ_RDMA_FLAGS_UC_FENCE 0x4UL
307 #define SQ_RDMA_FLAGS_SE 0x8UL
308 #define SQ_RDMA_FLAGS_INLINE 0x10UL
320 /* sq_rdma_hdr (size:256b/32B) */
334 /* Atomic SQ WQE (40 bytes) */
337 #define SQ_ATOMIC_WQE_TYPE_ATOMIC_CS 0x8UL
338 #define SQ_ATOMIC_WQE_TYPE_ATOMIC_FA 0xbUL
340 #define SQ_ATOMIC_FLAGS_SIGNAL_COMP 0x1UL
341 #define SQ_ATOMIC_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL
342 #define SQ_ATOMIC_FLAGS_UC_FENCE 0x4UL
343 #define SQ_ATOMIC_FLAGS_SE 0x8UL
344 #define SQ_ATOMIC_FLAGS_INLINE 0x10UL
353 /* sq_atomic_hdr (size:256b/32B) */
354 struct sq_atomic_hdr
{
364 /* Local Invalidate SQ WQE (40 bytes) */
365 struct sq_localinvalidate
{
367 #define SQ_LOCALINVALIDATE_WQE_TYPE_LOCAL_INVALID 0xcUL
369 #define SQ_LOCALINVALIDATE_FLAGS_SIGNAL_COMP 0x1UL
370 #define SQ_LOCALINVALIDATE_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL
371 #define SQ_LOCALINVALIDATE_FLAGS_UC_FENCE 0x4UL
372 #define SQ_LOCALINVALIDATE_FLAGS_SE 0x8UL
373 #define SQ_LOCALINVALIDATE_FLAGS_INLINE 0x10UL
377 __le32 reserved128
[4];
381 /* sq_localinvalidate_hdr (size:256b/32B) */
382 struct sq_localinvalidate_hdr
{
391 /* FR-PMR SQ WQE (40 bytes) */
394 #define SQ_FR_PMR_WQE_TYPE_FR_PMR 0xdUL
396 #define SQ_FR_PMR_FLAGS_SIGNAL_COMP 0x1UL
397 #define SQ_FR_PMR_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL
398 #define SQ_FR_PMR_FLAGS_UC_FENCE 0x4UL
399 #define SQ_FR_PMR_FLAGS_SE 0x8UL
400 #define SQ_FR_PMR_FLAGS_INLINE 0x10UL
402 #define SQ_FR_PMR_ACCESS_CNTL_LOCAL_WRITE 0x1UL
403 #define SQ_FR_PMR_ACCESS_CNTL_REMOTE_READ 0x2UL
404 #define SQ_FR_PMR_ACCESS_CNTL_REMOTE_WRITE 0x4UL
405 #define SQ_FR_PMR_ACCESS_CNTL_REMOTE_ATOMIC 0x8UL
406 #define SQ_FR_PMR_ACCESS_CNTL_WINDOW_BIND 0x10UL
407 u8 zero_based_page_size_log
;
408 #define SQ_FR_PMR_PAGE_SIZE_LOG_MASK 0x1fUL
409 #define SQ_FR_PMR_PAGE_SIZE_LOG_SFT 0
410 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4K 0x0UL
411 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8K 0x1UL
412 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_64K 0x4UL
413 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_256K 0x6UL
414 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_1M 0x8UL
415 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_2M 0x9UL
416 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4M 0xaUL
417 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_1G 0x12UL
418 #define SQ_FR_PMR_ZERO_BASED 0x20UL
419 #define SQ_FR_PMR_RESERVED2_MASK 0xc0UL
420 #define SQ_FR_PMR_RESERVED2_SFT 6
425 u8 numlevels_pbl_page_size_log
;
426 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_MASK 0x1fUL
427 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_SFT 0
428 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4K 0x0UL
429 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8K 0x1UL
430 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_64K 0x4UL
431 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_256K 0x6UL
432 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_1M 0x8UL
433 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_2M 0x9UL
434 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4M 0xaUL
435 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_1G 0x12UL
436 #define SQ_FR_PMR_RESERVED1 0x20UL
437 #define SQ_FR_PMR_NUMLEVELS_MASK 0xc0UL
438 #define SQ_FR_PMR_NUMLEVELS_SFT 6
439 #define SQ_FR_PMR_NUMLEVELS_PHYSICAL (0x0UL << 6)
440 #define SQ_FR_PMR_NUMLEVELS_LAYER1 (0x1UL << 6)
441 #define SQ_FR_PMR_NUMLEVELS_LAYER2 (0x2UL << 6)
447 /* sq_fr_pmr_hdr (size:256b/32B) */
448 struct sq_fr_pmr_hdr
{
452 u8 zero_based_page_size_log
;
457 u8 numlevels_pbl_page_size_log
;
462 /* Bind SQ WQE (40 bytes) */
465 #define SQ_BIND_WQE_TYPE_BIND 0xeUL
467 #define SQ_BIND_FLAGS_SIGNAL_COMP 0x1UL
468 #define SQ_BIND_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL
469 #define SQ_BIND_FLAGS_UC_FENCE 0x4UL
470 #define SQ_BIND_FLAGS_SE 0x8UL
471 #define SQ_BIND_FLAGS_INLINE 0x10UL
473 #define SQ_BIND_ACCESS_CNTL_LOCAL_WRITE 0x1UL
474 #define SQ_BIND_ACCESS_CNTL_REMOTE_READ 0x2UL
475 #define SQ_BIND_ACCESS_CNTL_REMOTE_WRITE 0x4UL
476 #define SQ_BIND_ACCESS_CNTL_REMOTE_ATOMIC 0x8UL
477 #define SQ_BIND_ACCESS_CNTL_WINDOW_BIND 0x10UL
479 u8 mw_type_zero_based
;
480 #define SQ_BIND_ZERO_BASED 0x1UL
481 #define SQ_BIND_MW_TYPE 0x2UL
482 #define SQ_BIND_MW_TYPE_TYPE1 (0x0UL << 1)
483 #define SQ_BIND_MW_TYPE_TYPE2 (0x1UL << 1)
484 #define SQ_BIND_RESERVED6_MASK 0xfcUL
485 #define SQ_BIND_RESERVED6_SFT 2
492 u8 data_reserved24
[99];
493 #define SQ_BIND_RESERVED24_MASK 0xffffff00UL
494 #define SQ_BIND_RESERVED24_SFT 8
495 #define SQ_BIND_DATA_MASK 0xffffffffUL
496 #define SQ_BIND_DATA_SFT 0
499 /* sq_bind_hdr (size:256b/32B) */
505 u8 mw_type_zero_based
;
515 /* RQ/SRQ WQE Structures */
516 /* RQ/SRQ WQE (40 bytes) */
519 #define RQ_WQE_WQE_TYPE_RCV 0x80UL
525 #define RQ_WQE_WR_ID_MASK 0xfffffUL
526 #define RQ_WQE_WR_ID_SFT 0
527 #define RQ_WQE_RESERVED44_MASK 0xfff00000UL
528 #define RQ_WQE_RESERVED44_SFT 20
529 __le32 reserved128
[4];
533 /* rq_wqe_hdr (size:256b/32B) */
544 /* CQ CQE Structures */
545 /* Base CQE (32 bytes) */
551 #define CQ_BASE_TOGGLE 0x1UL
552 #define CQ_BASE_CQE_TYPE_MASK 0x1eUL
553 #define CQ_BASE_CQE_TYPE_SFT 1
554 #define CQ_BASE_CQE_TYPE_REQ (0x0UL << 1)
555 #define CQ_BASE_CQE_TYPE_RES_RC (0x1UL << 1)
556 #define CQ_BASE_CQE_TYPE_RES_UD (0x2UL << 1)
557 #define CQ_BASE_CQE_TYPE_RES_RAWETH_QP1 (0x3UL << 1)
558 #define CQ_BASE_CQE_TYPE_TERMINAL (0xeUL << 1)
559 #define CQ_BASE_CQE_TYPE_CUT_OFF (0xfUL << 1)
560 #define CQ_BASE_RESERVED3_MASK 0xe0UL
561 #define CQ_BASE_RESERVED3_SFT 5
567 /* Requester CQ CQE (32 bytes) */
575 #define CQ_REQ_TOGGLE 0x1UL
576 #define CQ_REQ_CQE_TYPE_MASK 0x1eUL
577 #define CQ_REQ_CQE_TYPE_SFT 1
578 #define CQ_REQ_CQE_TYPE_REQ (0x0UL << 1)
579 #define CQ_REQ_RESERVED3_MASK 0xe0UL
580 #define CQ_REQ_RESERVED3_SFT 5
582 #define CQ_REQ_STATUS_OK 0x0UL
583 #define CQ_REQ_STATUS_BAD_RESPONSE_ERR 0x1UL
584 #define CQ_REQ_STATUS_LOCAL_LENGTH_ERR 0x2UL
585 #define CQ_REQ_STATUS_LOCAL_QP_OPERATION_ERR 0x3UL
586 #define CQ_REQ_STATUS_LOCAL_PROTECTION_ERR 0x4UL
587 #define CQ_REQ_STATUS_MEMORY_MGT_OPERATION_ERR 0x5UL
588 #define CQ_REQ_STATUS_REMOTE_INVALID_REQUEST_ERR 0x6UL
589 #define CQ_REQ_STATUS_REMOTE_ACCESS_ERR 0x7UL
590 #define CQ_REQ_STATUS_REMOTE_OPERATION_ERR 0x8UL
591 #define CQ_REQ_STATUS_RNR_NAK_RETRY_CNT_ERR 0x9UL
592 #define CQ_REQ_STATUS_TRANSPORT_RETRY_CNT_ERR 0xaUL
593 #define CQ_REQ_STATUS_WORK_REQUEST_FLUSHED_ERR 0xbUL
598 /* Responder RC CQE (32 bytes) */
601 __le32 imm_data_or_inv_r_key
;
605 #define CQ_RES_RC_TOGGLE 0x1UL
606 #define CQ_RES_RC_CQE_TYPE_MASK 0x1eUL
607 #define CQ_RES_RC_CQE_TYPE_SFT 1
608 #define CQ_RES_RC_CQE_TYPE_RES_RC (0x1UL << 1)
609 #define CQ_RES_RC_RESERVED3_MASK 0xe0UL
610 #define CQ_RES_RC_RESERVED3_SFT 5
612 #define CQ_RES_RC_STATUS_OK 0x0UL
613 #define CQ_RES_RC_STATUS_LOCAL_ACCESS_ERROR 0x1UL
614 #define CQ_RES_RC_STATUS_LOCAL_LENGTH_ERR 0x2UL
615 #define CQ_RES_RC_STATUS_LOCAL_PROTECTION_ERR 0x3UL
616 #define CQ_RES_RC_STATUS_LOCAL_QP_OPERATION_ERR 0x4UL
617 #define CQ_RES_RC_STATUS_MEMORY_MGT_OPERATION_ERR 0x5UL
618 #define CQ_RES_RC_STATUS_REMOTE_INVALID_REQUEST_ERR 0x6UL
619 #define CQ_RES_RC_STATUS_WORK_REQUEST_FLUSHED_ERR 0x7UL
620 #define CQ_RES_RC_STATUS_HW_FLUSH_ERR 0x8UL
622 #define CQ_RES_RC_FLAGS_SRQ 0x1UL
623 #define CQ_RES_RC_FLAGS_SRQ_RQ (0x0UL << 0)
624 #define CQ_RES_RC_FLAGS_SRQ_SRQ (0x1UL << 0)
625 #define CQ_RES_RC_FLAGS_SRQ_LAST CQ_RES_RC_FLAGS_SRQ_SRQ
626 #define CQ_RES_RC_FLAGS_IMM 0x2UL
627 #define CQ_RES_RC_FLAGS_INV 0x4UL
628 #define CQ_RES_RC_FLAGS_RDMA 0x8UL
629 #define CQ_RES_RC_FLAGS_RDMA_SEND (0x0UL << 3)
630 #define CQ_RES_RC_FLAGS_RDMA_RDMA_WRITE (0x1UL << 3)
631 #define CQ_RES_RC_FLAGS_RDMA_LAST CQ_RES_RC_FLAGS_RDMA_RDMA_WRITE
632 __le32 srq_or_rq_wr_id
;
633 #define CQ_RES_RC_SRQ_OR_RQ_WR_ID_MASK 0xfffffUL
634 #define CQ_RES_RC_SRQ_OR_RQ_WR_ID_SFT 0
635 #define CQ_RES_RC_RESERVED12_MASK 0xfff00000UL
636 #define CQ_RES_RC_RESERVED12_SFT 20
639 /* Responder UD CQE (32 bytes) */
642 #define CQ_RES_UD_LENGTH_MASK 0x3fffUL
643 #define CQ_RES_UD_LENGTH_SFT 0
645 #define CQ_RES_UD_CFA_METADATA_VID_MASK 0xfffUL
646 #define CQ_RES_UD_CFA_METADATA_VID_SFT 0
647 #define CQ_RES_UD_CFA_METADATA_DE 0x1000UL
648 #define CQ_RES_UD_CFA_METADATA_PRI_MASK 0xe000UL
649 #define CQ_RES_UD_CFA_METADATA_PRI_SFT 13
655 #define CQ_RES_UD_TOGGLE 0x1UL
656 #define CQ_RES_UD_CQE_TYPE_MASK 0x1eUL
657 #define CQ_RES_UD_CQE_TYPE_SFT 1
658 #define CQ_RES_UD_CQE_TYPE_RES_UD (0x2UL << 1)
660 #define CQ_RES_UD_STATUS_OK 0x0UL
661 #define CQ_RES_UD_STATUS_LOCAL_ACCESS_ERROR 0x1UL
662 #define CQ_RES_UD_STATUS_HW_LOCAL_LENGTH_ERR 0x2UL
663 #define CQ_RES_UD_STATUS_LOCAL_PROTECTION_ERR 0x3UL
664 #define CQ_RES_UD_STATUS_LOCAL_QP_OPERATION_ERR 0x4UL
665 #define CQ_RES_UD_STATUS_MEMORY_MGT_OPERATION_ERR 0x5UL
666 #define CQ_RES_UD_STATUS_WORK_REQUEST_FLUSHED_ERR 0x7UL
667 #define CQ_RES_UD_STATUS_HW_FLUSH_ERR 0x8UL
669 #define CQ_RES_UD_FLAGS_SRQ 0x1UL
670 #define CQ_RES_UD_FLAGS_SRQ_RQ (0x0UL << 0)
671 #define CQ_RES_UD_FLAGS_SRQ_SRQ (0x1UL << 0)
672 #define CQ_RES_UD_FLAGS_SRQ_LAST CQ_RES_UD_FLAGS_SRQ_SRQ
673 #define CQ_RES_UD_FLAGS_IMM 0x2UL
674 #define CQ_RES_UD_FLAGS_UNUSED_MASK 0xcUL
675 #define CQ_RES_UD_FLAGS_UNUSED_SFT 2
676 #define CQ_RES_UD_FLAGS_ROCE_IP_VER_MASK 0x30UL
677 #define CQ_RES_UD_FLAGS_ROCE_IP_VER_SFT 4
678 #define CQ_RES_UD_FLAGS_ROCE_IP_VER_V1 (0x0UL << 4)
679 #define CQ_RES_UD_FLAGS_ROCE_IP_VER_V2IPV4 (0x2UL << 4)
680 #define CQ_RES_UD_FLAGS_ROCE_IP_VER_V2IPV6 (0x3UL << 4)
681 #define CQ_RES_UD_FLAGS_ROCE_IP_VER_LAST \
682 CQ_RES_UD_FLAGS_ROCE_IP_VER_V2IPV6
683 #define CQ_RES_UD_FLAGS_META_FORMAT_MASK 0x3c0UL
684 #define CQ_RES_UD_FLAGS_META_FORMAT_SFT 6
685 #define CQ_RES_UD_FLAGS_META_FORMAT_NONE (0x0UL << 6)
686 #define CQ_RES_UD_FLAGS_META_FORMAT_VLAN (0x1UL << 6)
687 #define CQ_RES_UD_FLAGS_META_FORMAT_TUNNEL_ID (0x2UL << 6)
688 #define CQ_RES_UD_FLAGS_META_FORMAT_CHDR_DATA (0x3UL << 6)
689 #define CQ_RES_UD_FLAGS_META_FORMAT_HDR_OFFSET (0x4UL << 6)
690 #define CQ_RES_UD_FLAGS_META_FORMAT_LAST \
691 CQ_RES_UD_FLAGS_META_FORMAT_HDR_OFFSET
692 #define CQ_RES_UD_FLAGS_EXT_META_FORMAT_MASK 0xc00UL
693 #define CQ_RES_UD_FLAGS_EXT_META_FORMAT_SFT 10
695 __le32 src_qp_high_srq_or_rq_wr_id
;
696 #define CQ_RES_UD_SRQ_OR_RQ_WR_ID_MASK 0xfffffUL
697 #define CQ_RES_UD_SRQ_OR_RQ_WR_ID_SFT 0
698 #define CQ_RES_UD_SRC_QP_HIGH_MASK 0xff000000UL
699 #define CQ_RES_UD_SRC_QP_HIGH_SFT 24
702 /* Responder RawEth and QP1 CQE (32 bytes) */
703 struct cq_res_raweth_qp1
{
705 #define CQ_RES_RAWETH_QP1_LENGTH_MASK 0x3fffUL
706 #define CQ_RES_RAWETH_QP1_LENGTH_SFT 0
707 #define CQ_RES_RAWETH_QP1_RESERVED2_MASK 0xc000UL
708 #define CQ_RES_RAWETH_QP1_RESERVED2_SFT 14
709 __le16 raweth_qp1_flags
;
710 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ERROR 0x1UL
711 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_RESERVED5_1_MASK 0x3eUL
712 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_RESERVED5_1_SFT 1
713 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_MASK 0x3c0UL
714 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_SFT 6
715 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_NOT_KNOWN (0x0UL << 6)
716 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_IP (0x1UL << 6)
717 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_TCP (0x2UL << 6)
718 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_UDP (0x3UL << 6)
719 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_FCOE (0x4UL << 6)
720 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_ROCE (0x5UL << 6)
721 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_ICMP (0x7UL << 6)
722 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_PTP_WO_TIMESTAMP \
724 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP \
726 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_LAST \
727 CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP
728 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_MASK 0x3ffUL
729 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_SFT 0
730 #define CQ_RES_RAWETH_QP1_RESERVED6_MASK 0xfc00UL
731 #define CQ_RES_RAWETH_QP1_RESERVED6_SFT 10
732 __le16 raweth_qp1_errors
;
733 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_RESERVED4_MASK 0xfUL
734 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_RESERVED4_SFT 0
735 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_IP_CS_ERROR 0x10UL
736 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_L4_CS_ERROR 0x20UL
737 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_IP_CS_ERROR 0x40UL
738 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_L4_CS_ERROR 0x80UL
739 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_CRC_ERROR 0x100UL
740 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_MASK 0xe00UL
741 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_SFT 9
742 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_NO_ERROR \
745 CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION \
748 CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN \
751 CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR \
754 CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR \
757 CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR \
760 CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL \
762 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_LAST \
763 CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL
764 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_MASK 0xf000UL
765 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_SFT 12
766 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_NO_ERROR \
768 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_VERSION \
770 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN \
772 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_TTL \
774 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_IP_TOTAL_ERROR \
776 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR \
778 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN \
781 CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL\
783 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN \
785 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_LAST \
786 CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
787 __le16 raweth_qp1_cfa_code
;
789 __le32 raweth_qp1_flags2
;
790 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_IP_CS_CALC 0x1UL
791 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_L4_CS_CALC 0x2UL
792 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_T_IP_CS_CALC 0x4UL
793 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_T_L4_CS_CALC 0x8UL
794 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_MASK 0xf0UL
795 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_SFT 4
796 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_NONE \
798 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_VLAN \
800 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_LAST\
801 CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_VLAN
802 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_IP_TYPE 0x100UL
803 __le32 raweth_qp1_metadata
;
804 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_VID_MASK 0xfffUL
805 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_VID_SFT 0
806 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_DE 0x1000UL
807 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_MASK 0xe000UL
808 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_SFT 13
809 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_TPID_MASK 0xffff0000UL
810 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_TPID_SFT 16
812 #define CQ_RES_RAWETH_QP1_TOGGLE 0x1UL
813 #define CQ_RES_RAWETH_QP1_CQE_TYPE_MASK 0x1eUL
814 #define CQ_RES_RAWETH_QP1_CQE_TYPE_SFT 1
815 #define CQ_RES_RAWETH_QP1_CQE_TYPE_RES_RAWETH_QP1 (0x3UL << 1)
816 #define CQ_RES_RAWETH_QP1_RESERVED3_MASK 0xe0UL
817 #define CQ_RES_RAWETH_QP1_RESERVED3_SFT 5
819 #define CQ_RES_RAWETH_QP1_STATUS_OK 0x0UL
820 #define CQ_RES_RAWETH_QP1_STATUS_LOCAL_ACCESS_ERROR 0x1UL
821 #define CQ_RES_RAWETH_QP1_STATUS_HW_LOCAL_LENGTH_ERR 0x2UL
822 #define CQ_RES_RAWETH_QP1_STATUS_LOCAL_PROTECTION_ERR 0x3UL
823 #define CQ_RES_RAWETH_QP1_STATUS_LOCAL_QP_OPERATION_ERR 0x4UL
824 #define CQ_RES_RAWETH_QP1_STATUS_MEMORY_MGT_OPERATION_ERR 0x5UL
825 #define CQ_RES_RAWETH_QP1_STATUS_WORK_REQUEST_FLUSHED_ERR 0x7UL
826 #define CQ_RES_RAWETH_QP1_STATUS_HW_FLUSH_ERR 0x8UL
828 #define CQ_RES_RAWETH_QP1_FLAGS_SRQ 0x1UL
829 #define CQ_RES_RAWETH_QP1_FLAGS_SRQ_RQ 0x0UL
830 #define CQ_RES_RAWETH_QP1_FLAGS_SRQ_SRQ 0x1UL
831 #define CQ_RES_RAWETH_QP1_FLAGS_SRQ_LAST \
832 CQ_RES_RAWETH_QP1_FLAGS_SRQ_SRQ
833 __le32 raweth_qp1_payload_offset_srq_or_rq_wr_id
;
834 #define CQ_RES_RAWETH_QP1_SRQ_OR_RQ_WR_ID_MASK 0xfffffUL
835 #define CQ_RES_RAWETH_QP1_SRQ_OR_RQ_WR_ID_SFT 0
836 #define CQ_RES_RAWETH_QP1_RESERVED4_MASK 0xf00000UL
837 #define CQ_RES_RAWETH_QP1_RESERVED4_SFT 20
838 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_PAYLOAD_OFFSET_MASK 0xff000000UL
839 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_PAYLOAD_OFFSET_SFT 24
842 /* Terminal CQE (32 bytes) */
850 #define CQ_TERMINAL_TOGGLE 0x1UL
851 #define CQ_TERMINAL_CQE_TYPE_MASK 0x1eUL
852 #define CQ_TERMINAL_CQE_TYPE_SFT 1
853 #define CQ_TERMINAL_CQE_TYPE_TERMINAL (0xeUL << 1)
854 #define CQ_TERMINAL_RESERVED3_MASK 0xe0UL
855 #define CQ_TERMINAL_RESERVED3_SFT 5
857 #define CQ_TERMINAL_STATUS_OK 0x0UL
862 /* Cutoff CQE (32 bytes) */
868 #define CQ_CUTOFF_TOGGLE 0x1UL
869 #define CQ_CUTOFF_CQE_TYPE_MASK 0x1eUL
870 #define CQ_CUTOFF_CQE_TYPE_SFT 1
871 #define CQ_CUTOFF_CQE_TYPE_CUT_OFF (0xfUL << 1)
872 #define CQ_CUTOFF_RESERVED3_MASK 0xe0UL
873 #define CQ_CUTOFF_RESERVED3_SFT 5
875 #define CQ_CUTOFF_STATUS_OK 0x0UL
880 /* Notification Queue (NQ) Structures */
881 /* Base NQ Record (16 bytes) */
884 #define NQ_BASE_TYPE_MASK 0x3fUL
885 #define NQ_BASE_TYPE_SFT 0
886 #define NQ_BASE_TYPE_CQ_NOTIFICATION 0x30UL
887 #define NQ_BASE_TYPE_SRQ_EVENT 0x32UL
888 #define NQ_BASE_TYPE_DBQ_EVENT 0x34UL
889 #define NQ_BASE_TYPE_QP_EVENT 0x38UL
890 #define NQ_BASE_TYPE_FUNC_EVENT 0x3aUL
891 #define NQ_BASE_INFO10_MASK 0xffc0UL
892 #define NQ_BASE_INFO10_SFT 6
896 #define NQ_BASE_V 0x1UL
897 #define NQ_BASE_INFO63_MASK 0xfffffffeUL
898 #define NQ_BASE_INFO63_SFT 1
901 /* Completion Queue Notification (16 bytes) */
904 #define NQ_CN_TYPE_MASK 0x3fUL
905 #define NQ_CN_TYPE_SFT 0
906 #define NQ_CN_TYPE_CQ_NOTIFICATION 0x30UL
907 #define NQ_CN_RESERVED9_MASK 0xffc0UL
908 #define NQ_CN_RESERVED9_SFT 6
910 __le32 cq_handle_low
;
912 #define NQ_CN_V 0x1UL
913 #define NQ_CN_RESERVED31_MASK 0xfffffffeUL
914 #define NQ_CN_RESERVED31_SFT 1
915 __le32 cq_handle_high
;
918 /* SRQ Event Notification (16 bytes) */
919 struct nq_srq_event
{
921 #define NQ_SRQ_EVENT_TYPE_MASK 0x3fUL
922 #define NQ_SRQ_EVENT_TYPE_SFT 0
923 #define NQ_SRQ_EVENT_TYPE_SRQ_EVENT 0x32UL
924 #define NQ_SRQ_EVENT_RESERVED1_MASK 0xc0UL
925 #define NQ_SRQ_EVENT_RESERVED1_SFT 6
927 #define NQ_SRQ_EVENT_EVENT_SRQ_THRESHOLD_EVENT 0x1UL
929 __le32 srq_handle_low
;
931 #define NQ_SRQ_EVENT_V 0x1UL
932 #define NQ_SRQ_EVENT_RESERVED31_MASK 0xfffffffeUL
933 #define NQ_SRQ_EVENT_RESERVED31_SFT 1
934 __le32 srq_handle_high
;
937 /* DBQ Async Event Notification (16 bytes) */
938 struct nq_dbq_event
{
940 #define NQ_DBQ_EVENT_TYPE_MASK 0x3fUL
941 #define NQ_DBQ_EVENT_TYPE_SFT 0
942 #define NQ_DBQ_EVENT_TYPE_DBQ_EVENT 0x34UL
943 #define NQ_DBQ_EVENT_RESERVED1_MASK 0xc0UL
944 #define NQ_DBQ_EVENT_RESERVED1_SFT 6
946 #define NQ_DBQ_EVENT_EVENT_DBQ_THRESHOLD_EVENT 0x1UL
948 #define NQ_DBQ_EVENT_DB_PFID_MASK 0xfUL
949 #define NQ_DBQ_EVENT_DB_PFID_SFT 0
950 #define NQ_DBQ_EVENT_RESERVED12_MASK 0xfff0UL
951 #define NQ_DBQ_EVENT_RESERVED12_SFT 4
953 #define NQ_DBQ_EVENT_DB_DPI_MASK 0xfffffUL
954 #define NQ_DBQ_EVENT_DB_DPI_SFT 0
955 #define NQ_DBQ_EVENT_RESERVED12_2_MASK 0xfff00000UL
956 #define NQ_DBQ_EVENT_RESERVED12_2_SFT 20
958 #define NQ_DBQ_EVENT_V 0x1UL
959 #define NQ_DBQ_EVENT_RESERVED32_MASK 0xfffffffeUL
960 #define NQ_DBQ_EVENT_RESERVED32_SFT 1
961 __le32 db_type_db_xid
;
962 #define NQ_DBQ_EVENT_DB_XID_MASK 0xfffffUL
963 #define NQ_DBQ_EVENT_DB_XID_SFT 0
964 #define NQ_DBQ_EVENT_RESERVED8_MASK 0xff00000UL
965 #define NQ_DBQ_EVENT_RESERVED8_SFT 20
966 #define NQ_DBQ_EVENT_DB_TYPE_MASK 0xf0000000UL
967 #define NQ_DBQ_EVENT_DB_TYPE_SFT 28
970 /* Read Request/Response Queue Structures */
971 /* Input Read Request Queue (IRRQ) Message (32 bytes) */
974 #define XRRQ_IRRQ_TYPE 0x1UL
975 #define XRRQ_IRRQ_TYPE_READ_REQ 0x0UL
976 #define XRRQ_IRRQ_TYPE_ATOMIC_REQ 0x1UL
977 #define XRRQ_IRRQ_RESERVED10_MASK 0x7feUL
978 #define XRRQ_IRRQ_RESERVED10_SFT 1
979 #define XRRQ_IRRQ_CREDITS_MASK 0xf800UL
980 #define XRRQ_IRRQ_CREDITS_SFT 11
984 #define XRRQ_IRRQ_PSN_MASK 0xffffffUL
985 #define XRRQ_IRRQ_PSN_SFT 0
986 #define XRRQ_IRRQ_RESERVED8_1_MASK 0xff000000UL
987 #define XRRQ_IRRQ_RESERVED8_1_SFT 24
989 #define XRRQ_IRRQ_MSN_MASK 0xffffffUL
990 #define XRRQ_IRRQ_MSN_SFT 0
991 #define XRRQ_IRRQ_RESERVED8_2_MASK 0xff000000UL
992 #define XRRQ_IRRQ_RESERVED8_2_SFT 24
993 __le64 va_or_atomic_result
;
998 /* Output Read Request Queue (ORRQ) Message (32 bytes) */
1000 __le16 num_sges_type
;
1001 #define XRRQ_ORRQ_TYPE 0x1UL
1002 #define XRRQ_ORRQ_TYPE_READ_REQ 0x0UL
1003 #define XRRQ_ORRQ_TYPE_ATOMIC_REQ 0x1UL
1004 #define XRRQ_ORRQ_RESERVED10_MASK 0x7feUL
1005 #define XRRQ_ORRQ_RESERVED10_SFT 1
1006 #define XRRQ_ORRQ_NUM_SGES_MASK 0xf800UL
1007 #define XRRQ_ORRQ_NUM_SGES_SFT 11
1011 #define XRRQ_ORRQ_PSN_MASK 0xffffffUL
1012 #define XRRQ_ORRQ_PSN_SFT 0
1013 #define XRRQ_ORRQ_RESERVED8_1_MASK 0xff000000UL
1014 #define XRRQ_ORRQ_RESERVED8_1_SFT 24
1016 #define XRRQ_ORRQ_END_PSN_MASK 0xffffffUL
1017 #define XRRQ_ORRQ_END_PSN_SFT 0
1018 #define XRRQ_ORRQ_RESERVED8_2_MASK 0xff000000UL
1019 #define XRRQ_ORRQ_RESERVED8_2_SFT 24
1020 __le64 first_sge_phy_or_sing_sge_va
;
1021 __le32 single_sge_l_key
;
1022 __le32 single_sge_size
;
1025 /* Page Buffer List Memory Structures (PBL) */
1026 /* Page Table Entry (PTE) (8 bytes) */
1028 __le32 page_next_to_last_last_valid
[2];
1029 #define PTU_PTE_VALID 0x1UL
1030 #define PTU_PTE_LAST 0x2UL
1031 #define PTU_PTE_NEXT_TO_LAST 0x4UL
1032 #define PTU_PTE_PAGE_MASK 0xfffff000UL
1033 #define PTU_PTE_PAGE_SFT 12
1036 /* Page Directory Entry (PDE) (8 bytes) */
1038 __le32 page_valid
[2];
1039 #define PTU_PDE_VALID 0x1UL
1040 #define PTU_PDE_PAGE_MASK 0xfffff000UL
1041 #define PTU_PDE_PAGE_SFT 12
1044 /* RoCE Fastpath Host Structures */
1045 /* Command Queue (CMDQ) Interface */
1046 /* Init CMDQ (16 bytes) */
1049 __le16 cmdq_size_cmdq_lvl
;
1050 #define CMDQ_INIT_CMDQ_LVL_MASK 0x3UL
1051 #define CMDQ_INIT_CMDQ_LVL_SFT 0
1052 #define CMDQ_INIT_CMDQ_SIZE_MASK 0xfffcUL
1053 #define CMDQ_INIT_CMDQ_SIZE_SFT 2
1054 __le16 creq_ring_id
;
1058 /* Update CMDQ producer index (16 bytes) */
1059 struct cmdq_update
{
1065 /* CMDQ common header structure (16 bytes) */
1068 #define CMDQ_BASE_OPCODE_CREATE_QP 0x1UL
1069 #define CMDQ_BASE_OPCODE_DESTROY_QP 0x2UL
1070 #define CMDQ_BASE_OPCODE_MODIFY_QP 0x3UL
1071 #define CMDQ_BASE_OPCODE_QUERY_QP 0x4UL
1072 #define CMDQ_BASE_OPCODE_CREATE_SRQ 0x5UL
1073 #define CMDQ_BASE_OPCODE_DESTROY_SRQ 0x6UL
1074 #define CMDQ_BASE_OPCODE_QUERY_SRQ 0x8UL
1075 #define CMDQ_BASE_OPCODE_CREATE_CQ 0x9UL
1076 #define CMDQ_BASE_OPCODE_DESTROY_CQ 0xaUL
1077 #define CMDQ_BASE_OPCODE_RESIZE_CQ 0xcUL
1078 #define CMDQ_BASE_OPCODE_ALLOCATE_MRW 0xdUL
1079 #define CMDQ_BASE_OPCODE_DEALLOCATE_KEY 0xeUL
1080 #define CMDQ_BASE_OPCODE_REGISTER_MR 0xfUL
1081 #define CMDQ_BASE_OPCODE_DEREGISTER_MR 0x10UL
1082 #define CMDQ_BASE_OPCODE_ADD_GID 0x11UL
1083 #define CMDQ_BASE_OPCODE_DELETE_GID 0x12UL
1084 #define CMDQ_BASE_OPCODE_MODIFY_GID 0x17UL
1085 #define CMDQ_BASE_OPCODE_QUERY_GID 0x18UL
1086 #define CMDQ_BASE_OPCODE_CREATE_QP1 0x13UL
1087 #define CMDQ_BASE_OPCODE_DESTROY_QP1 0x14UL
1088 #define CMDQ_BASE_OPCODE_CREATE_AH 0x15UL
1089 #define CMDQ_BASE_OPCODE_DESTROY_AH 0x16UL
1090 #define CMDQ_BASE_OPCODE_INITIALIZE_FW 0x80UL
1091 #define CMDQ_BASE_OPCODE_DEINITIALIZE_FW 0x81UL
1092 #define CMDQ_BASE_OPCODE_STOP_FUNC 0x82UL
1093 #define CMDQ_BASE_OPCODE_QUERY_FUNC 0x83UL
1094 #define CMDQ_BASE_OPCODE_SET_FUNC_RESOURCES 0x84UL
1095 #define CMDQ_BASE_OPCODE_READ_CONTEXT 0x85UL
1096 #define CMDQ_BASE_OPCODE_VF_BACKCHANNEL_REQUEST 0x86UL
1097 #define CMDQ_BASE_OPCODE_READ_VF_MEMORY 0x87UL
1098 #define CMDQ_BASE_OPCODE_COMPLETE_VF_REQUEST 0x88UL
1099 #define CMDQ_BASE_OPCODE_EXTEND_CONTEXT_ARRRAY 0x89UL
1100 #define CMDQ_BASE_OPCODE_MAP_TC_TO_COS 0x8aUL
1101 #define CMDQ_BASE_OPCODE_QUERY_VERSION 0x8bUL
1102 #define CMDQ_BASE_OPCODE_MODIFY_CC 0x8cUL
1103 #define CMDQ_BASE_OPCODE_QUERY_CC 0x8dUL
1104 #define CMDQ_BASE_OPCODE_QUERY_ROCE_STATS 0x8eUL
1113 /* Create QP command (96 bytes) */
1114 struct cmdq_create_qp
{
1116 #define CMDQ_CREATE_QP_OPCODE_CREATE_QP 0x1UL
1125 #define CMDQ_CREATE_QP_QP_FLAGS_SRQ_USED 0x1UL
1126 #define CMDQ_CREATE_QP_QP_FLAGS_FORCE_COMPLETION 0x2UL
1127 #define CMDQ_CREATE_QP_QP_FLAGS_RESERVED_LKEY_ENABLE 0x4UL
1128 #define CMDQ_CREATE_QP_QP_FLAGS_FR_PMR_ENABLED 0x8UL
1129 #define CMDQ_CREATE_QP_QP_FLAGS_VARIABLE_SIZED_WQE_ENABLED 0x10UL
1131 #define CMDQ_CREATE_QP_TYPE_RC 0x2UL
1132 #define CMDQ_CREATE_QP_TYPE_UD 0x4UL
1133 #define CMDQ_CREATE_QP_TYPE_RAW_ETHERTYPE 0x6UL
1134 #define CMDQ_CREATE_QP_TYPE_GSI 0x7UL
1135 u8 sq_pg_size_sq_lvl
;
1136 #define CMDQ_CREATE_QP_SQ_LVL_MASK 0xfUL
1137 #define CMDQ_CREATE_QP_SQ_LVL_SFT 0
1138 #define CMDQ_CREATE_QP_SQ_LVL_LVL_0 0x0UL
1139 #define CMDQ_CREATE_QP_SQ_LVL_LVL_1 0x1UL
1140 #define CMDQ_CREATE_QP_SQ_LVL_LVL_2 0x2UL
1141 #define CMDQ_CREATE_QP_SQ_PG_SIZE_MASK 0xf0UL
1142 #define CMDQ_CREATE_QP_SQ_PG_SIZE_SFT 4
1143 #define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_4K (0x0UL << 4)
1144 #define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_8K (0x1UL << 4)
1145 #define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_64K (0x2UL << 4)
1146 #define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_2M (0x3UL << 4)
1147 #define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_8M (0x4UL << 4)
1148 #define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_1G (0x5UL << 4)
1149 u8 rq_pg_size_rq_lvl
;
1150 #define CMDQ_CREATE_QP_RQ_LVL_MASK 0xfUL
1151 #define CMDQ_CREATE_QP_RQ_LVL_SFT 0
1152 #define CMDQ_CREATE_QP_RQ_LVL_LVL_0 0x0UL
1153 #define CMDQ_CREATE_QP_RQ_LVL_LVL_1 0x1UL
1154 #define CMDQ_CREATE_QP_RQ_LVL_LVL_2 0x2UL
1155 #define CMDQ_CREATE_QP_RQ_PG_SIZE_MASK 0xf0UL
1156 #define CMDQ_CREATE_QP_RQ_PG_SIZE_SFT 4
1157 #define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_4K (0x0UL << 4)
1158 #define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_8K (0x1UL << 4)
1159 #define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_64K (0x2UL << 4)
1160 #define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_2M (0x3UL << 4)
1161 #define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_8M (0x4UL << 4)
1162 #define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_1G (0x5UL << 4)
1167 __le16 sq_fwo_sq_sge
;
1168 #define CMDQ_CREATE_QP_SQ_SGE_MASK 0xfUL
1169 #define CMDQ_CREATE_QP_SQ_SGE_SFT 0
1170 #define CMDQ_CREATE_QP_SQ_FWO_MASK 0xfff0UL
1171 #define CMDQ_CREATE_QP_SQ_FWO_SFT 4
1172 __le16 rq_fwo_rq_sge
;
1173 #define CMDQ_CREATE_QP_RQ_SGE_MASK 0xfUL
1174 #define CMDQ_CREATE_QP_RQ_SGE_SFT 0
1175 #define CMDQ_CREATE_QP_RQ_FWO_MASK 0xfff0UL
1176 #define CMDQ_CREATE_QP_RQ_FWO_SFT 4
1187 /* Destroy QP command (24 bytes) */
1188 struct cmdq_destroy_qp
{
1190 #define CMDQ_DESTROY_QP_OPCODE_DESTROY_QP 0x2UL
1201 /* Modify QP command (112 bytes) */
1202 struct cmdq_modify_qp
{
1204 #define CMDQ_MODIFY_QP_OPCODE_MODIFY_QP 0x3UL
1212 #define CMDQ_MODIFY_QP_MODIFY_MASK_STATE 0x1UL
1213 #define CMDQ_MODIFY_QP_MODIFY_MASK_EN_SQD_ASYNC_NOTIFY 0x2UL
1214 #define CMDQ_MODIFY_QP_MODIFY_MASK_ACCESS 0x4UL
1215 #define CMDQ_MODIFY_QP_MODIFY_MASK_PKEY 0x8UL
1216 #define CMDQ_MODIFY_QP_MODIFY_MASK_QKEY 0x10UL
1217 #define CMDQ_MODIFY_QP_MODIFY_MASK_DGID 0x20UL
1218 #define CMDQ_MODIFY_QP_MODIFY_MASK_FLOW_LABEL 0x40UL
1219 #define CMDQ_MODIFY_QP_MODIFY_MASK_SGID_INDEX 0x80UL
1220 #define CMDQ_MODIFY_QP_MODIFY_MASK_HOP_LIMIT 0x100UL
1221 #define CMDQ_MODIFY_QP_MODIFY_MASK_TRAFFIC_CLASS 0x200UL
1222 #define CMDQ_MODIFY_QP_MODIFY_MASK_DEST_MAC 0x400UL
1223 #define CMDQ_MODIFY_QP_MODIFY_MASK_PATH_MTU 0x1000UL
1224 #define CMDQ_MODIFY_QP_MODIFY_MASK_TIMEOUT 0x2000UL
1225 #define CMDQ_MODIFY_QP_MODIFY_MASK_RETRY_CNT 0x4000UL
1226 #define CMDQ_MODIFY_QP_MODIFY_MASK_RNR_RETRY 0x8000UL
1227 #define CMDQ_MODIFY_QP_MODIFY_MASK_RQ_PSN 0x10000UL
1228 #define CMDQ_MODIFY_QP_MODIFY_MASK_MAX_RD_ATOMIC 0x20000UL
1229 #define CMDQ_MODIFY_QP_MODIFY_MASK_MIN_RNR_TIMER 0x40000UL
1230 #define CMDQ_MODIFY_QP_MODIFY_MASK_SQ_PSN 0x80000UL
1231 #define CMDQ_MODIFY_QP_MODIFY_MASK_MAX_DEST_RD_ATOMIC 0x100000UL
1232 #define CMDQ_MODIFY_QP_MODIFY_MASK_SQ_SIZE 0x200000UL
1233 #define CMDQ_MODIFY_QP_MODIFY_MASK_RQ_SIZE 0x400000UL
1234 #define CMDQ_MODIFY_QP_MODIFY_MASK_SQ_SGE 0x800000UL
1235 #define CMDQ_MODIFY_QP_MODIFY_MASK_RQ_SGE 0x1000000UL
1236 #define CMDQ_MODIFY_QP_MODIFY_MASK_MAX_INLINE_DATA 0x2000000UL
1237 #define CMDQ_MODIFY_QP_MODIFY_MASK_DEST_QP_ID 0x4000000UL
1238 #define CMDQ_MODIFY_QP_MODIFY_MASK_SRC_MAC 0x8000000UL
1239 #define CMDQ_MODIFY_QP_MODIFY_MASK_VLAN_ID 0x10000000UL
1240 #define CMDQ_MODIFY_QP_MODIFY_MASK_ENABLE_CC 0x20000000UL
1241 #define CMDQ_MODIFY_QP_MODIFY_MASK_TOS_ECN 0x40000000UL
1242 #define CMDQ_MODIFY_QP_MODIFY_MASK_TOS_DSCP 0x80000000UL
1244 u8 network_type_en_sqd_async_notify_new_state
;
1245 #define CMDQ_MODIFY_QP_NEW_STATE_MASK 0xfUL
1246 #define CMDQ_MODIFY_QP_NEW_STATE_SFT 0
1247 #define CMDQ_MODIFY_QP_NEW_STATE_RESET 0x0UL
1248 #define CMDQ_MODIFY_QP_NEW_STATE_INIT 0x1UL
1249 #define CMDQ_MODIFY_QP_NEW_STATE_RTR 0x2UL
1250 #define CMDQ_MODIFY_QP_NEW_STATE_RTS 0x3UL
1251 #define CMDQ_MODIFY_QP_NEW_STATE_SQD 0x4UL
1252 #define CMDQ_MODIFY_QP_NEW_STATE_SQE 0x5UL
1253 #define CMDQ_MODIFY_QP_NEW_STATE_ERR 0x6UL
1254 #define CMDQ_MODIFY_QP_EN_SQD_ASYNC_NOTIFY 0x10UL
1255 #define CMDQ_MODIFY_QP_NETWORK_TYPE_MASK 0xc0UL
1256 #define CMDQ_MODIFY_QP_NETWORK_TYPE_SFT 6
1257 #define CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV1 (0x0UL << 6)
1258 #define CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV2_IPV4 (0x2UL << 6)
1259 #define CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV2_IPV6 (0x3UL << 6)
1261 #define CMDQ_MODIFY_QP_ACCESS_LOCAL_WRITE 0x1UL
1262 #define CMDQ_MODIFY_QP_ACCESS_REMOTE_WRITE 0x2UL
1263 #define CMDQ_MODIFY_QP_ACCESS_REMOTE_READ 0x4UL
1264 #define CMDQ_MODIFY_QP_ACCESS_REMOTE_ATOMIC 0x8UL
1273 u8 tos_dscp_tos_ecn
;
1274 #define CMDQ_MODIFY_QP_TOS_ECN_MASK 0x3UL
1275 #define CMDQ_MODIFY_QP_TOS_ECN_SFT 0
1276 #define CMDQ_MODIFY_QP_TOS_DSCP_MASK 0xfcUL
1277 #define CMDQ_MODIFY_QP_TOS_DSCP_SFT 2
1279 #define CMDQ_MODIFY_QP_PATH_MTU_MASK 0xf0UL
1280 #define CMDQ_MODIFY_QP_PATH_MTU_SFT 4
1281 #define CMDQ_MODIFY_QP_PATH_MTU_MTU_256 (0x0UL << 4)
1282 #define CMDQ_MODIFY_QP_PATH_MTU_MTU_512 (0x1UL << 4)
1283 #define CMDQ_MODIFY_QP_PATH_MTU_MTU_1024 (0x2UL << 4)
1284 #define CMDQ_MODIFY_QP_PATH_MTU_MTU_2048 (0x3UL << 4)
1285 #define CMDQ_MODIFY_QP_PATH_MTU_MTU_4096 (0x4UL << 4)
1286 #define CMDQ_MODIFY_QP_PATH_MTU_MTU_8192 (0x5UL << 4)
1294 u8 max_dest_rd_atomic
;
1296 #define CMDQ_MODIFY_QP_ENABLE_CC 0x1UL
1301 __le32 max_inline_data
;
1305 __le16 vlan_pcp_vlan_dei_vlan_id
;
1306 #define CMDQ_MODIFY_QP_VLAN_ID_MASK 0xfffUL
1307 #define CMDQ_MODIFY_QP_VLAN_ID_SFT 0
1308 #define CMDQ_MODIFY_QP_VLAN_DEI 0x1000UL
1309 #define CMDQ_MODIFY_QP_VLAN_PCP_MASK 0xe000UL
1310 #define CMDQ_MODIFY_QP_VLAN_PCP_SFT 13
1313 /* Query QP command (24 bytes) */
1314 struct cmdq_query_qp
{
1316 #define CMDQ_QUERY_QP_OPCODE_QUERY_QP 0x4UL
1327 /* Create SRQ command (48 bytes) */
1328 struct cmdq_create_srq
{
1330 #define CMDQ_CREATE_SRQ_OPCODE_CREATE_SRQ 0x5UL
1339 #define CMDQ_CREATE_SRQ_LVL_MASK 0x3UL
1340 #define CMDQ_CREATE_SRQ_LVL_SFT 0
1341 #define CMDQ_CREATE_SRQ_LVL_LVL_0 0x0UL
1342 #define CMDQ_CREATE_SRQ_LVL_LVL_1 0x1UL
1343 #define CMDQ_CREATE_SRQ_LVL_LVL_2 0x2UL
1344 #define CMDQ_CREATE_SRQ_PG_SIZE_MASK 0x1cUL
1345 #define CMDQ_CREATE_SRQ_PG_SIZE_SFT 2
1346 #define CMDQ_CREATE_SRQ_PG_SIZE_PG_4K (0x0UL << 2)
1347 #define CMDQ_CREATE_SRQ_PG_SIZE_PG_8K (0x1UL << 2)
1348 #define CMDQ_CREATE_SRQ_PG_SIZE_PG_64K (0x2UL << 2)
1349 #define CMDQ_CREATE_SRQ_PG_SIZE_PG_2M (0x3UL << 2)
1350 #define CMDQ_CREATE_SRQ_PG_SIZE_PG_8M (0x4UL << 2)
1351 #define CMDQ_CREATE_SRQ_PG_SIZE_PG_1G (0x5UL << 2)
1353 #define CMDQ_CREATE_SRQ_EVENTQ_ID_MASK 0xfffUL
1354 #define CMDQ_CREATE_SRQ_EVENTQ_ID_SFT 0
1362 /* Destroy SRQ command (24 bytes) */
1363 struct cmdq_destroy_srq
{
1365 #define CMDQ_DESTROY_SRQ_OPCODE_DESTROY_SRQ 0x6UL
1376 /* Query SRQ command (24 bytes) */
1377 struct cmdq_query_srq
{
1379 #define CMDQ_QUERY_SRQ_OPCODE_QUERY_SRQ 0x8UL
1390 /* Create CQ command (48 bytes) */
1391 struct cmdq_create_cq
{
1393 #define CMDQ_CREATE_CQ_OPCODE_CREATE_CQ 0x9UL
1402 #define CMDQ_CREATE_CQ_LVL_MASK 0x3UL
1403 #define CMDQ_CREATE_CQ_LVL_SFT 0
1404 #define CMDQ_CREATE_CQ_LVL_LVL_0 0x0UL
1405 #define CMDQ_CREATE_CQ_LVL_LVL_1 0x1UL
1406 #define CMDQ_CREATE_CQ_LVL_LVL_2 0x2UL
1407 #define CMDQ_CREATE_CQ_PG_SIZE_MASK 0x1cUL
1408 #define CMDQ_CREATE_CQ_PG_SIZE_SFT 2
1409 #define CMDQ_CREATE_CQ_PG_SIZE_PG_4K (0x0UL << 2)
1410 #define CMDQ_CREATE_CQ_PG_SIZE_PG_8K (0x1UL << 2)
1411 #define CMDQ_CREATE_CQ_PG_SIZE_PG_64K (0x2UL << 2)
1412 #define CMDQ_CREATE_CQ_PG_SIZE_PG_2M (0x3UL << 2)
1413 #define CMDQ_CREATE_CQ_PG_SIZE_PG_8M (0x4UL << 2)
1414 #define CMDQ_CREATE_CQ_PG_SIZE_PG_1G (0x5UL << 2)
1415 __le32 cq_fco_cnq_id
;
1416 #define CMDQ_CREATE_CQ_CNQ_ID_MASK 0xfffUL
1417 #define CMDQ_CREATE_CQ_CNQ_ID_SFT 0
1418 #define CMDQ_CREATE_CQ_CQ_FCO_MASK 0xfffff000UL
1419 #define CMDQ_CREATE_CQ_CQ_FCO_SFT 12
1425 /* Destroy CQ command (24 bytes) */
1426 struct cmdq_destroy_cq
{
1428 #define CMDQ_DESTROY_CQ_OPCODE_DESTROY_CQ 0xaUL
1439 /* Resize CQ command (40 bytes) */
1440 struct cmdq_resize_cq
{
1442 #define CMDQ_RESIZE_CQ_OPCODE_RESIZE_CQ 0xcUL
1450 __le32 new_cq_size_pg_size_lvl
;
1451 #define CMDQ_RESIZE_CQ_LVL_MASK 0x3UL
1452 #define CMDQ_RESIZE_CQ_LVL_SFT 0
1453 #define CMDQ_RESIZE_CQ_LVL_LVL_0 0x0UL
1454 #define CMDQ_RESIZE_CQ_LVL_LVL_1 0x1UL
1455 #define CMDQ_RESIZE_CQ_LVL_LVL_2 0x2UL
1456 #define CMDQ_RESIZE_CQ_PG_SIZE_MASK 0x1cUL
1457 #define CMDQ_RESIZE_CQ_PG_SIZE_SFT 2
1458 #define CMDQ_RESIZE_CQ_PG_SIZE_PG_4K (0x0UL << 2)
1459 #define CMDQ_RESIZE_CQ_PG_SIZE_PG_8K (0x1UL << 2)
1460 #define CMDQ_RESIZE_CQ_PG_SIZE_PG_64K (0x2UL << 2)
1461 #define CMDQ_RESIZE_CQ_PG_SIZE_PG_2M (0x3UL << 2)
1462 #define CMDQ_RESIZE_CQ_PG_SIZE_PG_8M (0x4UL << 2)
1463 #define CMDQ_RESIZE_CQ_PG_SIZE_PG_1G (0x5UL << 2)
1464 #define CMDQ_RESIZE_CQ_NEW_CQ_SIZE_MASK 0x1fffe0UL
1465 #define CMDQ_RESIZE_CQ_NEW_CQ_SIZE_SFT 5
1471 /* Allocate MRW command (32 bytes) */
1472 struct cmdq_allocate_mrw
{
1474 #define CMDQ_ALLOCATE_MRW_OPCODE_ALLOCATE_MRW 0xdUL
1483 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MASK 0xfUL
1484 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_SFT 0
1485 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MR 0x0UL
1486 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_PMR 0x1UL
1487 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1 0x2UL
1488 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A 0x3UL
1489 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B 0x4UL
1491 #define CMDQ_ALLOCATE_MRW_ACCESS_RESERVED_MASK 0x1fUL
1492 #define CMDQ_ALLOCATE_MRW_ACCESS_RESERVED_SFT 0
1493 #define CMDQ_ALLOCATE_MRW_ACCESS_CONSUMER_OWNED_KEY 0x20UL
1498 /* De-allocate key command (24 bytes) */
1499 struct cmdq_deallocate_key
{
1501 #define CMDQ_DEALLOCATE_KEY_OPCODE_DEALLOCATE_KEY 0xeUL
1509 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MASK 0xfUL
1510 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_SFT 0
1511 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MR 0x0UL
1512 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_PMR 0x1UL
1513 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE1 0x2UL
1514 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE2A 0x3UL
1515 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE2B 0x4UL
1520 /* Register MR command (48 bytes) */
1521 struct cmdq_register_mr
{
1523 #define CMDQ_REGISTER_MR_OPCODE_REGISTER_MR 0xfUL
1530 u8 log2_pg_size_lvl
;
1531 #define CMDQ_REGISTER_MR_LVL_MASK 0x3UL
1532 #define CMDQ_REGISTER_MR_LVL_SFT 0
1533 #define CMDQ_REGISTER_MR_LVL_LVL_0 0x0UL
1534 #define CMDQ_REGISTER_MR_LVL_LVL_1 0x1UL
1535 #define CMDQ_REGISTER_MR_LVL_LVL_2 0x2UL
1536 #define CMDQ_REGISTER_MR_LVL_LAST CMDQ_REGISTER_MR_LVL_LVL_2
1537 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_MASK 0x7cUL
1538 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_SFT 2
1539 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_4K (0xcUL << 2)
1540 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_8K (0xdUL << 2)
1541 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_64K (0x10UL << 2)
1542 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_256K (0x12UL << 2)
1543 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_1M (0x14UL << 2)
1544 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_2M (0x15UL << 2)
1545 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_4M (0x16UL << 2)
1546 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_1G (0x1eUL << 2)
1547 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_LAST \
1548 CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_1G
1549 #define CMDQ_REGISTER_MR_UNUSED1 0x80UL
1551 #define CMDQ_REGISTER_MR_ACCESS_LOCAL_WRITE 0x1UL
1552 #define CMDQ_REGISTER_MR_ACCESS_REMOTE_READ 0x2UL
1553 #define CMDQ_REGISTER_MR_ACCESS_REMOTE_WRITE 0x4UL
1554 #define CMDQ_REGISTER_MR_ACCESS_REMOTE_ATOMIC 0x8UL
1555 #define CMDQ_REGISTER_MR_ACCESS_MW_BIND 0x10UL
1556 #define CMDQ_REGISTER_MR_ACCESS_ZERO_BASED 0x20UL
1557 __le16 log2_pbl_pg_size
;
1558 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_MASK 0x1fUL
1559 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_SFT 0
1560 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_4K 0xcUL
1561 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_8K 0xdUL
1562 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_64K 0x10UL
1563 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_256K 0x12UL
1564 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_1M 0x14UL
1565 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_2M 0x15UL
1566 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_4M 0x16UL
1567 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_1G 0x1eUL
1568 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_LAST \
1569 CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_1G
1570 #define CMDQ_REGISTER_MR_UNUSED11_MASK 0xffe0UL
1571 #define CMDQ_REGISTER_MR_UNUSED11_SFT 5
1578 /* Deregister MR command (24 bytes) */
1579 struct cmdq_deregister_mr
{
1581 #define CMDQ_DEREGISTER_MR_OPCODE_DEREGISTER_MR 0x10UL
1592 /* Add GID command (48 bytes) */
1593 struct cmdq_add_gid
{
1595 #define CMDQ_ADD_GID_OPCODE_ADD_GID 0x11UL
1605 #define CMDQ_ADD_GID_VLAN_VLAN_ID_MASK 0xfffUL
1606 #define CMDQ_ADD_GID_VLAN_VLAN_ID_SFT 0
1607 #define CMDQ_ADD_GID_VLAN_TPID_MASK 0x7000UL
1608 #define CMDQ_ADD_GID_VLAN_TPID_SFT 12
1609 #define CMDQ_ADD_GID_VLAN_TPID_TPID_88A8 (0x0UL << 12)
1610 #define CMDQ_ADD_GID_VLAN_TPID_TPID_8100 (0x1UL << 12)
1611 #define CMDQ_ADD_GID_VLAN_TPID_TPID_9100 (0x2UL << 12)
1612 #define CMDQ_ADD_GID_VLAN_TPID_TPID_9200 (0x3UL << 12)
1613 #define CMDQ_ADD_GID_VLAN_TPID_TPID_9300 (0x4UL << 12)
1614 #define CMDQ_ADD_GID_VLAN_TPID_TPID_CFG1 (0x5UL << 12)
1615 #define CMDQ_ADD_GID_VLAN_TPID_TPID_CFG2 (0x6UL << 12)
1616 #define CMDQ_ADD_GID_VLAN_TPID_TPID_CFG3 (0x7UL << 12)
1617 #define CMDQ_ADD_GID_VLAN_TPID_LAST CMDQ_ADD_GID_VLAN_TPID_TPID_CFG3
1618 #define CMDQ_ADD_GID_VLAN_VLAN_EN 0x8000UL
1621 #define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_ID_MASK 0x7fffUL
1622 #define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_ID_SFT 0
1623 #define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_VALID 0x8000UL
1627 /* Delete GID command (24 bytes) */
1628 struct cmdq_delete_gid
{
1630 #define CMDQ_DELETE_GID_OPCODE_DELETE_GID 0x12UL
1642 /* Modify GID command (48 bytes) */
1643 struct cmdq_modify_gid
{
1645 #define CMDQ_MODIFY_GID_OPCODE_MODIFY_GID 0x17UL
1655 #define CMDQ_MODIFY_GID_VLAN_VLAN_ID_MASK 0xfffUL
1656 #define CMDQ_MODIFY_GID_VLAN_VLAN_ID_SFT 0
1657 #define CMDQ_MODIFY_GID_VLAN_TPID_MASK 0x7000UL
1658 #define CMDQ_MODIFY_GID_VLAN_TPID_SFT 12
1659 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_88A8 (0x0UL << 12)
1660 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_8100 (0x1UL << 12)
1661 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_9100 (0x2UL << 12)
1662 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_9200 (0x3UL << 12)
1663 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_9300 (0x4UL << 12)
1664 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG1 (0x5UL << 12)
1665 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG2 (0x6UL << 12)
1666 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG3 (0x7UL << 12)
1667 #define CMDQ_MODIFY_GID_VLAN_TPID_LAST \
1668 CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG3
1669 #define CMDQ_MODIFY_GID_VLAN_VLAN_EN 0x8000UL
1673 #define CMDQ_MODIFY_GID_STATS_CTX_STATS_CTX_ID_MASK 0x7fffUL
1674 #define CMDQ_MODIFY_GID_STATS_CTX_STATS_CTX_ID_SFT 0
1675 #define CMDQ_MODIFY_GID_STATS_CTX_STATS_CTX_VALID 0x8000UL
1679 /* Query GID command (24 bytes) */
1680 struct cmdq_query_gid
{
1682 #define CMDQ_QUERY_GID_OPCODE_QUERY_GID 0x18UL
1694 /* Create QP1 command (80 bytes) */
1695 struct cmdq_create_qp1
{
1697 #define CMDQ_CREATE_QP1_OPCODE_CREATE_QP1 0x13UL
1706 #define CMDQ_CREATE_QP1_QP_FLAGS_SRQ_USED 0x1UL
1707 #define CMDQ_CREATE_QP1_QP_FLAGS_FORCE_COMPLETION 0x2UL
1708 #define CMDQ_CREATE_QP1_QP_FLAGS_RESERVED_LKEY_ENABLE 0x4UL
1710 #define CMDQ_CREATE_QP1_TYPE_GSI 0x1UL
1711 u8 sq_pg_size_sq_lvl
;
1712 #define CMDQ_CREATE_QP1_SQ_LVL_MASK 0xfUL
1713 #define CMDQ_CREATE_QP1_SQ_LVL_SFT 0
1714 #define CMDQ_CREATE_QP1_SQ_LVL_LVL_0 0x0UL
1715 #define CMDQ_CREATE_QP1_SQ_LVL_LVL_1 0x1UL
1716 #define CMDQ_CREATE_QP1_SQ_LVL_LVL_2 0x2UL
1717 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_MASK 0xf0UL
1718 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_SFT 4
1719 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_4K (0x0UL << 4)
1720 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_8K (0x1UL << 4)
1721 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_64K (0x2UL << 4)
1722 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_2M (0x3UL << 4)
1723 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_8M (0x4UL << 4)
1724 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_1G (0x5UL << 4)
1725 u8 rq_pg_size_rq_lvl
;
1726 #define CMDQ_CREATE_QP1_RQ_LVL_MASK 0xfUL
1727 #define CMDQ_CREATE_QP1_RQ_LVL_SFT 0
1728 #define CMDQ_CREATE_QP1_RQ_LVL_LVL_0 0x0UL
1729 #define CMDQ_CREATE_QP1_RQ_LVL_LVL_1 0x1UL
1730 #define CMDQ_CREATE_QP1_RQ_LVL_LVL_2 0x2UL
1731 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_MASK 0xf0UL
1732 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_SFT 4
1733 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_4K (0x0UL << 4)
1734 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_8K (0x1UL << 4)
1735 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_64K (0x2UL << 4)
1736 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_2M (0x3UL << 4)
1737 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_8M (0x4UL << 4)
1738 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_1G (0x5UL << 4)
1743 __le16 sq_fwo_sq_sge
;
1744 #define CMDQ_CREATE_QP1_SQ_SGE_MASK 0xfUL
1745 #define CMDQ_CREATE_QP1_SQ_SGE_SFT 0
1746 #define CMDQ_CREATE_QP1_SQ_FWO_MASK 0xfff0UL
1747 #define CMDQ_CREATE_QP1_SQ_FWO_SFT 4
1748 __le16 rq_fwo_rq_sge
;
1749 #define CMDQ_CREATE_QP1_RQ_SGE_MASK 0xfUL
1750 #define CMDQ_CREATE_QP1_RQ_SGE_SFT 0
1751 #define CMDQ_CREATE_QP1_RQ_FWO_MASK 0xfff0UL
1752 #define CMDQ_CREATE_QP1_RQ_FWO_SFT 4
1761 /* Destroy QP1 command (24 bytes) */
1762 struct cmdq_destroy_qp1
{
1764 #define CMDQ_DESTROY_QP1_OPCODE_DESTROY_QP1 0x14UL
1775 /* Create AH command (64 bytes) */
1776 struct cmdq_create_ah
{
1778 #define CMDQ_CREATE_AH_OPCODE_CREATE_AH 0x15UL
1788 #define CMDQ_CREATE_AH_TYPE_V1 0x0UL
1789 #define CMDQ_CREATE_AH_TYPE_V2IPV4 0x2UL
1790 #define CMDQ_CREATE_AH_TYPE_V2IPV6 0x3UL
1793 __le32 dest_vlan_id_flow_label
;
1794 #define CMDQ_CREATE_AH_FLOW_LABEL_MASK 0xfffffUL
1795 #define CMDQ_CREATE_AH_FLOW_LABEL_SFT 0
1796 #define CMDQ_CREATE_AH_DEST_VLAN_ID_MASK 0xfff00000UL
1797 #define CMDQ_CREATE_AH_DEST_VLAN_ID_SFT 20
1805 /* Destroy AH command (24 bytes) */
1806 struct cmdq_destroy_ah
{
1808 #define CMDQ_DESTROY_AH_OPCODE_DESTROY_AH 0x16UL
1819 /* Initialize Firmware command (112 bytes) */
1820 struct cmdq_initialize_fw
{
1822 #define CMDQ_INITIALIZE_FW_OPCODE_INITIALIZE_FW 0x80UL
1829 u8 qpc_pg_size_qpc_lvl
;
1830 #define CMDQ_INITIALIZE_FW_QPC_LVL_MASK 0xfUL
1831 #define CMDQ_INITIALIZE_FW_QPC_LVL_SFT 0
1832 #define CMDQ_INITIALIZE_FW_QPC_LVL_LVL_0 0x0UL
1833 #define CMDQ_INITIALIZE_FW_QPC_LVL_LVL_1 0x1UL
1834 #define CMDQ_INITIALIZE_FW_QPC_LVL_LVL_2 0x2UL
1835 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_MASK 0xf0UL
1836 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_SFT 4
1837 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_4K (0x0UL << 4)
1838 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_8K (0x1UL << 4)
1839 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_64K (0x2UL << 4)
1840 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_2M (0x3UL << 4)
1841 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_8M (0x4UL << 4)
1842 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_1G (0x5UL << 4)
1843 u8 mrw_pg_size_mrw_lvl
;
1844 #define CMDQ_INITIALIZE_FW_MRW_LVL_MASK 0xfUL
1845 #define CMDQ_INITIALIZE_FW_MRW_LVL_SFT 0
1846 #define CMDQ_INITIALIZE_FW_MRW_LVL_LVL_0 0x0UL
1847 #define CMDQ_INITIALIZE_FW_MRW_LVL_LVL_1 0x1UL
1848 #define CMDQ_INITIALIZE_FW_MRW_LVL_LVL_2 0x2UL
1849 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_MASK 0xf0UL
1850 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_SFT 4
1851 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_4K (0x0UL << 4)
1852 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_8K (0x1UL << 4)
1853 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_64K (0x2UL << 4)
1854 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_2M (0x3UL << 4)
1855 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_8M (0x4UL << 4)
1856 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_1G (0x5UL << 4)
1857 u8 srq_pg_size_srq_lvl
;
1858 #define CMDQ_INITIALIZE_FW_SRQ_LVL_MASK 0xfUL
1859 #define CMDQ_INITIALIZE_FW_SRQ_LVL_SFT 0
1860 #define CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_0 0x0UL
1861 #define CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_1 0x1UL
1862 #define CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_2 0x2UL
1863 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_MASK 0xf0UL
1864 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_SFT 4
1865 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_4K (0x0UL << 4)
1866 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_8K (0x1UL << 4)
1867 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_64K (0x2UL << 4)
1868 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_2M (0x3UL << 4)
1869 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_8M (0x4UL << 4)
1870 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_1G (0x5UL << 4)
1871 u8 cq_pg_size_cq_lvl
;
1872 #define CMDQ_INITIALIZE_FW_CQ_LVL_MASK 0xfUL
1873 #define CMDQ_INITIALIZE_FW_CQ_LVL_SFT 0
1874 #define CMDQ_INITIALIZE_FW_CQ_LVL_LVL_0 0x0UL
1875 #define CMDQ_INITIALIZE_FW_CQ_LVL_LVL_1 0x1UL
1876 #define CMDQ_INITIALIZE_FW_CQ_LVL_LVL_2 0x2UL
1877 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_MASK 0xf0UL
1878 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_SFT 4
1879 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_4K (0x0UL << 4)
1880 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_8K (0x1UL << 4)
1881 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_64K (0x2UL << 4)
1882 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_2M (0x3UL << 4)
1883 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_8M (0x4UL << 4)
1884 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_1G (0x5UL << 4)
1885 u8 tqm_pg_size_tqm_lvl
;
1886 #define CMDQ_INITIALIZE_FW_TQM_LVL_MASK 0xfUL
1887 #define CMDQ_INITIALIZE_FW_TQM_LVL_SFT 0
1888 #define CMDQ_INITIALIZE_FW_TQM_LVL_LVL_0 0x0UL
1889 #define CMDQ_INITIALIZE_FW_TQM_LVL_LVL_1 0x1UL
1890 #define CMDQ_INITIALIZE_FW_TQM_LVL_LVL_2 0x2UL
1891 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_MASK 0xf0UL
1892 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_SFT 4
1893 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_4K (0x0UL << 4)
1894 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_8K (0x1UL << 4)
1895 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_64K (0x2UL << 4)
1896 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_2M (0x3UL << 4)
1897 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_8M (0x4UL << 4)
1898 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_1G (0x5UL << 4)
1899 u8 tim_pg_size_tim_lvl
;
1900 #define CMDQ_INITIALIZE_FW_TIM_LVL_MASK 0xfUL
1901 #define CMDQ_INITIALIZE_FW_TIM_LVL_SFT 0
1902 #define CMDQ_INITIALIZE_FW_TIM_LVL_LVL_0 0x0UL
1903 #define CMDQ_INITIALIZE_FW_TIM_LVL_LVL_1 0x1UL
1904 #define CMDQ_INITIALIZE_FW_TIM_LVL_LVL_2 0x2UL
1905 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_MASK 0xf0UL
1906 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_SFT 4
1907 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_4K (0x0UL << 4)
1908 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_8K (0x1UL << 4)
1909 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_64K (0x2UL << 4)
1910 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_2M (0x3UL << 4)
1911 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_8M (0x4UL << 4)
1912 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_1G (0x5UL << 4)
1913 /* This value is (log-base-2-of-DBR-page-size - 12).
1914 * 0 for 4KB. HW supported values are enumerated below.
1916 __le16 log2_dbr_pg_size
;
1917 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_MASK 0xfUL
1918 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_SFT 0
1919 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_4K 0x0UL
1920 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_8K 0x1UL
1921 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_16K 0x2UL
1922 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_32K 0x3UL
1923 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_64K 0x4UL
1924 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_128K 0x5UL
1925 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_256K 0x6UL
1926 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_512K 0x7UL
1927 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_1M 0x8UL
1928 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_2M 0x9UL
1929 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_4M 0xaUL
1930 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_8M 0xbUL
1931 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_16M 0xcUL
1932 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_32M 0xdUL
1933 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_64M 0xeUL
1934 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_128M 0xfUL
1935 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_LAST \
1936 CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_128M
1937 __le64 qpc_page_dir
;
1938 __le64 mrw_page_dir
;
1939 __le64 srq_page_dir
;
1941 __le64 tqm_page_dir
;
1942 __le64 tim_page_dir
;
1943 __le32 number_of_qp
;
1944 __le32 number_of_mrw
;
1945 __le32 number_of_srq
;
1946 __le32 number_of_cq
;
1947 __le32 max_qp_per_vf
;
1948 __le32 max_mrw_per_vf
;
1949 __le32 max_srq_per_vf
;
1950 __le32 max_cq_per_vf
;
1951 __le32 max_gid_per_vf
;
1955 /* De-initialize Firmware command (16 bytes) */
1956 struct cmdq_deinitialize_fw
{
1958 #define CMDQ_DEINITIALIZE_FW_OPCODE_DEINITIALIZE_FW 0x81UL
1967 /* Stop function command (16 bytes) */
1968 struct cmdq_stop_func
{
1970 #define CMDQ_STOP_FUNC_OPCODE_STOP_FUNC 0x82UL
1979 /* Query function command (16 bytes) */
1980 struct cmdq_query_func
{
1982 #define CMDQ_QUERY_FUNC_OPCODE_QUERY_FUNC 0x83UL
1991 /* Set function resources command (16 bytes) */
1992 struct cmdq_set_func_resources
{
1994 #define CMDQ_SET_FUNC_RESOURCES_OPCODE_SET_FUNC_RESOURCES 0x84UL
2001 __le32 number_of_qp
;
2002 __le32 number_of_mrw
;
2003 __le32 number_of_srq
;
2004 __le32 number_of_cq
;
2005 __le32 max_qp_per_vf
;
2006 __le32 max_mrw_per_vf
;
2007 __le32 max_srq_per_vf
;
2008 __le32 max_cq_per_vf
;
2009 __le32 max_gid_per_vf
;
2013 /* Read hardware resource context command (24 bytes) */
2014 struct cmdq_read_context
{
2016 #define CMDQ_READ_CONTEXT_OPCODE_READ_CONTEXT 0x85UL
2024 #define CMDQ_READ_CONTEXT_XID_MASK 0xffffffUL
2025 #define CMDQ_READ_CONTEXT_XID_SFT 0
2026 #define CMDQ_READ_CONTEXT_TYPE_MASK 0xff000000UL
2027 #define CMDQ_READ_CONTEXT_TYPE_SFT 24
2028 #define CMDQ_READ_CONTEXT_TYPE_QPC (0x0UL << 24)
2029 #define CMDQ_READ_CONTEXT_TYPE_CQ (0x1UL << 24)
2030 #define CMDQ_READ_CONTEXT_TYPE_MRW (0x2UL << 24)
2031 #define CMDQ_READ_CONTEXT_TYPE_SRQ (0x3UL << 24)
2035 /* Map TC to COS. Can only be issued from a PF (24 bytes) */
2036 struct cmdq_map_tc_to_cos
{
2038 #define CMDQ_MAP_TC_TO_COS_OPCODE_MAP_TC_TO_COS 0x8aUL
2046 #define CMDQ_MAP_TC_TO_COS_COS0_NO_CHANGE 0xffffUL
2048 #define CMDQ_MAP_TC_TO_COS_COS1_DISABLE 0x8000UL
2049 #define CMDQ_MAP_TC_TO_COS_COS1_NO_CHANGE 0xffffUL
2053 /* Query version command (16 bytes) */
2054 struct cmdq_query_version
{
2056 #define CMDQ_QUERY_VERSION_OPCODE_QUERY_VERSION 0x8bUL
2065 /* Command-Response Event Queue (CREQ) Structures */
2066 /* Base CREQ Record (16 bytes) */
2069 #define CREQ_BASE_TYPE_MASK 0x3fUL
2070 #define CREQ_BASE_TYPE_SFT 0
2071 #define CREQ_BASE_TYPE_QP_EVENT 0x38UL
2072 #define CREQ_BASE_TYPE_FUNC_EVENT 0x3aUL
2073 #define CREQ_BASE_RESERVED2_MASK 0xc0UL
2074 #define CREQ_BASE_RESERVED2_SFT 6
2077 #define CREQ_BASE_V 0x1UL
2078 #define CREQ_BASE_RESERVED7_MASK 0xfeUL
2079 #define CREQ_BASE_RESERVED7_SFT 1
2081 __le16 reserved48
[3];
2084 /* RoCE Function Async Event Notification (16 bytes) */
2085 struct creq_func_event
{
2087 #define CREQ_FUNC_EVENT_TYPE_MASK 0x3fUL
2088 #define CREQ_FUNC_EVENT_TYPE_SFT 0
2089 #define CREQ_FUNC_EVENT_TYPE_FUNC_EVENT 0x3aUL
2090 #define CREQ_FUNC_EVENT_RESERVED2_MASK 0xc0UL
2091 #define CREQ_FUNC_EVENT_RESERVED2_SFT 6
2094 #define CREQ_FUNC_EVENT_V 0x1UL
2095 #define CREQ_FUNC_EVENT_RESERVED7_MASK 0xfeUL
2096 #define CREQ_FUNC_EVENT_RESERVED7_SFT 1
2098 #define CREQ_FUNC_EVENT_EVENT_TX_WQE_ERROR 0x1UL
2099 #define CREQ_FUNC_EVENT_EVENT_TX_DATA_ERROR 0x2UL
2100 #define CREQ_FUNC_EVENT_EVENT_RX_WQE_ERROR 0x3UL
2101 #define CREQ_FUNC_EVENT_EVENT_RX_DATA_ERROR 0x4UL
2102 #define CREQ_FUNC_EVENT_EVENT_CQ_ERROR 0x5UL
2103 #define CREQ_FUNC_EVENT_EVENT_TQM_ERROR 0x6UL
2104 #define CREQ_FUNC_EVENT_EVENT_CFCQ_ERROR 0x7UL
2105 #define CREQ_FUNC_EVENT_EVENT_CFCS_ERROR 0x8UL
2106 #define CREQ_FUNC_EVENT_EVENT_CFCC_ERROR 0x9UL
2107 #define CREQ_FUNC_EVENT_EVENT_CFCM_ERROR 0xaUL
2108 #define CREQ_FUNC_EVENT_EVENT_TIM_ERROR 0xbUL
2109 #define CREQ_FUNC_EVENT_EVENT_VF_COMM_REQUEST 0x80UL
2110 #define CREQ_FUNC_EVENT_EVENT_RESOURCE_EXHAUSTED 0x81UL
2111 __le16 reserved48
[3];
2114 /* RoCE Slowpath Command Completion (16 bytes) */
2115 struct creq_qp_event
{
2117 #define CREQ_QP_EVENT_TYPE_MASK 0x3fUL
2118 #define CREQ_QP_EVENT_TYPE_SFT 0
2119 #define CREQ_QP_EVENT_TYPE_QP_EVENT 0x38UL
2120 #define CREQ_QP_EVENT_RESERVED2_MASK 0xc0UL
2121 #define CREQ_QP_EVENT_RESERVED2_SFT 6
2126 #define CREQ_QP_EVENT_V 0x1UL
2127 #define CREQ_QP_EVENT_RESERVED7_MASK 0xfeUL
2128 #define CREQ_QP_EVENT_RESERVED7_SFT 1
2130 #define CREQ_QP_EVENT_EVENT_CREATE_QP 0x1UL
2131 #define CREQ_QP_EVENT_EVENT_DESTROY_QP 0x2UL
2132 #define CREQ_QP_EVENT_EVENT_MODIFY_QP 0x3UL
2133 #define CREQ_QP_EVENT_EVENT_QUERY_QP 0x4UL
2134 #define CREQ_QP_EVENT_EVENT_CREATE_SRQ 0x5UL
2135 #define CREQ_QP_EVENT_EVENT_DESTROY_SRQ 0x6UL
2136 #define CREQ_QP_EVENT_EVENT_QUERY_SRQ 0x8UL
2137 #define CREQ_QP_EVENT_EVENT_CREATE_CQ 0x9UL
2138 #define CREQ_QP_EVENT_EVENT_DESTROY_CQ 0xaUL
2139 #define CREQ_QP_EVENT_EVENT_RESIZE_CQ 0xcUL
2140 #define CREQ_QP_EVENT_EVENT_ALLOCATE_MRW 0xdUL
2141 #define CREQ_QP_EVENT_EVENT_DEALLOCATE_KEY 0xeUL
2142 #define CREQ_QP_EVENT_EVENT_REGISTER_MR 0xfUL
2143 #define CREQ_QP_EVENT_EVENT_DEREGISTER_MR 0x10UL
2144 #define CREQ_QP_EVENT_EVENT_ADD_GID 0x11UL
2145 #define CREQ_QP_EVENT_EVENT_DELETE_GID 0x12UL
2146 #define CREQ_QP_EVENT_EVENT_MODIFY_GID 0x17UL
2147 #define CREQ_QP_EVENT_EVENT_QUERY_GID 0x18UL
2148 #define CREQ_QP_EVENT_EVENT_CREATE_QP1 0x13UL
2149 #define CREQ_QP_EVENT_EVENT_DESTROY_QP1 0x14UL
2150 #define CREQ_QP_EVENT_EVENT_CREATE_AH 0x15UL
2151 #define CREQ_QP_EVENT_EVENT_DESTROY_AH 0x16UL
2152 #define CREQ_QP_EVENT_EVENT_INITIALIZE_FW 0x80UL
2153 #define CREQ_QP_EVENT_EVENT_DEINITIALIZE_FW 0x81UL
2154 #define CREQ_QP_EVENT_EVENT_STOP_FUNC 0x82UL
2155 #define CREQ_QP_EVENT_EVENT_QUERY_FUNC 0x83UL
2156 #define CREQ_QP_EVENT_EVENT_SET_FUNC_RESOURCES 0x84UL
2157 #define CREQ_QP_EVENT_EVENT_MAP_TC_TO_COS 0x8aUL
2158 #define CREQ_QP_EVENT_EVENT_QUERY_VERSION 0x8bUL
2159 #define CREQ_QP_EVENT_EVENT_MODIFY_CC 0x8cUL
2160 #define CREQ_QP_EVENT_EVENT_QUERY_CC 0x8dUL
2161 #define CREQ_QP_EVENT_EVENT_QP_ERROR_NOTIFICATION 0xc0UL
2162 __le16 reserved48
[3];
2165 /* Create QP command response (16 bytes) */
2166 struct creq_create_qp_resp
{
2168 #define CREQ_CREATE_QP_RESP_TYPE_MASK 0x3fUL
2169 #define CREQ_CREATE_QP_RESP_TYPE_SFT 0
2170 #define CREQ_CREATE_QP_RESP_TYPE_QP_EVENT 0x38UL
2171 #define CREQ_CREATE_QP_RESP_RESERVED2_MASK 0xc0UL
2172 #define CREQ_CREATE_QP_RESP_RESERVED2_SFT 6
2177 #define CREQ_CREATE_QP_RESP_V 0x1UL
2178 #define CREQ_CREATE_QP_RESP_RESERVED7_MASK 0xfeUL
2179 #define CREQ_CREATE_QP_RESP_RESERVED7_SFT 1
2181 #define CREQ_CREATE_QP_RESP_EVENT_CREATE_QP 0x1UL
2182 __le16 reserved48
[3];
2185 /* Destroy QP command response (16 bytes) */
2186 struct creq_destroy_qp_resp
{
2188 #define CREQ_DESTROY_QP_RESP_TYPE_MASK 0x3fUL
2189 #define CREQ_DESTROY_QP_RESP_TYPE_SFT 0
2190 #define CREQ_DESTROY_QP_RESP_TYPE_QP_EVENT 0x38UL
2191 #define CREQ_DESTROY_QP_RESP_RESERVED2_MASK 0xc0UL
2192 #define CREQ_DESTROY_QP_RESP_RESERVED2_SFT 6
2197 #define CREQ_DESTROY_QP_RESP_V 0x1UL
2198 #define CREQ_DESTROY_QP_RESP_RESERVED7_MASK 0xfeUL
2199 #define CREQ_DESTROY_QP_RESP_RESERVED7_SFT 1
2201 #define CREQ_DESTROY_QP_RESP_EVENT_DESTROY_QP 0x2UL
2202 __le16 reserved48
[3];
2205 /* Modify QP command response (16 bytes) */
2206 struct creq_modify_qp_resp
{
2208 #define CREQ_MODIFY_QP_RESP_TYPE_MASK 0x3fUL
2209 #define CREQ_MODIFY_QP_RESP_TYPE_SFT 0
2210 #define CREQ_MODIFY_QP_RESP_TYPE_QP_EVENT 0x38UL
2211 #define CREQ_MODIFY_QP_RESP_RESERVED2_MASK 0xc0UL
2212 #define CREQ_MODIFY_QP_RESP_RESERVED2_SFT 6
2217 #define CREQ_MODIFY_QP_RESP_V 0x1UL
2218 #define CREQ_MODIFY_QP_RESP_RESERVED7_MASK 0xfeUL
2219 #define CREQ_MODIFY_QP_RESP_RESERVED7_SFT 1
2221 #define CREQ_MODIFY_QP_RESP_EVENT_MODIFY_QP 0x3UL
2222 __le16 reserved48
[3];
2225 /* cmdq_query_roce_stats (size:128b/16B) */
2226 struct cmdq_query_roce_stats
{
2228 #define CMDQ_QUERY_ROCE_STATS_OPCODE_QUERY_ROCE_STATS 0x8eUL
2229 #define CMDQ_QUERY_ROCE_STATS_OPCODE_LAST \
2230 CMDQ_QUERY_ROCE_STATS_OPCODE_QUERY_ROCE_STATS
2239 /* Query QP command response (16 bytes) */
2240 struct creq_query_qp_resp
{
2242 #define CREQ_QUERY_QP_RESP_TYPE_MASK 0x3fUL
2243 #define CREQ_QUERY_QP_RESP_TYPE_SFT 0
2244 #define CREQ_QUERY_QP_RESP_TYPE_QP_EVENT 0x38UL
2245 #define CREQ_QUERY_QP_RESP_RESERVED2_MASK 0xc0UL
2246 #define CREQ_QUERY_QP_RESP_RESERVED2_SFT 6
2251 #define CREQ_QUERY_QP_RESP_V 0x1UL
2252 #define CREQ_QUERY_QP_RESP_RESERVED7_MASK 0xfeUL
2253 #define CREQ_QUERY_QP_RESP_RESERVED7_SFT 1
2255 #define CREQ_QUERY_QP_RESP_EVENT_QUERY_QP 0x4UL
2256 __le16 reserved48
[3];
2259 /* Query QP command response side buffer structure (104 bytes) */
2260 struct creq_query_qp_resp_sb
{
2262 #define CREQ_QUERY_QP_RESP_SB_OPCODE_QUERY_QP 0x4UL
2269 u8 en_sqd_async_notify_state
;
2270 #define CREQ_QUERY_QP_RESP_SB_STATE_MASK 0xfUL
2271 #define CREQ_QUERY_QP_RESP_SB_STATE_SFT 0
2272 #define CREQ_QUERY_QP_RESP_SB_STATE_RESET 0x0UL
2273 #define CREQ_QUERY_QP_RESP_SB_STATE_INIT 0x1UL
2274 #define CREQ_QUERY_QP_RESP_SB_STATE_RTR 0x2UL
2275 #define CREQ_QUERY_QP_RESP_SB_STATE_RTS 0x3UL
2276 #define CREQ_QUERY_QP_RESP_SB_STATE_SQD 0x4UL
2277 #define CREQ_QUERY_QP_RESP_SB_STATE_SQE 0x5UL
2278 #define CREQ_QUERY_QP_RESP_SB_STATE_ERR 0x6UL
2279 #define CREQ_QUERY_QP_RESP_SB_EN_SQD_ASYNC_NOTIFY 0x10UL
2281 #define CREQ_QUERY_QP_RESP_SB_ACCESS_LOCAL_WRITE 0x1UL
2282 #define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_WRITE 0x2UL
2283 #define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_READ 0x4UL
2284 #define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_ATOMIC 0x8UL
2294 __le16 path_mtu_dest_vlan_id
;
2295 #define CREQ_QUERY_QP_RESP_SB_DEST_VLAN_ID_MASK 0xfffUL
2296 #define CREQ_QUERY_QP_RESP_SB_DEST_VLAN_ID_SFT 0
2297 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MASK 0xf000UL
2298 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_SFT 12
2299 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_256 (0x0UL << 12)
2300 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_512 (0x1UL << 12)
2301 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_1024 (0x2UL << 12)
2302 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_2048 (0x3UL << 12)
2303 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_4096 (0x4UL << 12)
2304 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_8192 (0x5UL << 12)
2312 u8 max_dest_rd_atomic
;
2313 u8 tos_dscp_tos_ecn
;
2314 #define CREQ_QUERY_QP_RESP_SB_TOS_ECN_MASK 0x3UL
2315 #define CREQ_QUERY_QP_RESP_SB_TOS_ECN_SFT 0
2316 #define CREQ_QUERY_QP_RESP_SB_TOS_DSCP_MASK 0xfcUL
2317 #define CREQ_QUERY_QP_RESP_SB_TOS_DSCP_SFT 2
2319 #define CREQ_QUERY_QP_RESP_SB_ENABLE_CC 0x1UL
2320 #define CREQ_QUERY_QP_RESP_SB_RESERVED7_MASK 0xfeUL
2321 #define CREQ_QUERY_QP_RESP_SB_RESERVED7_SFT 1
2326 __le32 max_inline_data
;
2330 __le16 vlan_pcp_vlan_dei_vlan_id
;
2331 #define CREQ_QUERY_QP_RESP_SB_VLAN_ID_MASK 0xfffUL
2332 #define CREQ_QUERY_QP_RESP_SB_VLAN_ID_SFT 0
2333 #define CREQ_QUERY_QP_RESP_SB_VLAN_DEI 0x1000UL
2334 #define CREQ_QUERY_QP_RESP_SB_VLAN_PCP_MASK 0xe000UL
2335 #define CREQ_QUERY_QP_RESP_SB_VLAN_PCP_SFT 13
2338 /* Create SRQ command response (16 bytes) */
2339 struct creq_create_srq_resp
{
2341 #define CREQ_CREATE_SRQ_RESP_TYPE_MASK 0x3fUL
2342 #define CREQ_CREATE_SRQ_RESP_TYPE_SFT 0
2343 #define CREQ_CREATE_SRQ_RESP_TYPE_QP_EVENT 0x38UL
2344 #define CREQ_CREATE_SRQ_RESP_RESERVED2_MASK 0xc0UL
2345 #define CREQ_CREATE_SRQ_RESP_RESERVED2_SFT 6
2350 #define CREQ_CREATE_SRQ_RESP_V 0x1UL
2351 #define CREQ_CREATE_SRQ_RESP_RESERVED7_MASK 0xfeUL
2352 #define CREQ_CREATE_SRQ_RESP_RESERVED7_SFT 1
2354 #define CREQ_CREATE_SRQ_RESP_EVENT_CREATE_SRQ 0x5UL
2355 __le16 reserved48
[3];
2358 /* Destroy SRQ command response (16 bytes) */
2359 struct creq_destroy_srq_resp
{
2361 #define CREQ_DESTROY_SRQ_RESP_TYPE_MASK 0x3fUL
2362 #define CREQ_DESTROY_SRQ_RESP_TYPE_SFT 0
2363 #define CREQ_DESTROY_SRQ_RESP_TYPE_QP_EVENT 0x38UL
2364 #define CREQ_DESTROY_SRQ_RESP_RESERVED2_MASK 0xc0UL
2365 #define CREQ_DESTROY_SRQ_RESP_RESERVED2_SFT 6
2370 #define CREQ_DESTROY_SRQ_RESP_V 0x1UL
2371 #define CREQ_DESTROY_SRQ_RESP_RESERVED7_MASK 0xfeUL
2372 #define CREQ_DESTROY_SRQ_RESP_RESERVED7_SFT 1
2374 #define CREQ_DESTROY_SRQ_RESP_EVENT_DESTROY_SRQ 0x6UL
2375 __le16 enable_for_arm
[3];
2376 #define CREQ_DESTROY_SRQ_RESP_ENABLE_FOR_ARM_MASK 0x30000UL
2377 #define CREQ_DESTROY_SRQ_RESP_ENABLE_FOR_ARM_SFT 16
2378 #define CREQ_DESTROY_SRQ_RESP_RESERVED46_MASK 0xfffc0000UL
2379 #define CREQ_DESTROY_SRQ_RESP_RESERVED46_SFT 18
2382 /* Query SRQ command response (16 bytes) */
2383 struct creq_query_srq_resp
{
2385 #define CREQ_QUERY_SRQ_RESP_TYPE_MASK 0x3fUL
2386 #define CREQ_QUERY_SRQ_RESP_TYPE_SFT 0
2387 #define CREQ_QUERY_SRQ_RESP_TYPE_QP_EVENT 0x38UL
2388 #define CREQ_QUERY_SRQ_RESP_RESERVED2_MASK 0xc0UL
2389 #define CREQ_QUERY_SRQ_RESP_RESERVED2_SFT 6
2394 #define CREQ_QUERY_SRQ_RESP_V 0x1UL
2395 #define CREQ_QUERY_SRQ_RESP_RESERVED7_MASK 0xfeUL
2396 #define CREQ_QUERY_SRQ_RESP_RESERVED7_SFT 1
2398 #define CREQ_QUERY_SRQ_RESP_EVENT_QUERY_SRQ 0x8UL
2399 __le16 reserved48
[3];
2402 /* Query SRQ command response side buffer structure (24 bytes) */
2403 struct creq_query_srq_resp_sb
{
2405 #define CREQ_QUERY_SRQ_RESP_SB_OPCODE_QUERY_SRQ 0x8UL
2417 /* Create CQ command Response (16 bytes) */
2418 struct creq_create_cq_resp
{
2420 #define CREQ_CREATE_CQ_RESP_TYPE_MASK 0x3fUL
2421 #define CREQ_CREATE_CQ_RESP_TYPE_SFT 0
2422 #define CREQ_CREATE_CQ_RESP_TYPE_QP_EVENT 0x38UL
2423 #define CREQ_CREATE_CQ_RESP_RESERVED2_MASK 0xc0UL
2424 #define CREQ_CREATE_CQ_RESP_RESERVED2_SFT 6
2429 #define CREQ_CREATE_CQ_RESP_V 0x1UL
2430 #define CREQ_CREATE_CQ_RESP_RESERVED7_MASK 0xfeUL
2431 #define CREQ_CREATE_CQ_RESP_RESERVED7_SFT 1
2433 #define CREQ_CREATE_CQ_RESP_EVENT_CREATE_CQ 0x9UL
2434 __le16 reserved48
[3];
2437 /* Destroy CQ command response (16 bytes) */
2438 struct creq_destroy_cq_resp
{
2440 #define CREQ_DESTROY_CQ_RESP_TYPE_MASK 0x3fUL
2441 #define CREQ_DESTROY_CQ_RESP_TYPE_SFT 0
2442 #define CREQ_DESTROY_CQ_RESP_TYPE_QP_EVENT 0x38UL
2443 #define CREQ_DESTROY_CQ_RESP_RESERVED2_MASK 0xc0UL
2444 #define CREQ_DESTROY_CQ_RESP_RESERVED2_SFT 6
2449 #define CREQ_DESTROY_CQ_RESP_V 0x1UL
2450 #define CREQ_DESTROY_CQ_RESP_RESERVED7_MASK 0xfeUL
2451 #define CREQ_DESTROY_CQ_RESP_RESERVED7_SFT 1
2453 #define CREQ_DESTROY_CQ_RESP_EVENT_DESTROY_CQ 0xaUL
2455 #define CREQ_DESTROY_CQ_RESP_CQ_ARM_LVL_MASK 0x3UL
2456 #define CREQ_DESTROY_CQ_RESP_CQ_ARM_LVL_SFT 0
2457 #define CREQ_DESTROY_CQ_RESP_RESERVED14_MASK 0xfffcUL
2458 #define CREQ_DESTROY_CQ_RESP_RESERVED14_SFT 2
2459 __le16 total_cnq_events
;
2463 /* Resize CQ command response (16 bytes) */
2464 struct creq_resize_cq_resp
{
2466 #define CREQ_RESIZE_CQ_RESP_TYPE_MASK 0x3fUL
2467 #define CREQ_RESIZE_CQ_RESP_TYPE_SFT 0
2468 #define CREQ_RESIZE_CQ_RESP_TYPE_QP_EVENT 0x38UL
2469 #define CREQ_RESIZE_CQ_RESP_RESERVED2_MASK 0xc0UL
2470 #define CREQ_RESIZE_CQ_RESP_RESERVED2_SFT 6
2475 #define CREQ_RESIZE_CQ_RESP_V 0x1UL
2476 #define CREQ_RESIZE_CQ_RESP_RESERVED7_MASK 0xfeUL
2477 #define CREQ_RESIZE_CQ_RESP_RESERVED7_SFT 1
2479 #define CREQ_RESIZE_CQ_RESP_EVENT_RESIZE_CQ 0xcUL
2480 __le16 reserved48
[3];
2483 /* Allocate MRW command response (16 bytes) */
2484 struct creq_allocate_mrw_resp
{
2486 #define CREQ_ALLOCATE_MRW_RESP_TYPE_MASK 0x3fUL
2487 #define CREQ_ALLOCATE_MRW_RESP_TYPE_SFT 0
2488 #define CREQ_ALLOCATE_MRW_RESP_TYPE_QP_EVENT 0x38UL
2489 #define CREQ_ALLOCATE_MRW_RESP_RESERVED2_MASK 0xc0UL
2490 #define CREQ_ALLOCATE_MRW_RESP_RESERVED2_SFT 6
2495 #define CREQ_ALLOCATE_MRW_RESP_V 0x1UL
2496 #define CREQ_ALLOCATE_MRW_RESP_RESERVED7_MASK 0xfeUL
2497 #define CREQ_ALLOCATE_MRW_RESP_RESERVED7_SFT 1
2499 #define CREQ_ALLOCATE_MRW_RESP_EVENT_ALLOCATE_MRW 0xdUL
2500 __le16 reserved48
[3];
2503 /* De-allocate key command response (16 bytes) */
2504 struct creq_deallocate_key_resp
{
2506 #define CREQ_DEALLOCATE_KEY_RESP_TYPE_MASK 0x3fUL
2507 #define CREQ_DEALLOCATE_KEY_RESP_TYPE_SFT 0
2508 #define CREQ_DEALLOCATE_KEY_RESP_TYPE_QP_EVENT 0x38UL
2509 #define CREQ_DEALLOCATE_KEY_RESP_RESERVED2_MASK 0xc0UL
2510 #define CREQ_DEALLOCATE_KEY_RESP_RESERVED2_SFT 6
2515 #define CREQ_DEALLOCATE_KEY_RESP_V 0x1UL
2516 #define CREQ_DEALLOCATE_KEY_RESP_RESERVED7_MASK 0xfeUL
2517 #define CREQ_DEALLOCATE_KEY_RESP_RESERVED7_SFT 1
2519 #define CREQ_DEALLOCATE_KEY_RESP_EVENT_DEALLOCATE_KEY 0xeUL
2521 __le32 bound_window_info
;
2524 /* Register MR command response (16 bytes) */
2525 struct creq_register_mr_resp
{
2527 #define CREQ_REGISTER_MR_RESP_TYPE_MASK 0x3fUL
2528 #define CREQ_REGISTER_MR_RESP_TYPE_SFT 0
2529 #define CREQ_REGISTER_MR_RESP_TYPE_QP_EVENT 0x38UL
2530 #define CREQ_REGISTER_MR_RESP_RESERVED2_MASK 0xc0UL
2531 #define CREQ_REGISTER_MR_RESP_RESERVED2_SFT 6
2536 #define CREQ_REGISTER_MR_RESP_V 0x1UL
2537 #define CREQ_REGISTER_MR_RESP_RESERVED7_MASK 0xfeUL
2538 #define CREQ_REGISTER_MR_RESP_RESERVED7_SFT 1
2540 #define CREQ_REGISTER_MR_RESP_EVENT_REGISTER_MR 0xfUL
2541 __le16 reserved48
[3];
2544 /* Deregister MR command response (16 bytes) */
2545 struct creq_deregister_mr_resp
{
2547 #define CREQ_DEREGISTER_MR_RESP_TYPE_MASK 0x3fUL
2548 #define CREQ_DEREGISTER_MR_RESP_TYPE_SFT 0
2549 #define CREQ_DEREGISTER_MR_RESP_TYPE_QP_EVENT 0x38UL
2550 #define CREQ_DEREGISTER_MR_RESP_RESERVED2_MASK 0xc0UL
2551 #define CREQ_DEREGISTER_MR_RESP_RESERVED2_SFT 6
2556 #define CREQ_DEREGISTER_MR_RESP_V 0x1UL
2557 #define CREQ_DEREGISTER_MR_RESP_RESERVED7_MASK 0xfeUL
2558 #define CREQ_DEREGISTER_MR_RESP_RESERVED7_SFT 1
2560 #define CREQ_DEREGISTER_MR_RESP_EVENT_DEREGISTER_MR 0x10UL
2562 __le32 bound_windows
;
2565 /* Add GID command response (16 bytes) */
2566 struct creq_add_gid_resp
{
2568 #define CREQ_ADD_GID_RESP_TYPE_MASK 0x3fUL
2569 #define CREQ_ADD_GID_RESP_TYPE_SFT 0
2570 #define CREQ_ADD_GID_RESP_TYPE_QP_EVENT 0x38UL
2571 #define CREQ_ADD_GID_RESP_RESERVED2_MASK 0xc0UL
2572 #define CREQ_ADD_GID_RESP_RESERVED2_SFT 6
2577 #define CREQ_ADD_GID_RESP_V 0x1UL
2578 #define CREQ_ADD_GID_RESP_RESERVED7_MASK 0xfeUL
2579 #define CREQ_ADD_GID_RESP_RESERVED7_SFT 1
2581 #define CREQ_ADD_GID_RESP_EVENT_ADD_GID 0x11UL
2582 __le16 reserved48
[3];
2585 /* Delete GID command response (16 bytes) */
2586 struct creq_delete_gid_resp
{
2588 #define CREQ_DELETE_GID_RESP_TYPE_MASK 0x3fUL
2589 #define CREQ_DELETE_GID_RESP_TYPE_SFT 0
2590 #define CREQ_DELETE_GID_RESP_TYPE_QP_EVENT 0x38UL
2591 #define CREQ_DELETE_GID_RESP_RESERVED2_MASK 0xc0UL
2592 #define CREQ_DELETE_GID_RESP_RESERVED2_SFT 6
2597 #define CREQ_DELETE_GID_RESP_V 0x1UL
2598 #define CREQ_DELETE_GID_RESP_RESERVED7_MASK 0xfeUL
2599 #define CREQ_DELETE_GID_RESP_RESERVED7_SFT 1
2601 #define CREQ_DELETE_GID_RESP_EVENT_DELETE_GID 0x12UL
2602 __le16 reserved48
[3];
2605 /* Modify GID command response (16 bytes) */
2606 struct creq_modify_gid_resp
{
2608 #define CREQ_MODIFY_GID_RESP_TYPE_MASK 0x3fUL
2609 #define CREQ_MODIFY_GID_RESP_TYPE_SFT 0
2610 #define CREQ_MODIFY_GID_RESP_TYPE_QP_EVENT 0x38UL
2611 #define CREQ_MODIFY_GID_RESP_RESERVED2_MASK 0xc0UL
2612 #define CREQ_MODIFY_GID_RESP_RESERVED2_SFT 6
2617 #define CREQ_MODIFY_GID_RESP_V 0x1UL
2618 #define CREQ_MODIFY_GID_RESP_RESERVED7_MASK 0xfeUL
2619 #define CREQ_MODIFY_GID_RESP_RESERVED7_SFT 1
2621 #define CREQ_MODIFY_GID_RESP_EVENT_ADD_GID 0x11UL
2622 __le16 reserved48
[3];
2625 /* Query GID command response (16 bytes) */
2626 struct creq_query_gid_resp
{
2628 #define CREQ_QUERY_GID_RESP_TYPE_MASK 0x3fUL
2629 #define CREQ_QUERY_GID_RESP_TYPE_SFT 0
2630 #define CREQ_QUERY_GID_RESP_TYPE_QP_EVENT 0x38UL
2631 #define CREQ_QUERY_GID_RESP_RESERVED2_MASK 0xc0UL
2632 #define CREQ_QUERY_GID_RESP_RESERVED2_SFT 6
2637 #define CREQ_QUERY_GID_RESP_V 0x1UL
2638 #define CREQ_QUERY_GID_RESP_RESERVED7_MASK 0xfeUL
2639 #define CREQ_QUERY_GID_RESP_RESERVED7_SFT 1
2641 #define CREQ_QUERY_GID_RESP_EVENT_QUERY_GID 0x18UL
2642 __le16 reserved48
[3];
2645 /* Query GID command response side buffer structure (40 bytes) */
2646 struct creq_query_gid_resp_sb
{
2648 #define CREQ_QUERY_GID_RESP_SB_OPCODE_QUERY_GID 0x18UL
2657 #define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_ID_MASK 0xfffUL
2658 #define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_ID_SFT 0
2659 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_MASK 0x7000UL
2660 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_SFT 12
2661 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_88A8 (0x0UL << 12)
2662 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_8100 (0x1UL << 12)
2663 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_9100 (0x2UL << 12)
2664 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_9200 (0x3UL << 12)
2665 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_9300 (0x4UL << 12)
2666 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG1 (0x5UL << 12)
2667 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG2 (0x6UL << 12)
2668 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG3 (0x7UL << 12)
2669 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_LAST \
2670 CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG3
2671 #define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_EN 0x8000UL
2677 /* Create QP1 command response (16 bytes) */
2678 struct creq_create_qp1_resp
{
2680 #define CREQ_CREATE_QP1_RESP_TYPE_MASK 0x3fUL
2681 #define CREQ_CREATE_QP1_RESP_TYPE_SFT 0
2682 #define CREQ_CREATE_QP1_RESP_TYPE_QP_EVENT 0x38UL
2683 #define CREQ_CREATE_QP1_RESP_RESERVED2_MASK 0xc0UL
2684 #define CREQ_CREATE_QP1_RESP_RESERVED2_SFT 6
2689 #define CREQ_CREATE_QP1_RESP_V 0x1UL
2690 #define CREQ_CREATE_QP1_RESP_RESERVED7_MASK 0xfeUL
2691 #define CREQ_CREATE_QP1_RESP_RESERVED7_SFT 1
2693 #define CREQ_CREATE_QP1_RESP_EVENT_CREATE_QP1 0x13UL
2694 __le16 reserved48
[3];
2697 /* Destroy QP1 command response (16 bytes) */
2698 struct creq_destroy_qp1_resp
{
2700 #define CREQ_DESTROY_QP1_RESP_TYPE_MASK 0x3fUL
2701 #define CREQ_DESTROY_QP1_RESP_TYPE_SFT 0
2702 #define CREQ_DESTROY_QP1_RESP_TYPE_QP_EVENT 0x38UL
2703 #define CREQ_DESTROY_QP1_RESP_RESERVED2_MASK 0xc0UL
2704 #define CREQ_DESTROY_QP1_RESP_RESERVED2_SFT 6
2709 #define CREQ_DESTROY_QP1_RESP_V 0x1UL
2710 #define CREQ_DESTROY_QP1_RESP_RESERVED7_MASK 0xfeUL
2711 #define CREQ_DESTROY_QP1_RESP_RESERVED7_SFT 1
2713 #define CREQ_DESTROY_QP1_RESP_EVENT_DESTROY_QP1 0x14UL
2714 __le16 reserved48
[3];
2717 /* Create AH command response (16 bytes) */
2718 struct creq_create_ah_resp
{
2720 #define CREQ_CREATE_AH_RESP_TYPE_MASK 0x3fUL
2721 #define CREQ_CREATE_AH_RESP_TYPE_SFT 0
2722 #define CREQ_CREATE_AH_RESP_TYPE_QP_EVENT 0x38UL
2723 #define CREQ_CREATE_AH_RESP_RESERVED2_MASK 0xc0UL
2724 #define CREQ_CREATE_AH_RESP_RESERVED2_SFT 6
2729 #define CREQ_CREATE_AH_RESP_V 0x1UL
2730 #define CREQ_CREATE_AH_RESP_RESERVED7_MASK 0xfeUL
2731 #define CREQ_CREATE_AH_RESP_RESERVED7_SFT 1
2733 #define CREQ_CREATE_AH_RESP_EVENT_CREATE_AH 0x15UL
2734 __le16 reserved48
[3];
2737 /* Destroy AH command response (16 bytes) */
2738 struct creq_destroy_ah_resp
{
2740 #define CREQ_DESTROY_AH_RESP_TYPE_MASK 0x3fUL
2741 #define CREQ_DESTROY_AH_RESP_TYPE_SFT 0
2742 #define CREQ_DESTROY_AH_RESP_TYPE_QP_EVENT 0x38UL
2743 #define CREQ_DESTROY_AH_RESP_RESERVED2_MASK 0xc0UL
2744 #define CREQ_DESTROY_AH_RESP_RESERVED2_SFT 6
2749 #define CREQ_DESTROY_AH_RESP_V 0x1UL
2750 #define CREQ_DESTROY_AH_RESP_RESERVED7_MASK 0xfeUL
2751 #define CREQ_DESTROY_AH_RESP_RESERVED7_SFT 1
2753 #define CREQ_DESTROY_AH_RESP_EVENT_DESTROY_AH 0x16UL
2754 __le16 reserved48
[3];
2757 /* Initialize Firmware command response (16 bytes) */
2758 struct creq_initialize_fw_resp
{
2760 #define CREQ_INITIALIZE_FW_RESP_TYPE_MASK 0x3fUL
2761 #define CREQ_INITIALIZE_FW_RESP_TYPE_SFT 0
2762 #define CREQ_INITIALIZE_FW_RESP_TYPE_QP_EVENT 0x38UL
2763 #define CREQ_INITIALIZE_FW_RESP_RESERVED2_MASK 0xc0UL
2764 #define CREQ_INITIALIZE_FW_RESP_RESERVED2_SFT 6
2769 #define CREQ_INITIALIZE_FW_RESP_V 0x1UL
2770 #define CREQ_INITIALIZE_FW_RESP_RESERVED7_MASK 0xfeUL
2771 #define CREQ_INITIALIZE_FW_RESP_RESERVED7_SFT 1
2773 #define CREQ_INITIALIZE_FW_RESP_EVENT_INITIALIZE_FW 0x80UL
2774 __le16 reserved48
[3];
2777 /* De-initialize Firmware command response (16 bytes) */
2778 struct creq_deinitialize_fw_resp
{
2780 #define CREQ_DEINITIALIZE_FW_RESP_TYPE_MASK 0x3fUL
2781 #define CREQ_DEINITIALIZE_FW_RESP_TYPE_SFT 0
2782 #define CREQ_DEINITIALIZE_FW_RESP_TYPE_QP_EVENT 0x38UL
2783 #define CREQ_DEINITIALIZE_FW_RESP_RESERVED2_MASK 0xc0UL
2784 #define CREQ_DEINITIALIZE_FW_RESP_RESERVED2_SFT 6
2789 #define CREQ_DEINITIALIZE_FW_RESP_V 0x1UL
2790 #define CREQ_DEINITIALIZE_FW_RESP_RESERVED7_MASK 0xfeUL
2791 #define CREQ_DEINITIALIZE_FW_RESP_RESERVED7_SFT 1
2793 #define CREQ_DEINITIALIZE_FW_RESP_EVENT_DEINITIALIZE_FW 0x81UL
2794 __le16 reserved48
[3];
2797 /* Stop function command response (16 bytes) */
2798 struct creq_stop_func_resp
{
2800 #define CREQ_STOP_FUNC_RESP_TYPE_MASK 0x3fUL
2801 #define CREQ_STOP_FUNC_RESP_TYPE_SFT 0
2802 #define CREQ_STOP_FUNC_RESP_TYPE_QP_EVENT 0x38UL
2803 #define CREQ_STOP_FUNC_RESP_RESERVED2_MASK 0xc0UL
2804 #define CREQ_STOP_FUNC_RESP_RESERVED2_SFT 6
2809 #define CREQ_STOP_FUNC_RESP_V 0x1UL
2810 #define CREQ_STOP_FUNC_RESP_RESERVED7_MASK 0xfeUL
2811 #define CREQ_STOP_FUNC_RESP_RESERVED7_SFT 1
2813 #define CREQ_STOP_FUNC_RESP_EVENT_STOP_FUNC 0x82UL
2814 __le16 reserved48
[3];
2817 /* Query function command response (16 bytes) */
2818 struct creq_query_func_resp
{
2820 #define CREQ_QUERY_FUNC_RESP_TYPE_MASK 0x3fUL
2821 #define CREQ_QUERY_FUNC_RESP_TYPE_SFT 0
2822 #define CREQ_QUERY_FUNC_RESP_TYPE_QP_EVENT 0x38UL
2823 #define CREQ_QUERY_FUNC_RESP_RESERVED2_MASK 0xc0UL
2824 #define CREQ_QUERY_FUNC_RESP_RESERVED2_SFT 6
2829 #define CREQ_QUERY_FUNC_RESP_V 0x1UL
2830 #define CREQ_QUERY_FUNC_RESP_RESERVED7_MASK 0xfeUL
2831 #define CREQ_QUERY_FUNC_RESP_RESERVED7_SFT 1
2833 #define CREQ_QUERY_FUNC_RESP_EVENT_QUERY_FUNC 0x83UL
2834 __le16 reserved48
[3];
2837 /* Query function command response side buffer structure (88 bytes) */
2838 struct creq_query_func_resp_sb
{
2840 #define CREQ_QUERY_FUNC_RESP_SB_OPCODE_QUERY_FUNC 0x83UL
2849 __le16 dev_cap_flags
;
2850 #define CREQ_QUERY_FUNC_RESP_SB_DEV_CAP_FLAGS_RESIZE_QP 0x1UL
2857 u8 max_qp_init_rd_atom
;
2860 __le32 max_raw_eth_qp
;
2865 __le32 max_inline_data
;
2867 u8 l2_db_space_size
;
2870 __le32 tqm_alloc_reqs
[12];
2875 /* Set resources command response (16 bytes) */
2876 struct creq_set_func_resources_resp
{
2878 #define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_MASK 0x3fUL
2879 #define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_SFT 0
2880 #define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_QP_EVENT 0x38UL
2881 #define CREQ_SET_FUNC_RESOURCES_RESP_RESERVED2_MASK 0xc0UL
2882 #define CREQ_SET_FUNC_RESOURCES_RESP_RESERVED2_SFT 6
2887 #define CREQ_SET_FUNC_RESOURCES_RESP_V 0x1UL
2888 #define CREQ_SET_FUNC_RESOURCES_RESP_RESERVED7_MASK 0xfeUL
2889 #define CREQ_SET_FUNC_RESOURCES_RESP_RESERVED7_SFT 1
2891 #define CREQ_SET_FUNC_RESOURCES_RESP_EVENT_SET_FUNC_RESOURCES 0x84UL
2892 __le16 reserved48
[3];
2895 /* Map TC to COS response (16 bytes) */
2896 struct creq_map_tc_to_cos_resp
{
2898 #define CREQ_MAP_TC_TO_COS_RESP_TYPE_MASK 0x3fUL
2899 #define CREQ_MAP_TC_TO_COS_RESP_TYPE_SFT 0
2900 #define CREQ_MAP_TC_TO_COS_RESP_TYPE_QP_EVENT 0x38UL
2901 #define CREQ_MAP_TC_TO_COS_RESP_RESERVED2_MASK 0xc0UL
2902 #define CREQ_MAP_TC_TO_COS_RESP_RESERVED2_SFT 6
2907 #define CREQ_MAP_TC_TO_COS_RESP_V 0x1UL
2908 #define CREQ_MAP_TC_TO_COS_RESP_RESERVED7_MASK 0xfeUL
2909 #define CREQ_MAP_TC_TO_COS_RESP_RESERVED7_SFT 1
2911 #define CREQ_MAP_TC_TO_COS_RESP_EVENT_MAP_TC_TO_COS 0x8aUL
2912 __le16 reserved48
[3];
2915 /* Query version response (16 bytes) */
2916 struct creq_query_version_resp
{
2918 #define CREQ_QUERY_VERSION_RESP_TYPE_MASK 0x3fUL
2919 #define CREQ_QUERY_VERSION_RESP_TYPE_SFT 0
2920 #define CREQ_QUERY_VERSION_RESP_TYPE_QP_EVENT 0x38UL
2921 #define CREQ_QUERY_VERSION_RESP_RESERVED2_MASK 0xc0UL
2922 #define CREQ_QUERY_VERSION_RESP_RESERVED2_SFT 6
2930 #define CREQ_QUERY_VERSION_RESP_V 0x1UL
2931 #define CREQ_QUERY_VERSION_RESP_RESERVED7_MASK 0xfeUL
2932 #define CREQ_QUERY_VERSION_RESP_RESERVED7_SFT 1
2934 #define CREQ_QUERY_VERSION_RESP_EVENT_QUERY_VERSION 0x8bUL
2942 /* Modify congestion control command response (16 bytes) */
2943 struct creq_modify_cc_resp
{
2945 #define CREQ_MODIFY_CC_RESP_TYPE_MASK 0x3fUL
2946 #define CREQ_MODIFY_CC_RESP_TYPE_SFT 0
2947 #define CREQ_MODIFY_CC_RESP_TYPE_QP_EVENT 0x38UL
2948 #define CREQ_MODIFY_CC_RESP_RESERVED2_MASK 0xc0UL
2949 #define CREQ_MODIFY_CC_RESP_RESERVED2_SFT 6
2954 #define CREQ_MODIFY_CC_RESP_V 0x1UL
2955 #define CREQ_MODIFY_CC_RESP_RESERVED7_MASK 0xfeUL
2956 #define CREQ_MODIFY_CC_RESP_RESERVED7_SFT 1
2958 #define CREQ_MODIFY_CC_RESP_EVENT_MODIFY_CC 0x8cUL
2959 __le16 reserved48
[3];
2962 /* Query congestion control command response (16 bytes) */
2963 struct creq_query_cc_resp
{
2965 #define CREQ_QUERY_CC_RESP_TYPE_MASK 0x3fUL
2966 #define CREQ_QUERY_CC_RESP_TYPE_SFT 0
2967 #define CREQ_QUERY_CC_RESP_TYPE_QP_EVENT 0x38UL
2968 #define CREQ_QUERY_CC_RESP_RESERVED2_MASK 0xc0UL
2969 #define CREQ_QUERY_CC_RESP_RESERVED2_SFT 6
2974 #define CREQ_QUERY_CC_RESP_V 0x1UL
2975 #define CREQ_QUERY_CC_RESP_RESERVED7_MASK 0xfeUL
2976 #define CREQ_QUERY_CC_RESP_RESERVED7_SFT 1
2978 #define CREQ_QUERY_CC_RESP_EVENT_QUERY_CC 0x8dUL
2979 __le16 reserved48
[3];
2982 /* Query congestion control command response side buffer structure (32 bytes) */
2983 struct creq_query_cc_resp_sb
{
2985 #define CREQ_QUERY_CC_RESP_SB_OPCODE_QUERY_CC 0x8dUL
2992 #define CREQ_QUERY_CC_RESP_SB_ENABLE_CC 0x1UL
2994 #define CREQ_QUERY_CC_RESP_SB_G_MASK 0x7UL
2995 #define CREQ_QUERY_CC_RESP_SB_G_SFT 0
2996 u8 num_phases_per_state
;
3002 u8 tos_dscp_tos_ecn
;
3003 #define CREQ_QUERY_CC_RESP_SB_TOS_ECN_MASK 0x3UL
3004 #define CREQ_QUERY_CC_RESP_SB_TOS_ECN_SFT 0
3005 #define CREQ_QUERY_CC_RESP_SB_TOS_DSCP_MASK 0xfcUL
3006 #define CREQ_QUERY_CC_RESP_SB_TOS_DSCP_SFT 2
3008 __le64 reserved64_1
;
3011 /* creq_query_roce_stats_resp (size:128b/16B) */
3012 struct creq_query_roce_stats_resp
{
3014 #define CREQ_QUERY_ROCE_STATS_RESP_TYPE_MASK 0x3fUL
3015 #define CREQ_QUERY_ROCE_STATS_RESP_TYPE_SFT 0
3016 #define CREQ_QUERY_ROCE_STATS_RESP_TYPE_QP_EVENT 0x38UL
3017 #define CREQ_QUERY_ROCE_STATS_RESP_TYPE_LAST \
3018 CREQ_QUERY_ROCE_STATS_RESP_TYPE_QP_EVENT
3023 #define CREQ_QUERY_ROCE_STATS_RESP_V 0x1UL
3025 #define CREQ_QUERY_ROCE_STATS_RESP_EVENT_QUERY_ROCE_STATS 0x8eUL
3026 #define CREQ_QUERY_ROCE_STATS_RESP_EVENT_LAST \
3027 CREQ_QUERY_ROCE_STATS_RESP_EVENT_QUERY_ROCE_STATS
3031 /* creq_query_roce_stats_resp_sb (size:2624b/328B) */
3032 struct creq_query_roce_stats_resp_sb
{
3034 #define CREQ_QUERY_ROCE_STATS_RESP_SB_OPCODE_QUERY_ROCE_STATS 0x8eUL
3035 #define CREQ_QUERY_ROCE_STATS_RESP_SB_OPCODE_LAST \
3036 CREQ_QUERY_ROCE_STATS_RESP_SB_OPCODE_QUERY_ROCE_STATS
3042 __le32 num_counters
;
3044 __le64 to_retransmits
;
3045 __le64 seq_err_naks_rcvd
;
3046 __le64 max_retry_exceeded
;
3047 __le64 rnr_naks_rcvd
;
3048 __le64 missing_resp
;
3049 __le64 unrecoverable_err
;
3050 __le64 bad_resp_err
;
3051 __le64 local_qp_op_err
;
3052 __le64 local_protection_err
;
3053 __le64 mem_mgmt_op_err
;
3054 __le64 remote_invalid_req_err
;
3055 __le64 remote_access_err
;
3056 __le64 remote_op_err
;
3058 __le64 res_exceed_max
;
3059 __le64 res_length_mismatch
;
3060 __le64 res_exceeds_wqe
;
3061 __le64 res_opcode_err
;
3062 __le64 res_rx_invalid_rkey
;
3063 __le64 res_rx_domain_err
;
3064 __le64 res_rx_no_perm
;
3065 __le64 res_rx_range_err
;
3066 __le64 res_tx_invalid_rkey
;
3067 __le64 res_tx_domain_err
;
3068 __le64 res_tx_no_perm
;
3069 __le64 res_tx_range_err
;
3070 __le64 res_irrq_oflow
;
3071 __le64 res_unsup_opcode
;
3072 __le64 res_unaligned_atomic
;
3073 __le64 res_rem_inv_err
;
3074 __le64 res_mem_error
;
3077 __le64 res_invalid_dup_rkey
;
3078 __le64 res_wqe_format_err
;
3079 __le64 res_cq_load_err
;
3080 __le64 res_srq_load_err
;
3081 __le64 res_tx_pci_err
;
3082 __le64 res_rx_pci_err
;
3083 __le64 res_oos_drop_count
;
3084 __le64 active_qp_count_p0
;
3085 __le64 active_qp_count_p1
;
3086 __le64 active_qp_count_p2
;
3087 __le64 active_qp_count_p3
;
3090 /* QP error notification event (16 bytes) */
3091 struct creq_qp_error_notification
{
3093 #define CREQ_QP_ERROR_NOTIFICATION_TYPE_MASK 0x3fUL
3094 #define CREQ_QP_ERROR_NOTIFICATION_TYPE_SFT 0
3095 #define CREQ_QP_ERROR_NOTIFICATION_TYPE_QP_EVENT 0x38UL
3096 #define CREQ_QP_ERROR_NOTIFICATION_RESERVED2_MASK 0xc0UL
3097 #define CREQ_QP_ERROR_NOTIFICATION_RESERVED2_SFT 6
3099 u8 req_slow_path_state
;
3100 u8 req_err_state_reason
;
3103 #define CREQ_QP_ERROR_NOTIFICATION_V 0x1UL
3104 #define CREQ_QP_ERROR_NOTIFICATION_RESERVED7_MASK 0xfeUL
3105 #define CREQ_QP_ERROR_NOTIFICATION_RESERVED7_SFT 1
3107 #define CREQ_QP_ERROR_NOTIFICATION_EVENT_QP_ERROR_NOTIFICATION 0xc0UL
3108 u8 res_slow_path_state
;
3109 u8 res_err_state_reason
;
3114 /* RoCE Slowpath HSI Specification 1.6.0 */
3115 #define ROCE_SP_HSI_VERSION_MAJOR 1
3116 #define ROCE_SP_HSI_VERSION_MINOR 6
3117 #define ROCE_SP_HSI_VERSION_UPDATE 0
3119 #define ROCE_SP_HSI_VERSION_STR "1.6.0"
3121 * Following is the signature for ROCE_SP_HSI message field that indicates not
3122 * applicable (All F's). Need to cast it the size of the field if needed.
3124 #define ROCE_SP_HSI_NA_SIGNATURE ((__le32)(-1))
3125 #endif /* __BNXT_RE_HSI_H__ */