1 /* 2 * Broadcom NetXtreme-E RoCE driver. 3 * 4 * Copyright (c) 2016 - 2017, Broadcom. All rights reserved. The term 5 * Broadcom refers to Broadcom Limited and/or its subsidiaries. 6 * 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 11 * BSD license below: 12 * 13 * Redistribution and use in source and binary forms, with or without 14 * modification, are permitted provided that the following conditions 15 * are met: 16 * 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 22 * distribution. 23 * 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. 35 * 36 * Description: RoCE HSI File - Autogenerated 37 */ 38 39 #ifndef __BNXT_RE_HSI_H__ 40 #define __BNXT_RE_HSI_H__ 41 42 /* include bnxt_hsi.h from bnxt_en driver */ 43 #include "bnxt_hsi.h" 44 45 /* tx_doorbell (size:32b/4B) */ 46 struct tx_doorbell { 47 __le32 key_idx; 48 #define TX_DOORBELL_IDX_MASK 0xffffffUL 49 #define TX_DOORBELL_IDX_SFT 0 50 #define TX_DOORBELL_KEY_MASK 0xf0000000UL 51 #define TX_DOORBELL_KEY_SFT 28 52 #define TX_DOORBELL_KEY_TX (0x0UL << 28) 53 #define TX_DOORBELL_KEY_LAST TX_DOORBELL_KEY_TX 54 }; 55 56 /* rx_doorbell (size:32b/4B) */ 57 struct rx_doorbell { 58 __le32 key_idx; 59 #define RX_DOORBELL_IDX_MASK 0xffffffUL 60 #define RX_DOORBELL_IDX_SFT 0 61 #define RX_DOORBELL_KEY_MASK 0xf0000000UL 62 #define RX_DOORBELL_KEY_SFT 28 63 #define RX_DOORBELL_KEY_RX (0x1UL << 28) 64 #define RX_DOORBELL_KEY_LAST RX_DOORBELL_KEY_RX 65 }; 66 67 /* cmpl_doorbell (size:32b/4B) */ 68 struct cmpl_doorbell { 69 __le32 key_mask_valid_idx; 70 #define CMPL_DOORBELL_IDX_MASK 0xffffffUL 71 #define CMPL_DOORBELL_IDX_SFT 0 72 #define CMPL_DOORBELL_IDX_VALID 0x4000000UL 73 #define CMPL_DOORBELL_MASK 0x8000000UL 74 #define CMPL_DOORBELL_KEY_MASK 0xf0000000UL 75 #define CMPL_DOORBELL_KEY_SFT 28 76 #define CMPL_DOORBELL_KEY_CMPL (0x2UL << 28) 77 #define CMPL_DOORBELL_KEY_LAST CMPL_DOORBELL_KEY_CMPL 78 }; 79 80 /* status_doorbell (size:32b/4B) */ 81 struct status_doorbell { 82 __le32 key_idx; 83 #define STATUS_DOORBELL_IDX_MASK 0xffffffUL 84 #define STATUS_DOORBELL_IDX_SFT 0 85 #define STATUS_DOORBELL_KEY_MASK 0xf0000000UL 86 #define STATUS_DOORBELL_KEY_SFT 28 87 #define STATUS_DOORBELL_KEY_STAT (0x3UL << 28) 88 #define STATUS_DOORBELL_KEY_LAST STATUS_DOORBELL_KEY_STAT 89 }; 90 91 /* cmdq_init (size:128b/16B) */ 92 struct cmdq_init { 93 __le64 cmdq_pbl; 94 __le16 cmdq_size_cmdq_lvl; 95 #define CMDQ_INIT_CMDQ_LVL_MASK 0x3UL 96 #define CMDQ_INIT_CMDQ_LVL_SFT 0 97 #define CMDQ_INIT_CMDQ_SIZE_MASK 0xfffcUL 98 #define CMDQ_INIT_CMDQ_SIZE_SFT 2 99 __le16 creq_ring_id; 100 __le32 prod_idx; 101 }; 102 103 /* cmdq_base (size:128b/16B) */ 104 struct cmdq_base { 105 u8 opcode; 106 #define CMDQ_BASE_OPCODE_CREATE_QP 0x1UL 107 #define CMDQ_BASE_OPCODE_DESTROY_QP 0x2UL 108 #define CMDQ_BASE_OPCODE_MODIFY_QP 0x3UL 109 #define CMDQ_BASE_OPCODE_QUERY_QP 0x4UL 110 #define CMDQ_BASE_OPCODE_CREATE_SRQ 0x5UL 111 #define CMDQ_BASE_OPCODE_DESTROY_SRQ 0x6UL 112 #define CMDQ_BASE_OPCODE_QUERY_SRQ 0x8UL 113 #define CMDQ_BASE_OPCODE_CREATE_CQ 0x9UL 114 #define CMDQ_BASE_OPCODE_DESTROY_CQ 0xaUL 115 #define CMDQ_BASE_OPCODE_RESIZE_CQ 0xcUL 116 #define CMDQ_BASE_OPCODE_ALLOCATE_MRW 0xdUL 117 #define CMDQ_BASE_OPCODE_DEALLOCATE_KEY 0xeUL 118 #define CMDQ_BASE_OPCODE_REGISTER_MR 0xfUL 119 #define CMDQ_BASE_OPCODE_DEREGISTER_MR 0x10UL 120 #define CMDQ_BASE_OPCODE_ADD_GID 0x11UL 121 #define CMDQ_BASE_OPCODE_DELETE_GID 0x12UL 122 #define CMDQ_BASE_OPCODE_MODIFY_GID 0x17UL 123 #define CMDQ_BASE_OPCODE_QUERY_GID 0x18UL 124 #define CMDQ_BASE_OPCODE_CREATE_QP1 0x13UL 125 #define CMDQ_BASE_OPCODE_DESTROY_QP1 0x14UL 126 #define CMDQ_BASE_OPCODE_CREATE_AH 0x15UL 127 #define CMDQ_BASE_OPCODE_DESTROY_AH 0x16UL 128 #define CMDQ_BASE_OPCODE_INITIALIZE_FW 0x80UL 129 #define CMDQ_BASE_OPCODE_DEINITIALIZE_FW 0x81UL 130 #define CMDQ_BASE_OPCODE_STOP_FUNC 0x82UL 131 #define CMDQ_BASE_OPCODE_QUERY_FUNC 0x83UL 132 #define CMDQ_BASE_OPCODE_SET_FUNC_RESOURCES 0x84UL 133 #define CMDQ_BASE_OPCODE_READ_CONTEXT 0x85UL 134 #define CMDQ_BASE_OPCODE_VF_BACKCHANNEL_REQUEST 0x86UL 135 #define CMDQ_BASE_OPCODE_READ_VF_MEMORY 0x87UL 136 #define CMDQ_BASE_OPCODE_COMPLETE_VF_REQUEST 0x88UL 137 #define CMDQ_BASE_OPCODE_EXTEND_CONTEXT_ARRRAY 0x89UL 138 #define CMDQ_BASE_OPCODE_MAP_TC_TO_COS 0x8aUL 139 #define CMDQ_BASE_OPCODE_QUERY_VERSION 0x8bUL 140 #define CMDQ_BASE_OPCODE_MODIFY_ROCE_CC 0x8cUL 141 #define CMDQ_BASE_OPCODE_QUERY_ROCE_CC 0x8dUL 142 #define CMDQ_BASE_OPCODE_QUERY_ROCE_STATS 0x8eUL 143 #define CMDQ_BASE_OPCODE_SET_LINK_AGGR_MODE 0x8fUL 144 #define CMDQ_BASE_OPCODE_MODIFY_CQ 0x90UL 145 #define CMDQ_BASE_OPCODE_QUERY_QP_EXTEND 0x91UL 146 #define CMDQ_BASE_OPCODE_QUERY_ROCE_STATS_EXT 0x92UL 147 #define CMDQ_BASE_OPCODE_LAST CMDQ_BASE_OPCODE_QUERY_ROCE_STATS_EXT 148 u8 cmd_size; 149 __le16 flags; 150 __le16 cookie; 151 u8 resp_size; 152 u8 reserved8; 153 __le64 resp_addr; 154 }; 155 156 /* creq_base (size:128b/16B) */ 157 struct creq_base { 158 u8 type; 159 #define CREQ_BASE_TYPE_MASK 0x3fUL 160 #define CREQ_BASE_TYPE_SFT 0 161 #define CREQ_BASE_TYPE_QP_EVENT 0x38UL 162 #define CREQ_BASE_TYPE_FUNC_EVENT 0x3aUL 163 #define CREQ_BASE_TYPE_LAST CREQ_BASE_TYPE_FUNC_EVENT 164 u8 reserved56[7]; 165 u8 v; 166 #define CREQ_BASE_V 0x1UL 167 u8 event; 168 u8 reserved48[6]; 169 }; 170 171 /* cmdq_query_version (size:128b/16B) */ 172 struct cmdq_query_version { 173 u8 opcode; 174 #define CMDQ_QUERY_VERSION_OPCODE_QUERY_VERSION 0x8bUL 175 #define CMDQ_QUERY_VERSION_OPCODE_LAST CMDQ_QUERY_VERSION_OPCODE_QUERY_VERSION 176 u8 cmd_size; 177 __le16 flags; 178 __le16 cookie; 179 u8 resp_size; 180 u8 reserved8; 181 __le64 resp_addr; 182 }; 183 184 /* creq_query_version_resp (size:128b/16B) */ 185 struct creq_query_version_resp { 186 u8 type; 187 #define CREQ_QUERY_VERSION_RESP_TYPE_MASK 0x3fUL 188 #define CREQ_QUERY_VERSION_RESP_TYPE_SFT 0 189 #define CREQ_QUERY_VERSION_RESP_TYPE_QP_EVENT 0x38UL 190 #define CREQ_QUERY_VERSION_RESP_TYPE_LAST CREQ_QUERY_VERSION_RESP_TYPE_QP_EVENT 191 u8 status; 192 __le16 cookie; 193 u8 fw_maj; 194 u8 fw_minor; 195 u8 fw_bld; 196 u8 fw_rsvd; 197 u8 v; 198 #define CREQ_QUERY_VERSION_RESP_V 0x1UL 199 u8 event; 200 #define CREQ_QUERY_VERSION_RESP_EVENT_QUERY_VERSION 0x8bUL 201 #define CREQ_QUERY_VERSION_RESP_EVENT_LAST \ 202 CREQ_QUERY_VERSION_RESP_EVENT_QUERY_VERSION 203 __le16 reserved16; 204 u8 intf_maj; 205 u8 intf_minor; 206 u8 intf_bld; 207 u8 intf_rsvd; 208 }; 209 210 /* cmdq_initialize_fw (size:896b/112B) */ 211 struct cmdq_initialize_fw { 212 u8 opcode; 213 #define CMDQ_INITIALIZE_FW_OPCODE_INITIALIZE_FW 0x80UL 214 #define CMDQ_INITIALIZE_FW_OPCODE_LAST CMDQ_INITIALIZE_FW_OPCODE_INITIALIZE_FW 215 u8 cmd_size; 216 __le16 flags; 217 #define CMDQ_INITIALIZE_FW_FLAGS_MRAV_RESERVATION_SPLIT 0x1UL 218 #define CMDQ_INITIALIZE_FW_FLAGS_HW_REQUESTER_RETX_SUPPORTED 0x2UL 219 __le16 cookie; 220 u8 resp_size; 221 u8 reserved8; 222 __le64 resp_addr; 223 u8 qpc_pg_size_qpc_lvl; 224 #define CMDQ_INITIALIZE_FW_QPC_LVL_MASK 0xfUL 225 #define CMDQ_INITIALIZE_FW_QPC_LVL_SFT 0 226 #define CMDQ_INITIALIZE_FW_QPC_LVL_LVL_0 0x0UL 227 #define CMDQ_INITIALIZE_FW_QPC_LVL_LVL_1 0x1UL 228 #define CMDQ_INITIALIZE_FW_QPC_LVL_LVL_2 0x2UL 229 #define CMDQ_INITIALIZE_FW_QPC_LVL_LAST CMDQ_INITIALIZE_FW_QPC_LVL_LVL_2 230 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_MASK 0xf0UL 231 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_SFT 4 232 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_4K (0x0UL << 4) 233 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_8K (0x1UL << 4) 234 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_64K (0x2UL << 4) 235 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_2M (0x3UL << 4) 236 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_8M (0x4UL << 4) 237 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_1G (0x5UL << 4) 238 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_LAST CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_1G 239 u8 mrw_pg_size_mrw_lvl; 240 #define CMDQ_INITIALIZE_FW_MRW_LVL_MASK 0xfUL 241 #define CMDQ_INITIALIZE_FW_MRW_LVL_SFT 0 242 #define CMDQ_INITIALIZE_FW_MRW_LVL_LVL_0 0x0UL 243 #define CMDQ_INITIALIZE_FW_MRW_LVL_LVL_1 0x1UL 244 #define CMDQ_INITIALIZE_FW_MRW_LVL_LVL_2 0x2UL 245 #define CMDQ_INITIALIZE_FW_MRW_LVL_LAST CMDQ_INITIALIZE_FW_MRW_LVL_LVL_2 246 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_MASK 0xf0UL 247 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_SFT 4 248 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_4K (0x0UL << 4) 249 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_8K (0x1UL << 4) 250 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_64K (0x2UL << 4) 251 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_2M (0x3UL << 4) 252 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_8M (0x4UL << 4) 253 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_1G (0x5UL << 4) 254 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_LAST CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_1G 255 u8 srq_pg_size_srq_lvl; 256 #define CMDQ_INITIALIZE_FW_SRQ_LVL_MASK 0xfUL 257 #define CMDQ_INITIALIZE_FW_SRQ_LVL_SFT 0 258 #define CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_0 0x0UL 259 #define CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_1 0x1UL 260 #define CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_2 0x2UL 261 #define CMDQ_INITIALIZE_FW_SRQ_LVL_LAST CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_2 262 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_MASK 0xf0UL 263 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_SFT 4 264 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_4K (0x0UL << 4) 265 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_8K (0x1UL << 4) 266 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_64K (0x2UL << 4) 267 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_2M (0x3UL << 4) 268 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_8M (0x4UL << 4) 269 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_1G (0x5UL << 4) 270 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_LAST CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_1G 271 u8 cq_pg_size_cq_lvl; 272 #define CMDQ_INITIALIZE_FW_CQ_LVL_MASK 0xfUL 273 #define CMDQ_INITIALIZE_FW_CQ_LVL_SFT 0 274 #define CMDQ_INITIALIZE_FW_CQ_LVL_LVL_0 0x0UL 275 #define CMDQ_INITIALIZE_FW_CQ_LVL_LVL_1 0x1UL 276 #define CMDQ_INITIALIZE_FW_CQ_LVL_LVL_2 0x2UL 277 #define CMDQ_INITIALIZE_FW_CQ_LVL_LAST CMDQ_INITIALIZE_FW_CQ_LVL_LVL_2 278 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_MASK 0xf0UL 279 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_SFT 4 280 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_4K (0x0UL << 4) 281 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_8K (0x1UL << 4) 282 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_64K (0x2UL << 4) 283 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_2M (0x3UL << 4) 284 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_8M (0x4UL << 4) 285 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_1G (0x5UL << 4) 286 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_LAST CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_1G 287 u8 tqm_pg_size_tqm_lvl; 288 #define CMDQ_INITIALIZE_FW_TQM_LVL_MASK 0xfUL 289 #define CMDQ_INITIALIZE_FW_TQM_LVL_SFT 0 290 #define CMDQ_INITIALIZE_FW_TQM_LVL_LVL_0 0x0UL 291 #define CMDQ_INITIALIZE_FW_TQM_LVL_LVL_1 0x1UL 292 #define CMDQ_INITIALIZE_FW_TQM_LVL_LVL_2 0x2UL 293 #define CMDQ_INITIALIZE_FW_TQM_LVL_LAST CMDQ_INITIALIZE_FW_TQM_LVL_LVL_2 294 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_MASK 0xf0UL 295 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_SFT 4 296 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_4K (0x0UL << 4) 297 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_8K (0x1UL << 4) 298 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_64K (0x2UL << 4) 299 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_2M (0x3UL << 4) 300 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_8M (0x4UL << 4) 301 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_1G (0x5UL << 4) 302 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_LAST CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_1G 303 u8 tim_pg_size_tim_lvl; 304 #define CMDQ_INITIALIZE_FW_TIM_LVL_MASK 0xfUL 305 #define CMDQ_INITIALIZE_FW_TIM_LVL_SFT 0 306 #define CMDQ_INITIALIZE_FW_TIM_LVL_LVL_0 0x0UL 307 #define CMDQ_INITIALIZE_FW_TIM_LVL_LVL_1 0x1UL 308 #define CMDQ_INITIALIZE_FW_TIM_LVL_LVL_2 0x2UL 309 #define CMDQ_INITIALIZE_FW_TIM_LVL_LAST CMDQ_INITIALIZE_FW_TIM_LVL_LVL_2 310 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_MASK 0xf0UL 311 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_SFT 4 312 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_4K (0x0UL << 4) 313 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_8K (0x1UL << 4) 314 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_64K (0x2UL << 4) 315 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_2M (0x3UL << 4) 316 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_8M (0x4UL << 4) 317 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_1G (0x5UL << 4) 318 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_LAST CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_1G 319 __le16 log2_dbr_pg_size; 320 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_MASK 0xfUL 321 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_SFT 0 322 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_4K 0x0UL 323 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_8K 0x1UL 324 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_16K 0x2UL 325 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_32K 0x3UL 326 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_64K 0x4UL 327 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_128K 0x5UL 328 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_256K 0x6UL 329 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_512K 0x7UL 330 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_1M 0x8UL 331 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_2M 0x9UL 332 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_4M 0xaUL 333 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_8M 0xbUL 334 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_16M 0xcUL 335 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_32M 0xdUL 336 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_64M 0xeUL 337 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_128M 0xfUL 338 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_LAST \ 339 CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_128M 340 #define CMDQ_INITIALIZE_FW_RSVD_MASK 0xfff0UL 341 #define CMDQ_INITIALIZE_FW_RSVD_SFT 4 342 __le64 qpc_page_dir; 343 __le64 mrw_page_dir; 344 __le64 srq_page_dir; 345 __le64 cq_page_dir; 346 __le64 tqm_page_dir; 347 __le64 tim_page_dir; 348 __le32 number_of_qp; 349 __le32 number_of_mrw; 350 __le32 number_of_srq; 351 __le32 number_of_cq; 352 __le32 max_qp_per_vf; 353 __le32 max_mrw_per_vf; 354 __le32 max_srq_per_vf; 355 __le32 max_cq_per_vf; 356 __le32 max_gid_per_vf; 357 __le32 stat_ctx_id; 358 }; 359 360 /* creq_initialize_fw_resp (size:128b/16B) */ 361 struct creq_initialize_fw_resp { 362 u8 type; 363 #define CREQ_INITIALIZE_FW_RESP_TYPE_MASK 0x3fUL 364 #define CREQ_INITIALIZE_FW_RESP_TYPE_SFT 0 365 #define CREQ_INITIALIZE_FW_RESP_TYPE_QP_EVENT 0x38UL 366 #define CREQ_INITIALIZE_FW_RESP_TYPE_LAST CREQ_INITIALIZE_FW_RESP_TYPE_QP_EVENT 367 u8 status; 368 __le16 cookie; 369 __le32 reserved32; 370 u8 v; 371 #define CREQ_INITIALIZE_FW_RESP_V 0x1UL 372 u8 event; 373 #define CREQ_INITIALIZE_FW_RESP_EVENT_INITIALIZE_FW 0x80UL 374 #define CREQ_INITIALIZE_FW_RESP_EVENT_LAST \ 375 CREQ_INITIALIZE_FW_RESP_EVENT_INITIALIZE_FW 376 u8 reserved48[6]; 377 }; 378 379 /* cmdq_deinitialize_fw (size:128b/16B) */ 380 struct cmdq_deinitialize_fw { 381 u8 opcode; 382 #define CMDQ_DEINITIALIZE_FW_OPCODE_DEINITIALIZE_FW 0x81UL 383 #define CMDQ_DEINITIALIZE_FW_OPCODE_LAST \ 384 CMDQ_DEINITIALIZE_FW_OPCODE_DEINITIALIZE_FW 385 u8 cmd_size; 386 __le16 flags; 387 __le16 cookie; 388 u8 resp_size; 389 u8 reserved8; 390 __le64 resp_addr; 391 }; 392 393 /* creq_deinitialize_fw_resp (size:128b/16B) */ 394 struct creq_deinitialize_fw_resp { 395 u8 type; 396 #define CREQ_DEINITIALIZE_FW_RESP_TYPE_MASK 0x3fUL 397 #define CREQ_DEINITIALIZE_FW_RESP_TYPE_SFT 0 398 #define CREQ_DEINITIALIZE_FW_RESP_TYPE_QP_EVENT 0x38UL 399 #define CREQ_DEINITIALIZE_FW_RESP_TYPE_LAST CREQ_DEINITIALIZE_FW_RESP_TYPE_QP_EVENT 400 u8 status; 401 __le16 cookie; 402 __le32 reserved32; 403 u8 v; 404 #define CREQ_DEINITIALIZE_FW_RESP_V 0x1UL 405 u8 event; 406 #define CREQ_DEINITIALIZE_FW_RESP_EVENT_DEINITIALIZE_FW 0x81UL 407 #define CREQ_DEINITIALIZE_FW_RESP_EVENT_LAST \ 408 CREQ_DEINITIALIZE_FW_RESP_EVENT_DEINITIALIZE_FW 409 u8 reserved48[6]; 410 }; 411 412 /* cmdq_create_qp (size:768b/96B) */ 413 struct cmdq_create_qp { 414 u8 opcode; 415 #define CMDQ_CREATE_QP_OPCODE_CREATE_QP 0x1UL 416 #define CMDQ_CREATE_QP_OPCODE_LAST CMDQ_CREATE_QP_OPCODE_CREATE_QP 417 u8 cmd_size; 418 __le16 flags; 419 __le16 cookie; 420 u8 resp_size; 421 u8 reserved8; 422 __le64 resp_addr; 423 __le64 qp_handle; 424 __le32 qp_flags; 425 #define CMDQ_CREATE_QP_QP_FLAGS_SRQ_USED 0x1UL 426 #define CMDQ_CREATE_QP_QP_FLAGS_FORCE_COMPLETION 0x2UL 427 #define CMDQ_CREATE_QP_QP_FLAGS_RESERVED_LKEY_ENABLE 0x4UL 428 #define CMDQ_CREATE_QP_QP_FLAGS_FR_PMR_ENABLED 0x8UL 429 #define CMDQ_CREATE_QP_QP_FLAGS_VARIABLE_SIZED_WQE_ENABLED 0x10UL 430 #define CMDQ_CREATE_QP_QP_FLAGS_OPTIMIZED_TRANSMIT_ENABLED 0x20UL 431 #define CMDQ_CREATE_QP_QP_FLAGS_RESPONDER_UD_CQE_WITH_CFA 0x40UL 432 #define CMDQ_CREATE_QP_QP_FLAGS_EXT_STATS_ENABLED 0x80UL 433 #define CMDQ_CREATE_QP_QP_FLAGS_LAST \ 434 CMDQ_CREATE_QP_QP_FLAGS_EXT_STATS_ENABLED 435 u8 type; 436 #define CMDQ_CREATE_QP_TYPE_RC 0x2UL 437 #define CMDQ_CREATE_QP_TYPE_UD 0x4UL 438 #define CMDQ_CREATE_QP_TYPE_RAW_ETHERTYPE 0x6UL 439 #define CMDQ_CREATE_QP_TYPE_GSI 0x7UL 440 #define CMDQ_CREATE_QP_TYPE_LAST CMDQ_CREATE_QP_TYPE_GSI 441 u8 sq_pg_size_sq_lvl; 442 #define CMDQ_CREATE_QP_SQ_LVL_MASK 0xfUL 443 #define CMDQ_CREATE_QP_SQ_LVL_SFT 0 444 #define CMDQ_CREATE_QP_SQ_LVL_LVL_0 0x0UL 445 #define CMDQ_CREATE_QP_SQ_LVL_LVL_1 0x1UL 446 #define CMDQ_CREATE_QP_SQ_LVL_LVL_2 0x2UL 447 #define CMDQ_CREATE_QP_SQ_LVL_LAST CMDQ_CREATE_QP_SQ_LVL_LVL_2 448 #define CMDQ_CREATE_QP_SQ_PG_SIZE_MASK 0xf0UL 449 #define CMDQ_CREATE_QP_SQ_PG_SIZE_SFT 4 450 #define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_4K (0x0UL << 4) 451 #define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_8K (0x1UL << 4) 452 #define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_64K (0x2UL << 4) 453 #define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_2M (0x3UL << 4) 454 #define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_8M (0x4UL << 4) 455 #define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_1G (0x5UL << 4) 456 #define CMDQ_CREATE_QP_SQ_PG_SIZE_LAST CMDQ_CREATE_QP_SQ_PG_SIZE_PG_1G 457 u8 rq_pg_size_rq_lvl; 458 #define CMDQ_CREATE_QP_RQ_LVL_MASK 0xfUL 459 #define CMDQ_CREATE_QP_RQ_LVL_SFT 0 460 #define CMDQ_CREATE_QP_RQ_LVL_LVL_0 0x0UL 461 #define CMDQ_CREATE_QP_RQ_LVL_LVL_1 0x1UL 462 #define CMDQ_CREATE_QP_RQ_LVL_LVL_2 0x2UL 463 #define CMDQ_CREATE_QP_RQ_LVL_LAST CMDQ_CREATE_QP_RQ_LVL_LVL_2 464 #define CMDQ_CREATE_QP_RQ_PG_SIZE_MASK 0xf0UL 465 #define CMDQ_CREATE_QP_RQ_PG_SIZE_SFT 4 466 #define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_4K (0x0UL << 4) 467 #define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_8K (0x1UL << 4) 468 #define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_64K (0x2UL << 4) 469 #define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_2M (0x3UL << 4) 470 #define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_8M (0x4UL << 4) 471 #define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_1G (0x5UL << 4) 472 #define CMDQ_CREATE_QP_RQ_PG_SIZE_LAST CMDQ_CREATE_QP_RQ_PG_SIZE_PG_1G 473 u8 unused_0; 474 __le32 dpi; 475 __le32 sq_size; 476 __le32 rq_size; 477 __le16 sq_fwo_sq_sge; 478 #define CMDQ_CREATE_QP_SQ_SGE_MASK 0xfUL 479 #define CMDQ_CREATE_QP_SQ_SGE_SFT 0 480 #define CMDQ_CREATE_QP_SQ_FWO_MASK 0xfff0UL 481 #define CMDQ_CREATE_QP_SQ_FWO_SFT 4 482 __le16 rq_fwo_rq_sge; 483 #define CMDQ_CREATE_QP_RQ_SGE_MASK 0xfUL 484 #define CMDQ_CREATE_QP_RQ_SGE_SFT 0 485 #define CMDQ_CREATE_QP_RQ_FWO_MASK 0xfff0UL 486 #define CMDQ_CREATE_QP_RQ_FWO_SFT 4 487 __le32 scq_cid; 488 __le32 rcq_cid; 489 __le32 srq_cid; 490 __le32 pd_id; 491 __le64 sq_pbl; 492 __le64 rq_pbl; 493 __le64 irrq_addr; 494 __le64 orrq_addr; 495 }; 496 497 /* creq_create_qp_resp (size:128b/16B) */ 498 struct creq_create_qp_resp { 499 u8 type; 500 #define CREQ_CREATE_QP_RESP_TYPE_MASK 0x3fUL 501 #define CREQ_CREATE_QP_RESP_TYPE_SFT 0 502 #define CREQ_CREATE_QP_RESP_TYPE_QP_EVENT 0x38UL 503 #define CREQ_CREATE_QP_RESP_TYPE_LAST CREQ_CREATE_QP_RESP_TYPE_QP_EVENT 504 u8 status; 505 __le16 cookie; 506 __le32 xid; 507 u8 v; 508 #define CREQ_CREATE_QP_RESP_V 0x1UL 509 u8 event; 510 #define CREQ_CREATE_QP_RESP_EVENT_CREATE_QP 0x1UL 511 #define CREQ_CREATE_QP_RESP_EVENT_LAST CREQ_CREATE_QP_RESP_EVENT_CREATE_QP 512 u8 optimized_transmit_enabled; 513 u8 reserved48[5]; 514 }; 515 516 /* cmdq_destroy_qp (size:192b/24B) */ 517 struct cmdq_destroy_qp { 518 u8 opcode; 519 #define CMDQ_DESTROY_QP_OPCODE_DESTROY_QP 0x2UL 520 #define CMDQ_DESTROY_QP_OPCODE_LAST CMDQ_DESTROY_QP_OPCODE_DESTROY_QP 521 u8 cmd_size; 522 __le16 flags; 523 __le16 cookie; 524 u8 resp_size; 525 u8 reserved8; 526 __le64 resp_addr; 527 __le32 qp_cid; 528 __le32 unused_0; 529 }; 530 531 /* creq_destroy_qp_resp (size:128b/16B) */ 532 struct creq_destroy_qp_resp { 533 u8 type; 534 #define CREQ_DESTROY_QP_RESP_TYPE_MASK 0x3fUL 535 #define CREQ_DESTROY_QP_RESP_TYPE_SFT 0 536 #define CREQ_DESTROY_QP_RESP_TYPE_QP_EVENT 0x38UL 537 #define CREQ_DESTROY_QP_RESP_TYPE_LAST CREQ_DESTROY_QP_RESP_TYPE_QP_EVENT 538 u8 status; 539 __le16 cookie; 540 __le32 xid; 541 u8 v; 542 #define CREQ_DESTROY_QP_RESP_V 0x1UL 543 u8 event; 544 #define CREQ_DESTROY_QP_RESP_EVENT_DESTROY_QP 0x2UL 545 #define CREQ_DESTROY_QP_RESP_EVENT_LAST CREQ_DESTROY_QP_RESP_EVENT_DESTROY_QP 546 u8 reserved48[6]; 547 }; 548 549 /* cmdq_modify_qp (size:1024b/128B) */ 550 struct cmdq_modify_qp { 551 u8 opcode; 552 #define CMDQ_MODIFY_QP_OPCODE_MODIFY_QP 0x3UL 553 #define CMDQ_MODIFY_QP_OPCODE_LAST CMDQ_MODIFY_QP_OPCODE_MODIFY_QP 554 u8 cmd_size; 555 __le16 flags; 556 __le16 cookie; 557 u8 resp_size; 558 u8 qp_type; 559 #define CMDQ_MODIFY_QP_QP_TYPE_RC 0x2UL 560 #define CMDQ_MODIFY_QP_QP_TYPE_UD 0x4UL 561 #define CMDQ_MODIFY_QP_QP_TYPE_RAW_ETHERTYPE 0x6UL 562 #define CMDQ_MODIFY_QP_QP_TYPE_GSI 0x7UL 563 #define CMDQ_MODIFY_QP_QP_TYPE_LAST CMDQ_MODIFY_QP_QP_TYPE_GSI 564 __le64 resp_addr; 565 __le32 modify_mask; 566 #define CMDQ_MODIFY_QP_MODIFY_MASK_STATE 0x1UL 567 #define CMDQ_MODIFY_QP_MODIFY_MASK_EN_SQD_ASYNC_NOTIFY 0x2UL 568 #define CMDQ_MODIFY_QP_MODIFY_MASK_ACCESS 0x4UL 569 #define CMDQ_MODIFY_QP_MODIFY_MASK_PKEY 0x8UL 570 #define CMDQ_MODIFY_QP_MODIFY_MASK_QKEY 0x10UL 571 #define CMDQ_MODIFY_QP_MODIFY_MASK_DGID 0x20UL 572 #define CMDQ_MODIFY_QP_MODIFY_MASK_FLOW_LABEL 0x40UL 573 #define CMDQ_MODIFY_QP_MODIFY_MASK_SGID_INDEX 0x80UL 574 #define CMDQ_MODIFY_QP_MODIFY_MASK_HOP_LIMIT 0x100UL 575 #define CMDQ_MODIFY_QP_MODIFY_MASK_TRAFFIC_CLASS 0x200UL 576 #define CMDQ_MODIFY_QP_MODIFY_MASK_DEST_MAC 0x400UL 577 #define CMDQ_MODIFY_QP_MODIFY_MASK_PINGPONG_PUSH_MODE 0x800UL 578 #define CMDQ_MODIFY_QP_MODIFY_MASK_PATH_MTU 0x1000UL 579 #define CMDQ_MODIFY_QP_MODIFY_MASK_TIMEOUT 0x2000UL 580 #define CMDQ_MODIFY_QP_MODIFY_MASK_RETRY_CNT 0x4000UL 581 #define CMDQ_MODIFY_QP_MODIFY_MASK_RNR_RETRY 0x8000UL 582 #define CMDQ_MODIFY_QP_MODIFY_MASK_RQ_PSN 0x10000UL 583 #define CMDQ_MODIFY_QP_MODIFY_MASK_MAX_RD_ATOMIC 0x20000UL 584 #define CMDQ_MODIFY_QP_MODIFY_MASK_MIN_RNR_TIMER 0x40000UL 585 #define CMDQ_MODIFY_QP_MODIFY_MASK_SQ_PSN 0x80000UL 586 #define CMDQ_MODIFY_QP_MODIFY_MASK_MAX_DEST_RD_ATOMIC 0x100000UL 587 #define CMDQ_MODIFY_QP_MODIFY_MASK_SQ_SIZE 0x200000UL 588 #define CMDQ_MODIFY_QP_MODIFY_MASK_RQ_SIZE 0x400000UL 589 #define CMDQ_MODIFY_QP_MODIFY_MASK_SQ_SGE 0x800000UL 590 #define CMDQ_MODIFY_QP_MODIFY_MASK_RQ_SGE 0x1000000UL 591 #define CMDQ_MODIFY_QP_MODIFY_MASK_MAX_INLINE_DATA 0x2000000UL 592 #define CMDQ_MODIFY_QP_MODIFY_MASK_DEST_QP_ID 0x4000000UL 593 #define CMDQ_MODIFY_QP_MODIFY_MASK_SRC_MAC 0x8000000UL 594 #define CMDQ_MODIFY_QP_MODIFY_MASK_VLAN_ID 0x10000000UL 595 #define CMDQ_MODIFY_QP_MODIFY_MASK_ENABLE_CC 0x20000000UL 596 #define CMDQ_MODIFY_QP_MODIFY_MASK_TOS_ECN 0x40000000UL 597 #define CMDQ_MODIFY_QP_MODIFY_MASK_TOS_DSCP 0x80000000UL 598 __le32 qp_cid; 599 u8 network_type_en_sqd_async_notify_new_state; 600 #define CMDQ_MODIFY_QP_NEW_STATE_MASK 0xfUL 601 #define CMDQ_MODIFY_QP_NEW_STATE_SFT 0 602 #define CMDQ_MODIFY_QP_NEW_STATE_RESET 0x0UL 603 #define CMDQ_MODIFY_QP_NEW_STATE_INIT 0x1UL 604 #define CMDQ_MODIFY_QP_NEW_STATE_RTR 0x2UL 605 #define CMDQ_MODIFY_QP_NEW_STATE_RTS 0x3UL 606 #define CMDQ_MODIFY_QP_NEW_STATE_SQD 0x4UL 607 #define CMDQ_MODIFY_QP_NEW_STATE_SQE 0x5UL 608 #define CMDQ_MODIFY_QP_NEW_STATE_ERR 0x6UL 609 #define CMDQ_MODIFY_QP_NEW_STATE_LAST CMDQ_MODIFY_QP_NEW_STATE_ERR 610 #define CMDQ_MODIFY_QP_EN_SQD_ASYNC_NOTIFY 0x10UL 611 #define CMDQ_MODIFY_QP_UNUSED1 0x20UL 612 #define CMDQ_MODIFY_QP_NETWORK_TYPE_MASK 0xc0UL 613 #define CMDQ_MODIFY_QP_NETWORK_TYPE_SFT 6 614 #define CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV1 (0x0UL << 6) 615 #define CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV2_IPV4 (0x2UL << 6) 616 #define CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV2_IPV6 (0x3UL << 6) 617 #define CMDQ_MODIFY_QP_NETWORK_TYPE_LAST CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV2_IPV6 618 u8 access; 619 #define CMDQ_MODIFY_QP_ACCESS_REMOTE_ATOMIC_REMOTE_READ_REMOTE_WRITE_LOCAL_WRITE_MASK 0xffUL 620 #define CMDQ_MODIFY_QP_ACCESS_REMOTE_ATOMIC_REMOTE_READ_REMOTE_WRITE_LOCAL_WRITE_SFT 0 621 #define CMDQ_MODIFY_QP_ACCESS_LOCAL_WRITE 0x1UL 622 #define CMDQ_MODIFY_QP_ACCESS_REMOTE_WRITE 0x2UL 623 #define CMDQ_MODIFY_QP_ACCESS_REMOTE_READ 0x4UL 624 #define CMDQ_MODIFY_QP_ACCESS_REMOTE_ATOMIC 0x8UL 625 __le16 pkey; 626 __le32 qkey; 627 __le32 dgid[4]; 628 __le32 flow_label; 629 __le16 sgid_index; 630 u8 hop_limit; 631 u8 traffic_class; 632 __le16 dest_mac[3]; 633 u8 tos_dscp_tos_ecn; 634 #define CMDQ_MODIFY_QP_TOS_ECN_MASK 0x3UL 635 #define CMDQ_MODIFY_QP_TOS_ECN_SFT 0 636 #define CMDQ_MODIFY_QP_TOS_DSCP_MASK 0xfcUL 637 #define CMDQ_MODIFY_QP_TOS_DSCP_SFT 2 638 u8 path_mtu_pingpong_push_enable; 639 #define CMDQ_MODIFY_QP_PINGPONG_PUSH_ENABLE 0x1UL 640 #define CMDQ_MODIFY_QP_UNUSED3_MASK 0xeUL 641 #define CMDQ_MODIFY_QP_UNUSED3_SFT 1 642 #define CMDQ_MODIFY_QP_PATH_MTU_MASK 0xf0UL 643 #define CMDQ_MODIFY_QP_PATH_MTU_SFT 4 644 #define CMDQ_MODIFY_QP_PATH_MTU_MTU_256 (0x0UL << 4) 645 #define CMDQ_MODIFY_QP_PATH_MTU_MTU_512 (0x1UL << 4) 646 #define CMDQ_MODIFY_QP_PATH_MTU_MTU_1024 (0x2UL << 4) 647 #define CMDQ_MODIFY_QP_PATH_MTU_MTU_2048 (0x3UL << 4) 648 #define CMDQ_MODIFY_QP_PATH_MTU_MTU_4096 (0x4UL << 4) 649 #define CMDQ_MODIFY_QP_PATH_MTU_MTU_8192 (0x5UL << 4) 650 #define CMDQ_MODIFY_QP_PATH_MTU_LAST CMDQ_MODIFY_QP_PATH_MTU_MTU_8192 651 u8 timeout; 652 u8 retry_cnt; 653 u8 rnr_retry; 654 u8 min_rnr_timer; 655 __le32 rq_psn; 656 __le32 sq_psn; 657 u8 max_rd_atomic; 658 u8 max_dest_rd_atomic; 659 __le16 enable_cc; 660 #define CMDQ_MODIFY_QP_ENABLE_CC 0x1UL 661 #define CMDQ_MODIFY_QP_UNUSED15_MASK 0xfffeUL 662 #define CMDQ_MODIFY_QP_UNUSED15_SFT 1 663 __le32 sq_size; 664 __le32 rq_size; 665 __le16 sq_sge; 666 __le16 rq_sge; 667 __le32 max_inline_data; 668 __le32 dest_qp_id; 669 __le32 pingpong_push_dpi; 670 __le16 src_mac[3]; 671 __le16 vlan_pcp_vlan_dei_vlan_id; 672 #define CMDQ_MODIFY_QP_VLAN_ID_MASK 0xfffUL 673 #define CMDQ_MODIFY_QP_VLAN_ID_SFT 0 674 #define CMDQ_MODIFY_QP_VLAN_DEI 0x1000UL 675 #define CMDQ_MODIFY_QP_VLAN_PCP_MASK 0xe000UL 676 #define CMDQ_MODIFY_QP_VLAN_PCP_SFT 13 677 __le64 irrq_addr; 678 __le64 orrq_addr; 679 __le32 ext_modify_mask; 680 #define CMDQ_MODIFY_QP_EXT_MODIFY_MASK_EXT_STATS_CTX 0x1UL 681 #define CMDQ_MODIFY_QP_EXT_MODIFY_MASK_SCHQ_ID_VALID 0x2UL 682 __le32 ext_stats_ctx_id; 683 __le16 schq_id; 684 __le16 unused_0; 685 __le32 reserved32; 686 }; 687 688 /* creq_modify_qp_resp (size:128b/16B) */ 689 struct creq_modify_qp_resp { 690 u8 type; 691 #define CREQ_MODIFY_QP_RESP_TYPE_MASK 0x3fUL 692 #define CREQ_MODIFY_QP_RESP_TYPE_SFT 0 693 #define CREQ_MODIFY_QP_RESP_TYPE_QP_EVENT 0x38UL 694 #define CREQ_MODIFY_QP_RESP_TYPE_LAST CREQ_MODIFY_QP_RESP_TYPE_QP_EVENT 695 u8 status; 696 __le16 cookie; 697 __le32 xid; 698 u8 v; 699 #define CREQ_MODIFY_QP_RESP_V 0x1UL 700 u8 event; 701 #define CREQ_MODIFY_QP_RESP_EVENT_MODIFY_QP 0x3UL 702 #define CREQ_MODIFY_QP_RESP_EVENT_LAST CREQ_MODIFY_QP_RESP_EVENT_MODIFY_QP 703 u8 pingpong_push_state_index_enabled; 704 #define CREQ_MODIFY_QP_RESP_PINGPONG_PUSH_ENABLED 0x1UL 705 #define CREQ_MODIFY_QP_RESP_PINGPONG_PUSH_INDEX_MASK 0xeUL 706 #define CREQ_MODIFY_QP_RESP_PINGPONG_PUSH_INDEX_SFT 1 707 #define CREQ_MODIFY_QP_RESP_PINGPONG_PUSH_STATE 0x10UL 708 u8 reserved8; 709 __le32 lag_src_mac; 710 }; 711 712 /* cmdq_query_qp (size:192b/24B) */ 713 struct cmdq_query_qp { 714 u8 opcode; 715 #define CMDQ_QUERY_QP_OPCODE_QUERY_QP 0x4UL 716 #define CMDQ_QUERY_QP_OPCODE_LAST CMDQ_QUERY_QP_OPCODE_QUERY_QP 717 u8 cmd_size; 718 __le16 flags; 719 __le16 cookie; 720 u8 resp_size; 721 u8 reserved8; 722 __le64 resp_addr; 723 __le32 qp_cid; 724 __le32 unused_0; 725 }; 726 727 /* creq_query_qp_resp (size:128b/16B) */ 728 struct creq_query_qp_resp { 729 u8 type; 730 #define CREQ_QUERY_QP_RESP_TYPE_MASK 0x3fUL 731 #define CREQ_QUERY_QP_RESP_TYPE_SFT 0 732 #define CREQ_QUERY_QP_RESP_TYPE_QP_EVENT 0x38UL 733 #define CREQ_QUERY_QP_RESP_TYPE_LAST CREQ_QUERY_QP_RESP_TYPE_QP_EVENT 734 u8 status; 735 __le16 cookie; 736 __le32 size; 737 u8 v; 738 #define CREQ_QUERY_QP_RESP_V 0x1UL 739 u8 event; 740 #define CREQ_QUERY_QP_RESP_EVENT_QUERY_QP 0x4UL 741 #define CREQ_QUERY_QP_RESP_EVENT_LAST CREQ_QUERY_QP_RESP_EVENT_QUERY_QP 742 u8 reserved48[6]; 743 }; 744 745 /* creq_query_qp_resp_sb (size:832b/104B) */ 746 struct creq_query_qp_resp_sb { 747 u8 opcode; 748 #define CREQ_QUERY_QP_RESP_SB_OPCODE_QUERY_QP 0x4UL 749 #define CREQ_QUERY_QP_RESP_SB_OPCODE_LAST CREQ_QUERY_QP_RESP_SB_OPCODE_QUERY_QP 750 u8 status; 751 __le16 cookie; 752 __le16 flags; 753 u8 resp_size; 754 u8 reserved8; 755 __le32 xid; 756 u8 en_sqd_async_notify_state; 757 #define CREQ_QUERY_QP_RESP_SB_STATE_MASK 0xfUL 758 #define CREQ_QUERY_QP_RESP_SB_STATE_SFT 0 759 #define CREQ_QUERY_QP_RESP_SB_STATE_RESET 0x0UL 760 #define CREQ_QUERY_QP_RESP_SB_STATE_INIT 0x1UL 761 #define CREQ_QUERY_QP_RESP_SB_STATE_RTR 0x2UL 762 #define CREQ_QUERY_QP_RESP_SB_STATE_RTS 0x3UL 763 #define CREQ_QUERY_QP_RESP_SB_STATE_SQD 0x4UL 764 #define CREQ_QUERY_QP_RESP_SB_STATE_SQE 0x5UL 765 #define CREQ_QUERY_QP_RESP_SB_STATE_ERR 0x6UL 766 #define CREQ_QUERY_QP_RESP_SB_STATE_LAST CREQ_QUERY_QP_RESP_SB_STATE_ERR 767 #define CREQ_QUERY_QP_RESP_SB_EN_SQD_ASYNC_NOTIFY 0x10UL 768 #define CREQ_QUERY_QP_RESP_SB_UNUSED3_MASK 0xe0UL 769 #define CREQ_QUERY_QP_RESP_SB_UNUSED3_SFT 5 770 u8 access; 771 #define \ 772 CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_ATOMIC_REMOTE_READ_REMOTE_WRITE_LOCAL_WRITE_MASK\ 773 0xffUL 774 #define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_ATOMIC_REMOTE_READ_REMOTE_WRITE_LOCAL_WRITE_SFT\ 775 0 776 #define CREQ_QUERY_QP_RESP_SB_ACCESS_LOCAL_WRITE 0x1UL 777 #define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_WRITE 0x2UL 778 #define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_READ 0x4UL 779 #define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_ATOMIC 0x8UL 780 __le16 pkey; 781 __le32 qkey; 782 __le32 reserved32; 783 __le32 dgid[4]; 784 __le32 flow_label; 785 __le16 sgid_index; 786 u8 hop_limit; 787 u8 traffic_class; 788 __le16 dest_mac[3]; 789 __le16 path_mtu_dest_vlan_id; 790 #define CREQ_QUERY_QP_RESP_SB_DEST_VLAN_ID_MASK 0xfffUL 791 #define CREQ_QUERY_QP_RESP_SB_DEST_VLAN_ID_SFT 0 792 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MASK 0xf000UL 793 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_SFT 12 794 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_256 (0x0UL << 12) 795 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_512 (0x1UL << 12) 796 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_1024 (0x2UL << 12) 797 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_2048 (0x3UL << 12) 798 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_4096 (0x4UL << 12) 799 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_8192 (0x5UL << 12) 800 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_LAST CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_8192 801 u8 timeout; 802 u8 retry_cnt; 803 u8 rnr_retry; 804 u8 min_rnr_timer; 805 __le32 rq_psn; 806 __le32 sq_psn; 807 u8 max_rd_atomic; 808 u8 max_dest_rd_atomic; 809 u8 tos_dscp_tos_ecn; 810 #define CREQ_QUERY_QP_RESP_SB_TOS_ECN_MASK 0x3UL 811 #define CREQ_QUERY_QP_RESP_SB_TOS_ECN_SFT 0 812 #define CREQ_QUERY_QP_RESP_SB_TOS_DSCP_MASK 0xfcUL 813 #define CREQ_QUERY_QP_RESP_SB_TOS_DSCP_SFT 2 814 u8 enable_cc; 815 #define CREQ_QUERY_QP_RESP_SB_ENABLE_CC 0x1UL 816 __le32 sq_size; 817 __le32 rq_size; 818 __le16 sq_sge; 819 __le16 rq_sge; 820 __le32 max_inline_data; 821 __le32 dest_qp_id; 822 __le16 port_id; 823 u8 unused_0; 824 u8 stat_collection_id; 825 __le16 src_mac[3]; 826 __le16 vlan_pcp_vlan_dei_vlan_id; 827 #define CREQ_QUERY_QP_RESP_SB_VLAN_ID_MASK 0xfffUL 828 #define CREQ_QUERY_QP_RESP_SB_VLAN_ID_SFT 0 829 #define CREQ_QUERY_QP_RESP_SB_VLAN_DEI 0x1000UL 830 #define CREQ_QUERY_QP_RESP_SB_VLAN_PCP_MASK 0xe000UL 831 #define CREQ_QUERY_QP_RESP_SB_VLAN_PCP_SFT 13 832 }; 833 834 /* cmdq_query_qp_extend (size:192b/24B) */ 835 struct cmdq_query_qp_extend { 836 u8 opcode; 837 #define CMDQ_QUERY_QP_EXTEND_OPCODE_QUERY_QP_EXTEND 0x91UL 838 #define CMDQ_QUERY_QP_EXTEND_OPCODE_LAST CMDQ_QUERY_QP_EXTEND_OPCODE_QUERY_QP_EXTEND 839 u8 cmd_size; 840 __le16 flags; 841 __le16 cookie; 842 u8 resp_size; 843 u8 num_qps; 844 __le64 resp_addr; 845 __le32 function_id; 846 #define CMDQ_QUERY_QP_EXTEND_PF_NUM_MASK 0xffUL 847 #define CMDQ_QUERY_QP_EXTEND_PF_NUM_SFT 0 848 #define CMDQ_QUERY_QP_EXTEND_VF_NUM_MASK 0xffff00UL 849 #define CMDQ_QUERY_QP_EXTEND_VF_NUM_SFT 8 850 #define CMDQ_QUERY_QP_EXTEND_VF_VALID 0x1000000UL 851 __le32 current_index; 852 }; 853 854 /* creq_query_qp_extend_resp (size:128b/16B) */ 855 struct creq_query_qp_extend_resp { 856 u8 type; 857 #define CREQ_QUERY_QP_EXTEND_RESP_TYPE_MASK 0x3fUL 858 #define CREQ_QUERY_QP_EXTEND_RESP_TYPE_SFT 0 859 #define CREQ_QUERY_QP_EXTEND_RESP_TYPE_QP_EVENT 0x38UL 860 #define CREQ_QUERY_QP_EXTEND_RESP_TYPE_LAST CREQ_QUERY_QP_EXTEND_RESP_TYPE_QP_EVENT 861 u8 status; 862 __le16 cookie; 863 __le32 size; 864 u8 v; 865 #define CREQ_QUERY_QP_EXTEND_RESP_V 0x1UL 866 u8 event; 867 #define CREQ_QUERY_QP_EXTEND_RESP_EVENT_QUERY_QP_EXTEND 0x91UL 868 #define CREQ_QUERY_QP_EXTEND_RESP_EVENT_LAST CREQ_QUERY_QP_EXTEND_RESP_EVENT_QUERY_QP_EXTEND 869 __le16 reserved16; 870 __le32 current_index; 871 }; 872 873 /* creq_query_qp_extend_resp_sb (size:384b/48B) */ 874 struct creq_query_qp_extend_resp_sb { 875 u8 opcode; 876 #define CREQ_QUERY_QP_EXTEND_RESP_SB_OPCODE_QUERY_QP_EXTEND 0x91UL 877 #define CREQ_QUERY_QP_EXTEND_RESP_SB_OPCODE_LAST \ 878 CREQ_QUERY_QP_EXTEND_RESP_SB_OPCODE_QUERY_QP_EXTEND 879 u8 status; 880 __le16 cookie; 881 __le16 flags; 882 u8 resp_size; 883 u8 reserved8; 884 __le32 xid; 885 u8 state; 886 #define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_MASK 0xfUL 887 #define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_SFT 0 888 #define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_RESET 0x0UL 889 #define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_INIT 0x1UL 890 #define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_RTR 0x2UL 891 #define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_RTS 0x3UL 892 #define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_SQD 0x4UL 893 #define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_SQE 0x5UL 894 #define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_ERR 0x6UL 895 #define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_LAST CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_ERR 896 #define CREQ_QUERY_QP_EXTEND_RESP_SB_UNUSED4_MASK 0xf0UL 897 #define CREQ_QUERY_QP_EXTEND_RESP_SB_UNUSED4_SFT 4 898 u8 reserved_8; 899 __le16 port_id; 900 __le32 qkey; 901 __le16 sgid_index; 902 u8 network_type; 903 #define CREQ_QUERY_QP_EXTEND_RESP_SB_NETWORK_TYPE_ROCEV1 0x0UL 904 #define CREQ_QUERY_QP_EXTEND_RESP_SB_NETWORK_TYPE_ROCEV2_IPV4 0x2UL 905 #define CREQ_QUERY_QP_EXTEND_RESP_SB_NETWORK_TYPE_ROCEV2_IPV6 0x3UL 906 #define CREQ_QUERY_QP_EXTEND_RESP_SB_NETWORK_TYPE_LAST \ 907 CREQ_QUERY_QP_EXTEND_RESP_SB_NETWORK_TYPE_ROCEV2_IPV6 908 u8 unused_0; 909 __le32 dgid[4]; 910 __le32 dest_qp_id; 911 u8 stat_collection_id; 912 u8 reservred_8; 913 __le16 reserved_16; 914 }; 915 916 /* creq_query_qp_extend_resp_sb_tlv (size:512b/64B) */ 917 struct creq_query_qp_extend_resp_sb_tlv { 918 __le16 cmd_discr; 919 u8 reserved_8b; 920 u8 tlv_flags; 921 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_MORE 0x1UL 922 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_MORE_LAST 0x0UL 923 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_MORE_NOT_LAST 0x1UL 924 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_REQUIRED 0x2UL 925 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_REQUIRED_NO (0x0UL << 1) 926 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES (0x1UL << 1) 927 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_REQUIRED_LAST \ 928 CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES 929 __le16 tlv_type; 930 __le16 length; 931 u8 total_size; 932 u8 reserved56[7]; 933 u8 opcode; 934 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_OPCODE_QUERY_QP_EXTEND 0x91UL 935 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_OPCODE_LAST \ 936 CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_OPCODE_QUERY_QP_EXTEND 937 u8 status; 938 __le16 cookie; 939 __le16 flags; 940 u8 resp_size; 941 u8 reserved8; 942 __le32 xid; 943 u8 state; 944 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_MASK 0xfUL 945 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_SFT 0 946 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_RESET 0x0UL 947 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_INIT 0x1UL 948 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_RTR 0x2UL 949 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_RTS 0x3UL 950 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_SQD 0x4UL 951 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_SQE 0x5UL 952 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_ERR 0x6UL 953 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_LAST \ 954 CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_ERR 955 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_UNUSED4_MASK 0xf0UL 956 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_UNUSED4_SFT 4 957 u8 reserved_8; 958 __le16 port_id; 959 __le32 qkey; 960 __le16 sgid_index; 961 u8 network_type; 962 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_NETWORK_TYPE_ROCEV1 0x0UL 963 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_NETWORK_TYPE_ROCEV2_IPV4 0x2UL 964 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_NETWORK_TYPE_ROCEV2_IPV6 0x3UL 965 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_NETWORK_TYPE_LAST \ 966 CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_NETWORK_TYPE_ROCEV2_IPV6 967 u8 unused_0; 968 __le32 dgid[4]; 969 __le32 dest_qp_id; 970 u8 stat_collection_id; 971 u8 reservred_8; 972 __le16 reserved_16; 973 }; 974 975 /* cmdq_create_srq (size:384b/48B) */ 976 struct cmdq_create_srq { 977 u8 opcode; 978 #define CMDQ_CREATE_SRQ_OPCODE_CREATE_SRQ 0x5UL 979 #define CMDQ_CREATE_SRQ_OPCODE_LAST CMDQ_CREATE_SRQ_OPCODE_CREATE_SRQ 980 u8 cmd_size; 981 __le16 flags; 982 __le16 cookie; 983 u8 resp_size; 984 u8 reserved8; 985 __le64 resp_addr; 986 __le64 srq_handle; 987 __le16 pg_size_lvl; 988 #define CMDQ_CREATE_SRQ_LVL_MASK 0x3UL 989 #define CMDQ_CREATE_SRQ_LVL_SFT 0 990 #define CMDQ_CREATE_SRQ_LVL_LVL_0 0x0UL 991 #define CMDQ_CREATE_SRQ_LVL_LVL_1 0x1UL 992 #define CMDQ_CREATE_SRQ_LVL_LVL_2 0x2UL 993 #define CMDQ_CREATE_SRQ_LVL_LAST CMDQ_CREATE_SRQ_LVL_LVL_2 994 #define CMDQ_CREATE_SRQ_PG_SIZE_MASK 0x1cUL 995 #define CMDQ_CREATE_SRQ_PG_SIZE_SFT 2 996 #define CMDQ_CREATE_SRQ_PG_SIZE_PG_4K (0x0UL << 2) 997 #define CMDQ_CREATE_SRQ_PG_SIZE_PG_8K (0x1UL << 2) 998 #define CMDQ_CREATE_SRQ_PG_SIZE_PG_64K (0x2UL << 2) 999 #define CMDQ_CREATE_SRQ_PG_SIZE_PG_2M (0x3UL << 2) 1000 #define CMDQ_CREATE_SRQ_PG_SIZE_PG_8M (0x4UL << 2) 1001 #define CMDQ_CREATE_SRQ_PG_SIZE_PG_1G (0x5UL << 2) 1002 #define CMDQ_CREATE_SRQ_PG_SIZE_LAST CMDQ_CREATE_SRQ_PG_SIZE_PG_1G 1003 #define CMDQ_CREATE_SRQ_UNUSED11_MASK 0xffe0UL 1004 #define CMDQ_CREATE_SRQ_UNUSED11_SFT 5 1005 __le16 eventq_id; 1006 #define CMDQ_CREATE_SRQ_EVENTQ_ID_MASK 0xfffUL 1007 #define CMDQ_CREATE_SRQ_EVENTQ_ID_SFT 0 1008 #define CMDQ_CREATE_SRQ_UNUSED4_MASK 0xf000UL 1009 #define CMDQ_CREATE_SRQ_UNUSED4_SFT 12 1010 __le16 srq_size; 1011 __le16 srq_fwo; 1012 __le32 dpi; 1013 __le32 pd_id; 1014 __le64 pbl; 1015 }; 1016 1017 /* creq_create_srq_resp (size:128b/16B) */ 1018 struct creq_create_srq_resp { 1019 u8 type; 1020 #define CREQ_CREATE_SRQ_RESP_TYPE_MASK 0x3fUL 1021 #define CREQ_CREATE_SRQ_RESP_TYPE_SFT 0 1022 #define CREQ_CREATE_SRQ_RESP_TYPE_QP_EVENT 0x38UL 1023 #define CREQ_CREATE_SRQ_RESP_TYPE_LAST CREQ_CREATE_SRQ_RESP_TYPE_QP_EVENT 1024 u8 status; 1025 __le16 cookie; 1026 __le32 xid; 1027 u8 v; 1028 #define CREQ_CREATE_SRQ_RESP_V 0x1UL 1029 u8 event; 1030 #define CREQ_CREATE_SRQ_RESP_EVENT_CREATE_SRQ 0x5UL 1031 #define CREQ_CREATE_SRQ_RESP_EVENT_LAST CREQ_CREATE_SRQ_RESP_EVENT_CREATE_SRQ 1032 u8 reserved48[6]; 1033 }; 1034 1035 /* cmdq_destroy_srq (size:192b/24B) */ 1036 struct cmdq_destroy_srq { 1037 u8 opcode; 1038 #define CMDQ_DESTROY_SRQ_OPCODE_DESTROY_SRQ 0x6UL 1039 #define CMDQ_DESTROY_SRQ_OPCODE_LAST CMDQ_DESTROY_SRQ_OPCODE_DESTROY_SRQ 1040 u8 cmd_size; 1041 __le16 flags; 1042 __le16 cookie; 1043 u8 resp_size; 1044 u8 reserved8; 1045 __le64 resp_addr; 1046 __le32 srq_cid; 1047 __le32 unused_0; 1048 }; 1049 1050 /* creq_destroy_srq_resp (size:128b/16B) */ 1051 struct creq_destroy_srq_resp { 1052 u8 type; 1053 #define CREQ_DESTROY_SRQ_RESP_TYPE_MASK 0x3fUL 1054 #define CREQ_DESTROY_SRQ_RESP_TYPE_SFT 0 1055 #define CREQ_DESTROY_SRQ_RESP_TYPE_QP_EVENT 0x38UL 1056 #define CREQ_DESTROY_SRQ_RESP_TYPE_LAST CREQ_DESTROY_SRQ_RESP_TYPE_QP_EVENT 1057 u8 status; 1058 __le16 cookie; 1059 __le32 xid; 1060 u8 v; 1061 #define CREQ_DESTROY_SRQ_RESP_V 0x1UL 1062 u8 event; 1063 #define CREQ_DESTROY_SRQ_RESP_EVENT_DESTROY_SRQ 0x6UL 1064 #define CREQ_DESTROY_SRQ_RESP_EVENT_LAST CREQ_DESTROY_SRQ_RESP_EVENT_DESTROY_SRQ 1065 __le16 enable_for_arm[3]; 1066 #define CREQ_DESTROY_SRQ_RESP_UNUSED0_MASK 0xffffUL 1067 #define CREQ_DESTROY_SRQ_RESP_UNUSED0_SFT 0 1068 #define CREQ_DESTROY_SRQ_RESP_ENABLE_FOR_ARM_MASK 0x30000UL 1069 #define CREQ_DESTROY_SRQ_RESP_ENABLE_FOR_ARM_SFT 16 1070 }; 1071 1072 /* cmdq_query_srq (size:192b/24B) */ 1073 struct cmdq_query_srq { 1074 u8 opcode; 1075 #define CMDQ_QUERY_SRQ_OPCODE_QUERY_SRQ 0x8UL 1076 #define CMDQ_QUERY_SRQ_OPCODE_LAST CMDQ_QUERY_SRQ_OPCODE_QUERY_SRQ 1077 u8 cmd_size; 1078 __le16 flags; 1079 __le16 cookie; 1080 u8 resp_size; 1081 u8 reserved8; 1082 __le64 resp_addr; 1083 __le32 srq_cid; 1084 __le32 unused_0; 1085 }; 1086 1087 /* creq_query_srq_resp (size:128b/16B) */ 1088 struct creq_query_srq_resp { 1089 u8 type; 1090 #define CREQ_QUERY_SRQ_RESP_TYPE_MASK 0x3fUL 1091 #define CREQ_QUERY_SRQ_RESP_TYPE_SFT 0 1092 #define CREQ_QUERY_SRQ_RESP_TYPE_QP_EVENT 0x38UL 1093 #define CREQ_QUERY_SRQ_RESP_TYPE_LAST CREQ_QUERY_SRQ_RESP_TYPE_QP_EVENT 1094 u8 status; 1095 __le16 cookie; 1096 __le32 size; 1097 u8 v; 1098 #define CREQ_QUERY_SRQ_RESP_V 0x1UL 1099 u8 event; 1100 #define CREQ_QUERY_SRQ_RESP_EVENT_QUERY_SRQ 0x8UL 1101 #define CREQ_QUERY_SRQ_RESP_EVENT_LAST CREQ_QUERY_SRQ_RESP_EVENT_QUERY_SRQ 1102 u8 reserved48[6]; 1103 }; 1104 1105 /* creq_query_srq_resp_sb (size:256b/32B) */ 1106 struct creq_query_srq_resp_sb { 1107 u8 opcode; 1108 #define CREQ_QUERY_SRQ_RESP_SB_OPCODE_QUERY_SRQ 0x8UL 1109 #define CREQ_QUERY_SRQ_RESP_SB_OPCODE_LAST CREQ_QUERY_SRQ_RESP_SB_OPCODE_QUERY_SRQ 1110 u8 status; 1111 __le16 cookie; 1112 __le16 flags; 1113 u8 resp_size; 1114 u8 reserved8; 1115 __le32 xid; 1116 __le16 srq_limit; 1117 __le16 reserved16; 1118 __le32 data[4]; 1119 }; 1120 1121 /* cmdq_create_cq (size:384b/48B) */ 1122 struct cmdq_create_cq { 1123 u8 opcode; 1124 #define CMDQ_CREATE_CQ_OPCODE_CREATE_CQ 0x9UL 1125 #define CMDQ_CREATE_CQ_OPCODE_LAST CMDQ_CREATE_CQ_OPCODE_CREATE_CQ 1126 u8 cmd_size; 1127 __le16 flags; 1128 #define CMDQ_CREATE_CQ_FLAGS_DISABLE_CQ_OVERFLOW_DETECTION 0x1UL 1129 __le16 cookie; 1130 u8 resp_size; 1131 u8 reserved8; 1132 __le64 resp_addr; 1133 __le64 cq_handle; 1134 __le32 pg_size_lvl; 1135 #define CMDQ_CREATE_CQ_LVL_MASK 0x3UL 1136 #define CMDQ_CREATE_CQ_LVL_SFT 0 1137 #define CMDQ_CREATE_CQ_LVL_LVL_0 0x0UL 1138 #define CMDQ_CREATE_CQ_LVL_LVL_1 0x1UL 1139 #define CMDQ_CREATE_CQ_LVL_LVL_2 0x2UL 1140 #define CMDQ_CREATE_CQ_LVL_LAST CMDQ_CREATE_CQ_LVL_LVL_2 1141 #define CMDQ_CREATE_CQ_PG_SIZE_MASK 0x1cUL 1142 #define CMDQ_CREATE_CQ_PG_SIZE_SFT 2 1143 #define CMDQ_CREATE_CQ_PG_SIZE_PG_4K (0x0UL << 2) 1144 #define CMDQ_CREATE_CQ_PG_SIZE_PG_8K (0x1UL << 2) 1145 #define CMDQ_CREATE_CQ_PG_SIZE_PG_64K (0x2UL << 2) 1146 #define CMDQ_CREATE_CQ_PG_SIZE_PG_2M (0x3UL << 2) 1147 #define CMDQ_CREATE_CQ_PG_SIZE_PG_8M (0x4UL << 2) 1148 #define CMDQ_CREATE_CQ_PG_SIZE_PG_1G (0x5UL << 2) 1149 #define CMDQ_CREATE_CQ_PG_SIZE_LAST CMDQ_CREATE_CQ_PG_SIZE_PG_1G 1150 #define CMDQ_CREATE_CQ_UNUSED27_MASK 0xffffffe0UL 1151 #define CMDQ_CREATE_CQ_UNUSED27_SFT 5 1152 __le32 cq_fco_cnq_id; 1153 #define CMDQ_CREATE_CQ_CNQ_ID_MASK 0xfffUL 1154 #define CMDQ_CREATE_CQ_CNQ_ID_SFT 0 1155 #define CMDQ_CREATE_CQ_CQ_FCO_MASK 0xfffff000UL 1156 #define CMDQ_CREATE_CQ_CQ_FCO_SFT 12 1157 __le32 dpi; 1158 __le32 cq_size; 1159 __le64 pbl; 1160 }; 1161 1162 /* creq_create_cq_resp (size:128b/16B) */ 1163 struct creq_create_cq_resp { 1164 u8 type; 1165 #define CREQ_CREATE_CQ_RESP_TYPE_MASK 0x3fUL 1166 #define CREQ_CREATE_CQ_RESP_TYPE_SFT 0 1167 #define CREQ_CREATE_CQ_RESP_TYPE_QP_EVENT 0x38UL 1168 #define CREQ_CREATE_CQ_RESP_TYPE_LAST CREQ_CREATE_CQ_RESP_TYPE_QP_EVENT 1169 u8 status; 1170 __le16 cookie; 1171 __le32 xid; 1172 u8 v; 1173 #define CREQ_CREATE_CQ_RESP_V 0x1UL 1174 u8 event; 1175 #define CREQ_CREATE_CQ_RESP_EVENT_CREATE_CQ 0x9UL 1176 #define CREQ_CREATE_CQ_RESP_EVENT_LAST CREQ_CREATE_CQ_RESP_EVENT_CREATE_CQ 1177 u8 reserved48[6]; 1178 }; 1179 1180 /* cmdq_destroy_cq (size:192b/24B) */ 1181 struct cmdq_destroy_cq { 1182 u8 opcode; 1183 #define CMDQ_DESTROY_CQ_OPCODE_DESTROY_CQ 0xaUL 1184 #define CMDQ_DESTROY_CQ_OPCODE_LAST CMDQ_DESTROY_CQ_OPCODE_DESTROY_CQ 1185 u8 cmd_size; 1186 __le16 flags; 1187 __le16 cookie; 1188 u8 resp_size; 1189 u8 reserved8; 1190 __le64 resp_addr; 1191 __le32 cq_cid; 1192 __le32 unused_0; 1193 }; 1194 1195 /* creq_destroy_cq_resp (size:128b/16B) */ 1196 struct creq_destroy_cq_resp { 1197 u8 type; 1198 #define CREQ_DESTROY_CQ_RESP_TYPE_MASK 0x3fUL 1199 #define CREQ_DESTROY_CQ_RESP_TYPE_SFT 0 1200 #define CREQ_DESTROY_CQ_RESP_TYPE_QP_EVENT 0x38UL 1201 #define CREQ_DESTROY_CQ_RESP_TYPE_LAST CREQ_DESTROY_CQ_RESP_TYPE_QP_EVENT 1202 u8 status; 1203 __le16 cookie; 1204 __le32 xid; 1205 u8 v; 1206 #define CREQ_DESTROY_CQ_RESP_V 0x1UL 1207 u8 event; 1208 #define CREQ_DESTROY_CQ_RESP_EVENT_DESTROY_CQ 0xaUL 1209 #define CREQ_DESTROY_CQ_RESP_EVENT_LAST CREQ_DESTROY_CQ_RESP_EVENT_DESTROY_CQ 1210 __le16 cq_arm_lvl; 1211 #define CREQ_DESTROY_CQ_RESP_CQ_ARM_LVL_MASK 0x3UL 1212 #define CREQ_DESTROY_CQ_RESP_CQ_ARM_LVL_SFT 0 1213 __le16 total_cnq_events; 1214 __le16 reserved16; 1215 }; 1216 1217 /* cmdq_resize_cq (size:320b/40B) */ 1218 struct cmdq_resize_cq { 1219 u8 opcode; 1220 #define CMDQ_RESIZE_CQ_OPCODE_RESIZE_CQ 0xcUL 1221 #define CMDQ_RESIZE_CQ_OPCODE_LAST CMDQ_RESIZE_CQ_OPCODE_RESIZE_CQ 1222 u8 cmd_size; 1223 __le16 flags; 1224 __le16 cookie; 1225 u8 resp_size; 1226 u8 reserved8; 1227 __le64 resp_addr; 1228 __le32 cq_cid; 1229 __le32 new_cq_size_pg_size_lvl; 1230 #define CMDQ_RESIZE_CQ_LVL_MASK 0x3UL 1231 #define CMDQ_RESIZE_CQ_LVL_SFT 0 1232 #define CMDQ_RESIZE_CQ_LVL_LVL_0 0x0UL 1233 #define CMDQ_RESIZE_CQ_LVL_LVL_1 0x1UL 1234 #define CMDQ_RESIZE_CQ_LVL_LVL_2 0x2UL 1235 #define CMDQ_RESIZE_CQ_LVL_LAST CMDQ_RESIZE_CQ_LVL_LVL_2 1236 #define CMDQ_RESIZE_CQ_PG_SIZE_MASK 0x1cUL 1237 #define CMDQ_RESIZE_CQ_PG_SIZE_SFT 2 1238 #define CMDQ_RESIZE_CQ_PG_SIZE_PG_4K (0x0UL << 2) 1239 #define CMDQ_RESIZE_CQ_PG_SIZE_PG_8K (0x1UL << 2) 1240 #define CMDQ_RESIZE_CQ_PG_SIZE_PG_64K (0x2UL << 2) 1241 #define CMDQ_RESIZE_CQ_PG_SIZE_PG_2M (0x3UL << 2) 1242 #define CMDQ_RESIZE_CQ_PG_SIZE_PG_8M (0x4UL << 2) 1243 #define CMDQ_RESIZE_CQ_PG_SIZE_PG_1G (0x5UL << 2) 1244 #define CMDQ_RESIZE_CQ_PG_SIZE_LAST CMDQ_RESIZE_CQ_PG_SIZE_PG_1G 1245 #define CMDQ_RESIZE_CQ_NEW_CQ_SIZE_MASK 0x1fffffe0UL 1246 #define CMDQ_RESIZE_CQ_NEW_CQ_SIZE_SFT 5 1247 __le64 new_pbl; 1248 __le32 new_cq_fco; 1249 __le32 unused_0; 1250 }; 1251 1252 /* creq_resize_cq_resp (size:128b/16B) */ 1253 struct creq_resize_cq_resp { 1254 u8 type; 1255 #define CREQ_RESIZE_CQ_RESP_TYPE_MASK 0x3fUL 1256 #define CREQ_RESIZE_CQ_RESP_TYPE_SFT 0 1257 #define CREQ_RESIZE_CQ_RESP_TYPE_QP_EVENT 0x38UL 1258 #define CREQ_RESIZE_CQ_RESP_TYPE_LAST CREQ_RESIZE_CQ_RESP_TYPE_QP_EVENT 1259 u8 status; 1260 __le16 cookie; 1261 __le32 xid; 1262 u8 v; 1263 #define CREQ_RESIZE_CQ_RESP_V 0x1UL 1264 u8 event; 1265 #define CREQ_RESIZE_CQ_RESP_EVENT_RESIZE_CQ 0xcUL 1266 #define CREQ_RESIZE_CQ_RESP_EVENT_LAST CREQ_RESIZE_CQ_RESP_EVENT_RESIZE_CQ 1267 u8 reserved48[6]; 1268 }; 1269 1270 /* cmdq_allocate_mrw (size:256b/32B) */ 1271 struct cmdq_allocate_mrw { 1272 u8 opcode; 1273 #define CMDQ_ALLOCATE_MRW_OPCODE_ALLOCATE_MRW 0xdUL 1274 #define CMDQ_ALLOCATE_MRW_OPCODE_LAST CMDQ_ALLOCATE_MRW_OPCODE_ALLOCATE_MRW 1275 u8 cmd_size; 1276 __le16 flags; 1277 __le16 cookie; 1278 u8 resp_size; 1279 u8 reserved8; 1280 __le64 resp_addr; 1281 __le64 mrw_handle; 1282 u8 mrw_flags; 1283 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MASK 0xfUL 1284 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_SFT 0 1285 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MR 0x0UL 1286 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_PMR 0x1UL 1287 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1 0x2UL 1288 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A 0x3UL 1289 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B 0x4UL 1290 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_LAST CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B 1291 #define CMDQ_ALLOCATE_MRW_UNUSED4_MASK 0xf0UL 1292 #define CMDQ_ALLOCATE_MRW_UNUSED4_SFT 4 1293 u8 access; 1294 #define CMDQ_ALLOCATE_MRW_ACCESS_CONSUMER_OWNED_KEY 0x20UL 1295 __le16 unused16; 1296 __le32 pd_id; 1297 }; 1298 1299 /* creq_allocate_mrw_resp (size:128b/16B) */ 1300 struct creq_allocate_mrw_resp { 1301 u8 type; 1302 #define CREQ_ALLOCATE_MRW_RESP_TYPE_MASK 0x3fUL 1303 #define CREQ_ALLOCATE_MRW_RESP_TYPE_SFT 0 1304 #define CREQ_ALLOCATE_MRW_RESP_TYPE_QP_EVENT 0x38UL 1305 #define CREQ_ALLOCATE_MRW_RESP_TYPE_LAST CREQ_ALLOCATE_MRW_RESP_TYPE_QP_EVENT 1306 u8 status; 1307 __le16 cookie; 1308 __le32 xid; 1309 u8 v; 1310 #define CREQ_ALLOCATE_MRW_RESP_V 0x1UL 1311 u8 event; 1312 #define CREQ_ALLOCATE_MRW_RESP_EVENT_ALLOCATE_MRW 0xdUL 1313 #define CREQ_ALLOCATE_MRW_RESP_EVENT_LAST CREQ_ALLOCATE_MRW_RESP_EVENT_ALLOCATE_MRW 1314 u8 reserved48[6]; 1315 }; 1316 1317 /* cmdq_deallocate_key (size:192b/24B) */ 1318 struct cmdq_deallocate_key { 1319 u8 opcode; 1320 #define CMDQ_DEALLOCATE_KEY_OPCODE_DEALLOCATE_KEY 0xeUL 1321 #define CMDQ_DEALLOCATE_KEY_OPCODE_LAST CMDQ_DEALLOCATE_KEY_OPCODE_DEALLOCATE_KEY 1322 u8 cmd_size; 1323 __le16 flags; 1324 __le16 cookie; 1325 u8 resp_size; 1326 u8 reserved8; 1327 __le64 resp_addr; 1328 u8 mrw_flags; 1329 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MASK 0xfUL 1330 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_SFT 0 1331 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MR 0x0UL 1332 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_PMR 0x1UL 1333 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE1 0x2UL 1334 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE2A 0x3UL 1335 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE2B 0x4UL 1336 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_LAST CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE2B 1337 #define CMDQ_DEALLOCATE_KEY_UNUSED4_MASK 0xf0UL 1338 #define CMDQ_DEALLOCATE_KEY_UNUSED4_SFT 4 1339 u8 unused24[3]; 1340 __le32 key; 1341 }; 1342 1343 /* creq_deallocate_key_resp (size:128b/16B) */ 1344 struct creq_deallocate_key_resp { 1345 u8 type; 1346 #define CREQ_DEALLOCATE_KEY_RESP_TYPE_MASK 0x3fUL 1347 #define CREQ_DEALLOCATE_KEY_RESP_TYPE_SFT 0 1348 #define CREQ_DEALLOCATE_KEY_RESP_TYPE_QP_EVENT 0x38UL 1349 #define CREQ_DEALLOCATE_KEY_RESP_TYPE_LAST CREQ_DEALLOCATE_KEY_RESP_TYPE_QP_EVENT 1350 u8 status; 1351 __le16 cookie; 1352 __le32 xid; 1353 u8 v; 1354 #define CREQ_DEALLOCATE_KEY_RESP_V 0x1UL 1355 u8 event; 1356 #define CREQ_DEALLOCATE_KEY_RESP_EVENT_DEALLOCATE_KEY 0xeUL 1357 #define CREQ_DEALLOCATE_KEY_RESP_EVENT_LAST CREQ_DEALLOCATE_KEY_RESP_EVENT_DEALLOCATE_KEY 1358 __le16 reserved16; 1359 __le32 bound_window_info; 1360 }; 1361 1362 /* cmdq_register_mr (size:384b/48B) */ 1363 struct cmdq_register_mr { 1364 u8 opcode; 1365 #define CMDQ_REGISTER_MR_OPCODE_REGISTER_MR 0xfUL 1366 #define CMDQ_REGISTER_MR_OPCODE_LAST CMDQ_REGISTER_MR_OPCODE_REGISTER_MR 1367 u8 cmd_size; 1368 __le16 flags; 1369 #define CMDQ_REGISTER_MR_FLAGS_ALLOC_MR 0x1UL 1370 __le16 cookie; 1371 u8 resp_size; 1372 u8 reserved8; 1373 __le64 resp_addr; 1374 u8 log2_pg_size_lvl; 1375 #define CMDQ_REGISTER_MR_LVL_MASK 0x3UL 1376 #define CMDQ_REGISTER_MR_LVL_SFT 0 1377 #define CMDQ_REGISTER_MR_LVL_LVL_0 0x0UL 1378 #define CMDQ_REGISTER_MR_LVL_LVL_1 0x1UL 1379 #define CMDQ_REGISTER_MR_LVL_LVL_2 0x2UL 1380 #define CMDQ_REGISTER_MR_LVL_LAST CMDQ_REGISTER_MR_LVL_LVL_2 1381 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_MASK 0x7cUL 1382 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_SFT 2 1383 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_4K (0xcUL << 2) 1384 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_8K (0xdUL << 2) 1385 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_64K (0x10UL << 2) 1386 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_256K (0x12UL << 2) 1387 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_1M (0x14UL << 2) 1388 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_2M (0x15UL << 2) 1389 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_4M (0x16UL << 2) 1390 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_1G (0x1eUL << 2) 1391 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_LAST CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_1G 1392 #define CMDQ_REGISTER_MR_UNUSED1 0x80UL 1393 u8 access; 1394 #define CMDQ_REGISTER_MR_ACCESS_LOCAL_WRITE 0x1UL 1395 #define CMDQ_REGISTER_MR_ACCESS_REMOTE_READ 0x2UL 1396 #define CMDQ_REGISTER_MR_ACCESS_REMOTE_WRITE 0x4UL 1397 #define CMDQ_REGISTER_MR_ACCESS_REMOTE_ATOMIC 0x8UL 1398 #define CMDQ_REGISTER_MR_ACCESS_MW_BIND 0x10UL 1399 #define CMDQ_REGISTER_MR_ACCESS_ZERO_BASED 0x20UL 1400 __le16 log2_pbl_pg_size; 1401 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_MASK 0x1fUL 1402 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_SFT 0 1403 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_4K 0xcUL 1404 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_8K 0xdUL 1405 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_64K 0x10UL 1406 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_256K 0x12UL 1407 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_1M 0x14UL 1408 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_2M 0x15UL 1409 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_4M 0x16UL 1410 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_1G 0x1eUL 1411 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_LAST CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_1G 1412 #define CMDQ_REGISTER_MR_UNUSED11_MASK 0xffe0UL 1413 #define CMDQ_REGISTER_MR_UNUSED11_SFT 5 1414 __le32 key; 1415 __le64 pbl; 1416 __le64 va; 1417 __le64 mr_size; 1418 }; 1419 1420 /* creq_register_mr_resp (size:128b/16B) */ 1421 struct creq_register_mr_resp { 1422 u8 type; 1423 #define CREQ_REGISTER_MR_RESP_TYPE_MASK 0x3fUL 1424 #define CREQ_REGISTER_MR_RESP_TYPE_SFT 0 1425 #define CREQ_REGISTER_MR_RESP_TYPE_QP_EVENT 0x38UL 1426 #define CREQ_REGISTER_MR_RESP_TYPE_LAST CREQ_REGISTER_MR_RESP_TYPE_QP_EVENT 1427 u8 status; 1428 __le16 cookie; 1429 __le32 xid; 1430 u8 v; 1431 #define CREQ_REGISTER_MR_RESP_V 0x1UL 1432 u8 event; 1433 #define CREQ_REGISTER_MR_RESP_EVENT_REGISTER_MR 0xfUL 1434 #define CREQ_REGISTER_MR_RESP_EVENT_LAST CREQ_REGISTER_MR_RESP_EVENT_REGISTER_MR 1435 u8 reserved48[6]; 1436 }; 1437 1438 /* cmdq_deregister_mr (size:192b/24B) */ 1439 struct cmdq_deregister_mr { 1440 u8 opcode; 1441 #define CMDQ_DEREGISTER_MR_OPCODE_DEREGISTER_MR 0x10UL 1442 #define CMDQ_DEREGISTER_MR_OPCODE_LAST CMDQ_DEREGISTER_MR_OPCODE_DEREGISTER_MR 1443 u8 cmd_size; 1444 __le16 flags; 1445 __le16 cookie; 1446 u8 resp_size; 1447 u8 reserved8; 1448 __le64 resp_addr; 1449 __le32 lkey; 1450 __le32 unused_0; 1451 }; 1452 1453 /* creq_deregister_mr_resp (size:128b/16B) */ 1454 struct creq_deregister_mr_resp { 1455 u8 type; 1456 #define CREQ_DEREGISTER_MR_RESP_TYPE_MASK 0x3fUL 1457 #define CREQ_DEREGISTER_MR_RESP_TYPE_SFT 0 1458 #define CREQ_DEREGISTER_MR_RESP_TYPE_QP_EVENT 0x38UL 1459 #define CREQ_DEREGISTER_MR_RESP_TYPE_LAST CREQ_DEREGISTER_MR_RESP_TYPE_QP_EVENT 1460 u8 status; 1461 __le16 cookie; 1462 __le32 xid; 1463 u8 v; 1464 #define CREQ_DEREGISTER_MR_RESP_V 0x1UL 1465 u8 event; 1466 #define CREQ_DEREGISTER_MR_RESP_EVENT_DEREGISTER_MR 0x10UL 1467 #define CREQ_DEREGISTER_MR_RESP_EVENT_LAST CREQ_DEREGISTER_MR_RESP_EVENT_DEREGISTER_MR 1468 __le16 reserved16; 1469 __le32 bound_windows; 1470 }; 1471 1472 /* cmdq_add_gid (size:384b/48B) */ 1473 struct cmdq_add_gid { 1474 u8 opcode; 1475 #define CMDQ_ADD_GID_OPCODE_ADD_GID 0x11UL 1476 #define CMDQ_ADD_GID_OPCODE_LAST CMDQ_ADD_GID_OPCODE_ADD_GID 1477 u8 cmd_size; 1478 __le16 flags; 1479 __le16 cookie; 1480 u8 resp_size; 1481 u8 reserved8; 1482 __le64 resp_addr; 1483 __be32 gid[4]; 1484 __be16 src_mac[3]; 1485 __le16 vlan; 1486 #define CMDQ_ADD_GID_VLAN_VLAN_EN_TPID_VLAN_ID_MASK 0xffffUL 1487 #define CMDQ_ADD_GID_VLAN_VLAN_EN_TPID_VLAN_ID_SFT 0 1488 #define CMDQ_ADD_GID_VLAN_VLAN_ID_MASK 0xfffUL 1489 #define CMDQ_ADD_GID_VLAN_VLAN_ID_SFT 0 1490 #define CMDQ_ADD_GID_VLAN_TPID_MASK 0x7000UL 1491 #define CMDQ_ADD_GID_VLAN_TPID_SFT 12 1492 #define CMDQ_ADD_GID_VLAN_TPID_TPID_88A8 (0x0UL << 12) 1493 #define CMDQ_ADD_GID_VLAN_TPID_TPID_8100 (0x1UL << 12) 1494 #define CMDQ_ADD_GID_VLAN_TPID_TPID_9100 (0x2UL << 12) 1495 #define CMDQ_ADD_GID_VLAN_TPID_TPID_9200 (0x3UL << 12) 1496 #define CMDQ_ADD_GID_VLAN_TPID_TPID_9300 (0x4UL << 12) 1497 #define CMDQ_ADD_GID_VLAN_TPID_TPID_CFG1 (0x5UL << 12) 1498 #define CMDQ_ADD_GID_VLAN_TPID_TPID_CFG2 (0x6UL << 12) 1499 #define CMDQ_ADD_GID_VLAN_TPID_TPID_CFG3 (0x7UL << 12) 1500 #define CMDQ_ADD_GID_VLAN_TPID_LAST CMDQ_ADD_GID_VLAN_TPID_TPID_CFG3 1501 #define CMDQ_ADD_GID_VLAN_VLAN_EN 0x8000UL 1502 __le16 ipid; 1503 __le16 stats_ctx; 1504 #define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_VALID_STATS_CTX_ID_MASK 0xffffUL 1505 #define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_VALID_STATS_CTX_ID_SFT 0 1506 #define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_ID_MASK 0x7fffUL 1507 #define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_ID_SFT 0 1508 #define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_VALID 0x8000UL 1509 __le32 unused_0; 1510 }; 1511 1512 /* creq_add_gid_resp (size:128b/16B) */ 1513 struct creq_add_gid_resp { 1514 u8 type; 1515 #define CREQ_ADD_GID_RESP_TYPE_MASK 0x3fUL 1516 #define CREQ_ADD_GID_RESP_TYPE_SFT 0 1517 #define CREQ_ADD_GID_RESP_TYPE_QP_EVENT 0x38UL 1518 #define CREQ_ADD_GID_RESP_TYPE_LAST CREQ_ADD_GID_RESP_TYPE_QP_EVENT 1519 u8 status; 1520 __le16 cookie; 1521 __le32 xid; 1522 u8 v; 1523 #define CREQ_ADD_GID_RESP_V 0x1UL 1524 u8 event; 1525 #define CREQ_ADD_GID_RESP_EVENT_ADD_GID 0x11UL 1526 #define CREQ_ADD_GID_RESP_EVENT_LAST CREQ_ADD_GID_RESP_EVENT_ADD_GID 1527 u8 reserved48[6]; 1528 }; 1529 1530 /* cmdq_delete_gid (size:192b/24B) */ 1531 struct cmdq_delete_gid { 1532 u8 opcode; 1533 #define CMDQ_DELETE_GID_OPCODE_DELETE_GID 0x12UL 1534 #define CMDQ_DELETE_GID_OPCODE_LAST CMDQ_DELETE_GID_OPCODE_DELETE_GID 1535 u8 cmd_size; 1536 __le16 flags; 1537 __le16 cookie; 1538 u8 resp_size; 1539 u8 reserved8; 1540 __le64 resp_addr; 1541 __le16 gid_index; 1542 u8 unused_0[6]; 1543 }; 1544 1545 /* creq_delete_gid_resp (size:128b/16B) */ 1546 struct creq_delete_gid_resp { 1547 u8 type; 1548 #define CREQ_DELETE_GID_RESP_TYPE_MASK 0x3fUL 1549 #define CREQ_DELETE_GID_RESP_TYPE_SFT 0 1550 #define CREQ_DELETE_GID_RESP_TYPE_QP_EVENT 0x38UL 1551 #define CREQ_DELETE_GID_RESP_TYPE_LAST CREQ_DELETE_GID_RESP_TYPE_QP_EVENT 1552 u8 status; 1553 __le16 cookie; 1554 __le32 xid; 1555 u8 v; 1556 #define CREQ_DELETE_GID_RESP_V 0x1UL 1557 u8 event; 1558 #define CREQ_DELETE_GID_RESP_EVENT_DELETE_GID 0x12UL 1559 #define CREQ_DELETE_GID_RESP_EVENT_LAST CREQ_DELETE_GID_RESP_EVENT_DELETE_GID 1560 u8 reserved48[6]; 1561 }; 1562 1563 /* cmdq_modify_gid (size:384b/48B) */ 1564 struct cmdq_modify_gid { 1565 u8 opcode; 1566 #define CMDQ_MODIFY_GID_OPCODE_MODIFY_GID 0x17UL 1567 #define CMDQ_MODIFY_GID_OPCODE_LAST CMDQ_MODIFY_GID_OPCODE_MODIFY_GID 1568 u8 cmd_size; 1569 __le16 flags; 1570 __le16 cookie; 1571 u8 resp_size; 1572 u8 reserved8; 1573 __le64 resp_addr; 1574 __be32 gid[4]; 1575 __be16 src_mac[3]; 1576 __le16 vlan; 1577 #define CMDQ_MODIFY_GID_VLAN_VLAN_ID_MASK 0xfffUL 1578 #define CMDQ_MODIFY_GID_VLAN_VLAN_ID_SFT 0 1579 #define CMDQ_MODIFY_GID_VLAN_TPID_MASK 0x7000UL 1580 #define CMDQ_MODIFY_GID_VLAN_TPID_SFT 12 1581 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_88A8 (0x0UL << 12) 1582 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_8100 (0x1UL << 12) 1583 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_9100 (0x2UL << 12) 1584 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_9200 (0x3UL << 12) 1585 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_9300 (0x4UL << 12) 1586 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG1 (0x5UL << 12) 1587 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG2 (0x6UL << 12) 1588 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG3 (0x7UL << 12) 1589 #define CMDQ_MODIFY_GID_VLAN_TPID_LAST CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG3 1590 #define CMDQ_MODIFY_GID_VLAN_VLAN_EN 0x8000UL 1591 __le16 ipid; 1592 __le16 gid_index; 1593 __le16 stats_ctx; 1594 #define CMDQ_MODIFY_GID_STATS_CTX_STATS_CTX_ID_MASK 0x7fffUL 1595 #define CMDQ_MODIFY_GID_STATS_CTX_STATS_CTX_ID_SFT 0 1596 #define CMDQ_MODIFY_GID_STATS_CTX_STATS_CTX_VALID 0x8000UL 1597 __le16 unused_0; 1598 }; 1599 1600 /* creq_modify_gid_resp (size:128b/16B) */ 1601 struct creq_modify_gid_resp { 1602 u8 type; 1603 #define CREQ_MODIFY_GID_RESP_TYPE_MASK 0x3fUL 1604 #define CREQ_MODIFY_GID_RESP_TYPE_SFT 0 1605 #define CREQ_MODIFY_GID_RESP_TYPE_QP_EVENT 0x38UL 1606 #define CREQ_MODIFY_GID_RESP_TYPE_LAST CREQ_MODIFY_GID_RESP_TYPE_QP_EVENT 1607 u8 status; 1608 __le16 cookie; 1609 __le32 xid; 1610 u8 v; 1611 #define CREQ_MODIFY_GID_RESP_V 0x1UL 1612 u8 event; 1613 #define CREQ_MODIFY_GID_RESP_EVENT_ADD_GID 0x11UL 1614 #define CREQ_MODIFY_GID_RESP_EVENT_LAST CREQ_MODIFY_GID_RESP_EVENT_ADD_GID 1615 u8 reserved48[6]; 1616 }; 1617 1618 /* cmdq_query_gid (size:192b/24B) */ 1619 struct cmdq_query_gid { 1620 u8 opcode; 1621 #define CMDQ_QUERY_GID_OPCODE_QUERY_GID 0x18UL 1622 #define CMDQ_QUERY_GID_OPCODE_LAST CMDQ_QUERY_GID_OPCODE_QUERY_GID 1623 u8 cmd_size; 1624 __le16 flags; 1625 __le16 cookie; 1626 u8 resp_size; 1627 u8 reserved8; 1628 __le64 resp_addr; 1629 __le16 gid_index; 1630 u8 unused16[6]; 1631 }; 1632 1633 /* creq_query_gid_resp (size:128b/16B) */ 1634 struct creq_query_gid_resp { 1635 u8 type; 1636 #define CREQ_QUERY_GID_RESP_TYPE_MASK 0x3fUL 1637 #define CREQ_QUERY_GID_RESP_TYPE_SFT 0 1638 #define CREQ_QUERY_GID_RESP_TYPE_QP_EVENT 0x38UL 1639 #define CREQ_QUERY_GID_RESP_TYPE_LAST CREQ_QUERY_GID_RESP_TYPE_QP_EVENT 1640 u8 status; 1641 __le16 cookie; 1642 __le32 size; 1643 u8 v; 1644 #define CREQ_QUERY_GID_RESP_V 0x1UL 1645 u8 event; 1646 #define CREQ_QUERY_GID_RESP_EVENT_QUERY_GID 0x18UL 1647 #define CREQ_QUERY_GID_RESP_EVENT_LAST CREQ_QUERY_GID_RESP_EVENT_QUERY_GID 1648 u8 reserved48[6]; 1649 }; 1650 1651 /* creq_query_gid_resp_sb (size:320b/40B) */ 1652 struct creq_query_gid_resp_sb { 1653 u8 opcode; 1654 #define CREQ_QUERY_GID_RESP_SB_OPCODE_QUERY_GID 0x18UL 1655 #define CREQ_QUERY_GID_RESP_SB_OPCODE_LAST CREQ_QUERY_GID_RESP_SB_OPCODE_QUERY_GID 1656 u8 status; 1657 __le16 cookie; 1658 __le16 flags; 1659 u8 resp_size; 1660 u8 reserved8; 1661 __le32 gid[4]; 1662 __le16 src_mac[3]; 1663 __le16 vlan; 1664 #define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_EN_TPID_VLAN_ID_MASK 0xffffUL 1665 #define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_EN_TPID_VLAN_ID_SFT 0 1666 #define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_ID_MASK 0xfffUL 1667 #define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_ID_SFT 0 1668 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_MASK 0x7000UL 1669 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_SFT 12 1670 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_88A8 (0x0UL << 12) 1671 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_8100 (0x1UL << 12) 1672 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_9100 (0x2UL << 12) 1673 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_9200 (0x3UL << 12) 1674 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_9300 (0x4UL << 12) 1675 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG1 (0x5UL << 12) 1676 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG2 (0x6UL << 12) 1677 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG3 (0x7UL << 12) 1678 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_LAST CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG3 1679 #define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_EN 0x8000UL 1680 __le16 ipid; 1681 __le16 gid_index; 1682 __le32 unused_0; 1683 }; 1684 1685 /* cmdq_create_qp1 (size:640b/80B) */ 1686 struct cmdq_create_qp1 { 1687 u8 opcode; 1688 #define CMDQ_CREATE_QP1_OPCODE_CREATE_QP1 0x13UL 1689 #define CMDQ_CREATE_QP1_OPCODE_LAST CMDQ_CREATE_QP1_OPCODE_CREATE_QP1 1690 u8 cmd_size; 1691 __le16 flags; 1692 __le16 cookie; 1693 u8 resp_size; 1694 u8 reserved8; 1695 __le64 resp_addr; 1696 __le64 qp_handle; 1697 __le32 qp_flags; 1698 #define CMDQ_CREATE_QP1_QP_FLAGS_SRQ_USED 0x1UL 1699 #define CMDQ_CREATE_QP1_QP_FLAGS_FORCE_COMPLETION 0x2UL 1700 #define CMDQ_CREATE_QP1_QP_FLAGS_RESERVED_LKEY_ENABLE 0x4UL 1701 #define CMDQ_CREATE_QP1_QP_FLAGS_LAST CMDQ_CREATE_QP1_QP_FLAGS_RESERVED_LKEY_ENABLE 1702 u8 type; 1703 #define CMDQ_CREATE_QP1_TYPE_GSI 0x1UL 1704 #define CMDQ_CREATE_QP1_TYPE_LAST CMDQ_CREATE_QP1_TYPE_GSI 1705 u8 sq_pg_size_sq_lvl; 1706 #define CMDQ_CREATE_QP1_SQ_LVL_MASK 0xfUL 1707 #define CMDQ_CREATE_QP1_SQ_LVL_SFT 0 1708 #define CMDQ_CREATE_QP1_SQ_LVL_LVL_0 0x0UL 1709 #define CMDQ_CREATE_QP1_SQ_LVL_LVL_1 0x1UL 1710 #define CMDQ_CREATE_QP1_SQ_LVL_LVL_2 0x2UL 1711 #define CMDQ_CREATE_QP1_SQ_LVL_LAST CMDQ_CREATE_QP1_SQ_LVL_LVL_2 1712 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_MASK 0xf0UL 1713 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_SFT 4 1714 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_4K (0x0UL << 4) 1715 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_8K (0x1UL << 4) 1716 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_64K (0x2UL << 4) 1717 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_2M (0x3UL << 4) 1718 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_8M (0x4UL << 4) 1719 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_1G (0x5UL << 4) 1720 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_LAST CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_1G 1721 u8 rq_pg_size_rq_lvl; 1722 #define CMDQ_CREATE_QP1_RQ_LVL_MASK 0xfUL 1723 #define CMDQ_CREATE_QP1_RQ_LVL_SFT 0 1724 #define CMDQ_CREATE_QP1_RQ_LVL_LVL_0 0x0UL 1725 #define CMDQ_CREATE_QP1_RQ_LVL_LVL_1 0x1UL 1726 #define CMDQ_CREATE_QP1_RQ_LVL_LVL_2 0x2UL 1727 #define CMDQ_CREATE_QP1_RQ_LVL_LAST CMDQ_CREATE_QP1_RQ_LVL_LVL_2 1728 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_MASK 0xf0UL 1729 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_SFT 4 1730 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_4K (0x0UL << 4) 1731 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_8K (0x1UL << 4) 1732 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_64K (0x2UL << 4) 1733 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_2M (0x3UL << 4) 1734 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_8M (0x4UL << 4) 1735 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_1G (0x5UL << 4) 1736 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_LAST CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_1G 1737 u8 unused_0; 1738 __le32 dpi; 1739 __le32 sq_size; 1740 __le32 rq_size; 1741 __le16 sq_fwo_sq_sge; 1742 #define CMDQ_CREATE_QP1_SQ_SGE_MASK 0xfUL 1743 #define CMDQ_CREATE_QP1_SQ_SGE_SFT 0 1744 #define CMDQ_CREATE_QP1_SQ_FWO_MASK 0xfff0UL 1745 #define CMDQ_CREATE_QP1_SQ_FWO_SFT 4 1746 __le16 rq_fwo_rq_sge; 1747 #define CMDQ_CREATE_QP1_RQ_SGE_MASK 0xfUL 1748 #define CMDQ_CREATE_QP1_RQ_SGE_SFT 0 1749 #define CMDQ_CREATE_QP1_RQ_FWO_MASK 0xfff0UL 1750 #define CMDQ_CREATE_QP1_RQ_FWO_SFT 4 1751 __le32 scq_cid; 1752 __le32 rcq_cid; 1753 __le32 srq_cid; 1754 __le32 pd_id; 1755 __le64 sq_pbl; 1756 __le64 rq_pbl; 1757 }; 1758 1759 /* creq_create_qp1_resp (size:128b/16B) */ 1760 struct creq_create_qp1_resp { 1761 u8 type; 1762 #define CREQ_CREATE_QP1_RESP_TYPE_MASK 0x3fUL 1763 #define CREQ_CREATE_QP1_RESP_TYPE_SFT 0 1764 #define CREQ_CREATE_QP1_RESP_TYPE_QP_EVENT 0x38UL 1765 #define CREQ_CREATE_QP1_RESP_TYPE_LAST CREQ_CREATE_QP1_RESP_TYPE_QP_EVENT 1766 u8 status; 1767 __le16 cookie; 1768 __le32 xid; 1769 u8 v; 1770 #define CREQ_CREATE_QP1_RESP_V 0x1UL 1771 u8 event; 1772 #define CREQ_CREATE_QP1_RESP_EVENT_CREATE_QP1 0x13UL 1773 #define CREQ_CREATE_QP1_RESP_EVENT_LAST CREQ_CREATE_QP1_RESP_EVENT_CREATE_QP1 1774 u8 reserved48[6]; 1775 }; 1776 1777 /* cmdq_destroy_qp1 (size:192b/24B) */ 1778 struct cmdq_destroy_qp1 { 1779 u8 opcode; 1780 #define CMDQ_DESTROY_QP1_OPCODE_DESTROY_QP1 0x14UL 1781 #define CMDQ_DESTROY_QP1_OPCODE_LAST CMDQ_DESTROY_QP1_OPCODE_DESTROY_QP1 1782 u8 cmd_size; 1783 __le16 flags; 1784 __le16 cookie; 1785 u8 resp_size; 1786 u8 reserved8; 1787 __le64 resp_addr; 1788 __le32 qp1_cid; 1789 __le32 unused_0; 1790 }; 1791 1792 /* creq_destroy_qp1_resp (size:128b/16B) */ 1793 struct creq_destroy_qp1_resp { 1794 u8 type; 1795 #define CREQ_DESTROY_QP1_RESP_TYPE_MASK 0x3fUL 1796 #define CREQ_DESTROY_QP1_RESP_TYPE_SFT 0 1797 #define CREQ_DESTROY_QP1_RESP_TYPE_QP_EVENT 0x38UL 1798 #define CREQ_DESTROY_QP1_RESP_TYPE_LAST CREQ_DESTROY_QP1_RESP_TYPE_QP_EVENT 1799 u8 status; 1800 __le16 cookie; 1801 __le32 xid; 1802 u8 v; 1803 #define CREQ_DESTROY_QP1_RESP_V 0x1UL 1804 u8 event; 1805 #define CREQ_DESTROY_QP1_RESP_EVENT_DESTROY_QP1 0x14UL 1806 #define CREQ_DESTROY_QP1_RESP_EVENT_LAST CREQ_DESTROY_QP1_RESP_EVENT_DESTROY_QP1 1807 u8 reserved48[6]; 1808 }; 1809 1810 /* cmdq_create_ah (size:512b/64B) */ 1811 struct cmdq_create_ah { 1812 u8 opcode; 1813 #define CMDQ_CREATE_AH_OPCODE_CREATE_AH 0x15UL 1814 #define CMDQ_CREATE_AH_OPCODE_LAST CMDQ_CREATE_AH_OPCODE_CREATE_AH 1815 u8 cmd_size; 1816 __le16 flags; 1817 __le16 cookie; 1818 u8 resp_size; 1819 u8 reserved8; 1820 __le64 resp_addr; 1821 __le64 ah_handle; 1822 __le32 dgid[4]; 1823 u8 type; 1824 #define CMDQ_CREATE_AH_TYPE_V1 0x0UL 1825 #define CMDQ_CREATE_AH_TYPE_V2IPV4 0x2UL 1826 #define CMDQ_CREATE_AH_TYPE_V2IPV6 0x3UL 1827 #define CMDQ_CREATE_AH_TYPE_LAST CMDQ_CREATE_AH_TYPE_V2IPV6 1828 u8 hop_limit; 1829 __le16 sgid_index; 1830 __le32 dest_vlan_id_flow_label; 1831 #define CMDQ_CREATE_AH_FLOW_LABEL_MASK 0xfffffUL 1832 #define CMDQ_CREATE_AH_FLOW_LABEL_SFT 0 1833 #define CMDQ_CREATE_AH_DEST_VLAN_ID_MASK 0xfff00000UL 1834 #define CMDQ_CREATE_AH_DEST_VLAN_ID_SFT 20 1835 __le32 pd_id; 1836 __le32 unused_0; 1837 __le16 dest_mac[3]; 1838 u8 traffic_class; 1839 u8 enable_cc; 1840 #define CMDQ_CREATE_AH_ENABLE_CC 0x1UL 1841 }; 1842 1843 /* creq_create_ah_resp (size:128b/16B) */ 1844 struct creq_create_ah_resp { 1845 u8 type; 1846 #define CREQ_CREATE_AH_RESP_TYPE_MASK 0x3fUL 1847 #define CREQ_CREATE_AH_RESP_TYPE_SFT 0 1848 #define CREQ_CREATE_AH_RESP_TYPE_QP_EVENT 0x38UL 1849 #define CREQ_CREATE_AH_RESP_TYPE_LAST CREQ_CREATE_AH_RESP_TYPE_QP_EVENT 1850 u8 status; 1851 __le16 cookie; 1852 __le32 xid; 1853 u8 v; 1854 #define CREQ_CREATE_AH_RESP_V 0x1UL 1855 u8 event; 1856 #define CREQ_CREATE_AH_RESP_EVENT_CREATE_AH 0x15UL 1857 #define CREQ_CREATE_AH_RESP_EVENT_LAST CREQ_CREATE_AH_RESP_EVENT_CREATE_AH 1858 u8 reserved48[6]; 1859 }; 1860 1861 /* cmdq_destroy_ah (size:192b/24B) */ 1862 struct cmdq_destroy_ah { 1863 u8 opcode; 1864 #define CMDQ_DESTROY_AH_OPCODE_DESTROY_AH 0x16UL 1865 #define CMDQ_DESTROY_AH_OPCODE_LAST CMDQ_DESTROY_AH_OPCODE_DESTROY_AH 1866 u8 cmd_size; 1867 __le16 flags; 1868 __le16 cookie; 1869 u8 resp_size; 1870 u8 reserved8; 1871 __le64 resp_addr; 1872 __le32 ah_cid; 1873 __le32 unused_0; 1874 }; 1875 1876 /* creq_destroy_ah_resp (size:128b/16B) */ 1877 struct creq_destroy_ah_resp { 1878 u8 type; 1879 #define CREQ_DESTROY_AH_RESP_TYPE_MASK 0x3fUL 1880 #define CREQ_DESTROY_AH_RESP_TYPE_SFT 0 1881 #define CREQ_DESTROY_AH_RESP_TYPE_QP_EVENT 0x38UL 1882 #define CREQ_DESTROY_AH_RESP_TYPE_LAST CREQ_DESTROY_AH_RESP_TYPE_QP_EVENT 1883 u8 status; 1884 __le16 cookie; 1885 __le32 xid; 1886 u8 v; 1887 #define CREQ_DESTROY_AH_RESP_V 0x1UL 1888 u8 event; 1889 #define CREQ_DESTROY_AH_RESP_EVENT_DESTROY_AH 0x16UL 1890 #define CREQ_DESTROY_AH_RESP_EVENT_LAST CREQ_DESTROY_AH_RESP_EVENT_DESTROY_AH 1891 u8 reserved48[6]; 1892 }; 1893 1894 /* cmdq_query_roce_stats (size:192b/24B) */ 1895 struct cmdq_query_roce_stats { 1896 u8 opcode; 1897 #define CMDQ_QUERY_ROCE_STATS_OPCODE_QUERY_ROCE_STATS 0x8eUL 1898 #define CMDQ_QUERY_ROCE_STATS_OPCODE_LAST CMDQ_QUERY_ROCE_STATS_OPCODE_QUERY_ROCE_STATS 1899 u8 cmd_size; 1900 __le16 flags; 1901 #define CMDQ_QUERY_ROCE_STATS_FLAGS_COLLECTION_ID 0x1UL 1902 #define CMDQ_QUERY_ROCE_STATS_FLAGS_FUNCTION_ID 0x2UL 1903 __le16 cookie; 1904 u8 resp_size; 1905 u8 collection_id; 1906 __le64 resp_addr; 1907 __le32 function_id; 1908 #define CMDQ_QUERY_ROCE_STATS_PF_NUM_MASK 0xffUL 1909 #define CMDQ_QUERY_ROCE_STATS_PF_NUM_SFT 0 1910 #define CMDQ_QUERY_ROCE_STATS_VF_NUM_MASK 0xffff00UL 1911 #define CMDQ_QUERY_ROCE_STATS_VF_NUM_SFT 8 1912 #define CMDQ_QUERY_ROCE_STATS_VF_VALID 0x1000000UL 1913 __le32 reserved32; 1914 }; 1915 1916 /* creq_query_roce_stats_resp (size:128b/16B) */ 1917 struct creq_query_roce_stats_resp { 1918 u8 type; 1919 #define CREQ_QUERY_ROCE_STATS_RESP_TYPE_MASK 0x3fUL 1920 #define CREQ_QUERY_ROCE_STATS_RESP_TYPE_SFT 0 1921 #define CREQ_QUERY_ROCE_STATS_RESP_TYPE_QP_EVENT 0x38UL 1922 #define CREQ_QUERY_ROCE_STATS_RESP_TYPE_LAST CREQ_QUERY_ROCE_STATS_RESP_TYPE_QP_EVENT 1923 u8 status; 1924 __le16 cookie; 1925 __le32 size; 1926 u8 v; 1927 #define CREQ_QUERY_ROCE_STATS_RESP_V 0x1UL 1928 u8 event; 1929 #define CREQ_QUERY_ROCE_STATS_RESP_EVENT_QUERY_ROCE_STATS 0x8eUL 1930 #define CREQ_QUERY_ROCE_STATS_RESP_EVENT_LAST \ 1931 CREQ_QUERY_ROCE_STATS_RESP_EVENT_QUERY_ROCE_STATS 1932 u8 reserved48[6]; 1933 }; 1934 1935 /* creq_query_roce_stats_resp_sb (size:2944b/368B) */ 1936 struct creq_query_roce_stats_resp_sb { 1937 u8 opcode; 1938 #define CREQ_QUERY_ROCE_STATS_RESP_SB_OPCODE_QUERY_ROCE_STATS 0x8eUL 1939 #define CREQ_QUERY_ROCE_STATS_RESP_SB_OPCODE_LAST \ 1940 CREQ_QUERY_ROCE_STATS_RESP_SB_OPCODE_QUERY_ROCE_STATS 1941 u8 status; 1942 __le16 cookie; 1943 __le16 flags; 1944 u8 resp_size; 1945 u8 rsvd; 1946 __le32 num_counters; 1947 __le32 rsvd1; 1948 __le64 to_retransmits; 1949 __le64 seq_err_naks_rcvd; 1950 __le64 max_retry_exceeded; 1951 __le64 rnr_naks_rcvd; 1952 __le64 missing_resp; 1953 __le64 unrecoverable_err; 1954 __le64 bad_resp_err; 1955 __le64 local_qp_op_err; 1956 __le64 local_protection_err; 1957 __le64 mem_mgmt_op_err; 1958 __le64 remote_invalid_req_err; 1959 __le64 remote_access_err; 1960 __le64 remote_op_err; 1961 __le64 dup_req; 1962 __le64 res_exceed_max; 1963 __le64 res_length_mismatch; 1964 __le64 res_exceeds_wqe; 1965 __le64 res_opcode_err; 1966 __le64 res_rx_invalid_rkey; 1967 __le64 res_rx_domain_err; 1968 __le64 res_rx_no_perm; 1969 __le64 res_rx_range_err; 1970 __le64 res_tx_invalid_rkey; 1971 __le64 res_tx_domain_err; 1972 __le64 res_tx_no_perm; 1973 __le64 res_tx_range_err; 1974 __le64 res_irrq_oflow; 1975 __le64 res_unsup_opcode; 1976 __le64 res_unaligned_atomic; 1977 __le64 res_rem_inv_err; 1978 __le64 res_mem_error; 1979 __le64 res_srq_err; 1980 __le64 res_cmp_err; 1981 __le64 res_invalid_dup_rkey; 1982 __le64 res_wqe_format_err; 1983 __le64 res_cq_load_err; 1984 __le64 res_srq_load_err; 1985 __le64 res_tx_pci_err; 1986 __le64 res_rx_pci_err; 1987 __le64 res_oos_drop_count; 1988 __le64 active_qp_count_p0; 1989 __le64 active_qp_count_p1; 1990 __le64 active_qp_count_p2; 1991 __le64 active_qp_count_p3; 1992 }; 1993 1994 /* cmdq_query_roce_stats_ext (size:192b/24B) */ 1995 struct cmdq_query_roce_stats_ext { 1996 u8 opcode; 1997 #define CMDQ_QUERY_ROCE_STATS_EXT_OPCODE_QUERY_ROCE_STATS 0x92UL 1998 #define CMDQ_QUERY_ROCE_STATS_EXT_OPCODE_LAST \ 1999 CMDQ_QUERY_ROCE_STATS_EXT_OPCODE_QUERY_ROCE_STATS 2000 u8 cmd_size; 2001 __le16 flags; 2002 #define CMDQ_QUERY_ROCE_STATS_EXT_FLAGS_COLLECTION_ID 0x1UL 2003 #define CMDQ_QUERY_ROCE_STATS_EXT_FLAGS_FUNCTION_ID 0x2UL 2004 __le16 cookie; 2005 u8 resp_size; 2006 u8 collection_id; 2007 __le64 resp_addr; 2008 __le32 function_id; 2009 #define CMDQ_QUERY_ROCE_STATS_EXT_PF_NUM_MASK 0xffUL 2010 #define CMDQ_QUERY_ROCE_STATS_EXT_PF_NUM_SFT 0 2011 #define CMDQ_QUERY_ROCE_STATS_EXT_VF_NUM_MASK 0xffff00UL 2012 #define CMDQ_QUERY_ROCE_STATS_EXT_VF_NUM_SFT 8 2013 #define CMDQ_QUERY_ROCE_STATS_EXT_VF_VALID 0x1000000UL 2014 __le32 reserved32; 2015 }; 2016 2017 /* creq_query_roce_stats_ext_resp (size:128b/16B) */ 2018 struct creq_query_roce_stats_ext_resp { 2019 u8 type; 2020 #define CREQ_QUERY_ROCE_STATS_EXT_RESP_TYPE_MASK 0x3fUL 2021 #define CREQ_QUERY_ROCE_STATS_EXT_RESP_TYPE_SFT 0 2022 #define CREQ_QUERY_ROCE_STATS_EXT_RESP_TYPE_QP_EVENT 0x38UL 2023 #define CREQ_QUERY_ROCE_STATS_EXT_RESP_TYPE_LAST \ 2024 CREQ_QUERY_ROCE_STATS_EXT_RESP_TYPE_QP_EVENT 2025 u8 status; 2026 __le16 cookie; 2027 __le32 size; 2028 u8 v; 2029 #define CREQ_QUERY_ROCE_STATS_EXT_RESP_V 0x1UL 2030 u8 event; 2031 #define CREQ_QUERY_ROCE_STATS_EXT_RESP_EVENT_QUERY_ROCE_STATS_EXT 0x92UL 2032 #define CREQ_QUERY_ROCE_STATS_EXT_RESP_EVENT_LAST \ 2033 CREQ_QUERY_ROCE_STATS_EXT_RESP_EVENT_QUERY_ROCE_STATS_EXT 2034 u8 reserved48[6]; 2035 }; 2036 2037 /* creq_query_roce_stats_ext_resp_sb (size:1856b/232B) */ 2038 struct creq_query_roce_stats_ext_resp_sb { 2039 u8 opcode; 2040 #define CREQ_QUERY_ROCE_STATS_EXT_RESP_SB_OPCODE_QUERY_ROCE_STATS_EXT 0x92UL 2041 #define CREQ_QUERY_ROCE_STATS_EXT_RESP_SB_OPCODE_LAST \ 2042 CREQ_QUERY_ROCE_STATS_EXT_RESP_SB_OPCODE_QUERY_ROCE_STATS_EXT 2043 u8 status; 2044 __le16 cookie; 2045 __le16 flags; 2046 u8 resp_size; 2047 u8 rsvd; 2048 __le64 tx_atomic_req_pkts; 2049 __le64 tx_read_req_pkts; 2050 __le64 tx_read_res_pkts; 2051 __le64 tx_write_req_pkts; 2052 __le64 tx_send_req_pkts; 2053 __le64 tx_roce_pkts; 2054 __le64 tx_roce_bytes; 2055 __le64 rx_atomic_req_pkts; 2056 __le64 rx_read_req_pkts; 2057 __le64 rx_read_res_pkts; 2058 __le64 rx_write_req_pkts; 2059 __le64 rx_send_req_pkts; 2060 __le64 rx_roce_pkts; 2061 __le64 rx_roce_bytes; 2062 __le64 rx_roce_good_pkts; 2063 __le64 rx_roce_good_bytes; 2064 __le64 rx_out_of_buffer_pkts; 2065 __le64 rx_out_of_sequence_pkts; 2066 __le64 tx_cnp_pkts; 2067 __le64 rx_cnp_pkts; 2068 __le64 rx_ecn_marked_pkts; 2069 __le64 tx_cnp_bytes; 2070 __le64 rx_cnp_bytes; 2071 __le64 seq_err_naks_rcvd; 2072 __le64 rnr_naks_rcvd; 2073 __le64 missing_resp; 2074 __le64 to_retransmit; 2075 __le64 dup_req; 2076 }; 2077 2078 /* cmdq_query_func (size:128b/16B) */ 2079 struct cmdq_query_func { 2080 u8 opcode; 2081 #define CMDQ_QUERY_FUNC_OPCODE_QUERY_FUNC 0x83UL 2082 #define CMDQ_QUERY_FUNC_OPCODE_LAST CMDQ_QUERY_FUNC_OPCODE_QUERY_FUNC 2083 u8 cmd_size; 2084 __le16 flags; 2085 __le16 cookie; 2086 u8 resp_size; 2087 u8 reserved8; 2088 __le64 resp_addr; 2089 }; 2090 2091 /* creq_query_func_resp (size:128b/16B) */ 2092 struct creq_query_func_resp { 2093 u8 type; 2094 #define CREQ_QUERY_FUNC_RESP_TYPE_MASK 0x3fUL 2095 #define CREQ_QUERY_FUNC_RESP_TYPE_SFT 0 2096 #define CREQ_QUERY_FUNC_RESP_TYPE_QP_EVENT 0x38UL 2097 #define CREQ_QUERY_FUNC_RESP_TYPE_LAST CREQ_QUERY_FUNC_RESP_TYPE_QP_EVENT 2098 u8 status; 2099 __le16 cookie; 2100 __le32 size; 2101 u8 v; 2102 #define CREQ_QUERY_FUNC_RESP_V 0x1UL 2103 u8 event; 2104 #define CREQ_QUERY_FUNC_RESP_EVENT_QUERY_FUNC 0x83UL 2105 #define CREQ_QUERY_FUNC_RESP_EVENT_LAST CREQ_QUERY_FUNC_RESP_EVENT_QUERY_FUNC 2106 u8 reserved48[6]; 2107 }; 2108 2109 /* creq_query_func_resp_sb (size:1088b/136B) */ 2110 struct creq_query_func_resp_sb { 2111 u8 opcode; 2112 #define CREQ_QUERY_FUNC_RESP_SB_OPCODE_QUERY_FUNC 0x83UL 2113 #define CREQ_QUERY_FUNC_RESP_SB_OPCODE_LAST CREQ_QUERY_FUNC_RESP_SB_OPCODE_QUERY_FUNC 2114 u8 status; 2115 __le16 cookie; 2116 __le16 flags; 2117 u8 resp_size; 2118 u8 reserved8; 2119 __le64 max_mr_size; 2120 __le32 max_qp; 2121 __le16 max_qp_wr; 2122 __le16 dev_cap_flags; 2123 #define CREQ_QUERY_FUNC_RESP_SB_RESIZE_QP 0x1UL 2124 #define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_MASK 0xeUL 2125 #define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_SFT 1 2126 #define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_CC_GEN0 (0x0UL << 1) 2127 #define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_CC_GEN1 (0x1UL << 1) 2128 #define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_CC_GEN1_EXT (0x2UL << 1) 2129 #define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_LAST \ 2130 CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_CC_GEN1_EXT 2131 #define CREQ_QUERY_FUNC_RESP_SB_EXT_STATS 0x10UL 2132 #define CREQ_QUERY_FUNC_RESP_SB_MR_REGISTER_ALLOC 0x20UL 2133 #define CREQ_QUERY_FUNC_RESP_SB_OPTIMIZED_TRANSMIT_ENABLED 0x40UL 2134 #define CREQ_QUERY_FUNC_RESP_SB_CQE_V2 0x80UL 2135 #define CREQ_QUERY_FUNC_RESP_SB_PINGPONG_PUSH_MODE 0x100UL 2136 #define CREQ_QUERY_FUNC_RESP_SB_HW_REQUESTER_RETX_ENABLED 0x200UL 2137 #define CREQ_QUERY_FUNC_RESP_SB_HW_RESPONDER_RETX_ENABLED 0x400UL 2138 __le32 max_cq; 2139 __le32 max_cqe; 2140 __le32 max_pd; 2141 u8 max_sge; 2142 u8 max_srq_sge; 2143 u8 max_qp_rd_atom; 2144 u8 max_qp_init_rd_atom; 2145 __le32 max_mr; 2146 __le32 max_mw; 2147 __le32 max_raw_eth_qp; 2148 __le32 max_ah; 2149 __le32 max_fmr; 2150 __le32 max_srq_wr; 2151 __le32 max_pkeys; 2152 __le32 max_inline_data; 2153 u8 max_map_per_fmr; 2154 u8 l2_db_space_size; 2155 __le16 max_srq; 2156 __le32 max_gid; 2157 __le32 tqm_alloc_reqs[12]; 2158 __le32 max_dpi; 2159 u8 max_sge_var_wqe; 2160 u8 dev_cap_ext_flags; 2161 #define CREQ_QUERY_FUNC_RESP_SB_ATOMIC_OPS_NOT_SUPPORTED 0x1UL 2162 #define CREQ_QUERY_FUNC_RESP_SB_DRV_VERSION_RGTR_SUPPORTED 0x2UL 2163 #define CREQ_QUERY_FUNC_RESP_SB_CREATE_QP_BATCH_SUPPORTED 0x4UL 2164 #define CREQ_QUERY_FUNC_RESP_SB_DESTROY_QP_BATCH_SUPPORTED 0x8UL 2165 #define CREQ_QUERY_FUNC_RESP_SB_ROCE_STATS_EXT_CTX_SUPPORTED 0x10UL 2166 #define CREQ_QUERY_FUNC_RESP_SB_CREATE_SRQ_SGE_SUPPORTED 0x20UL 2167 #define CREQ_QUERY_FUNC_RESP_SB_FIXED_SIZE_WQE_DISABLED 0x40UL 2168 #define CREQ_QUERY_FUNC_RESP_SB_DCN_SUPPORTED 0x80UL 2169 __le16 max_inline_data_var_wqe; 2170 __le32 start_qid; 2171 u8 max_msn_table_size; 2172 u8 reserved8_1; 2173 __le16 dev_cap_ext_flags_2; 2174 #define CREQ_QUERY_FUNC_RESP_SB_OPTIMIZE_MODIFY_QP_SUPPORTED 0x1UL 2175 #define CREQ_QUERY_FUNC_RESP_SB_CHANGE_UDP_SRC_PORT_WQE_SUPPORTED 0x2UL 2176 #define CREQ_QUERY_FUNC_RESP_SB_CQ_COALESCING_SUPPORTED 0x4UL 2177 #define CREQ_QUERY_FUNC_RESP_SB_MEMORY_REGION_RO_SUPPORTED 0x8UL 2178 #define CREQ_QUERY_FUNC_RESP_SB_REQ_RETRANSMISSION_SUPPORT_MASK 0x30UL 2179 #define CREQ_QUERY_FUNC_RESP_SB_REQ_RETRANSMISSION_SUPPORT_SFT 4 2180 #define CREQ_QUERY_FUNC_RESP_SB_REQ_RETRANSMISSION_SUPPORT_HOST_PSN_TABLE (0x0UL << 4) 2181 #define CREQ_QUERY_FUNC_RESP_SB_REQ_RETRANSMISSION_SUPPORT_HOST_MSN_TABLE (0x1UL << 4) 2182 #define CREQ_QUERY_FUNC_RESP_SB_REQ_RETRANSMISSION_SUPPORT_IQM_MSN_TABLE (0x2UL << 4) 2183 #define CREQ_QUERY_FUNC_RESP_SB_REQ_RETRANSMISSION_SUPPORT_LAST \ 2184 CREQ_QUERY_FUNC_RESP_SB_REQ_RETRANSMISSION_SUPPORT_IQM_MSN_TABLE 2185 __le16 max_xp_qp_size; 2186 __le16 create_qp_batch_size; 2187 __le16 destroy_qp_batch_size; 2188 __le16 reserved16; 2189 __le64 reserved64; 2190 }; 2191 2192 /* cmdq_set_func_resources (size:448b/56B) */ 2193 struct cmdq_set_func_resources { 2194 u8 opcode; 2195 #define CMDQ_SET_FUNC_RESOURCES_OPCODE_SET_FUNC_RESOURCES 0x84UL 2196 #define CMDQ_SET_FUNC_RESOURCES_OPCODE_LAST\ 2197 CMDQ_SET_FUNC_RESOURCES_OPCODE_SET_FUNC_RESOURCES 2198 u8 cmd_size; 2199 __le16 flags; 2200 #define CMDQ_SET_FUNC_RESOURCES_FLAGS_MRAV_RESERVATION_SPLIT 0x1UL 2201 __le16 cookie; 2202 u8 resp_size; 2203 u8 reserved8; 2204 __le64 resp_addr; 2205 __le32 number_of_qp; 2206 __le32 number_of_mrw; 2207 __le32 number_of_srq; 2208 __le32 number_of_cq; 2209 __le32 max_qp_per_vf; 2210 __le32 max_mrw_per_vf; 2211 __le32 max_srq_per_vf; 2212 __le32 max_cq_per_vf; 2213 __le32 max_gid_per_vf; 2214 __le32 stat_ctx_id; 2215 }; 2216 2217 /* creq_set_func_resources_resp (size:128b/16B) */ 2218 struct creq_set_func_resources_resp { 2219 u8 type; 2220 #define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_MASK 0x3fUL 2221 #define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_SFT 0 2222 #define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_QP_EVENT 0x38UL 2223 #define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_LAST CREQ_SET_FUNC_RESOURCES_RESP_TYPE_QP_EVENT 2224 u8 status; 2225 __le16 cookie; 2226 __le32 reserved32; 2227 u8 v; 2228 #define CREQ_SET_FUNC_RESOURCES_RESP_V 0x1UL 2229 u8 event; 2230 #define CREQ_SET_FUNC_RESOURCES_RESP_EVENT_SET_FUNC_RESOURCES 0x84UL 2231 #define CREQ_SET_FUNC_RESOURCES_RESP_EVENT_LAST \ 2232 CREQ_SET_FUNC_RESOURCES_RESP_EVENT_SET_FUNC_RESOURCES 2233 u8 reserved48[6]; 2234 }; 2235 2236 /* cmdq_map_tc_to_cos (size:192b/24B) */ 2237 struct cmdq_map_tc_to_cos { 2238 u8 opcode; 2239 #define CMDQ_MAP_TC_TO_COS_OPCODE_MAP_TC_TO_COS 0x8aUL 2240 #define CMDQ_MAP_TC_TO_COS_OPCODE_LAST CMDQ_MAP_TC_TO_COS_OPCODE_MAP_TC_TO_COS 2241 u8 cmd_size; 2242 __le16 flags; 2243 __le16 cookie; 2244 u8 resp_size; 2245 u8 reserved8; 2246 __le64 resp_addr; 2247 __le16 cos0; 2248 #define CMDQ_MAP_TC_TO_COS_COS0_NO_CHANGE 0xffffUL 2249 #define CMDQ_MAP_TC_TO_COS_COS0_LAST CMDQ_MAP_TC_TO_COS_COS0_NO_CHANGE 2250 __le16 cos1; 2251 #define CMDQ_MAP_TC_TO_COS_COS1_DISABLE 0x8000UL 2252 #define CMDQ_MAP_TC_TO_COS_COS1_NO_CHANGE 0xffffUL 2253 #define CMDQ_MAP_TC_TO_COS_COS1_LAST CMDQ_MAP_TC_TO_COS_COS1_NO_CHANGE 2254 __le32 unused_0; 2255 }; 2256 2257 /* creq_map_tc_to_cos_resp (size:128b/16B) */ 2258 struct creq_map_tc_to_cos_resp { 2259 u8 type; 2260 #define CREQ_MAP_TC_TO_COS_RESP_TYPE_MASK 0x3fUL 2261 #define CREQ_MAP_TC_TO_COS_RESP_TYPE_SFT 0 2262 #define CREQ_MAP_TC_TO_COS_RESP_TYPE_QP_EVENT 0x38UL 2263 #define CREQ_MAP_TC_TO_COS_RESP_TYPE_LAST CREQ_MAP_TC_TO_COS_RESP_TYPE_QP_EVENT 2264 u8 status; 2265 __le16 cookie; 2266 __le32 reserved32; 2267 u8 v; 2268 #define CREQ_MAP_TC_TO_COS_RESP_V 0x1UL 2269 u8 event; 2270 #define CREQ_MAP_TC_TO_COS_RESP_EVENT_MAP_TC_TO_COS 0x8aUL 2271 #define CREQ_MAP_TC_TO_COS_RESP_EVENT_LAST CREQ_MAP_TC_TO_COS_RESP_EVENT_MAP_TC_TO_COS 2272 u8 reserved48[6]; 2273 }; 2274 2275 /* cmdq_query_roce_cc (size:128b/16B) */ 2276 struct cmdq_query_roce_cc { 2277 u8 opcode; 2278 #define CMDQ_QUERY_ROCE_CC_OPCODE_QUERY_ROCE_CC 0x8dUL 2279 #define CMDQ_QUERY_ROCE_CC_OPCODE_LAST CMDQ_QUERY_ROCE_CC_OPCODE_QUERY_ROCE_CC 2280 u8 cmd_size; 2281 __le16 flags; 2282 __le16 cookie; 2283 u8 resp_size; 2284 u8 reserved8; 2285 __le64 resp_addr; 2286 }; 2287 2288 /* creq_query_roce_cc_resp (size:128b/16B) */ 2289 struct creq_query_roce_cc_resp { 2290 u8 type; 2291 #define CREQ_QUERY_ROCE_CC_RESP_TYPE_MASK 0x3fUL 2292 #define CREQ_QUERY_ROCE_CC_RESP_TYPE_SFT 0 2293 #define CREQ_QUERY_ROCE_CC_RESP_TYPE_QP_EVENT 0x38UL 2294 #define CREQ_QUERY_ROCE_CC_RESP_TYPE_LAST CREQ_QUERY_ROCE_CC_RESP_TYPE_QP_EVENT 2295 u8 status; 2296 __le16 cookie; 2297 __le32 size; 2298 u8 v; 2299 #define CREQ_QUERY_ROCE_CC_RESP_V 0x1UL 2300 u8 event; 2301 #define CREQ_QUERY_ROCE_CC_RESP_EVENT_QUERY_ROCE_CC 0x8dUL 2302 #define CREQ_QUERY_ROCE_CC_RESP_EVENT_LAST CREQ_QUERY_ROCE_CC_RESP_EVENT_QUERY_ROCE_CC 2303 u8 reserved48[6]; 2304 }; 2305 2306 /* creq_query_roce_cc_resp_sb (size:256b/32B) */ 2307 struct creq_query_roce_cc_resp_sb { 2308 u8 opcode; 2309 #define CREQ_QUERY_ROCE_CC_RESP_SB_OPCODE_QUERY_ROCE_CC 0x8dUL 2310 #define CREQ_QUERY_ROCE_CC_RESP_SB_OPCODE_LAST \ 2311 CREQ_QUERY_ROCE_CC_RESP_SB_OPCODE_QUERY_ROCE_CC 2312 u8 status; 2313 __le16 cookie; 2314 __le16 flags; 2315 u8 resp_size; 2316 u8 reserved8; 2317 u8 enable_cc; 2318 #define CREQ_QUERY_ROCE_CC_RESP_SB_ENABLE_CC 0x1UL 2319 #define CREQ_QUERY_ROCE_CC_RESP_SB_UNUSED7_MASK 0xfeUL 2320 #define CREQ_QUERY_ROCE_CC_RESP_SB_UNUSED7_SFT 1 2321 u8 tos_dscp_tos_ecn; 2322 #define CREQ_QUERY_ROCE_CC_RESP_SB_TOS_ECN_MASK 0x3UL 2323 #define CREQ_QUERY_ROCE_CC_RESP_SB_TOS_ECN_SFT 0 2324 #define CREQ_QUERY_ROCE_CC_RESP_SB_TOS_DSCP_MASK 0xfcUL 2325 #define CREQ_QUERY_ROCE_CC_RESP_SB_TOS_DSCP_SFT 2 2326 u8 g; 2327 u8 num_phases_per_state; 2328 __le16 init_cr; 2329 __le16 init_tr; 2330 u8 alt_vlan_pcp; 2331 #define CREQ_QUERY_ROCE_CC_RESP_SB_ALT_VLAN_PCP_MASK 0x7UL 2332 #define CREQ_QUERY_ROCE_CC_RESP_SB_ALT_VLAN_PCP_SFT 0 2333 #define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD1_MASK 0xf8UL 2334 #define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD1_SFT 3 2335 u8 alt_tos_dscp; 2336 #define CREQ_QUERY_ROCE_CC_RESP_SB_ALT_TOS_DSCP_MASK 0x3fUL 2337 #define CREQ_QUERY_ROCE_CC_RESP_SB_ALT_TOS_DSCP_SFT 0 2338 #define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD4_MASK 0xc0UL 2339 #define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD4_SFT 6 2340 u8 cc_mode; 2341 #define CREQ_QUERY_ROCE_CC_RESP_SB_CC_MODE_DCTCP 0x0UL 2342 #define CREQ_QUERY_ROCE_CC_RESP_SB_CC_MODE_PROBABILISTIC 0x1UL 2343 #define CREQ_QUERY_ROCE_CC_RESP_SB_CC_MODE_LAST \ 2344 CREQ_QUERY_ROCE_CC_RESP_SB_CC_MODE_PROBABILISTIC 2345 u8 tx_queue; 2346 __le16 rtt; 2347 #define CREQ_QUERY_ROCE_CC_RESP_SB_RTT_MASK 0x3fffUL 2348 #define CREQ_QUERY_ROCE_CC_RESP_SB_RTT_SFT 0 2349 #define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD5_MASK 0xc000UL 2350 #define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD5_SFT 14 2351 __le16 tcp_cp; 2352 #define CREQ_QUERY_ROCE_CC_RESP_SB_TCP_CP_MASK 0x3ffUL 2353 #define CREQ_QUERY_ROCE_CC_RESP_SB_TCP_CP_SFT 0 2354 #define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD6_MASK 0xfc00UL 2355 #define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD6_SFT 10 2356 __le16 inactivity_th; 2357 u8 pkts_per_phase; 2358 u8 time_per_phase; 2359 __le32 reserved32; 2360 }; 2361 2362 /* creq_query_roce_cc_resp_sb_tlv (size:384b/48B) */ 2363 struct creq_query_roce_cc_resp_sb_tlv { 2364 __le16 cmd_discr; 2365 u8 reserved_8b; 2366 u8 tlv_flags; 2367 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_MORE 0x1UL 2368 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_MORE_LAST 0x0UL 2369 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_MORE_NOT_LAST 0x1UL 2370 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_REQUIRED 0x2UL 2371 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_REQUIRED_NO (0x0UL << 1) 2372 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES (0x1UL << 1) 2373 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_REQUIRED_LAST \ 2374 CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES 2375 __le16 tlv_type; 2376 __le16 length; 2377 u8 total_size; 2378 u8 reserved56[7]; 2379 u8 opcode; 2380 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_OPCODE_QUERY_ROCE_CC 0x8dUL 2381 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_OPCODE_LAST \ 2382 CREQ_QUERY_ROCE_CC_RESP_SB_TLV_OPCODE_QUERY_ROCE_CC 2383 u8 status; 2384 __le16 cookie; 2385 __le16 flags; 2386 u8 resp_size; 2387 u8 reserved8; 2388 u8 enable_cc; 2389 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_ENABLE_CC 0x1UL 2390 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_UNUSED7_MASK 0xfeUL 2391 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_UNUSED7_SFT 1 2392 u8 tos_dscp_tos_ecn; 2393 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TOS_ECN_MASK 0x3UL 2394 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TOS_ECN_SFT 0 2395 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TOS_DSCP_MASK 0xfcUL 2396 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TOS_DSCP_SFT 2 2397 u8 g; 2398 u8 num_phases_per_state; 2399 __le16 init_cr; 2400 __le16 init_tr; 2401 u8 alt_vlan_pcp; 2402 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_ALT_VLAN_PCP_MASK 0x7UL 2403 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_ALT_VLAN_PCP_SFT 0 2404 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD1_MASK 0xf8UL 2405 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD1_SFT 3 2406 u8 alt_tos_dscp; 2407 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_ALT_TOS_DSCP_MASK 0x3fUL 2408 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_ALT_TOS_DSCP_SFT 0 2409 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD4_MASK 0xc0UL 2410 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD4_SFT 6 2411 u8 cc_mode; 2412 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_CC_MODE_DCTCP 0x0UL 2413 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_CC_MODE_PROBABILISTIC 0x1UL 2414 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_CC_MODE_LAST\ 2415 CREQ_QUERY_ROCE_CC_RESP_SB_TLV_CC_MODE_PROBABILISTIC 2416 u8 tx_queue; 2417 __le16 rtt; 2418 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RTT_MASK 0x3fffUL 2419 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RTT_SFT 0 2420 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD5_MASK 0xc000UL 2421 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD5_SFT 14 2422 __le16 tcp_cp; 2423 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TCP_CP_MASK 0x3ffUL 2424 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TCP_CP_SFT 0 2425 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD6_MASK 0xfc00UL 2426 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD6_SFT 10 2427 __le16 inactivity_th; 2428 u8 pkts_per_phase; 2429 u8 time_per_phase; 2430 __le32 reserved32; 2431 }; 2432 2433 /* creq_query_roce_cc_gen1_resp_sb_tlv (size:704b/88B) */ 2434 struct creq_query_roce_cc_gen1_resp_sb_tlv { 2435 __le16 cmd_discr; 2436 u8 reserved_8b; 2437 u8 tlv_flags; 2438 #define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_MORE 0x1UL 2439 #define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_MORE_LAST 0x0UL 2440 #define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_MORE_NOT_LAST 0x1UL 2441 #define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_REQUIRED 0x2UL 2442 #define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_REQUIRED_NO (0x0UL << 1) 2443 #define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES (0x1UL << 1) 2444 #define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_REQUIRED_LAST \ 2445 CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES 2446 __le16 tlv_type; 2447 __le16 length; 2448 __le64 reserved64; 2449 __le16 inactivity_th_hi; 2450 __le16 min_time_between_cnps; 2451 __le16 init_cp; 2452 u8 tr_update_mode; 2453 u8 tr_update_cycles; 2454 u8 fr_num_rtts; 2455 u8 ai_rate_increase; 2456 __le16 reduction_relax_rtts_th; 2457 __le16 additional_relax_cr_th; 2458 __le16 cr_min_th; 2459 u8 bw_avg_weight; 2460 u8 actual_cr_factor; 2461 __le16 max_cp_cr_th; 2462 u8 cp_bias_en; 2463 u8 cp_bias; 2464 u8 cnp_ecn; 2465 #define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_CNP_ECN_NOT_ECT 0x0UL 2466 #define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_CNP_ECN_ECT_1 0x1UL 2467 #define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_CNP_ECN_ECT_0 0x2UL 2468 #define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_CNP_ECN_LAST \ 2469 CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_CNP_ECN_ECT_0 2470 u8 rtt_jitter_en; 2471 __le16 link_bytes_per_usec; 2472 __le16 reset_cc_cr_th; 2473 u8 cr_width; 2474 u8 quota_period_min; 2475 u8 quota_period_max; 2476 u8 quota_period_abs_max; 2477 __le16 tr_lower_bound; 2478 u8 cr_prob_factor; 2479 u8 tr_prob_factor; 2480 __le16 fairness_cr_th; 2481 u8 red_div; 2482 u8 cnp_ratio_th; 2483 __le16 exp_ai_rtts; 2484 u8 exp_ai_cr_cp_ratio; 2485 u8 use_rate_table; 2486 __le16 cp_exp_update_th; 2487 __le16 high_exp_ai_rtts_th1; 2488 __le16 high_exp_ai_rtts_th2; 2489 __le16 actual_cr_cong_free_rtts_th; 2490 __le16 severe_cong_cr_th1; 2491 __le16 severe_cong_cr_th2; 2492 __le32 link64B_per_rtt; 2493 u8 cc_ack_bytes; 2494 u8 reduce_init_en; 2495 __le16 reduce_init_cong_free_rtts_th; 2496 u8 random_no_red_en; 2497 u8 actual_cr_shift_correction_en; 2498 u8 quota_period_adjust_en; 2499 u8 reserved[5]; 2500 }; 2501 2502 /* cmdq_modify_roce_cc (size:448b/56B) */ 2503 struct cmdq_modify_roce_cc { 2504 u8 opcode; 2505 #define CMDQ_MODIFY_ROCE_CC_OPCODE_MODIFY_ROCE_CC 0x8cUL 2506 #define CMDQ_MODIFY_ROCE_CC_OPCODE_LAST CMDQ_MODIFY_ROCE_CC_OPCODE_MODIFY_ROCE_CC 2507 u8 cmd_size; 2508 __le16 flags; 2509 __le16 cookie; 2510 u8 resp_size; 2511 u8 reserved8; 2512 __le64 resp_addr; 2513 __le32 modify_mask; 2514 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_ENABLE_CC 0x1UL 2515 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_G 0x2UL 2516 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_NUMPHASEPERSTATE 0x4UL 2517 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_INIT_CR 0x8UL 2518 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_INIT_TR 0x10UL 2519 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TOS_ECN 0x20UL 2520 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TOS_DSCP 0x40UL 2521 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_ALT_VLAN_PCP 0x80UL 2522 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_ALT_TOS_DSCP 0x100UL 2523 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_RTT 0x200UL 2524 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_CC_MODE 0x400UL 2525 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TCP_CP 0x800UL 2526 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TX_QUEUE 0x1000UL 2527 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_INACTIVITY_CP 0x2000UL 2528 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TIME_PER_PHASE 0x4000UL 2529 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_PKTS_PER_PHASE 0x8000UL 2530 u8 enable_cc; 2531 #define CMDQ_MODIFY_ROCE_CC_ENABLE_CC 0x1UL 2532 #define CMDQ_MODIFY_ROCE_CC_RSVD1_MASK 0xfeUL 2533 #define CMDQ_MODIFY_ROCE_CC_RSVD1_SFT 1 2534 u8 g; 2535 u8 num_phases_per_state; 2536 u8 pkts_per_phase; 2537 __le16 init_cr; 2538 __le16 init_tr; 2539 u8 tos_dscp_tos_ecn; 2540 #define CMDQ_MODIFY_ROCE_CC_TOS_ECN_MASK 0x3UL 2541 #define CMDQ_MODIFY_ROCE_CC_TOS_ECN_SFT 0 2542 #define CMDQ_MODIFY_ROCE_CC_TOS_DSCP_MASK 0xfcUL 2543 #define CMDQ_MODIFY_ROCE_CC_TOS_DSCP_SFT 2 2544 u8 alt_vlan_pcp; 2545 #define CMDQ_MODIFY_ROCE_CC_ALT_VLAN_PCP_MASK 0x7UL 2546 #define CMDQ_MODIFY_ROCE_CC_ALT_VLAN_PCP_SFT 0 2547 #define CMDQ_MODIFY_ROCE_CC_RSVD3_MASK 0xf8UL 2548 #define CMDQ_MODIFY_ROCE_CC_RSVD3_SFT 3 2549 __le16 alt_tos_dscp; 2550 #define CMDQ_MODIFY_ROCE_CC_ALT_TOS_DSCP_MASK 0x3fUL 2551 #define CMDQ_MODIFY_ROCE_CC_ALT_TOS_DSCP_SFT 0 2552 #define CMDQ_MODIFY_ROCE_CC_RSVD4_MASK 0xffc0UL 2553 #define CMDQ_MODIFY_ROCE_CC_RSVD4_SFT 6 2554 __le16 rtt; 2555 #define CMDQ_MODIFY_ROCE_CC_RTT_MASK 0x3fffUL 2556 #define CMDQ_MODIFY_ROCE_CC_RTT_SFT 0 2557 #define CMDQ_MODIFY_ROCE_CC_RSVD5_MASK 0xc000UL 2558 #define CMDQ_MODIFY_ROCE_CC_RSVD5_SFT 14 2559 __le16 tcp_cp; 2560 #define CMDQ_MODIFY_ROCE_CC_TCP_CP_MASK 0x3ffUL 2561 #define CMDQ_MODIFY_ROCE_CC_TCP_CP_SFT 0 2562 #define CMDQ_MODIFY_ROCE_CC_RSVD6_MASK 0xfc00UL 2563 #define CMDQ_MODIFY_ROCE_CC_RSVD6_SFT 10 2564 u8 cc_mode; 2565 #define CMDQ_MODIFY_ROCE_CC_CC_MODE_DCTCP_CC_MODE 0x0UL 2566 #define CMDQ_MODIFY_ROCE_CC_CC_MODE_PROBABILISTIC_CC_MODE 0x1UL 2567 #define CMDQ_MODIFY_ROCE_CC_CC_MODE_LAST CMDQ_MODIFY_ROCE_CC_CC_MODE_PROBABILISTIC_CC_MODE 2568 u8 tx_queue; 2569 __le16 inactivity_th; 2570 u8 time_per_phase; 2571 u8 reserved8_1; 2572 __le16 reserved16; 2573 __le32 reserved32; 2574 __le64 reserved64; 2575 }; 2576 2577 /* cmdq_modify_roce_cc_tlv (size:640b/80B) */ 2578 struct cmdq_modify_roce_cc_tlv { 2579 __le16 cmd_discr; 2580 u8 reserved_8b; 2581 u8 tlv_flags; 2582 #define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_MORE 0x1UL 2583 #define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_MORE_LAST 0x0UL 2584 #define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_MORE_NOT_LAST 0x1UL 2585 #define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_REQUIRED 0x2UL 2586 #define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_REQUIRED_NO (0x0UL << 1) 2587 #define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_REQUIRED_YES (0x1UL << 1) 2588 #define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_REQUIRED_LAST \ 2589 CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_REQUIRED_YES 2590 __le16 tlv_type; 2591 __le16 length; 2592 u8 total_size; 2593 u8 reserved56[7]; 2594 u8 opcode; 2595 #define CMDQ_MODIFY_ROCE_CC_TLV_OPCODE_MODIFY_ROCE_CC 0x8cUL 2596 #define CMDQ_MODIFY_ROCE_CC_TLV_OPCODE_LAST CMDQ_MODIFY_ROCE_CC_TLV_OPCODE_MODIFY_ROCE_CC 2597 u8 cmd_size; 2598 __le16 flags; 2599 __le16 cookie; 2600 u8 resp_size; 2601 u8 reserved8; 2602 __le64 resp_addr; 2603 __le32 modify_mask; 2604 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_ENABLE_CC 0x1UL 2605 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_G 0x2UL 2606 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_NUMPHASEPERSTATE 0x4UL 2607 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_INIT_CR 0x8UL 2608 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_INIT_TR 0x10UL 2609 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_TOS_ECN 0x20UL 2610 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_TOS_DSCP 0x40UL 2611 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_ALT_VLAN_PCP 0x80UL 2612 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_ALT_TOS_DSCP 0x100UL 2613 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_RTT 0x200UL 2614 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_CC_MODE 0x400UL 2615 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_TCP_CP 0x800UL 2616 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_TX_QUEUE 0x1000UL 2617 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_INACTIVITY_CP 0x2000UL 2618 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_TIME_PER_PHASE 0x4000UL 2619 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_PKTS_PER_PHASE 0x8000UL 2620 u8 enable_cc; 2621 #define CMDQ_MODIFY_ROCE_CC_TLV_ENABLE_CC 0x1UL 2622 #define CMDQ_MODIFY_ROCE_CC_TLV_RSVD1_MASK 0xfeUL 2623 #define CMDQ_MODIFY_ROCE_CC_TLV_RSVD1_SFT 1 2624 u8 g; 2625 u8 num_phases_per_state; 2626 u8 pkts_per_phase; 2627 __le16 init_cr; 2628 __le16 init_tr; 2629 u8 tos_dscp_tos_ecn; 2630 #define CMDQ_MODIFY_ROCE_CC_TLV_TOS_ECN_MASK 0x3UL 2631 #define CMDQ_MODIFY_ROCE_CC_TLV_TOS_ECN_SFT 0 2632 #define CMDQ_MODIFY_ROCE_CC_TLV_TOS_DSCP_MASK 0xfcUL 2633 #define CMDQ_MODIFY_ROCE_CC_TLV_TOS_DSCP_SFT 2 2634 u8 alt_vlan_pcp; 2635 #define CMDQ_MODIFY_ROCE_CC_TLV_ALT_VLAN_PCP_MASK 0x7UL 2636 #define CMDQ_MODIFY_ROCE_CC_TLV_ALT_VLAN_PCP_SFT 0 2637 #define CMDQ_MODIFY_ROCE_CC_TLV_RSVD3_MASK 0xf8UL 2638 #define CMDQ_MODIFY_ROCE_CC_TLV_RSVD3_SFT 3 2639 __le16 alt_tos_dscp; 2640 #define CMDQ_MODIFY_ROCE_CC_TLV_ALT_TOS_DSCP_MASK 0x3fUL 2641 #define CMDQ_MODIFY_ROCE_CC_TLV_ALT_TOS_DSCP_SFT 0 2642 #define CMDQ_MODIFY_ROCE_CC_TLV_RSVD4_MASK 0xffc0UL 2643 #define CMDQ_MODIFY_ROCE_CC_TLV_RSVD4_SFT 6 2644 __le16 rtt; 2645 #define CMDQ_MODIFY_ROCE_CC_TLV_RTT_MASK 0x3fffUL 2646 #define CMDQ_MODIFY_ROCE_CC_TLV_RTT_SFT 0 2647 #define CMDQ_MODIFY_ROCE_CC_TLV_RSVD5_MASK 0xc000UL 2648 #define CMDQ_MODIFY_ROCE_CC_TLV_RSVD5_SFT 14 2649 __le16 tcp_cp; 2650 #define CMDQ_MODIFY_ROCE_CC_TLV_TCP_CP_MASK 0x3ffUL 2651 #define CMDQ_MODIFY_ROCE_CC_TLV_TCP_CP_SFT 0 2652 #define CMDQ_MODIFY_ROCE_CC_TLV_RSVD6_MASK 0xfc00UL 2653 #define CMDQ_MODIFY_ROCE_CC_TLV_RSVD6_SFT 10 2654 u8 cc_mode; 2655 #define CMDQ_MODIFY_ROCE_CC_TLV_CC_MODE_DCTCP_CC_MODE 0x0UL 2656 #define CMDQ_MODIFY_ROCE_CC_TLV_CC_MODE_PROBABILISTIC_CC_MODE 0x1UL 2657 #define CMDQ_MODIFY_ROCE_CC_TLV_CC_MODE_LAST\ 2658 CMDQ_MODIFY_ROCE_CC_TLV_CC_MODE_PROBABILISTIC_CC_MODE 2659 u8 tx_queue; 2660 __le16 inactivity_th; 2661 u8 time_per_phase; 2662 u8 reserved8_1; 2663 __le16 reserved16; 2664 __le32 reserved32; 2665 __le64 reserved64; 2666 __le64 reservedtlvpad; 2667 }; 2668 2669 /* cmdq_modify_roce_cc_gen1_tlv (size:768b/96B) */ 2670 struct cmdq_modify_roce_cc_gen1_tlv { 2671 __le16 cmd_discr; 2672 u8 reserved_8b; 2673 u8 tlv_flags; 2674 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_MORE 0x1UL 2675 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_MORE_LAST 0x0UL 2676 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_MORE_NOT_LAST 0x1UL 2677 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_REQUIRED 0x2UL 2678 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_REQUIRED_NO (0x0UL << 1) 2679 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_REQUIRED_YES (0x1UL << 1) 2680 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_REQUIRED_LAST\ 2681 CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_REQUIRED_YES 2682 __le16 tlv_type; 2683 __le16 length; 2684 __le64 reserved64; 2685 __le64 modify_mask; 2686 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_MIN_TIME_BETWEEN_CNPS 0x1UL 2687 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_INIT_CP 0x2UL 2688 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_TR_UPDATE_MODE 0x4UL 2689 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_TR_UPDATE_CYCLES 0x8UL 2690 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_FR_NUM_RTTS 0x10UL 2691 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_AI_RATE_INCREASE 0x20UL 2692 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_REDUCTION_RELAX_RTTS_TH 0x40UL 2693 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_ADDITIONAL_RELAX_CR_TH 0x80UL 2694 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CR_MIN_TH 0x100UL 2695 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_BW_AVG_WEIGHT 0x200UL 2696 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_ACTUAL_CR_FACTOR 0x400UL 2697 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_MAX_CP_CR_TH 0x800UL 2698 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CP_BIAS_EN 0x1000UL 2699 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CP_BIAS 0x2000UL 2700 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CNP_ECN 0x4000UL 2701 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_RTT_JITTER_EN 0x8000UL 2702 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_LINK_BYTES_PER_USEC 0x10000UL 2703 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_RESET_CC_CR_TH 0x20000UL 2704 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CR_WIDTH 0x40000UL 2705 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_QUOTA_PERIOD_MIN 0x80000UL 2706 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_QUOTA_PERIOD_MAX 0x100000UL 2707 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_QUOTA_PERIOD_ABS_MAX 0x200000UL 2708 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_TR_LOWER_BOUND 0x400000UL 2709 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CR_PROB_FACTOR 0x800000UL 2710 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_TR_PROB_FACTOR 0x1000000UL 2711 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_FAIRNESS_CR_TH 0x2000000UL 2712 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_RED_DIV 0x4000000UL 2713 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CNP_RATIO_TH 0x8000000UL 2714 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_EXP_AI_RTTS 0x10000000UL 2715 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_EXP_AI_CR_CP_RATIO 0x20000000UL 2716 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CP_EXP_UPDATE_TH 0x40000000UL 2717 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_HIGH_EXP_AI_RTTS_TH1 0x80000000UL 2718 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_HIGH_EXP_AI_RTTS_TH2 0x100000000ULL 2719 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_USE_RATE_TABLE 0x200000000ULL 2720 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_LINK64B_PER_RTT 0x400000000ULL 2721 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_ACTUAL_CR_CONG_FREE_RTTS_TH 0x800000000ULL 2722 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_SEVERE_CONG_CR_TH1 0x1000000000ULL 2723 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_SEVERE_CONG_CR_TH2 0x2000000000ULL 2724 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CC_ACK_BYTES 0x4000000000ULL 2725 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_REDUCE_INIT_EN 0x8000000000ULL 2726 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_REDUCE_INIT_CONG_FREE_RTTS_TH \ 2727 0x10000000000ULL 2728 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_RANDOM_NO_RED_EN 0x20000000000ULL 2729 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_ACTUAL_CR_SHIFT_CORRECTION_EN \ 2730 0x40000000000ULL 2731 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_QUOTA_PERIOD_ADJUST_EN 0x80000000000ULL 2732 __le16 inactivity_th_hi; 2733 __le16 min_time_between_cnps; 2734 __le16 init_cp; 2735 u8 tr_update_mode; 2736 u8 tr_update_cycles; 2737 u8 fr_num_rtts; 2738 u8 ai_rate_increase; 2739 __le16 reduction_relax_rtts_th; 2740 __le16 additional_relax_cr_th; 2741 __le16 cr_min_th; 2742 u8 bw_avg_weight; 2743 u8 actual_cr_factor; 2744 __le16 max_cp_cr_th; 2745 u8 cp_bias_en; 2746 u8 cp_bias; 2747 u8 cnp_ecn; 2748 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_CNP_ECN_NOT_ECT 0x0UL 2749 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_CNP_ECN_ECT_1 0x1UL 2750 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_CNP_ECN_ECT_0 0x2UL 2751 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_CNP_ECN_LAST CMDQ_MODIFY_ROCE_CC_GEN1_TLV_CNP_ECN_ECT_0 2752 u8 rtt_jitter_en; 2753 __le16 link_bytes_per_usec; 2754 __le16 reset_cc_cr_th; 2755 u8 cr_width; 2756 u8 quota_period_min; 2757 u8 quota_period_max; 2758 u8 quota_period_abs_max; 2759 __le16 tr_lower_bound; 2760 u8 cr_prob_factor; 2761 u8 tr_prob_factor; 2762 __le16 fairness_cr_th; 2763 u8 red_div; 2764 u8 cnp_ratio_th; 2765 __le16 exp_ai_rtts; 2766 u8 exp_ai_cr_cp_ratio; 2767 u8 use_rate_table; 2768 __le16 cp_exp_update_th; 2769 __le16 high_exp_ai_rtts_th1; 2770 __le16 high_exp_ai_rtts_th2; 2771 __le16 actual_cr_cong_free_rtts_th; 2772 __le16 severe_cong_cr_th1; 2773 __le16 severe_cong_cr_th2; 2774 __le32 link64B_per_rtt; 2775 u8 cc_ack_bytes; 2776 u8 reduce_init_en; 2777 __le16 reduce_init_cong_free_rtts_th; 2778 u8 random_no_red_en; 2779 u8 actual_cr_shift_correction_en; 2780 u8 quota_period_adjust_en; 2781 u8 reserved[5]; 2782 }; 2783 2784 /* creq_modify_roce_cc_resp (size:128b/16B) */ 2785 struct creq_modify_roce_cc_resp { 2786 u8 type; 2787 #define CREQ_MODIFY_ROCE_CC_RESP_TYPE_MASK 0x3fUL 2788 #define CREQ_MODIFY_ROCE_CC_RESP_TYPE_SFT 0 2789 #define CREQ_MODIFY_ROCE_CC_RESP_TYPE_QP_EVENT 0x38UL 2790 #define CREQ_MODIFY_ROCE_CC_RESP_TYPE_LAST CREQ_MODIFY_ROCE_CC_RESP_TYPE_QP_EVENT 2791 u8 status; 2792 __le16 cookie; 2793 __le32 reserved32; 2794 u8 v; 2795 #define CREQ_MODIFY_ROCE_CC_RESP_V 0x1UL 2796 u8 event; 2797 #define CREQ_MODIFY_ROCE_CC_RESP_EVENT_MODIFY_ROCE_CC 0x8cUL 2798 #define CREQ_MODIFY_ROCE_CC_RESP_EVENT_LAST CREQ_MODIFY_ROCE_CC_RESP_EVENT_MODIFY_ROCE_CC 2799 u8 reserved48[6]; 2800 }; 2801 2802 /* cmdq_set_link_aggr_mode_cc (size:320b/40B) */ 2803 struct cmdq_set_link_aggr_mode_cc { 2804 u8 opcode; 2805 #define CMDQ_SET_LINK_AGGR_MODE_OPCODE_SET_LINK_AGGR_MODE 0x8fUL 2806 #define CMDQ_SET_LINK_AGGR_MODE_OPCODE_LAST \ 2807 CMDQ_SET_LINK_AGGR_MODE_OPCODE_SET_LINK_AGGR_MODE 2808 u8 cmd_size; 2809 __le16 flags; 2810 __le16 cookie; 2811 u8 resp_size; 2812 u8 reserved8; 2813 __le64 resp_addr; 2814 __le32 modify_mask; 2815 #define CMDQ_SET_LINK_AGGR_MODE_MODIFY_MASK_AGGR_EN 0x1UL 2816 #define CMDQ_SET_LINK_AGGR_MODE_MODIFY_MASK_ACTIVE_PORT_MAP 0x2UL 2817 #define CMDQ_SET_LINK_AGGR_MODE_MODIFY_MASK_MEMBER_PORT_MAP 0x4UL 2818 #define CMDQ_SET_LINK_AGGR_MODE_MODIFY_MASK_AGGR_MODE 0x8UL 2819 #define CMDQ_SET_LINK_AGGR_MODE_MODIFY_MASK_STAT_CTX_ID 0x10UL 2820 u8 aggr_enable; 2821 #define CMDQ_SET_LINK_AGGR_MODE_AGGR_ENABLE 0x1UL 2822 #define CMDQ_SET_LINK_AGGR_MODE_RSVD1_MASK 0xfeUL 2823 #define CMDQ_SET_LINK_AGGR_MODE_RSVD1_SFT 1 2824 u8 active_port_map; 2825 #define CMDQ_SET_LINK_AGGR_MODE_ACTIVE_PORT_MAP_MASK 0xfUL 2826 #define CMDQ_SET_LINK_AGGR_MODE_ACTIVE_PORT_MAP_SFT 0 2827 #define CMDQ_SET_LINK_AGGR_MODE_RSVD2_MASK 0xf0UL 2828 #define CMDQ_SET_LINK_AGGR_MODE_RSVD2_SFT 4 2829 u8 member_port_map; 2830 u8 link_aggr_mode; 2831 #define CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_ACTIVE_ACTIVE 0x1UL 2832 #define CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_ACTIVE_BACKUP 0x2UL 2833 #define CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_BALANCE_XOR 0x3UL 2834 #define CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_802_3_AD 0x4UL 2835 #define CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_LAST CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_802_3_AD 2836 __le16 stat_ctx_id[4]; 2837 __le64 rsvd1; 2838 }; 2839 2840 /* creq_set_link_aggr_mode_resources_resp (size:128b/16B) */ 2841 struct creq_set_link_aggr_mode_resources_resp { 2842 u8 type; 2843 #define CREQ_SET_LINK_AGGR_MODE_RESP_TYPE_MASK 0x3fUL 2844 #define CREQ_SET_LINK_AGGR_MODE_RESP_TYPE_SFT 0 2845 #define CREQ_SET_LINK_AGGR_MODE_RESP_TYPE_QP_EVENT 0x38UL 2846 #define CREQ_SET_LINK_AGGR_MODE_RESP_TYPE_LAST CREQ_SET_LINK_AGGR_MODE_RESP_TYPE_QP_EVENT 2847 u8 status; 2848 __le16 cookie; 2849 __le32 reserved32; 2850 u8 v; 2851 #define CREQ_SET_LINK_AGGR_MODE_RESP_V 0x1UL 2852 u8 event; 2853 #define CREQ_SET_LINK_AGGR_MODE_RESP_EVENT_SET_LINK_AGGR_MODE 0x8fUL 2854 #define CREQ_SET_LINK_AGGR_MODE_RESP_EVENT_LAST\ 2855 CREQ_SET_LINK_AGGR_MODE_RESP_EVENT_SET_LINK_AGGR_MODE 2856 u8 reserved48[6]; 2857 }; 2858 2859 /* creq_func_event (size:128b/16B) */ 2860 struct creq_func_event { 2861 u8 type; 2862 #define CREQ_FUNC_EVENT_TYPE_MASK 0x3fUL 2863 #define CREQ_FUNC_EVENT_TYPE_SFT 0 2864 #define CREQ_FUNC_EVENT_TYPE_FUNC_EVENT 0x3aUL 2865 #define CREQ_FUNC_EVENT_TYPE_LAST CREQ_FUNC_EVENT_TYPE_FUNC_EVENT 2866 u8 reserved56[7]; 2867 u8 v; 2868 #define CREQ_FUNC_EVENT_V 0x1UL 2869 u8 event; 2870 #define CREQ_FUNC_EVENT_EVENT_TX_WQE_ERROR 0x1UL 2871 #define CREQ_FUNC_EVENT_EVENT_TX_DATA_ERROR 0x2UL 2872 #define CREQ_FUNC_EVENT_EVENT_RX_WQE_ERROR 0x3UL 2873 #define CREQ_FUNC_EVENT_EVENT_RX_DATA_ERROR 0x4UL 2874 #define CREQ_FUNC_EVENT_EVENT_CQ_ERROR 0x5UL 2875 #define CREQ_FUNC_EVENT_EVENT_TQM_ERROR 0x6UL 2876 #define CREQ_FUNC_EVENT_EVENT_CFCQ_ERROR 0x7UL 2877 #define CREQ_FUNC_EVENT_EVENT_CFCS_ERROR 0x8UL 2878 #define CREQ_FUNC_EVENT_EVENT_CFCC_ERROR 0x9UL 2879 #define CREQ_FUNC_EVENT_EVENT_CFCM_ERROR 0xaUL 2880 #define CREQ_FUNC_EVENT_EVENT_TIM_ERROR 0xbUL 2881 #define CREQ_FUNC_EVENT_EVENT_VF_COMM_REQUEST 0x80UL 2882 #define CREQ_FUNC_EVENT_EVENT_RESOURCE_EXHAUSTED 0x81UL 2883 #define CREQ_FUNC_EVENT_EVENT_LAST CREQ_FUNC_EVENT_EVENT_RESOURCE_EXHAUSTED 2884 u8 reserved48[6]; 2885 }; 2886 2887 /* creq_qp_event (size:128b/16B) */ 2888 struct creq_qp_event { 2889 u8 type; 2890 #define CREQ_QP_EVENT_TYPE_MASK 0x3fUL 2891 #define CREQ_QP_EVENT_TYPE_SFT 0 2892 #define CREQ_QP_EVENT_TYPE_QP_EVENT 0x38UL 2893 #define CREQ_QP_EVENT_TYPE_LAST CREQ_QP_EVENT_TYPE_QP_EVENT 2894 u8 status; 2895 #define CREQ_QP_EVENT_STATUS_SUCCESS 0x0UL 2896 #define CREQ_QP_EVENT_STATUS_FAIL 0x1UL 2897 #define CREQ_QP_EVENT_STATUS_RESOURCES 0x2UL 2898 #define CREQ_QP_EVENT_STATUS_INVALID_CMD 0x3UL 2899 #define CREQ_QP_EVENT_STATUS_NOT_IMPLEMENTED 0x4UL 2900 #define CREQ_QP_EVENT_STATUS_INVALID_PARAMETER 0x5UL 2901 #define CREQ_QP_EVENT_STATUS_HARDWARE_ERROR 0x6UL 2902 #define CREQ_QP_EVENT_STATUS_INTERNAL_ERROR 0x7UL 2903 #define CREQ_QP_EVENT_STATUS_LAST CREQ_QP_EVENT_STATUS_INTERNAL_ERROR 2904 __le16 cookie; 2905 __le32 reserved32; 2906 u8 v; 2907 #define CREQ_QP_EVENT_V 0x1UL 2908 u8 event; 2909 #define CREQ_QP_EVENT_EVENT_CREATE_QP 0x1UL 2910 #define CREQ_QP_EVENT_EVENT_DESTROY_QP 0x2UL 2911 #define CREQ_QP_EVENT_EVENT_MODIFY_QP 0x3UL 2912 #define CREQ_QP_EVENT_EVENT_QUERY_QP 0x4UL 2913 #define CREQ_QP_EVENT_EVENT_CREATE_SRQ 0x5UL 2914 #define CREQ_QP_EVENT_EVENT_DESTROY_SRQ 0x6UL 2915 #define CREQ_QP_EVENT_EVENT_QUERY_SRQ 0x8UL 2916 #define CREQ_QP_EVENT_EVENT_CREATE_CQ 0x9UL 2917 #define CREQ_QP_EVENT_EVENT_DESTROY_CQ 0xaUL 2918 #define CREQ_QP_EVENT_EVENT_RESIZE_CQ 0xcUL 2919 #define CREQ_QP_EVENT_EVENT_ALLOCATE_MRW 0xdUL 2920 #define CREQ_QP_EVENT_EVENT_DEALLOCATE_KEY 0xeUL 2921 #define CREQ_QP_EVENT_EVENT_REGISTER_MR 0xfUL 2922 #define CREQ_QP_EVENT_EVENT_DEREGISTER_MR 0x10UL 2923 #define CREQ_QP_EVENT_EVENT_ADD_GID 0x11UL 2924 #define CREQ_QP_EVENT_EVENT_DELETE_GID 0x12UL 2925 #define CREQ_QP_EVENT_EVENT_MODIFY_GID 0x17UL 2926 #define CREQ_QP_EVENT_EVENT_QUERY_GID 0x18UL 2927 #define CREQ_QP_EVENT_EVENT_CREATE_QP1 0x13UL 2928 #define CREQ_QP_EVENT_EVENT_DESTROY_QP1 0x14UL 2929 #define CREQ_QP_EVENT_EVENT_CREATE_AH 0x15UL 2930 #define CREQ_QP_EVENT_EVENT_DESTROY_AH 0x16UL 2931 #define CREQ_QP_EVENT_EVENT_INITIALIZE_FW 0x80UL 2932 #define CREQ_QP_EVENT_EVENT_DEINITIALIZE_FW 0x81UL 2933 #define CREQ_QP_EVENT_EVENT_STOP_FUNC 0x82UL 2934 #define CREQ_QP_EVENT_EVENT_QUERY_FUNC 0x83UL 2935 #define CREQ_QP_EVENT_EVENT_SET_FUNC_RESOURCES 0x84UL 2936 #define CREQ_QP_EVENT_EVENT_READ_CONTEXT 0x85UL 2937 #define CREQ_QP_EVENT_EVENT_MAP_TC_TO_COS 0x8aUL 2938 #define CREQ_QP_EVENT_EVENT_QUERY_VERSION 0x8bUL 2939 #define CREQ_QP_EVENT_EVENT_MODIFY_CC 0x8cUL 2940 #define CREQ_QP_EVENT_EVENT_QUERY_CC 0x8dUL 2941 #define CREQ_QP_EVENT_EVENT_QUERY_ROCE_STATS 0x8eUL 2942 #define CREQ_QP_EVENT_EVENT_SET_LINK_AGGR_MODE 0x8fUL 2943 #define CREQ_QP_EVENT_EVENT_QUERY_QP_EXTEND 0x91UL 2944 #define CREQ_QP_EVENT_EVENT_QP_ERROR_NOTIFICATION 0xc0UL 2945 #define CREQ_QP_EVENT_EVENT_CQ_ERROR_NOTIFICATION 0xc1UL 2946 #define CREQ_QP_EVENT_EVENT_LAST CREQ_QP_EVENT_EVENT_CQ_ERROR_NOTIFICATION 2947 u8 reserved48[6]; 2948 }; 2949 2950 /* creq_qp_error_notification (size:128b/16B) */ 2951 struct creq_qp_error_notification { 2952 u8 type; 2953 #define CREQ_QP_ERROR_NOTIFICATION_TYPE_MASK 0x3fUL 2954 #define CREQ_QP_ERROR_NOTIFICATION_TYPE_SFT 0 2955 #define CREQ_QP_ERROR_NOTIFICATION_TYPE_QP_EVENT 0x38UL 2956 #define CREQ_QP_ERROR_NOTIFICATION_TYPE_LAST CREQ_QP_ERROR_NOTIFICATION_TYPE_QP_EVENT 2957 u8 status; 2958 u8 req_slow_path_state; 2959 u8 req_err_state_reason; 2960 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_NO_ERROR 0X0UL 2961 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_OPCODE_ERROR 0X1UL 2962 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_TIMEOUT_RETRY_LIMIT 0X2UL 2963 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_RNR_TIMEOUT_RETRY_LIMIT 0X3UL 2964 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_NAK_ARRIVAL_1 0X4UL 2965 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_NAK_ARRIVAL_2 0X5UL 2966 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_NAK_ARRIVAL_3 0X6UL 2967 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_NAK_ARRIVAL_4 0X7UL 2968 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_RX_MEMORY_ERROR 0X8UL 2969 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_TX_MEMORY_ERROR 0X9UL 2970 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_READ_RESP_LENGTH 0XAUL 2971 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_INVALID_READ_RESP 0XBUL 2972 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_ILLEGAL_BIND 0XCUL 2973 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_ILLEGAL_FAST_REG 0XDUL 2974 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_ILLEGAL_INVALIDATE 0XEUL 2975 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_CMP_ERROR 0XFUL 2976 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_RETRAN_LOCAL_ERROR 0X10UL 2977 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_WQE_FORMAT_ERROR 0X11UL 2978 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_ORRQ_FORMAT_ERROR 0X12UL 2979 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_INVALID_AVID_ERROR 0X13UL 2980 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_AV_DOMAIN_ERROR 0X14UL 2981 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_CQ_LOAD_ERROR 0X15UL 2982 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_SERV_TYPE_ERROR 0X16UL 2983 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_INVALID_OP_ERROR 0X17UL 2984 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_TX_PCI_ERROR 0X18UL 2985 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_RX_PCI_ERROR 0X19UL 2986 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_PROD_WQE_MSMTCH_ERROR 0X1AUL 2987 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_PSN_RANGE_CHECK_ERROR 0X1BUL 2988 #define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_RETX_SETUP_ERROR 0X1CUL 2989 __le32 xid; 2990 u8 v; 2991 #define CREQ_QP_ERROR_NOTIFICATION_V 0x1UL 2992 u8 event; 2993 #define CREQ_QP_ERROR_NOTIFICATION_EVENT_QP_ERROR_NOTIFICATION 0xc0UL 2994 #define CREQ_QP_ERROR_NOTIFICATION_EVENT_LAST \ 2995 CREQ_QP_ERROR_NOTIFICATION_EVENT_QP_ERROR_NOTIFICATION 2996 u8 res_slow_path_state; 2997 u8 res_err_state_reason; 2998 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_NO_ERROR 0x0UL 2999 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_EXCEED_MAX 0x1UL 3000 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_PAYLOAD_LENGTH_MISMATCH 0x2UL 3001 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_EXCEEDS_WQE 0x3UL 3002 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_OPCODE_ERROR 0x4UL 3003 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_PSN_SEQ_ERROR_RETRY_LIMIT 0x5UL 3004 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_RX_INVALID_R_KEY 0x6UL 3005 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_RX_DOMAIN_ERROR 0x7UL 3006 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_RX_NO_PERMISSION 0x8UL 3007 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_RX_RANGE_ERROR 0x9UL 3008 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_TX_INVALID_R_KEY 0xaUL 3009 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_TX_DOMAIN_ERROR 0xbUL 3010 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_TX_NO_PERMISSION 0xcUL 3011 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_TX_RANGE_ERROR 0xdUL 3012 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_IRRQ_OFLOW 0xeUL 3013 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_UNSUPPORTED_OPCODE 0xfUL 3014 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_UNALIGN_ATOMIC 0x10UL 3015 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_REM_INVALIDATE 0x11UL 3016 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_MEMORY_ERROR 0x12UL 3017 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_SRQ_ERROR 0x13UL 3018 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_CMP_ERROR 0x14UL 3019 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_INVALID_DUP_RKEY 0x15UL 3020 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_WQE_FORMAT_ERROR 0x16UL 3021 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_IRRQ_FORMAT_ERROR 0x17UL 3022 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_CQ_LOAD_ERROR 0x18UL 3023 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_SRQ_LOAD_ERROR 0x19UL 3024 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_TX_PCI_ERROR 0x1bUL 3025 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_RX_PCI_ERROR 0x1cUL 3026 #define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_PSN_NOT_FOUND 0x1dUL 3027 __le16 sq_cons_idx; 3028 __le16 rq_cons_idx; 3029 }; 3030 3031 /* creq_cq_error_notification (size:128b/16B) */ 3032 struct creq_cq_error_notification { 3033 u8 type; 3034 #define CREQ_CQ_ERROR_NOTIFICATION_TYPE_MASK 0x3fUL 3035 #define CREQ_CQ_ERROR_NOTIFICATION_TYPE_SFT 0 3036 #define CREQ_CQ_ERROR_NOTIFICATION_TYPE_CQ_EVENT 0x38UL 3037 #define CREQ_CQ_ERROR_NOTIFICATION_TYPE_LAST CREQ_CQ_ERROR_NOTIFICATION_TYPE_CQ_EVENT 3038 u8 status; 3039 u8 cq_err_reason; 3040 #define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_REQ_CQ_INVALID_ERROR 0x1UL 3041 #define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_REQ_CQ_OVERFLOW_ERROR 0x2UL 3042 #define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_REQ_CQ_LOAD_ERROR 0x3UL 3043 #define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_RES_CQ_INVALID_ERROR 0x4UL 3044 #define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_RES_CQ_OVERFLOW_ERROR 0x5UL 3045 #define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_RES_CQ_LOAD_ERROR 0x6UL 3046 #define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_LAST \ 3047 CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_RES_CQ_LOAD_ERROR 3048 u8 reserved8; 3049 __le32 xid; 3050 u8 v; 3051 #define CREQ_CQ_ERROR_NOTIFICATION_V 0x1UL 3052 u8 event; 3053 #define CREQ_CQ_ERROR_NOTIFICATION_EVENT_CQ_ERROR_NOTIFICATION 0xc1UL 3054 #define CREQ_CQ_ERROR_NOTIFICATION_EVENT_LAST \ 3055 CREQ_CQ_ERROR_NOTIFICATION_EVENT_CQ_ERROR_NOTIFICATION 3056 u8 reserved48[6]; 3057 }; 3058 3059 /* sq_base (size:64b/8B) */ 3060 struct sq_base { 3061 u8 wqe_type; 3062 #define SQ_BASE_WQE_TYPE_SEND 0x0UL 3063 #define SQ_BASE_WQE_TYPE_SEND_W_IMMEAD 0x1UL 3064 #define SQ_BASE_WQE_TYPE_SEND_W_INVALID 0x2UL 3065 #define SQ_BASE_WQE_TYPE_WRITE_WQE 0x4UL 3066 #define SQ_BASE_WQE_TYPE_WRITE_W_IMMEAD 0x5UL 3067 #define SQ_BASE_WQE_TYPE_READ_WQE 0x6UL 3068 #define SQ_BASE_WQE_TYPE_ATOMIC_CS 0x8UL 3069 #define SQ_BASE_WQE_TYPE_ATOMIC_FA 0xbUL 3070 #define SQ_BASE_WQE_TYPE_LOCAL_INVALID 0xcUL 3071 #define SQ_BASE_WQE_TYPE_FR_PMR 0xdUL 3072 #define SQ_BASE_WQE_TYPE_BIND 0xeUL 3073 #define SQ_BASE_WQE_TYPE_FR_PPMR 0xfUL 3074 #define SQ_BASE_WQE_TYPE_LAST SQ_BASE_WQE_TYPE_FR_PPMR 3075 u8 unused_0[7]; 3076 }; 3077 3078 /* sq_sge (size:128b/16B) */ 3079 struct sq_sge { 3080 __le64 va_or_pa; 3081 __le32 l_key; 3082 __le32 size; 3083 }; 3084 3085 /* sq_psn_search (size:64b/8B) */ 3086 struct sq_psn_search { 3087 __le32 opcode_start_psn; 3088 #define SQ_PSN_SEARCH_START_PSN_MASK 0xffffffUL 3089 #define SQ_PSN_SEARCH_START_PSN_SFT 0 3090 #define SQ_PSN_SEARCH_OPCODE_MASK 0xff000000UL 3091 #define SQ_PSN_SEARCH_OPCODE_SFT 24 3092 __le32 flags_next_psn; 3093 #define SQ_PSN_SEARCH_NEXT_PSN_MASK 0xffffffUL 3094 #define SQ_PSN_SEARCH_NEXT_PSN_SFT 0 3095 #define SQ_PSN_SEARCH_FLAGS_MASK 0xff000000UL 3096 #define SQ_PSN_SEARCH_FLAGS_SFT 24 3097 }; 3098 3099 /* sq_psn_search_ext (size:128b/16B) */ 3100 struct sq_psn_search_ext { 3101 __le32 opcode_start_psn; 3102 #define SQ_PSN_SEARCH_EXT_START_PSN_MASK 0xffffffUL 3103 #define SQ_PSN_SEARCH_EXT_START_PSN_SFT 0 3104 #define SQ_PSN_SEARCH_EXT_OPCODE_MASK 0xff000000UL 3105 #define SQ_PSN_SEARCH_EXT_OPCODE_SFT 24 3106 __le32 flags_next_psn; 3107 #define SQ_PSN_SEARCH_EXT_NEXT_PSN_MASK 0xffffffUL 3108 #define SQ_PSN_SEARCH_EXT_NEXT_PSN_SFT 0 3109 #define SQ_PSN_SEARCH_EXT_FLAGS_MASK 0xff000000UL 3110 #define SQ_PSN_SEARCH_EXT_FLAGS_SFT 24 3111 __le16 start_slot_idx; 3112 __le16 reserved16; 3113 __le32 reserved32; 3114 }; 3115 3116 /* sq_msn_search (size:64b/8B) */ 3117 struct sq_msn_search { 3118 __le64 start_idx_next_psn_start_psn; 3119 #define SQ_MSN_SEARCH_START_PSN_MASK 0xffffffUL 3120 #define SQ_MSN_SEARCH_START_PSN_SFT 0 3121 #define SQ_MSN_SEARCH_NEXT_PSN_MASK 0xffffff000000ULL 3122 #define SQ_MSN_SEARCH_NEXT_PSN_SFT 24 3123 #define SQ_MSN_SEARCH_START_IDX_MASK 0xffff000000000000ULL 3124 #define SQ_MSN_SEARCH_START_IDX_SFT 48 3125 }; 3126 3127 /* sq_send (size:1024b/128B) */ 3128 struct sq_send { 3129 u8 wqe_type; 3130 #define SQ_SEND_WQE_TYPE_SEND 0x0UL 3131 #define SQ_SEND_WQE_TYPE_SEND_W_IMMEAD 0x1UL 3132 #define SQ_SEND_WQE_TYPE_SEND_W_INVALID 0x2UL 3133 #define SQ_SEND_WQE_TYPE_LAST SQ_SEND_WQE_TYPE_SEND_W_INVALID 3134 u8 flags; 3135 #define SQ_SEND_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK 0xffUL 3136 #define SQ_SEND_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT 0 3137 #define SQ_SEND_FLAGS_SIGNAL_COMP 0x1UL 3138 #define SQ_SEND_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL 3139 #define SQ_SEND_FLAGS_UC_FENCE 0x4UL 3140 #define SQ_SEND_FLAGS_SE 0x8UL 3141 #define SQ_SEND_FLAGS_INLINE 0x10UL 3142 #define SQ_SEND_FLAGS_WQE_TS_EN 0x20UL 3143 #define SQ_SEND_FLAGS_DEBUG_TRACE 0x40UL 3144 u8 wqe_size; 3145 u8 reserved8_1; 3146 __le32 inv_key_or_imm_data; 3147 __le32 length; 3148 __le32 q_key; 3149 __le32 dst_qp; 3150 #define SQ_SEND_DST_QP_MASK 0xffffffUL 3151 #define SQ_SEND_DST_QP_SFT 0 3152 __le32 avid; 3153 #define SQ_SEND_AVID_MASK 0xfffffUL 3154 #define SQ_SEND_AVID_SFT 0 3155 __le32 reserved32; 3156 __le32 timestamp; 3157 #define SQ_SEND_TIMESTAMP_MASK 0xffffffUL 3158 #define SQ_SEND_TIMESTAMP_SFT 0 3159 __le32 data[24]; 3160 }; 3161 3162 /* sq_send_hdr (size:256b/32B) */ 3163 struct sq_send_hdr { 3164 u8 wqe_type; 3165 #define SQ_SEND_HDR_WQE_TYPE_SEND 0x0UL 3166 #define SQ_SEND_HDR_WQE_TYPE_SEND_W_IMMEAD 0x1UL 3167 #define SQ_SEND_HDR_WQE_TYPE_SEND_W_INVALID 0x2UL 3168 #define SQ_SEND_HDR_WQE_TYPE_LAST SQ_SEND_HDR_WQE_TYPE_SEND_W_INVALID 3169 u8 flags; 3170 #define SQ_SEND_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK 0xffUL 3171 #define SQ_SEND_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT 0 3172 #define SQ_SEND_HDR_FLAGS_SIGNAL_COMP 0x1UL 3173 #define SQ_SEND_HDR_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL 3174 #define SQ_SEND_HDR_FLAGS_UC_FENCE 0x4UL 3175 #define SQ_SEND_HDR_FLAGS_SE 0x8UL 3176 #define SQ_SEND_HDR_FLAGS_INLINE 0x10UL 3177 #define SQ_SEND_HDR_FLAGS_WQE_TS_EN 0x20UL 3178 #define SQ_SEND_HDR_FLAGS_DEBUG_TRACE 0x40UL 3179 u8 wqe_size; 3180 u8 reserved8_1; 3181 __le32 inv_key_or_imm_data; 3182 __le32 length; 3183 __le32 q_key; 3184 __le32 dst_qp; 3185 #define SQ_SEND_HDR_DST_QP_MASK 0xffffffUL 3186 #define SQ_SEND_HDR_DST_QP_SFT 0 3187 __le32 avid; 3188 #define SQ_SEND_HDR_AVID_MASK 0xfffffUL 3189 #define SQ_SEND_HDR_AVID_SFT 0 3190 __le32 reserved32; 3191 __le32 timestamp; 3192 #define SQ_SEND_HDR_TIMESTAMP_MASK 0xffffffUL 3193 #define SQ_SEND_HDR_TIMESTAMP_SFT 0 3194 }; 3195 3196 /* sq_send_raweth_qp1 (size:1024b/128B) */ 3197 struct sq_send_raweth_qp1 { 3198 u8 wqe_type; 3199 #define SQ_SEND_RAWETH_QP1_WQE_TYPE_SEND 0x0UL 3200 #define SQ_SEND_RAWETH_QP1_WQE_TYPE_LAST SQ_SEND_RAWETH_QP1_WQE_TYPE_SEND 3201 u8 flags; 3202 #define SQ_SEND_RAWETH_QP1_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK \ 3203 0xffUL 3204 #define SQ_SEND_RAWETH_QP1_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT \ 3205 0 3206 #define SQ_SEND_RAWETH_QP1_FLAGS_SIGNAL_COMP 0x1UL 3207 #define SQ_SEND_RAWETH_QP1_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL 3208 #define SQ_SEND_RAWETH_QP1_FLAGS_UC_FENCE 0x4UL 3209 #define SQ_SEND_RAWETH_QP1_FLAGS_SE 0x8UL 3210 #define SQ_SEND_RAWETH_QP1_FLAGS_INLINE 0x10UL 3211 #define SQ_SEND_RAWETH_QP1_FLAGS_WQE_TS_EN 0x20UL 3212 #define SQ_SEND_RAWETH_QP1_FLAGS_DEBUG_TRACE 0x40UL 3213 u8 wqe_size; 3214 u8 reserved8; 3215 __le16 lflags; 3216 #define SQ_SEND_RAWETH_QP1_LFLAGS_TCP_UDP_CHKSUM 0x1UL 3217 #define SQ_SEND_RAWETH_QP1_LFLAGS_IP_CHKSUM 0x2UL 3218 #define SQ_SEND_RAWETH_QP1_LFLAGS_NOCRC 0x4UL 3219 #define SQ_SEND_RAWETH_QP1_LFLAGS_STAMP 0x8UL 3220 #define SQ_SEND_RAWETH_QP1_LFLAGS_T_IP_CHKSUM 0x10UL 3221 #define SQ_SEND_RAWETH_QP1_LFLAGS_ROCE_CRC 0x100UL 3222 #define SQ_SEND_RAWETH_QP1_LFLAGS_FCOE_CRC 0x200UL 3223 __le16 cfa_action; 3224 __le32 length; 3225 __le32 reserved32_1; 3226 __le32 cfa_meta; 3227 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_VID_MASK 0xfffUL 3228 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_VID_SFT 0 3229 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_DE 0x1000UL 3230 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_PRI_MASK 0xe000UL 3231 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_PRI_SFT 13 3232 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_MASK 0x70000UL 3233 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_SFT 16 3234 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID88A8 (0x0UL << 16) 3235 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID8100 (0x1UL << 16) 3236 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID9100 (0x2UL << 16) 3237 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID9200 (0x3UL << 16) 3238 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID9300 (0x4UL << 16) 3239 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPIDCFG (0x5UL << 16) 3240 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_LAST\ 3241 SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPIDCFG 3242 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_RESERVED_MASK 0xff80000UL 3243 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_RESERVED_SFT 19 3244 #define SQ_SEND_RAWETH_QP1_CFA_META_KEY_MASK 0xf0000000UL 3245 #define SQ_SEND_RAWETH_QP1_CFA_META_KEY_SFT 28 3246 #define SQ_SEND_RAWETH_QP1_CFA_META_KEY_NONE (0x0UL << 28) 3247 #define SQ_SEND_RAWETH_QP1_CFA_META_KEY_VLAN_TAG (0x1UL << 28) 3248 #define SQ_SEND_RAWETH_QP1_CFA_META_KEY_LAST SQ_SEND_RAWETH_QP1_CFA_META_KEY_VLAN_TAG 3249 __le32 reserved32_2; 3250 __le32 reserved32_3; 3251 __le32 timestamp; 3252 #define SQ_SEND_RAWETH_QP1_TIMESTAMP_MASK 0xffffffUL 3253 #define SQ_SEND_RAWETH_QP1_TIMESTAMP_SFT 0 3254 __le32 data[24]; 3255 }; 3256 3257 /* sq_send_raweth_qp1_hdr (size:256b/32B) */ 3258 struct sq_send_raweth_qp1_hdr { 3259 u8 wqe_type; 3260 #define SQ_SEND_RAWETH_QP1_HDR_WQE_TYPE_SEND 0x0UL 3261 #define SQ_SEND_RAWETH_QP1_HDR_WQE_TYPE_LAST SQ_SEND_RAWETH_QP1_HDR_WQE_TYPE_SEND 3262 u8 flags; 3263 #define \ 3264 SQ_SEND_RAWETH_QP1_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK 0xffUL 3265 #define SQ_SEND_RAWETH_QP1_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT\ 3266 0 3267 #define SQ_SEND_RAWETH_QP1_HDR_FLAGS_SIGNAL_COMP 0x1UL 3268 #define SQ_SEND_RAWETH_QP1_HDR_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL 3269 #define SQ_SEND_RAWETH_QP1_HDR_FLAGS_UC_FENCE 0x4UL 3270 #define SQ_SEND_RAWETH_QP1_HDR_FLAGS_SE 0x8UL 3271 #define SQ_SEND_RAWETH_QP1_HDR_FLAGS_INLINE 0x10UL 3272 #define SQ_SEND_RAWETH_QP1_HDR_FLAGS_WQE_TS_EN 0x20UL 3273 #define SQ_SEND_RAWETH_QP1_HDR_FLAGS_DEBUG_TRACE 0x40UL 3274 u8 wqe_size; 3275 u8 reserved8; 3276 __le16 lflags; 3277 #define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_TCP_UDP_CHKSUM 0x1UL 3278 #define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_IP_CHKSUM 0x2UL 3279 #define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_NOCRC 0x4UL 3280 #define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_STAMP 0x8UL 3281 #define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_T_IP_CHKSUM 0x10UL 3282 #define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_ROCE_CRC 0x100UL 3283 #define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_FCOE_CRC 0x200UL 3284 __le16 cfa_action; 3285 __le32 length; 3286 __le32 reserved32_1; 3287 __le32 cfa_meta; 3288 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_VID_MASK 0xfffUL 3289 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_VID_SFT 0 3290 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_DE 0x1000UL 3291 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_PRI_MASK 0xe000UL 3292 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_PRI_SFT 13 3293 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_MASK 0x70000UL 3294 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_SFT 16 3295 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPID88A8 (0x0UL << 16) 3296 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPID8100 (0x1UL << 16) 3297 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPID9100 (0x2UL << 16) 3298 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPID9200 (0x3UL << 16) 3299 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPID9300 (0x4UL << 16) 3300 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPIDCFG (0x5UL << 16) 3301 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_LAST\ 3302 SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPIDCFG 3303 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_RESERVED_MASK 0xff80000UL 3304 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_RESERVED_SFT 19 3305 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_MASK 0xf0000000UL 3306 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_SFT 28 3307 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_NONE (0x0UL << 28) 3308 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_VLAN_TAG (0x1UL << 28) 3309 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_LAST\ 3310 SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_VLAN_TAG 3311 __le32 reserved32_2; 3312 __le32 reserved32_3; 3313 __le32 timestamp; 3314 #define SQ_SEND_RAWETH_QP1_HDR_TIMESTAMP_MASK 0xffffffUL 3315 #define SQ_SEND_RAWETH_QP1_HDR_TIMESTAMP_SFT 0 3316 }; 3317 3318 /* sq_rdma (size:1024b/128B) */ 3319 struct sq_rdma { 3320 u8 wqe_type; 3321 #define SQ_RDMA_WQE_TYPE_WRITE_WQE 0x4UL 3322 #define SQ_RDMA_WQE_TYPE_WRITE_W_IMMEAD 0x5UL 3323 #define SQ_RDMA_WQE_TYPE_READ_WQE 0x6UL 3324 #define SQ_RDMA_WQE_TYPE_LAST SQ_RDMA_WQE_TYPE_READ_WQE 3325 u8 flags; 3326 #define SQ_RDMA_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK 0xffUL 3327 #define SQ_RDMA_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT 0 3328 #define SQ_RDMA_FLAGS_SIGNAL_COMP 0x1UL 3329 #define SQ_RDMA_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL 3330 #define SQ_RDMA_FLAGS_UC_FENCE 0x4UL 3331 #define SQ_RDMA_FLAGS_SE 0x8UL 3332 #define SQ_RDMA_FLAGS_INLINE 0x10UL 3333 #define SQ_RDMA_FLAGS_WQE_TS_EN 0x20UL 3334 #define SQ_RDMA_FLAGS_DEBUG_TRACE 0x40UL 3335 u8 wqe_size; 3336 u8 reserved8; 3337 __le32 imm_data; 3338 __le32 length; 3339 __le32 reserved32_1; 3340 __le64 remote_va; 3341 __le32 remote_key; 3342 __le32 timestamp; 3343 #define SQ_RDMA_TIMESTAMP_MASK 0xffffffUL 3344 #define SQ_RDMA_TIMESTAMP_SFT 0 3345 __le32 data[24]; 3346 }; 3347 3348 /* sq_rdma_hdr (size:256b/32B) */ 3349 struct sq_rdma_hdr { 3350 u8 wqe_type; 3351 #define SQ_RDMA_HDR_WQE_TYPE_WRITE_WQE 0x4UL 3352 #define SQ_RDMA_HDR_WQE_TYPE_WRITE_W_IMMEAD 0x5UL 3353 #define SQ_RDMA_HDR_WQE_TYPE_READ_WQE 0x6UL 3354 #define SQ_RDMA_HDR_WQE_TYPE_LAST SQ_RDMA_HDR_WQE_TYPE_READ_WQE 3355 u8 flags; 3356 #define SQ_RDMA_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK 0xffUL 3357 #define SQ_RDMA_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT 0 3358 #define SQ_RDMA_HDR_FLAGS_SIGNAL_COMP 0x1UL 3359 #define SQ_RDMA_HDR_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL 3360 #define SQ_RDMA_HDR_FLAGS_UC_FENCE 0x4UL 3361 #define SQ_RDMA_HDR_FLAGS_SE 0x8UL 3362 #define SQ_RDMA_HDR_FLAGS_INLINE 0x10UL 3363 #define SQ_RDMA_HDR_FLAGS_WQE_TS_EN 0x20UL 3364 #define SQ_RDMA_HDR_FLAGS_DEBUG_TRACE 0x40UL 3365 u8 wqe_size; 3366 u8 reserved8; 3367 __le32 imm_data; 3368 __le32 length; 3369 __le32 reserved32_1; 3370 __le64 remote_va; 3371 __le32 remote_key; 3372 __le32 timestamp; 3373 #define SQ_RDMA_HDR_TIMESTAMP_MASK 0xffffffUL 3374 #define SQ_RDMA_HDR_TIMESTAMP_SFT 0 3375 }; 3376 3377 /* sq_atomic (size:1024b/128B) */ 3378 struct sq_atomic { 3379 u8 wqe_type; 3380 #define SQ_ATOMIC_WQE_TYPE_ATOMIC_CS 0x8UL 3381 #define SQ_ATOMIC_WQE_TYPE_ATOMIC_FA 0xbUL 3382 #define SQ_ATOMIC_WQE_TYPE_LAST SQ_ATOMIC_WQE_TYPE_ATOMIC_FA 3383 u8 flags; 3384 #define SQ_ATOMIC_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK 0xffUL 3385 #define SQ_ATOMIC_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT 0 3386 #define SQ_ATOMIC_FLAGS_SIGNAL_COMP 0x1UL 3387 #define SQ_ATOMIC_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL 3388 #define SQ_ATOMIC_FLAGS_UC_FENCE 0x4UL 3389 #define SQ_ATOMIC_FLAGS_SE 0x8UL 3390 #define SQ_ATOMIC_FLAGS_INLINE 0x10UL 3391 #define SQ_ATOMIC_FLAGS_WQE_TS_EN 0x20UL 3392 #define SQ_ATOMIC_FLAGS_DEBUG_TRACE 0x40UL 3393 __le16 reserved16; 3394 __le32 remote_key; 3395 __le64 remote_va; 3396 __le64 swap_data; 3397 __le64 cmp_data; 3398 __le32 data[24]; 3399 }; 3400 3401 /* sq_atomic_hdr (size:256b/32B) */ 3402 struct sq_atomic_hdr { 3403 u8 wqe_type; 3404 #define SQ_ATOMIC_HDR_WQE_TYPE_ATOMIC_CS 0x8UL 3405 #define SQ_ATOMIC_HDR_WQE_TYPE_ATOMIC_FA 0xbUL 3406 #define SQ_ATOMIC_HDR_WQE_TYPE_LAST SQ_ATOMIC_HDR_WQE_TYPE_ATOMIC_FA 3407 u8 flags; 3408 #define SQ_ATOMIC_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK 0xffUL 3409 #define SQ_ATOMIC_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT 0 3410 #define SQ_ATOMIC_HDR_FLAGS_SIGNAL_COMP 0x1UL 3411 #define SQ_ATOMIC_HDR_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL 3412 #define SQ_ATOMIC_HDR_FLAGS_UC_FENCE 0x4UL 3413 #define SQ_ATOMIC_HDR_FLAGS_SE 0x8UL 3414 #define SQ_ATOMIC_HDR_FLAGS_INLINE 0x10UL 3415 #define SQ_ATOMIC_HDR_FLAGS_WQE_TS_EN 0x20UL 3416 #define SQ_ATOMIC_HDR_FLAGS_DEBUG_TRACE 0x40UL 3417 __le16 reserved16; 3418 __le32 remote_key; 3419 __le64 remote_va; 3420 __le64 swap_data; 3421 __le64 cmp_data; 3422 }; 3423 3424 /* sq_localinvalidate (size:1024b/128B) */ 3425 struct sq_localinvalidate { 3426 u8 wqe_type; 3427 #define SQ_LOCALINVALIDATE_WQE_TYPE_LOCAL_INVALID 0xcUL 3428 #define SQ_LOCALINVALIDATE_WQE_TYPE_LAST SQ_LOCALINVALIDATE_WQE_TYPE_LOCAL_INVALID 3429 u8 flags; 3430 #define SQ_LOCALINVALIDATE_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK\ 3431 0xffUL 3432 #define SQ_LOCALINVALIDATE_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT\ 3433 0 3434 #define SQ_LOCALINVALIDATE_FLAGS_SIGNAL_COMP 0x1UL 3435 #define SQ_LOCALINVALIDATE_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL 3436 #define SQ_LOCALINVALIDATE_FLAGS_UC_FENCE 0x4UL 3437 #define SQ_LOCALINVALIDATE_FLAGS_SE 0x8UL 3438 #define SQ_LOCALINVALIDATE_FLAGS_INLINE 0x10UL 3439 #define SQ_LOCALINVALIDATE_FLAGS_WQE_TS_EN 0x20UL 3440 #define SQ_LOCALINVALIDATE_FLAGS_DEBUG_TRACE 0x40UL 3441 __le16 reserved16; 3442 __le32 inv_l_key; 3443 __le64 reserved64; 3444 u8 reserved128[16]; 3445 __le32 data[24]; 3446 }; 3447 3448 /* sq_localinvalidate_hdr (size:256b/32B) */ 3449 struct sq_localinvalidate_hdr { 3450 u8 wqe_type; 3451 #define SQ_LOCALINVALIDATE_HDR_WQE_TYPE_LOCAL_INVALID 0xcUL 3452 #define SQ_LOCALINVALIDATE_HDR_WQE_TYPE_LAST SQ_LOCALINVALIDATE_HDR_WQE_TYPE_LOCAL_INVALID 3453 u8 flags; 3454 #define \ 3455 SQ_LOCALINVALIDATE_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK 0xffUL 3456 #define SQ_LOCALINVALIDATE_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT\ 3457 0 3458 #define SQ_LOCALINVALIDATE_HDR_FLAGS_SIGNAL_COMP 0x1UL 3459 #define SQ_LOCALINVALIDATE_HDR_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL 3460 #define SQ_LOCALINVALIDATE_HDR_FLAGS_UC_FENCE 0x4UL 3461 #define SQ_LOCALINVALIDATE_HDR_FLAGS_SE 0x8UL 3462 #define SQ_LOCALINVALIDATE_HDR_FLAGS_INLINE 0x10UL 3463 #define SQ_LOCALINVALIDATE_HDR_FLAGS_WQE_TS_EN 0x20UL 3464 #define SQ_LOCALINVALIDATE_HDR_FLAGS_DEBUG_TRACE 0x40UL 3465 __le16 reserved16; 3466 __le32 inv_l_key; 3467 __le64 reserved64; 3468 u8 reserved128[16]; 3469 }; 3470 3471 /* sq_fr_pmr (size:1024b/128B) */ 3472 struct sq_fr_pmr { 3473 u8 wqe_type; 3474 #define SQ_FR_PMR_WQE_TYPE_FR_PMR 0xdUL 3475 #define SQ_FR_PMR_WQE_TYPE_LAST SQ_FR_PMR_WQE_TYPE_FR_PMR 3476 u8 flags; 3477 #define SQ_FR_PMR_FLAGS_SIGNAL_COMP 0x1UL 3478 #define SQ_FR_PMR_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL 3479 #define SQ_FR_PMR_FLAGS_UC_FENCE 0x4UL 3480 #define SQ_FR_PMR_FLAGS_SE 0x8UL 3481 #define SQ_FR_PMR_FLAGS_INLINE 0x10UL 3482 #define SQ_FR_PMR_FLAGS_WQE_TS_EN 0x20UL 3483 #define SQ_FR_PMR_FLAGS_DEBUG_TRACE 0x40UL 3484 u8 access_cntl; 3485 #define SQ_FR_PMR_ACCESS_CNTL_LOCAL_WRITE 0x1UL 3486 #define SQ_FR_PMR_ACCESS_CNTL_REMOTE_READ 0x2UL 3487 #define SQ_FR_PMR_ACCESS_CNTL_REMOTE_WRITE 0x4UL 3488 #define SQ_FR_PMR_ACCESS_CNTL_REMOTE_ATOMIC 0x8UL 3489 #define SQ_FR_PMR_ACCESS_CNTL_WINDOW_BIND 0x10UL 3490 u8 zero_based_page_size_log; 3491 #define SQ_FR_PMR_PAGE_SIZE_LOG_MASK 0x1fUL 3492 #define SQ_FR_PMR_PAGE_SIZE_LOG_SFT 0 3493 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4K 0x0UL 3494 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8K 0x1UL 3495 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_16K 0x2UL 3496 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_32K 0x3UL 3497 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_64K 0x4UL 3498 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_128K 0x5UL 3499 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_256K 0x6UL 3500 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_512K 0x7UL 3501 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_1M 0x8UL 3502 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_2M 0x9UL 3503 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4M 0xaUL 3504 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8M 0xbUL 3505 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_16M 0xcUL 3506 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_32M 0xdUL 3507 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_64M 0xeUL 3508 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_128M 0xfUL 3509 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_256M 0x10UL 3510 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_512M 0x11UL 3511 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_1G 0x12UL 3512 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_2G 0x13UL 3513 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4G 0x14UL 3514 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8G 0x15UL 3515 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_16G 0x16UL 3516 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_32G 0x17UL 3517 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_64G 0x18UL 3518 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_128G 0x19UL 3519 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_256G 0x1aUL 3520 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_512G 0x1bUL 3521 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_1T 0x1cUL 3522 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_2T 0x1dUL 3523 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4T 0x1eUL 3524 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8T 0x1fUL 3525 #define SQ_FR_PMR_PAGE_SIZE_LOG_LAST SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8T 3526 #define SQ_FR_PMR_ZERO_BASED 0x20UL 3527 __le32 l_key; 3528 u8 length[5]; 3529 u8 reserved8_1; 3530 u8 reserved8_2; 3531 u8 numlevels_pbl_page_size_log; 3532 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_MASK 0x1fUL 3533 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_SFT 0 3534 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4K 0x0UL 3535 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8K 0x1UL 3536 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_16K 0x2UL 3537 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_32K 0x3UL 3538 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_64K 0x4UL 3539 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_128K 0x5UL 3540 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_256K 0x6UL 3541 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_512K 0x7UL 3542 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_1M 0x8UL 3543 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_2M 0x9UL 3544 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4M 0xaUL 3545 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8M 0xbUL 3546 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_16M 0xcUL 3547 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_32M 0xdUL 3548 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_64M 0xeUL 3549 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_128M 0xfUL 3550 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_256M 0x10UL 3551 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_512M 0x11UL 3552 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_1G 0x12UL 3553 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_2G 0x13UL 3554 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4G 0x14UL 3555 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8G 0x15UL 3556 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_16G 0x16UL 3557 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_32G 0x17UL 3558 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_64G 0x18UL 3559 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_128G 0x19UL 3560 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_256G 0x1aUL 3561 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_512G 0x1bUL 3562 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_1T 0x1cUL 3563 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_2T 0x1dUL 3564 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4T 0x1eUL 3565 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8T 0x1fUL 3566 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_LAST SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8T 3567 #define SQ_FR_PMR_NUMLEVELS_MASK 0xc0UL 3568 #define SQ_FR_PMR_NUMLEVELS_SFT 6 3569 #define SQ_FR_PMR_NUMLEVELS_PHYSICAL (0x0UL << 6) 3570 #define SQ_FR_PMR_NUMLEVELS_LAYER1 (0x1UL << 6) 3571 #define SQ_FR_PMR_NUMLEVELS_LAYER2 (0x2UL << 6) 3572 #define SQ_FR_PMR_NUMLEVELS_LAST SQ_FR_PMR_NUMLEVELS_LAYER2 3573 __le64 pblptr; 3574 __le64 va; 3575 __le32 data[24]; 3576 }; 3577 3578 /* sq_fr_pmr_hdr (size:256b/32B) */ 3579 struct sq_fr_pmr_hdr { 3580 u8 wqe_type; 3581 #define SQ_FR_PMR_HDR_WQE_TYPE_FR_PMR 0xdUL 3582 #define SQ_FR_PMR_HDR_WQE_TYPE_LAST SQ_FR_PMR_HDR_WQE_TYPE_FR_PMR 3583 u8 flags; 3584 #define SQ_FR_PMR_HDR_FLAGS_SIGNAL_COMP 0x1UL 3585 #define SQ_FR_PMR_HDR_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL 3586 #define SQ_FR_PMR_HDR_FLAGS_UC_FENCE 0x4UL 3587 #define SQ_FR_PMR_HDR_FLAGS_SE 0x8UL 3588 #define SQ_FR_PMR_HDR_FLAGS_INLINE 0x10UL 3589 #define SQ_FR_PMR_HDR_FLAGS_WQE_TS_EN 0x20UL 3590 #define SQ_FR_PMR_HDR_FLAGS_DEBUG_TRACE 0x40UL 3591 u8 access_cntl; 3592 #define SQ_FR_PMR_HDR_ACCESS_CNTL_LOCAL_WRITE 0x1UL 3593 #define SQ_FR_PMR_HDR_ACCESS_CNTL_REMOTE_READ 0x2UL 3594 #define SQ_FR_PMR_HDR_ACCESS_CNTL_REMOTE_WRITE 0x4UL 3595 #define SQ_FR_PMR_HDR_ACCESS_CNTL_REMOTE_ATOMIC 0x8UL 3596 #define SQ_FR_PMR_HDR_ACCESS_CNTL_WINDOW_BIND 0x10UL 3597 u8 zero_based_page_size_log; 3598 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_MASK 0x1fUL 3599 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_SFT 0 3600 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_4K 0x0UL 3601 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_8K 0x1UL 3602 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_16K 0x2UL 3603 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_32K 0x3UL 3604 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_64K 0x4UL 3605 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_128K 0x5UL 3606 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_256K 0x6UL 3607 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_512K 0x7UL 3608 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_1M 0x8UL 3609 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_2M 0x9UL 3610 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_4M 0xaUL 3611 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_8M 0xbUL 3612 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_16M 0xcUL 3613 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_32M 0xdUL 3614 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_64M 0xeUL 3615 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_128M 0xfUL 3616 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_256M 0x10UL 3617 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_512M 0x11UL 3618 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_1G 0x12UL 3619 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_2G 0x13UL 3620 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_4G 0x14UL 3621 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_8G 0x15UL 3622 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_16G 0x16UL 3623 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_32G 0x17UL 3624 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_64G 0x18UL 3625 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_128G 0x19UL 3626 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_256G 0x1aUL 3627 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_512G 0x1bUL 3628 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_1T 0x1cUL 3629 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_2T 0x1dUL 3630 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_4T 0x1eUL 3631 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_8T 0x1fUL 3632 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_LAST SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_8T 3633 #define SQ_FR_PMR_HDR_ZERO_BASED 0x20UL 3634 __le32 l_key; 3635 u8 length[5]; 3636 u8 reserved8_1; 3637 u8 reserved8_2; 3638 u8 numlevels_pbl_page_size_log; 3639 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_MASK 0x1fUL 3640 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_SFT 0 3641 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4K 0x0UL 3642 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8K 0x1UL 3643 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_16K 0x2UL 3644 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_32K 0x3UL 3645 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_64K 0x4UL 3646 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_128K 0x5UL 3647 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_256K 0x6UL 3648 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_512K 0x7UL 3649 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_1M 0x8UL 3650 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_2M 0x9UL 3651 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4M 0xaUL 3652 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8M 0xbUL 3653 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_16M 0xcUL 3654 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_32M 0xdUL 3655 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_64M 0xeUL 3656 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_128M 0xfUL 3657 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_256M 0x10UL 3658 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_512M 0x11UL 3659 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_1G 0x12UL 3660 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_2G 0x13UL 3661 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4G 0x14UL 3662 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8G 0x15UL 3663 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_16G 0x16UL 3664 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_32G 0x17UL 3665 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_64G 0x18UL 3666 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_128G 0x19UL 3667 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_256G 0x1aUL 3668 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_512G 0x1bUL 3669 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_1T 0x1cUL 3670 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_2T 0x1dUL 3671 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4T 0x1eUL 3672 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8T 0x1fUL 3673 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_LAST SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8T 3674 #define SQ_FR_PMR_HDR_NUMLEVELS_MASK 0xc0UL 3675 #define SQ_FR_PMR_HDR_NUMLEVELS_SFT 6 3676 #define SQ_FR_PMR_HDR_NUMLEVELS_PHYSICAL (0x0UL << 6) 3677 #define SQ_FR_PMR_HDR_NUMLEVELS_LAYER1 (0x1UL << 6) 3678 #define SQ_FR_PMR_HDR_NUMLEVELS_LAYER2 (0x2UL << 6) 3679 #define SQ_FR_PMR_HDR_NUMLEVELS_LAST SQ_FR_PMR_HDR_NUMLEVELS_LAYER2 3680 __le64 pblptr; 3681 __le64 va; 3682 }; 3683 3684 /* sq_bind (size:1024b/128B) */ 3685 struct sq_bind { 3686 u8 wqe_type; 3687 #define SQ_BIND_WQE_TYPE_BIND 0xeUL 3688 #define SQ_BIND_WQE_TYPE_LAST SQ_BIND_WQE_TYPE_BIND 3689 u8 flags; 3690 #define SQ_BIND_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK 0xffUL 3691 #define SQ_BIND_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT 0 3692 #define SQ_BIND_FLAGS_SIGNAL_COMP 0x1UL 3693 #define SQ_BIND_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL 3694 #define SQ_BIND_FLAGS_UC_FENCE 0x4UL 3695 #define SQ_BIND_FLAGS_SE 0x8UL 3696 #define SQ_BIND_FLAGS_INLINE 0x10UL 3697 #define SQ_BIND_FLAGS_WQE_TS_EN 0x20UL 3698 #define SQ_BIND_FLAGS_DEBUG_TRACE 0x40UL 3699 u8 access_cntl; 3700 #define \ 3701 SQ_BIND_ACCESS_CNTL_WINDOW_BIND_REMOTE_ATOMIC_REMOTE_WRITE_REMOTE_READ_LOCAL_WRITE_MASK\ 3702 0xffUL 3703 #define \ 3704 SQ_BIND_ACCESS_CNTL_WINDOW_BIND_REMOTE_ATOMIC_REMOTE_WRITE_REMOTE_READ_LOCAL_WRITE_SFT 0 3705 #define SQ_BIND_ACCESS_CNTL_LOCAL_WRITE 0x1UL 3706 #define SQ_BIND_ACCESS_CNTL_REMOTE_READ 0x2UL 3707 #define SQ_BIND_ACCESS_CNTL_REMOTE_WRITE 0x4UL 3708 #define SQ_BIND_ACCESS_CNTL_REMOTE_ATOMIC 0x8UL 3709 #define SQ_BIND_ACCESS_CNTL_WINDOW_BIND 0x10UL 3710 u8 reserved8_1; 3711 u8 mw_type_zero_based; 3712 #define SQ_BIND_ZERO_BASED 0x1UL 3713 #define SQ_BIND_MW_TYPE 0x2UL 3714 #define SQ_BIND_MW_TYPE_TYPE1 (0x0UL << 1) 3715 #define SQ_BIND_MW_TYPE_TYPE2 (0x1UL << 1) 3716 #define SQ_BIND_MW_TYPE_LAST SQ_BIND_MW_TYPE_TYPE2 3717 u8 reserved8_2; 3718 __le16 reserved16; 3719 __le32 parent_l_key; 3720 __le32 l_key; 3721 __le64 va; 3722 u8 length[5]; 3723 u8 reserved24[3]; 3724 __le32 data[24]; 3725 }; 3726 3727 /* sq_bind_hdr (size:256b/32B) */ 3728 struct sq_bind_hdr { 3729 u8 wqe_type; 3730 #define SQ_BIND_HDR_WQE_TYPE_BIND 0xeUL 3731 #define SQ_BIND_HDR_WQE_TYPE_LAST SQ_BIND_HDR_WQE_TYPE_BIND 3732 u8 flags; 3733 #define SQ_BIND_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK 0xffUL 3734 #define SQ_BIND_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT 0 3735 #define SQ_BIND_HDR_FLAGS_SIGNAL_COMP 0x1UL 3736 #define SQ_BIND_HDR_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL 3737 #define SQ_BIND_HDR_FLAGS_UC_FENCE 0x4UL 3738 #define SQ_BIND_HDR_FLAGS_SE 0x8UL 3739 #define SQ_BIND_HDR_FLAGS_INLINE 0x10UL 3740 #define SQ_BIND_HDR_FLAGS_WQE_TS_EN 0x20UL 3741 #define SQ_BIND_HDR_FLAGS_DEBUG_TRACE 0x40UL 3742 u8 access_cntl; 3743 #define \ 3744 SQ_BIND_HDR_ACCESS_CNTL_WINDOW_BIND_REMOTE_ATOMIC_REMOTE_WRITE_REMOTE_READ_LOCAL_WRITE_MASK\ 3745 0xffUL 3746 #define \ 3747 SQ_BIND_HDR_ACCESS_CNTL_WINDOW_BIND_REMOTE_ATOMIC_REMOTE_WRITE_REMOTE_READ_LOCAL_WRITE_SFT \ 3748 0 3749 #define SQ_BIND_HDR_ACCESS_CNTL_LOCAL_WRITE 0x1UL 3750 #define SQ_BIND_HDR_ACCESS_CNTL_REMOTE_READ 0x2UL 3751 #define SQ_BIND_HDR_ACCESS_CNTL_REMOTE_WRITE 0x4UL 3752 #define SQ_BIND_HDR_ACCESS_CNTL_REMOTE_ATOMIC 0x8UL 3753 #define SQ_BIND_HDR_ACCESS_CNTL_WINDOW_BIND 0x10UL 3754 u8 reserved8_1; 3755 u8 mw_type_zero_based; 3756 #define SQ_BIND_HDR_ZERO_BASED 0x1UL 3757 #define SQ_BIND_HDR_MW_TYPE 0x2UL 3758 #define SQ_BIND_HDR_MW_TYPE_TYPE1 (0x0UL << 1) 3759 #define SQ_BIND_HDR_MW_TYPE_TYPE2 (0x1UL << 1) 3760 #define SQ_BIND_HDR_MW_TYPE_LAST SQ_BIND_HDR_MW_TYPE_TYPE2 3761 u8 reserved8_2; 3762 __le16 reserved16; 3763 __le32 parent_l_key; 3764 __le32 l_key; 3765 __le64 va; 3766 u8 length[5]; 3767 u8 reserved24[3]; 3768 }; 3769 3770 /* rq_wqe (size:1024b/128B) */ 3771 struct rq_wqe { 3772 u8 wqe_type; 3773 #define RQ_WQE_WQE_TYPE_RCV 0x80UL 3774 #define RQ_WQE_WQE_TYPE_LAST RQ_WQE_WQE_TYPE_RCV 3775 u8 flags; 3776 u8 wqe_size; 3777 u8 reserved8; 3778 __le32 reserved32; 3779 __le32 wr_id[2]; 3780 #define RQ_WQE_WR_ID_MASK 0xfffffUL 3781 #define RQ_WQE_WR_ID_SFT 0 3782 u8 reserved128[16]; 3783 __le32 data[24]; 3784 }; 3785 3786 /* rq_wqe_hdr (size:256b/32B) */ 3787 struct rq_wqe_hdr { 3788 u8 wqe_type; 3789 #define RQ_WQE_HDR_WQE_TYPE_RCV 0x80UL 3790 #define RQ_WQE_HDR_WQE_TYPE_LAST RQ_WQE_HDR_WQE_TYPE_RCV 3791 u8 flags; 3792 u8 wqe_size; 3793 u8 reserved8; 3794 __le32 reserved32; 3795 __le32 wr_id[2]; 3796 #define RQ_WQE_HDR_WR_ID_MASK 0xfffffUL 3797 #define RQ_WQE_HDR_WR_ID_SFT 0 3798 u8 reserved128[16]; 3799 }; 3800 3801 /* cq_base (size:256b/32B) */ 3802 struct cq_base { 3803 __le64 reserved64_1; 3804 __le64 reserved64_2; 3805 __le64 reserved64_3; 3806 u8 cqe_type_toggle; 3807 #define CQ_BASE_TOGGLE 0x1UL 3808 #define CQ_BASE_CQE_TYPE_MASK 0x1eUL 3809 #define CQ_BASE_CQE_TYPE_SFT 1 3810 #define CQ_BASE_CQE_TYPE_REQ (0x0UL << 1) 3811 #define CQ_BASE_CQE_TYPE_RES_RC (0x1UL << 1) 3812 #define CQ_BASE_CQE_TYPE_RES_UD (0x2UL << 1) 3813 #define CQ_BASE_CQE_TYPE_RES_RAWETH_QP1 (0x3UL << 1) 3814 #define CQ_BASE_CQE_TYPE_RES_UD_CFA (0x4UL << 1) 3815 #define CQ_BASE_CQE_TYPE_REQ_V3 (0x8UL << 1) 3816 #define CQ_BASE_CQE_TYPE_RES_RC_V3 (0x9UL << 1) 3817 #define CQ_BASE_CQE_TYPE_RES_UD_V3 (0xaUL << 1) 3818 #define CQ_BASE_CQE_TYPE_RES_RAWETH_QP1_V3 (0xbUL << 1) 3819 #define CQ_BASE_CQE_TYPE_RES_UD_CFA_V3 (0xcUL << 1) 3820 #define CQ_BASE_CQE_TYPE_NO_OP (0xdUL << 1) 3821 #define CQ_BASE_CQE_TYPE_TERMINAL (0xeUL << 1) 3822 #define CQ_BASE_CQE_TYPE_CUT_OFF (0xfUL << 1) 3823 #define CQ_BASE_CQE_TYPE_LAST CQ_BASE_CQE_TYPE_CUT_OFF 3824 u8 status; 3825 #define CQ_BASE_STATUS_OK 0x0UL 3826 #define CQ_BASE_STATUS_BAD_RESPONSE_ERR 0x1UL 3827 #define CQ_BASE_STATUS_LOCAL_LENGTH_ERR 0x2UL 3828 #define CQ_BASE_STATUS_HW_LOCAL_LENGTH_ERR 0x3UL 3829 #define CQ_BASE_STATUS_LOCAL_QP_OPERATION_ERR 0x4UL 3830 #define CQ_BASE_STATUS_LOCAL_PROTECTION_ERR 0x5UL 3831 #define CQ_BASE_STATUS_LOCAL_ACCESS_ERROR 0x6UL 3832 #define CQ_BASE_STATUS_MEMORY_MGT_OPERATION_ERR 0x7UL 3833 #define CQ_BASE_STATUS_REMOTE_INVALID_REQUEST_ERR 0x8UL 3834 #define CQ_BASE_STATUS_REMOTE_ACCESS_ERR 0x9UL 3835 #define CQ_BASE_STATUS_REMOTE_OPERATION_ERR 0xaUL 3836 #define CQ_BASE_STATUS_RNR_NAK_RETRY_CNT_ERR 0xbUL 3837 #define CQ_BASE_STATUS_TRANSPORT_RETRY_CNT_ERR 0xcUL 3838 #define CQ_BASE_STATUS_WORK_REQUEST_FLUSHED_ERR 0xdUL 3839 #define CQ_BASE_STATUS_HW_FLUSH_ERR 0xeUL 3840 #define CQ_BASE_STATUS_OVERFLOW_ERR 0xfUL 3841 #define CQ_BASE_STATUS_LAST CQ_BASE_STATUS_OVERFLOW_ERR 3842 __le16 reserved16; 3843 __le32 opaque; 3844 }; 3845 3846 /* cq_req (size:256b/32B) */ 3847 struct cq_req { 3848 __le64 qp_handle; 3849 __le16 sq_cons_idx; 3850 __le16 reserved16_1; 3851 __le32 reserved32_2; 3852 __le64 reserved64; 3853 u8 cqe_type_toggle; 3854 #define CQ_REQ_TOGGLE 0x1UL 3855 #define CQ_REQ_CQE_TYPE_MASK 0x1eUL 3856 #define CQ_REQ_CQE_TYPE_SFT 1 3857 #define CQ_REQ_CQE_TYPE_REQ (0x0UL << 1) 3858 #define CQ_REQ_CQE_TYPE_LAST CQ_REQ_CQE_TYPE_REQ 3859 #define CQ_REQ_PUSH 0x20UL 3860 u8 status; 3861 #define CQ_REQ_STATUS_OK 0x0UL 3862 #define CQ_REQ_STATUS_BAD_RESPONSE_ERR 0x1UL 3863 #define CQ_REQ_STATUS_LOCAL_LENGTH_ERR 0x2UL 3864 #define CQ_REQ_STATUS_LOCAL_QP_OPERATION_ERR 0x3UL 3865 #define CQ_REQ_STATUS_LOCAL_PROTECTION_ERR 0x4UL 3866 #define CQ_REQ_STATUS_MEMORY_MGT_OPERATION_ERR 0x5UL 3867 #define CQ_REQ_STATUS_REMOTE_INVALID_REQUEST_ERR 0x6UL 3868 #define CQ_REQ_STATUS_REMOTE_ACCESS_ERR 0x7UL 3869 #define CQ_REQ_STATUS_REMOTE_OPERATION_ERR 0x8UL 3870 #define CQ_REQ_STATUS_RNR_NAK_RETRY_CNT_ERR 0x9UL 3871 #define CQ_REQ_STATUS_TRANSPORT_RETRY_CNT_ERR 0xaUL 3872 #define CQ_REQ_STATUS_WORK_REQUEST_FLUSHED_ERR 0xbUL 3873 #define CQ_REQ_STATUS_LAST CQ_REQ_STATUS_WORK_REQUEST_FLUSHED_ERR 3874 __le16 reserved16_2; 3875 __le32 reserved32_1; 3876 }; 3877 3878 /* cq_res_rc (size:256b/32B) */ 3879 struct cq_res_rc { 3880 __le32 length; 3881 __le32 imm_data_or_inv_r_key; 3882 __le64 qp_handle; 3883 __le64 mr_handle; 3884 u8 cqe_type_toggle; 3885 #define CQ_RES_RC_TOGGLE 0x1UL 3886 #define CQ_RES_RC_CQE_TYPE_MASK 0x1eUL 3887 #define CQ_RES_RC_CQE_TYPE_SFT 1 3888 #define CQ_RES_RC_CQE_TYPE_RES_RC (0x1UL << 1) 3889 #define CQ_RES_RC_CQE_TYPE_LAST CQ_RES_RC_CQE_TYPE_RES_RC 3890 u8 status; 3891 #define CQ_RES_RC_STATUS_OK 0x0UL 3892 #define CQ_RES_RC_STATUS_LOCAL_ACCESS_ERROR 0x1UL 3893 #define CQ_RES_RC_STATUS_LOCAL_LENGTH_ERR 0x2UL 3894 #define CQ_RES_RC_STATUS_LOCAL_PROTECTION_ERR 0x3UL 3895 #define CQ_RES_RC_STATUS_LOCAL_QP_OPERATION_ERR 0x4UL 3896 #define CQ_RES_RC_STATUS_MEMORY_MGT_OPERATION_ERR 0x5UL 3897 #define CQ_RES_RC_STATUS_REMOTE_INVALID_REQUEST_ERR 0x6UL 3898 #define CQ_RES_RC_STATUS_WORK_REQUEST_FLUSHED_ERR 0x7UL 3899 #define CQ_RES_RC_STATUS_HW_FLUSH_ERR 0x8UL 3900 #define CQ_RES_RC_STATUS_LAST CQ_RES_RC_STATUS_HW_FLUSH_ERR 3901 __le16 flags; 3902 #define CQ_RES_RC_FLAGS_SRQ 0x1UL 3903 #define CQ_RES_RC_FLAGS_SRQ_RQ 0x0UL 3904 #define CQ_RES_RC_FLAGS_SRQ_SRQ 0x1UL 3905 #define CQ_RES_RC_FLAGS_SRQ_LAST CQ_RES_RC_FLAGS_SRQ_SRQ 3906 #define CQ_RES_RC_FLAGS_IMM 0x2UL 3907 #define CQ_RES_RC_FLAGS_INV 0x4UL 3908 #define CQ_RES_RC_FLAGS_RDMA 0x8UL 3909 #define CQ_RES_RC_FLAGS_RDMA_SEND (0x0UL << 3) 3910 #define CQ_RES_RC_FLAGS_RDMA_RDMA_WRITE (0x1UL << 3) 3911 #define CQ_RES_RC_FLAGS_RDMA_LAST CQ_RES_RC_FLAGS_RDMA_RDMA_WRITE 3912 __le32 srq_or_rq_wr_id; 3913 #define CQ_RES_RC_SRQ_OR_RQ_WR_ID_MASK 0xfffffUL 3914 #define CQ_RES_RC_SRQ_OR_RQ_WR_ID_SFT 0 3915 }; 3916 3917 /* cq_res_ud (size:256b/32B) */ 3918 struct cq_res_ud { 3919 __le16 length; 3920 #define CQ_RES_UD_LENGTH_MASK 0x3fffUL 3921 #define CQ_RES_UD_LENGTH_SFT 0 3922 __le16 cfa_metadata; 3923 #define CQ_RES_UD_CFA_METADATA_VID_MASK 0xfffUL 3924 #define CQ_RES_UD_CFA_METADATA_VID_SFT 0 3925 #define CQ_RES_UD_CFA_METADATA_DE 0x1000UL 3926 #define CQ_RES_UD_CFA_METADATA_PRI_MASK 0xe000UL 3927 #define CQ_RES_UD_CFA_METADATA_PRI_SFT 13 3928 __le32 imm_data; 3929 __le64 qp_handle; 3930 __le16 src_mac[3]; 3931 __le16 src_qp_low; 3932 u8 cqe_type_toggle; 3933 #define CQ_RES_UD_TOGGLE 0x1UL 3934 #define CQ_RES_UD_CQE_TYPE_MASK 0x1eUL 3935 #define CQ_RES_UD_CQE_TYPE_SFT 1 3936 #define CQ_RES_UD_CQE_TYPE_RES_UD (0x2UL << 1) 3937 #define CQ_RES_UD_CQE_TYPE_LAST CQ_RES_UD_CQE_TYPE_RES_UD 3938 u8 status; 3939 #define CQ_RES_UD_STATUS_OK 0x0UL 3940 #define CQ_RES_UD_STATUS_LOCAL_ACCESS_ERROR 0x1UL 3941 #define CQ_RES_UD_STATUS_HW_LOCAL_LENGTH_ERR 0x2UL 3942 #define CQ_RES_UD_STATUS_LOCAL_PROTECTION_ERR 0x3UL 3943 #define CQ_RES_UD_STATUS_LOCAL_QP_OPERATION_ERR 0x4UL 3944 #define CQ_RES_UD_STATUS_MEMORY_MGT_OPERATION_ERR 0x5UL 3945 #define CQ_RES_UD_STATUS_WORK_REQUEST_FLUSHED_ERR 0x7UL 3946 #define CQ_RES_UD_STATUS_HW_FLUSH_ERR 0x8UL 3947 #define CQ_RES_UD_STATUS_LAST CQ_RES_UD_STATUS_HW_FLUSH_ERR 3948 __le16 flags; 3949 #define CQ_RES_UD_FLAGS_SRQ 0x1UL 3950 #define CQ_RES_UD_FLAGS_SRQ_RQ 0x0UL 3951 #define CQ_RES_UD_FLAGS_SRQ_SRQ 0x1UL 3952 #define CQ_RES_UD_FLAGS_SRQ_LAST CQ_RES_UD_FLAGS_SRQ_SRQ 3953 #define CQ_RES_UD_FLAGS_IMM 0x2UL 3954 #define CQ_RES_UD_FLAGS_UNUSED_MASK 0xcUL 3955 #define CQ_RES_UD_FLAGS_UNUSED_SFT 2 3956 #define CQ_RES_UD_FLAGS_ROCE_IP_VER_MASK 0x30UL 3957 #define CQ_RES_UD_FLAGS_ROCE_IP_VER_SFT 4 3958 #define CQ_RES_UD_FLAGS_ROCE_IP_VER_V1 (0x0UL << 4) 3959 #define CQ_RES_UD_FLAGS_ROCE_IP_VER_V2IPV4 (0x2UL << 4) 3960 #define CQ_RES_UD_FLAGS_ROCE_IP_VER_V2IPV6 (0x3UL << 4) 3961 #define CQ_RES_UD_FLAGS_ROCE_IP_VER_LAST CQ_RES_UD_FLAGS_ROCE_IP_VER_V2IPV6 3962 #define CQ_RES_UD_FLAGS_META_FORMAT_MASK 0x3c0UL 3963 #define CQ_RES_UD_FLAGS_META_FORMAT_SFT 6 3964 #define CQ_RES_UD_FLAGS_META_FORMAT_NONE (0x0UL << 6) 3965 #define CQ_RES_UD_FLAGS_META_FORMAT_VLAN (0x1UL << 6) 3966 #define CQ_RES_UD_FLAGS_META_FORMAT_TUNNEL_ID (0x2UL << 6) 3967 #define CQ_RES_UD_FLAGS_META_FORMAT_CHDR_DATA (0x3UL << 6) 3968 #define CQ_RES_UD_FLAGS_META_FORMAT_HDR_OFFSET (0x4UL << 6) 3969 #define CQ_RES_UD_FLAGS_META_FORMAT_LAST CQ_RES_UD_FLAGS_META_FORMAT_HDR_OFFSET 3970 #define CQ_RES_UD_FLAGS_EXT_META_FORMAT_MASK 0xc00UL 3971 #define CQ_RES_UD_FLAGS_EXT_META_FORMAT_SFT 10 3972 __le32 src_qp_high_srq_or_rq_wr_id; 3973 #define CQ_RES_UD_SRQ_OR_RQ_WR_ID_MASK 0xfffffUL 3974 #define CQ_RES_UD_SRQ_OR_RQ_WR_ID_SFT 0 3975 #define CQ_RES_UD_SRC_QP_HIGH_MASK 0xff000000UL 3976 #define CQ_RES_UD_SRC_QP_HIGH_SFT 24 3977 }; 3978 3979 /* cq_res_ud_v2 (size:256b/32B) */ 3980 struct cq_res_ud_v2 { 3981 __le16 length; 3982 #define CQ_RES_UD_V2_LENGTH_MASK 0x3fffUL 3983 #define CQ_RES_UD_V2_LENGTH_SFT 0 3984 __le16 cfa_metadata0; 3985 #define CQ_RES_UD_V2_CFA_METADATA0_VID_MASK 0xfffUL 3986 #define CQ_RES_UD_V2_CFA_METADATA0_VID_SFT 0 3987 #define CQ_RES_UD_V2_CFA_METADATA0_DE 0x1000UL 3988 #define CQ_RES_UD_V2_CFA_METADATA0_PRI_MASK 0xe000UL 3989 #define CQ_RES_UD_V2_CFA_METADATA0_PRI_SFT 13 3990 __le32 imm_data; 3991 __le64 qp_handle; 3992 __le16 src_mac[3]; 3993 __le16 src_qp_low; 3994 u8 cqe_type_toggle; 3995 #define CQ_RES_UD_V2_TOGGLE 0x1UL 3996 #define CQ_RES_UD_V2_CQE_TYPE_MASK 0x1eUL 3997 #define CQ_RES_UD_V2_CQE_TYPE_SFT 1 3998 #define CQ_RES_UD_V2_CQE_TYPE_RES_UD (0x2UL << 1) 3999 #define CQ_RES_UD_V2_CQE_TYPE_LAST CQ_RES_UD_V2_CQE_TYPE_RES_UD 4000 u8 status; 4001 #define CQ_RES_UD_V2_STATUS_OK 0x0UL 4002 #define CQ_RES_UD_V2_STATUS_LOCAL_ACCESS_ERROR 0x1UL 4003 #define CQ_RES_UD_V2_STATUS_HW_LOCAL_LENGTH_ERR 0x2UL 4004 #define CQ_RES_UD_V2_STATUS_LOCAL_PROTECTION_ERR 0x3UL 4005 #define CQ_RES_UD_V2_STATUS_LOCAL_QP_OPERATION_ERR 0x4UL 4006 #define CQ_RES_UD_V2_STATUS_MEMORY_MGT_OPERATION_ERR 0x5UL 4007 #define CQ_RES_UD_V2_STATUS_WORK_REQUEST_FLUSHED_ERR 0x7UL 4008 #define CQ_RES_UD_V2_STATUS_HW_FLUSH_ERR 0x8UL 4009 #define CQ_RES_UD_V2_STATUS_LAST CQ_RES_UD_V2_STATUS_HW_FLUSH_ERR 4010 __le16 flags; 4011 #define CQ_RES_UD_V2_FLAGS_SRQ 0x1UL 4012 #define CQ_RES_UD_V2_FLAGS_SRQ_RQ 0x0UL 4013 #define CQ_RES_UD_V2_FLAGS_SRQ_SRQ 0x1UL 4014 #define CQ_RES_UD_V2_FLAGS_SRQ_LAST CQ_RES_UD_V2_FLAGS_SRQ_SRQ 4015 #define CQ_RES_UD_V2_FLAGS_IMM 0x2UL 4016 #define CQ_RES_UD_V2_FLAGS_UNUSED_MASK 0xcUL 4017 #define CQ_RES_UD_V2_FLAGS_UNUSED_SFT 2 4018 #define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_MASK 0x30UL 4019 #define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_SFT 4 4020 #define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_V1 (0x0UL << 4) 4021 #define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_V2IPV4 (0x2UL << 4) 4022 #define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_V2IPV6 (0x3UL << 4) 4023 #define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_LAST CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_V2IPV6 4024 #define CQ_RES_UD_V2_FLAGS_META_FORMAT_MASK 0x3c0UL 4025 #define CQ_RES_UD_V2_FLAGS_META_FORMAT_SFT 6 4026 #define CQ_RES_UD_V2_FLAGS_META_FORMAT_NONE (0x0UL << 6) 4027 #define CQ_RES_UD_V2_FLAGS_META_FORMAT_ACT_REC_PTR (0x1UL << 6) 4028 #define CQ_RES_UD_V2_FLAGS_META_FORMAT_TUNNEL_ID (0x2UL << 6) 4029 #define CQ_RES_UD_V2_FLAGS_META_FORMAT_CHDR_DATA (0x3UL << 6) 4030 #define CQ_RES_UD_V2_FLAGS_META_FORMAT_HDR_OFFSET (0x4UL << 6) 4031 #define CQ_RES_UD_V2_FLAGS_META_FORMAT_LAST CQ_RES_UD_V2_FLAGS_META_FORMAT_HDR_OFFSET 4032 __le32 src_qp_high_srq_or_rq_wr_id; 4033 #define CQ_RES_UD_V2_SRQ_OR_RQ_WR_ID_MASK 0xfffffUL 4034 #define CQ_RES_UD_V2_SRQ_OR_RQ_WR_ID_SFT 0 4035 #define CQ_RES_UD_V2_CFA_METADATA1_MASK 0xf00000UL 4036 #define CQ_RES_UD_V2_CFA_METADATA1_SFT 20 4037 #define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_MASK 0x700000UL 4038 #define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_SFT 20 4039 #define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPID88A8 (0x0UL << 20) 4040 #define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPID8100 (0x1UL << 20) 4041 #define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPID9100 (0x2UL << 20) 4042 #define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPID9200 (0x3UL << 20) 4043 #define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPID9300 (0x4UL << 20) 4044 #define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPIDCFG (0x5UL << 20) 4045 #define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_LAST CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPIDCFG 4046 #define CQ_RES_UD_V2_CFA_METADATA1_VALID 0x800000UL 4047 #define CQ_RES_UD_V2_SRC_QP_HIGH_MASK 0xff000000UL 4048 #define CQ_RES_UD_V2_SRC_QP_HIGH_SFT 24 4049 }; 4050 4051 /* cq_res_ud_cfa (size:256b/32B) */ 4052 struct cq_res_ud_cfa { 4053 __le16 length; 4054 #define CQ_RES_UD_CFA_LENGTH_MASK 0x3fffUL 4055 #define CQ_RES_UD_CFA_LENGTH_SFT 0 4056 __le16 cfa_code; 4057 __le32 imm_data; 4058 __le32 qid; 4059 #define CQ_RES_UD_CFA_QID_MASK 0xfffffUL 4060 #define CQ_RES_UD_CFA_QID_SFT 0 4061 __le32 cfa_metadata; 4062 #define CQ_RES_UD_CFA_CFA_METADATA_VID_MASK 0xfffUL 4063 #define CQ_RES_UD_CFA_CFA_METADATA_VID_SFT 0 4064 #define CQ_RES_UD_CFA_CFA_METADATA_DE 0x1000UL 4065 #define CQ_RES_UD_CFA_CFA_METADATA_PRI_MASK 0xe000UL 4066 #define CQ_RES_UD_CFA_CFA_METADATA_PRI_SFT 13 4067 #define CQ_RES_UD_CFA_CFA_METADATA_TPID_MASK 0xffff0000UL 4068 #define CQ_RES_UD_CFA_CFA_METADATA_TPID_SFT 16 4069 __le16 src_mac[3]; 4070 __le16 src_qp_low; 4071 u8 cqe_type_toggle; 4072 #define CQ_RES_UD_CFA_TOGGLE 0x1UL 4073 #define CQ_RES_UD_CFA_CQE_TYPE_MASK 0x1eUL 4074 #define CQ_RES_UD_CFA_CQE_TYPE_SFT 1 4075 #define CQ_RES_UD_CFA_CQE_TYPE_RES_UD_CFA (0x4UL << 1) 4076 #define CQ_RES_UD_CFA_CQE_TYPE_LAST CQ_RES_UD_CFA_CQE_TYPE_RES_UD_CFA 4077 u8 status; 4078 #define CQ_RES_UD_CFA_STATUS_OK 0x0UL 4079 #define CQ_RES_UD_CFA_STATUS_LOCAL_ACCESS_ERROR 0x1UL 4080 #define CQ_RES_UD_CFA_STATUS_HW_LOCAL_LENGTH_ERR 0x2UL 4081 #define CQ_RES_UD_CFA_STATUS_LOCAL_PROTECTION_ERR 0x3UL 4082 #define CQ_RES_UD_CFA_STATUS_LOCAL_QP_OPERATION_ERR 0x4UL 4083 #define CQ_RES_UD_CFA_STATUS_MEMORY_MGT_OPERATION_ERR 0x5UL 4084 #define CQ_RES_UD_CFA_STATUS_WORK_REQUEST_FLUSHED_ERR 0x7UL 4085 #define CQ_RES_UD_CFA_STATUS_HW_FLUSH_ERR 0x8UL 4086 #define CQ_RES_UD_CFA_STATUS_LAST CQ_RES_UD_CFA_STATUS_HW_FLUSH_ERR 4087 __le16 flags; 4088 #define CQ_RES_UD_CFA_FLAGS_SRQ 0x1UL 4089 #define CQ_RES_UD_CFA_FLAGS_SRQ_RQ 0x0UL 4090 #define CQ_RES_UD_CFA_FLAGS_SRQ_SRQ 0x1UL 4091 #define CQ_RES_UD_CFA_FLAGS_SRQ_LAST CQ_RES_UD_CFA_FLAGS_SRQ_SRQ 4092 #define CQ_RES_UD_CFA_FLAGS_IMM 0x2UL 4093 #define CQ_RES_UD_CFA_FLAGS_UNUSED_MASK 0xcUL 4094 #define CQ_RES_UD_CFA_FLAGS_UNUSED_SFT 2 4095 #define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_MASK 0x30UL 4096 #define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_SFT 4 4097 #define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_V1 (0x0UL << 4) 4098 #define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_V2IPV4 (0x2UL << 4) 4099 #define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_V2IPV6 (0x3UL << 4) 4100 #define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_LAST CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_V2IPV6 4101 #define CQ_RES_UD_CFA_FLAGS_META_FORMAT_MASK 0x3c0UL 4102 #define CQ_RES_UD_CFA_FLAGS_META_FORMAT_SFT 6 4103 #define CQ_RES_UD_CFA_FLAGS_META_FORMAT_NONE (0x0UL << 6) 4104 #define CQ_RES_UD_CFA_FLAGS_META_FORMAT_VLAN (0x1UL << 6) 4105 #define CQ_RES_UD_CFA_FLAGS_META_FORMAT_TUNNEL_ID (0x2UL << 6) 4106 #define CQ_RES_UD_CFA_FLAGS_META_FORMAT_CHDR_DATA (0x3UL << 6) 4107 #define CQ_RES_UD_CFA_FLAGS_META_FORMAT_HDR_OFFSET (0x4UL << 6) 4108 #define CQ_RES_UD_CFA_FLAGS_META_FORMAT_LAST CQ_RES_UD_CFA_FLAGS_META_FORMAT_HDR_OFFSET 4109 #define CQ_RES_UD_CFA_FLAGS_EXT_META_FORMAT_MASK 0xc00UL 4110 #define CQ_RES_UD_CFA_FLAGS_EXT_META_FORMAT_SFT 10 4111 __le32 src_qp_high_srq_or_rq_wr_id; 4112 #define CQ_RES_UD_CFA_SRQ_OR_RQ_WR_ID_MASK 0xfffffUL 4113 #define CQ_RES_UD_CFA_SRQ_OR_RQ_WR_ID_SFT 0 4114 #define CQ_RES_UD_CFA_SRC_QP_HIGH_MASK 0xff000000UL 4115 #define CQ_RES_UD_CFA_SRC_QP_HIGH_SFT 24 4116 }; 4117 4118 /* cq_res_ud_cfa_v2 (size:256b/32B) */ 4119 struct cq_res_ud_cfa_v2 { 4120 __le16 length; 4121 #define CQ_RES_UD_CFA_V2_LENGTH_MASK 0x3fffUL 4122 #define CQ_RES_UD_CFA_V2_LENGTH_SFT 0 4123 __le16 cfa_metadata0; 4124 #define CQ_RES_UD_CFA_V2_CFA_METADATA0_VID_MASK 0xfffUL 4125 #define CQ_RES_UD_CFA_V2_CFA_METADATA0_VID_SFT 0 4126 #define CQ_RES_UD_CFA_V2_CFA_METADATA0_DE 0x1000UL 4127 #define CQ_RES_UD_CFA_V2_CFA_METADATA0_PRI_MASK 0xe000UL 4128 #define CQ_RES_UD_CFA_V2_CFA_METADATA0_PRI_SFT 13 4129 __le32 imm_data; 4130 __le32 qid; 4131 #define CQ_RES_UD_CFA_V2_QID_MASK 0xfffffUL 4132 #define CQ_RES_UD_CFA_V2_QID_SFT 0 4133 __le32 cfa_metadata2; 4134 __le16 src_mac[3]; 4135 __le16 src_qp_low; 4136 u8 cqe_type_toggle; 4137 #define CQ_RES_UD_CFA_V2_TOGGLE 0x1UL 4138 #define CQ_RES_UD_CFA_V2_CQE_TYPE_MASK 0x1eUL 4139 #define CQ_RES_UD_CFA_V2_CQE_TYPE_SFT 1 4140 #define CQ_RES_UD_CFA_V2_CQE_TYPE_RES_UD_CFA (0x4UL << 1) 4141 #define CQ_RES_UD_CFA_V2_CQE_TYPE_LAST CQ_RES_UD_CFA_V2_CQE_TYPE_RES_UD_CFA 4142 u8 status; 4143 #define CQ_RES_UD_CFA_V2_STATUS_OK 0x0UL 4144 #define CQ_RES_UD_CFA_V2_STATUS_LOCAL_ACCESS_ERROR 0x1UL 4145 #define CQ_RES_UD_CFA_V2_STATUS_HW_LOCAL_LENGTH_ERR 0x2UL 4146 #define CQ_RES_UD_CFA_V2_STATUS_LOCAL_PROTECTION_ERR 0x3UL 4147 #define CQ_RES_UD_CFA_V2_STATUS_LOCAL_QP_OPERATION_ERR 0x4UL 4148 #define CQ_RES_UD_CFA_V2_STATUS_MEMORY_MGT_OPERATION_ERR 0x5UL 4149 #define CQ_RES_UD_CFA_V2_STATUS_WORK_REQUEST_FLUSHED_ERR 0x7UL 4150 #define CQ_RES_UD_CFA_V2_STATUS_HW_FLUSH_ERR 0x8UL 4151 #define CQ_RES_UD_CFA_V2_STATUS_LAST CQ_RES_UD_CFA_V2_STATUS_HW_FLUSH_ERR 4152 __le16 flags; 4153 #define CQ_RES_UD_CFA_V2_FLAGS_SRQ 0x1UL 4154 #define CQ_RES_UD_CFA_V2_FLAGS_SRQ_RQ 0x0UL 4155 #define CQ_RES_UD_CFA_V2_FLAGS_SRQ_SRQ 0x1UL 4156 #define CQ_RES_UD_CFA_V2_FLAGS_SRQ_LAST CQ_RES_UD_CFA_V2_FLAGS_SRQ_SRQ 4157 #define CQ_RES_UD_CFA_V2_FLAGS_IMM 0x2UL 4158 #define CQ_RES_UD_CFA_V2_FLAGS_UNUSED_MASK 0xcUL 4159 #define CQ_RES_UD_CFA_V2_FLAGS_UNUSED_SFT 2 4160 #define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_MASK 0x30UL 4161 #define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_SFT 4 4162 #define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_V1 (0x0UL << 4) 4163 #define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_V2IPV4 (0x2UL << 4) 4164 #define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_V2IPV6 (0x3UL << 4) 4165 #define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_LAST CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_V2IPV6 4166 #define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_MASK 0x3c0UL 4167 #define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_SFT 6 4168 #define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_NONE (0x0UL << 6) 4169 #define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_ACT_REC_PTR (0x1UL << 6) 4170 #define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_TUNNEL_ID (0x2UL << 6) 4171 #define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_CHDR_DATA (0x3UL << 6) 4172 #define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_HDR_OFFSET (0x4UL << 6) 4173 #define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_LAST \ 4174 CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_HDR_OFFSET 4175 __le32 src_qp_high_srq_or_rq_wr_id; 4176 #define CQ_RES_UD_CFA_V2_SRQ_OR_RQ_WR_ID_MASK 0xfffffUL 4177 #define CQ_RES_UD_CFA_V2_SRQ_OR_RQ_WR_ID_SFT 0 4178 #define CQ_RES_UD_CFA_V2_CFA_METADATA1_MASK 0xf00000UL 4179 #define CQ_RES_UD_CFA_V2_CFA_METADATA1_SFT 20 4180 #define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_MASK 0x700000UL 4181 #define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_SFT 20 4182 #define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPID88A8 (0x0UL << 20) 4183 #define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPID8100 (0x1UL << 20) 4184 #define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPID9100 (0x2UL << 20) 4185 #define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPID9200 (0x3UL << 20) 4186 #define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPID9300 (0x4UL << 20) 4187 #define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPIDCFG (0x5UL << 20) 4188 #define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_LAST \ 4189 CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPIDCFG 4190 #define CQ_RES_UD_CFA_V2_CFA_METADATA1_VALID 0x800000UL 4191 #define CQ_RES_UD_CFA_V2_SRC_QP_HIGH_MASK 0xff000000UL 4192 #define CQ_RES_UD_CFA_V2_SRC_QP_HIGH_SFT 24 4193 }; 4194 4195 /* cq_res_raweth_qp1 (size:256b/32B) */ 4196 struct cq_res_raweth_qp1 { 4197 __le16 length; 4198 #define CQ_RES_RAWETH_QP1_LENGTH_MASK 0x3fffUL 4199 #define CQ_RES_RAWETH_QP1_LENGTH_SFT 0 4200 __le16 raweth_qp1_flags; 4201 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_MASK 0x3ffUL 4202 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_SFT 0 4203 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ERROR 0x1UL 4204 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_MASK 0x3c0UL 4205 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_SFT 6 4206 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_NOT_KNOWN (0x0UL << 6) 4207 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_IP (0x1UL << 6) 4208 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_TCP (0x2UL << 6) 4209 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_UDP (0x3UL << 6) 4210 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_FCOE (0x4UL << 6) 4211 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_ROCE (0x5UL << 6) 4212 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_ICMP (0x7UL << 6) 4213 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_PTP_WO_TIMESTAMP (0x8UL << 6) 4214 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP (0x9UL << 6) 4215 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_LAST \ 4216 CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP 4217 __le16 raweth_qp1_errors; 4218 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_IP_CS_ERROR 0x10UL 4219 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_L4_CS_ERROR 0x20UL 4220 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_IP_CS_ERROR 0x40UL 4221 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_L4_CS_ERROR 0x80UL 4222 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_CRC_ERROR 0x100UL 4223 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_MASK 0xe00UL 4224 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_SFT 9 4225 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_NO_ERROR (0x0UL << 9) 4226 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION (0x1UL << 9) 4227 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN (0x2UL << 9) 4228 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR (0x3UL << 9) 4229 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR (0x4UL << 9) 4230 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR (0x5UL << 9) 4231 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL (0x6UL << 9) 4232 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_LAST \ 4233 CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL 4234 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_MASK 0xf000UL 4235 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_SFT 12 4236 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_NO_ERROR (0x0UL << 12) 4237 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_VERSION (0x1UL << 12) 4238 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN (0x2UL << 12) 4239 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_TTL (0x3UL << 12) 4240 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_IP_TOTAL_ERROR (0x4UL << 12) 4241 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR (0x5UL << 12) 4242 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN (0x6UL << 12) 4243 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL (0x7UL << 12) 4244 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN (0x8UL << 12) 4245 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_LAST \ 4246 CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN 4247 __le16 raweth_qp1_cfa_code; 4248 __le64 qp_handle; 4249 __le32 raweth_qp1_flags2; 4250 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_IP_CS_CALC 0x1UL 4251 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_L4_CS_CALC 0x2UL 4252 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_T_IP_CS_CALC 0x4UL 4253 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_T_L4_CS_CALC 0x8UL 4254 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_MASK 0xf0UL 4255 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_SFT 4 4256 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_NONE (0x0UL << 4) 4257 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_VLAN (0x1UL << 4) 4258 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_TUNNEL_ID (0x2UL << 4) 4259 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_CHDR_DATA (0x3UL << 4) 4260 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_HDR_OFFSET (0x4UL << 4) 4261 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_LAST \ 4262 CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_HDR_OFFSET 4263 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_IP_TYPE 0x100UL 4264 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_CALC 0x200UL 4265 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_EXT_META_FORMAT_MASK 0xc00UL 4266 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_EXT_META_FORMAT_SFT 10 4267 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_MASK 0xffff0000UL 4268 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_SFT 16 4269 __le32 raweth_qp1_metadata; 4270 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_DE_VID_MASK 0xffffUL 4271 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_DE_VID_SFT 0 4272 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_VID_MASK 0xfffUL 4273 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_VID_SFT 0 4274 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_DE 0x1000UL 4275 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_MASK 0xe000UL 4276 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_SFT 13 4277 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_TPID_MASK 0xffff0000UL 4278 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_TPID_SFT 16 4279 u8 cqe_type_toggle; 4280 #define CQ_RES_RAWETH_QP1_TOGGLE 0x1UL 4281 #define CQ_RES_RAWETH_QP1_CQE_TYPE_MASK 0x1eUL 4282 #define CQ_RES_RAWETH_QP1_CQE_TYPE_SFT 1 4283 #define CQ_RES_RAWETH_QP1_CQE_TYPE_RES_RAWETH_QP1 (0x3UL << 1) 4284 #define CQ_RES_RAWETH_QP1_CQE_TYPE_LAST CQ_RES_RAWETH_QP1_CQE_TYPE_RES_RAWETH_QP1 4285 u8 status; 4286 #define CQ_RES_RAWETH_QP1_STATUS_OK 0x0UL 4287 #define CQ_RES_RAWETH_QP1_STATUS_LOCAL_ACCESS_ERROR 0x1UL 4288 #define CQ_RES_RAWETH_QP1_STATUS_HW_LOCAL_LENGTH_ERR 0x2UL 4289 #define CQ_RES_RAWETH_QP1_STATUS_LOCAL_PROTECTION_ERR 0x3UL 4290 #define CQ_RES_RAWETH_QP1_STATUS_LOCAL_QP_OPERATION_ERR 0x4UL 4291 #define CQ_RES_RAWETH_QP1_STATUS_MEMORY_MGT_OPERATION_ERR 0x5UL 4292 #define CQ_RES_RAWETH_QP1_STATUS_WORK_REQUEST_FLUSHED_ERR 0x7UL 4293 #define CQ_RES_RAWETH_QP1_STATUS_HW_FLUSH_ERR 0x8UL 4294 #define CQ_RES_RAWETH_QP1_STATUS_LAST CQ_RES_RAWETH_QP1_STATUS_HW_FLUSH_ERR 4295 __le16 flags; 4296 #define CQ_RES_RAWETH_QP1_FLAGS_SRQ 0x1UL 4297 #define CQ_RES_RAWETH_QP1_FLAGS_SRQ_RQ 0x0UL 4298 #define CQ_RES_RAWETH_QP1_FLAGS_SRQ_SRQ 0x1UL 4299 #define CQ_RES_RAWETH_QP1_FLAGS_SRQ_LAST CQ_RES_RAWETH_QP1_FLAGS_SRQ_SRQ 4300 __le32 raweth_qp1_payload_offset_srq_or_rq_wr_id; 4301 #define CQ_RES_RAWETH_QP1_SRQ_OR_RQ_WR_ID_MASK 0xfffffUL 4302 #define CQ_RES_RAWETH_QP1_SRQ_OR_RQ_WR_ID_SFT 0 4303 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_PAYLOAD_OFFSET_MASK 0xff000000UL 4304 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_PAYLOAD_OFFSET_SFT 24 4305 }; 4306 4307 /* cq_res_raweth_qp1_v2 (size:256b/32B) */ 4308 struct cq_res_raweth_qp1_v2 { 4309 __le16 length; 4310 #define CQ_RES_RAWETH_QP1_V2_LENGTH_MASK 0x3fffUL 4311 #define CQ_RES_RAWETH_QP1_V2_LENGTH_SFT 0 4312 __le16 raweth_qp1_flags; 4313 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_MASK 0x3ffUL 4314 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_SFT 0 4315 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ERROR 0x1UL 4316 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_MASK 0x3c0UL 4317 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_SFT 6 4318 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_NOT_KNOWN (0x0UL << 6) 4319 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_IP (0x1UL << 6) 4320 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_TCP (0x2UL << 6) 4321 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_UDP (0x3UL << 6) 4322 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_FCOE (0x4UL << 6) 4323 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_ROCE (0x5UL << 6) 4324 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_ICMP (0x7UL << 6) 4325 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_PTP_WO_TIMESTAMP (0x8UL << 6) 4326 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP (0x9UL << 6) 4327 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_LAST \ 4328 CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP 4329 __le16 raweth_qp1_errors; 4330 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_IP_CS_ERROR 0x10UL 4331 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_L4_CS_ERROR 0x20UL 4332 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_IP_CS_ERROR 0x40UL 4333 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_L4_CS_ERROR 0x80UL 4334 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_CRC_ERROR 0x100UL 4335 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_MASK 0xe00UL 4336 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_SFT 9 4337 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_NO_ERROR (0x0UL << 9) 4338 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION (0x1UL << 9) 4339 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN (0x2UL << 9) 4340 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR (0x3UL << 9) 4341 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR (0x4UL << 9) 4342 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR (0x5UL << 9) 4343 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL (0x6UL << 9) 4344 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_LAST \ 4345 CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL 4346 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_MASK 0xf000UL 4347 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_SFT 12 4348 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_NO_ERROR (0x0UL << 12) 4349 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_VERSION (0x1UL << 12) 4350 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN (0x2UL << 12) 4351 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_TTL (0x3UL << 12) 4352 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_IP_TOTAL_ERROR (0x4UL << 12) 4353 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR (0x5UL << 12) 4354 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN (0x6UL << 12) 4355 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL \ 4356 (0x7UL << 12) 4357 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN \ 4358 (0x8UL << 12) 4359 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_LAST \ 4360 CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN 4361 __le16 cfa_metadata0; 4362 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA0_VID_MASK 0xfffUL 4363 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA0_VID_SFT 0 4364 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA0_DE 0x1000UL 4365 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA0_PRI_MASK 0xe000UL 4366 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA0_PRI_SFT 13 4367 __le64 qp_handle; 4368 __le32 raweth_qp1_flags2; 4369 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_CS_ALL_OK_MODE 0x8UL 4370 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_MASK 0xf0UL 4371 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_SFT 4 4372 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_NONE (0x0UL << 4) 4373 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_ACT_REC_PTR (0x1UL << 4) 4374 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_TUNNEL_ID (0x2UL << 4) 4375 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_CHDR_DATA (0x3UL << 4) 4376 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_HDR_OFFSET (0x4UL << 4) 4377 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_LAST \ 4378 CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_HDR_OFFSET 4379 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_IP_TYPE 0x100UL 4380 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_CALC 0x200UL 4381 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_CS_OK_MASK 0xfc00UL 4382 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_CS_OK_SFT 10 4383 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_MASK 0xffff0000UL 4384 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_SFT 16 4385 __le32 cfa_metadata2; 4386 u8 cqe_type_toggle; 4387 #define CQ_RES_RAWETH_QP1_V2_TOGGLE 0x1UL 4388 #define CQ_RES_RAWETH_QP1_V2_CQE_TYPE_MASK 0x1eUL 4389 #define CQ_RES_RAWETH_QP1_V2_CQE_TYPE_SFT 1 4390 #define CQ_RES_RAWETH_QP1_V2_CQE_TYPE_RES_RAWETH_QP1 (0x3UL << 1) 4391 #define CQ_RES_RAWETH_QP1_V2_CQE_TYPE_LAST CQ_RES_RAWETH_QP1_V2_CQE_TYPE_RES_RAWETH_QP1 4392 u8 status; 4393 #define CQ_RES_RAWETH_QP1_V2_STATUS_OK 0x0UL 4394 #define CQ_RES_RAWETH_QP1_V2_STATUS_LOCAL_ACCESS_ERROR 0x1UL 4395 #define CQ_RES_RAWETH_QP1_V2_STATUS_HW_LOCAL_LENGTH_ERR 0x2UL 4396 #define CQ_RES_RAWETH_QP1_V2_STATUS_LOCAL_PROTECTION_ERR 0x3UL 4397 #define CQ_RES_RAWETH_QP1_V2_STATUS_LOCAL_QP_OPERATION_ERR 0x4UL 4398 #define CQ_RES_RAWETH_QP1_V2_STATUS_MEMORY_MGT_OPERATION_ERR 0x5UL 4399 #define CQ_RES_RAWETH_QP1_V2_STATUS_WORK_REQUEST_FLUSHED_ERR 0x7UL 4400 #define CQ_RES_RAWETH_QP1_V2_STATUS_HW_FLUSH_ERR 0x8UL 4401 #define CQ_RES_RAWETH_QP1_V2_STATUS_LAST CQ_RES_RAWETH_QP1_V2_STATUS_HW_FLUSH_ERR 4402 __le16 flags; 4403 #define CQ_RES_RAWETH_QP1_V2_FLAGS_SRQ 0x1UL 4404 #define CQ_RES_RAWETH_QP1_V2_FLAGS_SRQ_RQ 0x0UL 4405 #define CQ_RES_RAWETH_QP1_V2_FLAGS_SRQ_SRQ 0x1UL 4406 #define CQ_RES_RAWETH_QP1_V2_FLAGS_SRQ_LAST CQ_RES_RAWETH_QP1_V2_FLAGS_SRQ_SRQ 4407 __le32 raweth_qp1_payload_offset_srq_or_rq_wr_id; 4408 #define CQ_RES_RAWETH_QP1_V2_SRQ_OR_RQ_WR_ID_MASK 0xfffffUL 4409 #define CQ_RES_RAWETH_QP1_V2_SRQ_OR_RQ_WR_ID_SFT 0 4410 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_MASK 0xf00000UL 4411 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_SFT 20 4412 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_MASK 0x700000UL 4413 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_SFT 20 4414 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPID88A8 (0x0UL << 20) 4415 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPID8100 (0x1UL << 20) 4416 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPID9100 (0x2UL << 20) 4417 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPID9200 (0x3UL << 20) 4418 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPID9300 (0x4UL << 20) 4419 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPIDCFG (0x5UL << 20) 4420 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_LAST \ 4421 CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPIDCFG 4422 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_VALID 0x800000UL 4423 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_PAYLOAD_OFFSET_MASK 0xff000000UL 4424 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_PAYLOAD_OFFSET_SFT 24 4425 }; 4426 4427 /* cq_terminal (size:256b/32B) */ 4428 struct cq_terminal { 4429 __le64 qp_handle; 4430 __le16 sq_cons_idx; 4431 __le16 rq_cons_idx; 4432 __le32 reserved32_1; 4433 __le64 reserved64_3; 4434 u8 cqe_type_toggle; 4435 #define CQ_TERMINAL_TOGGLE 0x1UL 4436 #define CQ_TERMINAL_CQE_TYPE_MASK 0x1eUL 4437 #define CQ_TERMINAL_CQE_TYPE_SFT 1 4438 #define CQ_TERMINAL_CQE_TYPE_TERMINAL (0xeUL << 1) 4439 #define CQ_TERMINAL_CQE_TYPE_LAST CQ_TERMINAL_CQE_TYPE_TERMINAL 4440 u8 status; 4441 #define CQ_TERMINAL_STATUS_OK 0x0UL 4442 #define CQ_TERMINAL_STATUS_LAST CQ_TERMINAL_STATUS_OK 4443 __le16 reserved16; 4444 __le32 reserved32_2; 4445 }; 4446 4447 /* cq_cutoff (size:256b/32B) */ 4448 struct cq_cutoff { 4449 __le64 reserved64_1; 4450 __le64 reserved64_2; 4451 __le64 reserved64_3; 4452 u8 cqe_type_toggle; 4453 #define CQ_CUTOFF_TOGGLE 0x1UL 4454 #define CQ_CUTOFF_CQE_TYPE_MASK 0x1eUL 4455 #define CQ_CUTOFF_CQE_TYPE_SFT 1 4456 #define CQ_CUTOFF_CQE_TYPE_CUT_OFF (0xfUL << 1) 4457 #define CQ_CUTOFF_CQE_TYPE_LAST CQ_CUTOFF_CQE_TYPE_CUT_OFF 4458 #define CQ_CUTOFF_RESIZE_TOGGLE_MASK 0x60UL 4459 #define CQ_CUTOFF_RESIZE_TOGGLE_SFT 5 4460 u8 status; 4461 #define CQ_CUTOFF_STATUS_OK 0x0UL 4462 #define CQ_CUTOFF_STATUS_LAST CQ_CUTOFF_STATUS_OK 4463 __le16 reserved16; 4464 __le32 reserved32; 4465 }; 4466 4467 /* nq_base (size:128b/16B) */ 4468 struct nq_base { 4469 __le16 info10_type; 4470 #define NQ_BASE_TYPE_MASK 0x3fUL 4471 #define NQ_BASE_TYPE_SFT 0 4472 #define NQ_BASE_TYPE_CQ_NOTIFICATION 0x30UL 4473 #define NQ_BASE_TYPE_SRQ_EVENT 0x32UL 4474 #define NQ_BASE_TYPE_DBQ_EVENT 0x34UL 4475 #define NQ_BASE_TYPE_QP_EVENT 0x38UL 4476 #define NQ_BASE_TYPE_FUNC_EVENT 0x3aUL 4477 #define NQ_BASE_TYPE_LAST NQ_BASE_TYPE_FUNC_EVENT 4478 #define NQ_BASE_INFO10_MASK 0xffc0UL 4479 #define NQ_BASE_INFO10_SFT 6 4480 __le16 info16; 4481 __le32 info32; 4482 __le32 info63_v[2]; 4483 #define NQ_BASE_V 0x1UL 4484 #define NQ_BASE_INFO63_MASK 0xfffffffeUL 4485 #define NQ_BASE_INFO63_SFT 1 4486 }; 4487 4488 /* nq_cn (size:128b/16B) */ 4489 struct nq_cn { 4490 __le16 type; 4491 #define NQ_CN_TYPE_MASK 0x3fUL 4492 #define NQ_CN_TYPE_SFT 0 4493 #define NQ_CN_TYPE_CQ_NOTIFICATION 0x30UL 4494 #define NQ_CN_TYPE_LAST NQ_CN_TYPE_CQ_NOTIFICATION 4495 #define NQ_CN_TOGGLE_MASK 0xc0UL 4496 #define NQ_CN_TOGGLE_SFT 6 4497 __le16 reserved16; 4498 __le32 cq_handle_low; 4499 __le32 v; 4500 #define NQ_CN_V 0x1UL 4501 __le32 cq_handle_high; 4502 }; 4503 4504 /* nq_srq_event (size:128b/16B) */ 4505 struct nq_srq_event { 4506 u8 type; 4507 #define NQ_SRQ_EVENT_TYPE_MASK 0x3fUL 4508 #define NQ_SRQ_EVENT_TYPE_SFT 0 4509 #define NQ_SRQ_EVENT_TYPE_SRQ_EVENT 0x32UL 4510 #define NQ_SRQ_EVENT_TYPE_LAST NQ_SRQ_EVENT_TYPE_SRQ_EVENT 4511 #define NQ_SRQ_EVENT_TOGGLE_MASK 0xc0UL 4512 #define NQ_SRQ_EVENT_TOGGLE_SFT 6 4513 u8 event; 4514 #define NQ_SRQ_EVENT_EVENT_SRQ_THRESHOLD_EVENT 0x1UL 4515 #define NQ_SRQ_EVENT_EVENT_LAST NQ_SRQ_EVENT_EVENT_SRQ_THRESHOLD_EVENT 4516 __le16 reserved16; 4517 __le32 srq_handle_low; 4518 __le32 v; 4519 #define NQ_SRQ_EVENT_V 0x1UL 4520 __le32 srq_handle_high; 4521 }; 4522 4523 /* nq_dbq_event (size:128b/16B) */ 4524 struct nq_dbq_event { 4525 u8 type; 4526 #define NQ_DBQ_EVENT_TYPE_MASK 0x3fUL 4527 #define NQ_DBQ_EVENT_TYPE_SFT 0 4528 #define NQ_DBQ_EVENT_TYPE_DBQ_EVENT 0x34UL 4529 #define NQ_DBQ_EVENT_TYPE_LAST NQ_DBQ_EVENT_TYPE_DBQ_EVENT 4530 u8 event; 4531 #define NQ_DBQ_EVENT_EVENT_DBQ_THRESHOLD_EVENT 0x1UL 4532 #define NQ_DBQ_EVENT_EVENT_LAST NQ_DBQ_EVENT_EVENT_DBQ_THRESHOLD_EVENT 4533 __le16 db_pfid; 4534 #define NQ_DBQ_EVENT_DB_PFID_MASK 0xfUL 4535 #define NQ_DBQ_EVENT_DB_PFID_SFT 0 4536 __le32 db_dpi; 4537 #define NQ_DBQ_EVENT_DB_DPI_MASK 0xfffffUL 4538 #define NQ_DBQ_EVENT_DB_DPI_SFT 0 4539 __le32 v; 4540 #define NQ_DBQ_EVENT_V 0x1UL 4541 __le32 db_type_db_xid; 4542 #define NQ_DBQ_EVENT_DB_XID_MASK 0xfffffUL 4543 #define NQ_DBQ_EVENT_DB_XID_SFT 0 4544 #define NQ_DBQ_EVENT_DB_TYPE_MASK 0xf0000000UL 4545 #define NQ_DBQ_EVENT_DB_TYPE_SFT 28 4546 }; 4547 4548 /* xrrq_irrq (size:256b/32B) */ 4549 struct xrrq_irrq { 4550 __le16 credits_type; 4551 #define XRRQ_IRRQ_TYPE 0x1UL 4552 #define XRRQ_IRRQ_TYPE_READ_REQ 0x0UL 4553 #define XRRQ_IRRQ_TYPE_ATOMIC_REQ 0x1UL 4554 #define XRRQ_IRRQ_TYPE_LAST XRRQ_IRRQ_TYPE_ATOMIC_REQ 4555 #define XRRQ_IRRQ_CREDITS_MASK 0xf800UL 4556 #define XRRQ_IRRQ_CREDITS_SFT 11 4557 __le16 reserved16; 4558 __le32 reserved32; 4559 __le32 psn; 4560 #define XRRQ_IRRQ_PSN_MASK 0xffffffUL 4561 #define XRRQ_IRRQ_PSN_SFT 0 4562 __le32 msn; 4563 #define XRRQ_IRRQ_MSN_MASK 0xffffffUL 4564 #define XRRQ_IRRQ_MSN_SFT 0 4565 __le64 va_or_atomic_result; 4566 __le32 rdma_r_key; 4567 __le32 length; 4568 }; 4569 4570 /* xrrq_orrq (size:256b/32B) */ 4571 struct xrrq_orrq { 4572 __le16 num_sges_type; 4573 #define XRRQ_ORRQ_TYPE 0x1UL 4574 #define XRRQ_ORRQ_TYPE_READ_REQ 0x0UL 4575 #define XRRQ_ORRQ_TYPE_ATOMIC_REQ 0x1UL 4576 #define XRRQ_ORRQ_TYPE_LAST XRRQ_ORRQ_TYPE_ATOMIC_REQ 4577 #define XRRQ_ORRQ_NUM_SGES_MASK 0xf800UL 4578 #define XRRQ_ORRQ_NUM_SGES_SFT 11 4579 __le16 reserved16; 4580 __le32 length; 4581 __le32 psn; 4582 #define XRRQ_ORRQ_PSN_MASK 0xffffffUL 4583 #define XRRQ_ORRQ_PSN_SFT 0 4584 __le32 end_psn; 4585 #define XRRQ_ORRQ_END_PSN_MASK 0xffffffUL 4586 #define XRRQ_ORRQ_END_PSN_SFT 0 4587 __le64 first_sge_phy_or_sing_sge_va; 4588 __le32 single_sge_l_key; 4589 __le32 single_sge_size; 4590 }; 4591 4592 /* ptu_pte (size:64b/8B) */ 4593 struct ptu_pte { 4594 __le32 page_next_to_last_last_valid[2]; 4595 #define PTU_PTE_VALID 0x1UL 4596 #define PTU_PTE_LAST 0x2UL 4597 #define PTU_PTE_NEXT_TO_LAST 0x4UL 4598 #define PTU_PTE_UNUSED_MASK 0xff8UL 4599 #define PTU_PTE_UNUSED_SFT 3 4600 #define PTU_PTE_PAGE_MASK 0xfffff000UL 4601 #define PTU_PTE_PAGE_SFT 12 4602 }; 4603 4604 /* ptu_pde (size:64b/8B) */ 4605 struct ptu_pde { 4606 __le32 page_valid[2]; 4607 #define PTU_PDE_VALID 0x1UL 4608 #define PTU_PDE_UNUSED_MASK 0xffeUL 4609 #define PTU_PDE_UNUSED_SFT 1 4610 #define PTU_PDE_PAGE_MASK 0xfffff000UL 4611 #define PTU_PDE_PAGE_SFT 12 4612 }; 4613 4614 #endif /* ___BNXT_RE_HSI_H__ */ 4615