1 /*-
2 * BSD LICENSE
3 *
4 * Copyright (c) 2016 Broadcom, All Rights Reserved.
5 * The term Broadcom refers to Broadcom Limited and/or its subsidiaries
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
15 * distribution.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30 #include <sys/cdefs.h>
31 __FBSDID("$FreeBSD$");
32
33 /*
34 * Copyright(c) 2001-2021, Broadcom. All rights reserved. The
35 * term Broadcom refers to Broadcom Inc. and/or its subsidiaries.
36 * Proprietary and Confidential Information.
37 *
38 * This source file is the property of Broadcom Corporation, and
39 * may not be copied or distributed in any isomorphic form without
40 * the prior written consent of Broadcom Corporation.
41 *
42 * DO NOT MODIFY!!! This file is automatically generated.
43 */
44
45 #ifndef _HSI_STRUCT_DEF_EXTERNAL_H_
46 #define _HSI_STRUCT_DEF_EXTERNAL_H_
47
48 /* This is the HWRM command header. */
49 /* hwrm_cmd_hdr (size:128b/16B) */
50
51 typedef struct hwrm_cmd_hdr {
52 /* The HWRM command request type. */
53 uint16_t req_type;
54 /*
55 * The completion ring to send the completion event on. This should
56 * be the NQ ID returned from the `nq_alloc` HWRM command.
57 */
58 uint16_t cmpl_ring;
59 /*
60 * The sequence ID is used by the driver for tracking multiple
61 * commands. This ID is treated as opaque data by the firmware and
62 * the value is returned in the `hwrm_resp_hdr` upon completion.
63 */
64 uint16_t seq_id;
65 /*
66 * The target ID of the command:
67 * * 0x0-0xFFF8 - The function ID
68 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
69 * * 0xFFFD - Reserved for user-space HWRM interface
70 * * 0xFFFF - HWRM
71 */
72 uint16_t target_id;
73 /*
74 * A physical address pointer pointing to a host buffer that the
75 * command's response data will be written. This can be either a host
76 * physical address (HPA) or a guest physical address (GPA) and must
77 * point to a physically contiguous block of memory.
78 */
79 uint64_t resp_addr;
80 } hwrm_cmd_hdr_t, *phwrm_cmd_hdr_t;
81
82 /* This is the HWRM response header. */
83 /* hwrm_resp_hdr (size:64b/8B) */
84
85 typedef struct hwrm_resp_hdr {
86 /* The specific error status for the command. */
87 uint16_t error_code;
88 /* The HWRM command request type. */
89 uint16_t req_type;
90 /* The sequence ID from the original command. */
91 uint16_t seq_id;
92 /* The length of the response data in number of bytes. */
93 uint16_t resp_len;
94 } hwrm_resp_hdr_t, *phwrm_resp_hdr_t;
95
96 /*
97 * TLV encapsulated message. Use the TLV type field of the
98 * TLV to determine the type of message encapsulated.
99 */
100 #define CMD_DISCR_TLV_ENCAP UINT32_C(0x8000)
101 #define CMD_DISCR_LAST CMD_DISCR_TLV_ENCAP
102
103
104 /* HWRM request message */
105 #define TLV_TYPE_HWRM_REQUEST UINT32_C(0x1)
106 /* HWRM response message */
107 #define TLV_TYPE_HWRM_RESPONSE UINT32_C(0x2)
108 /* RoCE slow path command */
109 #define TLV_TYPE_ROCE_SP_COMMAND UINT32_C(0x3)
110 /* RoCE slow path command to query CC Gen1 support. */
111 #define TLV_TYPE_QUERY_ROCE_CC_GEN1 UINT32_C(0x4)
112 /* RoCE slow path command to modify CC Gen1 support. */
113 #define TLV_TYPE_MODIFY_ROCE_CC_GEN1 UINT32_C(0x5)
114 /* Engine CKV - The Alias key EC curve and ECC public key information. */
115 #define TLV_TYPE_ENGINE_CKV_ALIAS_ECC_PUBLIC_KEY UINT32_C(0x8001)
116 /* Engine CKV - Initialization vector. */
117 #define TLV_TYPE_ENGINE_CKV_IV UINT32_C(0x8003)
118 /* Engine CKV - Authentication tag. */
119 #define TLV_TYPE_ENGINE_CKV_AUTH_TAG UINT32_C(0x8004)
120 /* Engine CKV - The encrypted data. */
121 #define TLV_TYPE_ENGINE_CKV_CIPHERTEXT UINT32_C(0x8005)
122 /* Engine CKV - Supported host_algorithms. */
123 #define TLV_TYPE_ENGINE_CKV_HOST_ALGORITHMS UINT32_C(0x8006)
124 /* Engine CKV - The Host EC curve name and ECC public key information. */
125 #define TLV_TYPE_ENGINE_CKV_HOST_ECC_PUBLIC_KEY UINT32_C(0x8007)
126 /* Engine CKV - The ECDSA signature. */
127 #define TLV_TYPE_ENGINE_CKV_ECDSA_SIGNATURE UINT32_C(0x8008)
128 /* Engine CKV - The firmware EC curve name and ECC public key information. */
129 #define TLV_TYPE_ENGINE_CKV_FW_ECC_PUBLIC_KEY UINT32_C(0x8009)
130 /* Engine CKV - Supported firmware algorithms. */
131 #define TLV_TYPE_ENGINE_CKV_FW_ALGORITHMS UINT32_C(0x800a)
132 #define TLV_TYPE_LAST TLV_TYPE_ENGINE_CKV_FW_ALGORITHMS
133
134
135 /* tlv (size:64b/8B) */
136
137 typedef struct tlv {
138 /*
139 * The command discriminator is used to differentiate between various
140 * types of HWRM messages. This includes legacy HWRM and RoCE slowpath
141 * command messages as well as newer TLV encapsulated HWRM commands.
142 *
143 * For TLV encapsulated messages this field must be 0x8000.
144 */
145 uint16_t cmd_discr;
146 uint8_t reserved_8b;
147 uint8_t flags;
148 /*
149 * Indicates the presence of additional TLV encapsulated data
150 * follows this TLV.
151 */
152 #define TLV_FLAGS_MORE UINT32_C(0x1)
153 /* Last TLV in a sequence of TLVs. */
154 #define TLV_FLAGS_MORE_LAST UINT32_C(0x0)
155 /* More TLVs follow this TLV. */
156 #define TLV_FLAGS_MORE_NOT_LAST UINT32_C(0x1)
157 /*
158 * When an HWRM receiver detects a TLV type that it does not
159 * support with the TLV required flag set, the receiver must
160 * reject the HWRM message with an error code indicating an
161 * unsupported TLV type.
162 */
163 #define TLV_FLAGS_REQUIRED UINT32_C(0x2)
164 /* No */
165 #define TLV_FLAGS_REQUIRED_NO (UINT32_C(0x0) << 1)
166 /* Yes */
167 #define TLV_FLAGS_REQUIRED_YES (UINT32_C(0x1) << 1)
168 #define TLV_FLAGS_REQUIRED_LAST TLV_FLAGS_REQUIRED_YES
169 /*
170 * This field defines the TLV type value which is divided into
171 * two ranges to differentiate between global and local TLV types.
172 * Global TLV types must be unique across all defined TLV types.
173 * Local TLV types are valid only for extensions to a given
174 * HWRM message and may be repeated across different HWRM message
175 * types. There is a direct correlation of each HWRM message type
176 * to a single global TLV type value.
177 *
178 * Global TLV range: `0 - (63k-1)`
179 *
180 * Local TLV range: `63k - (64k-1)`
181 */
182 uint16_t tlv_type;
183 /*
184 * Length of the message data encapsulated by this TLV in bytes.
185 * This length does not include the size of the TLV header itself
186 * and it must be an integer multiple of 8B.
187 */
188 uint16_t length;
189 } tlv_t, *ptlv_t;
190
191 /* Input */
192 /* input (size:128b/16B) */
193
194 typedef struct input {
195 /*
196 * This value indicates what type of request this is. The format
197 * for the rest of the command is determined by this field.
198 */
199 uint16_t req_type;
200 /*
201 * This value indicates the what completion ring the request will
202 * be optionally completed on. If the value is -1, then no
203 * CR completion will be generated. Any other value must be a
204 * valid CR ring_id value for this function.
205 */
206 uint16_t cmpl_ring;
207 /* This value indicates the command sequence number. */
208 uint16_t seq_id;
209 /*
210 * Target ID of this command.
211 *
212 * 0x0 - 0xFFF8 - Used for function ids
213 * 0xFFF8 - 0xFFFE - Reserved for internal processors
214 * 0xFFFF - HWRM
215 */
216 uint16_t target_id;
217 /*
218 * This is the host address where the response will be written
219 * when the request is complete. This area must be 16B aligned
220 * and must be cleared to zero before the request is made.
221 */
222 uint64_t resp_addr;
223 } input_t, *pinput_t;
224
225 /* Output */
226 /* output (size:64b/8B) */
227
228 typedef struct output {
229 /*
230 * Pass/Fail or error type
231 *
232 * Note: receiver to verify the in parameters, and fail the call
233 * with an error when appropriate
234 */
235 uint16_t error_code;
236 /* This field returns the type of original request. */
237 uint16_t req_type;
238 /* This field provides original sequence number of the command. */
239 uint16_t seq_id;
240 /*
241 * This field is the length of the response in bytes. The
242 * last byte of the response is a valid flag that will read
243 * as '1' when the command has been completely written to
244 * memory.
245 */
246 uint16_t resp_len;
247 } output_t, *poutput_t;
248
249 /* Short Command Structure */
250 /* hwrm_short_input (size:128b/16B) */
251
252 typedef struct hwrm_short_input {
253 /*
254 * This field indicates the type of request in the request buffer.
255 * The format for the rest of the command (request) is determined
256 * by this field.
257 */
258 uint16_t req_type;
259 /*
260 * This field indicates a signature that is used to identify short
261 * form of the command listed here. This field shall be set to
262 * 17185 (0x4321).
263 */
264 uint16_t signature;
265 /* Signature indicating this is a short form of HWRM command */
266 #define HWRM_SHORT_INPUT_SIGNATURE_SHORT_CMD UINT32_C(0x4321)
267 #define HWRM_SHORT_INPUT_SIGNATURE_LAST HWRM_SHORT_INPUT_SIGNATURE_SHORT_CMD
268 /* The target ID of the command */
269 uint16_t target_id;
270 /* Default target_id (0x0) to maintain compatibility with old driver */
271 #define HWRM_SHORT_INPUT_TARGET_ID_DEFAULT UINT32_C(0x0)
272 /* Reserved for user-space HWRM interface */
273 #define HWRM_SHORT_INPUT_TARGET_ID_TOOLS UINT32_C(0xfffd)
274 #define HWRM_SHORT_INPUT_TARGET_ID_LAST HWRM_SHORT_INPUT_TARGET_ID_TOOLS
275 /* This value indicates the length of the request. */
276 uint16_t size;
277 /*
278 * This is the host address where the request was written.
279 * This area must be 16B aligned.
280 */
281 uint64_t req_addr;
282 } hwrm_short_input_t, *phwrm_short_input_t;
283
284 #define GET_HWRM_REQ_TYPE(x) \
285 (((x) < 0x80) ? \
286 ((x) == 0x0 ? "HWRM_VER_GET": \
287 ((x) == 0xb ? "HWRM_FUNC_ECHO_RESPONSE": \
288 ((x) == 0xc ? "HWRM_ERROR_RECOVERY_QCFG": \
289 ((x) == 0xd ? "HWRM_FUNC_DRV_IF_CHANGE": \
290 ((x) == 0xe ? "HWRM_FUNC_BUF_UNRGTR": \
291 ((x) == 0xf ? "HWRM_FUNC_VF_CFG": \
292 ((x) == 0x10 ? "HWRM_RESERVED1": \
293 ((x) == 0x11 ? "HWRM_FUNC_RESET": \
294 ((x) == 0x12 ? "HWRM_FUNC_GETFID": \
295 ((x) == 0x13 ? "HWRM_FUNC_VF_ALLOC": \
296 ((x) == 0x14 ? "HWRM_FUNC_VF_FREE": \
297 ((x) == 0x15 ? "HWRM_FUNC_QCAPS": \
298 ((x) == 0x16 ? "HWRM_FUNC_QCFG": \
299 ((x) == 0x17 ? "HWRM_FUNC_CFG": \
300 ((x) == 0x18 ? "HWRM_FUNC_QSTATS": \
301 ((x) == 0x19 ? "HWRM_FUNC_CLR_STATS": \
302 ((x) == 0x1a ? "HWRM_FUNC_DRV_UNRGTR": \
303 ((x) == 0x1b ? "HWRM_FUNC_VF_RESC_FREE": \
304 ((x) == 0x1c ? "HWRM_FUNC_VF_VNIC_IDS_QUERY": \
305 ((x) == 0x1d ? "HWRM_FUNC_DRV_RGTR": \
306 ((x) == 0x1e ? "HWRM_FUNC_DRV_QVER": \
307 ((x) == 0x1f ? "HWRM_FUNC_BUF_RGTR": \
308 ((x) == 0x20 ? "HWRM_PORT_PHY_CFG": \
309 ((x) == 0x21 ? "HWRM_PORT_MAC_CFG": \
310 ((x) == 0x22 ? "HWRM_PORT_TS_QUERY": \
311 ((x) == 0x23 ? "HWRM_PORT_QSTATS": \
312 ((x) == 0x24 ? "HWRM_PORT_LPBK_QSTATS": \
313 ((x) == 0x25 ? "HWRM_PORT_CLR_STATS": \
314 ((x) == 0x26 ? "HWRM_PORT_LPBK_CLR_STATS": \
315 ((x) == 0x27 ? "HWRM_PORT_PHY_QCFG": \
316 ((x) == 0x28 ? "HWRM_PORT_MAC_QCFG": \
317 ((x) == 0x29 ? "HWRM_PORT_MAC_PTP_QCFG": \
318 ((x) == 0x2a ? "HWRM_PORT_PHY_QCAPS": \
319 ((x) == 0x2b ? "HWRM_PORT_PHY_I2C_WRITE": \
320 ((x) == 0x2c ? "HWRM_PORT_PHY_I2C_READ": \
321 ((x) == 0x2d ? "HWRM_PORT_LED_CFG": \
322 ((x) == 0x2e ? "HWRM_PORT_LED_QCFG": \
323 ((x) == 0x2f ? "HWRM_PORT_LED_QCAPS": \
324 ((x) == 0x30 ? "HWRM_QUEUE_QPORTCFG": \
325 ((x) == 0x31 ? "HWRM_QUEUE_QCFG": \
326 ((x) == 0x32 ? "HWRM_QUEUE_CFG": \
327 ((x) == 0x33 ? "HWRM_FUNC_VLAN_CFG": \
328 ((x) == 0x34 ? "HWRM_FUNC_VLAN_QCFG": \
329 ((x) == 0x35 ? "HWRM_QUEUE_PFCENABLE_QCFG": \
330 ((x) == 0x36 ? "HWRM_QUEUE_PFCENABLE_CFG": \
331 ((x) == 0x37 ? "HWRM_QUEUE_PRI2COS_QCFG": \
332 ((x) == 0x38 ? "HWRM_QUEUE_PRI2COS_CFG": \
333 ((x) == 0x39 ? "HWRM_QUEUE_COS2BW_QCFG": \
334 ((x) == 0x3a ? "HWRM_QUEUE_COS2BW_CFG": \
335 ((x) == 0x3b ? "HWRM_QUEUE_DSCP_QCAPS": \
336 ((x) == 0x3c ? "HWRM_QUEUE_DSCP2PRI_QCFG": \
337 ((x) == 0x3d ? "HWRM_QUEUE_DSCP2PRI_CFG": \
338 ((x) == 0x40 ? "HWRM_VNIC_ALLOC": \
339 ((x) == 0x41 ? "HWRM_VNIC_FREE": \
340 ((x) == 0x42 ? "HWRM_VNIC_CFG": \
341 ((x) == 0x43 ? "HWRM_VNIC_QCFG": \
342 ((x) == 0x44 ? "HWRM_VNIC_TPA_CFG": \
343 ((x) == 0x45 ? "HWRM_VNIC_TPA_QCFG": \
344 ((x) == 0x46 ? "HWRM_VNIC_RSS_CFG": \
345 ((x) == 0x47 ? "HWRM_VNIC_RSS_QCFG": \
346 ((x) == 0x48 ? "HWRM_VNIC_PLCMODES_CFG": \
347 ((x) == 0x49 ? "HWRM_VNIC_PLCMODES_QCFG": \
348 ((x) == 0x4a ? "HWRM_VNIC_QCAPS": \
349 ((x) == 0x4b ? "HWRM_VNIC_UPDATE": \
350 ((x) == 0x50 ? "HWRM_RING_ALLOC": \
351 ((x) == 0x51 ? "HWRM_RING_FREE": \
352 ((x) == 0x52 ? "HWRM_RING_CMPL_RING_QAGGINT_PARAMS": \
353 ((x) == 0x53 ? "HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS": \
354 ((x) == 0x54 ? "HWRM_RING_AGGINT_QCAPS": \
355 ((x) == 0x55 ? "HWRM_RING_SCHQ_ALLOC": \
356 ((x) == 0x56 ? "HWRM_RING_SCHQ_CFG": \
357 ((x) == 0x57 ? "HWRM_RING_SCHQ_FREE": \
358 ((x) == 0x5e ? "HWRM_RING_RESET": \
359 ((x) == 0x60 ? "HWRM_RING_GRP_ALLOC": \
360 ((x) == 0x61 ? "HWRM_RING_GRP_FREE": \
361 ((x) == 0x62 ? "HWRM_RING_CFG": \
362 ((x) == 0x63 ? "HWRM_RING_QCFG": \
363 ((x) == 0x64 ? "HWRM_RESERVED5": \
364 ((x) == 0x65 ? "HWRM_RESERVED6": \
365 ((x) == 0x70 ? "HWRM_VNIC_RSS_COS_LB_CTX_ALLOC": \
366 ((x) == 0x71 ? "HWRM_VNIC_RSS_COS_LB_CTX_FREE": \
367 "Unknown decode" ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) : \
368 (((x) < 0x100) ? \
369 ((x) == 0x80 ? "HWRM_QUEUE_MPLS_QCAPS": \
370 ((x) == 0x81 ? "HWRM_QUEUE_MPLSTC2PRI_QCFG": \
371 ((x) == 0x82 ? "HWRM_QUEUE_MPLSTC2PRI_CFG": \
372 ((x) == 0x83 ? "HWRM_QUEUE_VLANPRI_QCAPS": \
373 ((x) == 0x84 ? "HWRM_QUEUE_VLANPRI2PRI_QCFG": \
374 ((x) == 0x85 ? "HWRM_QUEUE_VLANPRI2PRI_CFG": \
375 ((x) == 0x86 ? "HWRM_QUEUE_GLOBAL_CFG": \
376 ((x) == 0x87 ? "HWRM_QUEUE_GLOBAL_QCFG": \
377 ((x) == 0x90 ? "HWRM_CFA_L2_FILTER_ALLOC": \
378 ((x) == 0x91 ? "HWRM_CFA_L2_FILTER_FREE": \
379 ((x) == 0x92 ? "HWRM_CFA_L2_FILTER_CFG": \
380 ((x) == 0x93 ? "HWRM_CFA_L2_SET_RX_MASK": \
381 ((x) == 0x94 ? "HWRM_CFA_VLAN_ANTISPOOF_CFG": \
382 ((x) == 0x95 ? "HWRM_CFA_TUNNEL_FILTER_ALLOC": \
383 ((x) == 0x96 ? "HWRM_CFA_TUNNEL_FILTER_FREE": \
384 ((x) == 0x97 ? "HWRM_CFA_ENCAP_RECORD_ALLOC": \
385 ((x) == 0x98 ? "HWRM_CFA_ENCAP_RECORD_FREE": \
386 ((x) == 0x99 ? "HWRM_CFA_NTUPLE_FILTER_ALLOC": \
387 ((x) == 0x9a ? "HWRM_CFA_NTUPLE_FILTER_FREE": \
388 ((x) == 0x9b ? "HWRM_CFA_NTUPLE_FILTER_CFG": \
389 ((x) == 0x9c ? "HWRM_CFA_EM_FLOW_ALLOC": \
390 ((x) == 0x9d ? "HWRM_CFA_EM_FLOW_FREE": \
391 ((x) == 0x9e ? "HWRM_CFA_EM_FLOW_CFG": \
392 ((x) == 0xa0 ? "HWRM_TUNNEL_DST_PORT_QUERY": \
393 ((x) == 0xa1 ? "HWRM_TUNNEL_DST_PORT_ALLOC": \
394 ((x) == 0xa2 ? "HWRM_TUNNEL_DST_PORT_FREE": \
395 ((x) == 0xaf ? "HWRM_STAT_CTX_ENG_QUERY": \
396 ((x) == 0xb0 ? "HWRM_STAT_CTX_ALLOC": \
397 ((x) == 0xb1 ? "HWRM_STAT_CTX_FREE": \
398 ((x) == 0xb2 ? "HWRM_STAT_CTX_QUERY": \
399 ((x) == 0xb3 ? "HWRM_STAT_CTX_CLR_STATS": \
400 ((x) == 0xb4 ? "HWRM_PORT_QSTATS_EXT": \
401 ((x) == 0xb5 ? "HWRM_PORT_PHY_MDIO_WRITE": \
402 ((x) == 0xb6 ? "HWRM_PORT_PHY_MDIO_READ": \
403 ((x) == 0xb7 ? "HWRM_PORT_PHY_MDIO_BUS_ACQUIRE": \
404 ((x) == 0xb8 ? "HWRM_PORT_PHY_MDIO_BUS_RELEASE": \
405 ((x) == 0xb9 ? "HWRM_PORT_QSTATS_EXT_PFC_WD": \
406 ((x) == 0xba ? "HWRM_RESERVED7": \
407 ((x) == 0xbb ? "HWRM_PORT_TX_FIR_CFG": \
408 ((x) == 0xbc ? "HWRM_PORT_TX_FIR_QCFG": \
409 ((x) == 0xbd ? "HWRM_PORT_ECN_QSTATS": \
410 ((x) == 0xbe ? "HWRM_FW_LIVEPATCH_QUERY": \
411 ((x) == 0xbf ? "HWRM_FW_LIVEPATCH": \
412 ((x) == 0xc0 ? "HWRM_FW_RESET": \
413 ((x) == 0xc1 ? "HWRM_FW_QSTATUS": \
414 ((x) == 0xc2 ? "HWRM_FW_HEALTH_CHECK": \
415 ((x) == 0xc3 ? "HWRM_FW_SYNC": \
416 ((x) == 0xc4 ? "HWRM_FW_STATE_QCAPS": \
417 ((x) == 0xc5 ? "HWRM_FW_STATE_QUIESCE": \
418 ((x) == 0xc6 ? "HWRM_FW_STATE_BACKUP": \
419 ((x) == 0xc7 ? "HWRM_FW_STATE_RESTORE": \
420 ((x) == 0xc8 ? "HWRM_FW_SET_TIME": \
421 ((x) == 0xc9 ? "HWRM_FW_GET_TIME": \
422 ((x) == 0xca ? "HWRM_FW_SET_STRUCTURED_DATA": \
423 ((x) == 0xcb ? "HWRM_FW_GET_STRUCTURED_DATA": \
424 ((x) == 0xcc ? "HWRM_FW_IPC_MAILBOX": \
425 ((x) == 0xcd ? "HWRM_FW_ECN_CFG": \
426 ((x) == 0xce ? "HWRM_FW_ECN_QCFG": \
427 ((x) == 0xcf ? "HWRM_FW_SECURE_CFG": \
428 ((x) == 0xd0 ? "HWRM_EXEC_FWD_RESP": \
429 ((x) == 0xd1 ? "HWRM_REJECT_FWD_RESP": \
430 ((x) == 0xd2 ? "HWRM_FWD_RESP": \
431 ((x) == 0xd3 ? "HWRM_FWD_ASYNC_EVENT_CMPL": \
432 ((x) == 0xd4 ? "HWRM_OEM_CMD": \
433 ((x) == 0xd5 ? "HWRM_PORT_PRBS_TEST": \
434 ((x) == 0xd6 ? "HWRM_PORT_SFP_SIDEBAND_CFG": \
435 ((x) == 0xd7 ? "HWRM_PORT_SFP_SIDEBAND_QCFG": \
436 ((x) == 0xd8 ? "HWRM_FW_STATE_UNQUIESCE": \
437 ((x) == 0xd9 ? "HWRM_PORT_DSC_DUMP": \
438 ((x) == 0xe0 ? "HWRM_TEMP_MONITOR_QUERY": \
439 ((x) == 0xe1 ? "HWRM_REG_POWER_QUERY": \
440 ((x) == 0xe2 ? "HWRM_CORE_FREQUENCY_QUERY": \
441 ((x) == 0xe3 ? "HWRM_REG_POWER_HISTOGRAM": \
442 ((x) == 0xf0 ? "HWRM_WOL_FILTER_ALLOC": \
443 ((x) == 0xf1 ? "HWRM_WOL_FILTER_FREE": \
444 ((x) == 0xf2 ? "HWRM_WOL_FILTER_QCFG": \
445 ((x) == 0xf3 ? "HWRM_WOL_REASON_QCFG": \
446 ((x) == 0xf4 ? "HWRM_CFA_METER_QCAPS": \
447 ((x) == 0xf5 ? "HWRM_CFA_METER_PROFILE_ALLOC": \
448 ((x) == 0xf6 ? "HWRM_CFA_METER_PROFILE_FREE": \
449 ((x) == 0xf7 ? "HWRM_CFA_METER_PROFILE_CFG": \
450 ((x) == 0xf8 ? "HWRM_CFA_METER_INSTANCE_ALLOC": \
451 ((x) == 0xf9 ? "HWRM_CFA_METER_INSTANCE_FREE": \
452 ((x) == 0xfa ? "HWRM_CFA_METER_INSTANCE_CFG": \
453 ((x) == 0xfd ? "HWRM_CFA_VFR_ALLOC": \
454 ((x) == 0xfe ? "HWRM_CFA_VFR_FREE": \
455 "Unknown decode" )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) : \
456 (((x) < 0x180) ? \
457 ((x) == 0x100 ? "HWRM_CFA_VF_PAIR_ALLOC": \
458 ((x) == 0x101 ? "HWRM_CFA_VF_PAIR_FREE": \
459 ((x) == 0x102 ? "HWRM_CFA_VF_PAIR_INFO": \
460 ((x) == 0x103 ? "HWRM_CFA_FLOW_ALLOC": \
461 ((x) == 0x104 ? "HWRM_CFA_FLOW_FREE": \
462 ((x) == 0x105 ? "HWRM_CFA_FLOW_FLUSH": \
463 ((x) == 0x106 ? "HWRM_CFA_FLOW_STATS": \
464 ((x) == 0x107 ? "HWRM_CFA_FLOW_INFO": \
465 ((x) == 0x108 ? "HWRM_CFA_DECAP_FILTER_ALLOC": \
466 ((x) == 0x109 ? "HWRM_CFA_DECAP_FILTER_FREE": \
467 ((x) == 0x10a ? "HWRM_CFA_VLAN_ANTISPOOF_QCFG": \
468 ((x) == 0x10b ? "HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC": \
469 ((x) == 0x10c ? "HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE": \
470 ((x) == 0x10d ? "HWRM_CFA_PAIR_ALLOC": \
471 ((x) == 0x10e ? "HWRM_CFA_PAIR_FREE": \
472 ((x) == 0x10f ? "HWRM_CFA_PAIR_INFO": \
473 ((x) == 0x110 ? "HWRM_FW_IPC_MSG": \
474 ((x) == 0x111 ? "HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO": \
475 ((x) == 0x112 ? "HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE": \
476 ((x) == 0x113 ? "HWRM_CFA_FLOW_AGING_TIMER_RESET": \
477 ((x) == 0x114 ? "HWRM_CFA_FLOW_AGING_CFG": \
478 ((x) == 0x115 ? "HWRM_CFA_FLOW_AGING_QCFG": \
479 ((x) == 0x116 ? "HWRM_CFA_FLOW_AGING_QCAPS": \
480 ((x) == 0x117 ? "HWRM_CFA_CTX_MEM_RGTR": \
481 ((x) == 0x118 ? "HWRM_CFA_CTX_MEM_UNRGTR": \
482 ((x) == 0x119 ? "HWRM_CFA_CTX_MEM_QCTX": \
483 ((x) == 0x11a ? "HWRM_CFA_CTX_MEM_QCAPS": \
484 ((x) == 0x11b ? "HWRM_CFA_COUNTER_QCAPS": \
485 ((x) == 0x11c ? "HWRM_CFA_COUNTER_CFG": \
486 ((x) == 0x11d ? "HWRM_CFA_COUNTER_QCFG": \
487 ((x) == 0x11e ? "HWRM_CFA_COUNTER_QSTATS": \
488 ((x) == 0x11f ? "HWRM_CFA_TCP_FLAG_PROCESS_QCFG": \
489 ((x) == 0x120 ? "HWRM_CFA_EEM_QCAPS": \
490 ((x) == 0x121 ? "HWRM_CFA_EEM_CFG": \
491 ((x) == 0x122 ? "HWRM_CFA_EEM_QCFG": \
492 ((x) == 0x123 ? "HWRM_CFA_EEM_OP": \
493 ((x) == 0x124 ? "HWRM_CFA_ADV_FLOW_MGNT_QCAPS": \
494 ((x) == 0x125 ? "HWRM_CFA_TFLIB": \
495 ((x) == 0x126 ? "HWRM_CFA_LAG_GROUP_MEMBER_RGTR": \
496 ((x) == 0x127 ? "HWRM_CFA_LAG_GROUP_MEMBER_UNRGTR": \
497 ((x) == 0x12e ? "HWRM_ENGINE_CKV_STATUS": \
498 ((x) == 0x12f ? "HWRM_ENGINE_CKV_CKEK_ADD": \
499 ((x) == 0x130 ? "HWRM_ENGINE_CKV_CKEK_DELETE": \
500 ((x) == 0x131 ? "HWRM_ENGINE_CKV_KEY_ADD": \
501 ((x) == 0x132 ? "HWRM_ENGINE_CKV_KEY_DELETE": \
502 ((x) == 0x133 ? "HWRM_ENGINE_CKV_FLUSH": \
503 ((x) == 0x134 ? "HWRM_ENGINE_CKV_RNG_GET": \
504 ((x) == 0x135 ? "HWRM_ENGINE_CKV_KEY_GEN": \
505 ((x) == 0x136 ? "HWRM_ENGINE_CKV_KEY_LABEL_CFG": \
506 ((x) == 0x137 ? "HWRM_ENGINE_CKV_KEY_LABEL_QCFG": \
507 ((x) == 0x13c ? "HWRM_ENGINE_QG_CONFIG_QUERY": \
508 ((x) == 0x13d ? "HWRM_ENGINE_QG_QUERY": \
509 ((x) == 0x13e ? "HWRM_ENGINE_QG_METER_PROFILE_CONFIG_QUERY": \
510 ((x) == 0x13f ? "HWRM_ENGINE_QG_METER_PROFILE_QUERY": \
511 ((x) == 0x140 ? "HWRM_ENGINE_QG_METER_PROFILE_ALLOC": \
512 ((x) == 0x141 ? "HWRM_ENGINE_QG_METER_PROFILE_FREE": \
513 ((x) == 0x142 ? "HWRM_ENGINE_QG_METER_QUERY": \
514 ((x) == 0x143 ? "HWRM_ENGINE_QG_METER_BIND": \
515 ((x) == 0x144 ? "HWRM_ENGINE_QG_METER_UNBIND": \
516 ((x) == 0x145 ? "HWRM_ENGINE_QG_FUNC_BIND": \
517 ((x) == 0x146 ? "HWRM_ENGINE_SG_CONFIG_QUERY": \
518 ((x) == 0x147 ? "HWRM_ENGINE_SG_QUERY": \
519 ((x) == 0x148 ? "HWRM_ENGINE_SG_METER_QUERY": \
520 ((x) == 0x149 ? "HWRM_ENGINE_SG_METER_CONFIG": \
521 ((x) == 0x14a ? "HWRM_ENGINE_SG_QG_BIND": \
522 ((x) == 0x14b ? "HWRM_ENGINE_QG_SG_UNBIND": \
523 ((x) == 0x154 ? "HWRM_ENGINE_CONFIG_QUERY": \
524 ((x) == 0x155 ? "HWRM_ENGINE_STATS_CONFIG": \
525 ((x) == 0x156 ? "HWRM_ENGINE_STATS_CLEAR": \
526 ((x) == 0x157 ? "HWRM_ENGINE_STATS_QUERY": \
527 ((x) == 0x158 ? "HWRM_ENGINE_STATS_QUERY_CONTINUOUS_ERROR": \
528 ((x) == 0x15e ? "HWRM_ENGINE_RQ_ALLOC": \
529 ((x) == 0x15f ? "HWRM_ENGINE_RQ_FREE": \
530 ((x) == 0x160 ? "HWRM_ENGINE_CQ_ALLOC": \
531 ((x) == 0x161 ? "HWRM_ENGINE_CQ_FREE": \
532 ((x) == 0x162 ? "HWRM_ENGINE_NQ_ALLOC": \
533 ((x) == 0x163 ? "HWRM_ENGINE_NQ_FREE": \
534 ((x) == 0x164 ? "HWRM_ENGINE_ON_DIE_RQE_CREDITS": \
535 ((x) == 0x165 ? "HWRM_ENGINE_FUNC_QCFG": \
536 "Unknown decode" ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) : \
537 (((x) < 0x200) ? \
538 ((x) == 0x190 ? "HWRM_FUNC_RESOURCE_QCAPS": \
539 ((x) == 0x191 ? "HWRM_FUNC_VF_RESOURCE_CFG": \
540 ((x) == 0x192 ? "HWRM_FUNC_BACKING_STORE_QCAPS": \
541 ((x) == 0x193 ? "HWRM_FUNC_BACKING_STORE_CFG": \
542 ((x) == 0x194 ? "HWRM_FUNC_BACKING_STORE_QCFG": \
543 ((x) == 0x195 ? "HWRM_FUNC_VF_BW_CFG": \
544 ((x) == 0x196 ? "HWRM_FUNC_VF_BW_QCFG": \
545 ((x) == 0x197 ? "HWRM_FUNC_HOST_PF_IDS_QUERY": \
546 ((x) == 0x198 ? "HWRM_FUNC_QSTATS_EXT": \
547 ((x) == 0x199 ? "HWRM_STAT_EXT_CTX_QUERY": \
548 ((x) == 0x19a ? "HWRM_FUNC_SPD_CFG": \
549 ((x) == 0x19b ? "HWRM_FUNC_SPD_QCFG": \
550 ((x) == 0x19c ? "HWRM_FUNC_PTP_PIN_QCFG": \
551 ((x) == 0x19d ? "HWRM_FUNC_PTP_PIN_CFG": \
552 ((x) == 0x19e ? "HWRM_FUNC_PTP_CFG": \
553 ((x) == 0x19f ? "HWRM_FUNC_PTP_TS_QUERY": \
554 "Unknown decode" )))))))))))))))) : \
555 (((x) < 0x280) ? \
556 ((x) == 0x200 ? "HWRM_SELFTEST_QLIST": \
557 ((x) == 0x201 ? "HWRM_SELFTEST_EXEC": \
558 ((x) == 0x202 ? "HWRM_SELFTEST_IRQ": \
559 ((x) == 0x203 ? "HWRM_SELFTEST_RETRIEVE_SERDES_DATA": \
560 ((x) == 0x204 ? "HWRM_PCIE_QSTATS": \
561 ((x) == 0x205 ? "HWRM_MFG_FRU_WRITE_CONTROL": \
562 ((x) == 0x206 ? "HWRM_MFG_TIMERS_QUERY": \
563 ((x) == 0x207 ? "HWRM_MFG_OTP_CFG": \
564 ((x) == 0x208 ? "HWRM_MFG_OTP_QCFG": \
565 ((x) == 0x209 ? "HWRM_MFG_HDMA_TEST": \
566 ((x) == 0x20a ? "HWRM_MFG_FRU_EEPROM_WRITE": \
567 ((x) == 0x20b ? "HWRM_MFG_FRU_EEPROM_READ": \
568 ((x) == 0x20c ? "HWRM_MFG_SOC_IMAGE": \
569 ((x) == 0x20d ? "HWRM_MFG_SOC_QSTATUS": \
570 ((x) == 0x20e ? "HWRM_MFG_PARAM_SEEPROM_SYNC": \
571 ((x) == 0x20f ? "HWRM_MFG_PARAM_SEEPROM_READ": \
572 ((x) == 0x210 ? "HWRM_MFG_PARAM_SEEPROM_HEALTH": \
573 "Unknown decode" ))))))))))))))))) : \
574 (((x) < 0x300) ? \
575 ((x) == 0x2bc ? "HWRM_TF": \
576 ((x) == 0x2bd ? "HWRM_TF_VERSION_GET": \
577 ((x) == 0x2c6 ? "HWRM_TF_SESSION_OPEN": \
578 ((x) == 0x2c7 ? "HWRM_TF_SESSION_ATTACH": \
579 ((x) == 0x2c8 ? "HWRM_TF_SESSION_REGISTER": \
580 ((x) == 0x2c9 ? "HWRM_TF_SESSION_UNREGISTER": \
581 ((x) == 0x2ca ? "HWRM_TF_SESSION_CLOSE": \
582 ((x) == 0x2cb ? "HWRM_TF_SESSION_QCFG": \
583 ((x) == 0x2cc ? "HWRM_TF_SESSION_RESC_QCAPS": \
584 ((x) == 0x2cd ? "HWRM_TF_SESSION_RESC_ALLOC": \
585 ((x) == 0x2ce ? "HWRM_TF_SESSION_RESC_FREE": \
586 ((x) == 0x2cf ? "HWRM_TF_SESSION_RESC_FLUSH": \
587 ((x) == 0x2d0 ? "HWRM_TF_SESSION_RESC_INFO": \
588 ((x) == 0x2da ? "HWRM_TF_TBL_TYPE_GET": \
589 ((x) == 0x2db ? "HWRM_TF_TBL_TYPE_SET": \
590 ((x) == 0x2dc ? "HWRM_TF_TBL_TYPE_BULK_GET": \
591 ((x) == 0x2e2 ? "HWRM_TF_CTXT_MEM_ALLOC": \
592 ((x) == 0x2e3 ? "HWRM_TF_CTXT_MEM_FREE": \
593 ((x) == 0x2e4 ? "HWRM_TF_CTXT_MEM_RGTR": \
594 ((x) == 0x2e5 ? "HWRM_TF_CTXT_MEM_UNRGTR": \
595 ((x) == 0x2e6 ? "HWRM_TF_EXT_EM_QCAPS": \
596 ((x) == 0x2e7 ? "HWRM_TF_EXT_EM_OP": \
597 ((x) == 0x2e8 ? "HWRM_TF_EXT_EM_CFG": \
598 ((x) == 0x2e9 ? "HWRM_TF_EXT_EM_QCFG": \
599 ((x) == 0x2ea ? "HWRM_TF_EM_INSERT": \
600 ((x) == 0x2eb ? "HWRM_TF_EM_DELETE": \
601 ((x) == 0x2ec ? "HWRM_TF_EM_HASH_INSERT": \
602 ((x) == 0x2ed ? "HWRM_TF_EM_MOVE": \
603 ((x) == 0x2f8 ? "HWRM_TF_TCAM_SET": \
604 ((x) == 0x2f9 ? "HWRM_TF_TCAM_GET": \
605 ((x) == 0x2fa ? "HWRM_TF_TCAM_MOVE": \
606 ((x) == 0x2fb ? "HWRM_TF_TCAM_FREE": \
607 ((x) == 0x2fc ? "HWRM_TF_GLOBAL_CFG_SET": \
608 ((x) == 0x2fd ? "HWRM_TF_GLOBAL_CFG_GET": \
609 ((x) == 0x2fe ? "HWRM_TF_IF_TBL_SET": \
610 ((x) == 0x2ff ? "HWRM_TF_IF_TBL_GET": \
611 "Unknown decode" )))))))))))))))))))))))))))))))))))) : \
612 (((x) < 0x480) ? \
613 ((x) == 0x400 ? "HWRM_SV": \
614 "Unknown decode" ) : \
615 (((x) < 0xff80) ? \
616 ((x) == 0xff10 ? "HWRM_DBG_READ_DIRECT": \
617 ((x) == 0xff11 ? "HWRM_DBG_READ_INDIRECT": \
618 ((x) == 0xff12 ? "HWRM_DBG_WRITE_DIRECT": \
619 ((x) == 0xff13 ? "HWRM_DBG_WRITE_INDIRECT": \
620 ((x) == 0xff14 ? "HWRM_DBG_DUMP": \
621 ((x) == 0xff15 ? "HWRM_DBG_ERASE_NVM": \
622 ((x) == 0xff16 ? "HWRM_DBG_CFG": \
623 ((x) == 0xff17 ? "HWRM_DBG_COREDUMP_LIST": \
624 ((x) == 0xff18 ? "HWRM_DBG_COREDUMP_INITIATE": \
625 ((x) == 0xff19 ? "HWRM_DBG_COREDUMP_RETRIEVE": \
626 ((x) == 0xff1a ? "HWRM_DBG_FW_CLI": \
627 ((x) == 0xff1b ? "HWRM_DBG_I2C_CMD": \
628 ((x) == 0xff1c ? "HWRM_DBG_RING_INFO_GET": \
629 ((x) == 0xff1d ? "HWRM_DBG_CRASHDUMP_HEADER": \
630 ((x) == 0xff1e ? "HWRM_DBG_CRASHDUMP_ERASE": \
631 ((x) == 0xff1f ? "HWRM_DBG_DRV_TRACE": \
632 ((x) == 0xff20 ? "HWRM_DBG_QCAPS": \
633 ((x) == 0xff21 ? "HWRM_DBG_QCFG": \
634 ((x) == 0xff22 ? "HWRM_DBG_CRASHDUMP_MEDIUM_CFG": \
635 ((x) == 0xff23 ? "HWRM_DBG_USEQ_ALLOC": \
636 ((x) == 0xff24 ? "HWRM_DBG_USEQ_FREE": \
637 ((x) == 0xff25 ? "HWRM_DBG_USEQ_FLUSH": \
638 ((x) == 0xff26 ? "HWRM_DBG_USEQ_QCAPS": \
639 ((x) == 0xff27 ? "HWRM_DBG_USEQ_CW_CFG": \
640 ((x) == 0xff28 ? "HWRM_DBG_USEQ_SCHED_CFG": \
641 ((x) == 0xff29 ? "HWRM_DBG_USEQ_RUN": \
642 ((x) == 0xff2a ? "HWRM_DBG_USEQ_DELIVERY_REQ": \
643 ((x) == 0xff2b ? "HWRM_DBG_USEQ_RESP_HDR": \
644 "Unknown decode" )))))))))))))))))))))))))))) : \
645 (((x) <= 0xffff) ? \
646 ((x) == 0xffed ? "HWRM_NVM_REQ_ARBITRATION": \
647 ((x) == 0xffee ? "HWRM_NVM_FACTORY_DEFAULTS": \
648 ((x) == 0xffef ? "HWRM_NVM_VALIDATE_OPTION": \
649 ((x) == 0xfff0 ? "HWRM_NVM_FLUSH": \
650 ((x) == 0xfff1 ? "HWRM_NVM_GET_VARIABLE": \
651 ((x) == 0xfff2 ? "HWRM_NVM_SET_VARIABLE": \
652 ((x) == 0xfff3 ? "HWRM_NVM_INSTALL_UPDATE": \
653 ((x) == 0xfff4 ? "HWRM_NVM_MODIFY": \
654 ((x) == 0xfff5 ? "HWRM_NVM_VERIFY_UPDATE": \
655 ((x) == 0xfff6 ? "HWRM_NVM_GET_DEV_INFO": \
656 ((x) == 0xfff7 ? "HWRM_NVM_ERASE_DIR_ENTRY": \
657 ((x) == 0xfff8 ? "HWRM_NVM_MOD_DIR_ENTRY": \
658 ((x) == 0xfff9 ? "HWRM_NVM_FIND_DIR_ENTRY": \
659 ((x) == 0xfffa ? "HWRM_NVM_GET_DIR_ENTRIES": \
660 ((x) == 0xfffb ? "HWRM_NVM_GET_DIR_INFO": \
661 ((x) == 0xfffc ? "HWRM_NVM_RAW_DUMP": \
662 ((x) == 0xfffd ? "HWRM_NVM_READ": \
663 ((x) == 0xfffe ? "HWRM_NVM_WRITE": \
664 ((x) == 0xffff ? "HWRM_NVM_RAW_WRITE_BLK": \
665 "Unknown decode" ))))))))))))))))))) : \
666 "Unknown decode" )))))))))
667
668
669 /*
670 * Command numbering
671 * # NOTE - definitions already in hwrm_req_type, in hwrm_types.yaml
672 * # So only structure definition is provided here.
673 */
674 /* cmd_nums (size:64b/8B) */
675
676 typedef struct cmd_nums {
677 /*
678 * This version of the specification defines the commands listed in
679 * the table below. The following are general implementation
680 * requirements for these commands:
681 *
682 * # All commands listed below that are marked neither
683 * reserved nor experimental shall be implemented by the HWRM.
684 * # A HWRM client compliant to this specification should not use
685 * commands outside of the list below.
686 * # A HWRM client compliant to this specification should not use
687 * command numbers marked reserved below.
688 * # A command marked experimental below may not be implemented
689 * by the HWRM.
690 * # A command marked experimental may change in the
691 * future version of the HWRM specification.
692 * # A command not listed below may be implemented by the HWRM.
693 * The behavior of commands that are not listed below is outside
694 * the scope of this specification.
695 */
696 uint16_t req_type;
697 #define HWRM_VER_GET UINT32_C(0x0)
698 #define HWRM_FUNC_ECHO_RESPONSE UINT32_C(0xb)
699 #define HWRM_ERROR_RECOVERY_QCFG UINT32_C(0xc)
700 #define HWRM_FUNC_DRV_IF_CHANGE UINT32_C(0xd)
701 #define HWRM_FUNC_BUF_UNRGTR UINT32_C(0xe)
702 #define HWRM_FUNC_VF_CFG UINT32_C(0xf)
703 /* Reserved for future use. */
704 #define HWRM_RESERVED1 UINT32_C(0x10)
705 #define HWRM_FUNC_RESET UINT32_C(0x11)
706 #define HWRM_FUNC_GETFID UINT32_C(0x12)
707 #define HWRM_FUNC_VF_ALLOC UINT32_C(0x13)
708 #define HWRM_FUNC_VF_FREE UINT32_C(0x14)
709 #define HWRM_FUNC_QCAPS UINT32_C(0x15)
710 #define HWRM_FUNC_QCFG UINT32_C(0x16)
711 #define HWRM_FUNC_CFG UINT32_C(0x17)
712 #define HWRM_FUNC_QSTATS UINT32_C(0x18)
713 #define HWRM_FUNC_CLR_STATS UINT32_C(0x19)
714 #define HWRM_FUNC_DRV_UNRGTR UINT32_C(0x1a)
715 #define HWRM_FUNC_VF_RESC_FREE UINT32_C(0x1b)
716 #define HWRM_FUNC_VF_VNIC_IDS_QUERY UINT32_C(0x1c)
717 #define HWRM_FUNC_DRV_RGTR UINT32_C(0x1d)
718 #define HWRM_FUNC_DRV_QVER UINT32_C(0x1e)
719 #define HWRM_FUNC_BUF_RGTR UINT32_C(0x1f)
720 #define HWRM_PORT_PHY_CFG UINT32_C(0x20)
721 #define HWRM_PORT_MAC_CFG UINT32_C(0x21)
722 /* Experimental */
723 #define HWRM_PORT_TS_QUERY UINT32_C(0x22)
724 #define HWRM_PORT_QSTATS UINT32_C(0x23)
725 #define HWRM_PORT_LPBK_QSTATS UINT32_C(0x24)
726 /* Experimental */
727 #define HWRM_PORT_CLR_STATS UINT32_C(0x25)
728 /* Experimental */
729 #define HWRM_PORT_LPBK_CLR_STATS UINT32_C(0x26)
730 #define HWRM_PORT_PHY_QCFG UINT32_C(0x27)
731 #define HWRM_PORT_MAC_QCFG UINT32_C(0x28)
732 /* Experimental */
733 #define HWRM_PORT_MAC_PTP_QCFG UINT32_C(0x29)
734 #define HWRM_PORT_PHY_QCAPS UINT32_C(0x2a)
735 #define HWRM_PORT_PHY_I2C_WRITE UINT32_C(0x2b)
736 #define HWRM_PORT_PHY_I2C_READ UINT32_C(0x2c)
737 #define HWRM_PORT_LED_CFG UINT32_C(0x2d)
738 #define HWRM_PORT_LED_QCFG UINT32_C(0x2e)
739 #define HWRM_PORT_LED_QCAPS UINT32_C(0x2f)
740 #define HWRM_QUEUE_QPORTCFG UINT32_C(0x30)
741 #define HWRM_QUEUE_QCFG UINT32_C(0x31)
742 #define HWRM_QUEUE_CFG UINT32_C(0x32)
743 #define HWRM_FUNC_VLAN_CFG UINT32_C(0x33)
744 #define HWRM_FUNC_VLAN_QCFG UINT32_C(0x34)
745 #define HWRM_QUEUE_PFCENABLE_QCFG UINT32_C(0x35)
746 #define HWRM_QUEUE_PFCENABLE_CFG UINT32_C(0x36)
747 #define HWRM_QUEUE_PRI2COS_QCFG UINT32_C(0x37)
748 #define HWRM_QUEUE_PRI2COS_CFG UINT32_C(0x38)
749 #define HWRM_QUEUE_COS2BW_QCFG UINT32_C(0x39)
750 #define HWRM_QUEUE_COS2BW_CFG UINT32_C(0x3a)
751 #define HWRM_QUEUE_DSCP_QCAPS UINT32_C(0x3b)
752 #define HWRM_QUEUE_DSCP2PRI_QCFG UINT32_C(0x3c)
753 #define HWRM_QUEUE_DSCP2PRI_CFG UINT32_C(0x3d)
754 #define HWRM_VNIC_ALLOC UINT32_C(0x40)
755 #define HWRM_VNIC_FREE UINT32_C(0x41)
756 #define HWRM_VNIC_CFG UINT32_C(0x42)
757 #define HWRM_VNIC_QCFG UINT32_C(0x43)
758 #define HWRM_VNIC_TPA_CFG UINT32_C(0x44)
759 /* Experimental */
760 #define HWRM_VNIC_TPA_QCFG UINT32_C(0x45)
761 #define HWRM_VNIC_RSS_CFG UINT32_C(0x46)
762 #define HWRM_VNIC_RSS_QCFG UINT32_C(0x47)
763 #define HWRM_VNIC_PLCMODES_CFG UINT32_C(0x48)
764 #define HWRM_VNIC_PLCMODES_QCFG UINT32_C(0x49)
765 #define HWRM_VNIC_QCAPS UINT32_C(0x4a)
766 /* Updates specific fields in RX VNIC structure */
767 #define HWRM_VNIC_UPDATE UINT32_C(0x4b)
768 #define HWRM_RING_ALLOC UINT32_C(0x50)
769 #define HWRM_RING_FREE UINT32_C(0x51)
770 #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS UINT32_C(0x52)
771 #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS UINT32_C(0x53)
772 #define HWRM_RING_AGGINT_QCAPS UINT32_C(0x54)
773 #define HWRM_RING_SCHQ_ALLOC UINT32_C(0x55)
774 #define HWRM_RING_SCHQ_CFG UINT32_C(0x56)
775 #define HWRM_RING_SCHQ_FREE UINT32_C(0x57)
776 #define HWRM_RING_RESET UINT32_C(0x5e)
777 #define HWRM_RING_GRP_ALLOC UINT32_C(0x60)
778 #define HWRM_RING_GRP_FREE UINT32_C(0x61)
779 #define HWRM_RING_CFG UINT32_C(0x62)
780 #define HWRM_RING_QCFG UINT32_C(0x63)
781 /* Reserved for future use. */
782 #define HWRM_RESERVED5 UINT32_C(0x64)
783 /* Reserved for future use. */
784 #define HWRM_RESERVED6 UINT32_C(0x65)
785 #define HWRM_VNIC_RSS_COS_LB_CTX_ALLOC UINT32_C(0x70)
786 #define HWRM_VNIC_RSS_COS_LB_CTX_FREE UINT32_C(0x71)
787 #define HWRM_QUEUE_MPLS_QCAPS UINT32_C(0x80)
788 #define HWRM_QUEUE_MPLSTC2PRI_QCFG UINT32_C(0x81)
789 #define HWRM_QUEUE_MPLSTC2PRI_CFG UINT32_C(0x82)
790 #define HWRM_QUEUE_VLANPRI_QCAPS UINT32_C(0x83)
791 #define HWRM_QUEUE_VLANPRI2PRI_QCFG UINT32_C(0x84)
792 #define HWRM_QUEUE_VLANPRI2PRI_CFG UINT32_C(0x85)
793 #define HWRM_QUEUE_GLOBAL_CFG UINT32_C(0x86)
794 #define HWRM_QUEUE_GLOBAL_QCFG UINT32_C(0x87)
795 #define HWRM_CFA_L2_FILTER_ALLOC UINT32_C(0x90)
796 #define HWRM_CFA_L2_FILTER_FREE UINT32_C(0x91)
797 #define HWRM_CFA_L2_FILTER_CFG UINT32_C(0x92)
798 #define HWRM_CFA_L2_SET_RX_MASK UINT32_C(0x93)
799 #define HWRM_CFA_VLAN_ANTISPOOF_CFG UINT32_C(0x94)
800 #define HWRM_CFA_TUNNEL_FILTER_ALLOC UINT32_C(0x95)
801 #define HWRM_CFA_TUNNEL_FILTER_FREE UINT32_C(0x96)
802 /* Experimental */
803 #define HWRM_CFA_ENCAP_RECORD_ALLOC UINT32_C(0x97)
804 /* Experimental */
805 #define HWRM_CFA_ENCAP_RECORD_FREE UINT32_C(0x98)
806 #define HWRM_CFA_NTUPLE_FILTER_ALLOC UINT32_C(0x99)
807 #define HWRM_CFA_NTUPLE_FILTER_FREE UINT32_C(0x9a)
808 #define HWRM_CFA_NTUPLE_FILTER_CFG UINT32_C(0x9b)
809 /* Experimental */
810 #define HWRM_CFA_EM_FLOW_ALLOC UINT32_C(0x9c)
811 /* Experimental */
812 #define HWRM_CFA_EM_FLOW_FREE UINT32_C(0x9d)
813 /* Experimental */
814 #define HWRM_CFA_EM_FLOW_CFG UINT32_C(0x9e)
815 #define HWRM_TUNNEL_DST_PORT_QUERY UINT32_C(0xa0)
816 #define HWRM_TUNNEL_DST_PORT_ALLOC UINT32_C(0xa1)
817 #define HWRM_TUNNEL_DST_PORT_FREE UINT32_C(0xa2)
818 #define HWRM_STAT_CTX_ENG_QUERY UINT32_C(0xaf)
819 #define HWRM_STAT_CTX_ALLOC UINT32_C(0xb0)
820 #define HWRM_STAT_CTX_FREE UINT32_C(0xb1)
821 #define HWRM_STAT_CTX_QUERY UINT32_C(0xb2)
822 #define HWRM_STAT_CTX_CLR_STATS UINT32_C(0xb3)
823 #define HWRM_PORT_QSTATS_EXT UINT32_C(0xb4)
824 #define HWRM_PORT_PHY_MDIO_WRITE UINT32_C(0xb5)
825 #define HWRM_PORT_PHY_MDIO_READ UINT32_C(0xb6)
826 #define HWRM_PORT_PHY_MDIO_BUS_ACQUIRE UINT32_C(0xb7)
827 #define HWRM_PORT_PHY_MDIO_BUS_RELEASE UINT32_C(0xb8)
828 #define HWRM_PORT_QSTATS_EXT_PFC_WD UINT32_C(0xb9)
829 /* Reserved. */
830 #define HWRM_RESERVED7 UINT32_C(0xba)
831 #define HWRM_PORT_TX_FIR_CFG UINT32_C(0xbb)
832 #define HWRM_PORT_TX_FIR_QCFG UINT32_C(0xbc)
833 #define HWRM_PORT_ECN_QSTATS UINT32_C(0xbd)
834 #define HWRM_FW_LIVEPATCH_QUERY UINT32_C(0xbe)
835 #define HWRM_FW_LIVEPATCH UINT32_C(0xbf)
836 #define HWRM_FW_RESET UINT32_C(0xc0)
837 #define HWRM_FW_QSTATUS UINT32_C(0xc1)
838 #define HWRM_FW_HEALTH_CHECK UINT32_C(0xc2)
839 #define HWRM_FW_SYNC UINT32_C(0xc3)
840 #define HWRM_FW_STATE_QCAPS UINT32_C(0xc4)
841 #define HWRM_FW_STATE_QUIESCE UINT32_C(0xc5)
842 #define HWRM_FW_STATE_BACKUP UINT32_C(0xc6)
843 #define HWRM_FW_STATE_RESTORE UINT32_C(0xc7)
844 /* Experimental */
845 #define HWRM_FW_SET_TIME UINT32_C(0xc8)
846 /* Experimental */
847 #define HWRM_FW_GET_TIME UINT32_C(0xc9)
848 /* Experimental */
849 #define HWRM_FW_SET_STRUCTURED_DATA UINT32_C(0xca)
850 /* Experimental */
851 #define HWRM_FW_GET_STRUCTURED_DATA UINT32_C(0xcb)
852 /* Experimental */
853 #define HWRM_FW_IPC_MAILBOX UINT32_C(0xcc)
854 #define HWRM_FW_ECN_CFG UINT32_C(0xcd)
855 #define HWRM_FW_ECN_QCFG UINT32_C(0xce)
856 #define HWRM_FW_SECURE_CFG UINT32_C(0xcf)
857 #define HWRM_EXEC_FWD_RESP UINT32_C(0xd0)
858 #define HWRM_REJECT_FWD_RESP UINT32_C(0xd1)
859 #define HWRM_FWD_RESP UINT32_C(0xd2)
860 #define HWRM_FWD_ASYNC_EVENT_CMPL UINT32_C(0xd3)
861 #define HWRM_OEM_CMD UINT32_C(0xd4)
862 /* Tells the fw to run PRBS test on a given port and lane. */
863 #define HWRM_PORT_PRBS_TEST UINT32_C(0xd5)
864 #define HWRM_PORT_SFP_SIDEBAND_CFG UINT32_C(0xd6)
865 #define HWRM_PORT_SFP_SIDEBAND_QCFG UINT32_C(0xd7)
866 #define HWRM_FW_STATE_UNQUIESCE UINT32_C(0xd8)
867 /* Tells the fw to collect dsc dump on a given port and lane. */
868 #define HWRM_PORT_DSC_DUMP UINT32_C(0xd9)
869 #define HWRM_TEMP_MONITOR_QUERY UINT32_C(0xe0)
870 #define HWRM_REG_POWER_QUERY UINT32_C(0xe1)
871 #define HWRM_CORE_FREQUENCY_QUERY UINT32_C(0xe2)
872 #define HWRM_REG_POWER_HISTOGRAM UINT32_C(0xe3)
873 #define HWRM_WOL_FILTER_ALLOC UINT32_C(0xf0)
874 #define HWRM_WOL_FILTER_FREE UINT32_C(0xf1)
875 #define HWRM_WOL_FILTER_QCFG UINT32_C(0xf2)
876 #define HWRM_WOL_REASON_QCFG UINT32_C(0xf3)
877 /* Experimental */
878 #define HWRM_CFA_METER_QCAPS UINT32_C(0xf4)
879 /* Experimental */
880 #define HWRM_CFA_METER_PROFILE_ALLOC UINT32_C(0xf5)
881 /* Experimental */
882 #define HWRM_CFA_METER_PROFILE_FREE UINT32_C(0xf6)
883 /* Experimental */
884 #define HWRM_CFA_METER_PROFILE_CFG UINT32_C(0xf7)
885 /* Experimental */
886 #define HWRM_CFA_METER_INSTANCE_ALLOC UINT32_C(0xf8)
887 /* Experimental */
888 #define HWRM_CFA_METER_INSTANCE_FREE UINT32_C(0xf9)
889 /* Experimental */
890 #define HWRM_CFA_METER_INSTANCE_CFG UINT32_C(0xfa)
891 /* Experimental */
892 #define HWRM_CFA_VFR_ALLOC UINT32_C(0xfd)
893 /* Experimental */
894 #define HWRM_CFA_VFR_FREE UINT32_C(0xfe)
895 /* Experimental */
896 #define HWRM_CFA_VF_PAIR_ALLOC UINT32_C(0x100)
897 /* Experimental */
898 #define HWRM_CFA_VF_PAIR_FREE UINT32_C(0x101)
899 /* Experimental */
900 #define HWRM_CFA_VF_PAIR_INFO UINT32_C(0x102)
901 /* Experimental */
902 #define HWRM_CFA_FLOW_ALLOC UINT32_C(0x103)
903 /* Experimental */
904 #define HWRM_CFA_FLOW_FREE UINT32_C(0x104)
905 /* Experimental */
906 #define HWRM_CFA_FLOW_FLUSH UINT32_C(0x105)
907 /* Experimental */
908 #define HWRM_CFA_FLOW_STATS UINT32_C(0x106)
909 /* Experimental */
910 #define HWRM_CFA_FLOW_INFO UINT32_C(0x107)
911 /* Experimental */
912 #define HWRM_CFA_DECAP_FILTER_ALLOC UINT32_C(0x108)
913 /* Experimental */
914 #define HWRM_CFA_DECAP_FILTER_FREE UINT32_C(0x109)
915 #define HWRM_CFA_VLAN_ANTISPOOF_QCFG UINT32_C(0x10a)
916 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC UINT32_C(0x10b)
917 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE UINT32_C(0x10c)
918 /* Experimental */
919 #define HWRM_CFA_PAIR_ALLOC UINT32_C(0x10d)
920 /* Experimental */
921 #define HWRM_CFA_PAIR_FREE UINT32_C(0x10e)
922 /* Experimental */
923 #define HWRM_CFA_PAIR_INFO UINT32_C(0x10f)
924 /* Experimental */
925 #define HWRM_FW_IPC_MSG UINT32_C(0x110)
926 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO UINT32_C(0x111)
927 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE UINT32_C(0x112)
928 /* Experimental */
929 #define HWRM_CFA_FLOW_AGING_TIMER_RESET UINT32_C(0x113)
930 /* Experimental */
931 #define HWRM_CFA_FLOW_AGING_CFG UINT32_C(0x114)
932 /* Experimental */
933 #define HWRM_CFA_FLOW_AGING_QCFG UINT32_C(0x115)
934 /* Experimental */
935 #define HWRM_CFA_FLOW_AGING_QCAPS UINT32_C(0x116)
936 /* Experimental */
937 #define HWRM_CFA_CTX_MEM_RGTR UINT32_C(0x117)
938 /* Experimental */
939 #define HWRM_CFA_CTX_MEM_UNRGTR UINT32_C(0x118)
940 /* Experimental */
941 #define HWRM_CFA_CTX_MEM_QCTX UINT32_C(0x119)
942 /* Experimental */
943 #define HWRM_CFA_CTX_MEM_QCAPS UINT32_C(0x11a)
944 /* Experimental */
945 #define HWRM_CFA_COUNTER_QCAPS UINT32_C(0x11b)
946 /* Experimental */
947 #define HWRM_CFA_COUNTER_CFG UINT32_C(0x11c)
948 /* Experimental */
949 #define HWRM_CFA_COUNTER_QCFG UINT32_C(0x11d)
950 /* Experimental */
951 #define HWRM_CFA_COUNTER_QSTATS UINT32_C(0x11e)
952 /* Experimental */
953 #define HWRM_CFA_TCP_FLAG_PROCESS_QCFG UINT32_C(0x11f)
954 /* Experimental */
955 #define HWRM_CFA_EEM_QCAPS UINT32_C(0x120)
956 /* Experimental */
957 #define HWRM_CFA_EEM_CFG UINT32_C(0x121)
958 /* Experimental */
959 #define HWRM_CFA_EEM_QCFG UINT32_C(0x122)
960 /* Experimental */
961 #define HWRM_CFA_EEM_OP UINT32_C(0x123)
962 /* Experimental */
963 #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS UINT32_C(0x124)
964 /* Experimental - DEPRECATED */
965 #define HWRM_CFA_TFLIB UINT32_C(0x125)
966 /* Experimental */
967 #define HWRM_CFA_LAG_GROUP_MEMBER_RGTR UINT32_C(0x126)
968 /* Experimental */
969 #define HWRM_CFA_LAG_GROUP_MEMBER_UNRGTR UINT32_C(0x127)
970 /* Engine CKV - Get the current allocation status of keys provisioned in the key vault. */
971 #define HWRM_ENGINE_CKV_STATUS UINT32_C(0x12e)
972 /* Engine CKV - Add a new CKEK used to encrypt keys. */
973 #define HWRM_ENGINE_CKV_CKEK_ADD UINT32_C(0x12f)
974 /* Engine CKV - Delete a previously added CKEK. */
975 #define HWRM_ENGINE_CKV_CKEK_DELETE UINT32_C(0x130)
976 /* Engine CKV - Add a new key to the key vault. */
977 #define HWRM_ENGINE_CKV_KEY_ADD UINT32_C(0x131)
978 /* Engine CKV - Delete a key from the key vault. */
979 #define HWRM_ENGINE_CKV_KEY_DELETE UINT32_C(0x132)
980 /* Engine CKV - Delete all keys from the key vault. */
981 #define HWRM_ENGINE_CKV_FLUSH UINT32_C(0x133)
982 /* Engine CKV - Get random data. */
983 #define HWRM_ENGINE_CKV_RNG_GET UINT32_C(0x134)
984 /* Engine CKV - Generate and encrypt a new AES key. */
985 #define HWRM_ENGINE_CKV_KEY_GEN UINT32_C(0x135)
986 /* Engine CKV - Configure a label index with a label value. */
987 #define HWRM_ENGINE_CKV_KEY_LABEL_CFG UINT32_C(0x136)
988 /* Engine CKV - Query a label */
989 #define HWRM_ENGINE_CKV_KEY_LABEL_QCFG UINT32_C(0x137)
990 /* Engine - Query the available queue groups configuration. */
991 #define HWRM_ENGINE_QG_CONFIG_QUERY UINT32_C(0x13c)
992 /* Engine - Query the queue groups assigned to a function. */
993 #define HWRM_ENGINE_QG_QUERY UINT32_C(0x13d)
994 /* Engine - Query the available queue group meter profile configuration. */
995 #define HWRM_ENGINE_QG_METER_PROFILE_CONFIG_QUERY UINT32_C(0x13e)
996 /* Engine - Query the configuration of a queue group meter profile. */
997 #define HWRM_ENGINE_QG_METER_PROFILE_QUERY UINT32_C(0x13f)
998 /* Engine - Allocate a queue group meter profile. */
999 #define HWRM_ENGINE_QG_METER_PROFILE_ALLOC UINT32_C(0x140)
1000 /* Engine - Free a queue group meter profile. */
1001 #define HWRM_ENGINE_QG_METER_PROFILE_FREE UINT32_C(0x141)
1002 /* Engine - Query the meters assigned to a queue group. */
1003 #define HWRM_ENGINE_QG_METER_QUERY UINT32_C(0x142)
1004 /* Engine - Bind a queue group meter profile to a queue group. */
1005 #define HWRM_ENGINE_QG_METER_BIND UINT32_C(0x143)
1006 /* Engine - Unbind a queue group meter profile from a queue group. */
1007 #define HWRM_ENGINE_QG_METER_UNBIND UINT32_C(0x144)
1008 /* Engine - Bind a queue group to a function. */
1009 #define HWRM_ENGINE_QG_FUNC_BIND UINT32_C(0x145)
1010 /* Engine - Query the scheduling group configuration. */
1011 #define HWRM_ENGINE_SG_CONFIG_QUERY UINT32_C(0x146)
1012 /* Engine - Query the queue groups assigned to a scheduling group. */
1013 #define HWRM_ENGINE_SG_QUERY UINT32_C(0x147)
1014 /* Engine - Query the configuration of a scheduling group's meter profiles. */
1015 #define HWRM_ENGINE_SG_METER_QUERY UINT32_C(0x148)
1016 /* Engine - Configure a scheduling group's meter profiles. */
1017 #define HWRM_ENGINE_SG_METER_CONFIG UINT32_C(0x149)
1018 /* Engine - Bind a queue group to a scheduling group. */
1019 #define HWRM_ENGINE_SG_QG_BIND UINT32_C(0x14a)
1020 /* Engine - Unbind a queue group from its scheduling group. */
1021 #define HWRM_ENGINE_QG_SG_UNBIND UINT32_C(0x14b)
1022 /* Engine - Query the Engine configuration. */
1023 #define HWRM_ENGINE_CONFIG_QUERY UINT32_C(0x154)
1024 /* Engine - Configure the statistics accumulator for an Engine. */
1025 #define HWRM_ENGINE_STATS_CONFIG UINT32_C(0x155)
1026 /* Engine - Clear the statistics accumulator for an Engine. */
1027 #define HWRM_ENGINE_STATS_CLEAR UINT32_C(0x156)
1028 /* Engine - Query the statistics accumulator for an Engine. */
1029 #define HWRM_ENGINE_STATS_QUERY UINT32_C(0x157)
1030 /* Engine - Query statistics counters for continuous errors from all CDDIP Engines. */
1031 #define HWRM_ENGINE_STATS_QUERY_CONTINUOUS_ERROR UINT32_C(0x158)
1032 /* Engine - Allocate an Engine RQ. */
1033 #define HWRM_ENGINE_RQ_ALLOC UINT32_C(0x15e)
1034 /* Engine - Free an Engine RQ. */
1035 #define HWRM_ENGINE_RQ_FREE UINT32_C(0x15f)
1036 /* Engine - Allocate an Engine CQ. */
1037 #define HWRM_ENGINE_CQ_ALLOC UINT32_C(0x160)
1038 /* Engine - Free an Engine CQ. */
1039 #define HWRM_ENGINE_CQ_FREE UINT32_C(0x161)
1040 /* Engine - Allocate an NQ. */
1041 #define HWRM_ENGINE_NQ_ALLOC UINT32_C(0x162)
1042 /* Engine - Free an NQ. */
1043 #define HWRM_ENGINE_NQ_FREE UINT32_C(0x163)
1044 /* Engine - Set the on-die RQE credit update location. */
1045 #define HWRM_ENGINE_ON_DIE_RQE_CREDITS UINT32_C(0x164)
1046 /* Engine - Query the engine function configuration. */
1047 #define HWRM_ENGINE_FUNC_QCFG UINT32_C(0x165)
1048 /* Experimental */
1049 #define HWRM_FUNC_RESOURCE_QCAPS UINT32_C(0x190)
1050 /* Experimental */
1051 #define HWRM_FUNC_VF_RESOURCE_CFG UINT32_C(0x191)
1052 /* Experimental */
1053 #define HWRM_FUNC_BACKING_STORE_QCAPS UINT32_C(0x192)
1054 /* Experimental */
1055 #define HWRM_FUNC_BACKING_STORE_CFG UINT32_C(0x193)
1056 /* Experimental */
1057 #define HWRM_FUNC_BACKING_STORE_QCFG UINT32_C(0x194)
1058 /* Configures the BW of any VF */
1059 #define HWRM_FUNC_VF_BW_CFG UINT32_C(0x195)
1060 /* Queries the BW of any VF */
1061 #define HWRM_FUNC_VF_BW_QCFG UINT32_C(0x196)
1062 /* Queries pf ids belong to specified host(s) */
1063 #define HWRM_FUNC_HOST_PF_IDS_QUERY UINT32_C(0x197)
1064 /* Queries extended stats per function */
1065 #define HWRM_FUNC_QSTATS_EXT UINT32_C(0x198)
1066 /* Queries extended statistics context */
1067 #define HWRM_STAT_EXT_CTX_QUERY UINT32_C(0x199)
1068 /* Configure SoC packet DMA settings */
1069 #define HWRM_FUNC_SPD_CFG UINT32_C(0x19a)
1070 /* Query SoC packet DMA settings */
1071 #define HWRM_FUNC_SPD_QCFG UINT32_C(0x19b)
1072 /* PTP - Queries configuration of timesync IO pins. */
1073 #define HWRM_FUNC_PTP_PIN_QCFG UINT32_C(0x19c)
1074 /* PTP - Configuration of timesync IO pins. */
1075 #define HWRM_FUNC_PTP_PIN_CFG UINT32_C(0x19d)
1076 /* PTP - Configuration for disciplining PHC. */
1077 #define HWRM_FUNC_PTP_CFG UINT32_C(0x19e)
1078 /* PTP - Queries for PHC timestamps. */
1079 #define HWRM_FUNC_PTP_TS_QUERY UINT32_C(0x19f)
1080 /* Experimental */
1081 #define HWRM_SELFTEST_QLIST UINT32_C(0x200)
1082 /* Experimental */
1083 #define HWRM_SELFTEST_EXEC UINT32_C(0x201)
1084 /* Experimental */
1085 #define HWRM_SELFTEST_IRQ UINT32_C(0x202)
1086 /* Experimental */
1087 #define HWRM_SELFTEST_RETRIEVE_SERDES_DATA UINT32_C(0x203)
1088 /* Experimental */
1089 #define HWRM_PCIE_QSTATS UINT32_C(0x204)
1090 /* Experimental */
1091 #define HWRM_MFG_FRU_WRITE_CONTROL UINT32_C(0x205)
1092 /* Returns the current value of a free running counter from the device. */
1093 #define HWRM_MFG_TIMERS_QUERY UINT32_C(0x206)
1094 /* Experimental */
1095 #define HWRM_MFG_OTP_CFG UINT32_C(0x207)
1096 /* Experimental */
1097 #define HWRM_MFG_OTP_QCFG UINT32_C(0x208)
1098 /*
1099 * Tells the fw to run the DMA read from the host and DMA write
1100 * to the host test.
1101 */
1102 #define HWRM_MFG_HDMA_TEST UINT32_C(0x209)
1103 /* Tells the fw to program the fru memory */
1104 #define HWRM_MFG_FRU_EEPROM_WRITE UINT32_C(0x20a)
1105 /* Tells the fw to read the fru memory */
1106 #define HWRM_MFG_FRU_EEPROM_READ UINT32_C(0x20b)
1107 /* Used to provision SoC software images */
1108 #define HWRM_MFG_SOC_IMAGE UINT32_C(0x20c)
1109 /* Retrieves the SoC status and image provisioning information */
1110 #define HWRM_MFG_SOC_QSTATUS UINT32_C(0x20d)
1111 /* Tells the fw to program the seeprom memory */
1112 #define HWRM_MFG_PARAM_SEEPROM_SYNC UINT32_C(0x20e)
1113 /* Tells the fw to read the seeprom memory */
1114 #define HWRM_MFG_PARAM_SEEPROM_READ UINT32_C(0x20f)
1115 /* Tells the fw to get the health of seeprom data */
1116 #define HWRM_MFG_PARAM_SEEPROM_HEALTH UINT32_C(0x210)
1117 /* Experimental */
1118 #define HWRM_TF UINT32_C(0x2bc)
1119 /* Experimental */
1120 #define HWRM_TF_VERSION_GET UINT32_C(0x2bd)
1121 /* Experimental */
1122 #define HWRM_TF_SESSION_OPEN UINT32_C(0x2c6)
1123 /* Experimental */
1124 #define HWRM_TF_SESSION_ATTACH UINT32_C(0x2c7)
1125 /* Experimental */
1126 #define HWRM_TF_SESSION_REGISTER UINT32_C(0x2c8)
1127 /* Experimental */
1128 #define HWRM_TF_SESSION_UNREGISTER UINT32_C(0x2c9)
1129 /* Experimental */
1130 #define HWRM_TF_SESSION_CLOSE UINT32_C(0x2ca)
1131 /* Experimental */
1132 #define HWRM_TF_SESSION_QCFG UINT32_C(0x2cb)
1133 /* Experimental */
1134 #define HWRM_TF_SESSION_RESC_QCAPS UINT32_C(0x2cc)
1135 /* Experimental */
1136 #define HWRM_TF_SESSION_RESC_ALLOC UINT32_C(0x2cd)
1137 /* Experimental */
1138 #define HWRM_TF_SESSION_RESC_FREE UINT32_C(0x2ce)
1139 /* Experimental */
1140 #define HWRM_TF_SESSION_RESC_FLUSH UINT32_C(0x2cf)
1141 /* Experimental */
1142 #define HWRM_TF_SESSION_RESC_INFO UINT32_C(0x2d0)
1143 /* Experimental */
1144 #define HWRM_TF_TBL_TYPE_GET UINT32_C(0x2da)
1145 /* Experimental */
1146 #define HWRM_TF_TBL_TYPE_SET UINT32_C(0x2db)
1147 /* Experimental */
1148 #define HWRM_TF_TBL_TYPE_BULK_GET UINT32_C(0x2dc)
1149 /* Experimental */
1150 #define HWRM_TF_CTXT_MEM_ALLOC UINT32_C(0x2e2)
1151 /* Experimental */
1152 #define HWRM_TF_CTXT_MEM_FREE UINT32_C(0x2e3)
1153 /* Experimental */
1154 #define HWRM_TF_CTXT_MEM_RGTR UINT32_C(0x2e4)
1155 /* Experimental */
1156 #define HWRM_TF_CTXT_MEM_UNRGTR UINT32_C(0x2e5)
1157 /* Experimental */
1158 #define HWRM_TF_EXT_EM_QCAPS UINT32_C(0x2e6)
1159 /* Experimental */
1160 #define HWRM_TF_EXT_EM_OP UINT32_C(0x2e7)
1161 /* Experimental */
1162 #define HWRM_TF_EXT_EM_CFG UINT32_C(0x2e8)
1163 /* Experimental */
1164 #define HWRM_TF_EXT_EM_QCFG UINT32_C(0x2e9)
1165 /* Experimental */
1166 #define HWRM_TF_EM_INSERT UINT32_C(0x2ea)
1167 /* Experimental */
1168 #define HWRM_TF_EM_DELETE UINT32_C(0x2eb)
1169 /* Experimental */
1170 #define HWRM_TF_EM_HASH_INSERT UINT32_C(0x2ec)
1171 /* Experimental */
1172 #define HWRM_TF_EM_MOVE UINT32_C(0x2ed)
1173 /* Experimental */
1174 #define HWRM_TF_TCAM_SET UINT32_C(0x2f8)
1175 /* Experimental */
1176 #define HWRM_TF_TCAM_GET UINT32_C(0x2f9)
1177 /* Experimental */
1178 #define HWRM_TF_TCAM_MOVE UINT32_C(0x2fa)
1179 /* Experimental */
1180 #define HWRM_TF_TCAM_FREE UINT32_C(0x2fb)
1181 /* Experimental */
1182 #define HWRM_TF_GLOBAL_CFG_SET UINT32_C(0x2fc)
1183 /* Experimental */
1184 #define HWRM_TF_GLOBAL_CFG_GET UINT32_C(0x2fd)
1185 /* Experimental */
1186 #define HWRM_TF_IF_TBL_SET UINT32_C(0x2fe)
1187 /* Experimental */
1188 #define HWRM_TF_IF_TBL_GET UINT32_C(0x2ff)
1189 /* Experimental */
1190 #define HWRM_SV UINT32_C(0x400)
1191 /* Experimental */
1192 #define HWRM_DBG_READ_DIRECT UINT32_C(0xff10)
1193 /* Experimental */
1194 #define HWRM_DBG_READ_INDIRECT UINT32_C(0xff11)
1195 /* Experimental */
1196 #define HWRM_DBG_WRITE_DIRECT UINT32_C(0xff12)
1197 /* Experimental */
1198 #define HWRM_DBG_WRITE_INDIRECT UINT32_C(0xff13)
1199 #define HWRM_DBG_DUMP UINT32_C(0xff14)
1200 /* Experimental */
1201 #define HWRM_DBG_ERASE_NVM UINT32_C(0xff15)
1202 /* Experimental */
1203 #define HWRM_DBG_CFG UINT32_C(0xff16)
1204 /* Experimental */
1205 #define HWRM_DBG_COREDUMP_LIST UINT32_C(0xff17)
1206 /* Experimental */
1207 #define HWRM_DBG_COREDUMP_INITIATE UINT32_C(0xff18)
1208 /* Experimental */
1209 #define HWRM_DBG_COREDUMP_RETRIEVE UINT32_C(0xff19)
1210 /* Experimental */
1211 #define HWRM_DBG_FW_CLI UINT32_C(0xff1a)
1212 /* */
1213 #define HWRM_DBG_I2C_CMD UINT32_C(0xff1b)
1214 /* */
1215 #define HWRM_DBG_RING_INFO_GET UINT32_C(0xff1c)
1216 /* Experimental */
1217 #define HWRM_DBG_CRASHDUMP_HEADER UINT32_C(0xff1d)
1218 /* Experimental */
1219 #define HWRM_DBG_CRASHDUMP_ERASE UINT32_C(0xff1e)
1220 /* Send driver debug information to firmware */
1221 #define HWRM_DBG_DRV_TRACE UINT32_C(0xff1f)
1222 /* Query debug capabilities of firmware */
1223 #define HWRM_DBG_QCAPS UINT32_C(0xff20)
1224 /* Retrieve debug settings of firmware */
1225 #define HWRM_DBG_QCFG UINT32_C(0xff21)
1226 /* Set destination parameters for crashdump medium */
1227 #define HWRM_DBG_CRASHDUMP_MEDIUM_CFG UINT32_C(0xff22)
1228 /* Experimental */
1229 #define HWRM_DBG_USEQ_ALLOC UINT32_C(0xff23)
1230 /* Experimental */
1231 #define HWRM_DBG_USEQ_FREE UINT32_C(0xff24)
1232 /* Experimental */
1233 #define HWRM_DBG_USEQ_FLUSH UINT32_C(0xff25)
1234 /* Experimental */
1235 #define HWRM_DBG_USEQ_QCAPS UINT32_C(0xff26)
1236 /* Experimental */
1237 #define HWRM_DBG_USEQ_CW_CFG UINT32_C(0xff27)
1238 /* Experimental */
1239 #define HWRM_DBG_USEQ_SCHED_CFG UINT32_C(0xff28)
1240 /* Experimental */
1241 #define HWRM_DBG_USEQ_RUN UINT32_C(0xff29)
1242 /* Experimental */
1243 #define HWRM_DBG_USEQ_DELIVERY_REQ UINT32_C(0xff2a)
1244 /* Experimental */
1245 #define HWRM_DBG_USEQ_RESP_HDR UINT32_C(0xff2b)
1246 #define HWRM_NVM_REQ_ARBITRATION UINT32_C(0xffed)
1247 /* Experimental */
1248 #define HWRM_NVM_FACTORY_DEFAULTS UINT32_C(0xffee)
1249 #define HWRM_NVM_VALIDATE_OPTION UINT32_C(0xffef)
1250 #define HWRM_NVM_FLUSH UINT32_C(0xfff0)
1251 #define HWRM_NVM_GET_VARIABLE UINT32_C(0xfff1)
1252 #define HWRM_NVM_SET_VARIABLE UINT32_C(0xfff2)
1253 #define HWRM_NVM_INSTALL_UPDATE UINT32_C(0xfff3)
1254 #define HWRM_NVM_MODIFY UINT32_C(0xfff4)
1255 #define HWRM_NVM_VERIFY_UPDATE UINT32_C(0xfff5)
1256 #define HWRM_NVM_GET_DEV_INFO UINT32_C(0xfff6)
1257 #define HWRM_NVM_ERASE_DIR_ENTRY UINT32_C(0xfff7)
1258 #define HWRM_NVM_MOD_DIR_ENTRY UINT32_C(0xfff8)
1259 #define HWRM_NVM_FIND_DIR_ENTRY UINT32_C(0xfff9)
1260 #define HWRM_NVM_GET_DIR_ENTRIES UINT32_C(0xfffa)
1261 #define HWRM_NVM_GET_DIR_INFO UINT32_C(0xfffb)
1262 #define HWRM_NVM_RAW_DUMP UINT32_C(0xfffc)
1263 #define HWRM_NVM_READ UINT32_C(0xfffd)
1264 #define HWRM_NVM_WRITE UINT32_C(0xfffe)
1265 #define HWRM_NVM_RAW_WRITE_BLK UINT32_C(0xffff)
1266 #define HWRM_LAST HWRM_NVM_RAW_WRITE_BLK
1267 uint16_t unused_0[3];
1268 } cmd_nums_t, *pcmd_nums_t;
1269
1270 /* Return Codes */
1271 /* ret_codes (size:64b/8B) */
1272
1273 typedef struct ret_codes {
1274 uint16_t error_code;
1275 /* Request was successfully executed by the HWRM. */
1276 #define HWRM_ERR_CODE_SUCCESS UINT32_C(0x0)
1277 /* The HWRM failed to execute the request. */
1278 #define HWRM_ERR_CODE_FAIL UINT32_C(0x1)
1279 /*
1280 * The request contains invalid argument(s) or input
1281 * parameters.
1282 */
1283 #define HWRM_ERR_CODE_INVALID_PARAMS UINT32_C(0x2)
1284 /*
1285 * The requester is not allowed to access the requested
1286 * resource. This error code shall be provided in a
1287 * response to a request to query or modify an existing
1288 * resource that is not accessible by the requester.
1289 */
1290 #define HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED UINT32_C(0x3)
1291 /*
1292 * The HWRM is unable to allocate the requested resource.
1293 * This code only applies to requests for HWRM resource
1294 * allocations.
1295 */
1296 #define HWRM_ERR_CODE_RESOURCE_ALLOC_ERROR UINT32_C(0x4)
1297 /*
1298 * Invalid combination of flags is specified in the
1299 * request.
1300 */
1301 #define HWRM_ERR_CODE_INVALID_FLAGS UINT32_C(0x5)
1302 /*
1303 * Invalid combination of enables fields is specified in
1304 * the request.
1305 */
1306 #define HWRM_ERR_CODE_INVALID_ENABLES UINT32_C(0x6)
1307 /*
1308 * Request contains a required TLV that is not supported by
1309 * the installed version of firmware.
1310 */
1311 #define HWRM_ERR_CODE_UNSUPPORTED_TLV UINT32_C(0x7)
1312 /*
1313 * No firmware buffer available to accept the request. Driver
1314 * should retry the request.
1315 */
1316 #define HWRM_ERR_CODE_NO_BUFFER UINT32_C(0x8)
1317 /*
1318 * This error code is only reported by firmware when some
1319 * sub-option of a supported HWRM command is unsupported.
1320 */
1321 #define HWRM_ERR_CODE_UNSUPPORTED_OPTION_ERR UINT32_C(0x9)
1322 /*
1323 * This error code is only reported by firmware when the specific
1324 * request is not able to process when the HOT reset in progress.
1325 */
1326 #define HWRM_ERR_CODE_HOT_RESET_PROGRESS UINT32_C(0xa)
1327 /*
1328 * This error code is only reported by firmware when the registered
1329 * driver instances are not capable of hot reset.
1330 */
1331 #define HWRM_ERR_CODE_HOT_RESET_FAIL UINT32_C(0xb)
1332 /*
1333 * This error code is only reported by the firmware when during
1334 * flow allocation when a request for a flow counter fails because
1335 * the number of flow counters are exhausted.
1336 */
1337 #define HWRM_ERR_CODE_NO_FLOW_COUNTER_DURING_ALLOC UINT32_C(0xc)
1338 /*
1339 * This error code is only reported by firmware when the registered
1340 * driver instances requested to offloaded a flow but was unable to because
1341 * the requested key's hash collides with the installed keys.
1342 */
1343 #define HWRM_ERR_CODE_KEY_HASH_COLLISION UINT32_C(0xd)
1344 /*
1345 * This error code is only reported by firmware when the registered
1346 * driver instances requested to offloaded a flow but was unable to because
1347 * the same key has already been installed.
1348 */
1349 #define HWRM_ERR_CODE_KEY_ALREADY_EXISTS UINT32_C(0xe)
1350 /*
1351 * Generic HWRM execution error that represents an
1352 * internal error.
1353 */
1354 #define HWRM_ERR_CODE_HWRM_ERROR UINT32_C(0xf)
1355 /*
1356 * Firmware is unable to service the request at the present time. Caller
1357 * may try again later.
1358 */
1359 #define HWRM_ERR_CODE_BUSY UINT32_C(0x10)
1360 /*
1361 * This error code is reported by Firmware when an operation requested
1362 * by the host is not allowed due to a secure lock violation.
1363 */
1364 #define HWRM_ERR_CODE_RESOURCE_LOCKED UINT32_C(0x11)
1365 /*
1366 * This value indicates that the HWRM response is in TLV format and
1367 * should be interpreted as one or more TLVs starting with the
1368 * hwrm_resp_hdr TLV. This value is not an indication of any error
1369 * by itself, just an indication that the response should be parsed
1370 * as TLV and the actual error code will be in the hwrm_resp_hdr TLV.
1371 */
1372 #define HWRM_ERR_CODE_TLV_ENCAPSULATED_RESPONSE UINT32_C(0x8000)
1373 /* Unknown error */
1374 #define HWRM_ERR_CODE_UNKNOWN_ERR UINT32_C(0xfffe)
1375 /* Unsupported or invalid command */
1376 #define HWRM_ERR_CODE_CMD_NOT_SUPPORTED UINT32_C(0xffff)
1377 #define HWRM_ERR_CODE_LAST HWRM_ERR_CODE_CMD_NOT_SUPPORTED
1378 uint16_t unused_0[3];
1379 } ret_codes_t, *pret_codes_t;
1380
1381 #define GET_HWRM_ERROR_CODE(x) \
1382 (((x) < 0x80) ? \
1383 ((x) == 0x0 ? "SUCCESS": \
1384 ((x) == 0x1 ? "FAIL": \
1385 ((x) == 0x2 ? "INVALID_PARAMS": \
1386 ((x) == 0x3 ? "RESOURCE_ACCESS_DENIED": \
1387 ((x) == 0x4 ? "RESOURCE_ALLOC_ERROR": \
1388 ((x) == 0x5 ? "INVALID_FLAGS": \
1389 ((x) == 0x6 ? "INVALID_ENABLES": \
1390 ((x) == 0x7 ? "UNSUPPORTED_TLV": \
1391 ((x) == 0x8 ? "NO_BUFFER": \
1392 ((x) == 0x9 ? "UNSUPPORTED_OPTION_ERR": \
1393 ((x) == 0xa ? "HOT_RESET_PROGRESS": \
1394 ((x) == 0xb ? "HOT_RESET_FAIL": \
1395 ((x) == 0xc ? "NO_FLOW_COUNTER_DURING_ALLOC": \
1396 ((x) == 0xd ? "KEY_HASH_COLLISION": \
1397 ((x) == 0xe ? "KEY_ALREADY_EXISTS": \
1398 ((x) == 0xf ? "HWRM_ERROR": \
1399 ((x) == 0x10 ? "BUSY": \
1400 ((x) == 0x11 ? "RESOURCE_LOCKED": \
1401 "Unknown decode" )))))))))))))))))) : \
1402 (((x) < 0x8080) ? \
1403 ((x) == 0x8000 ? "TLV_ENCAPSULATED_RESPONSE": \
1404 "Unknown decode" ) : \
1405 (((x) <= 0xffff) ? \
1406 ((x) == 0xfffe ? "UNKNOWN_ERR": \
1407 ((x) == 0xffff ? "CMD_NOT_SUPPORTED": \
1408 "Unknown decode" )) : \
1409 "Unknown decode" )))
1410
1411
1412 /* Output */
1413 /* hwrm_err_output (size:128b/16B) */
1414
1415 typedef struct hwrm_err_output {
1416 /*
1417 * Pass/Fail or error type
1418 *
1419 * Note: receiver to verify the in parameters, and fail the call
1420 * with an error when appropriate
1421 */
1422 uint16_t error_code;
1423 /* This field returns the type of original request. */
1424 uint16_t req_type;
1425 /* This field provides original sequence number of the command. */
1426 uint16_t seq_id;
1427 /*
1428 * This field is the length of the response in bytes. The
1429 * last byte of the response is a valid flag that will read
1430 * as '1' when the command has been completely written to
1431 * memory.
1432 */
1433 uint16_t resp_len;
1434 /* debug info for this error response. */
1435 uint32_t opaque_0;
1436 /* debug info for this error response. */
1437 uint16_t opaque_1;
1438 /*
1439 * In the case of an error response, command specific error
1440 * code is returned in this field.
1441 */
1442 uint8_t cmd_err;
1443 /*
1444 * This field is used in Output records to indicate that the output
1445 * is completely written to RAM. This field should be read as '1'
1446 * to indicate that the output has been completely written.
1447 * When writing a command completion or response to an internal processor,
1448 * the order of writes has to be such that this field is written last.
1449 */
1450 uint8_t valid;
1451 } hwrm_err_output_t, *phwrm_err_output_t;
1452
1453 /*
1454 * Following is the signature for HWRM message field that indicates not
1455 * applicable (All F's). Need to cast it the size of the field if needed.
1456 */
1457 #define HWRM_NA_SIGNATURE ((uint32_t)(-1))
1458 /* hwrm_func_buf_rgtr */
1459 #define HWRM_MAX_REQ_LEN 128
1460 /* hwrm_cfa_flow_info */
1461 #define HWRM_MAX_RESP_LEN 704
1462 /* 7 bit indirection table index. */
1463 #define HW_HASH_INDEX_SIZE 0x80
1464 #define HW_HASH_KEY_SIZE 40
1465 /* valid key for HWRM response */
1466 #define HWRM_RESP_VALID_KEY 1
1467 /* Reserved for BONO processor */
1468 #define HWRM_TARGET_ID_BONO 0xFFF8
1469 /* Reserved for KONG processor */
1470 #define HWRM_TARGET_ID_KONG 0xFFF9
1471 /* Reserved for APE processor */
1472 #define HWRM_TARGET_ID_APE 0xFFFA
1473 /*
1474 * This value will be used by tools for User-space HWRM Interface.
1475 * When tool execute any HWRM command with this target_id, firmware
1476 * will copy the response and/or data payload via register space instead
1477 * of DMAing it.
1478 */
1479 #define HWRM_TARGET_ID_TOOLS 0xFFFD
1480 #define HWRM_VERSION_MAJOR 1
1481 #define HWRM_VERSION_MINOR 10
1482 #define HWRM_VERSION_UPDATE 2
1483 /* non-zero means beta version */
1484 #define HWRM_VERSION_RSVD 34
1485 #define HWRM_VERSION_STR "1.10.2.34"
1486
1487 /****************
1488 * hwrm_ver_get *
1489 ****************/
1490
1491
1492 /* hwrm_ver_get_input (size:192b/24B) */
1493
1494 typedef struct hwrm_ver_get_input {
1495 /* The HWRM command request type. */
1496 uint16_t req_type;
1497 /*
1498 * The completion ring to send the completion event on. This should
1499 * be the NQ ID returned from the `nq_alloc` HWRM command.
1500 */
1501 uint16_t cmpl_ring;
1502 /*
1503 * The sequence ID is used by the driver for tracking multiple
1504 * commands. This ID is treated as opaque data by the firmware and
1505 * the value is returned in the `hwrm_resp_hdr` upon completion.
1506 */
1507 uint16_t seq_id;
1508 /*
1509 * The target ID of the command:
1510 * * 0x0-0xFFF8 - The function ID
1511 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
1512 * * 0xFFFD - Reserved for user-space HWRM interface
1513 * * 0xFFFF - HWRM
1514 */
1515 uint16_t target_id;
1516 /*
1517 * A physical address pointer pointing to a host buffer that the
1518 * command's response data will be written. This can be either a host
1519 * physical address (HPA) or a guest physical address (GPA) and must
1520 * point to a physically contiguous block of memory.
1521 */
1522 uint64_t resp_addr;
1523 /*
1524 * This field represents the major version of HWRM interface
1525 * specification supported by the driver HWRM implementation.
1526 * The interface major version is intended to change only when
1527 * non backward compatible changes are made to the HWRM
1528 * interface specification.
1529 */
1530 uint8_t hwrm_intf_maj;
1531 /*
1532 * This field represents the minor version of HWRM interface
1533 * specification supported by the driver HWRM implementation.
1534 * A change in interface minor version is used to reflect
1535 * significant backward compatible modification to HWRM
1536 * interface specification.
1537 * This can be due to addition or removal of functionality.
1538 * HWRM interface specifications with the same major version
1539 * but different minor versions are compatible.
1540 */
1541 uint8_t hwrm_intf_min;
1542 /*
1543 * This field represents the update version of HWRM interface
1544 * specification supported by the driver HWRM implementation.
1545 * The interface update version is used to reflect minor
1546 * changes or bug fixes to a released HWRM interface
1547 * specification.
1548 */
1549 uint8_t hwrm_intf_upd;
1550 uint8_t unused_0[5];
1551 } hwrm_ver_get_input_t, *phwrm_ver_get_input_t;
1552
1553 /* hwrm_ver_get_output (size:1408b/176B) */
1554
1555 typedef struct hwrm_ver_get_output {
1556 /* The specific error status for the command. */
1557 uint16_t error_code;
1558 /* The HWRM command request type. */
1559 uint16_t req_type;
1560 /* The sequence ID from the original command. */
1561 uint16_t seq_id;
1562 /* The length of the response data in number of bytes. */
1563 uint16_t resp_len;
1564 /*
1565 * This field represents the major version of HWRM interface
1566 * specification supported by the HWRM implementation.
1567 * The interface major version is intended to change only when
1568 * non backward compatible changes are made to the HWRM
1569 * interface specification.
1570 * A HWRM implementation that is compliant with this
1571 * specification shall provide value of 1 in this field.
1572 */
1573 uint8_t hwrm_intf_maj_8b;
1574 /*
1575 * This field represents the minor version of HWRM interface
1576 * specification supported by the HWRM implementation.
1577 * A change in interface minor version is used to reflect
1578 * significant backward compatible modification to HWRM
1579 * interface specification.
1580 * This can be due to addition or removal of functionality.
1581 * HWRM interface specifications with the same major version
1582 * but different minor versions are compatible.
1583 * A HWRM implementation that is compliant with this
1584 * specification shall provide value of 2 in this field.
1585 */
1586 uint8_t hwrm_intf_min_8b;
1587 /*
1588 * This field represents the update version of HWRM interface
1589 * specification supported by the HWRM implementation.
1590 * The interface update version is used to reflect minor
1591 * changes or bug fixes to a released HWRM interface
1592 * specification.
1593 * A HWRM implementation that is compliant with this
1594 * specification shall provide value of 2 in this field.
1595 */
1596 uint8_t hwrm_intf_upd_8b;
1597 uint8_t hwrm_intf_rsvd_8b;
1598 /*
1599 * This field represents the major version of HWRM firmware.
1600 * A change in firmware major version represents a major
1601 * firmware release.
1602 */
1603 uint8_t hwrm_fw_maj_8b;
1604 /*
1605 * This field represents the minor version of HWRM firmware.
1606 * A change in firmware minor version represents significant
1607 * firmware functionality changes.
1608 */
1609 uint8_t hwrm_fw_min_8b;
1610 /*
1611 * This field represents the build version of HWRM firmware.
1612 * A change in firmware build version represents bug fixes
1613 * to a released firmware.
1614 */
1615 uint8_t hwrm_fw_bld_8b;
1616 /*
1617 * This field is a reserved field. This field can be used to
1618 * represent firmware branches or customer specific releases
1619 * tied to a specific (major,minor,update) version of the
1620 * HWRM firmware.
1621 */
1622 uint8_t hwrm_fw_rsvd_8b;
1623 /*
1624 * This field represents the major version of mgmt firmware.
1625 * A change in major version represents a major release.
1626 */
1627 uint8_t mgmt_fw_maj_8b;
1628 /*
1629 * This field represents the minor version of mgmt firmware.
1630 * A change in minor version represents significant
1631 * functionality changes.
1632 */
1633 uint8_t mgmt_fw_min_8b;
1634 /*
1635 * This field represents the build version of mgmt firmware.
1636 * A change in update version represents bug fixes.
1637 */
1638 uint8_t mgmt_fw_bld_8b;
1639 /*
1640 * This field is a reserved field. This field can be used to
1641 * represent firmware branches or customer specific releases
1642 * tied to a specific (major,minor,update) version
1643 */
1644 uint8_t mgmt_fw_rsvd_8b;
1645 /*
1646 * This field represents the major version of network
1647 * control firmware.
1648 * A change in major version represents a major release.
1649 */
1650 uint8_t netctrl_fw_maj_8b;
1651 /*
1652 * This field represents the minor version of network
1653 * control firmware.
1654 * A change in minor version represents significant
1655 * functionality changes.
1656 */
1657 uint8_t netctrl_fw_min_8b;
1658 /*
1659 * This field represents the build version of network
1660 * control firmware.
1661 * A change in update version represents bug fixes.
1662 */
1663 uint8_t netctrl_fw_bld_8b;
1664 /*
1665 * This field is a reserved field. This field can be used to
1666 * represent firmware branches or customer specific releases
1667 * tied to a specific (major,minor,update) version
1668 */
1669 uint8_t netctrl_fw_rsvd_8b;
1670 /*
1671 * This field is used to indicate device's capabilities and
1672 * configurations.
1673 */
1674 uint32_t dev_caps_cfg;
1675 /*
1676 * If set to 1, then secure firmware update behavior
1677 * is supported.
1678 * If set to 0, then secure firmware update behavior is
1679 * not supported.
1680 */
1681 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SECURE_FW_UPD_SUPPORTED UINT32_C(0x1)
1682 /*
1683 * If set to 1, then firmware based DCBX agent is supported.
1684 * If set to 0, then firmware based DCBX agent capability
1685 * is not supported on this device.
1686 */
1687 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FW_DCBX_AGENT_SUPPORTED UINT32_C(0x2)
1688 /*
1689 * If set to 1, then HWRM short command format is supported.
1690 * If set to 0, then HWRM short command format is not supported.
1691 */
1692 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_SUPPORTED UINT32_C(0x4)
1693 /*
1694 * If set to 1, then HWRM short command format is required.
1695 * If set to 0, then HWRM short command format is not required.
1696 */
1697 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_REQUIRED UINT32_C(0x8)
1698 /*
1699 * If set to 1, then the KONG host mailbox channel is supported.
1700 * If set to 0, then the KONG host mailbox channel is not supported.
1701 * By default, this flag should be 0 for older version of core firmware.
1702 */
1703 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_KONG_MB_CHNL_SUPPORTED UINT32_C(0x10)
1704 /*
1705 * If set to 1, then the 64bit flow handle is supported in addition to the
1706 * legacy 16bit flow handle. If set to 0, then the 64bit flow handle is not
1707 * supported. By default, this flag should be 0 for older version of core firmware.
1708 */
1709 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FLOW_HANDLE_64BIT_SUPPORTED UINT32_C(0x20)
1710 /*
1711 * If set to 1, then filter type can be provided in filter_alloc or filter_cfg
1712 * filter types like L2 for l2 traffic and ROCE for roce & l2 traffic.
1713 * If set to 0, then filter types not supported.
1714 * By default, this flag should be 0 for older version of core firmware.
1715 */
1716 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_L2_FILTER_TYPES_ROCE_OR_L2_SUPPORTED UINT32_C(0x40)
1717 /*
1718 * If set to 1, firmware is capable to support virtio vSwitch offload model.
1719 * If set to 0, firmware can't supported virtio vSwitch offload model.
1720 * By default, this flag should be 0 for older version of core firmware.
1721 */
1722 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_VIRTIO_VSWITCH_OFFLOAD_SUPPORTED UINT32_C(0x80)
1723 /*
1724 * If set to 1, firmware is capable to support trusted VF.
1725 * If set to 0, firmware is not capable to support trusted VF.
1726 * By default, this flag should be 0 for older version of core firmware.
1727 */
1728 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_TRUSTED_VF_SUPPORTED UINT32_C(0x100)
1729 /*
1730 * If set to 1, firmware is capable to support flow aging.
1731 * If set to 0, firmware is not capable to support flow aging.
1732 * By default, this flag should be 0 for older version of core firmware.
1733 */
1734 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FLOW_AGING_SUPPORTED UINT32_C(0x200)
1735 /*
1736 * If set to 1, firmware is capable to support advanced flow counters like,
1737 * Meter drop counters and EEM counters.
1738 * If set to 0, firmware is not capable to support advanced flow counters.
1739 * By default, this flag should be 0 for older version of core firmware.
1740 */
1741 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_ADV_FLOW_COUNTERS_SUPPORTED UINT32_C(0x400)
1742 /*
1743 * If set to 1, the firmware is able to support the use of the CFA
1744 * Extended Exact Match(EEM) feature.
1745 * If set to 0, firmware is not capable to support the use of the
1746 * CFA EEM feature.
1747 * By default, this flag should be 0 for older version of core firmware.
1748 */
1749 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_EEM_SUPPORTED UINT32_C(0x800)
1750 /*
1751 * If set to 1, the firmware is able to support advance CFA flow management
1752 * features reported in the HWRM_CFA_FLOW_MGNT_QCAPS.
1753 * If set to 0, then the firmware doesn’t support the advance CFA flow management
1754 * features.
1755 * By default, this flag should be 0 for older version of core firmware.
1756 */
1757 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_ADV_FLOW_MGNT_SUPPORTED UINT32_C(0x1000)
1758 /*
1759 * Deprecated and replaced with cfa_truflow_supported.
1760 * If set to 1, the firmware is able to support TFLIB features.
1761 * If set to 0, then the firmware doesn’t support TFLIB features.
1762 * By default, this flag should be 0 for older version of core firmware.
1763 */
1764 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_TFLIB_SUPPORTED UINT32_C(0x2000)
1765 /*
1766 * If set to 1, the firmware is able to support TruFlow features.
1767 * If set to 0, then the firmware doesn’t support TruFlow features.
1768 * By default, this flag should be 0 for older version of
1769 * core firmware.
1770 */
1771 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_TRUFLOW_SUPPORTED UINT32_C(0x4000)
1772 /*
1773 * This field represents the major version of RoCE firmware.
1774 * A change in major version represents a major release.
1775 */
1776 uint8_t roce_fw_maj_8b;
1777 /*
1778 * This field represents the minor version of RoCE firmware.
1779 * A change in minor version represents significant
1780 * functionality changes.
1781 */
1782 uint8_t roce_fw_min_8b;
1783 /*
1784 * This field represents the build version of RoCE firmware.
1785 * A change in update version represents bug fixes.
1786 */
1787 uint8_t roce_fw_bld_8b;
1788 /*
1789 * This field is a reserved field. This field can be used to
1790 * represent firmware branches or customer specific releases
1791 * tied to a specific (major,minor,update) version
1792 */
1793 uint8_t roce_fw_rsvd_8b;
1794 /*
1795 * This field represents the name of HWRM FW (ASCII chars
1796 * with NULL at the end).
1797 */
1798 char hwrm_fw_name[16];
1799 /*
1800 * This field represents the name of mgmt FW (ASCII chars
1801 * with NULL at the end).
1802 */
1803 char mgmt_fw_name[16];
1804 /*
1805 * This field represents the name of network control
1806 * firmware (ASCII chars with NULL at the end).
1807 */
1808 char netctrl_fw_name[16];
1809 /* This field represents the active board package name. */
1810 char active_pkg_name[16];
1811 /*
1812 * This field represents the name of RoCE FW (ASCII chars
1813 * with NULL at the end).
1814 */
1815 char roce_fw_name[16];
1816 /* This field returns the chip number. */
1817 uint16_t chip_num;
1818 /* This field returns the revision of chip. */
1819 uint8_t chip_rev;
1820 /* This field returns the chip metal number. */
1821 uint8_t chip_metal;
1822 /* This field returns the bond id of the chip. */
1823 uint8_t chip_bond_id;
1824 /* This value indicates the type of platform used for chip implementation. */
1825 uint8_t chip_platform_type;
1826 /* ASIC */
1827 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_ASIC UINT32_C(0x0)
1828 /* FPGA platform of the chip. */
1829 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_FPGA UINT32_C(0x1)
1830 /* Palladium platform of the chip. */
1831 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM UINT32_C(0x2)
1832 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_LAST HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM
1833 /*
1834 * This field returns the maximum value of request window that
1835 * is supported by the HWRM. The request window is mapped
1836 * into device address space using MMIO.
1837 */
1838 uint16_t max_req_win_len;
1839 /*
1840 * This field returns the maximum value of response buffer in
1841 * bytes.
1842 */
1843 uint16_t max_resp_len;
1844 /*
1845 * This field returns the default request timeout value in
1846 * milliseconds.
1847 */
1848 uint16_t def_req_timeout;
1849 /*
1850 * This field will indicate if any subsystems is not fully
1851 * initialized.
1852 */
1853 uint8_t flags;
1854 /*
1855 * If set to 1, it will indicate to host drivers that firmware is
1856 * not ready to start full blown HWRM commands. Host drivers should
1857 * re-try HWRM_VER_GET with some timeout period. The timeout period
1858 * can be selected up to 5 seconds. Host drivers should also check
1859 * for dev_not_rdy_backing_store to identify if flag is set due to
1860 * backing store not been available.
1861 * For Example, PCIe hot-plug:
1862 * Hot plug timing is system dependent. It generally takes up to
1863 * 600 miliseconds for firmware to clear DEV_NOT_RDY flag.
1864 * If set to 0, device is ready to accept all HWRM commands.
1865 */
1866 #define HWRM_VER_GET_OUTPUT_FLAGS_DEV_NOT_RDY UINT32_C(0x1)
1867 /*
1868 * If set to 1, external version present.
1869 * If set to 0, external version not present.
1870 */
1871 #define HWRM_VER_GET_OUTPUT_FLAGS_EXT_VER_AVAIL UINT32_C(0x2)
1872 /*
1873 * Firmware sets this flag along with dev_not_rdy flag to indicate
1874 * host drivers that it has not completed resource initialization
1875 * required for data path operations. Host drivers should not send
1876 * any HWRM command that requires data path resources. Firmware will
1877 * fail those commands with HWRM_ERR_CODE_BUSY. Host drivers can retry
1878 * those commands once both the flags are cleared.
1879 * If this flag and dev_not_rdy flag are set to 0, device is ready
1880 * to accept all HWRM commands.
1881 */
1882 #define HWRM_VER_GET_OUTPUT_FLAGS_DEV_NOT_RDY_BACKING_STORE UINT32_C(0x4)
1883 uint8_t unused_0[2];
1884 /*
1885 * For backward compatibility this field must be set to 1.
1886 * Older drivers might look for this field to be 1 before
1887 * processing the message.
1888 */
1889 uint8_t always_1;
1890 /*
1891 * This field represents the major version of HWRM interface
1892 * specification supported by the HWRM implementation.
1893 * The interface major version is intended to change only when
1894 * non backward compatible changes are made to the HWRM
1895 * interface specification. A HWRM implementation that is
1896 * compliant with this specification shall provide value of 1
1897 * in this field.
1898 */
1899 uint16_t hwrm_intf_major;
1900 /*
1901 * This field represents the minor version of HWRM interface
1902 * specification supported by the HWRM implementation.
1903 * A change in interface minor version is used to reflect
1904 * significant backward compatible modification to HWRM
1905 * interface specification. This can be due to addition or
1906 * removal of functionality. HWRM interface specifications
1907 * with the same major version but different minor versions are
1908 * compatible. A HWRM implementation that is compliant with
1909 * this specification shall provide value of 2 in this field.
1910 */
1911 uint16_t hwrm_intf_minor;
1912 /*
1913 * This field represents the update version of HWRM interface
1914 * specification supported by the HWRM implementation. The
1915 * interface update version is used to reflect minor changes or
1916 * bug fixes to a released HWRM interface specification.
1917 * A HWRM implementation that is compliant with this
1918 * specification shall provide value of 2 in this field.
1919 */
1920 uint16_t hwrm_intf_build;
1921 /*
1922 * This field represents the patch version of HWRM interface
1923 * specification supported by the HWRM implementation.
1924 */
1925 uint16_t hwrm_intf_patch;
1926 /*
1927 * This field represents the major version of HWRM firmware.
1928 * A change in firmware major version represents a major
1929 * firmware release.
1930 */
1931 uint16_t hwrm_fw_major;
1932 /*
1933 * This field represents the minor version of HWRM firmware.
1934 * A change in firmware minor version represents significant
1935 * firmware functionality changes.
1936 */
1937 uint16_t hwrm_fw_minor;
1938 /*
1939 * This field represents the build version of HWRM firmware.
1940 * A change in firmware build version represents bug fixes to
1941 * a released firmware.
1942 */
1943 uint16_t hwrm_fw_build;
1944 /*
1945 * This field is a reserved field.
1946 * This field can be used to represent firmware branches or customer
1947 * specific releases tied to a specific (major,minor,update) version
1948 * of the HWRM firmware.
1949 */
1950 uint16_t hwrm_fw_patch;
1951 /*
1952 * This field represents the major version of mgmt firmware.
1953 * A change in major version represents a major release.
1954 */
1955 uint16_t mgmt_fw_major;
1956 /*
1957 * This field represents the minor version of HWRM firmware.
1958 * A change in firmware minor version represents significant
1959 * firmware functionality changes.
1960 */
1961 uint16_t mgmt_fw_minor;
1962 /*
1963 * This field represents the build version of mgmt firmware.
1964 * A change in update version represents bug fixes.
1965 */
1966 uint16_t mgmt_fw_build;
1967 /*
1968 * This field is a reserved field. This field can be used to
1969 * represent firmware branches or customer specific releases
1970 * tied to a specific (major,minor,update) version.
1971 */
1972 uint16_t mgmt_fw_patch;
1973 /*
1974 * This field represents the major version of network control
1975 * firmware. A change in major version represents
1976 * a major release.
1977 */
1978 uint16_t netctrl_fw_major;
1979 /*
1980 * This field represents the minor version of network control
1981 * firmware. A change in minor version represents significant
1982 * functionality changes.
1983 */
1984 uint16_t netctrl_fw_minor;
1985 /*
1986 * This field represents the build version of network control
1987 * firmware. A change in update version represents bug fixes.
1988 */
1989 uint16_t netctrl_fw_build;
1990 /*
1991 * This field is a reserved field. This field can be used to
1992 * represent firmware branches or customer specific releases
1993 * tied to a specific (major,minor,update) version
1994 */
1995 uint16_t netctrl_fw_patch;
1996 /*
1997 * This field represents the major version of RoCE firmware.
1998 * A change in major version represents a major release.
1999 */
2000 uint16_t roce_fw_major;
2001 /*
2002 * This field represents the minor version of RoCE firmware.
2003 * A change in minor version represents significant
2004 * functionality changes.
2005 */
2006 uint16_t roce_fw_minor;
2007 /*
2008 * This field represents the build version of RoCE firmware.
2009 * A change in update version represents bug fixes.
2010 */
2011 uint16_t roce_fw_build;
2012 /*
2013 * This field is a reserved field. This field can be used to
2014 * represent firmware branches or customer specific releases
2015 * tied to a specific (major,minor,update) version
2016 */
2017 uint16_t roce_fw_patch;
2018 /*
2019 * This field returns the maximum extended request length acceptable
2020 * by the device which allows requests greater than mailbox size when
2021 * used with the short cmd request format.
2022 */
2023 uint16_t max_ext_req_len;
2024 uint8_t unused_1[5];
2025 /*
2026 * This field is used in Output records to indicate that the output
2027 * is completely written to RAM. This field should be read as '1'
2028 * to indicate that the output has been completely written.
2029 * When writing a command completion or response to an internal processor,
2030 * the order of writes has to be such that this field is written last.
2031 */
2032 uint8_t valid;
2033 } hwrm_ver_get_output_t, *phwrm_ver_get_output_t;
2034
2035 /* cfa_bds_read_cmd_data_msg (size:128b/16B) */
2036
2037 typedef struct cfa_bds_read_cmd_data_msg {
2038 /* This value selects the format for the mid-path command for the CFA. */
2039 uint8_t opcode;
2040 /*
2041 * This is read command. From 32 to 128B can be read from a table
2042 * using this command.
2043 */
2044 #define CFA_BDS_READ_CMD_DATA_MSG_OPCODE_READ UINT32_C(0x0)
2045 #define CFA_BDS_READ_CMD_DATA_MSG_OPCODE_LAST CFA_BDS_READ_CMD_DATA_MSG_OPCODE_READ
2046 /* This value selects the table type to be acted upon. */
2047 uint8_t table_type;
2048 /* This value selects the table type to be acted upon. */
2049 #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_MASK UINT32_C(0xf)
2050 #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_SFT 0
2051 /* This command acts on the action table of the specified scope. */
2052 #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_ACTION UINT32_C(0x0)
2053 /* This command acts on the exact match table of the specified scope. */
2054 #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_EM UINT32_C(0x1)
2055 #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_LAST CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_EM
2056 /* This value selects which table scope will be accessed. */
2057 uint8_t table_scope;
2058 #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
2059 #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
2060 /*
2061 * This value identifies the number of 32B units will be accessed. A
2062 * value of zero is invalid. Maximum value is 4.
2063 */
2064 uint8_t data_size;
2065 #define CFA_BDS_READ_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
2066 #define CFA_BDS_READ_CMD_DATA_MSG_DATA_SIZE_SFT 0
2067 /* This is the 32B index into the selected table to access. */
2068 uint32_t table_index;
2069 #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_INDEX_MASK UINT32_C(0x3ffffff)
2070 #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_INDEX_SFT 0
2071 /*
2072 * This is the 64b host address where you want the data returned to. The
2073 * data will be written to the same function as the one that owns the SQ
2074 * this command is read from. The bottom two bits of this value must be
2075 * zero. The size of the write is controlled by the data_size field.
2076 */
2077 uint64_t host_address;
2078 } cfa_bds_read_cmd_data_msg_t, *pcfa_bds_read_cmd_data_msg_t;
2079
2080 /* cfa_bds_write_cmd_data_msg (size:1152b/144B) */
2081
2082 typedef struct cfa_bds_write_cmd_data_msg {
2083 /* This value selects the format for the mid-path command for the CFA. */
2084 uint8_t opcode;
2085 /*
2086 * This is write command. From 32 to 128B can be written to a table
2087 * using this command.
2088 */
2089 #define CFA_BDS_WRITE_CMD_DATA_MSG_OPCODE_WRITE UINT32_C(0x1)
2090 #define CFA_BDS_WRITE_CMD_DATA_MSG_OPCODE_LAST CFA_BDS_WRITE_CMD_DATA_MSG_OPCODE_WRITE
2091 /* This value selects the table type to be acted upon. */
2092 uint8_t write_thru_table_type;
2093 /* This value selects the table type to be acted upon. */
2094 #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_MASK UINT32_C(0xf)
2095 #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_SFT 0
2096 /* This command acts on the action table of the specified scope. */
2097 #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_ACTION UINT32_C(0x0)
2098 /* This command acts on the exact match table of the specified scope. */
2099 #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_EM UINT32_C(0x1)
2100 #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_LAST CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_EM
2101 /*
2102 * Indicates write-through control. Indicates write-through when set,
2103 * or write back when cleared.
2104 */
2105 #define CFA_BDS_WRITE_CMD_DATA_MSG_WRITE_THRU UINT32_C(0x10)
2106 /* This value selects which table scope will be accessed. */
2107 uint8_t table_scope;
2108 #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
2109 #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
2110 /*
2111 * This value identifies the number of 32B units will be accessed. A
2112 * value of zero is invalid. Maximum value is 4.
2113 */
2114 uint8_t data_size;
2115 #define CFA_BDS_WRITE_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
2116 #define CFA_BDS_WRITE_CMD_DATA_MSG_DATA_SIZE_SFT 0
2117 /* This is the 32B index into the selected table to access. */
2118 uint32_t table_index;
2119 #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_INDEX_MASK UINT32_C(0x3ffffff)
2120 #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_INDEX_SFT 0
2121 uint32_t unused0;
2122 uint32_t unused1;
2123 /*
2124 * This is the data to be written. Data length is determined by the
2125 * data_size field. The bd_cnt in the encapsulating BD must also be set
2126 * correctly to ensure that the BD is processed correctly and the full
2127 * WRITE_CMD message is extracted from the BD.
2128 */
2129 uint32_t dta[32];
2130 } cfa_bds_write_cmd_data_msg_t, *pcfa_bds_write_cmd_data_msg_t;
2131
2132 /* cfa_bds_read_clr_cmd_data_msg (size:256b/32B) */
2133
2134 typedef struct cfa_bds_read_clr_cmd_data_msg {
2135 /* This value selects the format for the mid-path command for the CFA. */
2136 uint8_t opcode;
2137 /*
2138 * This is read-clear command. 32B can be read from a table and
2139 * a 16b mask can be used to clear specific 16b units after the
2140 * read as an atomic operation.
2141 */
2142 #define CFA_BDS_READ_CLR_CMD_DATA_MSG_OPCODE_READ_CLR UINT32_C(0x2)
2143 #define CFA_BDS_READ_CLR_CMD_DATA_MSG_OPCODE_LAST CFA_BDS_READ_CLR_CMD_DATA_MSG_OPCODE_READ_CLR
2144 /* This value selects the table type to be acted upon. */
2145 uint8_t table_type;
2146 /* This value selects the table type to be acted upon. */
2147 #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_MASK UINT32_C(0xf)
2148 #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_SFT 0
2149 /* This command acts on the action table of the specified scope. */
2150 #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_ACTION UINT32_C(0x0)
2151 /* This command acts on the exact match table of the specified scope. */
2152 #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_EM UINT32_C(0x1)
2153 #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_LAST CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_EM
2154 /* This value selects which table scope will be accessed. */
2155 uint8_t table_scope;
2156 #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
2157 #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
2158 /*
2159 * This value identifies the number of 32B units will be accessed.
2160 * Always set the value to 1.
2161 */
2162 uint8_t data_size;
2163 #define CFA_BDS_READ_CLR_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
2164 #define CFA_BDS_READ_CLR_CMD_DATA_MSG_DATA_SIZE_SFT 0
2165 /* This is the 32B index into the selected table to access. */
2166 uint32_t table_index;
2167 #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_INDEX_MASK UINT32_C(0x3ffffff)
2168 #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_INDEX_SFT 0
2169 /*
2170 * This is the 64b host address where you want the data returned to. The
2171 * data will be written to the same function as the one that owns the SQ
2172 * this command is read from. The bottom two bits of this value must be
2173 * zero. The size of the write is controlled by the data_size field.
2174 */
2175 uint64_t host_address;
2176 /*
2177 * This is active high clear mask for the 32B of data that this command
2178 * can read. Bit 0 of the field will clear bits 15:0 of the first word
2179 * of data read when set to '1'.
2180 */
2181 uint16_t clear_mask;
2182 uint16_t unused0[3];
2183 uint16_t unused1[4];
2184 } cfa_bds_read_clr_cmd_data_msg_t, *pcfa_bds_read_clr_cmd_data_msg_t;
2185
2186 /* cfa_bds_em_insert_cmd_data_msg (size:1152b/144B) */
2187
2188 typedef struct cfa_bds_em_insert_cmd_data_msg {
2189 /* This value selects the format for the mid-path command for the CFA. */
2190 uint8_t opcode;
2191 /*
2192 * An exact match table insert will be attempted into the table.
2193 * If there is a free location in the bucket, the payload will
2194 * be written to the bucket.
2195 */
2196 #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_OPCODE_EM_INSERT UINT32_C(0x3)
2197 #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_OPCODE_LAST CFA_BDS_EM_INSERT_CMD_DATA_MSG_OPCODE_EM_INSERT
2198 /*
2199 * Indicates write-through control. Indicates write-through when set,
2200 * or write back when cleared.
2201 */
2202 uint8_t write_thru;
2203 #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_UNUSED_MASK UINT32_C(0xf)
2204 #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_UNUSED_SFT 0
2205 /*
2206 * Indicates write-through control. Indicates write-through when set,
2207 * or write back when cleared.
2208 */
2209 #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_WRITE_THRU UINT32_C(0x10)
2210 /* This value selects which table scope will be accessed. */
2211 uint8_t table_scope;
2212 #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
2213 #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
2214 /*
2215 * This value identifies the number of 32B units will be accessed. A
2216 * value of zero is invalid. Maximum value is 4.
2217 */
2218 uint8_t data_size;
2219 #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
2220 #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_DATA_SIZE_SFT 0
2221 /* This is the 32B index into the selected table to access. */
2222 uint32_t table_index;
2223 #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_TABLE_INDEX_MASK UINT32_C(0x3ffffff)
2224 #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_TABLE_INDEX_SFT 0
2225 /*
2226 * This is the 64b host address where you want the data returned to. The
2227 * data will be written to the same function as the one that owns the SQ
2228 */
2229 uint64_t host_address;
2230 /*
2231 * This is the Exact Match Lookup Record. Data length is determined by
2232 * the data_size field. The bd_cnt in the encapsulating BD must also be
2233 */
2234 uint32_t dta[32];
2235 } cfa_bds_em_insert_cmd_data_msg_t, *pcfa_bds_em_insert_cmd_data_msg_t;
2236
2237 /* cfa_bds_em_delete_cmd_data_msg (size:256b/32B) */
2238
2239 typedef struct cfa_bds_em_delete_cmd_data_msg {
2240 /* This value selects the format for the mid-path command for the CFA. */
2241 uint8_t opcode;
2242 /* An exact match table delete will be attempted. */
2243 #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_OPCODE_EM_DELETE UINT32_C(0x4)
2244 #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_OPCODE_LAST CFA_BDS_EM_DELETE_CMD_DATA_MSG_OPCODE_EM_DELETE
2245 /*
2246 * Indicates write-through control. Indicates write-through when set,
2247 * or write back when cleared.
2248 */
2249 uint8_t write_thru;
2250 #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_UNUSED_MASK UINT32_C(0xf)
2251 #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_UNUSED_SFT 0
2252 /*
2253 * Indicates write-through control. Indicates write-through when set,
2254 * or write back when cleared.
2255 */
2256 #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_WRITE_THRU UINT32_C(0x10)
2257 /* This value selects which table scope will be accessed. */
2258 uint8_t table_scope;
2259 #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
2260 #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
2261 /*
2262 * This value identifies the number of 32B units will be accessed. A
2263 * value of zero is invalid. Maximum value is 4.
2264 */
2265 uint8_t data_size;
2266 #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
2267 #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_DATA_SIZE_SFT 0
2268 uint32_t unused0;
2269 /*
2270 * This is the 64b host address where you want the data returned to. The
2271 * data will be written to the same function as the one that owns the SQ
2272 */
2273 uint64_t host_address;
2274 /*
2275 * This is the Exact Match Lookup Record. Data length is determined by
2276 * the data_size field. The bd_cnt in the encapsulating BD must also be
2277 */
2278 uint64_t dta;
2279 uint64_t unused1;
2280 } cfa_bds_em_delete_cmd_data_msg_t, *pcfa_bds_em_delete_cmd_data_msg_t;
2281
2282 /* cfa_bds_invalidate_cmd_data_msg (size:128b/16B) */
2283
2284 typedef struct cfa_bds_invalidate_cmd_data_msg {
2285 /* This value selects the format for the mid-path command for the CFA. */
2286 uint8_t opcode;
2287 /*
2288 * The specified table area will be invalidated. If it is needed.
2289 * again, it will be read from the backing store.
2290 */
2291 #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_OPCODE_INVALIDATE UINT32_C(0x5)
2292 #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_OPCODE_LAST CFA_BDS_INVALIDATE_CMD_DATA_MSG_OPCODE_INVALIDATE
2293 /* This value selects the table type to be acted upon. */
2294 uint8_t table_type;
2295 /* This value selects the table type to be acted upon. */
2296 #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_MASK UINT32_C(0xf)
2297 #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_SFT 0
2298 /* This command acts on the action table of the specified scope. */
2299 #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_ACTION UINT32_C(0x0)
2300 /* This command acts on the exact match table of the specified scope. */
2301 #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_EM UINT32_C(0x1)
2302 #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_LAST CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_EM
2303 /* This value selects which table scope will be accessed. */
2304 uint8_t table_scope;
2305 #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
2306 #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
2307 /* This value specifies the number of cache lines to invalidate. */
2308 uint8_t data_size;
2309 #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
2310 #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_DATA_SIZE_SFT 0
2311 /* This is the 32B index into the selected table to access. */
2312 uint32_t table_index;
2313 #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_INDEX_MASK UINT32_C(0x3ffffff)
2314 #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_INDEX_SFT 0
2315 uint64_t unused;
2316 } cfa_bds_invalidate_cmd_data_msg_t, *pcfa_bds_invalidate_cmd_data_msg_t;
2317
2318 /* cfa_bds_event_collect_cmd_data_msg (size:128b/16B) */
2319
2320 typedef struct cfa_bds_event_collect_cmd_data_msg {
2321 /* This value selects the format for the mid-path command for the CFA. */
2322 uint8_t opcode;
2323 /* Reads notification messages from the Host Notification Queue. */
2324 #define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_OPCODE_EVENT_COLLECT UINT32_C(0x6)
2325 #define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_OPCODE_LAST CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_OPCODE_EVENT_COLLECT
2326 uint8_t unused0;
2327 /* This value selects which table scope will be accessed. */
2328 uint8_t table_scope;
2329 #define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
2330 #define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
2331 /*
2332 * This value identifies the number of 32B units will be accessed. A
2333 * value of zero is invalid. Maximum value is 4.
2334 */
2335 uint8_t data_size;
2336 #define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
2337 #define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_DATA_SIZE_SFT 0
2338 uint32_t unused1;
2339 /*
2340 * This is the 64b host address where you want the data returned to. The
2341 * data will be written to the same function as the one that owns the SQ
2342 */
2343 uint64_t host_address;
2344 } cfa_bds_event_collect_cmd_data_msg_t, *pcfa_bds_event_collect_cmd_data_msg_t;
2345
2346 /* ce_bds_add_data_msg (size:512b/64B) */
2347
2348 typedef struct ce_bds_add_data_msg {
2349 uint32_t version_algorithm_kid_opcode;
2350 /*
2351 * This value selects the operation for the mid-path command for the
2352 * crypto blocks.
2353 */
2354 #define CE_BDS_ADD_DATA_MSG_OPCODE_MASK UINT32_C(0xf)
2355 #define CE_BDS_ADD_DATA_MSG_OPCODE_SFT 0
2356 /*
2357 * This is the add command. Using this opcode, Host Driver can add
2358 * information required for kTLS processing. The information is
2359 * updated in the CFCK context.
2360 */
2361 #define CE_BDS_ADD_DATA_MSG_OPCODE_ADD UINT32_C(0x1)
2362 #define CE_BDS_ADD_DATA_MSG_OPCODE_LAST CE_BDS_ADD_DATA_MSG_OPCODE_ADD
2363 /*
2364 * This field is the Crypto Context ID. The KID is used to store
2365 * information used by the associated kTLS offloaded connection.
2366 */
2367 #define CE_BDS_ADD_DATA_MSG_KID_MASK UINT32_C(0xfffff0)
2368 #define CE_BDS_ADD_DATA_MSG_KID_SFT 4
2369 /*
2370 * Currently only two algorithms are supported, AES_GCM_128 and
2371 * AES_GCM_256. Additional bits for future growth.
2372 */
2373 #define CE_BDS_ADD_DATA_MSG_ALGORITHM_MASK UINT32_C(0xf000000)
2374 #define CE_BDS_ADD_DATA_MSG_ALGORITHM_SFT 24
2375 /* AES_GCM_128 Algorithm */
2376 #define CE_BDS_ADD_DATA_MSG_ALGORITHM_AES_GCM_128 UINT32_C(0x1000000)
2377 /* AES_GCM_256 Algorithm */
2378 #define CE_BDS_ADD_DATA_MSG_ALGORITHM_AES_GCM_256 UINT32_C(0x2000000)
2379 /*
2380 * Version number of TLS connection. HW will provide registers that
2381 * converts the 4b encoded version number to 16b of actual version
2382 * number in the TLS Header. * Initialized --> By mid-path command *
2383 * Updated --> Never though another mid-path command will result in an
2384 * update.
2385 */
2386 #define CE_BDS_ADD_DATA_MSG_VERSION_MASK UINT32_C(0xf0000000)
2387 #define CE_BDS_ADD_DATA_MSG_VERSION_SFT 28
2388 /* TLS1.2 Version */
2389 #define CE_BDS_ADD_DATA_MSG__TLS1_2 (UINT32_C(0x0) << 28)
2390 /* TLS1.3 Version */
2391 #define CE_BDS_ADD_DATA_MSG__TLS1_3 (UINT32_C(0x1) << 28)
2392 #define CE_BDS_ADD_DATA_MSG__LAST CE_BDS_ADD_DATA_MSG__TLS1_3
2393 /*
2394 * Command Type in the TLS header. HW will provide registers that
2395 * converts the 3b encoded command type to 8b of actual command type in
2396 * the TLS Header. * Initialized --> By mid-path command * Updated -->
2397 * Never though another mid-path command will result in an update
2398 */
2399 uint8_t cmd_type;
2400 #define CE_BDS_ADD_DATA_MSG_CMD_TYPE_MASK UINT32_C(0x7)
2401 #define CE_BDS_ADD_DATA_MSG_CMD_TYPE_SFT 0
2402 /* Application */
2403 #define CE_BDS_ADD_DATA_MSG_CMD_TYPE_APP UINT32_C(0x0)
2404 #define CE_BDS_ADD_DATA_MSG_CMD_TYPE_LAST CE_BDS_ADD_DATA_MSG_CMD_TYPE_APP
2405 uint8_t unused0[3];
2406 /*
2407 * Salt is part of the nonce that is used as the Initial Vector (IV) in
2408 * AES-GCM cipher suites. These are exchanged as part of the handshake
2409 * process and is either the client_write_iv (when the client is
2410 * sending) or server_write_iv (when the server is sending). In
2411 * TLS1.2, 4B of Salt is concatenated with 8B of explicit_nonce to
2412 * generate the 12B of IV. In TLS1.3, 8B of TLS record sequence number
2413 * is zero padded to 12B and then xor'ed with the 4B of salt to generate
2414 * the 12B of IV. This value is initialized by this mid-path command.
2415 */
2416 uint32_t salt;
2417 uint32_t unused1;
2418 /*
2419 * This field keeps track of the TCP sequence number that is expected as
2420 * the first byte in the next TCP packet. This field is calculated by HW
2421 * using the output of the parser. The field is initialized as part of
2422 * the Mid-path BD download/update of a kTLS connection. For every TCP
2423 * packet processed, TCE HW will update the value to Current packet TCP
2424 * sequence number + Current packet TCP Payload Length.
2425 */
2426 uint32_t pkt_tcp_seq_num;
2427 /*
2428 * This field maintains the TCP sequence number of the first byte in the
2429 * header of the active TLS record. This field is initialized as part of
2430 * the Mid-path BD download/update of a kTLS connection. For every
2431 * record that is processed, TCE HW copies the value from the
2432 * next_tls_header_tcp_seq_num field.
2433 */
2434 uint32_t tls_header_tcp_seq_num;
2435 /*
2436 * This is sequence number for the TLS record in a particular session.
2437 * In TLS1.2, record sequence number is part of the Associated Data (AD)
2438 * in the AEAD algorithm. In TLS1.3, record sequence number is part of
2439 * the Initial Vector (IV). The field is initialized as part of the
2440 * mid-path BD download/update of a kTLS connection. TCE HW increments
2441 * the field after that for every record processed as it parses the TCP
2442 * packet.
2443 */
2444 uint64_t record_seq_num;
2445 /*
2446 * Key used for encrypting or decrypting TLS records. The Key is
2447 * exchanged during the hand-shake protocol by the client-server and
2448 * provided to HW through this mid-path BD.
2449 */
2450 uint32_t session_key[8];
2451 } ce_bds_add_data_msg_t, *pce_bds_add_data_msg_t;
2452
2453 /* ce_bds_delete_data_msg (size:64b/8B) */
2454
2455 typedef struct ce_bds_delete_data_msg {
2456 uint32_t kid_opcode;
2457 /*
2458 * This value selects the operation for the mid-path command for the
2459 * crypto blocks.
2460 */
2461 #define CE_BDS_DELETE_DATA_MSG_OPCODE_MASK UINT32_C(0xf)
2462 #define CE_BDS_DELETE_DATA_MSG_OPCODE_SFT 0
2463 /*
2464 * This is the delete command. Using this opcode, the host Driver
2465 * can remove a key context from the CFCK. If context is deleted
2466 * and packets with the same KID come through the pipeline, the
2467 * following actions are taken. For transmit packets, no crypto
2468 * operation will be performed, payload will be zero'ed out. For
2469 * receive packets, no crypto operation will be performed,
2470 * payload will be unmodified.
2471 */
2472 #define CE_BDS_DELETE_DATA_MSG_OPCODE_DELETE UINT32_C(0x2)
2473 #define CE_BDS_DELETE_DATA_MSG_OPCODE_LAST CE_BDS_DELETE_DATA_MSG_OPCODE_DELETE
2474 /*
2475 * This field is the Crypto Context ID. The KID is used to store
2476 * information used by the associated kTLS offloaded connection.
2477 */
2478 #define CE_BDS_DELETE_DATA_MSG_KID_MASK UINT32_C(0xfffff0)
2479 #define CE_BDS_DELETE_DATA_MSG_KID_SFT 4
2480 uint32_t unused0;
2481 } ce_bds_delete_data_msg_t, *pce_bds_delete_data_msg_t;
2482
2483 /* ce_bds_resync_resp_ack_msg (size:128b/16B) */
2484
2485 typedef struct ce_bds_resync_resp_ack_msg {
2486 uint32_t resync_status_kid_opcode;
2487 /*
2488 * This value selects the operation for the mid-path command for the
2489 * crypto blocks.
2490 */
2491 #define CE_BDS_RESYNC_RESP_ACK_MSG_OPCODE_MASK UINT32_C(0xf)
2492 #define CE_BDS_RESYNC_RESP_ACK_MSG_OPCODE_SFT 0
2493 /*
2494 * This command is used by the driver as a response to the resync
2495 * request sent by the crypto engine.
2496 */
2497 #define CE_BDS_RESYNC_RESP_ACK_MSG_OPCODE_RESYNC UINT32_C(0x3)
2498 #define CE_BDS_RESYNC_RESP_ACK_MSG_OPCODE_LAST CE_BDS_RESYNC_RESP_ACK_MSG_OPCODE_RESYNC
2499 /*
2500 * This field is the Crypto Context ID. The KID is used to store
2501 * information used by the associated kTLS offloaded connection.
2502 */
2503 #define CE_BDS_RESYNC_RESP_ACK_MSG_KID_MASK UINT32_C(0xfffff0)
2504 #define CE_BDS_RESYNC_RESP_ACK_MSG_KID_SFT 4
2505 /*
2506 * This field indicates if the resync request resulted in a success or
2507 * a failure.
2508 */
2509 #define CE_BDS_RESYNC_RESP_ACK_MSG_RESYNC_STATUS UINT32_C(0x1000000)
2510 /*
2511 * An ACK indicates that the driver was able to find the TLS record
2512 * associated with TCP sequence number provided by the HW
2513 */
2514 #define CE_BDS_RESYNC_RESP_ACK_MSG_RESYNC_STATUS_ACK (UINT32_C(0x0) << 24)
2515 #define CE_BDS_RESYNC_RESP_ACK_MSG_RESYNC_STATUS_LAST CE_BDS_RESYNC_RESP_ACK_MSG_RESYNC_STATUS_ACK
2516 /*
2517 * This field is the echo of the TCP sequence number provided in the
2518 * resync request by the HW. If HW sent multiple resync requests, it
2519 * only tracks the latest TCP sequence number. When the response from
2520 * the Driver doesn't match the latest request, HW will drop the resync
2521 * response.
2522 */
2523 uint32_t resync_record_tcp_seq_num;
2524 /*
2525 * This field indicates the TLS record sequence number associated with
2526 * the resync request. HW will take this number and add the delta records
2527 * it has found since sending the resync request, update the context and
2528 * resume decrypting records.
2529 */
2530 uint64_t resync_record_seq_num;
2531 } ce_bds_resync_resp_ack_msg_t, *pce_bds_resync_resp_ack_msg_t;
2532
2533 /* ce_bds_resync_resp_nack_msg (size:64b/8B) */
2534
2535 typedef struct ce_bds_resync_resp_nack_msg {
2536 uint32_t resync_status_kid_opcode;
2537 /*
2538 * This value selects the operation for the mid-path command for the
2539 * crypto blocks.
2540 */
2541 #define CE_BDS_RESYNC_RESP_NACK_MSG_OPCODE_MASK UINT32_C(0xf)
2542 #define CE_BDS_RESYNC_RESP_NACK_MSG_OPCODE_SFT 0
2543 /*
2544 * This command is used by the driver as a response to the resync
2545 * request sent by the crypto engine.
2546 */
2547 #define CE_BDS_RESYNC_RESP_NACK_MSG_OPCODE_RESYNC UINT32_C(0x3)
2548 #define CE_BDS_RESYNC_RESP_NACK_MSG_OPCODE_LAST CE_BDS_RESYNC_RESP_NACK_MSG_OPCODE_RESYNC
2549 /*
2550 * This field is the Crypto Context ID. The KID is used to store
2551 * information used by the associated kTLS offloaded connection.
2552 */
2553 #define CE_BDS_RESYNC_RESP_NACK_MSG_KID_MASK UINT32_C(0xfffff0)
2554 #define CE_BDS_RESYNC_RESP_NACK_MSG_KID_SFT 4
2555 /*
2556 * This field indicates if the resync request resulted in a success or
2557 * a failure.
2558 */
2559 #define CE_BDS_RESYNC_RESP_NACK_MSG_RESYNC_STATUS UINT32_C(0x1000000)
2560 /*
2561 * An NAK indicates that the driver wasn't able to find the TLS
2562 * record associated with TCP sequence number provided by the HW
2563 */
2564 #define CE_BDS_RESYNC_RESP_NACK_MSG_RESYNC_STATUS_NACK (UINT32_C(0x1) << 24)
2565 #define CE_BDS_RESYNC_RESP_NACK_MSG_RESYNC_STATUS_LAST CE_BDS_RESYNC_RESP_NACK_MSG_RESYNC_STATUS_NACK
2566 /*
2567 * This field is the echo of the TCP sequence number provided in the
2568 * resync request by the HW. If HW sent multiple resync requests, it
2569 * only tracks the latest TCP sequence number. When the response from
2570 * the Driver doesn't match the latest request, HW will drop the resync
2571 * response.
2572 */
2573 uint32_t resync_record_tcp_seq_num;
2574 } ce_bds_resync_resp_nack_msg_t, *pce_bds_resync_resp_nack_msg_t;
2575
2576 /* crypto_presync_bd_cmd (size:256b/32B) */
2577
2578 typedef struct crypto_presync_bd_cmd {
2579 uint8_t flags;
2580 /*
2581 * Typically, presync BDs are used for packet retransmissions. Source
2582 * port sends all the packets in order over the network to destination
2583 * port and packets get dropped in the network. The destination port
2584 * will request retranmission of dropped packets and source port driver
2585 * will send presync BD to setup the transmitter appropriately. It will
2586 * provide the start and end TCP sequence number of the data to be
2587 * transmitted. HW keeps two sets of context variable, one for in order
2588 * traffic and one for retransmission traffic. HW is designed to
2589 * transmit everything posted in the presync BD and return to in order
2590 * mode after that. No inorder context variables are updated in the
2591 * process. There is a special case where packets can be dropped
2592 * between the TCP stack and Device Driver (Berkeley Packet Filter for
2593 * ex) and HW still needs to transmit rest of the traffic. In this
2594 * mode, driver will send a presync BD as if it is a retransmission but
2595 * at the end of the transmission, the in order variables need to be
2596 * updated. This flag is used by driver to indicate that in order
2597 * variables needs to be updated at the end of completing the task
2598 * associated with the presync BD.
2599 */
2600 #define CRYPTO_PRESYNC_BD_CMD_FLAGS_UPDATE_IN_ORDER_VAR UINT32_C(0x1)
2601 uint8_t unused0;
2602 uint16_t unused1;
2603 /*
2604 * This field maintains the TCP sequence number of the first byte in the
2605 * Header of the active TLS record. This field is set to 0 during
2606 * mid-path BD updates, but is set to correct value when a presync BD is
2607 * detected. For every record that is processed, the value from the
2608 * next_tls_header_tcp_seq_num field is copied.
2609 */
2610 uint32_t header_tcp_seq_num;
2611 /*
2612 * When a retransmitted packet has a TLS authentication TAG present and
2613 * the data spans multiple TCP Packets, HW is required to read the entire
2614 * record to recalculate the TAG but only transmit what is required. This
2615 * field is the start TCP sequence number of the packet(s) that need to
2616 * be re-transmitted. This field is initialized to 0 during Mid-path BD
2617 * add command and initialized to value provided by the driver when
2618 * Pre-sync BD is detected. This field is never updated unless another
2619 * Pre-sync BD signaling a new retransmission is scheduled.
2620 */
2621 uint32_t start_tcp_seq_num;
2622 /*
2623 * When a retransmitted packet has a TLS authentication TAG present and
2624 * the data spans multiple TCP Packets, HW is required to read the
2625 * entire record to recalculate the TAG but only transmit what is
2626 * required. This field is the end TCP sequence number of the packet(s)
2627 * that need to be re-transmitted. This field is initialized to 0 during
2628 * Mid-path BD add command and initialized to value provided by the
2629 * driver when Pre-sync BD is detected. This field is never updated
2630 * unless another Pre-sync BD signaling a new retransmission is
2631 * scheduled.
2632 */
2633 uint32_t end_tcp_seq_num;
2634 /*
2635 * For TLS1.2, an explicit nonce is used as part of the IV (concatenated
2636 * with the SALT). For retans packets, this field is extracted from the
2637 * TLS record, field right after the TLS Header and stored in the
2638 * context. This field needs to be stored in context as TCP segmentation
2639 * could have split the field into multiple TCP packets. This value is
2640 * initialized to 0 when presync BD is detected by taking the value from
2641 * the first TLS header. When subsequent TLS Headers are detected, the
2642 * value is extracted from packet.
2643 */
2644 uint64_t explicit_nonce;
2645 /*
2646 * This is sequence number for the TLS record in a particular session. In
2647 * TLS1.2, record sequence number is part of the Associated Data (AD) in
2648 * the AEAD algorithm. In TLS1.3, record sequence number is part of the
2649 * Initial Vector (IV). The field is initialized to 0 during Mid-path BD
2650 * download. Is initialized to correct value when a pre-sync BD is
2651 * detected. TCE HW increments the field after that for every record
2652 * processed as it parses the TCP packet. Subsequent pre-sync BDs
2653 * delivering more retransmission instruction will also update this
2654 * field.
2655 */
2656 uint64_t record_seq_num;
2657 } crypto_presync_bd_cmd_t, *pcrypto_presync_bd_cmd_t;
2658
2659 /* bd_base (size:64b/8B) */
2660
2661 typedef struct bd_base {
2662 uint8_t type;
2663 /* This value identifies the type of buffer descriptor. */
2664 #define BD_BASE_TYPE_MASK UINT32_C(0x3f)
2665 #define BD_BASE_TYPE_SFT 0
2666 /*
2667 * Indicates that this BD is 16B long and is used for
2668 * normal L2 packet transmission.
2669 */
2670 #define BD_BASE_TYPE_TX_BD_SHORT UINT32_C(0x0)
2671 /*
2672 * Indicates that this BD is 1BB long and is an empty
2673 * TX BD. Not valid for use by the driver.
2674 */
2675 #define BD_BASE_TYPE_TX_BD_EMPTY UINT32_C(0x1)
2676 /*
2677 * Indicates that this BD is 16B long and is an RX Producer
2678 * (i.e. empty) buffer descriptor.
2679 */
2680 #define BD_BASE_TYPE_RX_PROD_PKT UINT32_C(0x4)
2681 /*
2682 * Indicates that this BD is 16B long and is an RX
2683 * Producer Buffer BD.
2684 */
2685 #define BD_BASE_TYPE_RX_PROD_BFR UINT32_C(0x5)
2686 /*
2687 * Indicates that this BD is 16B long and is an
2688 * RX Producer Assembly Buffer Descriptor.
2689 */
2690 #define BD_BASE_TYPE_RX_PROD_AGG UINT32_C(0x6)
2691 /*
2692 * Indicates that this BD is used to issue a command to one of
2693 * the mid-path destinations.
2694 */
2695 #define BD_BASE_TYPE_TX_BD_MP_CMD UINT32_C(0x8)
2696 /*
2697 * Indicates that this BD is used to issue a cryptographic pre-
2698 * sync command through the fast path and destined for TCE.
2699 */
2700 #define BD_BASE_TYPE_TX_BD_PRESYNC_CMD UINT32_C(0x9)
2701 /*
2702 * Indicates that this BD is 32B long and is used for
2703 * normal L2 packet transmission.
2704 */
2705 #define BD_BASE_TYPE_TX_BD_LONG UINT32_C(0x10)
2706 /*
2707 * Indicates that this BD is 32B long and is used for
2708 * L2 packet transmission for small packets that require
2709 * low latency.
2710 */
2711 #define BD_BASE_TYPE_TX_BD_LONG_INLINE UINT32_C(0x11)
2712 #define BD_BASE_TYPE_LAST BD_BASE_TYPE_TX_BD_LONG_INLINE
2713 uint8_t unused_1[7];
2714 } bd_base_t, *pbd_base_t;
2715
2716 /* tx_bd_short (size:128b/16B) */
2717
2718 typedef struct tx_bd_short {
2719 /*
2720 * All bits in this field must be valid on the first BD of a packet.
2721 * Only the packet_end bit must be valid for the remaining BDs
2722 * of a packet.
2723 */
2724 uint16_t flags_type;
2725 /* This value identifies the type of buffer descriptor. */
2726 #define TX_BD_SHORT_TYPE_MASK UINT32_C(0x3f)
2727 #define TX_BD_SHORT_TYPE_SFT 0
2728 /*
2729 * Indicates that this BD is 16B long and is used for
2730 * normal L2 packet transmission.
2731 */
2732 #define TX_BD_SHORT_TYPE_TX_BD_SHORT UINT32_C(0x0)
2733 #define TX_BD_SHORT_TYPE_LAST TX_BD_SHORT_TYPE_TX_BD_SHORT
2734 /*
2735 * All bits in this field must be valid on the first BD of a packet.
2736 * Only the packet_end bit must be valid for the remaining BDs
2737 * of a packet.
2738 */
2739 #define TX_BD_SHORT_FLAGS_MASK UINT32_C(0xffc0)
2740 #define TX_BD_SHORT_FLAGS_SFT 6
2741 /*
2742 * If set to 1, the packet ends with the data in the buffer
2743 * pointed to by this descriptor. This flag must be
2744 * valid on every BD.
2745 */
2746 #define TX_BD_SHORT_FLAGS_PACKET_END UINT32_C(0x40)
2747 /*
2748 * If set to 1, the device will not generate a completion for
2749 * this transmit packet unless there is an error in it's
2750 * processing.
2751 * If this bit
2752 * is set to 0, then the packet will be completed normally.
2753 *
2754 * This bit must be valid only on the first BD of a packet.
2755 */
2756 #define TX_BD_SHORT_FLAGS_NO_CMPL UINT32_C(0x80)
2757 /*
2758 * This value indicates how many 16B BD locations are consumed
2759 * in the ring by this packet.
2760 * A value of 1 indicates that this BD is the only BD (and that
2761 * it is a short BD). A value
2762 * of 3 indicates either 3 short BDs or 1 long BD and one short
2763 * BD in the packet. A value of 0 indicates
2764 * that there are 32 BD locations in the packet (the maximum).
2765 *
2766 * This field is valid only on the first BD of a packet.
2767 */
2768 #define TX_BD_SHORT_FLAGS_BD_CNT_MASK UINT32_C(0x1f00)
2769 #define TX_BD_SHORT_FLAGS_BD_CNT_SFT 8
2770 /*
2771 * This value is a hint for the length of the entire packet.
2772 * It is used by the chip to optimize internal processing.
2773 *
2774 * The packet will be dropped if the hint is too short.
2775 *
2776 * This field is valid only on the first BD of a packet.
2777 */
2778 #define TX_BD_SHORT_FLAGS_LHINT_MASK UINT32_C(0x6000)
2779 #define TX_BD_SHORT_FLAGS_LHINT_SFT 13
2780 /* indicates packet length < 512B */
2781 #define TX_BD_SHORT_FLAGS_LHINT_LT512 (UINT32_C(0x0) << 13)
2782 /* indicates 512 <= packet length < 1KB */
2783 #define TX_BD_SHORT_FLAGS_LHINT_LT1K (UINT32_C(0x1) << 13)
2784 /* indicates 1KB <= packet length < 2KB */
2785 #define TX_BD_SHORT_FLAGS_LHINT_LT2K (UINT32_C(0x2) << 13)
2786 /* indicates packet length >= 2KB */
2787 #define TX_BD_SHORT_FLAGS_LHINT_GTE2K (UINT32_C(0x3) << 13)
2788 #define TX_BD_SHORT_FLAGS_LHINT_LAST TX_BD_SHORT_FLAGS_LHINT_GTE2K
2789 /*
2790 * If set to 1, the device immediately updates the Send Consumer
2791 * Index after the buffer associated with this descriptor has
2792 * been transferred via DMA to NIC memory from host memory. An
2793 * interrupt may or may not be generated according to the state
2794 * of the interrupt avoidance mechanisms. If this bit
2795 * is set to 0, then the Consumer Index is only updated as soon
2796 * as one of the host interrupt coalescing conditions has been met.
2797 *
2798 * This bit must be valid on the first BD of a packet.
2799 */
2800 #define TX_BD_SHORT_FLAGS_COAL_NOW UINT32_C(0x8000)
2801 /*
2802 * This is the length of the host physical buffer this BD describes
2803 * in bytes.
2804 *
2805 * This field must be valid on all BDs of a packet.
2806 */
2807 uint16_t len;
2808 /*
2809 * The opaque data field is pass through to the completion and can be
2810 * used for any data that the driver wants to associate with the
2811 * transmit BD.
2812 *
2813 * This field must be valid on the first BD of a packet. If completion
2814 * coalescing is enabled on the TX ring, it is suggested that the driver
2815 * populate the opaque field to indicate the specific TX ring with which
2816 * the completion is associated, then utilize the opaque and sq_cons_idx
2817 * fields in the coalesced completion record to determine the specific
2818 * packets that are to be completed on that ring.
2819 */
2820 uint32_t opaque;
2821 /*
2822 * This is the host physical address for the portion of the packet
2823 * described by this TX BD.
2824 *
2825 * This value must be valid on all BDs of a packet.
2826 */
2827 uint64_t addr;
2828 } tx_bd_short_t, *ptx_bd_short_t;
2829
2830 /* tx_bd_long (size:128b/16B) */
2831
2832 typedef struct tx_bd_long {
2833 /* This value identifies the type of buffer descriptor. */
2834 uint16_t flags_type;
2835 /*
2836 * This value indicates the type of buffer descriptor.
2837 * packet.
2838 */
2839 #define TX_BD_LONG_TYPE_MASK UINT32_C(0x3f)
2840 #define TX_BD_LONG_TYPE_SFT 0
2841 /*
2842 * Indicates that this BD is 32B long and is used for
2843 * normal L2 packet transmission.
2844 */
2845 #define TX_BD_LONG_TYPE_TX_BD_LONG UINT32_C(0x10)
2846 #define TX_BD_LONG_TYPE_LAST TX_BD_LONG_TYPE_TX_BD_LONG
2847 /*
2848 * All bits in this field must be valid on the first BD of a packet.
2849 * Only the packet_end bit must be valid for the remaining BDs
2850 * of a packet.
2851 */
2852 #define TX_BD_LONG_FLAGS_MASK UINT32_C(0xffc0)
2853 #define TX_BD_LONG_FLAGS_SFT 6
2854 /*
2855 * If set to 1, the packet ends with the data in the buffer
2856 * pointed to by this descriptor. This flag must be
2857 * valid on every BD.
2858 */
2859 #define TX_BD_LONG_FLAGS_PACKET_END UINT32_C(0x40)
2860 /*
2861 * If set to 1, the device will not generate a completion for
2862 * this transmit packet unless there is an error in it's
2863 * processing.
2864 * If this bit
2865 * is set to 0, then the packet will be completed normally.
2866 *
2867 * This bit must be valid only on the first BD of a packet.
2868 */
2869 #define TX_BD_LONG_FLAGS_NO_CMPL UINT32_C(0x80)
2870 /*
2871 * This value indicates how many 16B BD locations are consumed
2872 * in the ring by this packet.
2873 * A value of 1 indicates that this BD is the only BD (and that
2874 * it is a short BD). A value
2875 * of 3 indicates either 3 short BDs or 1 long BD and one short
2876 * BD in the packet. A value of 0 indicates
2877 * that there are 32 BD locations in the packet (the maximum).
2878 *
2879 * This field is valid only on the first BD of a packet.
2880 */
2881 #define TX_BD_LONG_FLAGS_BD_CNT_MASK UINT32_C(0x1f00)
2882 #define TX_BD_LONG_FLAGS_BD_CNT_SFT 8
2883 /*
2884 * This value is a hint for the length of the entire packet.
2885 * It is used by the chip to optimize internal processing.
2886 *
2887 * The packet will be dropped if the hint is too short.
2888 *
2889 * This field is valid only on the first BD of a packet.
2890 */
2891 #define TX_BD_LONG_FLAGS_LHINT_MASK UINT32_C(0x6000)
2892 #define TX_BD_LONG_FLAGS_LHINT_SFT 13
2893 /* indicates packet length < 512B */
2894 #define TX_BD_LONG_FLAGS_LHINT_LT512 (UINT32_C(0x0) << 13)
2895 /* indicates 512 <= packet length < 1KB */
2896 #define TX_BD_LONG_FLAGS_LHINT_LT1K (UINT32_C(0x1) << 13)
2897 /* indicates 1KB <= packet length < 2KB */
2898 #define TX_BD_LONG_FLAGS_LHINT_LT2K (UINT32_C(0x2) << 13)
2899 /* indicates packet length >= 2KB */
2900 #define TX_BD_LONG_FLAGS_LHINT_GTE2K (UINT32_C(0x3) << 13)
2901 #define TX_BD_LONG_FLAGS_LHINT_LAST TX_BD_LONG_FLAGS_LHINT_GTE2K
2902 /*
2903 * If set to 1, the device immediately updates the Send Consumer
2904 * Index after the buffer associated with this descriptor has
2905 * been transferred via DMA to NIC memory from host memory. An
2906 * interrupt may or may not be generated according to the state
2907 * of the interrupt avoidance mechanisms. If this bit
2908 * is set to 0, then the Consumer Index is only updated as soon
2909 * as one of the host interrupt coalescing conditions has been met.
2910 *
2911 * This bit must be valid on the first BD of a packet.
2912 */
2913 #define TX_BD_LONG_FLAGS_COAL_NOW UINT32_C(0x8000)
2914 /*
2915 * This is the length of the host physical buffer this BD describes
2916 * in bytes.
2917 *
2918 * This field must be valid on all BDs of a packet.
2919 */
2920 uint16_t len;
2921 /*
2922 * The opaque data field is passed through to the completion and can be
2923 * used for any data that the driver wants to associate with the
2924 * transmit BD.
2925 *
2926 * This field must be valid on the first BD of a packet. If completion
2927 * coalescing is enabled on the TX ring, it is suggested that the driver
2928 * populate the opaque field to indicate the specific TX ring with which
2929 * the completion is associated, then utilize the opaque and sq_cons_idx
2930 * fields in the coalesced completion record to determine the specific
2931 * packets that are to be completed on that ring.
2932 */
2933 uint32_t opaque;
2934 /*
2935 * This is the host physical address for the portion of the packet
2936 * described by this TX BD.
2937 *
2938 * This value must be valid on all BDs of a packet.
2939 */
2940 uint64_t addr;
2941 } tx_bd_long_t, *ptx_bd_long_t;
2942
2943 /* Last 16 bytes of tx_bd_long. */
2944 /* tx_bd_long_hi (size:128b/16B) */
2945
2946 typedef struct tx_bd_long_hi {
2947 /*
2948 * All bits in this field must be valid on the first BD of a packet.
2949 * Their value on other BDs of the packet will be ignored.
2950 */
2951 uint16_t lflags;
2952 /*
2953 * If set to 1, the controller replaces the TCP/UPD checksum
2954 * fields of normal TCP/UPD checksum, or the inner TCP/UDP
2955 * checksum field of the encapsulated TCP/UDP packets with the
2956 * hardware calculated TCP/UDP checksum for the packet associated
2957 * with this descriptor. The flag is ignored if the LSO flag is set.
2958 *
2959 * This bit must be valid on the first BD of a packet.
2960 */
2961 #define TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM UINT32_C(0x1)
2962 /*
2963 * If set to 1, the controller replaces the IP checksum of the
2964 * normal packets, or the inner IP checksum of the encapsulated
2965 * packets with the hardware calculated IP checksum for the
2966 * packet associated with this descriptor.
2967 *
2968 * This bit must be valid on the first BD of a packet.
2969 */
2970 #define TX_BD_LONG_LFLAGS_IP_CHKSUM UINT32_C(0x2)
2971 /*
2972 * If set to 1, the controller will not append an Ethernet CRC
2973 * to the end of the frame.
2974 *
2975 * This bit must be valid on the first BD of a packet.
2976 *
2977 * Packet must be 64B or longer when this flag is set. It is not
2978 * useful to use this bit with any form of TX offload such as
2979 * CSO or LSO. The intent is that the packet from the host already
2980 * has a valid Ethernet CRC on the packet.
2981 */
2982 #define TX_BD_LONG_LFLAGS_NOCRC UINT32_C(0x4)
2983 /*
2984 * If set to 1, the device will record the time at which the packet
2985 * was actually transmitted at the TX MAC for 2-step time sync.
2986 *
2987 * This bit must be valid on the first BD of a packet.
2988 */
2989 #define TX_BD_LONG_LFLAGS_STAMP UINT32_C(0x8)
2990 /*
2991 * If set to 1, The controller replaces the tunnel IP checksum
2992 * field with hardware calculated IP checksum for the IP header
2993 * of the packet associated with this descriptor.
2994 *
2995 * For outer UDP checksum, global outer UDP checksum TE_NIC register
2996 * needs to be enabled. If the global outer UDP checksum TE_NIC register
2997 * bit is set, outer UDP checksum will be calculated for the following
2998 * cases:
2999 * 1. Packets with tcp_udp_chksum flag set to offload checksum for inner
3000 * packet AND the inner packet is TCP/UDP. If the inner packet is ICMP for
3001 * example (non-TCP/UDP), even if the tcp_udp_chksum is set, the outer UDP
3002 * checksum will not be calculated.
3003 * 2. Packets with lso flag set which implies inner TCP checksum calculation
3004 * as part of LSO operation.
3005 */
3006 #define TX_BD_LONG_LFLAGS_T_IP_CHKSUM UINT32_C(0x10)
3007 /*
3008 * If set to 1, the device will treat this packet with LSO(Large
3009 * Send Offload) processing for both normal or encapsulated
3010 * packets, which is a form of TCP segmentation. When this bit
3011 * is 1, the hdr_size and mss fields must be valid. The driver
3012 * doesn't need to set ot_ip_chksum, t_ip_chksum, ip_chksum, and
3013 * tcp_udp_chksum flags since the controller will replace the
3014 * appropriate checksum fields for segmented packets.
3015 *
3016 * When this bit is 1, the hdr_size and mss fields must be valid.
3017 */
3018 #define TX_BD_LONG_LFLAGS_LSO UINT32_C(0x20)
3019 /*
3020 * If set to zero when LSO is '1', then the IPID will be treated
3021 * as a 16b number and will be wrapped if it exceeds a value of
3022 * 0xffff.
3023 *
3024 * If set to one when LSO is '1', then the IPID will be treated
3025 * as a 15b number and will be wrapped if it exceeds a value 0f
3026 * 0x7fff.
3027 */
3028 #define TX_BD_LONG_LFLAGS_IPID_FMT UINT32_C(0x40)
3029 /*
3030 * If set to zero when LSO is '1', then the IPID of the tunnel
3031 * IP header will not be modified during LSO operations.
3032 *
3033 * If set to one when LSO is '1', then the IPID of the tunnel
3034 * IP header will be incremented for each subsequent segment of an
3035 * LSO operation.
3036 *
3037 * The flag is ignored if the LSO packet is a normal (non-tunneled)
3038 * TCP packet.
3039 */
3040 #define TX_BD_LONG_LFLAGS_T_IPID UINT32_C(0x80)
3041 /*
3042 * If set to '1', then the RoCE ICRC will be appended to the
3043 * packet. Packet must be a valid RoCE format packet.
3044 */
3045 #define TX_BD_LONG_LFLAGS_ROCE_CRC UINT32_C(0x100)
3046 /*
3047 * If set to '1', then the FCoE CRC will be appended to the
3048 * packet. Packet must be a valid FCoE format packet.
3049 */
3050 #define TX_BD_LONG_LFLAGS_FCOE_CRC UINT32_C(0x200)
3051 /*
3052 * If set to '1', then the timestamp from the BD is used. If cleared
3053 * to 0, then TWE provides the timestamp.
3054 */
3055 #define TX_BD_LONG_LFLAGS_BD_TS_EN UINT32_C(0x400)
3056 /*
3057 * If set to '1', this operation will cause a trace capture in each
3058 * block it passes through.
3059 */
3060 #define TX_BD_LONG_LFLAGS_DEBUG_TRACE UINT32_C(0x800)
3061 /*
3062 * If set to '1', the device will record the time at which the packet
3063 * was actually transmitted at the TX MAC for 1-step time sync. This
3064 * bit must be valid on the first BD of a packet.
3065 */
3066 #define TX_BD_LONG_LFLAGS_STAMP_1STEP UINT32_C(0x1000)
3067 /*
3068 * If set to '1', the controller replaces the Outer-tunnel IP checksum
3069 * field with hardware calculated IP checksum for the IP header of the
3070 * packet associated with this descriptor. For outer UDP checksum, it
3071 * will be the following behavior for all cases independent of settings
3072 * of inner LSO and checksum offload BD flags. If outer UDP checksum
3073 * is 0, then do not update it. If outer UDP checksum is non zero, then
3074 * the hardware should compute and update it.
3075 */
3076 #define TX_BD_LONG_LFLAGS_OT_IP_CHKSUM UINT32_C(0x2000)
3077 /*
3078 * If set to zero when LSO is '1', then the IPID of the Outer-tunnel IP
3079 * header will not be modified during LSO operations. If set to one
3080 * when LSO is '1', then the IPID of the Outer-tunnel IP header will be
3081 * incremented for each subsequent segment of an LSO operation. The
3082 * flag is ignored if the LSO packet is a normal (non-tunneled) TCP
3083 * packet.
3084 */
3085 #define TX_BD_LONG_LFLAGS_OT_IPID UINT32_C(0x4000)
3086 /*
3087 * If set to '1', When set to 1, KTLS encryption will be enabled for
3088 * the packet.
3089 */
3090 #define TX_BD_LONG_LFLAGS_CRYPTO_EN UINT32_C(0x8000)
3091 uint16_t kid_or_ts_low_hdr_size;
3092 /*
3093 * When LSO is '1', this field must contain the offset of the
3094 * TCP payload from the beginning of the packet in as
3095 * 16b words. In case of encapsulated/tunneling packet, this field
3096 * contains the offset of the inner TCP payload from beginning of the
3097 * packet as 16-bit words.
3098 *
3099 * This value must be valid on the first BD of a packet.
3100 */
3101 #define TX_BD_LONG_HDR_SIZE_MASK UINT32_C(0x1ff)
3102 #define TX_BD_LONG_HDR_SIZE_SFT 0
3103 /*
3104 * If lflags.bd_ts_en is 1, this is the lower 7 bits of the 24-bit
3105 * timestamp. If lflags.crypto_en is 1, this is the lower 7 bits of the
3106 * 20-bit KID.
3107 */
3108 #define TX_BD_LONG_KID_OR_TS_LOW_MASK UINT32_C(0xfe00)
3109 #define TX_BD_LONG_KID_OR_TS_LOW_SFT 9
3110 uint32_t kid_or_ts_high_mss;
3111 /*
3112 * This is the MSS value that will be used to do the LSO processing.
3113 * The value is the length in bytes of the TCP payload for each
3114 * segment generated by the LSO operation.
3115 *
3116 * This value must be valid on the first BD of a packet.
3117 */
3118 #define TX_BD_LONG_MSS_MASK UINT32_C(0x7fff)
3119 #define TX_BD_LONG_MSS_SFT 0
3120 /*
3121 * If lflags.bd_ts_en is 1, this is the upper 17 bits of the 24-bit
3122 * timestamp. If lflags.crypto_en is 1, the least significant 13 bits
3123 * of this field contain the upper 13 bits of the 20-bit KID.
3124 */
3125 #define TX_BD_LONG_KID_OR_TS_HIGH_MASK UINT32_C(0xffff8000)
3126 #define TX_BD_LONG_KID_OR_TS_HIGH_SFT 15
3127 /*
3128 * This value selects bits 25:16 of the CFA action to perform on the
3129 * packet. See the cfa_action field for more information.
3130 */
3131 uint16_t cfa_action_high;
3132 #define TX_BD_LONG_CFA_ACTION_HIGH_MASK UINT32_C(0x3ff)
3133 #define TX_BD_LONG_CFA_ACTION_HIGH_SFT 0
3134 /*
3135 * This value selects a CFA action to perform on the packet.
3136 * Set this value to zero if no CFA action is desired.
3137 *
3138 * This value must be valid on the first BD of a packet.
3139 */
3140 uint16_t cfa_action;
3141 /*
3142 * This value is action meta-data that defines CFA edit operations
3143 * that are done in addition to any action editing.
3144 */
3145 uint32_t cfa_meta;
3146 /* When key=1, This is the VLAN tag VID value. */
3147 #define TX_BD_LONG_CFA_META_VLAN_VID_MASK UINT32_C(0xfff)
3148 #define TX_BD_LONG_CFA_META_VLAN_VID_SFT 0
3149 /* When key=1, This is the VLAN tag DE value. */
3150 #define TX_BD_LONG_CFA_META_VLAN_DE UINT32_C(0x1000)
3151 /* When key=1, This is the VLAN tag PRI value. */
3152 #define TX_BD_LONG_CFA_META_VLAN_PRI_MASK UINT32_C(0xe000)
3153 #define TX_BD_LONG_CFA_META_VLAN_PRI_SFT 13
3154 /* When key=1, This is the VLAN tag TPID select value. */
3155 #define TX_BD_LONG_CFA_META_VLAN_TPID_MASK UINT32_C(0x70000)
3156 #define TX_BD_LONG_CFA_META_VLAN_TPID_SFT 16
3157 /* 0x88a8 */
3158 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID88A8 (UINT32_C(0x0) << 16)
3159 /* 0x8100 */
3160 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID8100 (UINT32_C(0x1) << 16)
3161 /* 0x9100 */
3162 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9100 (UINT32_C(0x2) << 16)
3163 /* 0x9200 */
3164 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9200 (UINT32_C(0x3) << 16)
3165 /* 0x9300 */
3166 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9300 (UINT32_C(0x4) << 16)
3167 /* Value programmed in CFA VLANTPID register. */
3168 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG (UINT32_C(0x5) << 16)
3169 #define TX_BD_LONG_CFA_META_VLAN_TPID_LAST TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG
3170 /* When key=1, This is the VLAN tag TPID select value. */
3171 #define TX_BD_LONG_CFA_META_VLAN_RESERVED_MASK UINT32_C(0xff80000)
3172 #define TX_BD_LONG_CFA_META_VLAN_RESERVED_SFT 19
3173 /*
3174 * This field identifies the type of edit to be performed
3175 * on the packet.
3176 *
3177 * This value must be valid on the first BD of a packet.
3178 */
3179 #define TX_BD_LONG_CFA_META_KEY_MASK UINT32_C(0xf0000000)
3180 #define TX_BD_LONG_CFA_META_KEY_SFT 28
3181 /* No editing */
3182 #define TX_BD_LONG_CFA_META_KEY_NONE (UINT32_C(0x0) << 28)
3183 /*
3184 * - meta[17:16] - TPID select value (0 = 0x8100).
3185 * - meta[15:12] - PRI/DE value.
3186 * - meta[11:0] - VID value.
3187 */
3188 #define TX_BD_LONG_CFA_META_KEY_VLAN_TAG (UINT32_C(0x1) << 28)
3189 /*
3190 * Provide metadata
3191 * - Wh+/SR - this option is not supported.
3192 * - Thor - cfa_meta[15:0] is used for metadata output if en_bd_meta
3193 * is set in the Lookup Table.
3194 * - SR2 - {4’d0, cfa_meta[27:0]} is used for metadata output if
3195 * en_bd_meta is set in the Lookup Table.
3196 */
3197 #define TX_BD_LONG_CFA_META_KEY_METADATA_TRANSFER (UINT32_C(0x2) << 28)
3198 #define TX_BD_LONG_CFA_META_KEY_LAST TX_BD_LONG_CFA_META_KEY_METADATA_TRANSFER
3199 } tx_bd_long_hi_t, *ptx_bd_long_hi_t;
3200
3201 /*
3202 * This structure is used to inform the NIC of packet data that needs to be
3203 * transmitted with additional processing that requires extra data such as
3204 * VLAN insertion plus attached inline data. This BD type may be used to
3205 * improve latency for small packets needing the additional extended features
3206 * supported by long BDs.
3207 */
3208 /* tx_bd_long_inline (size:256b/32B) */
3209
3210 typedef struct tx_bd_long_inline {
3211 uint16_t flags_type;
3212 /* This value identifies the type of buffer descriptor. */
3213 #define TX_BD_LONG_INLINE_TYPE_MASK UINT32_C(0x3f)
3214 #define TX_BD_LONG_INLINE_TYPE_SFT 0
3215 /*
3216 * This type of BD is 32B long and is used for inline L2 packet
3217 * transmission.
3218 */
3219 #define TX_BD_LONG_INLINE_TYPE_TX_BD_LONG_INLINE UINT32_C(0x11)
3220 #define TX_BD_LONG_INLINE_TYPE_LAST TX_BD_LONG_INLINE_TYPE_TX_BD_LONG_INLINE
3221 /*
3222 * All bits in this field may be set on the first BD of a packet.
3223 * Only the packet_end bit may be set in non-first BDs.
3224 */
3225 #define TX_BD_LONG_INLINE_FLAGS_MASK UINT32_C(0xffc0)
3226 #define TX_BD_LONG_INLINE_FLAGS_SFT 6
3227 /*
3228 * If set to 1, the packet ends with the data in the buffer
3229 * pointed to by this descriptor. This flag must be
3230 * valid on every BD.
3231 */
3232 #define TX_BD_LONG_INLINE_FLAGS_PACKET_END UINT32_C(0x40)
3233 /*
3234 * If set to 1, the device will not generate a completion for
3235 * this transmit packet unless there is an error in its processing.
3236 * If this bit is set to 0, then the packet will be completed
3237 * normally.
3238 *
3239 * This bit may be set only on the first BD of a packet.
3240 */
3241 #define TX_BD_LONG_INLINE_FLAGS_NO_CMPL UINT32_C(0x80)
3242 /*
3243 * This value indicates how many 16B BD locations are consumed
3244 * in the ring by this packet, including the BD and inline
3245 * data.
3246 */
3247 #define TX_BD_LONG_INLINE_FLAGS_BD_CNT_MASK UINT32_C(0x1f00)
3248 #define TX_BD_LONG_INLINE_FLAGS_BD_CNT_SFT 8
3249 /* This field is deprecated. */
3250 #define TX_BD_LONG_INLINE_FLAGS_LHINT_MASK UINT32_C(0x6000)
3251 #define TX_BD_LONG_INLINE_FLAGS_LHINT_SFT 13
3252 /*
3253 * If set to 1, the device immediately updates the Send Consumer
3254 * Index after the buffer associated with this descriptor has
3255 * been transferred via DMA to NIC memory from host memory. An
3256 * interrupt may or may not be generated according to the state
3257 * of the interrupt avoidance mechanisms. If this bit
3258 * is set to 0, then the Consumer Index is only updated as soon
3259 * as one of the host interrupt coalescing conditions has been met.
3260 *
3261 * This bit must be valid on the first BD of a packet.
3262 */
3263 #define TX_BD_LONG_INLINE_FLAGS_COAL_NOW UINT32_C(0x8000)
3264 /*
3265 * This is the length of the inline data, not including BD length, in
3266 * bytes.
3267 * The maximum value is 480.
3268 *
3269 * This field must be valid on all BDs of a packet.
3270 */
3271 uint16_t len;
3272 /*
3273 * The opaque data field is passed through to the completion and can be
3274 * used for any data that the driver wants to associate with the transmit
3275 * BD. This field must be valid on the first BD of a packet. If
3276 * completion coalescing is enabled on the TX ring, it is suggested that
3277 * the driver populate the opaque field to indicate the specific TX ring
3278 * with which the completion is associated, then utilize the opaque and
3279 * sq_cons_idx fields in the coalesced completion record to determine
3280 * the specific packets that are to be completed on that ring.
3281 *
3282 * This field must be valid on the first BD of a packet.
3283 */
3284 uint32_t opaque;
3285 uint64_t unused1;
3286 /*
3287 * All bits in this field must be valid on the first BD of a packet.
3288 * Their value on other BDs of the packet is ignored.
3289 */
3290 uint16_t lflags;
3291 /*
3292 * If set to 1, the controller replaces the TCP/UPD checksum
3293 * fields of normal TCP/UPD checksum, or the inner TCP/UDP
3294 * checksum field of the encapsulated TCP/UDP packets with the
3295 * hardware calculated TCP/UDP checksum for the packet associated
3296 * with this descriptor. The flag is ignored if the LSO flag is set.
3297 */
3298 #define TX_BD_LONG_INLINE_LFLAGS_TCP_UDP_CHKSUM UINT32_C(0x1)
3299 /*
3300 * If set to 1, the controller replaces the IP checksum of the
3301 * normal packets, or the inner IP checksum of the encapsulated
3302 * packets with the hardware calculated IP checksum for the
3303 * packet associated with this descriptor.
3304 */
3305 #define TX_BD_LONG_INLINE_LFLAGS_IP_CHKSUM UINT32_C(0x2)
3306 /*
3307 * If set to 1, the controller will not append an Ethernet CRC
3308 * to the end of the frame.
3309 *
3310 * Packet must be 64B or longer when this flag is set. It is not
3311 * useful to use this bit with any form of TX offload such as
3312 * CSO or LSO. The intent is that the packet from the host already
3313 * has a valid Ethernet CRC on the packet.
3314 */
3315 #define TX_BD_LONG_INLINE_LFLAGS_NOCRC UINT32_C(0x4)
3316 /*
3317 * If set to 1, the device will record the time at which the packet
3318 * was actually transmitted at the TX MAC for 2-step time sync. This
3319 * bit must be valid on the first BD of a packet.
3320 */
3321 #define TX_BD_LONG_INLINE_LFLAGS_STAMP UINT32_C(0x8)
3322 /*
3323 * If set to 1, the controller replaces the tunnel IP checksum
3324 * field with hardware calculated IP checksum for the IP header
3325 * of the packet associated with this descriptor. The hardware
3326 * updates an outer UDP checksum if it is non-zero.
3327 */
3328 #define TX_BD_LONG_INLINE_LFLAGS_T_IP_CHKSUM UINT32_C(0x10)
3329 /*
3330 * This bit must be 0 for BDs of this type. LSO is not supported with
3331 * inline BDs.
3332 */
3333 #define TX_BD_LONG_INLINE_LFLAGS_LSO UINT32_C(0x20)
3334 /* Since LSO is not supported with inline BDs, this bit is not used. */
3335 #define TX_BD_LONG_INLINE_LFLAGS_IPID_FMT UINT32_C(0x40)
3336 /* Since LSO is not supported with inline BDs, this bit is not used. */
3337 #define TX_BD_LONG_INLINE_LFLAGS_T_IPID UINT32_C(0x80)
3338 /*
3339 * If set to '1', then the RoCE ICRC will be appended to the
3340 * packet. Packet must be a valid RoCE format packet.
3341 */
3342 #define TX_BD_LONG_INLINE_LFLAGS_ROCE_CRC UINT32_C(0x100)
3343 /*
3344 * If set to '1', then the FCoE CRC will be appended to the
3345 * packet. Packet must be a valid FCoE format packet.
3346 */
3347 #define TX_BD_LONG_INLINE_LFLAGS_FCOE_CRC UINT32_C(0x200)
3348 /*
3349 * If set to '1', then the timestamp from the BD is used. If cleared
3350 * to 0, then TWE provides the timestamp.
3351 */
3352 #define TX_BD_LONG_INLINE_LFLAGS_BD_TS_EN UINT32_C(0x400)
3353 /*
3354 * If set to '1', this operation will cause a trace capture in each
3355 * block it passes through.
3356 */
3357 #define TX_BD_LONG_INLINE_LFLAGS_DEBUG_TRACE UINT32_C(0x800)
3358 /*
3359 * If set to '1', the device will record the time at which the packet
3360 * was actually transmitted at the TX MAC for 1-step time sync. This
3361 * bit must be valid on the first BD of a packet.
3362 */
3363 #define TX_BD_LONG_INLINE_LFLAGS_STAMP_1STEP UINT32_C(0x1000)
3364 /*
3365 * If set to '1', the controller replaces the Outer-tunnel IP checksum
3366 * field with hardware calculated IP checksum for the IP header of the
3367 * packet associated with this descriptor. For outer UDP checksum, it
3368 * will be the following behavior for all cases independent of settings
3369 * of inner LSO and checksum offload BD flags. If outer UDP checksum
3370 * is 0, then do not update it. If outer UDP checksum is non zero, then
3371 * the hardware should compute and update it.
3372 */
3373 #define TX_BD_LONG_INLINE_LFLAGS_OT_IP_CHKSUM UINT32_C(0x2000)
3374 /*
3375 * If set to zero when LSO is '1', then the IPID of the Outer-tunnel IP
3376 * header will not be modified during LSO operations. If set to one
3377 * when LSO is '1', then the IPID of the Outer-tunnel IP header will be
3378 * incremented for each subsequent segment of an LSO operation. The
3379 * flag is ignored if the LSO packet is a normal (non-tunneled) TCP
3380 * packet.
3381 */
3382 #define TX_BD_LONG_INLINE_LFLAGS_OT_IPID UINT32_C(0x4000)
3383 /*
3384 * If set to '1', When set to 1, KTLS encryption will be enabled for
3385 * the packet.
3386 */
3387 #define TX_BD_LONG_INLINE_LFLAGS_CRYPTO_EN UINT32_C(0x8000)
3388 uint8_t unused2;
3389 uint8_t kid_or_ts_low;
3390 #define TX_BD_LONG_INLINE_UNUSED UINT32_C(0x1)
3391 /*
3392 * If lflags.bd_ts_en is 1, this is the lower 7 bits of the 24-bit
3393 * timestamp. If lflags.crypto_en is 1, this is the lower 7 bits of
3394 * the 20-bit KID.
3395 */
3396 #define TX_BD_LONG_INLINE_KID_OR_TS_LOW_MASK UINT32_C(0xfe)
3397 #define TX_BD_LONG_INLINE_KID_OR_TS_LOW_SFT 1
3398 uint32_t kid_or_ts_high;
3399 #define TX_BD_LONG_INLINE_UNUSED_MASK UINT32_C(0x7fff)
3400 #define TX_BD_LONG_INLINE_UNUSED_SFT 0
3401 /*
3402 * If lflags.bd_ts_en is 1, this is the upper 17 bits of the 24-bit
3403 * timestamp. If lflags.crypto_en is 1, the least significant 13 bits
3404 * of this field contain the upper 13 bits of the 20-bit KID.
3405 */
3406 #define TX_BD_LONG_INLINE_KID_OR_TS_HIGH_MASK UINT32_C(0xffff8000)
3407 #define TX_BD_LONG_INLINE_KID_OR_TS_HIGH_SFT 15
3408 /*
3409 * This value selects bits 25:16 of the CFA action to perform on the
3410 * packet. See the cfa_action field for more information.
3411 */
3412 uint16_t cfa_action_high;
3413 #define TX_BD_LONG_INLINE_CFA_ACTION_HIGH_MASK UINT32_C(0x3ff)
3414 #define TX_BD_LONG_INLINE_CFA_ACTION_HIGH_SFT 0
3415 /*
3416 * This value selects a CFA action to perform on the packet.
3417 * Set this value to zero if no CFA action is desired.
3418 *
3419 * This value must be valid on the first BD of a packet.
3420 */
3421 uint16_t cfa_action;
3422 /*
3423 * This value is action meta-data that defines CFA edit operations
3424 * that are done in addition to any action editing.
3425 */
3426 uint32_t cfa_meta;
3427 /* When key = 1, this is the VLAN tag VID value. */
3428 #define TX_BD_LONG_INLINE_CFA_META_VLAN_VID_MASK UINT32_C(0xfff)
3429 #define TX_BD_LONG_INLINE_CFA_META_VLAN_VID_SFT 0
3430 /* When key = 1, this is the VLAN tag DE value. */
3431 #define TX_BD_LONG_INLINE_CFA_META_VLAN_DE UINT32_C(0x1000)
3432 /* When key = 1, this is the VLAN tag PRI value. */
3433 #define TX_BD_LONG_INLINE_CFA_META_VLAN_PRI_MASK UINT32_C(0xe000)
3434 #define TX_BD_LONG_INLINE_CFA_META_VLAN_PRI_SFT 13
3435 /* When key = 1, this is the VLAN tag TPID select value. */
3436 #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_MASK UINT32_C(0x70000)
3437 #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_SFT 16
3438 /* 0x88a8 */
3439 #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID88A8 (UINT32_C(0x0) << 16)
3440 /* 0x8100 */
3441 #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID8100 (UINT32_C(0x1) << 16)
3442 /* 0x9100 */
3443 #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9100 (UINT32_C(0x2) << 16)
3444 /* 0x9200 */
3445 #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9200 (UINT32_C(0x3) << 16)
3446 /* 0x9300 */
3447 #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9300 (UINT32_C(0x4) << 16)
3448 /* Value programmed in CFA VLANTPID register. */
3449 #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPIDCFG (UINT32_C(0x5) << 16)
3450 #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_LAST TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPIDCFG
3451 #define TX_BD_LONG_INLINE_CFA_META_VLAN_RESERVED_MASK UINT32_C(0xff80000)
3452 #define TX_BD_LONG_INLINE_CFA_META_VLAN_RESERVED_SFT 19
3453 /*
3454 * This field identifies the type of edit to be performed
3455 * on the packet.
3456 *
3457 * This value must be valid on the first BD of a packet.
3458 */
3459 #define TX_BD_LONG_INLINE_CFA_META_KEY_MASK UINT32_C(0xf0000000)
3460 #define TX_BD_LONG_INLINE_CFA_META_KEY_SFT 28
3461 /* No editing */
3462 #define TX_BD_LONG_INLINE_CFA_META_KEY_NONE (UINT32_C(0x0) << 28)
3463 /*
3464 * - meta[17:16] - TPID select value (0 = 0x8100).
3465 * - meta[15:12] - PRI/DE value.
3466 * - meta[11:0] - VID value.
3467 */
3468 #define TX_BD_LONG_INLINE_CFA_META_KEY_VLAN_TAG (UINT32_C(0x1) << 28)
3469 /*
3470 * Provide metadata
3471 * - Wh+/SR - this option is not supported.
3472 * - Thor - cfa_meta[15:0] is used for metadata output if en_bd_meta
3473 * is set in the Lookup Table.
3474 * - SR2 - {4’d0, cfa_meta[27:0]} is used for metadata output if
3475 * en_bd_meta is set in the Lookup Table.
3476 */
3477 #define TX_BD_LONG_INLINE_CFA_META_KEY_METADATA_TRANSFER (UINT32_C(0x2) << 28)
3478 #define TX_BD_LONG_INLINE_CFA_META_KEY_LAST TX_BD_LONG_INLINE_CFA_META_KEY_METADATA_TRANSFER
3479 } tx_bd_long_inline_t, *ptx_bd_long_inline_t;
3480
3481 /* tx_bd_empty (size:128b/16B) */
3482
3483 typedef struct tx_bd_empty {
3484 /* This value identifies the type of buffer descriptor. */
3485 uint8_t type;
3486 #define TX_BD_EMPTY_TYPE_MASK UINT32_C(0x3f)
3487 #define TX_BD_EMPTY_TYPE_SFT 0
3488 /*
3489 * Indicates that this BD is 1BB long and is an empty
3490 * TX BD. Not valid for use by the driver.
3491 */
3492 #define TX_BD_EMPTY_TYPE_TX_BD_EMPTY UINT32_C(0x1)
3493 #define TX_BD_EMPTY_TYPE_LAST TX_BD_EMPTY_TYPE_TX_BD_EMPTY
3494 uint8_t unused_1[3];
3495 uint8_t unused_2;
3496 uint8_t unused_3[3];
3497 uint8_t unused_4[8];
3498 } tx_bd_empty_t, *ptx_bd_empty_t;
3499
3500 /* tx_bd_mp_cmd (size:128b/16B) */
3501
3502 typedef struct tx_bd_mp_cmd {
3503 /* Unless otherwise stated, sub-fields of this field are always valid. */
3504 uint16_t flags_type;
3505 /* This value identifies the type of buffer descriptor. */
3506 #define TX_BD_MP_CMD_TYPE_MASK UINT32_C(0x3f)
3507 #define TX_BD_MP_CMD_TYPE_SFT 0
3508 /*
3509 * Indicates that this BD is used to issue a command to one of
3510 * the mid-path destinations.
3511 */
3512 #define TX_BD_MP_CMD_TYPE_TX_BD_MP_CMD UINT32_C(0x8)
3513 #define TX_BD_MP_CMD_TYPE_LAST TX_BD_MP_CMD_TYPE_TX_BD_MP_CMD
3514 #define TX_BD_MP_CMD_FLAGS_MASK UINT32_C(0xffc0)
3515 #define TX_BD_MP_CMD_FLAGS_SFT 6
3516 /* */
3517 #define TX_BD_MP_CMD_FLAGS_UNUSED_MASK UINT32_C(0xc0)
3518 #define TX_BD_MP_CMD_FLAGS_UNUSED_SFT 6
3519 /*
3520 * This value indicates the number of 16B BD locations (slots)
3521 * consumed in the ring by this mid-path command BD, including the
3522 * BD header and the command field.
3523 */
3524 #define TX_BD_MP_CMD_FLAGS_BD_CNT_MASK UINT32_C(0x1f00)
3525 #define TX_BD_MP_CMD_FLAGS_BD_CNT_SFT 8
3526 /*
3527 * This value defines the length of command field in bytes. The maximum
3528 * value shall be 496.
3529 */
3530 uint16_t len;
3531 /*
3532 * The opaque data field is pass through to the completion and can be
3533 * used for any data that the driver wants to associate with this
3534 * Tx mid-path command.
3535 */
3536 uint32_t opaque;
3537 uint64_t unused1;
3538 } tx_bd_mp_cmd_t, *ptx_bd_mp_cmd_t;
3539
3540 /* tx_bd_presync_cmd (size:128b/16B) */
3541
3542 typedef struct tx_bd_presync_cmd {
3543 /* Unless otherwise stated, sub-fields of this field are always valid. */
3544 uint16_t flags_type;
3545 /* This value identifies the type of buffer descriptor. */
3546 #define TX_BD_PRESYNC_CMD_TYPE_MASK UINT32_C(0x3f)
3547 #define TX_BD_PRESYNC_CMD_TYPE_SFT 0
3548 /*
3549 * Indicates that this BD is used to issue a cryptographic pre-
3550 * sync command through the fast path and destined for TCE.
3551 */
3552 #define TX_BD_PRESYNC_CMD_TYPE_TX_BD_PRESYNC_CMD UINT32_C(0x9)
3553 #define TX_BD_PRESYNC_CMD_TYPE_LAST TX_BD_PRESYNC_CMD_TYPE_TX_BD_PRESYNC_CMD
3554 #define TX_BD_PRESYNC_CMD_FLAGS_MASK UINT32_C(0xffc0)
3555 #define TX_BD_PRESYNC_CMD_FLAGS_SFT 6
3556 /* */
3557 #define TX_BD_PRESYNC_CMD_FLAGS_UNUSED_MASK UINT32_C(0xc0)
3558 #define TX_BD_PRESYNC_CMD_FLAGS_UNUSED_SFT 6
3559 /*
3560 * This value indicates the number of 16B BD locations (slots)
3561 * consumed in the ring by this pre-sync command BD, including the
3562 * BD header and the command field.
3563 */
3564 #define TX_BD_PRESYNC_CMD_FLAGS_BD_CNT_MASK UINT32_C(0x1f00)
3565 #define TX_BD_PRESYNC_CMD_FLAGS_BD_CNT_SFT 8
3566 /*
3567 * This value defines the length of command field in bytes. The maximum
3568 * value shall be 496.
3569 */
3570 uint16_t len;
3571 /*
3572 * The opaque data field is pass through to TCE and can be used for
3573 * debug.
3574 */
3575 uint32_t opaque;
3576 /*
3577 * This field is the Crypto Context ID to which the retransmit packet is
3578 * applied. The KID references the context fields used by the
3579 * associated kTLS offloaded connection.
3580 */
3581 uint32_t kid;
3582 /*
3583 * The KID value of all-ones is reserved for non-KTLS packets, which
3584 * only implies that this value must not be used when filling this
3585 * field for crypto packets.
3586 */
3587 #define TX_BD_PRESYNC_CMD_KID_VAL_MASK UINT32_C(0xfffff)
3588 #define TX_BD_PRESYNC_CMD_KID_VAL_SFT 0
3589 uint32_t unused_1;
3590 } tx_bd_presync_cmd_t, *ptx_bd_presync_cmd_t;
3591
3592 /* rx_prod_pkt_bd (size:128b/16B) */
3593
3594 typedef struct rx_prod_pkt_bd {
3595 /* This value identifies the type of buffer descriptor. */
3596 uint16_t flags_type;
3597 /* This value identifies the type of buffer descriptor. */
3598 #define RX_PROD_PKT_BD_TYPE_MASK UINT32_C(0x3f)
3599 #define RX_PROD_PKT_BD_TYPE_SFT 0
3600 /*
3601 * Indicates that this BD is 16B long and is an RX Producer
3602 * (i.e. empty) buffer descriptor.
3603 */
3604 #define RX_PROD_PKT_BD_TYPE_RX_PROD_PKT UINT32_C(0x4)
3605 #define RX_PROD_PKT_BD_TYPE_LAST RX_PROD_PKT_BD_TYPE_RX_PROD_PKT
3606 #define RX_PROD_PKT_BD_FLAGS_MASK UINT32_C(0xffc0)
3607 #define RX_PROD_PKT_BD_FLAGS_SFT 6
3608 /*
3609 * If set to 1, the packet will be placed at the address plus
3610 * 2B. The 2 Bytes of padding will be written as zero.
3611 */
3612 #define RX_PROD_PKT_BD_FLAGS_SOP_PAD UINT32_C(0x40)
3613 /*
3614 * If set to 1, the packet write will be padded out to the
3615 * nearest cache-line with zero value padding.
3616 */
3617 #define RX_PROD_PKT_BD_FLAGS_EOP_PAD UINT32_C(0x80)
3618 /*
3619 * This field has been deprecated. There can be no additional
3620 * BDs for this packet from this ring.
3621 *
3622 * Old definition:
3623 * This value is the number of additional buffers in the ring that
3624 * describe the buffer space to be consumed for this packet.
3625 * If the value is zero, then the packet must fit within the
3626 * space described by this BD. If this value is 1 or more, it
3627 * indicates how many additional "buffer" BDs are in the ring
3628 * immediately following this BD to be used for the same
3629 * network packet. Even if the packet to be placed does not need
3630 * all the additional buffers, they will be consumed anyway.
3631 */
3632 #define RX_PROD_PKT_BD_FLAGS_BUFFERS_MASK UINT32_C(0x300)
3633 #define RX_PROD_PKT_BD_FLAGS_BUFFERS_SFT 8
3634 /*
3635 * This is the length in Bytes of the host physical buffer where
3636 * data for the packet may be placed in host memory.
3637 */
3638 uint16_t len;
3639 /*
3640 * The opaque data field is pass through to the completion and can be
3641 * used for any data that the driver wants to associate with this
3642 * receive buffer set.
3643 */
3644 uint32_t opaque;
3645 /*
3646 * This is the host physical address where data for the packet may
3647 * be placed in host memory.
3648 */
3649 uint64_t addr;
3650 } rx_prod_pkt_bd_t, *prx_prod_pkt_bd_t;
3651
3652 /* rx_prod_bfr_bd (size:128b/16B) */
3653
3654 typedef struct rx_prod_bfr_bd {
3655 /* This value identifies the type of buffer descriptor. */
3656 uint16_t flags_type;
3657 /* This value identifies the type of buffer descriptor. */
3658 #define RX_PROD_BFR_BD_TYPE_MASK UINT32_C(0x3f)
3659 #define RX_PROD_BFR_BD_TYPE_SFT 0
3660 /*
3661 * Indicates that this BD is 16B long and is an RX
3662 * Producer Buffer BD.
3663 */
3664 #define RX_PROD_BFR_BD_TYPE_RX_PROD_BFR UINT32_C(0x5)
3665 #define RX_PROD_BFR_BD_TYPE_LAST RX_PROD_BFR_BD_TYPE_RX_PROD_BFR
3666 #define RX_PROD_BFR_BD_FLAGS_MASK UINT32_C(0xffc0)
3667 #define RX_PROD_BFR_BD_FLAGS_SFT 6
3668 /*
3669 * This is the length in Bytes of the host physical buffer where
3670 * data for the packet may be placed in host memory.
3671 */
3672 uint16_t len;
3673 /* This field is not used. */
3674 uint32_t opaque;
3675 /*
3676 * This is the host physical address where data for the packet may
3677 * be placed in host memory.
3678 */
3679 uint64_t addr;
3680 } rx_prod_bfr_bd_t, *prx_prod_bfr_bd_t;
3681
3682 /* rx_prod_agg_bd (size:128b/16B) */
3683
3684 typedef struct rx_prod_agg_bd {
3685 /* This value identifies the type of buffer descriptor. */
3686 uint16_t flags_type;
3687 /* This value identifies the type of buffer descriptor. */
3688 #define RX_PROD_AGG_BD_TYPE_MASK UINT32_C(0x3f)
3689 #define RX_PROD_AGG_BD_TYPE_SFT 0
3690 /*
3691 * Indicates that this BD is 16B long and is an
3692 * RX Producer Assembly Buffer Descriptor.
3693 */
3694 #define RX_PROD_AGG_BD_TYPE_RX_PROD_AGG UINT32_C(0x6)
3695 #define RX_PROD_AGG_BD_TYPE_LAST RX_PROD_AGG_BD_TYPE_RX_PROD_AGG
3696 #define RX_PROD_AGG_BD_FLAGS_MASK UINT32_C(0xffc0)
3697 #define RX_PROD_AGG_BD_FLAGS_SFT 6
3698 /*
3699 * If set to 1, the packet write will be padded out to the
3700 * nearest cache-line with zero value padding.
3701 */
3702 #define RX_PROD_AGG_BD_FLAGS_EOP_PAD UINT32_C(0x40)
3703 /*
3704 * This is the length in Bytes of the host physical buffer where
3705 * data for the packet may be placed in host memory.
3706 */
3707 uint16_t len;
3708 /*
3709 * The opaque data field is pass through to the completion and can be
3710 * used for any data that the driver wants to associate with this
3711 * receive assembly buffer.
3712 */
3713 uint32_t opaque;
3714 /*
3715 * This is the host physical address where data for the packet may
3716 * be placed in host memory.
3717 */
3718 uint64_t addr;
3719 } rx_prod_agg_bd_t, *prx_prod_agg_bd_t;
3720
3721 /* cfa_cmpls_cmp_data_msg (size:128b/16B) */
3722
3723 typedef struct cfa_cmpls_cmp_data_msg {
3724 uint32_t mp_client_dma_length_opcode_status_type;
3725 /*
3726 * This field represents the Mid-Path client that generated the
3727 * completion.
3728 */
3729 #define CFA_CMPLS_CMP_DATA_MSG_TYPE_MASK UINT32_C(0x3f)
3730 #define CFA_CMPLS_CMP_DATA_MSG_TYPE_SFT 0
3731 /* Mid Path Short Completion with length = 16B. */
3732 #define CFA_CMPLS_CMP_DATA_MSG_TYPE_MID_PATH_SHORT UINT32_C(0x1e)
3733 #define CFA_CMPLS_CMP_DATA_MSG_TYPE_LAST CFA_CMPLS_CMP_DATA_MSG_TYPE_MID_PATH_SHORT
3734 /* This value indicates the status for the command. */
3735 #define CFA_CMPLS_CMP_DATA_MSG_STATUS_MASK UINT32_C(0x3c0)
3736 #define CFA_CMPLS_CMP_DATA_MSG_STATUS_SFT 6
3737 /* Completed without error. */
3738 #define CFA_CMPLS_CMP_DATA_MSG_STATUS_OK (UINT32_C(0x0) << 6)
3739 /* Indicates an unsupported CFA opcode in the command. */
3740 #define CFA_CMPLS_CMP_DATA_MSG_STATUS_UNSPRT_ERR (UINT32_C(0x1) << 6)
3741 /*
3742 * Indicates a CFA command formatting error. This error can occur on
3743 * any of the supported CFA commands.
3744 */
3745 #define CFA_CMPLS_CMP_DATA_MSG_STATUS_FMT_ERR (UINT32_C(0x2) << 6)
3746 /*
3747 * Indicates an SVIF-Table scope error. This error can occur on any
3748 * of the supported CFA commands.
3749 */
3750 #define CFA_CMPLS_CMP_DATA_MSG_STATUS_SCOPE_ERR (UINT32_C(0x3) << 6)
3751 /*
3752 * Indicates that the table_index is either outside of the
3753 * table_scope range set by its EM_SIZE or, for EM Insert, it is in
3754 * the static bucket range. This error can occur on EM Insert
3755 * commands. It can also occur on Read, Read Clear, Write, and
3756 * Invalidate commands if the table_type is EM.
3757 */
3758 #define CFA_CMPLS_CMP_DATA_MSG_STATUS_ADDR_ERR (UINT32_C(0x4) << 6)
3759 /*
3760 * Cache operation responded with an error. This error can occur on
3761 * Read, Read Clear, Write, EM Insert, and EM Delete commands.
3762 */
3763 #define CFA_CMPLS_CMP_DATA_MSG_STATUS_CACHE_ERR (UINT32_C(0x5) << 6)
3764 /*
3765 * Indicates failure on EM Insert or EM Delete Command. Hash index
3766 * and hash msb are returned in table_index and hash_msb fields.
3767 * Dma_length is set to 1 if the bucket is also returned (as dma
3768 * data).
3769 */
3770 #define CFA_CMPLS_CMP_DATA_MSG_STATUS_EM_FAIL (UINT32_C(0x6) << 6)
3771 /*
3772 * Indicates no notifications were available on an Event Collection
3773 * command.
3774 */
3775 #define CFA_CMPLS_CMP_DATA_MSG_STATUS_EVENT_COLLECT_FAIL (UINT32_C(0x7) << 6)
3776 #define CFA_CMPLS_CMP_DATA_MSG_STATUS_LAST CFA_CMPLS_CMP_DATA_MSG_STATUS_EVENT_COLLECT_FAIL
3777 #define CFA_CMPLS_CMP_DATA_MSG_UNUSED0_MASK UINT32_C(0xc00)
3778 #define CFA_CMPLS_CMP_DATA_MSG_UNUSED0_SFT 10
3779 /* This is the opcode from the command. */
3780 #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_MASK UINT32_C(0xff000)
3781 #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_SFT 12
3782 /*
3783 * This is read command. From 32 to 128B can be read from a table
3784 * using this command.
3785 */
3786 #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_READ (UINT32_C(0x0) << 12)
3787 /*
3788 * This is write command. From 32 to 128B can be written to a table
3789 * using this command.
3790 */
3791 #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_WRITE (UINT32_C(0x1) << 12)
3792 /*
3793 * This is read-clear command. 32B can be read from a table and a 16b
3794 * mask can be used to clear specific 16b units after the read as an
3795 * atomic operation.
3796 */
3797 #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_READ_CLR (UINT32_C(0x2) << 12)
3798 /*
3799 * An exact match table insert will be attempted into the table. If
3800 * there is a free location in the bucket, the payload will be
3801 * written to the bucket.
3802 */
3803 #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_EM_INSERT (UINT32_C(0x3) << 12)
3804 /* An exact match table delete will be attempted. */
3805 #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_EM_DELETE (UINT32_C(0x4) << 12)
3806 /*
3807 * The specified table area will be invalidated. If it is needed
3808 * again, it will be read from the backing store.
3809 */
3810 #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_INVALIDATE (UINT32_C(0x5) << 12)
3811 /* Reads notification messages from the Host Notification Queue. */
3812 #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_EVENT_COLLECT (UINT32_C(0x6) << 12)
3813 #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_LAST CFA_CMPLS_CMP_DATA_MSG_OPCODE_EVENT_COLLECT
3814 /*
3815 * This field indicates the length of the DMA that accompanies the
3816 * completion. Specified in units of DWords (32b). Valid values are
3817 * between 0 and 128. A value of zero indicates that there is no DMA
3818 * that accompanies the completion.
3819 */
3820 #define CFA_CMPLS_CMP_DATA_MSG_DMA_LENGTH_MASK UINT32_C(0xff00000)
3821 #define CFA_CMPLS_CMP_DATA_MSG_DMA_LENGTH_SFT 20
3822 /*
3823 * This field represents the Mid-Path client that generated the
3824 * completion.
3825 */
3826 #define CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_MASK UINT32_C(0xf0000000)
3827 #define CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_SFT 28
3828 /* TX configrable flow processing block. */
3829 #define CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_TE_CFA (UINT32_C(0x2) << 28)
3830 /* RX configrable flow processing block. */
3831 #define CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_RE_CFA (UINT32_C(0x3) << 28)
3832 #define CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_LAST CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_RE_CFA
3833 /*
3834 * This is a copy of the opaque field from the mid path BD of this
3835 * command.
3836 */
3837 uint32_t opaque;
3838 uint16_t hash_msb_v;
3839 /*
3840 * This value is written by the NIC such that it will be different for
3841 * each pass through the completion queue. The even passes will
3842 * write 1. The odd passes will write 0.
3843 */
3844 #define CFA_CMPLS_CMP_DATA_MSG_V UINT32_C(0x1)
3845 #define CFA_CMPLS_CMP_DATA_MSG_UNUSED1_MASK UINT32_C(0xe)
3846 #define CFA_CMPLS_CMP_DATA_MSG_UNUSED1_SFT 1
3847 /*
3848 * This is the upper 12b of the hash, returned on Exact Match
3849 * Insertion/Deletion Commands.
3850 */
3851 #define CFA_CMPLS_CMP_DATA_MSG_HASH_MSB_MASK UINT32_C(0xfff0)
3852 #define CFA_CMPLS_CMP_DATA_MSG_HASH_MSB_SFT 4
3853 /* This is the table type from the command. */
3854 uint8_t table_type;
3855 #define CFA_CMPLS_CMP_DATA_MSG_UNUSED2_MASK UINT32_C(0xf)
3856 #define CFA_CMPLS_CMP_DATA_MSG_UNUSED2_SFT 0
3857 #define CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_MASK UINT32_C(0xf0)
3858 #define CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_SFT 4
3859 /* This command acts on the action table of the specified scope. */
3860 #define CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_ACTION (UINT32_C(0x0) << 4)
3861 /* This command acts on the exact match table of the specified scope. */
3862 #define CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_EM (UINT32_C(0x1) << 4)
3863 #define CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_LAST CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_EM
3864 uint8_t table_scope;
3865 /* This is the table scope from the command. */
3866 #define CFA_CMPLS_CMP_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
3867 #define CFA_CMPLS_CMP_DATA_MSG_TABLE_SCOPE_SFT 0
3868 uint32_t table_index;
3869 /*
3870 * This is the table index from the command (if it exists). However, if
3871 * an Exact Match Insertion/Deletion command failed, then this is the
3872 * table index of the calculated static hash bucket.
3873 */
3874 #define CFA_CMPLS_CMP_DATA_MSG_TABLE_INDEX_MASK UINT32_C(0x3ffffff)
3875 #define CFA_CMPLS_CMP_DATA_MSG_TABLE_INDEX_SFT 0
3876 } cfa_cmpls_cmp_data_msg_t, *pcfa_cmpls_cmp_data_msg_t;
3877
3878 /* CFA Mid-Path 32B DMA Message */
3879 /* cfa_dma32b_data_msg (size:256b/32B) */
3880
3881 typedef struct cfa_dma32b_data_msg {
3882 /* DMA data value. */
3883 uint32_t dta[8];
3884 } cfa_dma32b_data_msg_t, *pcfa_dma32b_data_msg_t;
3885
3886 /* CFA Mid-Path 64B DMA Message */
3887 /* cfa_dma64b_data_msg (size:512b/64B) */
3888
3889 typedef struct cfa_dma64b_data_msg {
3890 /* DMA data value. */
3891 uint32_t dta[16];
3892 } cfa_dma64b_data_msg_t, *pcfa_dma64b_data_msg_t;
3893
3894 /* CFA Mid-Path 96B DMA Message */
3895 /* cfa_dma96b_data_msg (size:768b/96B) */
3896
3897 typedef struct cfa_dma96b_data_msg {
3898 /* DMA data value. */
3899 uint32_t dta[24];
3900 } cfa_dma96b_data_msg_t, *pcfa_dma96b_data_msg_t;
3901
3902 /* CFA Mid-Path 128B DMA Message */
3903 /* cfa_dma128b_data_msg (size:1024b/128B) */
3904
3905 typedef struct cfa_dma128b_data_msg {
3906 /* DMA data value. */
3907 uint32_t dta[32];
3908 } cfa_dma128b_data_msg_t, *pcfa_dma128b_data_msg_t;
3909
3910 /* ce_cmpls_cmp_data_msg (size:128b/16B) */
3911
3912 typedef struct ce_cmpls_cmp_data_msg {
3913 uint16_t status_subtype_type;
3914 /*
3915 * This field indicates the exact type of the completion. By
3916 * convention, the LSB identifies the length of the record in 16B
3917 * units. Even values indicate 16B records. Odd values indicate 32B
3918 * records.
3919 */
3920 #define CE_CMPLS_CMP_DATA_MSG_TYPE_MASK UINT32_C(0x3f)
3921 #define CE_CMPLS_CMP_DATA_MSG_TYPE_SFT 0
3922 /* Completion of a Mid Path Command. Length = 16B */
3923 #define CE_CMPLS_CMP_DATA_MSG_TYPE_MID_PATH_SHORT UINT32_C(0x1e)
3924 #define CE_CMPLS_CMP_DATA_MSG_TYPE_LAST CE_CMPLS_CMP_DATA_MSG_TYPE_MID_PATH_SHORT
3925 /*
3926 * This value indicates the CE sub-type operation that is being
3927 * completed.
3928 */
3929 #define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_MASK UINT32_C(0x3c0)
3930 #define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_SFT 6
3931 /* Completion Response for a Solicited Command. */
3932 #define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_SOLICITED (UINT32_C(0x0) << 6)
3933 /* Error Completion (Unsolicited). */
3934 #define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_ERR (UINT32_C(0x1) << 6)
3935 /* Re-Sync Completion (Unsolicited) */
3936 #define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_RESYNC (UINT32_C(0x2) << 6)
3937 #define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_LAST CE_CMPLS_CMP_DATA_MSG_SUBTYPE_RESYNC
3938 /* This value indicates the status for the command. */
3939 #define CE_CMPLS_CMP_DATA_MSG_STATUS_MASK UINT32_C(0x3c00)
3940 #define CE_CMPLS_CMP_DATA_MSG_STATUS_SFT 10
3941 /* Completed without error. */
3942 #define CE_CMPLS_CMP_DATA_MSG_STATUS_OK (UINT32_C(0x0) << 10)
3943 /* CFCK load error. */
3944 #define CE_CMPLS_CMP_DATA_MSG_STATUS_CTX_LD_ERR (UINT32_C(0x1) << 10)
3945 /* FID check error. */
3946 #define CE_CMPLS_CMP_DATA_MSG_STATUS_FID_CHK_ERR (UINT32_C(0x2) << 10)
3947 #define CE_CMPLS_CMP_DATA_MSG_STATUS_LAST CE_CMPLS_CMP_DATA_MSG_STATUS_FID_CHK_ERR
3948 uint8_t unused0;
3949 uint8_t mp_clients;
3950 #define CE_CMPLS_CMP_DATA_MSG_UNUSED1_MASK UINT32_C(0xf)
3951 #define CE_CMPLS_CMP_DATA_MSG_UNUSED1_SFT 0
3952 /*
3953 * This field represents the Mid-Path client that generated the
3954 * completion.
3955 */
3956 #define CE_CMPLS_CMP_DATA_MSG_MP_CLIENTS_MASK UINT32_C(0xf0)
3957 #define CE_CMPLS_CMP_DATA_MSG_MP_CLIENTS_SFT 4
3958 /* TX crypto engine block. */
3959 #define CE_CMPLS_CMP_DATA_MSG_MP_CLIENTS_TCE (UINT32_C(0x0) << 4)
3960 /* RX crypto engine block. */
3961 #define CE_CMPLS_CMP_DATA_MSG_MP_CLIENTS_RCE (UINT32_C(0x1) << 4)
3962 #define CE_CMPLS_CMP_DATA_MSG_MP_CLIENTS_LAST CE_CMPLS_CMP_DATA_MSG_MP_CLIENTS_RCE
3963 /*
3964 * This is a copy of the opaque field from the mid path BD of this
3965 * command.
3966 */
3967 uint32_t opaque;
3968 /* */
3969 uint32_t kid_v;
3970 /*
3971 * This value is written by the NIC such that it will be different
3972 * for each pass through the completion queue. The even passes will
3973 * write 1. The odd passes will write 0.
3974 */
3975 #define CE_CMPLS_CMP_DATA_MSG_V UINT32_C(0x1)
3976 /*
3977 * This field is the Crypto Context ID. The KID is used to store
3978 * information used by the associated kTLS offloaded connection.
3979 */
3980 #define CE_CMPLS_CMP_DATA_MSG_KID_MASK UINT32_C(0x1ffffe)
3981 #define CE_CMPLS_CMP_DATA_MSG_KID_SFT 1
3982 uint32_t unused2;
3983 } ce_cmpls_cmp_data_msg_t, *pce_cmpls_cmp_data_msg_t;
3984
3985 /* cmpl_base (size:128b/16B) */
3986
3987 typedef struct cmpl_base {
3988 uint16_t type;
3989 /*
3990 * This field indicates the exact type of the completion.
3991 * By convention, the LSB identifies the length of the
3992 * record in 16B units. Even values indicate 16B
3993 * records. Odd values indicate 32B
3994 * records.
3995 */
3996 #define CMPL_BASE_TYPE_MASK UINT32_C(0x3f)
3997 #define CMPL_BASE_TYPE_SFT 0
3998 /*
3999 * TX L2 completion:
4000 * Completion of TX packet. Length = 16B
4001 */
4002 #define CMPL_BASE_TYPE_TX_L2 UINT32_C(0x0)
4003 /*
4004 * NO-OP completion:
4005 * Completion of NO-OP. Length = 16B
4006 */
4007 #define CMPL_BASE_TYPE_NO_OP UINT32_C(0x1)
4008 /*
4009 * TX L2 coalesced completion:
4010 * Completion of coalesced TX packet. Length = 16B
4011 */
4012 #define CMPL_BASE_TYPE_TX_L2_COAL UINT32_C(0x2)
4013 /*
4014 * TX L2 PTP completion:
4015 * Completion of PTP TX packet. Length = 32B
4016 */
4017 #define CMPL_BASE_TYPE_TX_L2_PTP UINT32_C(0x3)
4018 /*
4019 * RX L2 TPA Start V2 Completion:
4020 * Completion of and L2 RX packet. Length = 32B
4021 * This is the new version of the RX_TPA_START completion used
4022 * in SR2 and later chips.
4023 */
4024 #define CMPL_BASE_TYPE_RX_TPA_START_V2 UINT32_C(0xd)
4025 /*
4026 * RX L2 V2 completion:
4027 * Completion of and L2 RX packet. Length = 32B
4028 * This is the new version of the RX_L2 completion used in SR2
4029 * and later chips.
4030 */
4031 #define CMPL_BASE_TYPE_RX_L2_V2 UINT32_C(0xf)
4032 /*
4033 * RX L2 completion:
4034 * Completion of and L2 RX packet. Length = 32B
4035 */
4036 #define CMPL_BASE_TYPE_RX_L2 UINT32_C(0x11)
4037 /*
4038 * RX Aggregation Buffer completion :
4039 * Completion of an L2 aggregation buffer in support of
4040 * TPA, HDS, or Jumbo packet completion. Length = 16B
4041 */
4042 #define CMPL_BASE_TYPE_RX_AGG UINT32_C(0x12)
4043 /*
4044 * RX L2 TPA Start Completion:
4045 * Completion at the beginning of a TPA operation.
4046 * Length = 32B
4047 */
4048 #define CMPL_BASE_TYPE_RX_TPA_START UINT32_C(0x13)
4049 /*
4050 * RX L2 TPA End Completion:
4051 * Completion at the end of a TPA operation.
4052 * Length = 32B
4053 */
4054 #define CMPL_BASE_TYPE_RX_TPA_END UINT32_C(0x15)
4055 /*
4056 * Statistics Ejection Completion:
4057 * Completion of statistics data ejection buffer.
4058 * Length = 16B
4059 */
4060 #define CMPL_BASE_TYPE_STAT_EJECT UINT32_C(0x1a)
4061 /*
4062 * VEE Flush Completion:
4063 * This completion is inserted manually by
4064 * the Primate and processed by the VEE hardware to ensure that
4065 * all completions on a VEE function have been processed by the
4066 * VEE hardware before FLR process is completed.
4067 */
4068 #define CMPL_BASE_TYPE_VEE_FLUSH UINT32_C(0x1c)
4069 /*
4070 * Mid Path Short Completion :
4071 * Completion of a Mid Path Command. Length = 16B
4072 */
4073 #define CMPL_BASE_TYPE_MID_PATH_SHORT UINT32_C(0x1e)
4074 /*
4075 * Mid Path Long Completion :
4076 * Completion of a Mid Path Command. Length = 32B
4077 */
4078 #define CMPL_BASE_TYPE_MID_PATH_LONG UINT32_C(0x1f)
4079 /*
4080 * HWRM Command Completion:
4081 * Completion of an HWRM command.
4082 */
4083 #define CMPL_BASE_TYPE_HWRM_DONE UINT32_C(0x20)
4084 /* Forwarded HWRM Request */
4085 #define CMPL_BASE_TYPE_HWRM_FWD_REQ UINT32_C(0x22)
4086 /* Forwarded HWRM Response */
4087 #define CMPL_BASE_TYPE_HWRM_FWD_RESP UINT32_C(0x24)
4088 /* HWRM Asynchronous Event Information */
4089 #define CMPL_BASE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
4090 /* CQ Notification */
4091 #define CMPL_BASE_TYPE_CQ_NOTIFICATION UINT32_C(0x30)
4092 /* SRQ Threshold Event */
4093 #define CMPL_BASE_TYPE_SRQ_EVENT UINT32_C(0x32)
4094 /* DBQ Threshold Event */
4095 #define CMPL_BASE_TYPE_DBQ_EVENT UINT32_C(0x34)
4096 /* QP Async Notification */
4097 #define CMPL_BASE_TYPE_QP_EVENT UINT32_C(0x38)
4098 /* Function Async Notification */
4099 #define CMPL_BASE_TYPE_FUNC_EVENT UINT32_C(0x3a)
4100 #define CMPL_BASE_TYPE_LAST CMPL_BASE_TYPE_FUNC_EVENT
4101 /* info1 is 16 b */
4102 uint16_t info1;
4103 /* info2 is 32 b */
4104 uint32_t info2;
4105 /*
4106 * This value is written by the NIC such that it will be different
4107 * for each pass through the completion queue. The even passes
4108 * will write 1. The odd passes will write 0.
4109 */
4110 uint32_t info3_v;
4111 #define CMPL_BASE_V UINT32_C(0x1)
4112 #define CMPL_BASE_INFO3_MASK UINT32_C(0xfffffffe)
4113 #define CMPL_BASE_INFO3_SFT 1
4114 /* info4 is 32 b */
4115 uint32_t info4;
4116 } cmpl_base_t, *pcmpl_base_t;
4117
4118 /* tx_cmpl (size:128b/16B) */
4119
4120 typedef struct tx_cmpl {
4121 uint16_t flags_type;
4122 /*
4123 * This field indicates the exact type of the completion.
4124 * By convention, the LSB identifies the length of the
4125 * record in 16B units. Even values indicate 16B
4126 * records. Odd values indicate 32B
4127 * records.
4128 */
4129 #define TX_CMPL_TYPE_MASK UINT32_C(0x3f)
4130 #define TX_CMPL_TYPE_SFT 0
4131 /*
4132 * TX L2 completion:
4133 * Completion of TX packet. Length = 16B
4134 */
4135 #define TX_CMPL_TYPE_TX_L2 UINT32_C(0x0)
4136 #define TX_CMPL_TYPE_LAST TX_CMPL_TYPE_TX_L2
4137 #define TX_CMPL_FLAGS_MASK UINT32_C(0xffc0)
4138 #define TX_CMPL_FLAGS_SFT 6
4139 /*
4140 * When this bit is '1', it indicates a packet that has an
4141 * error of some type. Type of error is indicated in
4142 * error_flags.
4143 */
4144 #define TX_CMPL_FLAGS_ERROR UINT32_C(0x40)
4145 /*
4146 * When this bit is '1', it indicates that the packet completed
4147 * was transmitted using the push acceleration data provided
4148 * by the driver. When this bit is '', it indicates that the
4149 * packet had not push acceleration data written or was executed
4150 * as a normal packet even though push data was provided.
4151 */
4152 #define TX_CMPL_FLAGS_PUSH UINT32_C(0x80)
4153 /* unused1 is 16 b */
4154 uint16_t unused_0;
4155 /*
4156 * This is a copy of the opaque field from the first TX BD of this
4157 * transmitted packet. Note that, if the packet was described by a short
4158 * CSO or short CSO inline BD, then the 16-bit opaque field from the
4159 * short CSO BD will appear in the bottom 16 bits of this field.
4160 */
4161 uint32_t opaque;
4162 uint16_t errors_v;
4163 /*
4164 * This value is written by the NIC such that it will be different
4165 * for each pass through the completion queue. The even passes
4166 * will write 1. The odd passes will write 0.
4167 */
4168 #define TX_CMPL_V UINT32_C(0x1)
4169 #define TX_CMPL_ERRORS_MASK UINT32_C(0xfffe)
4170 #define TX_CMPL_ERRORS_SFT 1
4171 /*
4172 * This error indicates that there was some sort of problem
4173 * with the BDs for the packet.
4174 */
4175 #define TX_CMPL_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe)
4176 #define TX_CMPL_ERRORS_BUFFER_ERROR_SFT 1
4177 /* No error */
4178 #define TX_CMPL_ERRORS_BUFFER_ERROR_NO_ERROR (UINT32_C(0x0) << 1)
4179 /*
4180 * Bad Format:
4181 * BDs were not formatted correctly.
4182 */
4183 #define TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT (UINT32_C(0x2) << 1)
4184 #define TX_CMPL_ERRORS_BUFFER_ERROR_LAST TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT
4185 /*
4186 * When this bit is '1', it indicates that the length of
4187 * the packet was zero. No packet was transmitted.
4188 */
4189 #define TX_CMPL_ERRORS_ZERO_LENGTH_PKT UINT32_C(0x10)
4190 /*
4191 * When this bit is '1', it indicates that the packet
4192 * was longer than the programmed limit in TDI. No
4193 * packet was transmitted.
4194 */
4195 #define TX_CMPL_ERRORS_EXCESSIVE_BD_LENGTH UINT32_C(0x20)
4196 /*
4197 * When this bit is '1', it indicates that one or more of the
4198 * BDs associated with this packet generated a PCI error.
4199 * This probably means the address was not valid.
4200 */
4201 #define TX_CMPL_ERRORS_DMA_ERROR UINT32_C(0x40)
4202 /*
4203 * When this bit is '1', it indicates that the packet was longer
4204 * than indicated by the hint. No packet was transmitted.
4205 */
4206 #define TX_CMPL_ERRORS_HINT_TOO_SHORT UINT32_C(0x80)
4207 /*
4208 * When this bit is '1', it indicates that the packet was
4209 * dropped due to Poison TLP error on one or more of the
4210 * TLPs in the PXP completion.
4211 */
4212 #define TX_CMPL_ERRORS_POISON_TLP_ERROR UINT32_C(0x100)
4213 /*
4214 * When this bit is '1', it indicates that the packet was dropped
4215 * due to a transient internal error in TDC. The packet or LSO can
4216 * be retried and may transmit successfully on a subsequent attempt.
4217 */
4218 #define TX_CMPL_ERRORS_INTERNAL_ERROR UINT32_C(0x200)
4219 /*
4220 * When this bit is '1', it was not possible to collect a a timestamp
4221 * for a PTP completion, in which case the timestamp_hi and
4222 * timestamp_lo fields are invalid. When this bit is '' for a PTP
4223 * completion, the timestamp_hi and timestamp_lo fields are valid.
4224 * RJRN will copy the value of this bit into the field of the same
4225 * name in all TX completions, regardless of whether such completions
4226 * are PTP completions or other TX completions.
4227 */
4228 #define TX_CMPL_ERRORS_TIMESTAMP_INVALID_ERROR UINT32_C(0x400)
4229 /* unused2 is 16 b */
4230 uint16_t unused_1;
4231 /* unused3 is 32 b */
4232 uint32_t unused_2;
4233 } tx_cmpl_t, *ptx_cmpl_t;
4234
4235 /* tx_cmpl_coal (size:128b/16B) */
4236
4237 typedef struct tx_cmpl_coal {
4238 uint16_t flags_type;
4239 /*
4240 * This field indicates the exact type of the completion.
4241 * By convention, the LSB identifies the length of the
4242 * record in 16B units. Even values indicate 16B
4243 * records. Odd values indicate 32B
4244 * records.
4245 */
4246 #define TX_CMPL_COAL_TYPE_MASK UINT32_C(0x3f)
4247 #define TX_CMPL_COAL_TYPE_SFT 0
4248 /*
4249 * TX L2 coalesced completion:
4250 * Completion of TX packet. Length = 16B
4251 */
4252 #define TX_CMPL_COAL_TYPE_TX_L2_COAL UINT32_C(0x2)
4253 #define TX_CMPL_COAL_TYPE_LAST TX_CMPL_COAL_TYPE_TX_L2_COAL
4254 #define TX_CMPL_COAL_FLAGS_MASK UINT32_C(0xffc0)
4255 #define TX_CMPL_COAL_FLAGS_SFT 6
4256 /*
4257 * When this bit is '1', it indicates a packet that has an
4258 * error of some type. Type of error is indicated in
4259 * error_flags.
4260 */
4261 #define TX_CMPL_COAL_FLAGS_ERROR UINT32_C(0x40)
4262 /*
4263 * When this bit is '1', it indicates that the packet completed
4264 * was transmitted using the push acceleration data provided
4265 * by the driver. When this bit is '', it indicates that the
4266 * packet had not push acceleration data written or was executed
4267 * as a normal packet even though push data was provided.
4268 */
4269 #define TX_CMPL_COAL_FLAGS_PUSH UINT32_C(0x80)
4270 /* unused1 is 16 b */
4271 uint16_t unused_0;
4272 /*
4273 * This is a copy of the opaque field from the first TX BD of the packet
4274 * which corresponds with the reported sq_cons_idx. Note that, with
4275 * coalesced completions, completions are generated for only some of the
4276 * packets. The driver will see the opaque field for only those packets.
4277 * Note that, if the packet was described by a short CSO or short CSO
4278 * inline BD, then the 16-bit opaque field from the short CSO BD will
4279 * appear in the bottom 16 bits of this field. For TX rings with
4280 * completion coalescing enabled (which would use the coalesced
4281 * completion record), it is suggested that the driver populate the
4282 * opaque field to indicate the specific TX ring with which the
4283 * completion is associated, then utilize the opaque and sq_cons_idx
4284 * fields in the coalesced completion record to determine the specific
4285 * packets that are to be completed on that ring.
4286 */
4287 uint32_t opaque;
4288 uint16_t errors_v;
4289 /*
4290 * This value is written by the NIC such that it will be different
4291 * for each pass through the completion queue. The even passes
4292 * will write 1. The odd passes will write 0.
4293 */
4294 #define TX_CMPL_COAL_V UINT32_C(0x1)
4295 #define TX_CMPL_COAL_ERRORS_MASK UINT32_C(0xfffe)
4296 #define TX_CMPL_COAL_ERRORS_SFT 1
4297 /*
4298 * This error indicates that there was some sort of problem
4299 * with the BDs for the packet.
4300 */
4301 #define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe)
4302 #define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_SFT 1
4303 /* No error */
4304 #define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_NO_ERROR (UINT32_C(0x0) << 1)
4305 /*
4306 * Bad Format:
4307 * BDs were not formatted correctly.
4308 */
4309 #define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_BAD_FMT (UINT32_C(0x2) << 1)
4310 #define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_LAST TX_CMPL_COAL_ERRORS_BUFFER_ERROR_BAD_FMT
4311 /*
4312 * When this bit is '1', it indicates that the length of
4313 * the packet was zero. No packet was transmitted.
4314 */
4315 #define TX_CMPL_COAL_ERRORS_ZERO_LENGTH_PKT UINT32_C(0x10)
4316 /*
4317 * When this bit is '1', it indicates that the packet
4318 * was longer than the programmed limit in TDI. No
4319 * packet was transmitted.
4320 */
4321 #define TX_CMPL_COAL_ERRORS_EXCESSIVE_BD_LENGTH UINT32_C(0x20)
4322 /*
4323 * When this bit is '1', it indicates that one or more of the
4324 * BDs associated with this packet generated a PCI error.
4325 * This probably means the address was not valid.
4326 */
4327 #define TX_CMPL_COAL_ERRORS_DMA_ERROR UINT32_C(0x40)
4328 /*
4329 * When this bit is '1', it indicates that the packet was longer
4330 * than indicated by the hint. No packet was transmitted.
4331 */
4332 #define TX_CMPL_COAL_ERRORS_HINT_TOO_SHORT UINT32_C(0x80)
4333 /*
4334 * When this bit is '1', it indicates that the packet was
4335 * dropped due to Poison TLP error on one or more of the
4336 * TLPs in the PXP completion.
4337 */
4338 #define TX_CMPL_COAL_ERRORS_POISON_TLP_ERROR UINT32_C(0x100)
4339 /*
4340 * When this bit is '1', it indicates that the packet was dropped
4341 * due to a transient internal error in TDC. The packet or LSO can
4342 * be retried and may transmit successfully on a subsequent attempt.
4343 */
4344 #define TX_CMPL_COAL_ERRORS_INTERNAL_ERROR UINT32_C(0x200)
4345 /*
4346 * When this bit is '1', it was not possible to collect a a timestamp
4347 * for a PTP completion, in which case the timestamp_hi and
4348 * timestamp_lo fields are invalid. When this bit is '' for a PTP
4349 * completion, the timestamp_hi and timestamp_lo fields are valid.
4350 * RJRN will copy the value of this bit into the field of the same
4351 * name in all TX completions, regardless of whether such
4352 * completions are PTP completions or other TX completions.
4353 */
4354 #define TX_CMPL_COAL_ERRORS_TIMESTAMP_INVALID_ERROR UINT32_C(0x400)
4355 /* unused2 is 16 b */
4356 uint16_t unused_1;
4357 uint32_t sq_cons_idx;
4358 /*
4359 * This value is SQ index for the start of the packet following the
4360 * last completed packet.
4361 */
4362 #define TX_CMPL_COAL_SQ_CONS_IDX_MASK UINT32_C(0xffffff)
4363 #define TX_CMPL_COAL_SQ_CONS_IDX_SFT 0
4364 } tx_cmpl_coal_t, *ptx_cmpl_coal_t;
4365
4366 /* tx_cmpl_ptp (size:128b/16B) */
4367
4368 typedef struct tx_cmpl_ptp {
4369 uint16_t flags_type;
4370 /*
4371 * This field indicates the exact type of the completion.
4372 * By convention, the LSB identifies the length of the
4373 * record in 16B units. Even values indicate 16B
4374 * records. Odd values indicate 32B
4375 * records.
4376 */
4377 #define TX_CMPL_PTP_TYPE_MASK UINT32_C(0x3f)
4378 #define TX_CMPL_PTP_TYPE_SFT 0
4379 /*
4380 * TX L2 PTP completion:
4381 * Completion of TX packet. Length = 32B
4382 */
4383 #define TX_CMPL_PTP_TYPE_TX_L2_PTP UINT32_C(0x2)
4384 #define TX_CMPL_PTP_TYPE_LAST TX_CMPL_PTP_TYPE_TX_L2_PTP
4385 #define TX_CMPL_PTP_FLAGS_MASK UINT32_C(0xffc0)
4386 #define TX_CMPL_PTP_FLAGS_SFT 6
4387 /*
4388 * When this bit is '1', it indicates a packet that has an
4389 * error of some type. Type of error is indicated in
4390 * error_flags.
4391 */
4392 #define TX_CMPL_PTP_FLAGS_ERROR UINT32_C(0x40)
4393 /*
4394 * When this bit is '1', it indicates that the packet completed
4395 * was transmitted using the push acceleration data provided
4396 * by the driver. When this bit is '', it indicates that the
4397 * packet had not push acceleration data written or was executed
4398 * as a normal packet even though push data was provided.
4399 */
4400 #define TX_CMPL_PTP_FLAGS_PUSH UINT32_C(0x80)
4401 /* unused1 is 16 b */
4402 uint16_t unused_0;
4403 /*
4404 * This is a copy of the opaque field from the first TX BD of this
4405 * transmitted packet. Note that, if the packet was described by a short
4406 * CSO or short CSO inline BD, then the 16-bit opaque field from the
4407 * short CSO BD will appear in the bottom 16 bits of this field.
4408 */
4409 uint32_t opaque;
4410 uint16_t errors_v;
4411 /*
4412 * This value is written by the NIC such that it will be different
4413 * for each pass through the completion queue. The even passes
4414 * will write 1. The odd passes will write 0.
4415 */
4416 #define TX_CMPL_PTP_V UINT32_C(0x1)
4417 #define TX_CMPL_PTP_ERRORS_MASK UINT32_C(0xfffe)
4418 #define TX_CMPL_PTP_ERRORS_SFT 1
4419 /*
4420 * This error indicates that there was some sort of problem
4421 * with the BDs for the packet.
4422 */
4423 #define TX_CMPL_PTP_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe)
4424 #define TX_CMPL_PTP_ERRORS_BUFFER_ERROR_SFT 1
4425 /* No error */
4426 #define TX_CMPL_PTP_ERRORS_BUFFER_ERROR_NO_ERROR (UINT32_C(0x0) << 1)
4427 /*
4428 * Bad Format:
4429 * BDs were not formatted correctly.
4430 */
4431 #define TX_CMPL_PTP_ERRORS_BUFFER_ERROR_BAD_FMT (UINT32_C(0x2) << 1)
4432 #define TX_CMPL_PTP_ERRORS_BUFFER_ERROR_LAST TX_CMPL_PTP_ERRORS_BUFFER_ERROR_BAD_FMT
4433 /*
4434 * When this bit is '1', it indicates that the length of
4435 * the packet was zero. No packet was transmitted.
4436 */
4437 #define TX_CMPL_PTP_ERRORS_ZERO_LENGTH_PKT UINT32_C(0x10)
4438 /*
4439 * When this bit is '1', it indicates that the packet
4440 * was longer than the programmed limit in TDI. No
4441 * packet was transmitted.
4442 */
4443 #define TX_CMPL_PTP_ERRORS_EXCESSIVE_BD_LENGTH UINT32_C(0x20)
4444 /*
4445 * When this bit is '1', it indicates that one or more of the
4446 * BDs associated with this packet generated a PCI error.
4447 * This probably means the address was not valid.
4448 */
4449 #define TX_CMPL_PTP_ERRORS_DMA_ERROR UINT32_C(0x40)
4450 /*
4451 * When this bit is '1', it indicates that the packet was longer
4452 * than indicated by the hint. No packet was transmitted.
4453 */
4454 #define TX_CMPL_PTP_ERRORS_HINT_TOO_SHORT UINT32_C(0x80)
4455 /*
4456 * When this bit is '1', it indicates that the packet was
4457 * dropped due to Poison TLP error on one or more of the
4458 * TLPs in the PXP completion.
4459 */
4460 #define TX_CMPL_PTP_ERRORS_POISON_TLP_ERROR UINT32_C(0x100)
4461 /*
4462 * When this bit is '1', it indicates that the packet was dropped due
4463 * to a transient internal error in TDC. The packet or LSO can be
4464 * retried and may transmit successfully on a subsequent attempt.
4465 */
4466 #define TX_CMPL_PTP_ERRORS_INTERNAL_ERROR UINT32_C(0x200)
4467 /*
4468 * When this bit is '1', it was not possible to collect a a timestamp
4469 * for a PTP completion, in which case the timestamp_hi and
4470 * timestamp_lo fields are invalid. When this bit is '' for a PTP
4471 * completion, the timestamp_hi and timestamp_lo fields are valid.
4472 * RJRN will copy the value of this bit into the field of the same
4473 * name in all TX completions, regardless of whether such
4474 * completions are PTP completions or other TX completions.
4475 */
4476 #define TX_CMPL_PTP_ERRORS_TIMESTAMP_INVALID_ERROR UINT32_C(0x400)
4477 /* unused2 is 16 b */
4478 uint16_t unused_1;
4479 /*
4480 * This is timestamp value (lower 32bits) read from PM for the PTP
4481 * timestamp enabled packet.
4482 */
4483 uint32_t timestamp_lo;
4484 } tx_cmpl_ptp_t, *ptx_cmpl_ptp_t;
4485
4486 /* tx_cmpl_ptp_hi (size:128b/16B) */
4487
4488 typedef struct tx_cmpl_ptp_hi {
4489 /*
4490 * This is timestamp value (lower 32bits) read from PM for the PTP
4491 * timestamp enabled packet.
4492 */
4493 uint16_t timestamp_hi[3];
4494 uint16_t reserved16;
4495 uint64_t v2;
4496 /*
4497 * This value is written by the NIC such that it will be different for
4498 * each pass through the completion queue.The even passes will write 1.
4499 * The odd passes will write 0
4500 */
4501 #define TX_CMPL_PTP_HI_V2 UINT32_C(0x1)
4502 } tx_cmpl_ptp_hi_t, *ptx_cmpl_ptp_hi_t;
4503
4504 /* rx_pkt_cmpl (size:128b/16B) */
4505
4506 typedef struct rx_pkt_cmpl {
4507 uint16_t flags_type;
4508 /*
4509 * This field indicates the exact type of the completion.
4510 * By convention, the LSB identifies the length of the
4511 * record in 16B units. Even values indicate 16B
4512 * records. Odd values indicate 32B
4513 * records.
4514 */
4515 #define RX_PKT_CMPL_TYPE_MASK UINT32_C(0x3f)
4516 #define RX_PKT_CMPL_TYPE_SFT 0
4517 /*
4518 * RX L2 completion:
4519 * Completion of and L2 RX packet. Length = 32B
4520 */
4521 #define RX_PKT_CMPL_TYPE_RX_L2 UINT32_C(0x11)
4522 #define RX_PKT_CMPL_TYPE_LAST RX_PKT_CMPL_TYPE_RX_L2
4523 #define RX_PKT_CMPL_FLAGS_MASK UINT32_C(0xffc0)
4524 #define RX_PKT_CMPL_FLAGS_SFT 6
4525 /*
4526 * When this bit is '1', it indicates a packet that has an
4527 * error of some type. Type of error is indicated in
4528 * error_flags.
4529 */
4530 #define RX_PKT_CMPL_FLAGS_ERROR UINT32_C(0x40)
4531 /* This field indicates how the packet was placed in the buffer. */
4532 #define RX_PKT_CMPL_FLAGS_PLACEMENT_MASK UINT32_C(0x380)
4533 #define RX_PKT_CMPL_FLAGS_PLACEMENT_SFT 7
4534 /*
4535 * Normal:
4536 * Packet was placed using normal algorithm.
4537 */
4538 #define RX_PKT_CMPL_FLAGS_PLACEMENT_NORMAL (UINT32_C(0x0) << 7)
4539 /*
4540 * Jumbo:
4541 * Packet was placed using jumbo algorithm.
4542 */
4543 #define RX_PKT_CMPL_FLAGS_PLACEMENT_JUMBO (UINT32_C(0x1) << 7)
4544 /*
4545 * Header/Data Separation:
4546 * Packet was placed using Header/Data separation algorithm.
4547 * The separation location is indicated by the itype field.
4548 */
4549 #define RX_PKT_CMPL_FLAGS_PLACEMENT_HDS (UINT32_C(0x2) << 7)
4550 #define RX_PKT_CMPL_FLAGS_PLACEMENT_LAST RX_PKT_CMPL_FLAGS_PLACEMENT_HDS
4551 /* This bit is '1' if the RSS field in this completion is valid. */
4552 #define RX_PKT_CMPL_FLAGS_RSS_VALID UINT32_C(0x400)
4553 /* unused is 1 b */
4554 #define RX_PKT_CMPL_FLAGS_UNUSED UINT32_C(0x800)
4555 /*
4556 * This value indicates what the inner packet determined for the
4557 * packet was.
4558 */
4559 #define RX_PKT_CMPL_FLAGS_ITYPE_MASK UINT32_C(0xf000)
4560 #define RX_PKT_CMPL_FLAGS_ITYPE_SFT 12
4561 /*
4562 * Not Known:
4563 * Indicates that the packet type was not known.
4564 */
4565 #define RX_PKT_CMPL_FLAGS_ITYPE_NOT_KNOWN (UINT32_C(0x0) << 12)
4566 /*
4567 * IP Packet:
4568 * Indicates that the packet was an IP packet, but further
4569 * classification was not possible.
4570 */
4571 #define RX_PKT_CMPL_FLAGS_ITYPE_IP (UINT32_C(0x1) << 12)
4572 /*
4573 * TCP Packet:
4574 * Indicates that the packet was IP and TCP.
4575 * This indicates that the payload_offset field is valid.
4576 */
4577 #define RX_PKT_CMPL_FLAGS_ITYPE_TCP (UINT32_C(0x2) << 12)
4578 /*
4579 * UDP Packet:
4580 * Indicates that the packet was IP and UDP.
4581 * This indicates that the payload_offset field is valid.
4582 */
4583 #define RX_PKT_CMPL_FLAGS_ITYPE_UDP (UINT32_C(0x3) << 12)
4584 /*
4585 * FCoE Packet:
4586 * Indicates that the packet was recognized as a FCoE.
4587 * This also indicates that the payload_offset field is valid.
4588 */
4589 #define RX_PKT_CMPL_FLAGS_ITYPE_FCOE (UINT32_C(0x4) << 12)
4590 /*
4591 * RoCE Packet:
4592 * Indicates that the packet was recognized as a RoCE.
4593 * This also indicates that the payload_offset field is valid.
4594 */
4595 #define RX_PKT_CMPL_FLAGS_ITYPE_ROCE (UINT32_C(0x5) << 12)
4596 /*
4597 * ICMP Packet:
4598 * Indicates that the packet was recognized as ICMP.
4599 * This indicates that the payload_offset field is valid.
4600 */
4601 #define RX_PKT_CMPL_FLAGS_ITYPE_ICMP (UINT32_C(0x7) << 12)
4602 /*
4603 * PtP packet wo/timestamp:
4604 * Indicates that the packet was recognized as a PtP
4605 * packet.
4606 */
4607 #define RX_PKT_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP (UINT32_C(0x8) << 12)
4608 /*
4609 * PtP packet w/timestamp:
4610 * Indicates that the packet was recognized as a PtP
4611 * packet and that a timestamp was taken for the packet.
4612 */
4613 #define RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP (UINT32_C(0x9) << 12)
4614 #define RX_PKT_CMPL_FLAGS_ITYPE_LAST RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
4615 /*
4616 * This is the length of the data for the packet stored in the
4617 * buffer(s) identified by the opaque value. This includes
4618 * the packet BD and any associated buffer BDs. This does not include
4619 * the length of any data places in aggregation BDs.
4620 */
4621 uint16_t len;
4622 /*
4623 * This is a copy of the opaque field from the RX BD this completion
4624 * corresponds to.
4625 */
4626 uint32_t opaque;
4627 uint8_t agg_bufs_v1;
4628 /*
4629 * This value is written by the NIC such that it will be different
4630 * for each pass through the completion queue. The even passes
4631 * will write 1. The odd passes will write 0.
4632 */
4633 #define RX_PKT_CMPL_V1 UINT32_C(0x1)
4634 /*
4635 * This value is the number of aggregation buffers that follow this
4636 * entry in the completion ring that are a part of this packet.
4637 * If the value is zero, then the packet is completely contained
4638 * in the buffer space provided for the packet in the RX ring.
4639 */
4640 #define RX_PKT_CMPL_AGG_BUFS_MASK UINT32_C(0x3e)
4641 #define RX_PKT_CMPL_AGG_BUFS_SFT 1
4642 /* unused1 is 2 b */
4643 #define RX_PKT_CMPL_UNUSED1_MASK UINT32_C(0xc0)
4644 #define RX_PKT_CMPL_UNUSED1_SFT 6
4645 /*
4646 * This is the RSS hash type for the packet. The value is packed
4647 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
4648 *
4649 * The value of tuple_extrac_op provides the information about
4650 * what fields the hash was computed on.
4651 * * 0: The RSS hash was computed over source IP address,
4652 * destination IP address, source port, and destination port of inner
4653 * IP and TCP or UDP headers. Note: For non-tunneled packets,
4654 * the packet headers are considered inner packet headers for the RSS
4655 * hash computation purpose.
4656 * * 1: The RSS hash was computed over source IP address and destination
4657 * IP address of inner IP header. Note: For non-tunneled packets,
4658 * the packet headers are considered inner packet headers for the RSS
4659 * hash computation purpose.
4660 * * 2: The RSS hash was computed over source IP address,
4661 * destination IP address, source port, and destination port of
4662 * IP and TCP or UDP headers of outer tunnel headers.
4663 * Note: For non-tunneled packets, this value is not applicable.
4664 * * 3: The RSS hash was computed over source IP address and
4665 * destination IP address of IP header of outer tunnel headers.
4666 * Note: For non-tunneled packets, this value is not applicable.
4667 *
4668 * Note that 4-tuples values listed above are applicable
4669 * for layer 4 protocols supported and enabled for RSS in the hardware,
4670 * HWRM firmware, and drivers. For example, if RSS hash is supported and
4671 * enabled for TCP traffic only, then the values of tuple_extract_op
4672 * corresponding to 4-tuples are only valid for TCP traffic.
4673 */
4674 uint8_t rss_hash_type;
4675 /*
4676 * This value indicates the offset in bytes from the beginning of the packet
4677 * where the inner payload starts. This value is valid for TCP, UDP,
4678 * FCoE, and RoCE packets.
4679 *
4680 * A value of zero indicates that header is 256B into the packet.
4681 */
4682 uint8_t payload_offset;
4683 /* unused2 is 8 b */
4684 uint8_t unused1;
4685 /*
4686 * This value is the RSS hash value calculated for the packet
4687 * based on the mode bits and key value in the VNIC.
4688 */
4689 uint32_t rss_hash;
4690 } rx_pkt_cmpl_t, *prx_pkt_cmpl_t;
4691
4692 /* Last 16 bytes of rx_pkt_cmpl. */
4693 /* rx_pkt_cmpl_hi (size:128b/16B) */
4694
4695 typedef struct rx_pkt_cmpl_hi {
4696 uint32_t flags2;
4697 /*
4698 * This indicates that the ip checksum was calculated for the
4699 * inner packet and that the ip_cs_error field indicates if there
4700 * was an error.
4701 */
4702 #define RX_PKT_CMPL_FLAGS2_IP_CS_CALC UINT32_C(0x1)
4703 /*
4704 * This indicates that the TCP, UDP or ICMP checksum was
4705 * calculated for the inner packet and that the l4_cs_error field
4706 * indicates if there was an error.
4707 */
4708 #define RX_PKT_CMPL_FLAGS2_L4_CS_CALC UINT32_C(0x2)
4709 /*
4710 * This indicates that the ip checksum was calculated for the
4711 * tunnel header and that the t_ip_cs_error field indicates if there
4712 * was an error.
4713 */
4714 #define RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC UINT32_C(0x4)
4715 /*
4716 * This indicates that the UDP checksum was
4717 * calculated for the tunnel packet and that the t_l4_cs_error field
4718 * indicates if there was an error.
4719 */
4720 #define RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC UINT32_C(0x8)
4721 /* This value indicates what format the metadata field is. */
4722 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_MASK UINT32_C(0xf0)
4723 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_SFT 4
4724 /* No metadata information. Value is zero. */
4725 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_NONE (UINT32_C(0x0) << 4)
4726 /*
4727 * The metadata field contains the VLAN tag and TPID value.
4728 * - metadata[11:0] contains the vlan VID value.
4729 * - metadata[12] contains the vlan DE value.
4730 * - metadata[15:13] contains the vlan PRI value.
4731 * - metadata[31:16] contains the vlan TPID value.
4732 */
4733 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN (UINT32_C(0x1) << 4)
4734 /*
4735 * If ext_meta_format is equal to 1, the metadata field
4736 * contains the lower 16b of the tunnel ID value, justified
4737 * to LSB
4738 * - VXLAN = VNI[23:0] -> VXLAN Network ID
4739 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier.
4740 * - NVGRE = TNI[23:0] -> Tenant Network ID
4741 * - GRE = KEY[31:0] -> key field with bit mask. zero if K = 0
4742 * - IPV4 = 0 (not populated)
4743 * - IPV6 = Flow Label[19:0]
4744 * - PPPoE = sessionID[15:0]
4745 * - MPLs = Outer label[19:0]
4746 * - UPAR = Selected[31:0] with bit mask
4747 */
4748 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID (UINT32_C(0x2) << 4)
4749 /*
4750 * if ext_meta_format is equal to 1, metadata field contains
4751 * 16b metadata from the prepended header (chdr_data).
4752 */
4753 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_CHDR_DATA (UINT32_C(0x3) << 4)
4754 /*
4755 * If ext_meta_format is equal to 1, the metadata field contains
4756 * the outer_l3_offset, inner_l2_offset, inner_l3_offset and
4757 * inner_l4_size.
4758 * - metadata[8:0] contains the outer_l3_offset.
4759 * - metadata[17:9] contains the inner_l2_offset.
4760 * - metadata[26:18] contains the inner_l3_offset.
4761 * - metadata[31:27] contains the inner_l4_size.
4762 */
4763 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET (UINT32_C(0x4) << 4)
4764 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_LAST RX_PKT_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET
4765 /*
4766 * This field indicates the IP type for the inner-most IP header.
4767 * A value of '' indicates IPv4. A value of '1' indicates IPv6.
4768 * This value is only valid if itype indicates a packet
4769 * with an IP header.
4770 */
4771 #define RX_PKT_CMPL_FLAGS2_IP_TYPE UINT32_C(0x100)
4772 /*
4773 * This indicates that the complete 1's complement checksum was
4774 * calculated for the packet.
4775 */
4776 #define RX_PKT_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC UINT32_C(0x200)
4777 /*
4778 * The combination of this value and meta_format indicated what
4779 * format the metadata field is.
4780 */
4781 #define RX_PKT_CMPL_FLAGS2_EXT_META_FORMAT_MASK UINT32_C(0xc00)
4782 #define RX_PKT_CMPL_FLAGS2_EXT_META_FORMAT_SFT 10
4783 /*
4784 * This value is the complete 1's complement checksum calculated from
4785 * the start of the outer L3 header to the end of the packet (not
4786 * including the ethernet crc). It is valid when the
4787 * 'complete_checksum_calc' flag is set.
4788 */
4789 #define RX_PKT_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK UINT32_C(0xffff0000)
4790 #define RX_PKT_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT 16
4791 /*
4792 * This is data from the CFA block as indicated by the meta_format
4793 * field.
4794 */
4795 uint32_t metadata;
4796 /* When meta_format=1, this value is the VLAN VID. */
4797 #define RX_PKT_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
4798 #define RX_PKT_CMPL_METADATA_VID_SFT 0
4799 /* When meta_format=1, this value is the VLAN DE. */
4800 #define RX_PKT_CMPL_METADATA_DE UINT32_C(0x1000)
4801 /* When meta_format=1, this value is the VLAN PRI. */
4802 #define RX_PKT_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
4803 #define RX_PKT_CMPL_METADATA_PRI_SFT 13
4804 /* When meta_format=1, this value is the VLAN TPID. */
4805 #define RX_PKT_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
4806 #define RX_PKT_CMPL_METADATA_TPID_SFT 16
4807 uint16_t errors_v2;
4808 /*
4809 * This value is written by the NIC such that it will be different
4810 * for each pass through the completion queue. The even passes
4811 * will write 1. The odd passes will write 0.
4812 */
4813 #define RX_PKT_CMPL_V2 UINT32_C(0x1)
4814 #define RX_PKT_CMPL_ERRORS_MASK UINT32_C(0xfffe)
4815 #define RX_PKT_CMPL_ERRORS_SFT 1
4816 /*
4817 * This error indicates that there was some sort of problem with
4818 * the BDs for the packet that was found after part of the
4819 * packet was already placed. The packet should be treated as
4820 * invalid.
4821 */
4822 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe)
4823 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_SFT 1
4824 /* No buffer error */
4825 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER (UINT32_C(0x0) << 1)
4826 /*
4827 * Did Not Fit:
4828 * Packet did not fit into packet buffer provided.
4829 * For regular placement, this means the packet did not fit
4830 * in the buffer provided. For HDS and jumbo placement, this
4831 * means that the packet could not be placed into 7 physical
4832 * buffers or less.
4833 */
4834 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT (UINT32_C(0x1) << 1)
4835 /*
4836 * Not On Chip:
4837 * All BDs needed for the packet were not on-chip when
4838 * the packet arrived.
4839 */
4840 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP (UINT32_C(0x2) << 1)
4841 /*
4842 * Bad Format:
4843 * BDs were not formatted correctly.
4844 */
4845 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT (UINT32_C(0x3) << 1)
4846 /*
4847 * Flush:
4848 * There was a bad_format error on the previous operation
4849 */
4850 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_FLUSH (UINT32_C(0x5) << 1)
4851 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_LAST RX_PKT_CMPL_ERRORS_BUFFER_ERROR_FLUSH
4852 /*
4853 * This indicates that there was an error in the IP header
4854 * checksum.
4855 */
4856 #define RX_PKT_CMPL_ERRORS_IP_CS_ERROR UINT32_C(0x10)
4857 /*
4858 * This indicates that there was an error in the TCP, UDP
4859 * or ICMP checksum.
4860 */
4861 #define RX_PKT_CMPL_ERRORS_L4_CS_ERROR UINT32_C(0x20)
4862 /*
4863 * This indicates that there was an error in the tunnel
4864 * IP header checksum.
4865 */
4866 #define RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR UINT32_C(0x40)
4867 /*
4868 * This indicates that there was an error in the tunnel
4869 * UDP checksum.
4870 */
4871 #define RX_PKT_CMPL_ERRORS_T_L4_CS_ERROR UINT32_C(0x80)
4872 /*
4873 * This indicates that there was a CRC error on either an FCoE
4874 * or RoCE packet. The itype indicates the packet type.
4875 */
4876 #define RX_PKT_CMPL_ERRORS_CRC_ERROR UINT32_C(0x100)
4877 /*
4878 * This indicates that there was an error in the tunnel
4879 * portion of the packet when this
4880 * field is non-zero.
4881 */
4882 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_MASK UINT32_C(0xe00)
4883 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_SFT 9
4884 /*
4885 * No additional error occurred on the tunnel portion
4886 * or the packet of the packet does not have a tunnel.
4887 */
4888 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_NO_ERROR (UINT32_C(0x0) << 9)
4889 /*
4890 * Indicates that IP header version does not match
4891 * expectation from L2 Ethertype for IPv4 and IPv6
4892 * in the tunnel header.
4893 */
4894 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION (UINT32_C(0x1) << 9)
4895 /*
4896 * Indicates that header length is out of range in the
4897 * tunnel header. Valid for
4898 * IPv4.
4899 */
4900 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN (UINT32_C(0x2) << 9)
4901 /*
4902 * Indicates that the physical packet is shorter than that
4903 * claimed by the PPPoE header length for a tunnel PPPoE
4904 * packet.
4905 */
4906 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR (UINT32_C(0x3) << 9)
4907 /*
4908 * Indicates that physical packet is shorter than that claimed
4909 * by the tunnel l3 header length. Valid for IPv4, or IPv6
4910 * tunnel packet packets.
4911 */
4912 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR (UINT32_C(0x4) << 9)
4913 /*
4914 * Indicates that the physical packet is shorter than that
4915 * claimed by the tunnel UDP header length for a tunnel
4916 * UDP packet that is not fragmented.
4917 */
4918 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR (UINT32_C(0x5) << 9)
4919 /*
4920 * indicates that the IPv4 TTL or IPv6 hop limit check
4921 * have failed (e.g. TTL = 0) in the tunnel header. Valid
4922 * for IPv4, and IPv6.
4923 */
4924 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL (UINT32_C(0x6) << 9)
4925 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_LAST RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL
4926 /*
4927 * This indicates that there was an error in the inner
4928 * portion of the packet when this
4929 * field is non-zero.
4930 */
4931 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_MASK UINT32_C(0xf000)
4932 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_SFT 12
4933 /*
4934 * No additional error occurred on the tunnel portion
4935 * or the packet of the packet does not have a tunnel.
4936 */
4937 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_NO_ERROR (UINT32_C(0x0) << 12)
4938 /*
4939 * Indicates that IP header version does not match
4940 * expectation from L2 Ethertype for IPv4 and IPv6 or that
4941 * option other than VFT was parsed on
4942 * FCoE packet.
4943 */
4944 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_VERSION (UINT32_C(0x1) << 12)
4945 /*
4946 * indicates that header length is out of range. Valid for
4947 * IPv4 and RoCE
4948 */
4949 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN (UINT32_C(0x2) << 12)
4950 /*
4951 * indicates that the IPv4 TTL or IPv6 hop limit check
4952 * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
4953 */
4954 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_TTL (UINT32_C(0x3) << 12)
4955 /*
4956 * Indicates that physical packet is shorter than that
4957 * claimed by the l3 header length. Valid for IPv4,
4958 * IPv6 packet or RoCE packets.
4959 */
4960 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_IP_TOTAL_ERROR (UINT32_C(0x4) << 12)
4961 /*
4962 * Indicates that the physical packet is shorter than that
4963 * claimed by the UDP header length for a UDP packet that is
4964 * not fragmented.
4965 */
4966 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR (UINT32_C(0x5) << 12)
4967 /*
4968 * Indicates that TCP header length > IP payload. Valid for
4969 * TCP packets only.
4970 */
4971 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN (UINT32_C(0x6) << 12)
4972 /* Indicates that TCP header length < 5. Valid for TCP. */
4973 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL (UINT32_C(0x7) << 12)
4974 /*
4975 * Indicates that TCP option headers result in a TCP header
4976 * size that does not match data offset in TCP header. Valid
4977 * for TCP.
4978 */
4979 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN (UINT32_C(0x8) << 12)
4980 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_LAST RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
4981 /*
4982 * This field identifies the CFA action rule that was used for this
4983 * packet.
4984 */
4985 uint16_t cfa_code;
4986 uint32_t reorder;
4987 /*
4988 * This value holds the reordering sequence number for the packet.
4989 * If the reordering sequence is not valid, then this value is zero.
4990 * The reordering domain for the packet is in the bottom 8 to 10b of
4991 * the rss_hash value. The bottom 20b of this value contain the
4992 * ordering domain value for the packet.
4993 */
4994 #define RX_PKT_CMPL_REORDER_MASK UINT32_C(0xffffff)
4995 #define RX_PKT_CMPL_REORDER_SFT 0
4996 } rx_pkt_cmpl_hi_t, *prx_pkt_cmpl_hi_t;
4997
4998 /* rx_pkt_v2_cmpl (size:128b/16B) */
4999
5000 typedef struct rx_pkt_v2_cmpl {
5001 uint16_t flags_type;
5002 /*
5003 * This field indicates the exact type of the completion.
5004 * By convention, the LSB identifies the length of the
5005 * record in 16B units. Even values indicate 16B
5006 * records. Odd values indicate 32B
5007 * records.
5008 */
5009 #define RX_PKT_V2_CMPL_TYPE_MASK UINT32_C(0x3f)
5010 #define RX_PKT_V2_CMPL_TYPE_SFT 0
5011 /*
5012 * RX L2 V2 completion:
5013 * Completion of and L2 RX packet. Length = 32B
5014 * This is the new version of the RX_L2 completion used in SR2
5015 * and later chips.
5016 */
5017 #define RX_PKT_V2_CMPL_TYPE_RX_L2_V2 UINT32_C(0xf)
5018 #define RX_PKT_V2_CMPL_TYPE_LAST RX_PKT_V2_CMPL_TYPE_RX_L2_V2
5019 #define RX_PKT_V2_CMPL_FLAGS_MASK UINT32_C(0xffc0)
5020 #define RX_PKT_V2_CMPL_FLAGS_SFT 6
5021 /*
5022 * When this bit is '1', it indicates a packet that has an
5023 * error of some type. Type of error is indicated in
5024 * error_flags.
5025 */
5026 #define RX_PKT_V2_CMPL_FLAGS_ERROR UINT32_C(0x40)
5027 /* This field indicates how the packet was placed in the buffer. */
5028 #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_MASK UINT32_C(0x380)
5029 #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_SFT 7
5030 /*
5031 * Normal:
5032 * Packet was placed using normal algorithm.
5033 */
5034 #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_NORMAL (UINT32_C(0x0) << 7)
5035 /*
5036 * Jumbo:
5037 * Packet was placed using jumbo algorithm.
5038 */
5039 #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_JUMBO (UINT32_C(0x1) << 7)
5040 /*
5041 * Header/Data Separation:
5042 * Packet was placed using Header/Data separation algorithm.
5043 * The separation location is indicated by the itype field.
5044 */
5045 #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_HDS (UINT32_C(0x2) << 7)
5046 /*
5047 * Truncation:
5048 * Packet was placed using truncation algorithm. The
5049 * placed (truncated) length is indicated in the payload_offset
5050 * field. The original length is indicated in the len field.
5051 */
5052 #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_TRUNCATION (UINT32_C(0x3) << 7)
5053 #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_LAST RX_PKT_V2_CMPL_FLAGS_PLACEMENT_TRUNCATION
5054 /* This bit is '1' if the RSS field in this completion is valid. */
5055 #define RX_PKT_V2_CMPL_FLAGS_RSS_VALID UINT32_C(0x400)
5056 /*
5057 * This bit is '1' if metadata has been added to the end of the
5058 * packet in host memory. Metadata starts at the first 32B boundary
5059 * after the end of the packet for regular and jumbo placement.
5060 * It starts at the first 32B boundary after the end of the header
5061 * for HDS placement. The length of the metadata is indicated in the
5062 * metadata itself.
5063 */
5064 #define RX_PKT_V2_CMPL_FLAGS_PKT_METADATA_PRESENT UINT32_C(0x800)
5065 /*
5066 * This value indicates what the inner packet determined for the
5067 * packet was.
5068 */
5069 #define RX_PKT_V2_CMPL_FLAGS_ITYPE_MASK UINT32_C(0xf000)
5070 #define RX_PKT_V2_CMPL_FLAGS_ITYPE_SFT 12
5071 /*
5072 * Not Known:
5073 * Indicates that the packet type was not known.
5074 */
5075 #define RX_PKT_V2_CMPL_FLAGS_ITYPE_NOT_KNOWN (UINT32_C(0x0) << 12)
5076 /*
5077 * IP Packet:
5078 * Indicates that the packet was an IP packet, but further
5079 * classification was not possible.
5080 */
5081 #define RX_PKT_V2_CMPL_FLAGS_ITYPE_IP (UINT32_C(0x1) << 12)
5082 /*
5083 * TCP Packet:
5084 * Indicates that the packet was IP and TCP.
5085 * This indicates that the payload_offset field is valid.
5086 */
5087 #define RX_PKT_V2_CMPL_FLAGS_ITYPE_TCP (UINT32_C(0x2) << 12)
5088 /*
5089 * UDP Packet:
5090 * Indicates that the packet was IP and UDP.
5091 * This indicates that the payload_offset field is valid.
5092 */
5093 #define RX_PKT_V2_CMPL_FLAGS_ITYPE_UDP (UINT32_C(0x3) << 12)
5094 /*
5095 * FCoE Packet:
5096 * Indicates that the packet was recognized as a FCoE.
5097 * This also indicates that the payload_offset field is valid.
5098 */
5099 #define RX_PKT_V2_CMPL_FLAGS_ITYPE_FCOE (UINT32_C(0x4) << 12)
5100 /*
5101 * RoCE Packet:
5102 * Indicates that the packet was recognized as a RoCE.
5103 * This also indicates that the payload_offset field is valid.
5104 */
5105 #define RX_PKT_V2_CMPL_FLAGS_ITYPE_ROCE (UINT32_C(0x5) << 12)
5106 /*
5107 * ICMP Packet:
5108 * Indicates that the packet was recognized as ICMP.
5109 * This indicates that the payload_offset field is valid.
5110 */
5111 #define RX_PKT_V2_CMPL_FLAGS_ITYPE_ICMP (UINT32_C(0x7) << 12)
5112 /*
5113 * PtP packet wo/timestamp:
5114 * Indicates that the packet was recognized as a PtP
5115 * packet.
5116 */
5117 #define RX_PKT_V2_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP (UINT32_C(0x8) << 12)
5118 /*
5119 * PtP packet w/timestamp:
5120 * Indicates that the packet was recognized as a PtP
5121 * packet and that a timestamp was taken for the packet.
5122 */
5123 #define RX_PKT_V2_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP (UINT32_C(0x9) << 12)
5124 #define RX_PKT_V2_CMPL_FLAGS_ITYPE_LAST RX_PKT_V2_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
5125 /*
5126 * This is the length of the data for the packet stored in the
5127 * buffer(s) identified by the opaque value. This includes
5128 * the packet BD and any associated buffer BDs. This does not include
5129 * the length of any data places in aggregation BDs.
5130 */
5131 uint16_t len;
5132 /*
5133 * This is a copy of the opaque field from the RX BD this completion
5134 * corresponds to.
5135 */
5136 uint32_t opaque;
5137 uint8_t agg_bufs_v1;
5138 /*
5139 * This value is written by the NIC such that it will be different
5140 * for each pass through the completion queue. The even passes
5141 * will write 1. The odd passes will write 0.
5142 */
5143 #define RX_PKT_V2_CMPL_V1 UINT32_C(0x1)
5144 /*
5145 * This value is the number of aggregation buffers that follow this
5146 * entry in the completion ring that are a part of this packet.
5147 * If the value is zero, then the packet is completely contained
5148 * in the buffer space provided for the packet in the RX ring.
5149 */
5150 #define RX_PKT_V2_CMPL_AGG_BUFS_MASK UINT32_C(0x3e)
5151 #define RX_PKT_V2_CMPL_AGG_BUFS_SFT 1
5152 /* unused1 is 2 b */
5153 #define RX_PKT_V2_CMPL_UNUSED1_MASK UINT32_C(0xc0)
5154 #define RX_PKT_V2_CMPL_UNUSED1_SFT 6
5155 /*
5156 * This is the RSS hash type for the packet. The value is packed
5157 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
5158 *
5159 * The value of tuple_extrac_op provides the information about
5160 * what fields the hash was computed on.
5161 * * 0: The RSS hash was computed over source IP address,
5162 * destination IP address, source port, and destination port of inner
5163 * IP and TCP or UDP headers. Note: For non-tunneled packets,
5164 * the packet headers are considered inner packet headers for the RSS
5165 * hash computation purpose.
5166 * * 1: The RSS hash was computed over source IP address and destination
5167 * IP address of inner IP header. Note: For non-tunneled packets,
5168 * the packet headers are considered inner packet headers for the RSS
5169 * hash computation purpose.
5170 * * 2: The RSS hash was computed over source IP address,
5171 * destination IP address, source port, and destination port of
5172 * IP and TCP or UDP headers of outer tunnel headers.
5173 * Note: For non-tunneled packets, this value is not applicable.
5174 * * 3: The RSS hash was computed over source IP address and
5175 * destination IP address of IP header of outer tunnel headers.
5176 * Note: For non-tunneled packets, this value is not applicable.
5177 *
5178 * Note that 4-tuples values listed above are applicable
5179 * for layer 4 protocols supported and enabled for RSS in the hardware,
5180 * HWRM firmware, and drivers. For example, if RSS hash is supported and
5181 * enabled for TCP traffic only, then the values of tuple_extract_op
5182 * corresponding to 4-tuples are only valid for TCP traffic.
5183 */
5184 uint8_t rss_hash_type;
5185 uint16_t metadata1_payload_offset;
5186 /*
5187 * This is data from the CFA as indicated by the meta_format field.
5188 * If truncation placement is not used, this value indicates the offset
5189 * in bytes from the beginning of the packet where the inner payload
5190 * starts. This value is valid for TCP, UDP, FCoE, and RoCE packets. If
5191 * truncation placement is used, this value represents the placed
5192 * (truncated) length of the packet.
5193 */
5194 #define RX_PKT_V2_CMPL_PAYLOAD_OFFSET_MASK UINT32_C(0x1ff)
5195 #define RX_PKT_V2_CMPL_PAYLOAD_OFFSET_SFT 0
5196 /* This is data from the CFA as indicated by the meta_format field. */
5197 #define RX_PKT_V2_CMPL_METADATA1_MASK UINT32_C(0xf000)
5198 #define RX_PKT_V2_CMPL_METADATA1_SFT 12
5199 /* When meta_format != 0, this value is the VLAN TPID_SEL. */
5200 #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_MASK UINT32_C(0x7000)
5201 #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_SFT 12
5202 /* 0x88a8 */
5203 #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID88A8 (UINT32_C(0x0) << 12)
5204 /* 0x8100 */
5205 #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID8100 (UINT32_C(0x1) << 12)
5206 /* 0x9100 */
5207 #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID9100 (UINT32_C(0x2) << 12)
5208 /* 0x9200 */
5209 #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID9200 (UINT32_C(0x3) << 12)
5210 /* 0x9300 */
5211 #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID9300 (UINT32_C(0x4) << 12)
5212 /* Value programmed in CFA VLANTPID register. */
5213 #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPIDCFG (UINT32_C(0x5) << 12)
5214 #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_LAST RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPIDCFG
5215 /* When meta_format != 0, this value is the VLAN valid. */
5216 #define RX_PKT_V2_CMPL_METADATA1_VALID UINT32_C(0x8000)
5217 /*
5218 * This value is the RSS hash value calculated for the packet
5219 * based on the mode bits and key value in the VNIC. When vee_cmpl_mode
5220 * is set in VNIC context, this is the lower 32b of the host address
5221 * from the first BD used to place the packet.
5222 */
5223 uint32_t rss_hash;
5224 } rx_pkt_v2_cmpl_t, *prx_pkt_v2_cmpl_t;
5225
5226 /* Last 16 bytes of RX Packet V2 Completion Record */
5227 /* rx_pkt_v2_cmpl_hi (size:128b/16B) */
5228
5229 typedef struct rx_pkt_v2_cmpl_hi {
5230 uint32_t flags2;
5231 /*
5232 * When this bit is '', the cs_ok field has the following definition:-
5233 * ip_cs_ok[2:0] = The number of header groups with a valid IP checksum
5234 * in the delivered packet, counted from the outer-most header group to
5235 * the inner-most header group, stopping at the first error. -
5236 * l4_cs_ok[5:3] = The number of header groups with a valid L4 checksum
5237 * in the delivered packet, counted from the outer-most header group to
5238 * the inner-most header group, stopping at the first error. When this
5239 * bit is '1', the cs_ok field has the following definition: -
5240 * hdr_cnt[2:0] = The number of header groups that were parsed by the
5241 * chip and passed in the delivered packet. - ip_cs_all_ok[3] =This bit
5242 * will be '1' if all the parsed header groups with an IP checksum are
5243 * valid. - l4_cs_all_ok[4] = This bit will be '1' if all the parsed
5244 * header groups with an L4 checksum are valid.
5245 */
5246 #define RX_PKT_V2_CMPL_HI_FLAGS2_CS_ALL_OK_MODE UINT32_C(0x8)
5247 /* This value indicates what format the metadata field is. */
5248 #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_MASK UINT32_C(0xf0)
5249 #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_SFT 4
5250 /* There is no metadata information. Values are zero. */
5251 #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_NONE (UINT32_C(0x0) << 4)
5252 /*
5253 * The {metadata1, metadata0} fields contain the vtag
5254 * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
5255 * de, vid[11:0]} The metadata2 field contains the table scope
5256 * and action record pointer. - metadata2[25:0] contains the
5257 * action record pointer. - metadata2[31:26] contains the table
5258 * scope.
5259 */
5260 #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_ACT_REC_PTR (UINT32_C(0x1) << 4)
5261 /*
5262 * The {metadata1, metadata0} fields contain the vtag
5263 * information:
5264 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
5265 * The metadata2 field contains the Tunnel ID
5266 * value, justified to LSB. i
5267 * - VXLAN = VNI[23:0] -> VXLAN Network ID
5268 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
5269 * - NVGRE = TNI[23:0] -> Tenant Network ID
5270 * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
5271 * - IPv4 = 0 (not populated)
5272 * - IPv6 = Flow Label[19:0]
5273 * - PPPoE = sessionID[15:0]
5274 * - MPLs = Outer label[19:0]
5275 * - UPAR = Selected[31:0] with bit mask
5276 */
5277 #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_TUNNEL_ID (UINT32_C(0x2) << 4)
5278 /*
5279 * The {metadata1, metadata0} fields contain the vtag
5280 * information:
5281 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
5282 * The metadata2 field contains the 32b metadata from the prepended
5283 * header (chdr_data).
5284 */
5285 #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_CHDR_DATA (UINT32_C(0x3) << 4)
5286 /*
5287 * The {metadata1, metadata0} fields contain the vtag
5288 * information:
5289 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
5290 * The metadata2 field contains the outer_l3_offset,
5291 * inner_l2_offset, inner_l3_offset, and inner_l4_size.
5292 * - metadata2[8:0] contains the outer_l3_offset.
5293 * - metadata2[17:9] contains the inner_l2_offset.
5294 * - metadata2[26:18] contains the inner_l3_offset.
5295 * - metadata2[31:27] contains the inner_l4_size.
5296 */
5297 #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_HDR_OFFSET (UINT32_C(0x4) << 4)
5298 #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_LAST RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_HDR_OFFSET
5299 /*
5300 * This field indicates the IP type for the inner-most IP header.
5301 * A value of '' indicates IPv4. A value of '1' indicates IPv6.
5302 * This value is only valid if itype indicates a packet
5303 * with an IP header.
5304 */
5305 #define RX_PKT_V2_CMPL_HI_FLAGS2_IP_TYPE UINT32_C(0x100)
5306 /*
5307 * This indicates that the complete 1's complement checksum was
5308 * calculated for the packet.
5309 */
5310 #define RX_PKT_V2_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_CALC UINT32_C(0x200)
5311 /*
5312 * This field indicates the status of IP and L4 CS calculations done
5313 * by the chip. The format of this field is indicated by the
5314 * cs_all_ok_mode bit.
5315 */
5316 #define RX_PKT_V2_CMPL_HI_FLAGS2_CS_OK_MASK UINT32_C(0xfc00)
5317 #define RX_PKT_V2_CMPL_HI_FLAGS2_CS_OK_SFT 10
5318 /*
5319 * This value is the complete 1's complement checksum calculated from
5320 * the start of the outer L3 header to the end of the packet (not
5321 * including the ethernet crc). It is valid when the
5322 * 'complete_checksum_calc' flag is set.
5323 */
5324 #define RX_PKT_V2_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_MASK UINT32_C(0xffff0000)
5325 #define RX_PKT_V2_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_SFT 16
5326 /*
5327 * This is data from the CFA block as indicated by the meta_format
5328 * field.
5329 * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
5330 * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
5331 * act_rec_ptr[25:0]}
5332 * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
5333 * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
5334 * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
5335 * When vee_cmpl_mode is set in VNIC context, this is the upper 32b
5336 * of the host address from the first BD used to place the packet.
5337 */
5338 uint32_t metadata2;
5339 uint16_t errors_v2;
5340 /*
5341 * This value is written by the NIC such that it will be different
5342 * for each pass through the completion queue. The even passes
5343 * will write 1. The odd passes will write 0.
5344 */
5345 #define RX_PKT_V2_CMPL_HI_V2 UINT32_C(0x1)
5346 #define RX_PKT_V2_CMPL_HI_ERRORS_MASK UINT32_C(0xfffe)
5347 #define RX_PKT_V2_CMPL_HI_ERRORS_SFT 1
5348 /*
5349 * This error indicates that there was some sort of problem with
5350 * the BDs for the packet that was found after part of the
5351 * packet was already placed. The packet should be treated as
5352 * invalid.
5353 */
5354 #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe)
5355 #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_SFT 1
5356 /* No buffer error */
5357 #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_NO_BUFFER (UINT32_C(0x0) << 1)
5358 /*
5359 * Did Not Fit: Packet did not fit into packet buffer provided.
5360 * For regular placement, this means the packet did not fit in
5361 * the buffer provided. For HDS and jumbo placement, this means
5362 * that the packet could not be placed into 8 physical buffers
5363 * (if fixed-size buffers are used), or that the packet could
5364 * not be placed in the number of physical buffers configured
5365 * for the VNIC (if variable-size buffers are used)
5366 */
5367 #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_DID_NOT_FIT (UINT32_C(0x1) << 1)
5368 /*
5369 * Not On Chip: All BDs needed for the packet were not on-chip
5370 * when the packet arrived. For regular placement, this error is
5371 * not valid. For HDS and jumbo placement, this means that not
5372 * enough agg BDs were posted to place the packet.
5373 */
5374 #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_NOT_ON_CHIP (UINT32_C(0x2) << 1)
5375 /*
5376 * Bad Format:
5377 * BDs were not formatted correctly.
5378 */
5379 #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_BAD_FORMAT (UINT32_C(0x3) << 1)
5380 /*
5381 * Flush:
5382 * There was a bad_format error on the previous operation
5383 */
5384 #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_FLUSH (UINT32_C(0x5) << 1)
5385 #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_LAST RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_FLUSH
5386 /*
5387 * This indicates that there was an error in the outer tunnel
5388 * portion of the packet when this field is non-zero.
5389 */
5390 #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_MASK UINT32_C(0x70)
5391 #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_SFT 4
5392 /*
5393 * No additional error occurred on the outer tunnel portion
5394 * of the packet or the packet does not have a outer tunnel.
5395 */
5396 #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_NO_ERROR (UINT32_C(0x0) << 4)
5397 /*
5398 * Indicates that IP header version does not match expectation
5399 * from L2 Ethertype for IPv4 and IPv6 in the outer tunnel header.
5400 */
5401 #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L3_BAD_VERSION (UINT32_C(0x1) << 4)
5402 /*
5403 * Indicates that header length is out of range in the outer
5404 * tunnel header. Valid for IPv4.
5405 */
5406 #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L3_BAD_HDR_LEN (UINT32_C(0x2) << 4)
5407 /*
5408 * Indicates that physical packet is shorter than that claimed
5409 * by the outer tunnel l3 header length. Valid for IPv4, or
5410 * IPv6 outer tunnel packets.
5411 */
5412 #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_IP_TOTAL_ERROR (UINT32_C(0x3) << 4)
5413 /*
5414 * Indicates that the physical packet is shorter than that
5415 * claimed by the outer tunnel UDP header length for a outer
5416 * tunnel UDP packet that is not fragmented.
5417 */
5418 #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_UDP_TOTAL_ERROR (UINT32_C(0x4) << 4)
5419 /*
5420 * Indicates that the IPv4 TTL or IPv6 hop limit check have
5421 * failed (e.g. TTL = 0) in the outer tunnel header. Valid for
5422 * IPv4, and IPv6.
5423 */
5424 #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L3_BAD_TTL (UINT32_C(0x5) << 4)
5425 /*
5426 * Indicates that the IP checksum failed its check in the outer
5427 * tunnel header.
5428 */
5429 #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_IP_CS_ERROR (UINT32_C(0x6) << 4)
5430 /*
5431 * Indicates that the L4 checksum failed its check in the outer
5432 * tunnel header.
5433 */
5434 #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L4_CS_ERROR (UINT32_C(0x7) << 4)
5435 #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_LAST RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L4_CS_ERROR
5436 /*
5437 * This indicates that there was a CRC error on either an FCoE
5438 * or RoCE packet. The itype indicates the packet type.
5439 */
5440 #define RX_PKT_V2_CMPL_HI_ERRORS_CRC_ERROR UINT32_C(0x100)
5441 /*
5442 * This indicates that there was an error in the tunnel portion
5443 * of the packet when this field is non-zero.
5444 */
5445 #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_MASK UINT32_C(0xe00)
5446 #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_SFT 9
5447 /*
5448 * No additional error occurred on the tunnel portion
5449 * of the packet or the packet does not have a tunnel.
5450 */
5451 #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_NO_ERROR (UINT32_C(0x0) << 9)
5452 /*
5453 * Indicates that IP header version does not match expectation
5454 * from L2 Ethertype for IPv4 and IPv6 in the tunnel header.
5455 */
5456 #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION (UINT32_C(0x1) << 9)
5457 /*
5458 * Indicates that header length is out of range in the tunnel
5459 * header. Valid for IPv4.
5460 */
5461 #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN (UINT32_C(0x2) << 9)
5462 /*
5463 * Indicates that physical packet is shorter than that claimed
5464 * by the tunnel l3 header length. Valid for IPv4, or IPv6 tunnel
5465 * packet packets.
5466 */
5467 #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR (UINT32_C(0x3) << 9)
5468 /*
5469 * Indicates that the physical packet is shorter than that claimed
5470 * by the tunnel UDP header length for a tunnel UDP packet that is
5471 * not fragmented.
5472 */
5473 #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR (UINT32_C(0x4) << 9)
5474 /*
5475 * Indicates that the IPv4 TTL or IPv6 hop limit check have failed
5476 * (e.g. TTL = 0) in the tunnel header. Valid for IPv4, and IPv6.
5477 */
5478 #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL (UINT32_C(0x5) << 9)
5479 /*
5480 * Indicates that the IP checksum failed its check in the tunnel
5481 * header.
5482 */
5483 #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_IP_CS_ERROR (UINT32_C(0x6) << 9)
5484 /*
5485 * Indicates that the L4 checksum failed its check in the tunnel
5486 * header.
5487 */
5488 #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L4_CS_ERROR (UINT32_C(0x7) << 9)
5489 #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_LAST RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L4_CS_ERROR
5490 /*
5491 * This indicates that there was an error in the inner
5492 * portion of the packet when this
5493 * field is non-zero.
5494 */
5495 #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_MASK UINT32_C(0xf000)
5496 #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_SFT 12
5497 /*
5498 * No additional error occurred on the tunnel portion
5499 * or the packet of the packet does not have a tunnel.
5500 */
5501 #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_NO_ERROR (UINT32_C(0x0) << 12)
5502 /*
5503 * Indicates that IP header version does not match
5504 * expectation from L2 Ethertype for IPv4 and IPv6 or that
5505 * option other than VFT was parsed on
5506 * FCoE packet.
5507 */
5508 #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_VERSION (UINT32_C(0x1) << 12)
5509 /*
5510 * indicates that header length is out of range. Valid for
5511 * IPv4 and RoCE
5512 */
5513 #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN (UINT32_C(0x2) << 12)
5514 /*
5515 * indicates that the IPv4 TTL or IPv6 hop limit check
5516 * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
5517 */
5518 #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_TTL (UINT32_C(0x3) << 12)
5519 /*
5520 * Indicates that physical packet is shorter than that
5521 * claimed by the l3 header length. Valid for IPv4,
5522 * IPv6 packet or RoCE packets.
5523 */
5524 #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_IP_TOTAL_ERROR (UINT32_C(0x4) << 12)
5525 /*
5526 * Indicates that the physical packet is shorter than that
5527 * claimed by the UDP header length for a UDP packet that is
5528 * not fragmented.
5529 */
5530 #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR (UINT32_C(0x5) << 12)
5531 /*
5532 * Indicates that TCP header length > IP payload. Valid for
5533 * TCP packets only.
5534 */
5535 #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN (UINT32_C(0x6) << 12)
5536 /* Indicates that TCP header length < 5. Valid for TCP. */
5537 #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL (UINT32_C(0x7) << 12)
5538 /*
5539 * Indicates that TCP option headers result in a TCP header
5540 * size that does not match data offset in TCP header. Valid
5541 * for TCP.
5542 */
5543 #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN (UINT32_C(0x8) << 12)
5544 /*
5545 * Indicates that the IP checksum failed its check in the
5546 * inner header.
5547 */
5548 #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_IP_CS_ERROR (UINT32_C(0x9) << 12)
5549 /*
5550 * Indicates that the L4 checksum failed its check in the
5551 * inner header.
5552 */
5553 #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_CS_ERROR (UINT32_C(0xa) << 12)
5554 #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_LAST RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_CS_ERROR
5555 /*
5556 * This is data from the CFA block as indicated by the meta_format
5557 * field.
5558 */
5559 uint16_t metadata0;
5560 /* When meta_format=1, this value is the VLAN VID. */
5561 #define RX_PKT_V2_CMPL_HI_METADATA0_VID_MASK UINT32_C(0xfff)
5562 #define RX_PKT_V2_CMPL_HI_METADATA0_VID_SFT 0
5563 /* When meta_format=1, this value is the VLAN DE. */
5564 #define RX_PKT_V2_CMPL_HI_METADATA0_DE UINT32_C(0x1000)
5565 /* When meta_format=1, this value is the VLAN PRI. */
5566 #define RX_PKT_V2_CMPL_HI_METADATA0_PRI_MASK UINT32_C(0xe000)
5567 #define RX_PKT_V2_CMPL_HI_METADATA0_PRI_SFT 13
5568 /*
5569 * The timestamp field contains the 32b timestamp for the packet from
5570 * the MAC.
5571 */
5572 uint32_t timestamp;
5573 } rx_pkt_v2_cmpl_hi_t, *prx_pkt_v2_cmpl_hi_t;
5574
5575 /*
5576 * This TPA completion structure is used on devices where the
5577 * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
5578 */
5579 /* rx_tpa_start_cmpl (size:128b/16B) */
5580
5581 typedef struct rx_tpa_start_cmpl {
5582 uint16_t flags_type;
5583 /*
5584 * This field indicates the exact type of the completion.
5585 * By convention, the LSB identifies the length of the
5586 * record in 16B units. Even values indicate 16B
5587 * records. Odd values indicate 32B
5588 * records.
5589 */
5590 #define RX_TPA_START_CMPL_TYPE_MASK UINT32_C(0x3f)
5591 #define RX_TPA_START_CMPL_TYPE_SFT 0
5592 /*
5593 * RX L2 TPA Start Completion:
5594 * Completion at the beginning of a TPA operation.
5595 * Length = 32B
5596 */
5597 #define RX_TPA_START_CMPL_TYPE_RX_TPA_START UINT32_C(0x13)
5598 #define RX_TPA_START_CMPL_TYPE_LAST RX_TPA_START_CMPL_TYPE_RX_TPA_START
5599 #define RX_TPA_START_CMPL_FLAGS_MASK UINT32_C(0xffc0)
5600 #define RX_TPA_START_CMPL_FLAGS_SFT 6
5601 /* This bit will always be '' for TPA start completions. */
5602 #define RX_TPA_START_CMPL_FLAGS_ERROR UINT32_C(0x40)
5603 /* This field indicates how the packet was placed in the buffer. */
5604 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_MASK UINT32_C(0x380)
5605 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_SFT 7
5606 /*
5607 * Jumbo:
5608 * TPA Packet was placed using jumbo algorithm. This means
5609 * that the first buffer will be filled with data before
5610 * moving to aggregation buffers. Each aggregation buffer
5611 * will be filled before moving to the next aggregation
5612 * buffer.
5613 */
5614 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_JUMBO (UINT32_C(0x1) << 7)
5615 /*
5616 * Header/Data Separation:
5617 * Packet was placed using Header/Data separation algorithm.
5618 * The separation location is indicated by the itype field.
5619 */
5620 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_HDS (UINT32_C(0x2) << 7)
5621 /*
5622 * GRO/Jumbo:
5623 * Packet will be placed using GRO/Jumbo where the first
5624 * packet is filled with data. Subsequent packets will be
5625 * placed such that any one packet does not span two
5626 * aggregation buffers unless it starts at the beginning of
5627 * an aggregation buffer.
5628 */
5629 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_JUMBO (UINT32_C(0x5) << 7)
5630 /*
5631 * GRO/Header-Data Separation:
5632 * Packet will be placed using GRO/HDS where the header
5633 * is in the first packet.
5634 * Payload of each packet will be
5635 * placed such that any one packet does not span two
5636 * aggregation buffers unless it starts at the beginning of
5637 * an aggregation buffer.
5638 */
5639 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS (UINT32_C(0x6) << 7)
5640 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_LAST RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS
5641 /* This bit is '1' if the RSS field in this completion is valid. */
5642 #define RX_TPA_START_CMPL_FLAGS_RSS_VALID UINT32_C(0x400)
5643 /* unused is 1 b */
5644 #define RX_TPA_START_CMPL_FLAGS_UNUSED UINT32_C(0x800)
5645 /*
5646 * This value indicates what the inner packet determined for the
5647 * packet was.
5648 */
5649 #define RX_TPA_START_CMPL_FLAGS_ITYPE_MASK UINT32_C(0xf000)
5650 #define RX_TPA_START_CMPL_FLAGS_ITYPE_SFT 12
5651 /*
5652 * TCP Packet:
5653 * Indicates that the packet was IP and TCP.
5654 */
5655 #define RX_TPA_START_CMPL_FLAGS_ITYPE_TCP (UINT32_C(0x2) << 12)
5656 #define RX_TPA_START_CMPL_FLAGS_ITYPE_LAST RX_TPA_START_CMPL_FLAGS_ITYPE_TCP
5657 /*
5658 * This value indicates the amount of packet data written to the
5659 * buffer the opaque field in this completion corresponds to.
5660 */
5661 uint16_t len;
5662 /*
5663 * This is a copy of the opaque field from the RX BD this completion
5664 * corresponds to.
5665 */
5666 uint32_t opaque;
5667 /*
5668 * This value is written by the NIC such that it will be different
5669 * for each pass through the completion queue. The even passes
5670 * will write 1. The odd passes will write 0.
5671 */
5672 uint8_t v1;
5673 /*
5674 * This value is written by the NIC such that it will be different
5675 * for each pass through the completion queue. The even passes
5676 * will write 1. The odd passes will write 0.
5677 */
5678 #define RX_TPA_START_CMPL_V1 UINT32_C(0x1)
5679 #define RX_TPA_START_CMPL_LAST RX_TPA_START_CMPL_V1
5680 /*
5681 * This is the RSS hash type for the packet. The value is packed
5682 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
5683 *
5684 * The value of tuple_extrac_op provides the information about
5685 * what fields the hash was computed on.
5686 * * 0: The RSS hash was computed over source IP address,
5687 * destination IP address, source port, and destination port of inner
5688 * IP and TCP or UDP headers. Note: For non-tunneled packets,
5689 * the packet headers are considered inner packet headers for the RSS
5690 * hash computation purpose.
5691 * * 1: The RSS hash was computed over source IP address and destination
5692 * IP address of inner IP header. Note: For non-tunneled packets,
5693 * the packet headers are considered inner packet headers for the RSS
5694 * hash computation purpose.
5695 * * 2: The RSS hash was computed over source IP address,
5696 * destination IP address, source port, and destination port of
5697 * IP and TCP or UDP headers of outer tunnel headers.
5698 * Note: For non-tunneled packets, this value is not applicable.
5699 * * 3: The RSS hash was computed over source IP address and
5700 * destination IP address of IP header of outer tunnel headers.
5701 * Note: For non-tunneled packets, this value is not applicable.
5702 *
5703 * Note that 4-tuples values listed above are applicable
5704 * for layer 4 protocols supported and enabled for RSS in the hardware,
5705 * HWRM firmware, and drivers. For example, if RSS hash is supported and
5706 * enabled for TCP traffic only, then the values of tuple_extract_op
5707 * corresponding to 4-tuples are only valid for TCP traffic.
5708 */
5709 uint8_t rss_hash_type;
5710 /*
5711 * This is the aggregation ID that the completion is associated
5712 * with. Use this number to correlate the TPA start completion
5713 * with the TPA end completion.
5714 */
5715 uint16_t agg_id;
5716 /* unused2 is 9 b */
5717 #define RX_TPA_START_CMPL_UNUSED2_MASK UINT32_C(0x1ff)
5718 #define RX_TPA_START_CMPL_UNUSED2_SFT 0
5719 /*
5720 * This is the aggregation ID that the completion is associated
5721 * with. Use this number to correlate the TPA start completion
5722 * with the TPA end completion.
5723 */
5724 #define RX_TPA_START_CMPL_AGG_ID_MASK UINT32_C(0xfe00)
5725 #define RX_TPA_START_CMPL_AGG_ID_SFT 9
5726 /*
5727 * This value is the RSS hash value calculated for the packet
5728 * based on the mode bits and key value in the VNIC.
5729 */
5730 uint32_t rss_hash;
5731 } rx_tpa_start_cmpl_t, *prx_tpa_start_cmpl_t;
5732
5733 /*
5734 * Last 16 bytes of rx_tpa_start_cmpl.
5735 *
5736 * This TPA completion structure is used on devices where the
5737 * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
5738 */
5739 /* rx_tpa_start_cmpl_hi (size:128b/16B) */
5740
5741 typedef struct rx_tpa_start_cmpl_hi {
5742 uint32_t flags2;
5743 /*
5744 * This indicates that the ip checksum was calculated for the
5745 * inner packet and that the sum passed for all segments
5746 * included in the aggregation.
5747 */
5748 #define RX_TPA_START_CMPL_FLAGS2_IP_CS_CALC UINT32_C(0x1)
5749 /*
5750 * This indicates that the TCP, UDP or ICMP checksum was
5751 * calculated for the inner packet and that the sum passed
5752 * for all segments included in the aggregation.
5753 */
5754 #define RX_TPA_START_CMPL_FLAGS2_L4_CS_CALC UINT32_C(0x2)
5755 /*
5756 * This indicates that the ip checksum was calculated for the
5757 * tunnel header and that the sum passed for all segments
5758 * included in the aggregation.
5759 */
5760 #define RX_TPA_START_CMPL_FLAGS2_T_IP_CS_CALC UINT32_C(0x4)
5761 /*
5762 * This indicates that the UDP checksum was
5763 * calculated for the tunnel packet and that the sum passed for
5764 * all segments included in the aggregation.
5765 */
5766 #define RX_TPA_START_CMPL_FLAGS2_T_L4_CS_CALC UINT32_C(0x8)
5767 /* This value indicates what format the metadata field is. */
5768 #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_MASK UINT32_C(0xf0)
5769 #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_SFT 4
5770 /* No metadata information. Value is zero. */
5771 #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_NONE (UINT32_C(0x0) << 4)
5772 /*
5773 * The metadata field contains the VLAN tag and TPID value.
5774 * - metadata[11:0] contains the vlan VID value.
5775 * - metadata[12] contains the vlan DE value.
5776 * - metadata[15:13] contains the vlan PRI value.
5777 * - metadata[31:16] contains the vlan TPID value.
5778 */
5779 #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN (UINT32_C(0x1) << 4)
5780 #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_LAST RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN
5781 /*
5782 * This field indicates the IP type for the inner-most IP header.
5783 * A value of '' indicates IPv4. A value of '1' indicates IPv6.
5784 */
5785 #define RX_TPA_START_CMPL_FLAGS2_IP_TYPE UINT32_C(0x100)
5786 /*
5787 * This is data from the CFA block as indicated by the meta_format
5788 * field.
5789 */
5790 uint32_t metadata;
5791 /* When meta_format=1, this value is the VLAN VID. */
5792 #define RX_TPA_START_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
5793 #define RX_TPA_START_CMPL_METADATA_VID_SFT 0
5794 /* When meta_format=1, this value is the VLAN DE. */
5795 #define RX_TPA_START_CMPL_METADATA_DE UINT32_C(0x1000)
5796 /* When meta_format=1, this value is the VLAN PRI. */
5797 #define RX_TPA_START_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
5798 #define RX_TPA_START_CMPL_METADATA_PRI_SFT 13
5799 /* When meta_format=1, this value is the VLAN TPID. */
5800 #define RX_TPA_START_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
5801 #define RX_TPA_START_CMPL_METADATA_TPID_SFT 16
5802 uint16_t v2;
5803 /*
5804 * This value is written by the NIC such that it will be different
5805 * for each pass through the completion queue. The even passes
5806 * will write 1. The odd passes will write 0.
5807 */
5808 #define RX_TPA_START_CMPL_V2 UINT32_C(0x1)
5809 /*
5810 * This field identifies the CFA action rule that was used for this
5811 * packet.
5812 */
5813 uint16_t cfa_code;
5814 /*
5815 * This is the size in bytes of the inner most L4 header.
5816 * This can be subtracted from the payload_offset to determine
5817 * the start of the inner most L4 header.
5818 */
5819 uint32_t inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset;
5820 /*
5821 * This is the offset from the beginning of the packet in bytes for
5822 * the outer L3 header. If there is no outer L3 header, then this
5823 * value is zero.
5824 */
5825 #define RX_TPA_START_CMPL_OUTER_L3_OFFSET_MASK UINT32_C(0x1ff)
5826 #define RX_TPA_START_CMPL_OUTER_L3_OFFSET_SFT 0
5827 /*
5828 * This is the offset from the beginning of the packet in bytes for
5829 * the inner most L2 header.
5830 */
5831 #define RX_TPA_START_CMPL_INNER_L2_OFFSET_MASK UINT32_C(0x3fe00)
5832 #define RX_TPA_START_CMPL_INNER_L2_OFFSET_SFT 9
5833 /*
5834 * This is the offset from the beginning of the packet in bytes for
5835 * the inner most L3 header.
5836 */
5837 #define RX_TPA_START_CMPL_INNER_L3_OFFSET_MASK UINT32_C(0x7fc0000)
5838 #define RX_TPA_START_CMPL_INNER_L3_OFFSET_SFT 18
5839 /*
5840 * This is the size in bytes of the inner most L4 header.
5841 * This can be subtracted from the payload_offset to determine
5842 * the start of the inner most L4 header.
5843 */
5844 #define RX_TPA_START_CMPL_INNER_L4_SIZE_MASK UINT32_C(0xf8000000)
5845 #define RX_TPA_START_CMPL_INNER_L4_SIZE_SFT 27
5846 } rx_tpa_start_cmpl_hi_t, *prx_tpa_start_cmpl_hi_t;
5847
5848 /*
5849 * This TPA completion structure is used on devices where the
5850 * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
5851 * RX L2 TPA Start V2 Completion Record (32 bytes split to 2 16-byte
5852 * struct)
5853 */
5854 /* rx_tpa_start_v2_cmpl (size:128b/16B) */
5855
5856 typedef struct rx_tpa_start_v2_cmpl {
5857 uint16_t flags_type;
5858 /*
5859 * This field indicates the exact type of the completion.
5860 * By convention, the LSB identifies the length of the
5861 * record in 16B units. Even values indicate 16B
5862 * records. Odd values indicate 32B
5863 * records.
5864 */
5865 #define RX_TPA_START_V2_CMPL_TYPE_MASK UINT32_C(0x3f)
5866 #define RX_TPA_START_V2_CMPL_TYPE_SFT 0
5867 /*
5868 * RX L2 TPA Start V2 Completion:
5869 * Completion at the beginning of a TPA operation.
5870 * Length = 32B
5871 * This is the new version of the RX_TPA_START completion used
5872 * in SR2 and later chips.
5873 */
5874 #define RX_TPA_START_V2_CMPL_TYPE_RX_TPA_START_V2 UINT32_C(0xd)
5875 #define RX_TPA_START_V2_CMPL_TYPE_LAST RX_TPA_START_V2_CMPL_TYPE_RX_TPA_START_V2
5876 #define RX_TPA_START_V2_CMPL_FLAGS_MASK UINT32_C(0xffc0)
5877 #define RX_TPA_START_V2_CMPL_FLAGS_SFT 6
5878 /*
5879 * When this bit is '1', it indicates a packet that has an error
5880 * of some type. Type of error is indicated in error_flags.
5881 */
5882 #define RX_TPA_START_V2_CMPL_FLAGS_ERROR UINT32_C(0x40)
5883 /* This field indicates how the packet was placed in the buffer. */
5884 #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_MASK UINT32_C(0x380)
5885 #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_SFT 7
5886 /*
5887 * Jumbo:
5888 * TPA Packet was placed using jumbo algorithm. This means
5889 * that the first buffer will be filled with data before
5890 * moving to aggregation buffers. Each aggregation buffer
5891 * will be filled before moving to the next aggregation
5892 * buffer.
5893 */
5894 #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_JUMBO (UINT32_C(0x1) << 7)
5895 /*
5896 * Header/Data Separation:
5897 * Packet was placed using Header/Data separation algorithm.
5898 * The separation location is indicated by the itype field.
5899 */
5900 #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_HDS (UINT32_C(0x2) << 7)
5901 /*
5902 * IOC/Jumbo:
5903 * Packet will be placed using In-Order Completion/Jumbo where
5904 * the first packet of the aggregation is placed using Jumbo
5905 * Placement. Subsequent packets will be placed such that each
5906 * packet starts at the beginning of an aggregation buffer.
5907 */
5908 #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_IOC_JUMBO (UINT32_C(0x4) << 7)
5909 /*
5910 * GRO/Jumbo:
5911 * Packet will be placed using GRO/Jumbo where the first
5912 * packet is filled with data. Subsequent packets will be
5913 * placed such that any one packet does not span two
5914 * aggregation buffers unless it starts at the beginning of
5915 * an aggregation buffer.
5916 */
5917 #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_GRO_JUMBO (UINT32_C(0x5) << 7)
5918 /*
5919 * GRO/Header-Data Separation:
5920 * Packet will be placed using GRO/HDS where the header
5921 * is in the first packet.
5922 * Payload of each packet will be
5923 * placed such that any one packet does not span two
5924 * aggregation buffers unless it starts at the beginning of
5925 * an aggregation buffer.
5926 */
5927 #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_GRO_HDS (UINT32_C(0x6) << 7)
5928 /*
5929 * IOC/Header-Data Separation:
5930 * Packet will be placed using In-Order Completion/HDS where
5931 * the header is in the first packet buffer. Payload of each
5932 * packet will be placed such that each packet starts at the
5933 * beginning of an aggregation buffer.
5934 */
5935 #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_IOC_HDS (UINT32_C(0x7) << 7)
5936 #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_LAST RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_IOC_HDS
5937 /* This bit is '1' if the RSS field in this completion is valid. */
5938 #define RX_TPA_START_V2_CMPL_FLAGS_RSS_VALID UINT32_C(0x400)
5939 /*
5940 * This bit is '1' if metadata has been added to the end of the
5941 * packet in host memory. Metadata starts at the first 32B boundary
5942 * after the end of the packet for regular and jumbo placement. It
5943 * starts at the first 32B boundary after the end of the header for
5944 * HDS placement. The length of the metadata is indicated in the
5945 * metadata itself.
5946 */
5947 #define RX_TPA_START_V2_CMPL_FLAGS_PKT_METADATA_PRESENT UINT32_C(0x800)
5948 /*
5949 * This value indicates what the inner packet determined for the
5950 * packet was.
5951 */
5952 #define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_MASK UINT32_C(0xf000)
5953 #define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_SFT 12
5954 /*
5955 * TCP Packet:
5956 * Indicates that the packet was IP and TCP.
5957 */
5958 #define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_TCP (UINT32_C(0x2) << 12)
5959 #define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_LAST RX_TPA_START_V2_CMPL_FLAGS_ITYPE_TCP
5960 /*
5961 * This value indicates the amount of packet data written to the
5962 * buffer the opaque field in this completion corresponds to.
5963 */
5964 uint16_t len;
5965 /*
5966 * This is a copy of the opaque field from the RX BD this completion
5967 * corresponds to. If the VNIC is configured to not use an Rx BD for
5968 * the TPA Start completion, then this is a copy of the opaque field
5969 * from the first BD used to place the TPA Start packet.
5970 */
5971 uint32_t opaque;
5972 /*
5973 * This value is written by the NIC such that it will be different
5974 * for each pass through the completion queue. The even passes
5975 * will write 1. The odd passes will write 0.
5976 */
5977 uint8_t v1;
5978 /*
5979 * This value is written by the NIC such that it will be different
5980 * for each pass through the completion queue. The even passes
5981 * will write 1. The odd passes will write 0.
5982 */
5983 #define RX_TPA_START_V2_CMPL_V1 UINT32_C(0x1)
5984 #define RX_TPA_START_V2_CMPL_LAST RX_TPA_START_V2_CMPL_V1
5985 /*
5986 * This is the RSS hash type for the packet. The value is packed
5987 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
5988 *
5989 * The value of tuple_extrac_op provides the information about
5990 * what fields the hash was computed on.
5991 * * 0: The RSS hash was computed over source IP address,
5992 * destination IP address, source port, and destination port of inner
5993 * IP and TCP or UDP headers. Note: For non-tunneled packets,
5994 * the packet headers are considered inner packet headers for the RSS
5995 * hash computation purpose.
5996 * * 1: The RSS hash was computed over source IP address and destination
5997 * IP address of inner IP header. Note: For non-tunneled packets,
5998 * the packet headers are considered inner packet headers for the RSS
5999 * hash computation purpose.
6000 * * 2: The RSS hash was computed over source IP address,
6001 * destination IP address, source port, and destination port of
6002 * IP and TCP or UDP headers of outer tunnel headers.
6003 * Note: For non-tunneled packets, this value is not applicable.
6004 * * 3: The RSS hash was computed over source IP address and
6005 * destination IP address of IP header of outer tunnel headers.
6006 * Note: For non-tunneled packets, this value is not applicable.
6007 *
6008 * Note that 4-tuples values listed above are applicable
6009 * for layer 4 protocols supported and enabled for RSS in the hardware,
6010 * HWRM firmware, and drivers. For example, if RSS hash is supported and
6011 * enabled for TCP traffic only, then the values of tuple_extract_op
6012 * corresponding to 4-tuples are only valid for TCP traffic.
6013 */
6014 uint8_t rss_hash_type;
6015 /*
6016 * This is the aggregation ID that the completion is associated
6017 * with. Use this number to correlate the TPA start completion
6018 * with the TPA end completion.
6019 */
6020 uint16_t agg_id;
6021 /*
6022 * This is the aggregation ID that the completion is associated
6023 * with. Use this number to correlate the TPA start completion
6024 * with the TPA end completion.
6025 */
6026 #define RX_TPA_START_V2_CMPL_AGG_ID_MASK UINT32_C(0xfff)
6027 #define RX_TPA_START_V2_CMPL_AGG_ID_SFT 0
6028 #define RX_TPA_START_V2_CMPL_METADATA1_MASK UINT32_C(0xf000)
6029 #define RX_TPA_START_V2_CMPL_METADATA1_SFT 12
6030 /* When meta_format != 0, this value is the VLAN TPID_SEL. */
6031 #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_MASK UINT32_C(0x7000)
6032 #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_SFT 12
6033 /* 0x88a8 */
6034 #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID88A8 (UINT32_C(0x0) << 12)
6035 /* 0x8100 */
6036 #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID8100 (UINT32_C(0x1) << 12)
6037 /* 0x9100 */
6038 #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID9100 (UINT32_C(0x2) << 12)
6039 /* 0x9200 */
6040 #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID9200 (UINT32_C(0x3) << 12)
6041 /* 0x9300 */
6042 #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID9300 (UINT32_C(0x4) << 12)
6043 /* Value programmed in CFA VLANTPID register. */
6044 #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPIDCFG (UINT32_C(0x5) << 12)
6045 #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_LAST RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPIDCFG
6046 /* When meta_format != 0, this value is the VLAN valid. */
6047 #define RX_TPA_START_V2_CMPL_METADATA1_VALID UINT32_C(0x8000)
6048 /*
6049 * This value is the RSS hash value calculated for the packet
6050 * based on the mode bits and key value in the VNIC.
6051 * When vee_cmpl_mode is set in VNIC context, this is the lower
6052 * 32b of the host address from the first BD used to place the packet.
6053 */
6054 uint32_t rss_hash;
6055 } rx_tpa_start_v2_cmpl_t, *prx_tpa_start_v2_cmpl_t;
6056
6057 /*
6058 * Last 16 bytes of RX L2 TPA Start V2 Completion Record
6059 *
6060 * This TPA completion structure is used on devices where the
6061 * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
6062 */
6063 /* rx_tpa_start_v2_cmpl_hi (size:128b/16B) */
6064
6065 typedef struct rx_tpa_start_v2_cmpl_hi {
6066 uint32_t flags2;
6067 /* This indicates that the aggregation was done using GRO rules. */
6068 #define RX_TPA_START_V2_CMPL_FLAGS2_AGG_GRO UINT32_C(0x4)
6069 /*
6070 * When this bit is '', the cs_ok field has the following definition:-
6071 * ip_cs_ok[2:0] = The number of header groups with a valid IP checksum
6072 * in the delivered packet, counted from the outer-most header group to
6073 * the inner-most header group, stopping at the first error. -
6074 * l4_cs_ok[5:3] = The number of header groups with a valid L4 checksum
6075 * in the delivered packet, counted from the outer-most header group to
6076 * the inner-most header group, stopping at the first error. When this
6077 * bit is '1', the cs_ok field has the following definition: -
6078 * hdr_cnt[2:0] = The number of header groups that were parsed by the
6079 * chip and passed in the delivered packet. - ip_cs_all_ok[3] =This bit
6080 * will be '1' if all the parsed header groups with an IP checksum are
6081 * valid. - l4_cs_all_ok[4] = This bit will be '1' if all the parsed
6082 * header groups with an L4 checksum are valid.
6083 */
6084 #define RX_TPA_START_V2_CMPL_FLAGS2_CS_ALL_OK_MODE UINT32_C(0x8)
6085 /* This value indicates what format the metadata field is. */
6086 #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_MASK UINT32_C(0xf0)
6087 #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_SFT 4
6088 /* There is no metadata information. Values are zero. */
6089 #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_NONE (UINT32_C(0x0) << 4)
6090 /*
6091 * The {metadata1, metadata0} fields contain the vtag
6092 * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
6093 * de, vid[11:0]} The metadata2 field contains the table scope
6094 * and action record pointer. - metadata2[25:0] contains the
6095 * action record pointer. - metadata2[31:26] contains the table
6096 * scope.
6097 */
6098 #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_ACT_REC_PTR (UINT32_C(0x1) << 4)
6099 /*
6100 * The {metadata1, metadata0} fields contain the vtag
6101 * information:
6102 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
6103 * The metadata2 field contains the Tunnel ID
6104 * value, justified to LSB. i
6105 * - VXLAN = VNI[23:0] -> VXLAN Network ID
6106 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
6107 * - NVGRE = TNI[23:0] -> Tenant Network ID
6108 * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
6109 * - IPv4 = 0 (not populated)
6110 * - IPv6 = Flow Label[19:0]
6111 * - PPPoE = sessionID[15:0]
6112 * - MPLs = Outer label[19:0]
6113 * - UPAR = Selected[31:0] with bit mask
6114 */
6115 #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID (UINT32_C(0x2) << 4)
6116 /*
6117 * The {metadata1, metadata0} fields contain the vtag
6118 * information:
6119 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
6120 * The metadata2 field contains the 32b metadata from the prepended
6121 * header (chdr_data).
6122 */
6123 #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_CHDR_DATA (UINT32_C(0x3) << 4)
6124 /*
6125 * The {metadata1, metadata0} fields contain the vtag
6126 * information:
6127 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
6128 * The metadata2 field contains the outer_l3_offset,
6129 * inner_l2_offset, inner_l3_offset, and inner_l4_size.
6130 * - metadata2[8:0] contains the outer_l3_offset.
6131 * - metadata2[17:9] contains the inner_l2_offset.
6132 * - metadata2[26:18] contains the inner_l3_offset.
6133 * - metadata2[31:27] contains the inner_l4_size.
6134 */
6135 #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET (UINT32_C(0x4) << 4)
6136 #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_LAST RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET
6137 /*
6138 * This field indicates the IP type for the inner-most IP header.
6139 * A value of '' indicates IPv4. A value of '1' indicates IPv6.
6140 * This value is only valid if itype indicates a packet
6141 * with an IP header.
6142 */
6143 #define RX_TPA_START_V2_CMPL_FLAGS2_IP_TYPE UINT32_C(0x100)
6144 /*
6145 * This indicates that the complete 1's complement checksum was
6146 * calculated for the packet in the affregation.
6147 */
6148 #define RX_TPA_START_V2_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC UINT32_C(0x200)
6149 /*
6150 * This field indicates the status of IP and L4 CS calculations done
6151 * by the chip. The format of this field is indicated by the
6152 * cs_all_ok_mode bit.
6153 * CS status for TPA packets is always valid. This means that "all_ok"
6154 * status will always be set. The ok count status will be set
6155 * appropriately for the packet header, such that all existing CS
6156 * values are ok.
6157 */
6158 #define RX_TPA_START_V2_CMPL_FLAGS2_CS_OK_MASK UINT32_C(0xfc00)
6159 #define RX_TPA_START_V2_CMPL_FLAGS2_CS_OK_SFT 10
6160 /*
6161 * This value is the complete 1's complement checksum calculated from
6162 * the start of the outer L3 header to the end of the packet (not
6163 * including the ethernet crc). It is valid when the
6164 * 'complete_checksum_calc' flag is set. For TPA Start completions,
6165 * the complete checksum is calculated for the first packet in the
6166 * aggregation only.
6167 */
6168 #define RX_TPA_START_V2_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK UINT32_C(0xffff0000)
6169 #define RX_TPA_START_V2_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT 16
6170 /*
6171 * This is data from the CFA block as indicated by the meta_format
6172 * field.
6173 * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
6174 * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
6175 * act_rec_ptr[25:0]}
6176 * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
6177 * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
6178 * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
6179 * When vee_cmpl_mode is set in VNIC context, this is the upper 32b
6180 * of the host address from the first BD used to place the packet.
6181 */
6182 uint32_t metadata2;
6183 uint16_t errors_v2;
6184 /*
6185 * This value is written by the NIC such that it will be different
6186 * for each pass through the completion queue. The even passes
6187 * will write 1. The odd passes will write 0.
6188 */
6189 #define RX_TPA_START_V2_CMPL_V2 UINT32_C(0x1)
6190 #define RX_TPA_START_V2_CMPL_ERRORS_MASK UINT32_C(0xfffe)
6191 #define RX_TPA_START_V2_CMPL_ERRORS_SFT 1
6192 /*
6193 * This error indicates that there was some sort of problem with
6194 * the BDs for the packetThe packet should be treated as
6195 * invalid.
6196 */
6197 #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe)
6198 #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_SFT 1
6199 /* No buffer error */
6200 #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER (UINT32_C(0x0) << 1)
6201 /*
6202 * Did Not Fit:
6203 * Packet did not fit into packet buffer provided. This means
6204 * that the TPA Start packet was too big to be placed into the
6205 * per-packet maximum number of physical buffers configured for
6206 * the VNIC, or that it was too big to be placed into the
6207 * per-aggregation maximum number of physical buffers configured
6208 * for the VNIC. This error only occurs when the VNIC is
6209 * configured for variable size receive buffers.
6210 */
6211 #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT (UINT32_C(0x1) << 1)
6212 /*
6213 * Bad Format:
6214 * BDs were not formatted correctly.
6215 */
6216 #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT (UINT32_C(0x3) << 1)
6217 /*
6218 * Flush:
6219 * There was a bad_format error on the previous operation
6220 */
6221 #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_FLUSH (UINT32_C(0x5) << 1)
6222 #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_LAST RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_FLUSH
6223 /*
6224 * This is data from the CFA block as indicated by the meta_format
6225 * field.
6226 */
6227 uint16_t metadata0;
6228 /* When meta_format != 0, this value is the VLAN VID. */
6229 #define RX_TPA_START_V2_CMPL_METADATA0_VID_MASK UINT32_C(0xfff)
6230 #define RX_TPA_START_V2_CMPL_METADATA0_VID_SFT 0
6231 /* When meta_format != 0, this value is the VLAN DE. */
6232 #define RX_TPA_START_V2_CMPL_METADATA0_DE UINT32_C(0x1000)
6233 /* When meta_format != 0, this value is the VLAN PRI. */
6234 #define RX_TPA_START_V2_CMPL_METADATA0_PRI_MASK UINT32_C(0xe000)
6235 #define RX_TPA_START_V2_CMPL_METADATA0_PRI_SFT 13
6236 /*
6237 * This field contains the outer_l3_offset, inner_l2_offset,
6238 * inner_l3_offset, and inner_l4_size.
6239 *
6240 * hdr_offsets[8:0] contains the outer_l3_offset.
6241 * hdr_offsets[17:9] contains the inner_l2_offset.
6242 * hdr_offsets[26:18] contains the inner_l3_offset.
6243 * hdr_offsets[31:27] contains the inner_l4_size.
6244 */
6245 uint32_t hdr_offsets;
6246 } rx_tpa_start_v2_cmpl_hi_t, *prx_tpa_start_v2_cmpl_hi_t;
6247
6248 /*
6249 * This TPA completion structure is used on devices where the
6250 * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
6251 */
6252 /* rx_tpa_end_cmpl (size:128b/16B) */
6253
6254 typedef struct rx_tpa_end_cmpl {
6255 uint16_t flags_type;
6256 /*
6257 * This field indicates the exact type of the completion.
6258 * By convention, the LSB identifies the length of the
6259 * record in 16B units. Even values indicate 16B
6260 * records. Odd values indicate 32B
6261 * records.
6262 */
6263 #define RX_TPA_END_CMPL_TYPE_MASK UINT32_C(0x3f)
6264 #define RX_TPA_END_CMPL_TYPE_SFT 0
6265 /*
6266 * RX L2 TPA End Completion:
6267 * Completion at the end of a TPA operation.
6268 * Length = 32B
6269 */
6270 #define RX_TPA_END_CMPL_TYPE_RX_TPA_END UINT32_C(0x15)
6271 #define RX_TPA_END_CMPL_TYPE_LAST RX_TPA_END_CMPL_TYPE_RX_TPA_END
6272 #define RX_TPA_END_CMPL_FLAGS_MASK UINT32_C(0xffc0)
6273 #define RX_TPA_END_CMPL_FLAGS_SFT 6
6274 /*
6275 * When this bit is '1', it indicates a packet that has an
6276 * error of some type. Type of error is indicated in
6277 * error_flags.
6278 */
6279 #define RX_TPA_END_CMPL_FLAGS_ERROR UINT32_C(0x40)
6280 /* This field indicates how the packet was placed in the buffer. */
6281 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_MASK UINT32_C(0x380)
6282 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_SFT 7
6283 /*
6284 * Jumbo:
6285 * TPA Packet was placed using jumbo algorithm. This means
6286 * that the first buffer will be filled with data before
6287 * moving to aggregation buffers. Each aggregation buffer
6288 * will be filled before moving to the next aggregation
6289 * buffer.
6290 */
6291 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_JUMBO (UINT32_C(0x1) << 7)
6292 /*
6293 * Header/Data Separation:
6294 * Packet was placed using Header/Data separation algorithm.
6295 * The separation location is indicated by the itype field.
6296 */
6297 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_HDS (UINT32_C(0x2) << 7)
6298 /*
6299 * IOC/Jumbo:
6300 * Packet will be placed using In-Order Completion/Jumbo where
6301 * the first packet of the aggregation is placed using Jumbo
6302 * Placement. Subsequent packets will be placed such that each
6303 * packet starts at the beginning of an aggregation buffer.
6304 */
6305 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_IOC_JUMBO (UINT32_C(0x4) << 7)
6306 /*
6307 * GRO/Jumbo:
6308 * Packet will be placed using GRO/Jumbo where the first
6309 * packet is filled with data. Subsequent packets will be
6310 * placed such that any one packet does not span two
6311 * aggregation buffers unless it starts at the beginning of
6312 * an aggregation buffer.
6313 */
6314 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_JUMBO (UINT32_C(0x5) << 7)
6315 /*
6316 * GRO/Header-Data Separation:
6317 * Packet will be placed using GRO/HDS where the header
6318 * is in the first packet.
6319 * Payload of each packet will be
6320 * placed such that any one packet does not span two
6321 * aggregation buffers unless it starts at the beginning of
6322 * an aggregation buffer.
6323 */
6324 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS (UINT32_C(0x6) << 7)
6325 /*
6326 * IOC/Header-Data Separation:
6327 * Packet will be placed using In-Order Completion/HDS where
6328 * the header is in the first packet buffer. Payload of each
6329 * packet will be placed such that each packet starts at the
6330 * beginning of an aggregation buffer.
6331 */
6332 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_IOC_HDS (UINT32_C(0x7) << 7)
6333 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_LAST RX_TPA_END_CMPL_FLAGS_PLACEMENT_IOC_HDS
6334 /* unused is 1 b */
6335 #define RX_TPA_END_CMPL_FLAGS_UNUSED UINT32_C(0x400)
6336 /*
6337 * This bit is '1' if metadata has been added to the end of the
6338 * packet in host memory. Metadata starts at the first 32B boundary
6339 * after the end of the packet for regular and jumbo placement.
6340 * It starts at the first 32B boundary after the end of the header
6341 * for HDS placement. The length of the metadata is indicated in the
6342 * metadata itself.
6343 */
6344 #define RX_TPA_END_CMPL_FLAGS_PKT_METADATA_PRESENT UINT32_C(0x800)
6345 /*
6346 * This value indicates what the inner packet determined for the
6347 * packet was.
6348 * - 2 TCP Packet
6349 * Indicates that the packet was IP and TCP. This indicates
6350 * that the ip_cs field is valid and that the tcp_udp_cs
6351 * field is valid and contains the TCP checksum.
6352 * This also indicates that the payload_offset field is valid.
6353 */
6354 #define RX_TPA_END_CMPL_FLAGS_ITYPE_MASK UINT32_C(0xf000)
6355 #define RX_TPA_END_CMPL_FLAGS_ITYPE_SFT 12
6356 /*
6357 * This value is zero for TPA End completions.
6358 * There is no data in the buffer that corresponds to the opaque
6359 * value in this completion.
6360 */
6361 uint16_t len;
6362 /*
6363 * This is a copy of the opaque field from the RX BD this completion
6364 * corresponds to.
6365 */
6366 uint32_t opaque;
6367 /*
6368 * This value is written by the NIC such that it will be different
6369 * for each pass through the completion queue. The even passes
6370 * will write 1. The odd passes will write 0.
6371 */
6372 uint8_t agg_bufs_v1;
6373 /*
6374 * This value is written by the NIC such that it will be different
6375 * for each pass through the completion queue. The even passes
6376 * will write 1. The odd passes will write 0.
6377 */
6378 #define RX_TPA_END_CMPL_V1 UINT32_C(0x1)
6379 /*
6380 * This value is the number of aggregation buffers that follow this
6381 * entry in the completion ring that are a part of this aggregation
6382 * packet.
6383 * If the value is zero, then the packet is completely contained
6384 * in the buffer space provided in the aggregation start completion.
6385 */
6386 #define RX_TPA_END_CMPL_AGG_BUFS_MASK UINT32_C(0x7e)
6387 #define RX_TPA_END_CMPL_AGG_BUFS_SFT 1
6388 /* This value is the number of segments in the TPA operation. */
6389 uint8_t tpa_segs;
6390 /*
6391 * This value indicates the offset in bytes from the beginning of the packet
6392 * where the inner payload starts. This value is valid for TCP, UDP,
6393 * FCoE, and RoCE packets.
6394 *
6395 * A value of zero indicates an offset of 256 bytes.
6396 */
6397 uint8_t payload_offset;
6398 uint8_t agg_id;
6399 /* unused2 is 1 b */
6400 #define RX_TPA_END_CMPL_UNUSED2 UINT32_C(0x1)
6401 /*
6402 * This is the aggregation ID that the completion is associated
6403 * with. Use this number to correlate the TPA start completion
6404 * with the TPA end completion.
6405 */
6406 #define RX_TPA_END_CMPL_AGG_ID_MASK UINT32_C(0xfe)
6407 #define RX_TPA_END_CMPL_AGG_ID_SFT 1
6408 /*
6409 * For non-GRO packets, this value is the
6410 * timestamp delta between earliest and latest timestamp values for
6411 * TPA packet. If packets were not time stamped, then delta will be
6412 * zero.
6413 *
6414 * For GRO packets, this field is zero except for the following
6415 * sub-fields.
6416 * - tsdelta[31]
6417 * Timestamp present indication. When '', no Timestamp
6418 * option is in the packet. When '1', then a Timestamp
6419 * option is present in the packet.
6420 */
6421 uint32_t tsdelta;
6422 } rx_tpa_end_cmpl_t, *prx_tpa_end_cmpl_t;
6423
6424 /*
6425 * Last 16 bytes of rx_tpa_end_cmpl.
6426 *
6427 * This TPA completion structure is used on devices where the
6428 * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
6429 */
6430 /* rx_tpa_end_cmpl_hi (size:128b/16B) */
6431
6432 typedef struct rx_tpa_end_cmpl_hi {
6433 uint32_t tpa_dup_acks;
6434 /*
6435 * This value is the number of duplicate ACKs that have been
6436 * received as part of the TPA operation.
6437 */
6438 #define RX_TPA_END_CMPL_TPA_DUP_ACKS_MASK UINT32_C(0xf)
6439 #define RX_TPA_END_CMPL_TPA_DUP_ACKS_SFT 0
6440 /*
6441 * This value is the valid when TPA completion is active. It
6442 * indicates the length of the longest segment of the TPA operation
6443 * for LRO mode and the length of the first segment in GRO mode.
6444 *
6445 * This value may be used by GRO software to re-construct the original
6446 * packet stream from the TPA packet. This is the length of all
6447 * but the last segment for GRO. In LRO mode this value may be used
6448 * to indicate MSS size to the stack.
6449 */
6450 uint16_t tpa_seg_len;
6451 /* unused4 is 16 b */
6452 uint16_t unused3;
6453 uint16_t errors_v2;
6454 /*
6455 * This value is written by the NIC such that it will be different
6456 * for each pass through the completion queue. The even passes
6457 * will write 1. The odd passes will write 0.
6458 */
6459 #define RX_TPA_END_CMPL_V2 UINT32_C(0x1)
6460 #define RX_TPA_END_CMPL_ERRORS_MASK UINT32_C(0xfffe)
6461 #define RX_TPA_END_CMPL_ERRORS_SFT 1
6462 /*
6463 * This error indicates that there was some sort of problem with
6464 * the BDs for the packet that was found after part of the
6465 * packet was already placed. The packet should be treated as
6466 * invalid.
6467 */
6468 #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe)
6469 #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_SFT 1
6470 /*
6471 * This error occurs when there is a fatal HW problem in
6472 * the chip only. It indicates that there were not
6473 * BDs on chip but that there was adequate reservation.
6474 * provided by the TPA block.
6475 */
6476 #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP (UINT32_C(0x2) << 1)
6477 /*
6478 * This error occurs when TPA block was not configured to
6479 * reserve adequate BDs for TPA operations on this RX
6480 * ring. All data for the TPA operation was not placed.
6481 *
6482 * This error can also be generated when the number of
6483 * segments is not programmed correctly in TPA and the
6484 * 33 total aggregation buffers allowed for the TPA
6485 * operation has been exceeded.
6486 */
6487 #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR (UINT32_C(0x4) << 1)
6488 #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_LAST RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR
6489 /* unused5 is 16 b */
6490 uint16_t unused_4;
6491 /*
6492 * This is the opaque value that was completed for the TPA start
6493 * completion that corresponds to this TPA end completion.
6494 */
6495 uint32_t start_opaque;
6496 } rx_tpa_end_cmpl_hi_t, *prx_tpa_end_cmpl_hi_t;
6497
6498 /*
6499 * This TPA completion structure is used on devices where the
6500 * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
6501 */
6502 /* rx_tpa_v2_start_cmpl (size:128b/16B) */
6503
6504 typedef struct rx_tpa_v2_start_cmpl {
6505 uint16_t flags_type;
6506 /*
6507 * This field indicates the exact type of the completion.
6508 * By convention, the LSB identifies the length of the
6509 * record in 16B units. Even values indicate 16B
6510 * records. Odd values indicate 32B
6511 * records.
6512 */
6513 #define RX_TPA_V2_START_CMPL_TYPE_MASK UINT32_C(0x3f)
6514 #define RX_TPA_V2_START_CMPL_TYPE_SFT 0
6515 /*
6516 * RX L2 TPA Start Completion:
6517 * Completion at the beginning of a TPA operation.
6518 * Length = 32B
6519 */
6520 #define RX_TPA_V2_START_CMPL_TYPE_RX_TPA_START UINT32_C(0x13)
6521 #define RX_TPA_V2_START_CMPL_TYPE_LAST RX_TPA_V2_START_CMPL_TYPE_RX_TPA_START
6522 #define RX_TPA_V2_START_CMPL_FLAGS_MASK UINT32_C(0xffc0)
6523 #define RX_TPA_V2_START_CMPL_FLAGS_SFT 6
6524 /* This bit will always be '' for TPA start completions. */
6525 #define RX_TPA_V2_START_CMPL_FLAGS_ERROR UINT32_C(0x40)
6526 /* This field indicates how the packet was placed in the buffer. */
6527 #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_MASK UINT32_C(0x380)
6528 #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_SFT 7
6529 /*
6530 * Jumbo:
6531 * TPA Packet was placed using jumbo algorithm. This means
6532 * that the first buffer will be filled with data before
6533 * moving to aggregation buffers. Each aggregation buffer
6534 * will be filled before moving to the next aggregation
6535 * buffer.
6536 */
6537 #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_JUMBO (UINT32_C(0x1) << 7)
6538 /*
6539 * Header/Data Separation:
6540 * Packet was placed using Header/Data separation algorithm.
6541 * The separation location is indicated by the itype field.
6542 */
6543 #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_HDS (UINT32_C(0x2) << 7)
6544 /*
6545 * GRO/Jumbo:
6546 * Packet will be placed using GRO/Jumbo where the first
6547 * packet is filled with data. Subsequent packets will be
6548 * placed such that any one packet does not span two
6549 * aggregation buffers unless it starts at the beginning of
6550 * an aggregation buffer.
6551 */
6552 #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_GRO_JUMBO (UINT32_C(0x5) << 7)
6553 /*
6554 * GRO/Header-Data Separation:
6555 * Packet will be placed using GRO/HDS where the header
6556 * is in the first packet.
6557 * Payload of each packet will be
6558 * placed such that any one packet does not span two
6559 * aggregation buffers unless it starts at the beginning of
6560 * an aggregation buffer.
6561 */
6562 #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_GRO_HDS (UINT32_C(0x6) << 7)
6563 #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_LAST RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_GRO_HDS
6564 /* This bit is '1' if the RSS field in this completion is valid. */
6565 #define RX_TPA_V2_START_CMPL_FLAGS_RSS_VALID UINT32_C(0x400)
6566 /*
6567 * For devices that support timestamps, when this bit is cleared the
6568 * `inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset`
6569 * field contains the 32b timestamp for
6570 * the packet from the MAC. When this bit is set, the
6571 * `inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset`
6572 * field contains the outer_l3_offset, inner_l2_offset,
6573 * inner_l3_offset, and inner_l4_size.
6574 */
6575 #define RX_TPA_V2_START_CMPL_FLAGS_TIMESTAMP_FLD_FORMAT UINT32_C(0x800)
6576 /*
6577 * This value indicates what the inner packet determined for the
6578 * packet was.
6579 */
6580 #define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_MASK UINT32_C(0xf000)
6581 #define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_SFT 12
6582 /*
6583 * TCP Packet:
6584 * Indicates that the packet was IP and TCP.
6585 */
6586 #define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_TCP (UINT32_C(0x2) << 12)
6587 #define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_LAST RX_TPA_V2_START_CMPL_FLAGS_ITYPE_TCP
6588 /*
6589 * This value indicates the amount of packet data written to the
6590 * buffer the opaque field in this completion corresponds to.
6591 */
6592 uint16_t len;
6593 /*
6594 * This is a copy of the opaque field from the RX BD this completion
6595 * corresponds to.
6596 */
6597 uint32_t opaque;
6598 /*
6599 * This value is written by the NIC such that it will be different
6600 * for each pass through the completion queue. The even passes
6601 * will write 1. The odd passes will write 0.
6602 */
6603 uint8_t v1;
6604 /*
6605 * This value is written by the NIC such that it will be different
6606 * for each pass through the completion queue. The even passes
6607 * will write 1. The odd passes will write 0.
6608 */
6609 #define RX_TPA_V2_START_CMPL_V1 UINT32_C(0x1)
6610 #define RX_TPA_V2_START_CMPL_LAST RX_TPA_V2_START_CMPL_V1
6611 /*
6612 * This is the RSS hash type for the packet. The value is packed
6613 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
6614 *
6615 * The value of tuple_extrac_op provides the information about
6616 * what fields the hash was computed on.
6617 * * 0: The RSS hash was computed over source IP address,
6618 * destination IP address, source port, and destination port of inner
6619 * IP and TCP or UDP headers. Note: For non-tunneled packets,
6620 * the packet headers are considered inner packet headers for the RSS
6621 * hash computation purpose.
6622 * * 1: The RSS hash was computed over source IP address and destination
6623 * IP address of inner IP header. Note: For non-tunneled packets,
6624 * the packet headers are considered inner packet headers for the RSS
6625 * hash computation purpose.
6626 * * 2: The RSS hash was computed over source IP address,
6627 * destination IP address, source port, and destination port of
6628 * IP and TCP or UDP headers of outer tunnel headers.
6629 * Note: For non-tunneled packets, this value is not applicable.
6630 * * 3: The RSS hash was computed over source IP address and
6631 * destination IP address of IP header of outer tunnel headers.
6632 * Note: For non-tunneled packets, this value is not applicable.
6633 *
6634 * Note that 4-tuples values listed above are applicable
6635 * for layer 4 protocols supported and enabled for RSS in the hardware,
6636 * HWRM firmware, and drivers. For example, if RSS hash is supported and
6637 * enabled for TCP traffic only, then the values of tuple_extract_op
6638 * corresponding to 4-tuples are only valid for TCP traffic.
6639 */
6640 uint8_t rss_hash_type;
6641 /*
6642 * This is the aggregation ID that the completion is associated
6643 * with. Use this number to correlate the TPA start completion
6644 * with the TPA end completion.
6645 */
6646 uint16_t agg_id;
6647 /*
6648 * This value is the RSS hash value calculated for the packet
6649 * based on the mode bits and key value in the VNIC.
6650 */
6651 uint32_t rss_hash;
6652 } rx_tpa_v2_start_cmpl_t, *prx_tpa_v2_start_cmpl_t;
6653
6654 /*
6655 * Last 16 bytes of rx_tpa_v2_start_cmpl.
6656 *
6657 * This TPA completion structure is used on devices where the
6658 * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
6659 */
6660 /* rx_tpa_v2_start_cmpl_hi (size:128b/16B) */
6661
6662 typedef struct rx_tpa_v2_start_cmpl_hi {
6663 uint32_t flags2;
6664 /*
6665 * This indicates that the ip checksum was calculated for the
6666 * inner packet and that the sum passed for all segments
6667 * included in the aggregation.
6668 */
6669 #define RX_TPA_V2_START_CMPL_FLAGS2_IP_CS_CALC UINT32_C(0x1)
6670 /*
6671 * This indicates that the TCP, UDP or ICMP checksum was
6672 * calculated for the inner packet and that the sum passed
6673 * for all segments included in the aggregation.
6674 */
6675 #define RX_TPA_V2_START_CMPL_FLAGS2_L4_CS_CALC UINT32_C(0x2)
6676 /*
6677 * This indicates that the ip checksum was calculated for the
6678 * tunnel header and that the sum passed for all segments
6679 * included in the aggregation.
6680 */
6681 #define RX_TPA_V2_START_CMPL_FLAGS2_T_IP_CS_CALC UINT32_C(0x4)
6682 /*
6683 * This indicates that the UDP checksum was
6684 * calculated for the tunnel packet and that the sum passed for
6685 * all segments included in the aggregation.
6686 */
6687 #define RX_TPA_V2_START_CMPL_FLAGS2_T_L4_CS_CALC UINT32_C(0x8)
6688 /* This value indicates what format the metadata field is. */
6689 #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_MASK UINT32_C(0xf0)
6690 #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_SFT 4
6691 /* No metadata informtaion. Value is zero. */
6692 #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_NONE (UINT32_C(0x0) << 4)
6693 /*
6694 * The metadata field contains the VLAN tag and TPID value.
6695 * - metadata[11:0] contains the vlan VID value.
6696 * - metadata[12] contains the vlan DE value.
6697 * - metadata[15:13] contains the vlan PRI value.
6698 * - metadata[31:16] contains the vlan TPID value.
6699 */
6700 #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_VLAN (UINT32_C(0x1) << 4)
6701 /*
6702 * If ext_meta_format is equal to 1, the metadata field
6703 * contains the lower 16b of the tunnel ID value, justified
6704 * to LSB
6705 * - VXLAN = VNI[23:0] -> VXLAN Network ID
6706 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier.
6707 * - NVGRE = TNI[23:0] -> Tenant Network ID
6708 * - GRE = KEY[31:0 -> key fieled with bit mask. zero if K = 0
6709 * - IPV4 = 0 (not populated)
6710 * - IPV6 = Flow Label[19:0]
6711 * - PPPoE = sessionID[15:0]
6712 * - MPLs = Outer label[19:0]
6713 * - UPAR = Selected[31:0] with bit mask
6714 */
6715 #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID (UINT32_C(0x2) << 4)
6716 /*
6717 * if ext_meta_format is equal to 1, metadata field contains
6718 * 16b metadata from the prepended header (chdr_data).
6719 */
6720 #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_CHDR_DATA (UINT32_C(0x3) << 4)
6721 /*
6722 * If ext_meta_format is equal to 1, the metadata field contains
6723 * the outer_l3_offset, inner_l2_offset, inner_l3_offset and
6724 * inner_l4_size.
6725 * - metadata[8:0] contains the outer_l3_offset.
6726 * - metadata[17:9] contains the inner_l2_offset.
6727 * - metadata[26:18] contains the inner_l3_offset.
6728 * - metadata[31:27] contains the inner_l4_size.
6729 */
6730 #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET (UINT32_C(0x4) << 4)
6731 #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_LAST RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET
6732 /*
6733 * This field indicates the IP type for the inner-most IP header.
6734 * A value of '' indicates IPv4. A value of '1' indicates IPv6.
6735 */
6736 #define RX_TPA_V2_START_CMPL_FLAGS2_IP_TYPE UINT32_C(0x100)
6737 /*
6738 * This indicates that the complete 1's complement checksum was
6739 * calculated for the packet.
6740 */
6741 #define RX_TPA_V2_START_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC UINT32_C(0x200)
6742 /*
6743 * The combination of this value and meta_format indicated what
6744 * format the metadata field is.
6745 */
6746 #define RX_TPA_V2_START_CMPL_FLAGS2_EXT_META_FORMAT_MASK UINT32_C(0xc00)
6747 #define RX_TPA_V2_START_CMPL_FLAGS2_EXT_META_FORMAT_SFT 10
6748 /*
6749 * This value is the complete 1's complement checksum calculated from
6750 * the start of the outer L3 header to the end of the packet (not
6751 * including the ethernet crc). It is valid when the
6752 * 'complete_checksum_calc' flag is set. For TPA Start completions,
6753 * the complete checksum is calculated for the first packet in the
6754 * aggregation only.
6755 */
6756 #define RX_TPA_V2_START_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK UINT32_C(0xffff0000)
6757 #define RX_TPA_V2_START_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT 16
6758 /*
6759 * This is data from the CFA block as indicated by the meta_format
6760 * field.
6761 */
6762 uint32_t metadata;
6763 /* When {ext_meta_format,meta_format}=1, this value is the VLAN VID. */
6764 #define RX_TPA_V2_START_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
6765 #define RX_TPA_V2_START_CMPL_METADATA_VID_SFT 0
6766 /* When {ext_meta_format,meta_format}=1, this value is the VLAN DE. */
6767 #define RX_TPA_V2_START_CMPL_METADATA_DE UINT32_C(0x1000)
6768 /* When {ext_meta_format,meta_format}=1, this value is the VLAN PRI. */
6769 #define RX_TPA_V2_START_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
6770 #define RX_TPA_V2_START_CMPL_METADATA_PRI_SFT 13
6771 /* When {ext_meta_format,meta_format}=1, this value is the VLAN TPID. */
6772 #define RX_TPA_V2_START_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
6773 #define RX_TPA_V2_START_CMPL_METADATA_TPID_SFT 16
6774 uint16_t errors_v2;
6775 /*
6776 * This value is written by the NIC such that it will be different
6777 * for each pass through the completion queue. The even passes
6778 * will write 1. The odd passes will write 0.
6779 */
6780 #define RX_TPA_V2_START_CMPL_V2 UINT32_C(0x1)
6781 #define RX_TPA_V2_START_CMPL_ERRORS_MASK UINT32_C(0xfffe)
6782 #define RX_TPA_V2_START_CMPL_ERRORS_SFT 1
6783 /*
6784 * This error indicates that there was some sort of problem with
6785 * the BDs for the packet that was found after part of the
6786 * packet was already placed. The packet should be treated as
6787 * invalid.
6788 */
6789 #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe)
6790 #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_SFT 1
6791 /* No buffer error */
6792 #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER (UINT32_C(0x0) << 1)
6793 /*
6794 * Bad Format:
6795 * BDs were not formatted correctly.
6796 */
6797 #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT (UINT32_C(0x3) << 1)
6798 /*
6799 * Flush:
6800 * There was a bad_format error on the previous operation
6801 */
6802 #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_FLUSH (UINT32_C(0x5) << 1)
6803 #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_LAST RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_FLUSH
6804 /*
6805 * This field identifies the CFA action rule that was used for this
6806 * packet.
6807 */
6808 uint16_t cfa_code;
6809 /*
6810 * For devices that support timestamps this field is overridden
6811 * with the timestamp value. When `flags.timestamp_fld_format` is
6812 * cleared, this field contains the 32b timestamp for the packet from the
6813 * MAC.
6814 *
6815 * When `flags.timestamp_fld_format` is set, this field contains the
6816 * outer_l3_offset, inner_l2_offset, inner_l3_offset, and inner_l4_size
6817 * as defined below.
6818 */
6819 uint32_t inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset;
6820 /*
6821 * This is the offset from the beginning of the packet in bytes for
6822 * the outer L3 header. If there is no outer L3 header, then this
6823 * value is zero.
6824 */
6825 #define RX_TPA_V2_START_CMPL_OUTER_L3_OFFSET_MASK UINT32_C(0x1ff)
6826 #define RX_TPA_V2_START_CMPL_OUTER_L3_OFFSET_SFT 0
6827 /*
6828 * This is the offset from the beginning of the packet in bytes for
6829 * the inner most L2 header.
6830 */
6831 #define RX_TPA_V2_START_CMPL_INNER_L2_OFFSET_MASK UINT32_C(0x3fe00)
6832 #define RX_TPA_V2_START_CMPL_INNER_L2_OFFSET_SFT 9
6833 /*
6834 * This is the offset from the beginning of the packet in bytes for
6835 * the inner most L3 header.
6836 */
6837 #define RX_TPA_V2_START_CMPL_INNER_L3_OFFSET_MASK UINT32_C(0x7fc0000)
6838 #define RX_TPA_V2_START_CMPL_INNER_L3_OFFSET_SFT 18
6839 /*
6840 * This is the size in bytes of the inner most L4 header.
6841 * This can be subtracted from the payload_offset to determine
6842 * the start of the inner most L4 header.
6843 */
6844 #define RX_TPA_V2_START_CMPL_INNER_L4_SIZE_MASK UINT32_C(0xf8000000)
6845 #define RX_TPA_V2_START_CMPL_INNER_L4_SIZE_SFT 27
6846 } rx_tpa_v2_start_cmpl_hi_t, *prx_tpa_v2_start_cmpl_hi_t;
6847
6848 /*
6849 * This TPA completion structure is used on devices where the
6850 * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
6851 */
6852 /* rx_tpa_v2_end_cmpl (size:128b/16B) */
6853
6854 typedef struct rx_tpa_v2_end_cmpl {
6855 uint16_t flags_type;
6856 /*
6857 * This field indicates the exact type of the completion.
6858 * By convention, the LSB identifies the length of the
6859 * record in 16B units. Even values indicate 16B
6860 * records. Odd values indicate 32B
6861 * records.
6862 */
6863 #define RX_TPA_V2_END_CMPL_TYPE_MASK UINT32_C(0x3f)
6864 #define RX_TPA_V2_END_CMPL_TYPE_SFT 0
6865 /*
6866 * RX L2 TPA End Completion:
6867 * Completion at the end of a TPA operation.
6868 * Length = 32B
6869 */
6870 #define RX_TPA_V2_END_CMPL_TYPE_RX_TPA_END UINT32_C(0x15)
6871 #define RX_TPA_V2_END_CMPL_TYPE_LAST RX_TPA_V2_END_CMPL_TYPE_RX_TPA_END
6872 #define RX_TPA_V2_END_CMPL_FLAGS_MASK UINT32_C(0xffc0)
6873 #define RX_TPA_V2_END_CMPL_FLAGS_SFT 6
6874 /*
6875 * When this bit is '1', it indicates a packet that has an
6876 * error of some type. Type of error is indicated in
6877 * error_flags.
6878 */
6879 #define RX_TPA_V2_END_CMPL_FLAGS_ERROR UINT32_C(0x40)
6880 /* This field indicates how the packet was placed in the buffer. */
6881 #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_MASK UINT32_C(0x380)
6882 #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_SFT 7
6883 /*
6884 * Jumbo:
6885 * TPA Packet was placed using jumbo algorithm. This means
6886 * that the first buffer will be filled with data before
6887 * moving to aggregation buffers. Each aggregation buffer
6888 * will be filled before moving to the next aggregation
6889 * buffer.
6890 */
6891 #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_JUMBO (UINT32_C(0x1) << 7)
6892 /*
6893 * Header/Data Separation:
6894 * Packet was placed using Header/Data separation algorithm.
6895 * The separation location is indicated by the itype field.
6896 */
6897 #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_HDS (UINT32_C(0x2) << 7)
6898 /*
6899 * GRO/Jumbo:
6900 * Packet will be placed using GRO/Jumbo where the first
6901 * packet is filled with data. Subsequent packets will be
6902 * placed such that any one packet does not span two
6903 * aggregation buffers unless it starts at the beginning of
6904 * an aggregation buffer.
6905 */
6906 #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_GRO_JUMBO (UINT32_C(0x5) << 7)
6907 /*
6908 * GRO/Header-Data Separation:
6909 * Packet will be placed using GRO/HDS where the header
6910 * is in the first packet.
6911 * Payload of each packet will be
6912 * placed such that any one packet does not span two
6913 * aggregation buffers unless it starts at the beginning of
6914 * an aggregation buffer.
6915 */
6916 #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_GRO_HDS (UINT32_C(0x6) << 7)
6917 /*
6918 * IOC/Header-Data Separation:
6919 * Packet will be placed using In-Order Completion/HDS where
6920 * the header is in the first packet buffer. Payload of each
6921 * packet will be placed such that each packet starts at the
6922 * beginning of an aggregation buffer.
6923 */
6924 #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_IOC_HDS (UINT32_C(0x7) << 7)
6925 #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_LAST RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_IOC_HDS
6926 /* unused is 1 b */
6927 #define RX_TPA_V2_END_CMPL_FLAGS_UNUSED UINT32_C(0x400)
6928 /*
6929 * This bit is '1' if metadata has been added to the end of the
6930 * packet in host memory. Metadata starts at the first 32B boundary
6931 * after the end of the packet for regular and jumbo placement.
6932 * It starts at the first 32B boundary after the end of the header
6933 * for HDS placement. The length of the metadata is indicated in the
6934 * metadata itself.
6935 */
6936 #define RX_TPA_V2_END_CMPL_FLAGS_PKT_METADATA_PRESENT UINT32_C(0x800)
6937 /*
6938 * This value indicates what the inner packet determined for the
6939 * packet was.
6940 * - 2 TCP Packet
6941 * Indicates that the packet was IP and TCP. This indicates
6942 * that the ip_cs field is valid and that the tcp_udp_cs
6943 * field is valid and contains the TCP checksum.
6944 * This also indicates that the payload_offset field is valid.
6945 */
6946 #define RX_TPA_V2_END_CMPL_FLAGS_ITYPE_MASK UINT32_C(0xf000)
6947 #define RX_TPA_V2_END_CMPL_FLAGS_ITYPE_SFT 12
6948 /*
6949 * This value is zero for TPA End completions.
6950 * There is no data in the buffer that corresponds to the opaque
6951 * value in this completion.
6952 */
6953 uint16_t len;
6954 /*
6955 * This is a copy of the opaque field from the RX BD this completion
6956 * corresponds to.
6957 */
6958 uint32_t opaque;
6959 uint8_t v1;
6960 /*
6961 * This value is written by the NIC such that it will be different
6962 * for each pass through the completion queue. The even passes
6963 * will write 1. The odd passes will write 0.
6964 */
6965 #define RX_TPA_V2_END_CMPL_V1 UINT32_C(0x1)
6966 /* This value is the number of segments in the TPA operation. */
6967 uint8_t tpa_segs;
6968 /*
6969 * This is the aggregation ID that the completion is associated
6970 * with. Use this number to correlate the TPA start completion
6971 * with the TPA end completion.
6972 */
6973 uint16_t agg_id;
6974 /*
6975 * For non-GRO packets, this value is the
6976 * timestamp delta between earliest and latest timestamp values for
6977 * TPA packet. If packets were not time stamped, then delta will be
6978 * zero.
6979 *
6980 * For GRO packets, this field is zero except for the following
6981 * sub-fields.
6982 * - tsdelta[31]
6983 * Timestamp present indication. When '', no Timestamp
6984 * option is in the packet. When '1', then a Timestamp
6985 * option is present in the packet.
6986 */
6987 uint32_t tsdelta;
6988 } rx_tpa_v2_end_cmpl_t, *prx_tpa_v2_end_cmpl_t;
6989
6990 /*
6991 * Last 16 bytes of rx_tpa_v2_end_cmpl.
6992 *
6993 * This TPA completion structure is used on devices where the
6994 * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
6995 */
6996 /* rx_tpa_v2_end_cmpl_hi (size:128b/16B) */
6997
6998 typedef struct rx_tpa_v2_end_cmpl_hi {
6999 /*
7000 * This value is the number of duplicate ACKs that have been
7001 * received as part of the TPA operation.
7002 */
7003 uint16_t tpa_dup_acks;
7004 /*
7005 * This value is the number of duplicate ACKs that have been
7006 * received as part of the TPA operation.
7007 */
7008 #define RX_TPA_V2_END_CMPL_TPA_DUP_ACKS_MASK UINT32_C(0xf)
7009 #define RX_TPA_V2_END_CMPL_TPA_DUP_ACKS_SFT 0
7010 /*
7011 * This value indicated the offset in bytes from the beginning of
7012 * the packet where the inner payload starts. This value is valid
7013 * for TCP, UDP, FCoE and RoCE packets
7014 */
7015 uint8_t payload_offset;
7016 /*
7017 * The value is the total number of aggregation buffers that were
7018 * used in the TPA operation. All TPA aggregation buffer completions
7019 * precede the TPA End completion. If the value is zero, then the
7020 * aggregation is completely contained in the buffer space provided
7021 * in the aggregation start completion.
7022 * Note that the field is simply provided as a cross check.
7023 */
7024 uint8_t tpa_agg_bufs;
7025 /*
7026 * This value is the valid when TPA completion is active. It
7027 * indicates the length of the longest segment of the TPA operation
7028 * for LRO mode and the length of the first segment in GRO mode.
7029 *
7030 * This value may be used by GRO software to re-construct the original
7031 * packet stream from the TPA packet. This is the length of all
7032 * but the last segment for GRO. In LRO mode this value may be used
7033 * to indicate MSS size to the stack.
7034 */
7035 uint16_t tpa_seg_len;
7036 uint16_t unused_1;
7037 uint16_t errors_v2;
7038 /*
7039 * This value is written by the NIC such that it will be different
7040 * for each pass through the completion queue. The even passes
7041 * will write 1. The odd passes will write 0.
7042 */
7043 #define RX_TPA_V2_END_CMPL_V2 UINT32_C(0x1)
7044 #define RX_TPA_V2_END_CMPL_ERRORS_MASK UINT32_C(0xfffe)
7045 #define RX_TPA_V2_END_CMPL_ERRORS_SFT 1
7046 /*
7047 * This error indicates that there was some sort of problem with
7048 * the BDs for the packet that was found after part of the
7049 * packet was already placed. The packet should be treated as
7050 * invalid.
7051 */
7052 #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe)
7053 #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_SFT 1
7054 /* No buffer error */
7055 #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER (UINT32_C(0x0) << 1)
7056 /*
7057 * This error occurs when there is a fatal HW problem in
7058 * the chip only. It indicates that there were not
7059 * BDs on chip but that there was adequate reservation.
7060 * provided by the TPA block.
7061 */
7062 #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP (UINT32_C(0x2) << 1)
7063 /*
7064 * Bad Format:
7065 * BDs were not formatted correctly.
7066 */
7067 #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT (UINT32_C(0x3) << 1)
7068 /*
7069 * This error occurs when TPA block was not configured to
7070 * reserve adequate BDs for TPA operations on this RX
7071 * ring. All data for the TPA operation was not placed.
7072 *
7073 * This error can also be generated when the number of
7074 * segments is not programmed correctly in TPA and the
7075 * 33 total aggregation buffers allowed for the TPA
7076 * operation has been exceeded.
7077 */
7078 #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR (UINT32_C(0x4) << 1)
7079 /*
7080 * Flush:
7081 * There was a bad_format error on the previous operation
7082 */
7083 #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_FLUSH (UINT32_C(0x5) << 1)
7084 #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_LAST RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_FLUSH
7085 uint16_t unused_2;
7086 /*
7087 * This is the opaque value that was completed for the TPA start
7088 * completion that corresponds to this TPA end completion.
7089 */
7090 uint32_t start_opaque;
7091 } rx_tpa_v2_end_cmpl_hi_t, *prx_tpa_v2_end_cmpl_hi_t;
7092
7093 /*
7094 * This TPA completion structure is used on devices where the
7095 * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
7096 */
7097 /* rx_tpa_v2_abuf_cmpl (size:128b/16B) */
7098
7099 typedef struct rx_tpa_v2_abuf_cmpl {
7100 uint16_t type;
7101 /*
7102 * This field indicates the exact type of the completion.
7103 * By convention, the LSB identifies the length of the
7104 * record in 16B units. Even values indicate 16B
7105 * records. Odd values indicate 32B
7106 * records.
7107 */
7108 #define RX_TPA_V2_ABUF_CMPL_TYPE_MASK UINT32_C(0x3f)
7109 #define RX_TPA_V2_ABUF_CMPL_TYPE_SFT 0
7110 /*
7111 * RX TPA Aggregation Buffer completion :
7112 * Completion of an L2 aggregation buffer in support of
7113 * TPA packet completion. Length = 16B
7114 */
7115 #define RX_TPA_V2_ABUF_CMPL_TYPE_RX_TPA_AGG UINT32_C(0x16)
7116 #define RX_TPA_V2_ABUF_CMPL_TYPE_LAST RX_TPA_V2_ABUF_CMPL_TYPE_RX_TPA_AGG
7117 /*
7118 * This is the length of the data for the packet stored in this
7119 * aggregation buffer identified by the opaque value. This does not
7120 * include the length of any
7121 * data placed in other aggregation BDs or in the packet or buffer
7122 * BDs. This length does not include any space added due to
7123 * hdr_offset register during HDS placement mode.
7124 */
7125 uint16_t len;
7126 /*
7127 * This is a copy of the opaque field from the RX BD this aggregation
7128 * buffer corresponds to.
7129 */
7130 uint32_t opaque;
7131 uint16_t v;
7132 /*
7133 * This value is written by the NIC such that it will be different
7134 * for each pass through the completion queue. The even passes
7135 * will write 1. The odd passes will write 0.
7136 */
7137 #define RX_TPA_V2_ABUF_CMPL_V UINT32_C(0x1)
7138 /*
7139 * This is the aggregation ID that the completion is associated with. Use
7140 * this number to correlate the TPA agg completion with the TPA start
7141 * completion and the TPA end completion.
7142 */
7143 uint16_t agg_id;
7144 uint32_t unused_1;
7145 } rx_tpa_v2_abuf_cmpl_t, *prx_tpa_v2_abuf_cmpl_t;
7146
7147 /* rx_abuf_cmpl (size:128b/16B) */
7148
7149 typedef struct rx_abuf_cmpl {
7150 uint16_t type;
7151 /*
7152 * This field indicates the exact type of the completion.
7153 * By convention, the LSB identifies the length of the
7154 * record in 16B units. Even values indicate 16B
7155 * records. Odd values indicate 32B
7156 * records.
7157 */
7158 #define RX_ABUF_CMPL_TYPE_MASK UINT32_C(0x3f)
7159 #define RX_ABUF_CMPL_TYPE_SFT 0
7160 /*
7161 * RX Aggregation Buffer completion :
7162 * Completion of an L2 aggregation buffer in support of
7163 * TPA, HDS, or Jumbo packet completion. Length = 16B
7164 */
7165 #define RX_ABUF_CMPL_TYPE_RX_AGG UINT32_C(0x12)
7166 #define RX_ABUF_CMPL_TYPE_LAST RX_ABUF_CMPL_TYPE_RX_AGG
7167 /*
7168 * This is the length of the data for the packet stored in this
7169 * aggregation buffer identified by the opaque value. This does not
7170 * include the length of any
7171 * data placed in other aggregation BDs or in the packet or buffer
7172 * BDs. This length does not include any space added due to
7173 * hdr_offset register during HDS placement mode.
7174 */
7175 uint16_t len;
7176 /*
7177 * This is a copy of the opaque field from the RX BD this aggregation
7178 * buffer corresponds to.
7179 */
7180 uint32_t opaque;
7181 uint32_t v;
7182 /*
7183 * This value is written by the NIC such that it will be different
7184 * for each pass through the completion queue. The even passes
7185 * will write 1. The odd passes will write 0.
7186 */
7187 #define RX_ABUF_CMPL_V UINT32_C(0x1)
7188 /* unused3 is 32 b */
7189 uint32_t unused_2;
7190 } rx_abuf_cmpl_t, *prx_abuf_cmpl_t;
7191
7192 /* VEE FLUSH Completion Record (16 bytes) */
7193 /* vee_flush (size:128b/16B) */
7194
7195 typedef struct vee_flush {
7196 uint32_t downstream_path_type;
7197 /*
7198 * This field indicates the exact type of the completion.
7199 * By convention, the LSB identifies the length of the
7200 * record in 16B units. Even values indicate 16B
7201 * records. Odd values indicate 32B
7202 * records.
7203 */
7204 #define VEE_FLUSH_TYPE_MASK UINT32_C(0x3f)
7205 #define VEE_FLUSH_TYPE_SFT 0
7206 /*
7207 * VEE Flush Completion:
7208 * This completion is inserted manually by the Primate and processed
7209 * by the VEE hardware to ensure that all completions on a VEE
7210 * function have been processed by the VEE hardware before FLR
7211 * process is completed.
7212 */
7213 #define VEE_FLUSH_TYPE_VEE_FLUSH UINT32_C(0x1c)
7214 #define VEE_FLUSH_TYPE_LAST VEE_FLUSH_TYPE_VEE_FLUSH
7215 /* downstream_path is 1 b */
7216 #define VEE_FLUSH_DOWNSTREAM_PATH UINT32_C(0x40)
7217 /* This completion is associated with VEE Transmit */
7218 #define VEE_FLUSH_DOWNSTREAM_PATH_TX (UINT32_C(0x0) << 6)
7219 /* This completion is associated with VEE Receive */
7220 #define VEE_FLUSH_DOWNSTREAM_PATH_RX (UINT32_C(0x1) << 6)
7221 #define VEE_FLUSH_DOWNSTREAM_PATH_LAST VEE_FLUSH_DOWNSTREAM_PATH_RX
7222 /*
7223 * This is an opaque value that is passed through the completion
7224 * to the VEE handler SW and is used to indicate what VEE VQ or
7225 * function has completed FLR processing.
7226 */
7227 uint32_t opaque;
7228 uint32_t v;
7229 /*
7230 * This value is written by the NIC such that it will be different
7231 * for each pass through the completion queue. The even passes will
7232 * write 1. The odd passes will write 0.
7233 */
7234 #define VEE_FLUSH_V UINT32_C(0x1)
7235 /* unused3 is 32 b */
7236 uint32_t unused_3;
7237 } vee_flush_t, *pvee_flush_t;
7238
7239 /* eject_cmpl (size:128b/16B) */
7240
7241 typedef struct eject_cmpl {
7242 uint16_t type;
7243 /*
7244 * This field indicates the exact type of the completion.
7245 * By convention, the LSB identifies the length of the
7246 * record in 16B units. Even values indicate 16B
7247 * records. Odd values indicate 32B
7248 * records.
7249 */
7250 #define EJECT_CMPL_TYPE_MASK UINT32_C(0x3f)
7251 #define EJECT_CMPL_TYPE_SFT 0
7252 /*
7253 * Statistics Ejection Completion:
7254 * Completion of statistics data ejection buffer.
7255 * Length = 16B
7256 */
7257 #define EJECT_CMPL_TYPE_STAT_EJECT UINT32_C(0x1a)
7258 #define EJECT_CMPL_TYPE_LAST EJECT_CMPL_TYPE_STAT_EJECT
7259 #define EJECT_CMPL_FLAGS_MASK UINT32_C(0xffc0)
7260 #define EJECT_CMPL_FLAGS_SFT 6
7261 /*
7262 * When this bit is '1', it indicates a packet that has an
7263 * error of some type. Type of error is indicated in
7264 * error_flags.
7265 */
7266 #define EJECT_CMPL_FLAGS_ERROR UINT32_C(0x40)
7267 /*
7268 * This is the length of the statistics data stored in this
7269 * buffer.
7270 */
7271 uint16_t len;
7272 /*
7273 * This is a copy of the opaque field from the RX BD this ejection
7274 * buffer corresponds to.
7275 */
7276 uint32_t opaque;
7277 uint16_t v;
7278 /*
7279 * This value is written by the NIC such that it will be different
7280 * for each pass through the completion queue. The even passes
7281 * will write 1. The odd passes will write 0.
7282 */
7283 #define EJECT_CMPL_V UINT32_C(0x1)
7284 #define EJECT_CMPL_ERRORS_MASK UINT32_C(0xfffe)
7285 #define EJECT_CMPL_ERRORS_SFT 1
7286 /*
7287 * This error indicates that there was some sort of problem with
7288 * the BDs for statistics ejection. The statistics ejection should
7289 * be treated as invalid
7290 */
7291 #define EJECT_CMPL_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe)
7292 #define EJECT_CMPL_ERRORS_BUFFER_ERROR_SFT 1
7293 /* No buffer error */
7294 #define EJECT_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER (UINT32_C(0x0) << 1)
7295 /*
7296 * Did Not Fit:
7297 * Statistics did not fit into aggregation buffer provided.
7298 */
7299 #define EJECT_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT (UINT32_C(0x1) << 1)
7300 /*
7301 * Bad Format:
7302 * BDs were not formatted correctly.
7303 */
7304 #define EJECT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT (UINT32_C(0x3) << 1)
7305 /*
7306 * Flush:
7307 * There was a bad_format error on the previous operation
7308 */
7309 #define EJECT_CMPL_ERRORS_BUFFER_ERROR_FLUSH (UINT32_C(0x5) << 1)
7310 #define EJECT_CMPL_ERRORS_BUFFER_ERROR_LAST EJECT_CMPL_ERRORS_BUFFER_ERROR_FLUSH
7311 /* reserved16 is 16 b */
7312 uint16_t reserved16;
7313 /* unused3 is 32 b */
7314 uint32_t unused_2;
7315 } eject_cmpl_t, *peject_cmpl_t;
7316
7317 /* hwrm_cmpl (size:128b/16B) */
7318
7319 typedef struct hwrm_cmpl {
7320 uint16_t type;
7321 /*
7322 * This field indicates the exact type of the completion.
7323 * By convention, the LSB identifies the length of the
7324 * record in 16B units. Even values indicate 16B
7325 * records. Odd values indicate 32B
7326 * records.
7327 */
7328 #define HWRM_CMPL_TYPE_MASK UINT32_C(0x3f)
7329 #define HWRM_CMPL_TYPE_SFT 0
7330 /*
7331 * HWRM Command Completion:
7332 * Completion of an HWRM command.
7333 */
7334 #define HWRM_CMPL_TYPE_HWRM_DONE UINT32_C(0x20)
7335 #define HWRM_CMPL_TYPE_LAST HWRM_CMPL_TYPE_HWRM_DONE
7336 /* This is the sequence_id of the HWRM command that has completed. */
7337 uint16_t sequence_id;
7338 /* unused2 is 32 b */
7339 uint32_t unused_1;
7340 uint32_t v;
7341 /*
7342 * This value is written by the NIC such that it will be different
7343 * for each pass through the completion queue. The even passes
7344 * will write 1. The odd passes will write 0.
7345 */
7346 #define HWRM_CMPL_V UINT32_C(0x1)
7347 /* unused4 is 32 b */
7348 uint32_t unused_3;
7349 } hwrm_cmpl_t, *phwrm_cmpl_t;
7350
7351 /* hwrm_fwd_req_cmpl (size:128b/16B) */
7352
7353 typedef struct hwrm_fwd_req_cmpl {
7354 /*
7355 * This field indicates the exact type of the completion.
7356 * By convention, the LSB identifies the length of the
7357 * record in 16B units. Even values indicate 16B
7358 * records. Odd values indicate 32B
7359 * records.
7360 */
7361 uint16_t req_len_type;
7362 /*
7363 * This field indicates the exact type of the completion.
7364 * By convention, the LSB identifies the length of the
7365 * record in 16B units. Even values indicate 16B
7366 * records. Odd values indicate 32B
7367 * records.
7368 */
7369 #define HWRM_FWD_REQ_CMPL_TYPE_MASK UINT32_C(0x3f)
7370 #define HWRM_FWD_REQ_CMPL_TYPE_SFT 0
7371 /* Forwarded HWRM Request */
7372 #define HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ UINT32_C(0x22)
7373 #define HWRM_FWD_REQ_CMPL_TYPE_LAST HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ
7374 /* Length of forwarded request in bytes. */
7375 #define HWRM_FWD_REQ_CMPL_REQ_LEN_MASK UINT32_C(0xffc0)
7376 #define HWRM_FWD_REQ_CMPL_REQ_LEN_SFT 6
7377 /*
7378 * Source ID of this request.
7379 * Typically used in forwarding requests and responses.
7380 * 0x0 - 0xFFF8 - Used for function ids
7381 * 0xFFF8 - 0xFFFE - Reserved for internal processors
7382 * 0xFFFF - HWRM
7383 */
7384 uint16_t source_id;
7385 /* unused1 is 32 b */
7386 uint32_t unused0;
7387 /* Address of forwarded request. */
7388 uint64_t req_buf_addr_v;
7389 /*
7390 * This value is written by the NIC such that it will be different
7391 * for each pass through the completion queue. The even passes
7392 * will write 1. The odd passes will write 0.
7393 */
7394 #define HWRM_FWD_REQ_CMPL_V UINT32_C(0x1)
7395 /* Address of forwarded request. */
7396 #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_MASK UINT32_C(0xfffffffe)
7397 #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_SFT 1
7398 } hwrm_fwd_req_cmpl_t, *phwrm_fwd_req_cmpl_t;
7399
7400 /* hwrm_fwd_resp_cmpl (size:128b/16B) */
7401
7402 typedef struct hwrm_fwd_resp_cmpl {
7403 uint16_t type;
7404 /*
7405 * This field indicates the exact type of the completion.
7406 * By convention, the LSB identifies the length of the
7407 * record in 16B units. Even values indicate 16B
7408 * records. Odd values indicate 32B
7409 * records.
7410 */
7411 #define HWRM_FWD_RESP_CMPL_TYPE_MASK UINT32_C(0x3f)
7412 #define HWRM_FWD_RESP_CMPL_TYPE_SFT 0
7413 /* Forwarded HWRM Response */
7414 #define HWRM_FWD_RESP_CMPL_TYPE_HWRM_FWD_RESP UINT32_C(0x24)
7415 #define HWRM_FWD_RESP_CMPL_TYPE_LAST HWRM_FWD_RESP_CMPL_TYPE_HWRM_FWD_RESP
7416 /*
7417 * Source ID of this response.
7418 * Typically used in forwarding requests and responses.
7419 * 0x0 - 0xFFF8 - Used for function ids
7420 * 0xFFF8 - 0xFFFE - Reserved for internal processors
7421 * 0xFFFF - HWRM
7422 */
7423 uint16_t source_id;
7424 /* Length of forwarded response in bytes. */
7425 uint16_t resp_len;
7426 /* unused2 is 16 b */
7427 uint16_t unused_1;
7428 /* Address of forwarded request. */
7429 uint64_t resp_buf_addr_v;
7430 /*
7431 * This value is written by the NIC such that it will be different
7432 * for each pass through the completion queue. The even passes
7433 * will write 1. The odd passes will write 0.
7434 */
7435 #define HWRM_FWD_RESP_CMPL_V UINT32_C(0x1)
7436 /* Address of forwarded request. */
7437 #define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_MASK UINT32_C(0xfffffffe)
7438 #define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_SFT 1
7439 } hwrm_fwd_resp_cmpl_t, *phwrm_fwd_resp_cmpl_t;
7440
7441 /* hwrm_async_event_cmpl (size:128b/16B) */
7442
7443 typedef struct hwrm_async_event_cmpl {
7444 uint16_t type;
7445 /*
7446 * This field indicates the exact type of the completion.
7447 * By convention, the LSB identifies the length of the
7448 * record in 16B units. Even values indicate 16B
7449 * records. Odd values indicate 32B
7450 * records.
7451 */
7452 #define HWRM_ASYNC_EVENT_CMPL_TYPE_MASK UINT32_C(0x3f)
7453 #define HWRM_ASYNC_EVENT_CMPL_TYPE_SFT 0
7454 /* HWRM Asynchronous Event Information */
7455 #define HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
7456 #define HWRM_ASYNC_EVENT_CMPL_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT
7457 /* Identifiers of events. */
7458 uint16_t event_id;
7459 /* Link status changed */
7460 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE UINT32_C(0x0)
7461 /* Link MTU changed */
7462 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_MTU_CHANGE UINT32_C(0x1)
7463 /* Link speed changed */
7464 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE UINT32_C(0x2)
7465 /* DCB Configuration changed */
7466 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE UINT32_C(0x3)
7467 /* Port connection not allowed */
7468 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED UINT32_C(0x4)
7469 /* Link speed configuration was not allowed */
7470 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED UINT32_C(0x5)
7471 /* Link speed configuration change */
7472 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE UINT32_C(0x6)
7473 /* Port PHY configuration change */
7474 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_PHY_CFG_CHANGE UINT32_C(0x7)
7475 /* Reset notification to clients */
7476 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY UINT32_C(0x8)
7477 /* Master function selection event */
7478 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ERROR_RECOVERY UINT32_C(0x9)
7479 /*
7480 * An event signifying that a ring has been disabled by
7481 * hw due to error.
7482 */
7483 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RING_MONITOR_MSG UINT32_C(0xa)
7484 /* Function driver unloaded */
7485 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_UNLOAD UINT32_C(0x10)
7486 /* Function driver loaded */
7487 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_LOAD UINT32_C(0x11)
7488 /* Function FLR related processing has completed */
7489 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_FLR_PROC_CMPLT UINT32_C(0x12)
7490 /* PF driver unloaded */
7491 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD UINT32_C(0x20)
7492 /* PF driver loaded */
7493 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_LOAD UINT32_C(0x21)
7494 /* VF Function Level Reset (FLR) */
7495 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_FLR UINT32_C(0x30)
7496 /* VF MAC Address Change */
7497 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_MAC_ADDR_CHANGE UINT32_C(0x31)
7498 /* PF-VF communication channel status change. */
7499 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_VF_COMM_STATUS_CHANGE UINT32_C(0x32)
7500 /* VF Configuration Change */
7501 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE UINT32_C(0x33)
7502 /* LLFC/PFC Configuration Change */
7503 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LLFC_PFC_CHANGE UINT32_C(0x34)
7504 /* Default VNIC Configuration Change */
7505 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEFAULT_VNIC_CHANGE UINT32_C(0x35)
7506 /* HW flow aged */
7507 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HW_FLOW_AGED UINT32_C(0x36)
7508 /*
7509 * A debug notification being posted to the driver. These
7510 * notifications are purely for diagnostic purpose and should not be
7511 * used for functional purpose. The driver is not supposed to act
7512 * on these messages except to log/record it.
7513 */
7514 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEBUG_NOTIFICATION UINT32_C(0x37)
7515 /*
7516 * An EEM flow cached memory flush for all flows request event being
7517 * posted to the PF driver.
7518 */
7519 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_CACHE_FLUSH_REQ UINT32_C(0x38)
7520 /*
7521 * An EEM flow cache memory flush completion event being posted to the
7522 * firmware by the PF driver. This is indication that host EEM flush
7523 * has completed by the PF.
7524 */
7525 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_CACHE_FLUSH_DONE UINT32_C(0x39)
7526 /*
7527 * A tcp flag action change event being posted to the PF or trusted VF
7528 * driver by the firmware. The PF or trusted VF driver should query
7529 * the firmware for the new TCP flag action update after receiving
7530 * this async event.
7531 */
7532 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_TCP_FLAG_ACTION_CHANGE UINT32_C(0x3a)
7533 /*
7534 * An EEM flow active event being posted to the PF or trusted VF driver
7535 * by the firmware. The PF or trusted VF driver should update the
7536 * flow's aging timer after receiving this async event.
7537 */
7538 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_FLOW_ACTIVE UINT32_C(0x3b)
7539 /*
7540 * A eem cfg change event being posted to the trusted VF driver by the
7541 * firmware if the parent PF EEM configuration changed.
7542 */
7543 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_CFG_CHANGE UINT32_C(0x3c)
7544 /*
7545 * Deprecated.
7546 * TFLIB unique default VNIC Configuration Change
7547 */
7548 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_TFLIB_DEFAULT_VNIC_CHANGE UINT32_C(0x3d)
7549 /*
7550 * Deprecated.
7551 * TFLIB unique link status changed
7552 */
7553 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_TFLIB_LINK_STATUS_CHANGE UINT32_C(0x3e)
7554 /*
7555 * An event signifying completion for HWRM_FW_STATE_QUIESCE
7556 * (completion, timeout, or error)
7557 */
7558 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_QUIESCE_DONE UINT32_C(0x3f)
7559 /*
7560 * An event signifying a HWRM command is in progress and its
7561 * response will be deferred. This event is used on crypto controllers
7562 * only.
7563 */
7564 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEFERRED_RESPONSE UINT32_C(0x40)
7565 /*
7566 * An event signifying that a PFC WatchDog configuration
7567 * has changed on any port / cos.
7568 */
7569 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PFC_WATCHDOG_CFG_CHANGE UINT32_C(0x41)
7570 /*
7571 * An echo request from the firmware. An echo response is expected by
7572 * the firmware.
7573 */
7574 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ECHO_REQUEST UINT32_C(0x42)
7575 /*
7576 * An event from firmware indicating who has been selected as the
7577 * PHC Master. Only the function who is the Master can discipline
7578 * PHC.
7579 */
7580 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PHC_MASTER UINT32_C(0x43)
7581 /*
7582 * An event from firmware showing the last PPS timestamp that has been
7583 * latched.
7584 */
7585 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PPS_TIMESTAMP UINT32_C(0x44)
7586 /* Maximum Registrable event id. */
7587 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_MAX_RGTR_EVENT_ID UINT32_C(0x45)
7588 /*
7589 * A trace log message. This contains firmware trace logs string
7590 * embedded in the asynchronous message. This is an experimental
7591 * event, not meant for production use at this time.
7592 */
7593 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FW_TRACE_MSG UINT32_C(0xfe)
7594 /* HWRM Error */
7595 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR UINT32_C(0xff)
7596 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR
7597 /* Event specific data */
7598 uint32_t event_data2;
7599 uint8_t opaque_v;
7600 /*
7601 * This value is written by the NIC such that it will be different
7602 * for each pass through the completion queue. The even passes
7603 * will write 1. The odd passes will write 0.
7604 */
7605 #define HWRM_ASYNC_EVENT_CMPL_V UINT32_C(0x1)
7606 /* opaque is 7 b */
7607 #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_MASK UINT32_C(0xfe)
7608 #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_SFT 1
7609 /* 8-lsb timestamp from POR (100-msec resolution) */
7610 uint8_t timestamp_lo;
7611 /* 16-lsb timestamp from POR (100-msec resolution) */
7612 uint16_t timestamp_hi;
7613 /* Event specific data */
7614 uint32_t event_data1;
7615 } hwrm_async_event_cmpl_t, *phwrm_async_event_cmpl_t;
7616
7617 #define GET_EVENT_ID(x) \
7618 (((x) < 0x80) ? \
7619 ((x) == 0x0 ? "LINK_STATUS_CHANGE": \
7620 ((x) == 0x1 ? "LINK_MTU_CHANGE": \
7621 ((x) == 0x2 ? "LINK_SPEED_CHANGE": \
7622 ((x) == 0x3 ? "DCB_CONFIG_CHANGE": \
7623 ((x) == 0x4 ? "PORT_CONN_NOT_ALLOWED": \
7624 ((x) == 0x5 ? "LINK_SPEED_CFG_NOT_ALLOWED": \
7625 ((x) == 0x6 ? "LINK_SPEED_CFG_CHANGE": \
7626 ((x) == 0x7 ? "PORT_PHY_CFG_CHANGE": \
7627 ((x) == 0x8 ? "RESET_NOTIFY": \
7628 ((x) == 0x9 ? "ERROR_RECOVERY": \
7629 ((x) == 0xa ? "RING_MONITOR_MSG": \
7630 ((x) == 0x10 ? "FUNC_DRVR_UNLOAD": \
7631 ((x) == 0x11 ? "FUNC_DRVR_LOAD": \
7632 ((x) == 0x12 ? "FUNC_FLR_PROC_CMPLT": \
7633 ((x) == 0x20 ? "PF_DRVR_UNLOAD": \
7634 ((x) == 0x21 ? "PF_DRVR_LOAD": \
7635 ((x) == 0x30 ? "VF_FLR": \
7636 ((x) == 0x31 ? "VF_MAC_ADDR_CHANGE": \
7637 ((x) == 0x32 ? "PF_VF_COMM_STATUS_CHANGE": \
7638 ((x) == 0x33 ? "VF_CFG_CHANGE": \
7639 ((x) == 0x34 ? "LLFC_PFC_CHANGE": \
7640 ((x) == 0x35 ? "DEFAULT_VNIC_CHANGE": \
7641 ((x) == 0x36 ? "HW_FLOW_AGED": \
7642 ((x) == 0x37 ? "DEBUG_NOTIFICATION": \
7643 ((x) == 0x38 ? "EEM_CACHE_FLUSH_REQ": \
7644 ((x) == 0x39 ? "EEM_CACHE_FLUSH_DONE": \
7645 ((x) == 0x3a ? "TCP_FLAG_ACTION_CHANGE": \
7646 ((x) == 0x3b ? "EEM_FLOW_ACTIVE": \
7647 ((x) == 0x3c ? "EEM_CFG_CHANGE": \
7648 ((x) == 0x3d ? "TFLIB_DEFAULT_VNIC_CHANGE": \
7649 ((x) == 0x3e ? "TFLIB_LINK_STATUS_CHANGE": \
7650 ((x) == 0x3f ? "QUIESCE_DONE": \
7651 ((x) == 0x40 ? "DEFERRED_RESPONSE": \
7652 ((x) == 0x41 ? "PFC_WATCHDOG_CFG_CHANGE": \
7653 ((x) == 0x42 ? "ECHO_REQUEST": \
7654 ((x) == 0x43 ? "PHC_MASTER": \
7655 ((x) == 0x44 ? "PPS_TIMESTAMP": \
7656 ((x) == 0x45 ? "MAX_RGTR_EVENT_ID": \
7657 "Unknown decode" )))))))))))))))))))))))))))))))))))))) : \
7658 (((x) < 0x100) ? \
7659 ((x) == 0xfe ? "FW_TRACE_MSG": \
7660 ((x) == 0xff ? "HWRM_ERROR": \
7661 "Unknown decode" )) : \
7662 "Unknown decode" ))
7663
7664
7665 /* hwrm_async_event_cmpl_link_status_change (size:128b/16B) */
7666
7667 typedef struct hwrm_async_event_cmpl_link_status_change {
7668 uint16_t type;
7669 /*
7670 * This field indicates the exact type of the completion.
7671 * By convention, the LSB identifies the length of the
7672 * record in 16B units. Even values indicate 16B
7673 * records. Odd values indicate 32B
7674 * records.
7675 */
7676 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_MASK UINT32_C(0x3f)
7677 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_SFT 0
7678 /* HWRM Asynchronous Event Information */
7679 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
7680 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT
7681 /* Identifiers of events. */
7682 uint16_t event_id;
7683 /* Link status changed */
7684 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LINK_STATUS_CHANGE UINT32_C(0x0)
7685 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LINK_STATUS_CHANGE
7686 /* Event specific data */
7687 uint32_t event_data2;
7688 uint8_t opaque_v;
7689 /*
7690 * This value is written by the NIC such that it will be different
7691 * for each pass through the completion queue. The even passes
7692 * will write 1. The odd passes will write 0.
7693 */
7694 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_V UINT32_C(0x1)
7695 /* opaque is 7 b */
7696 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
7697 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_SFT 1
7698 /* 8-lsb timestamp from POR (100-msec resolution) */
7699 uint8_t timestamp_lo;
7700 /* 16-lsb timestamp from POR (100-msec resolution) */
7701 uint16_t timestamp_hi;
7702 /* Event specific data */
7703 uint32_t event_data1;
7704 /* Indicates link status change */
7705 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE UINT32_C(0x1)
7706 /*
7707 * If this bit set to 0, then it indicates that the link
7708 * was up and it went down.
7709 */
7710 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_DOWN UINT32_C(0x0)
7711 /*
7712 * If this bit is set to 1, then it indicates that the link
7713 * was down and it went up.
7714 */
7715 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_UP UINT32_C(0x1)
7716 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_LAST HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_UP
7717 /* Indicates the physical port this link status change occur */
7718 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_MASK UINT32_C(0xe)
7719 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_SFT 1
7720 /* PORT ID */
7721 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_MASK UINT32_C(0xffff0)
7722 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_SFT 4
7723 /* Indicates the physical function this event occurred on. */
7724 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PF_ID_MASK UINT32_C(0xff00000)
7725 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PF_ID_SFT 20
7726 } hwrm_async_event_cmpl_link_status_change_t, *phwrm_async_event_cmpl_link_status_change_t;
7727
7728 /* hwrm_async_event_cmpl_link_mtu_change (size:128b/16B) */
7729
7730 typedef struct hwrm_async_event_cmpl_link_mtu_change {
7731 uint16_t type;
7732 /*
7733 * This field indicates the exact type of the completion.
7734 * By convention, the LSB identifies the length of the
7735 * record in 16B units. Even values indicate 16B
7736 * records. Odd values indicate 32B
7737 * records.
7738 */
7739 #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_MASK UINT32_C(0x3f)
7740 #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_SFT 0
7741 /* HWRM Asynchronous Event Information */
7742 #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
7743 #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_HWRM_ASYNC_EVENT
7744 /* Identifiers of events. */
7745 uint16_t event_id;
7746 /* Link MTU changed */
7747 #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LINK_MTU_CHANGE UINT32_C(0x1)
7748 #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LINK_MTU_CHANGE
7749 /* Event specific data */
7750 uint32_t event_data2;
7751 uint8_t opaque_v;
7752 /*
7753 * This value is written by the NIC such that it will be different
7754 * for each pass through the completion queue. The even passes
7755 * will write 1. The odd passes will write 0.
7756 */
7757 #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_V UINT32_C(0x1)
7758 /* opaque is 7 b */
7759 #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
7760 #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_OPAQUE_SFT 1
7761 /* 8-lsb timestamp from POR (100-msec resolution) */
7762 uint8_t timestamp_lo;
7763 /* 16-lsb timestamp from POR (100-msec resolution) */
7764 uint16_t timestamp_hi;
7765 /* Event specific data */
7766 uint32_t event_data1;
7767 /* The new MTU of the link in bytes. */
7768 #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_MASK UINT32_C(0xffff)
7769 #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_SFT 0
7770 } hwrm_async_event_cmpl_link_mtu_change_t, *phwrm_async_event_cmpl_link_mtu_change_t;
7771
7772 /* hwrm_async_event_cmpl_link_speed_change (size:128b/16B) */
7773
7774 typedef struct hwrm_async_event_cmpl_link_speed_change {
7775 uint16_t type;
7776 /*
7777 * This field indicates the exact type of the completion.
7778 * By convention, the LSB identifies the length of the
7779 * record in 16B units. Even values indicate 16B
7780 * records. Odd values indicate 32B
7781 * records.
7782 */
7783 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_MASK UINT32_C(0x3f)
7784 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_SFT 0
7785 /* HWRM Asynchronous Event Information */
7786 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
7787 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_HWRM_ASYNC_EVENT
7788 /* Identifiers of events. */
7789 uint16_t event_id;
7790 /* Link speed changed */
7791 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LINK_SPEED_CHANGE UINT32_C(0x2)
7792 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LINK_SPEED_CHANGE
7793 /* Event specific data */
7794 uint32_t event_data2;
7795 uint8_t opaque_v;
7796 /*
7797 * This value is written by the NIC such that it will be different
7798 * for each pass through the completion queue. The even passes
7799 * will write 1. The odd passes will write 0.
7800 */
7801 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_V UINT32_C(0x1)
7802 /* opaque is 7 b */
7803 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
7804 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_OPAQUE_SFT 1
7805 /* 8-lsb timestamp from POR (100-msec resolution) */
7806 uint8_t timestamp_lo;
7807 /* 16-lsb timestamp from POR (100-msec resolution) */
7808 uint16_t timestamp_hi;
7809 /* Event specific data */
7810 uint32_t event_data1;
7811 /*
7812 * When this bit is '1', the link was forced to the
7813 * force_link_speed value.
7814 */
7815 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_FORCE UINT32_C(0x1)
7816 /* The new link speed in 100 Mbps units. */
7817 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_MASK UINT32_C(0xfffe)
7818 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_SFT 1
7819 /* 100Mb link speed */
7820 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100MB (UINT32_C(0x1) << 1)
7821 /* 1Gb link speed */
7822 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_1GB (UINT32_C(0xa) << 1)
7823 /* 2Gb link speed */
7824 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_2GB (UINT32_C(0x14) << 1)
7825 /* 25Gb link speed */
7826 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_2_5GB (UINT32_C(0x19) << 1)
7827 /* 10Gb link speed */
7828 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_10GB (UINT32_C(0x64) << 1)
7829 /* 20Mb link speed */
7830 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_20GB (UINT32_C(0xc8) << 1)
7831 /* 25Gb link speed */
7832 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_25GB (UINT32_C(0xfa) << 1)
7833 /* 40Gb link speed */
7834 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_40GB (UINT32_C(0x190) << 1)
7835 /* 50Gb link speed */
7836 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_50GB (UINT32_C(0x1f4) << 1)
7837 /* 100Gb link speed */
7838 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100GB (UINT32_C(0x3e8) << 1)
7839 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_LAST HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100GB
7840 /* PORT ID */
7841 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_PORT_ID_MASK UINT32_C(0xffff0000)
7842 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_PORT_ID_SFT 16
7843 } hwrm_async_event_cmpl_link_speed_change_t, *phwrm_async_event_cmpl_link_speed_change_t;
7844
7845 /* hwrm_async_event_cmpl_dcb_config_change (size:128b/16B) */
7846
7847 typedef struct hwrm_async_event_cmpl_dcb_config_change {
7848 uint16_t type;
7849 /*
7850 * This field indicates the exact type of the completion.
7851 * By convention, the LSB identifies the length of the
7852 * record in 16B units. Even values indicate 16B
7853 * records. Odd values indicate 32B
7854 * records.
7855 */
7856 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_MASK UINT32_C(0x3f)
7857 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_SFT 0
7858 /* HWRM Asynchronous Event Information */
7859 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
7860 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_HWRM_ASYNC_EVENT
7861 /* Identifiers of events. */
7862 uint16_t event_id;
7863 /* DCB Configuration changed */
7864 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_DCB_CONFIG_CHANGE UINT32_C(0x3)
7865 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_DCB_CONFIG_CHANGE
7866 /* Event specific data */
7867 uint32_t event_data2;
7868 /* ETS configuration change */
7869 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_ETS UINT32_C(0x1)
7870 /* PFC configuration change */
7871 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_PFC UINT32_C(0x2)
7872 /* APP configuration change */
7873 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_APP UINT32_C(0x4)
7874 /* DSCP configuration change */
7875 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_DSCP UINT32_C(0x8)
7876 uint8_t opaque_v;
7877 /*
7878 * This value is written by the NIC such that it will be different
7879 * for each pass through the completion queue. The even passes
7880 * will write 1. The odd passes will write 0.
7881 */
7882 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_V UINT32_C(0x1)
7883 /* opaque is 7 b */
7884 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
7885 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_OPAQUE_SFT 1
7886 /* 8-lsb timestamp from POR (100-msec resolution) */
7887 uint8_t timestamp_lo;
7888 /* 16-lsb timestamp from POR (100-msec resolution) */
7889 uint16_t timestamp_hi;
7890 /* Event specific data */
7891 uint32_t event_data1;
7892 /* PORT ID */
7893 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_MASK UINT32_C(0xffff)
7894 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_SFT 0
7895 /* Priority recommended for RoCE traffic */
7896 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_MASK UINT32_C(0xff0000)
7897 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_SFT 16
7898 /* none is 255 */
7899 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_NONE (UINT32_C(0xff) << 16)
7900 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_LAST HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_NONE
7901 /* Priority recommended for L2 traffic */
7902 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_MASK UINT32_C(0xff000000)
7903 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_SFT 24
7904 /* none is 255 */
7905 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_NONE (UINT32_C(0xff) << 24)
7906 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_LAST HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_NONE
7907 } hwrm_async_event_cmpl_dcb_config_change_t, *phwrm_async_event_cmpl_dcb_config_change_t;
7908
7909 /* hwrm_async_event_cmpl_port_conn_not_allowed (size:128b/16B) */
7910
7911 typedef struct hwrm_async_event_cmpl_port_conn_not_allowed {
7912 uint16_t type;
7913 /*
7914 * This field indicates the exact type of the completion.
7915 * By convention, the LSB identifies the length of the
7916 * record in 16B units. Even values indicate 16B
7917 * records. Odd values indicate 32B
7918 * records.
7919 */
7920 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_MASK UINT32_C(0x3f)
7921 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_SFT 0
7922 /* HWRM Asynchronous Event Information */
7923 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
7924 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT
7925 /* Identifiers of events. */
7926 uint16_t event_id;
7927 /* Port connection not allowed */
7928 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_PORT_CONN_NOT_ALLOWED UINT32_C(0x4)
7929 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_PORT_CONN_NOT_ALLOWED
7930 /* Event specific data */
7931 uint32_t event_data2;
7932 uint8_t opaque_v;
7933 /*
7934 * This value is written by the NIC such that it will be different
7935 * for each pass through the completion queue. The even passes
7936 * will write 1. The odd passes will write 0.
7937 */
7938 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_V UINT32_C(0x1)
7939 /* opaque is 7 b */
7940 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_OPAQUE_MASK UINT32_C(0xfe)
7941 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_OPAQUE_SFT 1
7942 /* 8-lsb timestamp from POR (100-msec resolution) */
7943 uint8_t timestamp_lo;
7944 /* 16-lsb timestamp from POR (100-msec resolution) */
7945 uint16_t timestamp_hi;
7946 /* Event specific data */
7947 uint32_t event_data1;
7948 /* PORT ID */
7949 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK UINT32_C(0xffff)
7950 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_SFT 0
7951 /*
7952 * This value indicates the current port level enforcement policy
7953 * for the optics module when there is an optical module mismatch
7954 * and port is not connected.
7955 */
7956 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_MASK UINT32_C(0xff0000)
7957 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_SFT 16
7958 /* No enforcement */
7959 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_NONE (UINT32_C(0x0) << 16)
7960 /* Disable Transmit side Laser. */
7961 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_DISABLETX (UINT32_C(0x1) << 16)
7962 /* Raise a warning message. */
7963 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_WARNINGMSG (UINT32_C(0x2) << 16)
7964 /* Power down the module. */
7965 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_PWRDOWN (UINT32_C(0x3) << 16)
7966 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_LAST HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_PWRDOWN
7967 } hwrm_async_event_cmpl_port_conn_not_allowed_t, *phwrm_async_event_cmpl_port_conn_not_allowed_t;
7968
7969 /* hwrm_async_event_cmpl_link_speed_cfg_not_allowed (size:128b/16B) */
7970
7971 typedef struct hwrm_async_event_cmpl_link_speed_cfg_not_allowed {
7972 uint16_t type;
7973 /*
7974 * This field indicates the exact type of the completion.
7975 * By convention, the LSB identifies the length of the
7976 * record in 16B units. Even values indicate 16B
7977 * records. Odd values indicate 32B
7978 * records.
7979 */
7980 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_MASK UINT32_C(0x3f)
7981 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_SFT 0
7982 /* HWRM Asynchronous Event Information */
7983 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
7984 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT
7985 /* Identifiers of events. */
7986 uint16_t event_id;
7987 /* Link speed configuration was not allowed */
7988 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED UINT32_C(0x5)
7989 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED
7990 /* Event specific data */
7991 uint32_t event_data2;
7992 uint8_t opaque_v;
7993 /*
7994 * This value is written by the NIC such that it will be different
7995 * for each pass through the completion queue. The even passes
7996 * will write 1. The odd passes will write 0.
7997 */
7998 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_V UINT32_C(0x1)
7999 /* opaque is 7 b */
8000 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_OPAQUE_MASK UINT32_C(0xfe)
8001 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_OPAQUE_SFT 1
8002 /* 8-lsb timestamp from POR (100-msec resolution) */
8003 uint8_t timestamp_lo;
8004 /* 16-lsb timestamp from POR (100-msec resolution) */
8005 uint16_t timestamp_hi;
8006 /* Event specific data */
8007 uint32_t event_data1;
8008 /* PORT ID */
8009 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK UINT32_C(0xffff)
8010 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_DATA1_PORT_ID_SFT 0
8011 } hwrm_async_event_cmpl_link_speed_cfg_not_allowed_t, *phwrm_async_event_cmpl_link_speed_cfg_not_allowed_t;
8012
8013 /* hwrm_async_event_cmpl_link_speed_cfg_change (size:128b/16B) */
8014
8015 typedef struct hwrm_async_event_cmpl_link_speed_cfg_change {
8016 uint16_t type;
8017 /*
8018 * This field indicates the exact type of the completion.
8019 * By convention, the LSB identifies the length of the
8020 * record in 16B units. Even values indicate 16B
8021 * records. Odd values indicate 32B
8022 * records.
8023 */
8024 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_MASK UINT32_C(0x3f)
8025 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_SFT 0
8026 /* HWRM Asynchronous Event Information */
8027 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
8028 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
8029 /* Identifiers of events. */
8030 uint16_t event_id;
8031 /* Link speed configuration change */
8032 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LINK_SPEED_CFG_CHANGE UINT32_C(0x6)
8033 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LINK_SPEED_CFG_CHANGE
8034 /* Event specific data */
8035 uint32_t event_data2;
8036 uint8_t opaque_v;
8037 /*
8038 * This value is written by the NIC such that it will be different
8039 * for each pass through the completion queue. The even passes
8040 * will write 1. The odd passes will write 0.
8041 */
8042 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_V UINT32_C(0x1)
8043 /* opaque is 7 b */
8044 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
8045 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_OPAQUE_SFT 1
8046 /* 8-lsb timestamp from POR (100-msec resolution) */
8047 uint8_t timestamp_lo;
8048 /* 16-lsb timestamp from POR (100-msec resolution) */
8049 uint16_t timestamp_hi;
8050 /* Event specific data */
8051 uint32_t event_data1;
8052 /* PORT ID */
8053 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK UINT32_C(0xffff)
8054 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT 0
8055 /*
8056 * If set to 1, it indicates that the supported link speeds
8057 * configuration on the port has changed.
8058 * If set to 0, then there is no change in supported link speeds
8059 * configuration.
8060 */
8061 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_SUPPORTED_LINK_SPEEDS_CHANGE UINT32_C(0x10000)
8062 /*
8063 * If set to 1, it indicates that the link speed configuration
8064 * on the port has become illegal or invalid.
8065 * If set to 0, then the link speed configuration on the port is
8066 * legal or valid.
8067 */
8068 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_ILLEGAL_LINK_SPEED_CFG UINT32_C(0x20000)
8069 } hwrm_async_event_cmpl_link_speed_cfg_change_t, *phwrm_async_event_cmpl_link_speed_cfg_change_t;
8070
8071 /* hwrm_async_event_cmpl_port_phy_cfg_change (size:128b/16B) */
8072
8073 typedef struct hwrm_async_event_cmpl_port_phy_cfg_change {
8074 uint16_t type;
8075 /*
8076 * This field indicates the exact type of the completion.
8077 * By convention, the LSB identifies the length of the
8078 * record in 16B units. Even values indicate 16B
8079 * records. Odd values indicate 32B
8080 * records.
8081 */
8082 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_MASK UINT32_C(0x3f)
8083 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_SFT 0
8084 /* HWRM Asynchronous Event Information */
8085 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
8086 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
8087 /* Identifiers of events. */
8088 uint16_t event_id;
8089 /* Port PHY configuration change */
8090 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_PORT_PHY_CFG_CHANGE UINT32_C(0x7)
8091 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_PORT_PHY_CFG_CHANGE
8092 /* Event specific data */
8093 uint32_t event_data2;
8094 uint8_t opaque_v;
8095 /*
8096 * This value is written by the NIC such that it will be different
8097 * for each pass through the completion queue. The even passes
8098 * will write 1. The odd passes will write 0.
8099 */
8100 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_V UINT32_C(0x1)
8101 /* opaque is 7 b */
8102 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
8103 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_OPAQUE_SFT 1
8104 /* 8-lsb timestamp from POR (100-msec resolution) */
8105 uint8_t timestamp_lo;
8106 /* 16-lsb timestamp from POR (100-msec resolution) */
8107 uint16_t timestamp_hi;
8108 /* Event specific data */
8109 uint32_t event_data1;
8110 /* PORT ID */
8111 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK UINT32_C(0xffff)
8112 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT 0
8113 /*
8114 * If set to 1, it indicates that the FEC
8115 * configuration on the port has changed.
8116 * If set to 0, then there is no change in FEC configuration.
8117 */
8118 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_FEC_CFG_CHANGE UINT32_C(0x10000)
8119 /*
8120 * If set to 1, it indicates that the EEE configuration
8121 * on the port has changed.
8122 * If set to 0, then there is no change in EEE configuration
8123 * on the port.
8124 */
8125 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_EEE_CFG_CHANGE UINT32_C(0x20000)
8126 /*
8127 * If set to 1, it indicates that the pause configuration
8128 * on the PHY has changed.
8129 * If set to 0, then there is no change in the pause
8130 * configuration on the PHY.
8131 */
8132 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PAUSE_CFG_CHANGE UINT32_C(0x40000)
8133 } hwrm_async_event_cmpl_port_phy_cfg_change_t, *phwrm_async_event_cmpl_port_phy_cfg_change_t;
8134
8135 /* hwrm_async_event_cmpl_reset_notify (size:128b/16B) */
8136
8137 typedef struct hwrm_async_event_cmpl_reset_notify {
8138 uint16_t type;
8139 /*
8140 * This field indicates the exact type of the completion.
8141 * By convention, the LSB identifies the length of the
8142 * record in 16B units. Even values indicate 16B
8143 * records. Odd values indicate 32B
8144 * records.
8145 */
8146 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_MASK UINT32_C(0x3f)
8147 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_SFT 0
8148 /* HWRM Asynchronous Event Information */
8149 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
8150 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_HWRM_ASYNC_EVENT
8151 /* Identifiers of events. */
8152 uint16_t event_id;
8153 /* Notify clients of imminent reset. */
8154 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_RESET_NOTIFY UINT32_C(0x8)
8155 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_RESET_NOTIFY
8156 /* Event specific data. The data is for internal debug use only. */
8157 uint32_t event_data2;
8158 /*
8159 * These bits indicate the status as being reported by the firmware.
8160 * This value is exactly the same as status code in fw_status register.
8161 * If the status code is equal to 0x8000, then the reset is initiated
8162 * by the Host using the FW_RESET command when the FW is in a healthy
8163 * state. If the status code is not equal to 0x8000, then the reset is
8164 * initiated by the FW to recover from the error or FATAL state.
8165 */
8166 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA2_FW_STATUS_CODE_MASK UINT32_C(0xffff)
8167 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA2_FW_STATUS_CODE_SFT 0
8168 uint8_t opaque_v;
8169 /*
8170 * This value is written by the NIC such that it will be different
8171 * for each pass through the completion queue. The even passes
8172 * will write 1. The odd passes will write 0.
8173 */
8174 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_V UINT32_C(0x1)
8175 /* opaque is 7 b */
8176 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_OPAQUE_MASK UINT32_C(0xfe)
8177 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_OPAQUE_SFT 1
8178 /*
8179 * 8-lsb timestamp (100-msec resolution)
8180 * The Minimum time required for the Firmware readiness after sending this
8181 * notification to the driver instances.
8182 */
8183 uint8_t timestamp_lo;
8184 /*
8185 * 16-lsb timestamp (100-msec resolution)
8186 * The Maximum Firmware Reset bail out value in the order of 100
8187 * milli seconds. The driver instances will use this value to re-initiate the
8188 * registration process again if the core firmware didn’t set the ready
8189 * state bit.
8190 */
8191 uint16_t timestamp_hi;
8192 /* Event specific data */
8193 uint32_t event_data1;
8194 /* Indicates driver action requested */
8195 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_MASK UINT32_C(0xff)
8196 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_SFT 0
8197 /*
8198 * If set to 1, it indicates that the l2 client should
8199 * stop sending in band traffic to Nitro.
8200 * if set to 0, there is no change in L2 client behavior.
8201 */
8202 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_STOP_TX_QUEUE UINT32_C(0x1)
8203 /*
8204 * If set to 1, it indicates that the L2 client should
8205 * bring down the interface.
8206 * If set to 0, then there is no change in L2 client behavior.
8207 */
8208 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_IFDOWN UINT32_C(0x2)
8209 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_LAST HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_IFDOWN
8210 /* Indicates reason for reset. */
8211 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_MASK UINT32_C(0xff00)
8212 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_SFT 8
8213 /* A management client has requested reset. */
8214 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_MANAGEMENT_RESET_REQUEST (UINT32_C(0x1) << 8)
8215 /* A fatal firmware exception has occurred. */
8216 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_EXCEPTION_FATAL (UINT32_C(0x2) << 8)
8217 /* A non-fatal firmware exception has occurred. */
8218 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_EXCEPTION_NON_FATAL (UINT32_C(0x3) << 8)
8219 /* Fast reset */
8220 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FAST_RESET (UINT32_C(0x4) << 8)
8221 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_LAST HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FAST_RESET
8222 /*
8223 * Minimum time before driver should attempt access - units 100ms ticks.
8224 * Range 0-65535
8225 */
8226 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DELAY_IN_100MS_TICKS_MASK UINT32_C(0xffff0000)
8227 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DELAY_IN_100MS_TICKS_SFT 16
8228 } hwrm_async_event_cmpl_reset_notify_t, *phwrm_async_event_cmpl_reset_notify_t;
8229
8230 /* hwrm_async_event_cmpl_error_recovery (size:128b/16B) */
8231
8232 typedef struct hwrm_async_event_cmpl_error_recovery {
8233 uint16_t type;
8234 /*
8235 * This field indicates the exact type of the completion.
8236 * By convention, the LSB identifies the length of the
8237 * record in 16B units. Even values indicate 16B
8238 * records. Odd values indicate 32B
8239 * records.
8240 */
8241 #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_MASK UINT32_C(0x3f)
8242 #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_SFT 0
8243 /* HWRM Asynchronous Event Information */
8244 #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
8245 #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_HWRM_ASYNC_EVENT
8246 /* Identifiers of events. */
8247 uint16_t event_id;
8248 /*
8249 * This async notification message can be used for selecting or
8250 * deselecting master function for error recovery,
8251 * and to communicate to all the functions whether error recovery
8252 * was enabled/disabled.
8253 */
8254 #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_ID_ERROR_RECOVERY UINT32_C(0x9)
8255 #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_ID_ERROR_RECOVERY
8256 /* Event specific data */
8257 uint32_t event_data2;
8258 uint8_t opaque_v;
8259 /*
8260 * This value is written by the NIC such that it will be different
8261 * for each pass through the completion queue. The even passes
8262 * will write 1. The odd passes will write 0.
8263 */
8264 #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_V UINT32_C(0x1)
8265 /* opaque is 7 b */
8266 #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_OPAQUE_MASK UINT32_C(0xfe)
8267 #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_OPAQUE_SFT 1
8268 /* 8-lsb timestamp (100-msec resolution) */
8269 uint8_t timestamp_lo;
8270 /* 16-lsb timestamp (100-msec resolution) */
8271 uint16_t timestamp_hi;
8272 /* Event specific data */
8273 uint32_t event_data1;
8274 /* Indicates driver action requested */
8275 #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_MASK UINT32_C(0xff)
8276 #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_SFT 0
8277 /*
8278 * If set to 1, this function is selected as Master function.
8279 * This function has responsibility to do 'chip reset' when it
8280 * detects a fatal error. If set to 0, master function functionality
8281 * is disabled on this function.
8282 */
8283 #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_MASTER_FUNC UINT32_C(0x1)
8284 /*
8285 * If set to 1, error recovery is enabled.
8286 * If set to 0, error recovery is disabled.
8287 */
8288 #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_RECOVERY_ENABLED UINT32_C(0x2)
8289 } hwrm_async_event_cmpl_error_recovery_t, *phwrm_async_event_cmpl_error_recovery_t;
8290
8291 /* hwrm_async_event_cmpl_ring_monitor_msg (size:128b/16B) */
8292
8293 typedef struct hwrm_async_event_cmpl_ring_monitor_msg {
8294 uint16_t type;
8295 /*
8296 * This field indicates the exact type of the completion.
8297 * By convention, the LSB identifies the length of the
8298 * record in 16B units. Even values indicate 16B
8299 * records. Odd values indicate 32B
8300 * records.
8301 */
8302 #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_TYPE_MASK UINT32_C(0x3f)
8303 #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_TYPE_SFT 0
8304 /* HWRM Asynchronous Event Information */
8305 #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
8306 #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_TYPE_HWRM_ASYNC_EVENT
8307 /* Identifiers of events. */
8308 uint16_t event_id;
8309 /* Ring Monitor Message. */
8310 #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_ID_RING_MONITOR_MSG UINT32_C(0xa)
8311 #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_ID_RING_MONITOR_MSG
8312 /* Event specific data */
8313 uint32_t event_data2;
8314 /* Type of Ring disabled. */
8315 #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_MASK UINT32_C(0xff)
8316 #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_SFT 0
8317 /* tx ring disabled. */
8318 #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_TX UINT32_C(0x0)
8319 /* rx ring disabled. */
8320 #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_RX UINT32_C(0x1)
8321 /* cmpl ring disabled. */
8322 #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_CMPL UINT32_C(0x2)
8323 #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_CMPL
8324 uint8_t opaque_v;
8325 /*
8326 * This value is written by the NIC such that it will be different
8327 * for each pass through the completion queue. The even passes
8328 * will write 1. The odd passes will write 0.
8329 */
8330 #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_V UINT32_C(0x1)
8331 /* opaque is 7 b */
8332 #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_OPAQUE_MASK UINT32_C(0xfe)
8333 #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_OPAQUE_SFT 1
8334 /* 8-lsb timestamp from POR (100-msec resolution) */
8335 uint8_t timestamp_lo;
8336 /* 16-lsb timestamp from POR (100-msec resolution) */
8337 uint16_t timestamp_hi;
8338 /*
8339 * Event specific data. If ring_type_disabled indicates a tx,rx or cmpl
8340 * then this field will indicate the ring id.
8341 */
8342 uint32_t event_data1;
8343 } hwrm_async_event_cmpl_ring_monitor_msg_t, *phwrm_async_event_cmpl_ring_monitor_msg_t;
8344
8345 /* hwrm_async_event_cmpl_func_drvr_unload (size:128b/16B) */
8346
8347 typedef struct hwrm_async_event_cmpl_func_drvr_unload {
8348 uint16_t type;
8349 /*
8350 * This field indicates the exact type of the completion.
8351 * By convention, the LSB identifies the length of the
8352 * record in 16B units. Even values indicate 16B
8353 * records. Odd values indicate 32B
8354 * records.
8355 */
8356 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_MASK UINT32_C(0x3f)
8357 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_SFT 0
8358 /* HWRM Asynchronous Event Information */
8359 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
8360 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT
8361 /* Identifiers of events. */
8362 uint16_t event_id;
8363 /* Function driver unloaded */
8364 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_FUNC_DRVR_UNLOAD UINT32_C(0x10)
8365 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_FUNC_DRVR_UNLOAD
8366 /* Event specific data */
8367 uint32_t event_data2;
8368 uint8_t opaque_v;
8369 /*
8370 * This value is written by the NIC such that it will be different
8371 * for each pass through the completion queue. The even passes
8372 * will write 1. The odd passes will write 0.
8373 */
8374 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_V UINT32_C(0x1)
8375 /* opaque is 7 b */
8376 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_OPAQUE_MASK UINT32_C(0xfe)
8377 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_OPAQUE_SFT 1
8378 /* 8-lsb timestamp from POR (100-msec resolution) */
8379 uint8_t timestamp_lo;
8380 /* 16-lsb timestamp from POR (100-msec resolution) */
8381 uint16_t timestamp_hi;
8382 /* Event specific data */
8383 uint32_t event_data1;
8384 /* Function ID */
8385 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_MASK UINT32_C(0xffff)
8386 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_SFT 0
8387 } hwrm_async_event_cmpl_func_drvr_unload_t, *phwrm_async_event_cmpl_func_drvr_unload_t;
8388
8389 /* hwrm_async_event_cmpl_func_drvr_load (size:128b/16B) */
8390
8391 typedef struct hwrm_async_event_cmpl_func_drvr_load {
8392 uint16_t type;
8393 /*
8394 * This field indicates the exact type of the completion.
8395 * By convention, the LSB identifies the length of the
8396 * record in 16B units. Even values indicate 16B
8397 * records. Odd values indicate 32B
8398 * records.
8399 */
8400 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_MASK UINT32_C(0x3f)
8401 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_SFT 0
8402 /* HWRM Asynchronous Event Information */
8403 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
8404 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT
8405 /* Identifiers of events. */
8406 uint16_t event_id;
8407 /* Function driver loaded */
8408 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_FUNC_DRVR_LOAD UINT32_C(0x11)
8409 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_FUNC_DRVR_LOAD
8410 /* Event specific data */
8411 uint32_t event_data2;
8412 uint8_t opaque_v;
8413 /*
8414 * This value is written by the NIC such that it will be different
8415 * for each pass through the completion queue. The even passes
8416 * will write 1. The odd passes will write 0.
8417 */
8418 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_V UINT32_C(0x1)
8419 /* opaque is 7 b */
8420 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_OPAQUE_MASK UINT32_C(0xfe)
8421 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_OPAQUE_SFT 1
8422 /* 8-lsb timestamp from POR (100-msec resolution) */
8423 uint8_t timestamp_lo;
8424 /* 16-lsb timestamp from POR (100-msec resolution) */
8425 uint16_t timestamp_hi;
8426 /* Event specific data */
8427 uint32_t event_data1;
8428 /* Function ID */
8429 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_MASK UINT32_C(0xffff)
8430 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_SFT 0
8431 } hwrm_async_event_cmpl_func_drvr_load_t, *phwrm_async_event_cmpl_func_drvr_load_t;
8432
8433 /* hwrm_async_event_cmpl_func_flr_proc_cmplt (size:128b/16B) */
8434
8435 typedef struct hwrm_async_event_cmpl_func_flr_proc_cmplt {
8436 uint16_t type;
8437 /*
8438 * This field indicates the exact type of the completion.
8439 * By convention, the LSB identifies the length of the
8440 * record in 16B units. Even values indicate 16B
8441 * records. Odd values indicate 32B
8442 * records.
8443 */
8444 #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_MASK UINT32_C(0x3f)
8445 #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_SFT 0
8446 /* HWRM Asynchronous Event Information */
8447 #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
8448 #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_HWRM_ASYNC_EVENT
8449 /* Identifiers of events. */
8450 uint16_t event_id;
8451 /* Function FLR related processing has completed */
8452 #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_FUNC_FLR_PROC_CMPLT UINT32_C(0x12)
8453 #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_FUNC_FLR_PROC_CMPLT
8454 /* Event specific data */
8455 uint32_t event_data2;
8456 uint8_t opaque_v;
8457 /*
8458 * This value is written by the NIC such that it will be different
8459 * for each pass through the completion queue. The even passes
8460 * will write 1. The odd passes will write 0.
8461 */
8462 #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_V UINT32_C(0x1)
8463 /* opaque is 7 b */
8464 #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_OPAQUE_MASK UINT32_C(0xfe)
8465 #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_OPAQUE_SFT 1
8466 /* 8-lsb timestamp from POR (100-msec resolution) */
8467 uint8_t timestamp_lo;
8468 /* 16-lsb timestamp from POR (100-msec resolution) */
8469 uint16_t timestamp_hi;
8470 /* Event specific data */
8471 uint32_t event_data1;
8472 /* Function ID */
8473 #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_DATA1_FUNC_ID_MASK UINT32_C(0xffff)
8474 #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_DATA1_FUNC_ID_SFT 0
8475 } hwrm_async_event_cmpl_func_flr_proc_cmplt_t, *phwrm_async_event_cmpl_func_flr_proc_cmplt_t;
8476
8477 /* hwrm_async_event_cmpl_pf_drvr_unload (size:128b/16B) */
8478
8479 typedef struct hwrm_async_event_cmpl_pf_drvr_unload {
8480 uint16_t type;
8481 /*
8482 * This field indicates the exact type of the completion.
8483 * By convention, the LSB identifies the length of the
8484 * record in 16B units. Even values indicate 16B
8485 * records. Odd values indicate 32B
8486 * records.
8487 */
8488 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_MASK UINT32_C(0x3f)
8489 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_SFT 0
8490 /* HWRM Asynchronous Event Information */
8491 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
8492 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT
8493 /* Identifiers of events. */
8494 uint16_t event_id;
8495 /* PF driver unloaded */
8496 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_PF_DRVR_UNLOAD UINT32_C(0x20)
8497 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_PF_DRVR_UNLOAD
8498 /* Event specific data */
8499 uint32_t event_data2;
8500 uint8_t opaque_v;
8501 /*
8502 * This value is written by the NIC such that it will be different
8503 * for each pass through the completion queue. The even passes
8504 * will write 1. The odd passes will write 0.
8505 */
8506 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_V UINT32_C(0x1)
8507 /* opaque is 7 b */
8508 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_OPAQUE_MASK UINT32_C(0xfe)
8509 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_OPAQUE_SFT 1
8510 /* 8-lsb timestamp from POR (100-msec resolution) */
8511 uint8_t timestamp_lo;
8512 /* 16-lsb timestamp from POR (100-msec resolution) */
8513 uint16_t timestamp_hi;
8514 /* Event specific data */
8515 uint32_t event_data1;
8516 /* PF ID */
8517 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_MASK UINT32_C(0xffff)
8518 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_SFT 0
8519 /* Indicates the physical port this pf belongs to */
8520 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_MASK UINT32_C(0x70000)
8521 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_SFT 16
8522 } hwrm_async_event_cmpl_pf_drvr_unload_t, *phwrm_async_event_cmpl_pf_drvr_unload_t;
8523
8524 /* hwrm_async_event_cmpl_pf_drvr_load (size:128b/16B) */
8525
8526 typedef struct hwrm_async_event_cmpl_pf_drvr_load {
8527 uint16_t type;
8528 /*
8529 * This field indicates the exact type of the completion.
8530 * By convention, the LSB identifies the length of the
8531 * record in 16B units. Even values indicate 16B
8532 * records. Odd values indicate 32B
8533 * records.
8534 */
8535 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_MASK UINT32_C(0x3f)
8536 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_SFT 0
8537 /* HWRM Asynchronous Event Information */
8538 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
8539 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT
8540 /* Identifiers of events. */
8541 uint16_t event_id;
8542 /* PF driver loaded */
8543 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_PF_DRVR_LOAD UINT32_C(0x21)
8544 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_PF_DRVR_LOAD
8545 /* Event specific data */
8546 uint32_t event_data2;
8547 uint8_t opaque_v;
8548 /*
8549 * This value is written by the NIC such that it will be different
8550 * for each pass through the completion queue. The even passes
8551 * will write 1. The odd passes will write 0.
8552 */
8553 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_V UINT32_C(0x1)
8554 /* opaque is 7 b */
8555 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_OPAQUE_MASK UINT32_C(0xfe)
8556 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_OPAQUE_SFT 1
8557 /* 8-lsb timestamp from POR (100-msec resolution) */
8558 uint8_t timestamp_lo;
8559 /* 16-lsb timestamp from POR (100-msec resolution) */
8560 uint16_t timestamp_hi;
8561 /* Event specific data */
8562 uint32_t event_data1;
8563 /* PF ID */
8564 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_FUNC_ID_MASK UINT32_C(0xffff)
8565 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_FUNC_ID_SFT 0
8566 /* Indicates the physical port this pf belongs to */
8567 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_MASK UINT32_C(0x70000)
8568 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_SFT 16
8569 } hwrm_async_event_cmpl_pf_drvr_load_t, *phwrm_async_event_cmpl_pf_drvr_load_t;
8570
8571 /* hwrm_async_event_cmpl_vf_flr (size:128b/16B) */
8572
8573 typedef struct hwrm_async_event_cmpl_vf_flr {
8574 uint16_t type;
8575 /*
8576 * This field indicates the exact type of the completion.
8577 * By convention, the LSB identifies the length of the
8578 * record in 16B units. Even values indicate 16B
8579 * records. Odd values indicate 32B
8580 * records.
8581 */
8582 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_MASK UINT32_C(0x3f)
8583 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_SFT 0
8584 /* HWRM Asynchronous Event Information */
8585 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
8586 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_HWRM_ASYNC_EVENT
8587 /* Identifiers of events. */
8588 uint16_t event_id;
8589 /* VF Function Level Reset (FLR) */
8590 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_VF_FLR UINT32_C(0x30)
8591 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_VF_FLR
8592 /* Event specific data */
8593 uint32_t event_data2;
8594 uint8_t opaque_v;
8595 /*
8596 * This value is written by the NIC such that it will be different
8597 * for each pass through the completion queue. The even passes
8598 * will write 1. The odd passes will write 0.
8599 */
8600 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_V UINT32_C(0x1)
8601 /* opaque is 7 b */
8602 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_OPAQUE_MASK UINT32_C(0xfe)
8603 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_OPAQUE_SFT 1
8604 /* 8-lsb timestamp from POR (100-msec resolution) */
8605 uint8_t timestamp_lo;
8606 /* 16-lsb timestamp from POR (100-msec resolution) */
8607 uint16_t timestamp_hi;
8608 /* Event specific data */
8609 uint32_t event_data1;
8610 /* VF ID */
8611 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_MASK UINT32_C(0xffff)
8612 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_SFT 0
8613 /* Indicates the physical function this event occurred on. */
8614 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_PF_ID_MASK UINT32_C(0xff0000)
8615 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_PF_ID_SFT 16
8616 } hwrm_async_event_cmpl_vf_flr_t, *phwrm_async_event_cmpl_vf_flr_t;
8617
8618 /* hwrm_async_event_cmpl_vf_mac_addr_change (size:128b/16B) */
8619
8620 typedef struct hwrm_async_event_cmpl_vf_mac_addr_change {
8621 uint16_t type;
8622 /*
8623 * This field indicates the exact type of the completion.
8624 * By convention, the LSB identifies the length of the
8625 * record in 16B units. Even values indicate 16B
8626 * records. Odd values indicate 32B
8627 * records.
8628 */
8629 #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_MASK UINT32_C(0x3f)
8630 #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_SFT 0
8631 /* HWRM Asynchronous Event Information */
8632 #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
8633 #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_HWRM_ASYNC_EVENT
8634 /* Identifiers of events. */
8635 uint16_t event_id;
8636 /* VF MAC Address Change */
8637 #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_VF_MAC_ADDR_CHANGE UINT32_C(0x31)
8638 #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_VF_MAC_ADDR_CHANGE
8639 /* Event specific data */
8640 uint32_t event_data2;
8641 uint8_t opaque_v;
8642 /*
8643 * This value is written by the NIC such that it will be different
8644 * for each pass through the completion queue. The even passes
8645 * will write 1. The odd passes will write 0.
8646 */
8647 #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_V UINT32_C(0x1)
8648 /* opaque is 7 b */
8649 #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
8650 #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_OPAQUE_SFT 1
8651 /* 8-lsb timestamp from POR (100-msec resolution) */
8652 uint8_t timestamp_lo;
8653 /* 16-lsb timestamp from POR (100-msec resolution) */
8654 uint16_t timestamp_hi;
8655 /* Event specific data */
8656 uint32_t event_data1;
8657 /* VF ID */
8658 #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_DATA1_VF_ID_MASK UINT32_C(0xffff)
8659 #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_DATA1_VF_ID_SFT 0
8660 } hwrm_async_event_cmpl_vf_mac_addr_change_t, *phwrm_async_event_cmpl_vf_mac_addr_change_t;
8661
8662 /* hwrm_async_event_cmpl_pf_vf_comm_status_change (size:128b/16B) */
8663
8664 typedef struct hwrm_async_event_cmpl_pf_vf_comm_status_change {
8665 uint16_t type;
8666 /*
8667 * This field indicates the exact type of the completion.
8668 * By convention, the LSB identifies the length of the
8669 * record in 16B units. Even values indicate 16B
8670 * records. Odd values indicate 32B
8671 * records.
8672 */
8673 #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_MASK UINT32_C(0x3f)
8674 #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_SFT 0
8675 /* HWRM Asynchronous Event Information */
8676 #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
8677 #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT
8678 /* Identifiers of events. */
8679 uint16_t event_id;
8680 /* PF-VF communication channel status change. */
8681 #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_PF_VF_COMM_STATUS_CHANGE UINT32_C(0x32)
8682 #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_PF_VF_COMM_STATUS_CHANGE
8683 /* Event specific data */
8684 uint32_t event_data2;
8685 uint8_t opaque_v;
8686 /*
8687 * This value is written by the NIC such that it will be different
8688 * for each pass through the completion queue. The even passes
8689 * will write 1. The odd passes will write 0.
8690 */
8691 #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_V UINT32_C(0x1)
8692 /* opaque is 7 b */
8693 #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
8694 #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_OPAQUE_SFT 1
8695 /* 8-lsb timestamp from POR (100-msec resolution) */
8696 uint8_t timestamp_lo;
8697 /* 16-lsb timestamp from POR (100-msec resolution) */
8698 uint16_t timestamp_hi;
8699 /* Event specific data */
8700 uint32_t event_data1;
8701 /*
8702 * If this bit is set to 1, then it indicates that the PF-VF
8703 * communication was lost and it is established.
8704 * If this bit set to 0, then it indicates that the PF-VF
8705 * communication was established and it is lost.
8706 */
8707 #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_DATA1_COMM_ESTABLISHED UINT32_C(0x1)
8708 } hwrm_async_event_cmpl_pf_vf_comm_status_change_t, *phwrm_async_event_cmpl_pf_vf_comm_status_change_t;
8709
8710 /* hwrm_async_event_cmpl_vf_cfg_change (size:128b/16B) */
8711
8712 typedef struct hwrm_async_event_cmpl_vf_cfg_change {
8713 uint16_t type;
8714 /*
8715 * This field indicates the exact type of the completion.
8716 * By convention, the LSB identifies the length of the
8717 * record in 16B units. Even values indicate 16B
8718 * records. Odd values indicate 32B
8719 * records.
8720 */
8721 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_MASK UINT32_C(0x3f)
8722 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_SFT 0
8723 /* HWRM Asynchronous Event Information */
8724 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
8725 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
8726 /* Identifiers of events. */
8727 uint16_t event_id;
8728 /* VF Configuration Change */
8729 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_VF_CFG_CHANGE UINT32_C(0x33)
8730 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_VF_CFG_CHANGE
8731 /* Event specific data */
8732 uint32_t event_data2;
8733 /*
8734 * This value indicates the VF ID of the VF whose configuration
8735 * is changing if this async. event is sent to the parent PF.
8736 * The firmware supports sending this to the parent PF if the
8737 * `hwrm_func_qcaps.vf_cfg_async_for_pf_supported` value is 1.
8738 * This value is undefined when the async. event is sent to the
8739 * VF.
8740 */
8741 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA2_VF_ID_MASK UINT32_C(0xffff)
8742 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA2_VF_ID_SFT 0
8743 uint8_t opaque_v;
8744 /*
8745 * This value is written by the NIC such that it will be different
8746 * for each pass through the completion queue. The even passes
8747 * will write 1. The odd passes will write 0.
8748 */
8749 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_V UINT32_C(0x1)
8750 /* opaque is 7 b */
8751 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
8752 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_OPAQUE_SFT 1
8753 /* 8-lsb timestamp from POR (100-msec resolution) */
8754 uint8_t timestamp_lo;
8755 /* 16-lsb timestamp from POR (100-msec resolution) */
8756 uint16_t timestamp_hi;
8757 /*
8758 * Each flag provided in this field indicates a specific VF
8759 * configuration change. At least one of these flags shall be set to 1
8760 * when an asynchronous event completion of this type is provided
8761 * by the HWRM.
8762 */
8763 uint32_t event_data1;
8764 /*
8765 * If this bit is set to 1, then the value of MTU
8766 * was changed on this VF.
8767 * If set to 0, then this bit should be ignored.
8768 */
8769 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_MTU_CHANGE UINT32_C(0x1)
8770 /*
8771 * If this bit is set to 1, then the value of MRU
8772 * was changed on this VF.
8773 * If set to 0, then this bit should be ignored.
8774 */
8775 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_MRU_CHANGE UINT32_C(0x2)
8776 /*
8777 * If this bit is set to 1, then the value of default MAC
8778 * address was changed on this VF.
8779 * If set to 0, then this bit should be ignored.
8780 */
8781 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_DFLT_MAC_ADDR_CHANGE UINT32_C(0x4)
8782 /*
8783 * If this bit is set to 1, then the value of default VLAN
8784 * was changed on this VF.
8785 * If set to 0, then this bit should be ignored.
8786 */
8787 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_DFLT_VLAN_CHANGE UINT32_C(0x8)
8788 /*
8789 * If this bit is set to 1, then the value of trusted VF enable
8790 * was changed on this VF.
8791 * If set to 0, then this bit should be ignored.
8792 */
8793 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_TRUSTED_VF_CFG_CHANGE UINT32_C(0x10)
8794 } hwrm_async_event_cmpl_vf_cfg_change_t, *phwrm_async_event_cmpl_vf_cfg_change_t;
8795
8796 /* hwrm_async_event_cmpl_llfc_pfc_change (size:128b/16B) */
8797
8798 typedef struct hwrm_async_event_cmpl_llfc_pfc_change {
8799 uint16_t type;
8800 /*
8801 * This field indicates the exact type of the completion.
8802 * By convention, the LSB identifies the length of the
8803 * record in 16B units. Even values indicate 16B
8804 * records. Odd values indicate 32B
8805 * records.
8806 */
8807 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_MASK UINT32_C(0x3f)
8808 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_SFT 0
8809 /* HWRM Asynchronous Event Information */
8810 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
8811 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_HWRM_ASYNC_EVENT
8812 /* unused1 is 10 b */
8813 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_UNUSED1_MASK UINT32_C(0xffc0)
8814 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_UNUSED1_SFT 6
8815 /* Identifiers of events. */
8816 uint16_t event_id;
8817 /* LLFC/PFC Configuration Change */
8818 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LLFC_PFC_CHANGE UINT32_C(0x34)
8819 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LLFC_PFC_CHANGE
8820 /* Event specific data */
8821 uint32_t event_data2;
8822 uint8_t opaque_v;
8823 /*
8824 * This value is written by the NIC such that it will be different
8825 * for each pass through the completion queue. The even passes
8826 * will write 1. The odd passes will write 0.
8827 */
8828 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_V UINT32_C(0x1)
8829 /* opaque is 7 b */
8830 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
8831 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_OPAQUE_SFT 1
8832 /* 8-lsb timestamp from POR (100-msec resolution) */
8833 uint8_t timestamp_lo;
8834 /* 16-lsb timestamp from POR (100-msec resolution) */
8835 uint16_t timestamp_hi;
8836 /* Event specific data */
8837 uint32_t event_data1;
8838 /* Indicates llfc pfc status change */
8839 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_MASK UINT32_C(0x3)
8840 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_SFT 0
8841 /*
8842 * If this field set to 1, then it indicates that llfc is
8843 * enabled.
8844 */
8845 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_LLFC UINT32_C(0x1)
8846 /*
8847 * If this field is set to 2, then it indicates that pfc
8848 * is enabled.
8849 */
8850 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_PFC UINT32_C(0x2)
8851 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_LAST HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_PFC
8852 /* Indicates the physical port this llfc pfc change occur */
8853 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_MASK UINT32_C(0x1c)
8854 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_SFT 2
8855 /* PORT ID */
8856 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_ID_MASK UINT32_C(0x1fffe0)
8857 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_ID_SFT 5
8858 } hwrm_async_event_cmpl_llfc_pfc_change_t, *phwrm_async_event_cmpl_llfc_pfc_change_t;
8859
8860 /* hwrm_async_event_cmpl_default_vnic_change (size:128b/16B) */
8861
8862 typedef struct hwrm_async_event_cmpl_default_vnic_change {
8863 uint16_t type;
8864 /*
8865 * This field indicates the exact type of the completion.
8866 * By convention, the LSB identifies the length of the
8867 * record in 16B units. Even values indicate 16B
8868 * records. Odd values indicate 32B
8869 * records.
8870 */
8871 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_MASK UINT32_C(0x3f)
8872 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_SFT 0
8873 /* HWRM Asynchronous Event Information */
8874 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
8875 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_HWRM_ASYNC_EVENT
8876 /* unused1 is 10 b */
8877 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_UNUSED1_MASK UINT32_C(0xffc0)
8878 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_UNUSED1_SFT 6
8879 /* Identifiers of events. */
8880 uint16_t event_id;
8881 /* Notification of a default vnic allocation or free */
8882 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_ALLOC_FREE_NOTIFICATION UINT32_C(0x35)
8883 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_ALLOC_FREE_NOTIFICATION
8884 /* Event specific data */
8885 uint32_t event_data2;
8886 uint8_t opaque_v;
8887 /*
8888 * This value is written by the NIC such that it will be different
8889 * for each pass through the completion queue. The even passes
8890 * will write 1. The odd passes will write 0.
8891 */
8892 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_V UINT32_C(0x1)
8893 /* opaque is 7 b */
8894 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
8895 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_OPAQUE_SFT 1
8896 /* 8-lsb timestamp from POR (100-msec resolution) */
8897 uint8_t timestamp_lo;
8898 /* 16-lsb timestamp from POR (100-msec resolution) */
8899 uint16_t timestamp_hi;
8900 /* Event specific data */
8901 uint32_t event_data1;
8902 /* Indicates default vnic configuration change */
8903 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_MASK UINT32_C(0x3)
8904 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_SFT 0
8905 /*
8906 * If this field is set to 1, then it indicates that
8907 * a default VNIC has been allocate.
8908 */
8909 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_ALLOC UINT32_C(0x1)
8910 /*
8911 * If this field is set to 2, then it indicates that
8912 * a default VNIC has been freed.
8913 */
8914 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_FREE UINT32_C(0x2)
8915 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_LAST HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_FREE
8916 /* Indicates the physical function this event occurred on. */
8917 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_PF_ID_MASK UINT32_C(0x3fc)
8918 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_PF_ID_SFT 2
8919 /* Indicates the virtual function this event occurred on */
8920 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_VF_ID_MASK UINT32_C(0x3fffc00)
8921 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_VF_ID_SFT 10
8922 } hwrm_async_event_cmpl_default_vnic_change_t, *phwrm_async_event_cmpl_default_vnic_change_t;
8923
8924 /* hwrm_async_event_cmpl_hw_flow_aged (size:128b/16B) */
8925
8926 typedef struct hwrm_async_event_cmpl_hw_flow_aged {
8927 uint16_t type;
8928 /*
8929 * This field indicates the exact type of the completion.
8930 * By convention, the LSB identifies the length of the
8931 * record in 16B units. Even values indicate 16B
8932 * records. Odd values indicate 32B
8933 * records.
8934 */
8935 #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_MASK UINT32_C(0x3f)
8936 #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_SFT 0
8937 /* HWRM Asynchronous Event Information */
8938 #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
8939 #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_HWRM_ASYNC_EVENT
8940 /* Identifiers of events. */
8941 uint16_t event_id;
8942 /* Notification of a hw flow aged */
8943 #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_ID_HW_FLOW_AGED UINT32_C(0x36)
8944 #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_ID_HW_FLOW_AGED
8945 /* Event specific data */
8946 uint32_t event_data2;
8947 uint8_t opaque_v;
8948 /*
8949 * This value is written by the NIC such that it will be different
8950 * for each pass through the completion queue. The even passes
8951 * will write 1. The odd passes will write 0.
8952 */
8953 #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_V UINT32_C(0x1)
8954 /* opaque is 7 b */
8955 #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_OPAQUE_MASK UINT32_C(0xfe)
8956 #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_OPAQUE_SFT 1
8957 /* 8-lsb timestamp from POR (100-msec resolution) */
8958 uint8_t timestamp_lo;
8959 /* 16-lsb timestamp from POR (100-msec resolution) */
8960 uint16_t timestamp_hi;
8961 /* Event specific data */
8962 uint32_t event_data1;
8963 /* Indicates flow ID this event occurred on. */
8964 #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_ID_MASK UINT32_C(0x7fffffff)
8965 #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_ID_SFT 0
8966 /* Indicates flow direction this event occurred on. */
8967 #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION UINT32_C(0x80000000)
8968 /*
8969 * If this bit set to 0, then it indicates that the aged
8970 * event was rx flow.
8971 */
8972 #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_RX (UINT32_C(0x0) << 31)
8973 /*
8974 * If this bit is set to 1, then it indicates that the aged
8975 * event was tx flow.
8976 */
8977 #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_TX (UINT32_C(0x1) << 31)
8978 #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_LAST HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_TX
8979 } hwrm_async_event_cmpl_hw_flow_aged_t, *phwrm_async_event_cmpl_hw_flow_aged_t;
8980
8981 /* hwrm_async_event_cmpl_eem_cache_flush_req (size:128b/16B) */
8982
8983 typedef struct hwrm_async_event_cmpl_eem_cache_flush_req {
8984 uint16_t type;
8985 /*
8986 * This field indicates the exact type of the completion.
8987 * By convention, the LSB identifies the length of the
8988 * record in 16B units. Even values indicate 16B
8989 * records. Odd values indicate 32B
8990 * records.
8991 */
8992 #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_MASK UINT32_C(0x3f)
8993 #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_SFT 0
8994 /* HWRM Asynchronous Event Information */
8995 #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
8996 #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_HWRM_ASYNC_EVENT
8997 /* Identifiers of events. */
8998 uint16_t event_id;
8999 /* Notification of a eem_cache_flush request */
9000 #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_EVENT_ID_EEM_CACHE_FLUSH_REQ UINT32_C(0x38)
9001 #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_EVENT_ID_EEM_CACHE_FLUSH_REQ
9002 /* Event specific data */
9003 uint32_t event_data2;
9004 uint8_t opaque_v;
9005 /*
9006 * This value is written by the NIC such that it will be different
9007 * for each pass through the completion queue. The even passes
9008 * will write 1. The odd passes will write 0.
9009 */
9010 #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_V UINT32_C(0x1)
9011 /* opaque is 7 b */
9012 #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_OPAQUE_MASK UINT32_C(0xfe)
9013 #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_OPAQUE_SFT 1
9014 /* 8-lsb timestamp from POR (100-msec resolution) */
9015 uint8_t timestamp_lo;
9016 /* 16-lsb timestamp from POR (100-msec resolution) */
9017 uint16_t timestamp_hi;
9018 /* Event specific data */
9019 uint32_t event_data1;
9020 } hwrm_async_event_cmpl_eem_cache_flush_req_t, *phwrm_async_event_cmpl_eem_cache_flush_req_t;
9021
9022 /* hwrm_async_event_cmpl_eem_cache_flush_done (size:128b/16B) */
9023
9024 typedef struct hwrm_async_event_cmpl_eem_cache_flush_done {
9025 uint16_t type;
9026 /*
9027 * This field indicates the exact type of the completion.
9028 * By convention, the LSB identifies the length of the
9029 * record in 16B units. Even values indicate 16B
9030 * records. Odd values indicate 32B
9031 * records.
9032 */
9033 #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_MASK UINT32_C(0x3f)
9034 #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_SFT 0
9035 /* HWRM Asynchronous Event Information */
9036 #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
9037 #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_HWRM_ASYNC_EVENT
9038 /* Identifiers of events. */
9039 uint16_t event_id;
9040 /*
9041 * Notification of a host eem_cache_flush has completed. This event
9042 * is generated by the host driver.
9043 */
9044 #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_ID_EEM_CACHE_FLUSH_DONE UINT32_C(0x39)
9045 #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_ID_EEM_CACHE_FLUSH_DONE
9046 /* Event specific data */
9047 uint32_t event_data2;
9048 uint8_t opaque_v;
9049 /*
9050 * This value is written by the NIC such that it will be different
9051 * for each pass through the completion queue. The even passes
9052 * will write 1. The odd passes will write 0.
9053 */
9054 #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_V UINT32_C(0x1)
9055 /* opaque is 7 b */
9056 #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_OPAQUE_MASK UINT32_C(0xfe)
9057 #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_OPAQUE_SFT 1
9058 /* 8-lsb timestamp from POR (100-msec resolution) */
9059 uint8_t timestamp_lo;
9060 /* 16-lsb timestamp from POR (100-msec resolution) */
9061 uint16_t timestamp_hi;
9062 /* Event specific data */
9063 uint32_t event_data1;
9064 /* Indicates function ID that this event occurred on. */
9065 #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_DATA1_FID_MASK UINT32_C(0xffff)
9066 #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_DATA1_FID_SFT 0
9067 } hwrm_async_event_cmpl_eem_cache_flush_done_t, *phwrm_async_event_cmpl_eem_cache_flush_done_t;
9068
9069 /* hwrm_async_event_cmpl_tcp_flag_action_change (size:128b/16B) */
9070
9071 typedef struct hwrm_async_event_cmpl_tcp_flag_action_change {
9072 uint16_t type;
9073 /*
9074 * This field indicates the exact type of the completion.
9075 * By convention, the LSB identifies the length of the
9076 * record in 16B units. Even values indicate 16B
9077 * records. Odd values indicate 32B
9078 * records.
9079 */
9080 #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_MASK UINT32_C(0x3f)
9081 #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_SFT 0
9082 /* HWRM Asynchronous Event Information */
9083 #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
9084 #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_HWRM_ASYNC_EVENT
9085 /* Identifiers of events. */
9086 uint16_t event_id;
9087 /* Notification of tcp flag action change */
9088 #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_EVENT_ID_TCP_FLAG_ACTION_CHANGE UINT32_C(0x3a)
9089 #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_EVENT_ID_TCP_FLAG_ACTION_CHANGE
9090 /* Event specific data */
9091 uint32_t event_data2;
9092 uint8_t opaque_v;
9093 /*
9094 * This value is written by the NIC such that it will be different
9095 * for each pass through the completion queue. The even passes
9096 * will write 1. The odd passes will write 0.
9097 */
9098 #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_V UINT32_C(0x1)
9099 /* opaque is 7 b */
9100 #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
9101 #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_OPAQUE_SFT 1
9102 /* 8-lsb timestamp from POR (100-msec resolution) */
9103 uint8_t timestamp_lo;
9104 /* 16-lsb timestamp from POR (100-msec resolution) */
9105 uint16_t timestamp_hi;
9106 /* Event specific data */
9107 uint32_t event_data1;
9108 } hwrm_async_event_cmpl_tcp_flag_action_change_t, *phwrm_async_event_cmpl_tcp_flag_action_change_t;
9109
9110 /* hwrm_async_event_cmpl_eem_flow_active (size:128b/16B) */
9111
9112 typedef struct hwrm_async_event_cmpl_eem_flow_active {
9113 uint16_t type;
9114 /*
9115 * This field indicates the exact type of the completion.
9116 * By convention, the LSB identifies the length of the
9117 * record in 16B units. Even values indicate 16B
9118 * records. Odd values indicate 32B
9119 * records.
9120 */
9121 #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_MASK UINT32_C(0x3f)
9122 #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_SFT 0
9123 /* HWRM Asynchronous Event Information */
9124 #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
9125 #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_HWRM_ASYNC_EVENT
9126 /* Identifiers of events. */
9127 uint16_t event_id;
9128 /* Notification of an active eem flow */
9129 #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_ID_EEM_FLOW_ACTIVE UINT32_C(0x3b)
9130 #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_ID_EEM_FLOW_ACTIVE
9131 /* Event specific data */
9132 uint32_t event_data2;
9133 /* Indicates the 2nd global id this event occurred on. */
9134 #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_GLOBAL_ID_2_MASK UINT32_C(0x3fffffff)
9135 #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_GLOBAL_ID_2_SFT 0
9136 /*
9137 * Indicates flow direction of the flow identified by
9138 * the global_id_2.
9139 */
9140 #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION UINT32_C(0x40000000)
9141 /* If this bit is set to 0, then it indicates that this rx flow. */
9142 #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_RX (UINT32_C(0x0) << 30)
9143 /* If this bit is set to 1, then it indicates that this tx flow. */
9144 #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_TX (UINT32_C(0x1) << 30)
9145 #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_LAST HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_TX
9146 uint8_t opaque_v;
9147 /*
9148 * This value is written by the NIC such that it will be different
9149 * for each pass through the completion queue. The even passes
9150 * will write 1. The odd passes will write 0.
9151 */
9152 #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_V UINT32_C(0x1)
9153 /* opaque is 7 b */
9154 #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_OPAQUE_MASK UINT32_C(0xfe)
9155 #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_OPAQUE_SFT 1
9156 /* 8-lsb timestamp from POR (100-msec resolution) */
9157 uint8_t timestamp_lo;
9158 /* 16-lsb timestamp from POR (100-msec resolution) */
9159 uint16_t timestamp_hi;
9160 /* Event specific data */
9161 uint32_t event_data1;
9162 /* Indicates the 1st global id this event occurred on. */
9163 #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_GLOBAL_ID_1_MASK UINT32_C(0x3fffffff)
9164 #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_GLOBAL_ID_1_SFT 0
9165 /*
9166 * Indicates flow direction of the flow identified by the
9167 * global_id_1.
9168 */
9169 #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION UINT32_C(0x40000000)
9170 /* If this bit is set to 0, then it indicates that this is rx flow. */
9171 #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_RX (UINT32_C(0x0) << 30)
9172 /* If this bit is set to 1, then it indicates that this is tx flow. */
9173 #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_TX (UINT32_C(0x1) << 30)
9174 #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_LAST HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_TX
9175 /*
9176 * Indicates EEM flow aging mode this event occurred on. If
9177 * this bit is set to 0, the event_data1 is the EEM global
9178 * ID. If this bit is set to 1, the event_data1 is the number
9179 * of global ID in the context memory.
9180 */
9181 #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE UINT32_C(0x80000000)
9182 /* EEM flow aging mode 0. */
9183 #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_0 (UINT32_C(0x0) << 31)
9184 /* EEM flow aging mode 1. */
9185 #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_1 (UINT32_C(0x1) << 31)
9186 #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_LAST HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_1
9187 } hwrm_async_event_cmpl_eem_flow_active_t, *phwrm_async_event_cmpl_eem_flow_active_t;
9188
9189 /* hwrm_async_event_cmpl_eem_cfg_change (size:128b/16B) */
9190
9191 typedef struct hwrm_async_event_cmpl_eem_cfg_change {
9192 uint16_t type;
9193 /*
9194 * This field indicates the exact type of the completion.
9195 * By convention, the LSB identifies the length of the
9196 * record in 16B units. Even values indicate 16B
9197 * records. Odd values indicate 32B
9198 * records.
9199 */
9200 #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_MASK UINT32_C(0x3f)
9201 #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_SFT 0
9202 /* HWRM Asynchronous Event Information */
9203 #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
9204 #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
9205 /* Identifiers of events. */
9206 uint16_t event_id;
9207 /* Notification of EEM configuration change */
9208 #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_ID_EEM_CFG_CHANGE UINT32_C(0x3c)
9209 #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_ID_EEM_CFG_CHANGE
9210 /* Event specific data */
9211 uint32_t event_data2;
9212 uint8_t opaque_v;
9213 /*
9214 * This value is written by the NIC such that it will be different
9215 * for each pass through the completion queue. The even passes
9216 * will write 1. The odd passes will write 0.
9217 */
9218 #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_V UINT32_C(0x1)
9219 /* opaque is 7 b */
9220 #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
9221 #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_OPAQUE_SFT 1
9222 /* 8-lsb timestamp from POR (100-msec resolution) */
9223 uint8_t timestamp_lo;
9224 /* 16-lsb timestamp from POR (100-msec resolution) */
9225 uint16_t timestamp_hi;
9226 /* Event specific data */
9227 uint32_t event_data1;
9228 /*
9229 * Value of 1 to indicate EEM TX configuration is enabled. Value of
9230 * 0 to indicate the EEM TX configuration is disabled.
9231 */
9232 #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_DATA1_EEM_TX_ENABLE UINT32_C(0x1)
9233 /*
9234 * Value of 1 to indicate EEM RX configuration is enabled. Value of 0
9235 * to indicate the EEM RX configuration is disabled.
9236 */
9237 #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_DATA1_EEM_RX_ENABLE UINT32_C(0x2)
9238 } hwrm_async_event_cmpl_eem_cfg_change_t, *phwrm_async_event_cmpl_eem_cfg_change_t;
9239
9240 /* hwrm_async_event_cmpl_quiesce_done (size:128b/16B) */
9241
9242 typedef struct hwrm_async_event_cmpl_quiesce_done {
9243 uint16_t type;
9244 /*
9245 * This field indicates the exact type of the completion.
9246 * By convention, the LSB identifies the length of the
9247 * record in 16B units. Even values indicate 16B
9248 * records. Odd values indicate 32B
9249 * records.
9250 */
9251 #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_MASK UINT32_C(0x3f)
9252 #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_SFT 0
9253 /* HWRM Asynchronous Event Information */
9254 #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
9255 #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_HWRM_ASYNC_EVENT
9256 /* Identifiers of events. */
9257 uint16_t event_id;
9258 /* An event signifying completion of HWRM_FW_STATE_QUIESCE */
9259 #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_ID_QUIESCE_DONE UINT32_C(0x3f)
9260 #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_ID_QUIESCE_DONE
9261 /* Event specific data */
9262 uint32_t event_data2;
9263 /* Status of HWRM_FW_STATE_QUIESCE completion */
9264 #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_MASK UINT32_C(0xff)
9265 #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_SFT 0
9266 /*
9267 * The quiesce operation started by HWRM_FW_STATE_QUIESCE
9268 * completed successfully.
9269 */
9270 #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_SUCCESS UINT32_C(0x0)
9271 /*
9272 * The quiesce operation started by HWRM_FW_STATE_QUIESCE timed
9273 * out.
9274 */
9275 #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_TIMEOUT UINT32_C(0x1)
9276 /*
9277 * The quiesce operation started by HWRM_FW_STATE_QUIESCE
9278 * encountered an error.
9279 */
9280 #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_ERROR UINT32_C(0x2)
9281 #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_LAST HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_ERROR
9282 /* opaque is 8 b */
9283 #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_OPAQUE_MASK UINT32_C(0xff00)
9284 #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_OPAQUE_SFT 8
9285 /*
9286 * Additional information about internal hardware state related to
9287 * idle/quiesce state. QUIESCE may succeed per quiesce_status
9288 * regardless of idle_state_flags. If QUIESCE fails, the host may
9289 * inspect idle_state_flags to determine whether a retry is warranted.
9290 */
9291 #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_MASK UINT32_C(0xff0000)
9292 #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_SFT 16
9293 /*
9294 * Failure to quiesce is caused by host not updating the NQ consumer
9295 * index.
9296 */
9297 #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_INCOMPLETE_NQ UINT32_C(0x10000)
9298 /* Flag 1 indicating partial non-idle state. */
9299 #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_IDLE_STATUS_1 UINT32_C(0x20000)
9300 /* Flag 2 indicating partial non-idle state. */
9301 #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_IDLE_STATUS_2 UINT32_C(0x40000)
9302 /* Flag 3 indicating partial non-idle state. */
9303 #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_IDLE_STATUS_3 UINT32_C(0x80000)
9304 uint8_t opaque_v;
9305 /*
9306 * This value is written by the NIC such that it will be different
9307 * for each pass through the completion queue. The even passes
9308 * will write 1. The odd passes will write 0.
9309 */
9310 #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_V UINT32_C(0x1)
9311 /* opaque is 7 b */
9312 #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_OPAQUE_MASK UINT32_C(0xfe)
9313 #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_OPAQUE_SFT 1
9314 /* 8-lsb timestamp from POR (100-msec resolution) */
9315 uint8_t timestamp_lo;
9316 /* 16-lsb timestamp from POR (100-msec resolution) */
9317 uint16_t timestamp_hi;
9318 /* Event specific data */
9319 uint32_t event_data1;
9320 /* Time stamp for error event */
9321 #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA1_TIMESTAMP UINT32_C(0x1)
9322 } hwrm_async_event_cmpl_quiesce_done_t, *phwrm_async_event_cmpl_quiesce_done_t;
9323
9324 /* hwrm_async_event_cmpl_deferred_response (size:128b/16B) */
9325
9326 typedef struct hwrm_async_event_cmpl_deferred_response {
9327 uint16_t type;
9328 /*
9329 * This field indicates the exact type of the completion.
9330 * By convention, the LSB identifies the length of the
9331 * record in 16B units. Even values indicate 16B
9332 * records. Odd values indicate 32B
9333 * records.
9334 */
9335 #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_MASK UINT32_C(0x3f)
9336 #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_SFT 0
9337 /* HWRM Asynchronous Event Information */
9338 #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
9339 #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_HWRM_ASYNC_EVENT
9340 /* Identifiers of events. */
9341 uint16_t event_id;
9342 /*
9343 * An event signifying a HWRM command is in progress and its
9344 * response will be deferred
9345 */
9346 #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_ID_DEFERRED_RESPONSE UINT32_C(0x40)
9347 #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_ID_DEFERRED_RESPONSE
9348 /* Event specific data */
9349 uint32_t event_data2;
9350 /*
9351 * The PF's mailbox is clear to issue another command.
9352 * A command with this seq_id is still in progress
9353 * and will return a regular HWRM completion when done.
9354 * 'event_data1' field, if non-zero, contains the estimated
9355 * execution time for the command.
9356 */
9357 #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_DATA2_SEQ_ID_MASK UINT32_C(0xffff)
9358 #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_DATA2_SEQ_ID_SFT 0
9359 uint8_t opaque_v;
9360 /*
9361 * This value is written by the NIC such that it will be different
9362 * for each pass through the completion queue. The even passes
9363 * will write 1. The odd passes will write 0.
9364 */
9365 #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_V UINT32_C(0x1)
9366 /* opaque is 7 b */
9367 #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_OPAQUE_MASK UINT32_C(0xfe)
9368 #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_OPAQUE_SFT 1
9369 /* 8-lsb timestamp from POR (100-msec resolution) */
9370 uint8_t timestamp_lo;
9371 /* 16-lsb timestamp from POR (100-msec resolution) */
9372 uint16_t timestamp_hi;
9373 /* Estimated remaining time of command execution in ms (if not zero) */
9374 uint32_t event_data1;
9375 } hwrm_async_event_cmpl_deferred_response_t, *phwrm_async_event_cmpl_deferred_response_t;
9376
9377 /* hwrm_async_event_cmpl_pfc_watchdog_cfg_change (size:128b/16B) */
9378
9379 typedef struct hwrm_async_event_cmpl_pfc_watchdog_cfg_change {
9380 uint16_t type;
9381 /*
9382 * This field indicates the exact type of the completion.
9383 * By convention, the LSB identifies the length of the
9384 * record in 16B units. Even values indicate 16B
9385 * records. Odd values indicate 32B
9386 * records.
9387 */
9388 #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_MASK UINT32_C(0x3f)
9389 #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_SFT 0
9390 /* HWRM Asynchronous Event Information */
9391 #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
9392 #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
9393 /* Identifiers of events. */
9394 uint16_t event_id;
9395 /* PFC watchdog configuration change for given port/cos */
9396 #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_ID_PFC_WATCHDOG_CFG_CHANGE UINT32_C(0x41)
9397 #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_ID_PFC_WATCHDOG_CFG_CHANGE
9398 /* Event specific data */
9399 uint32_t event_data2;
9400 uint8_t opaque_v;
9401 /*
9402 * This value is written by the NIC such that it will be different
9403 * for each pass through the completion queue. The even passes
9404 * will write 1. The odd passes will write 0.
9405 */
9406 #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_V UINT32_C(0x1)
9407 /* opaque is 7 b */
9408 #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
9409 #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_OPAQUE_SFT 1
9410 /* 8-lsb timestamp from POR (100-msec resolution) */
9411 uint8_t timestamp_lo;
9412 /* 16-lsb timestamp from POR (100-msec resolution) */
9413 uint16_t timestamp_hi;
9414 /* Event specific data */
9415 uint32_t event_data1;
9416 /*
9417 * 1 in bit position X indicates PFC watchdog should
9418 * be on for COSX
9419 */
9420 #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_MASK UINT32_C(0xff)
9421 #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_SFT 0
9422 /* 1 means PFC WD for COS0 is on, 0 - off. */
9423 #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS0 UINT32_C(0x1)
9424 /* 1 means PFC WD for COS1 is on, 0 - off. */
9425 #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS1 UINT32_C(0x2)
9426 /* 1 means PFC WD for COS2 is on, 0 - off. */
9427 #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS2 UINT32_C(0x4)
9428 /* 1 means PFC WD for COS3 is on, 0 - off. */
9429 #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS3 UINT32_C(0x8)
9430 /* 1 means PFC WD for COS4 is on, 0 - off. */
9431 #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS4 UINT32_C(0x10)
9432 /* 1 means PFC WD for COS5 is on, 0 - off. */
9433 #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS5 UINT32_C(0x20)
9434 /* 1 means PFC WD for COS6 is on, 0 - off. */
9435 #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS6 UINT32_C(0x40)
9436 /* 1 means PFC WD for COS7 is on, 0 - off. */
9437 #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS7 UINT32_C(0x80)
9438 /* PORT ID */
9439 #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK UINT32_C(0xffff00)
9440 #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT 8
9441 } hwrm_async_event_cmpl_pfc_watchdog_cfg_change_t, *phwrm_async_event_cmpl_pfc_watchdog_cfg_change_t;
9442
9443 /* hwrm_async_event_cmpl_echo_request (size:128b/16B) */
9444
9445 typedef struct hwrm_async_event_cmpl_echo_request {
9446 uint16_t type;
9447 /*
9448 * This field indicates the exact type of the completion.
9449 * By convention, the LSB identifies the length of the
9450 * record in 16B units. Even values indicate 16B
9451 * records. Odd values indicate 32B
9452 * records.
9453 */
9454 #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_TYPE_MASK UINT32_C(0x3f)
9455 #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_TYPE_SFT 0
9456 /* HWRM Asynchronous Event Information */
9457 #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
9458 #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_TYPE_HWRM_ASYNC_EVENT
9459 /* Identifiers of events. */
9460 uint16_t event_id;
9461 /*
9462 * An echo request from the firmware. An echo response is expected by
9463 * the firmware.
9464 */
9465 #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_EVENT_ID_ECHO_REQUEST UINT32_C(0x42)
9466 #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_EVENT_ID_ECHO_REQUEST
9467 /* Event specific data that should be provided in the echo response */
9468 uint32_t event_data2;
9469 uint8_t opaque_v;
9470 /*
9471 * This value is written by the NIC such that it will be different
9472 * for each pass through the completion queue. The even passes
9473 * will write 1. The odd passes will write 0.
9474 */
9475 #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_V UINT32_C(0x1)
9476 /* opaque is 7 b */
9477 #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_OPAQUE_MASK UINT32_C(0xfe)
9478 #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_OPAQUE_SFT 1
9479 /* 8-lsb timestamp from POR (100-msec resolution) */
9480 uint8_t timestamp_lo;
9481 /* 16-lsb timestamp from POR (100-msec resolution) */
9482 uint16_t timestamp_hi;
9483 /* Event specific data that should be provided in the echo response */
9484 uint32_t event_data1;
9485 } hwrm_async_event_cmpl_echo_request_t, *phwrm_async_event_cmpl_echo_request_t;
9486
9487 /* hwrm_async_event_cmpl_phc_master (size:128b/16B) */
9488
9489 typedef struct hwrm_async_event_cmpl_phc_master {
9490 uint16_t type;
9491 /*
9492 * This field indicates the exact type of the completion.
9493 * By convention, the LSB identifies the length of the
9494 * record in 16B units. Even values indicate 16B
9495 * records. Odd values indicate 32B
9496 * records.
9497 */
9498 #define HWRM_ASYNC_EVENT_CMPL_PHC_MASTER_TYPE_MASK UINT32_C(0x3f)
9499 #define HWRM_ASYNC_EVENT_CMPL_PHC_MASTER_TYPE_SFT 0
9500 /* HWRM Asynchronous Event Information */
9501 #define HWRM_ASYNC_EVENT_CMPL_PHC_MASTER_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
9502 #define HWRM_ASYNC_EVENT_CMPL_PHC_MASTER_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_PHC_MASTER_TYPE_HWRM_ASYNC_EVENT
9503 /* Identifiers of events. */
9504 uint16_t event_id;
9505 /*
9506 * This async event is used to notify driver of changes
9507 * in PHC master. Only one master function can configure
9508 * PHC.
9509 */
9510 #define HWRM_ASYNC_EVENT_CMPL_PHC_MASTER_EVENT_ID_PHC_MASTER UINT32_C(0x43)
9511 #define HWRM_ASYNC_EVENT_CMPL_PHC_MASTER_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_PHC_MASTER_EVENT_ID_PHC_MASTER
9512 /* Event specific data */
9513 uint32_t event_data2;
9514 uint8_t opaque_v;
9515 /*
9516 * This value is written by the NIC such that it will be different
9517 * for each pass through the completion queue. The even passes
9518 * will write 1. The odd passes will write 0.
9519 */
9520 #define HWRM_ASYNC_EVENT_CMPL_PHC_MASTER_V UINT32_C(0x1)
9521 /* opaque is 7 b */
9522 #define HWRM_ASYNC_EVENT_CMPL_PHC_MASTER_OPAQUE_MASK UINT32_C(0xfe)
9523 #define HWRM_ASYNC_EVENT_CMPL_PHC_MASTER_OPAQUE_SFT 1
9524 /* 8-lsb timestamp (100-msec resolution) */
9525 uint8_t timestamp_lo;
9526 /* 16-lsb timestamp (100-msec resolution) */
9527 uint16_t timestamp_hi;
9528 /* Event specific data */
9529 uint32_t event_data1;
9530 /* Indicates driver action requested */
9531 #define HWRM_ASYNC_EVENT_CMPL_PHC_MASTER_EVENT_DATA1_FLAGS_MASK UINT32_C(0xff)
9532 #define HWRM_ASYNC_EVENT_CMPL_PHC_MASTER_EVENT_DATA1_FLAGS_SFT 0
9533 /*
9534 * If set to 1, this function is selected as Master function.
9535 * A function is selected as PHC master if it's the first one
9536 * that tries to configure PHC.
9537 * If set to 0, this function is not the Master.
9538 * If master_selected is set to 1, driver should prevent PHC
9539 * configuration requests from being sent down. Firmware will
9540 * reject requests from this non-master.
9541 */
9542 #define HWRM_ASYNC_EVENT_CMPL_PHC_MASTER_EVENT_DATA1_FLAGS_MASTER_FUNC UINT32_C(0x1)
9543 /*
9544 * If set to 1, indicates that PHC Master has been selected.
9545 * If set to 0, indicates that PHC Master has not been selected
9546 * yet.
9547 * Since no PHC Master is selected, it indicates to driver that
9548 * any function can send down PHC configuration requests and
9549 * consequently become the PHC Master.
9550 */
9551 #define HWRM_ASYNC_EVENT_CMPL_PHC_MASTER_EVENT_DATA1_FLAGS_MASTER_SELECTED UINT32_C(0x2)
9552 } hwrm_async_event_cmpl_phc_master_t, *phwrm_async_event_cmpl_phc_master_t;
9553
9554 /* hwrm_async_event_cmpl_pps_timestamp (size:128b/16B) */
9555
9556 typedef struct hwrm_async_event_cmpl_pps_timestamp {
9557 uint16_t type;
9558 /*
9559 * This field indicates the exact type of the completion.
9560 * By convention, the LSB identifies the length of the
9561 * record in 16B units. Even values indicate 16B
9562 * records. Odd values indicate 32B
9563 * records.
9564 */
9565 #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_TYPE_MASK UINT32_C(0x3f)
9566 #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_TYPE_SFT 0
9567 /* HWRM Asynchronous Event Information */
9568 #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
9569 #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_TYPE_HWRM_ASYNC_EVENT
9570 /* Identifiers of events. */
9571 uint16_t event_id;
9572 /*
9573 * This async notification message can be used to inform
9574 * driver of the latest PPS timestamp that has been latched.
9575 * When driver enables PPS event, Firmware will generate
9576 * PPS timestamps every second, Firmware informs driver
9577 * of this timestamp through the async event.
9578 */
9579 #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_ID_PPS_TIMESTAMP UINT32_C(0x44)
9580 #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_ID_PPS_TIMESTAMP
9581 /* Event specific data */
9582 uint32_t event_data2;
9583 /* Indicates the PPS event type */
9584 #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_EVENT_TYPE UINT32_C(0x1)
9585 /* This is an internal event. */
9586 #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_EVENT_TYPE_INTERNAL UINT32_C(0x0)
9587 /* This is an external event. */
9588 #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_EVENT_TYPE_EXTERNAL UINT32_C(0x1)
9589 #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_EVENT_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_EVENT_TYPE_EXTERNAL
9590 /*
9591 * Indicates the pin number on which the event is
9592 * received.
9593 */
9594 #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_PIN_NUMBER_MASK UINT32_C(0xe)
9595 #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_PIN_NUMBER_SFT 1
9596 /*
9597 * Contains bits[47:32] of the upper PPS timestamp.
9598 * Lower 32 bits are in event_data1. Together they
9599 * provide the 48 bit PPS timestamp.
9600 */
9601 #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_PPS_TIMESTAMP_UPPER_MASK UINT32_C(0xffff0)
9602 #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_PPS_TIMESTAMP_UPPER_SFT 4
9603 uint8_t opaque_v;
9604 /*
9605 * This value is written by the NIC such that it will be different
9606 * for each pass through the completion queue. The even passes
9607 * will write 1. The odd passes will write 0.
9608 */
9609 #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_V UINT32_C(0x1)
9610 /* opaque is 7 b */
9611 #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_OPAQUE_MASK UINT32_C(0xfe)
9612 #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_OPAQUE_SFT 1
9613 /* 8-lsb timestamp (100-msec resolution) */
9614 uint8_t timestamp_lo;
9615 /* 16-lsb timestamp (100-msec resolution) */
9616 uint16_t timestamp_hi;
9617 /* Contains the lower 32 bits of the PPS timestamp. */
9618 uint32_t event_data1;
9619 /* Contains the lower 32 bit PPS timestamp */
9620 #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA1_PPS_TIMESTAMP_LOWER_MASK UINT32_C(0xffffffff)
9621 #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA1_PPS_TIMESTAMP_LOWER_SFT 0
9622 } hwrm_async_event_cmpl_pps_timestamp_t, *phwrm_async_event_cmpl_pps_timestamp_t;
9623
9624 /* hwrm_async_event_cmpl_fw_trace_msg (size:128b/16B) */
9625
9626 typedef struct hwrm_async_event_cmpl_fw_trace_msg {
9627 uint16_t type;
9628 /*
9629 * This field indicates the exact type of the completion.
9630 * By convention, the LSB identifies the length of the
9631 * record in 16B units. Even values indicate 16B
9632 * records. Odd values indicate 32B
9633 * records.
9634 */
9635 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_MASK UINT32_C(0x3f)
9636 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_SFT 0
9637 /* HWRM Asynchronous Event Information */
9638 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
9639 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_HWRM_ASYNC_EVENT
9640 /* Identifiers of events. */
9641 uint16_t event_id;
9642 /* Firmware trace log message */
9643 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_ID_FW_TRACE_MSG UINT32_C(0xfe)
9644 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_ID_FW_TRACE_MSG
9645 /* Trace byte 0 to 3 */
9646 uint32_t event_data2;
9647 /* Trace byte0 */
9648 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE0_MASK UINT32_C(0xff)
9649 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE0_SFT 0
9650 /* Trace byte1 */
9651 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE1_MASK UINT32_C(0xff00)
9652 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE1_SFT 8
9653 /* Trace byte2 */
9654 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE2_MASK UINT32_C(0xff0000)
9655 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE2_SFT 16
9656 /* Trace byte3 */
9657 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE3_MASK UINT32_C(0xff000000)
9658 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE3_SFT 24
9659 uint8_t opaque_v;
9660 /*
9661 * This value is written by the NIC such that it will be different
9662 * for each pass through the completion queue. The even passes
9663 * will write 1. The odd passes will write 0.
9664 */
9665 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_V UINT32_C(0x1)
9666 /* opaque is 7 b */
9667 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_OPAQUE_MASK UINT32_C(0xfe)
9668 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_OPAQUE_SFT 1
9669 /* Trace flags */
9670 uint8_t timestamp_lo;
9671 /* Indicates if the string is partial or complete. */
9672 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING UINT32_C(0x1)
9673 /* Complete string */
9674 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_COMPLETE UINT32_C(0x0)
9675 /* Partial string */
9676 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_PARTIAL UINT32_C(0x1)
9677 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_LAST HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_PARTIAL
9678 /* Indicates the firmware that sent the trace message. */
9679 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE UINT32_C(0x2)
9680 /* Primary firmware */
9681 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_PRIMARY (UINT32_C(0x0) << 1)
9682 /* Secondary firmware */
9683 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_SECONDARY (UINT32_C(0x1) << 1)
9684 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_LAST HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_SECONDARY
9685 /* Trace byte 4 to 5 */
9686 uint16_t timestamp_hi;
9687 /* Trace byte4 */
9688 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE4_MASK UINT32_C(0xff)
9689 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE4_SFT 0
9690 /* Trace byte5 */
9691 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE5_MASK UINT32_C(0xff00)
9692 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE5_SFT 8
9693 /* Trace byte 6 to 9 */
9694 uint32_t event_data1;
9695 /* Trace byte6 */
9696 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE6_MASK UINT32_C(0xff)
9697 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE6_SFT 0
9698 /* Trace byte7 */
9699 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE7_MASK UINT32_C(0xff00)
9700 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE7_SFT 8
9701 /* Trace byte8 */
9702 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE8_MASK UINT32_C(0xff0000)
9703 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE8_SFT 16
9704 /* Trace byte9 */
9705 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE9_MASK UINT32_C(0xff000000)
9706 #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE9_SFT 24
9707 } hwrm_async_event_cmpl_fw_trace_msg_t, *phwrm_async_event_cmpl_fw_trace_msg_t;
9708
9709 /* hwrm_async_event_cmpl_hwrm_error (size:128b/16B) */
9710
9711 typedef struct hwrm_async_event_cmpl_hwrm_error {
9712 uint16_t type;
9713 /*
9714 * This field indicates the exact type of the completion.
9715 * By convention, the LSB identifies the length of the
9716 * record in 16B units. Even values indicate 16B
9717 * records. Odd values indicate 32B
9718 * records.
9719 */
9720 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_MASK UINT32_C(0x3f)
9721 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_SFT 0
9722 /* HWRM Asynchronous Event Information */
9723 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
9724 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_HWRM_ASYNC_EVENT
9725 /* Identifiers of events. */
9726 uint16_t event_id;
9727 /* HWRM Error */
9728 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_HWRM_ERROR UINT32_C(0xff)
9729 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_HWRM_ERROR
9730 /* Event specific data */
9731 uint32_t event_data2;
9732 /* Severity of HWRM Error */
9733 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_MASK UINT32_C(0xff)
9734 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_SFT 0
9735 /* Warning */
9736 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_WARNING UINT32_C(0x0)
9737 /* Non-fatal Error */
9738 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_NONFATAL UINT32_C(0x1)
9739 /* Fatal Error */
9740 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_FATAL UINT32_C(0x2)
9741 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_LAST HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_FATAL
9742 uint8_t opaque_v;
9743 /*
9744 * This value is written by the NIC such that it will be different
9745 * for each pass through the completion queue. The even passes
9746 * will write 1. The odd passes will write 0.
9747 */
9748 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_V UINT32_C(0x1)
9749 /* opaque is 7 b */
9750 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_OPAQUE_MASK UINT32_C(0xfe)
9751 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_OPAQUE_SFT 1
9752 /* 8-lsb timestamp from POR (100-msec resolution) */
9753 uint8_t timestamp_lo;
9754 /* 16-lsb timestamp from POR (100-msec resolution) */
9755 uint16_t timestamp_hi;
9756 /* Event specific data */
9757 uint32_t event_data1;
9758 /* Time stamp for error event */
9759 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA1_TIMESTAMP UINT32_C(0x1)
9760 } hwrm_async_event_cmpl_hwrm_error_t, *phwrm_async_event_cmpl_hwrm_error_t;
9761
9762 /* metadata_base_msg (size:64b/8B) */
9763
9764 typedef struct metadata_base_msg {
9765 uint16_t md_type_link;
9766 /* This field classifies the data present in the meta-data. */
9767 #define METADATA_BASE_MSG_MD_TYPE_MASK UINT32_C(0x1f)
9768 #define METADATA_BASE_MSG_MD_TYPE_SFT 0
9769 /* Meta data fields are not valid */
9770 #define METADATA_BASE_MSG_MD_TYPE_NONE UINT32_C(0x0)
9771 /*
9772 * This setting is used when packets are coming in-order. Depending on
9773 * the state of the receive context, the meta-data will carry different
9774 * information.
9775 */
9776 #define METADATA_BASE_MSG_MD_TYPE_TLS_INSYNC UINT32_C(0x1)
9777 /*
9778 * With this setting HW passes the TCP sequence number of the TLS
9779 * record that it is requesting a resync on in the meta data.
9780 */
9781 #define METADATA_BASE_MSG_MD_TYPE_TLS_RESYNC UINT32_C(0x2)
9782 #define METADATA_BASE_MSG_MD_TYPE_LAST METADATA_BASE_MSG_MD_TYPE_TLS_RESYNC
9783 /*
9784 * This field indicates where the next metadata block starts. It is
9785 * counted in 16B units. A value of zero indicates that there is no
9786 * metadata.
9787 */
9788 #define METADATA_BASE_MSG_LINK_MASK UINT32_C(0x1e0)
9789 #define METADATA_BASE_MSG_LINK_SFT 5
9790 uint16_t unused0;
9791 uint32_t unused1;
9792 } metadata_base_msg_t, *pmetadata_base_msg_t;
9793
9794 /* tls_metadata_base_msg (size:64b/8B) */
9795
9796 typedef struct tls_metadata_base_msg {
9797 uint32_t md_type_link_flags_kid_lo;
9798 /* This field classifies the data present in the meta-data. */
9799 #define TLS_METADATA_BASE_MSG_MD_TYPE_MASK UINT32_C(0x1f)
9800 #define TLS_METADATA_BASE_MSG_MD_TYPE_SFT 0
9801 /*
9802 * This setting is used when packets are coming in-order. Depending on
9803 * the state of the receive context, the meta-data will carry different
9804 * information.
9805 */
9806 #define TLS_METADATA_BASE_MSG_MD_TYPE_TLS_INSYNC UINT32_C(0x1)
9807 /*
9808 * With this setting HW passes the TCP sequence number of the TLS
9809 * record that it is requesting a resync on in the meta data.
9810 */
9811 #define TLS_METADATA_BASE_MSG_MD_TYPE_TLS_RESYNC UINT32_C(0x2)
9812 #define TLS_METADATA_BASE_MSG_MD_TYPE_LAST TLS_METADATA_BASE_MSG_MD_TYPE_TLS_RESYNC
9813 /*
9814 * This field indicates where the next metadata block starts. It is
9815 * counted in 16B units. A value of zero indicates that there is no
9816 * metadata.
9817 */
9818 #define TLS_METADATA_BASE_MSG_LINK_MASK UINT32_C(0x1e0)
9819 #define TLS_METADATA_BASE_MSG_LINK_SFT 5
9820 /* These are flags present in the metadata. */
9821 #define TLS_METADATA_BASE_MSG_FLAGS_MASK UINT32_C(0x1fffe00)
9822 #define TLS_METADATA_BASE_MSG_FLAGS_SFT 9
9823 /*
9824 * A value of 1 implies that the packet was decrypted by HW. Otherwise
9825 * the packet is passed on as it came in on the wire.
9826 */
9827 #define TLS_METADATA_BASE_MSG_FLAGS_DECRYPTED UINT32_C(0x200)
9828 /*
9829 * This field indicates the state of the ghash field passed in the
9830 * meta-data.
9831 */
9832 #define TLS_METADATA_BASE_MSG_FLAGS_GHASH_MASK UINT32_C(0xc00)
9833 #define TLS_METADATA_BASE_MSG_FLAGS_GHASH_SFT 10
9834 /*
9835 * This enumeration states that the ghash is not valid in the
9836 * meta-data.
9837 */
9838 #define TLS_METADATA_BASE_MSG_FLAGS_GHASH_NOT_VALID (UINT32_C(0x0) << 10)
9839 /*
9840 * This enumeration indicates that this pkt contains the record's
9841 * tag and this pkt was received ooo, the partial_ghash field
9842 * contains the ghash.
9843 */
9844 #define TLS_METADATA_BASE_MSG_FLAGS_GHASH_CUR_REC (UINT32_C(0x1) << 10)
9845 /*
9846 * This enumeration indicates that the current record's tag wasn't
9847 * seen and the chip is moving on to the next record, the
9848 * partial_ghash field contains the ghash.
9849 */
9850 #define TLS_METADATA_BASE_MSG_FLAGS_GHASH_PRIOR_REC (UINT32_C(0x2) << 10)
9851 #define TLS_METADATA_BASE_MSG_FLAGS_GHASH_LAST TLS_METADATA_BASE_MSG_FLAGS_GHASH_PRIOR_REC
9852 /* This field indicates the status of tag authentication. */
9853 #define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_MASK UINT32_C(0x3000)
9854 #define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_SFT 12
9855 /*
9856 * This enumeration is set when there is no tags present in the
9857 * packet.
9858 */
9859 #define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_NONE (UINT32_C(0x0) << 12)
9860 /*
9861 * This enumeration states that there is at least one tag in the
9862 * packet and every tag is valid.
9863 */
9864 #define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_SUCCESS (UINT32_C(0x1) << 12)
9865 /*
9866 * This enumeration states that there is at least one tag in the
9867 * packet and at least one of the tag is invalid. The entire packet
9868 * is sent decrypted to the host.
9869 */
9870 #define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_FAILURE (UINT32_C(0x2) << 12)
9871 #define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_LAST TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_FAILURE
9872 /*
9873 * A value of 1 indicates that this packet contains a record that
9874 * starts in the packet and extends beyond the packet.
9875 */
9876 #define TLS_METADATA_BASE_MSG_FLAGS_HEADER_FLDS_VALID UINT32_C(0x4000)
9877 /*
9878 * This value indicates the lower 7-bit of the Crypto Key ID
9879 * associated with this operation.
9880 */
9881 #define TLS_METADATA_BASE_MSG_KID_LO_MASK UINT32_C(0xfe000000)
9882 #define TLS_METADATA_BASE_MSG_KID_LO_SFT 25
9883 uint16_t kid_hi;
9884 /*
9885 * This value indicates the upper 13-bit of the Crypto Key ID
9886 * associated with this operation.
9887 */
9888 #define TLS_METADATA_BASE_MSG_KID_HI_MASK UINT32_C(0x1fff)
9889 #define TLS_METADATA_BASE_MSG_KID_HI_SFT 0
9890 uint16_t unused0;
9891 } tls_metadata_base_msg_t, *ptls_metadata_base_msg_t;
9892
9893 /* tls_metadata_insync_msg (size:192b/24B) */
9894
9895 typedef struct tls_metadata_insync_msg {
9896 uint32_t md_type_link_flags_kid_lo;
9897 /* This field classifies the data present in the meta-data. */
9898 #define TLS_METADATA_INSYNC_MSG_MD_TYPE_MASK UINT32_C(0x1f)
9899 #define TLS_METADATA_INSYNC_MSG_MD_TYPE_SFT 0
9900 /*
9901 * This setting is used when packets are coming in-order. Depending on
9902 * the state of the receive context, the meta-data will carry different
9903 * information.
9904 */
9905 #define TLS_METADATA_INSYNC_MSG_MD_TYPE_TLS_INSYNC UINT32_C(0x1)
9906 #define TLS_METADATA_INSYNC_MSG_MD_TYPE_LAST TLS_METADATA_INSYNC_MSG_MD_TYPE_TLS_INSYNC
9907 /*
9908 * This field indicates where the next metadata block starts. It is
9909 * counted in 16B units. A value of zero indicates that there is no
9910 * metadata.
9911 */
9912 #define TLS_METADATA_INSYNC_MSG_LINK_MASK UINT32_C(0x1e0)
9913 #define TLS_METADATA_INSYNC_MSG_LINK_SFT 5
9914 /* These are flags present in the metadata. */
9915 #define TLS_METADATA_INSYNC_MSG_FLAGS_MASK UINT32_C(0x1fffe00)
9916 #define TLS_METADATA_INSYNC_MSG_FLAGS_SFT 9
9917 /*
9918 * A value of 1 implies that the packet was decrypted by HW. Otherwise
9919 * the packet is passed on as it came in on the wire.
9920 */
9921 #define TLS_METADATA_INSYNC_MSG_FLAGS_DECRYPTED UINT32_C(0x200)
9922 /*
9923 * This field indicates the state of the ghash field passed in the
9924 * meta-data.
9925 */
9926 #define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_MASK UINT32_C(0xc00)
9927 #define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_SFT 10
9928 /*
9929 * This enumeration states that the ghash is not valid in the
9930 * meta-data.
9931 */
9932 #define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_NOT_VALID (UINT32_C(0x0) << 10)
9933 /*
9934 * This enumeration indicates that this pkt contains the record's
9935 * tag and this pkt was received ooo, the partial_ghash field
9936 * contains the ghash.
9937 */
9938 #define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_CUR_REC (UINT32_C(0x1) << 10)
9939 /*
9940 * This enumeration indicates that the current record's tag wasn't
9941 * seen and the chip is moving on to the next record, the
9942 * partial_ghash field contains the ghash.
9943 */
9944 #define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_PRIOR_REC (UINT32_C(0x2) << 10)
9945 #define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_LAST TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_PRIOR_REC
9946 /* This field indicates the status of tag authentication. */
9947 #define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_MASK UINT32_C(0x3000)
9948 #define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_SFT 12
9949 /*
9950 * This enumeration is set when there is no tags present in the
9951 * packet.
9952 */
9953 #define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_NONE (UINT32_C(0x0) << 12)
9954 /*
9955 * This enumeration states that there is at least one tag in the
9956 * packet and every tag is valid.
9957 */
9958 #define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_SUCCESS (UINT32_C(0x1) << 12)
9959 /*
9960 * This enumeration states that there is at least one tag in the
9961 * packet and at least one of the tag is invalid. The entire packet
9962 * is sent decrypted to the host.
9963 */
9964 #define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_FAILURE (UINT32_C(0x2) << 12)
9965 #define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_LAST TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_FAILURE
9966 /*
9967 * A value of 1 indicates that this packet contains a record that
9968 * starts in the packet and extends beyond the packet.
9969 */
9970 #define TLS_METADATA_INSYNC_MSG_FLAGS_HEADER_FLDS_VALID UINT32_C(0x4000)
9971 /*
9972 * This value indicates the lower 7-bit of the Crypto Key ID
9973 * associated with this operation.
9974 */
9975 #define TLS_METADATA_INSYNC_MSG_KID_LO_MASK UINT32_C(0xfe000000)
9976 #define TLS_METADATA_INSYNC_MSG_KID_LO_SFT 25
9977 uint16_t kid_hi;
9978 /*
9979 * This value indicates the upper 13-bit of the Crypto Key ID
9980 * associated with this operation.
9981 */
9982 #define TLS_METADATA_INSYNC_MSG_KID_HI_MASK UINT32_C(0x1fff)
9983 #define TLS_METADATA_INSYNC_MSG_KID_HI_SFT 0
9984 /*
9985 * This field is only valid when md_type is set to tls_insync. This field
9986 * indicates the offset within the current TCP packet where the TLS header
9987 * starts. If there are multiple TLS headers in the packet, this provides
9988 * the offset of the last TLS header.
9989 *
9990 * The field is calculated by subtracting TCP sequence number of the first
9991 * byte of the TCP payload of the packet from the TCP sequence number of
9992 * the last TLS header in the packet.
9993 */
9994 uint16_t tls_header_offset;
9995 /*
9996 * This is the sequence Number of the record that was processed by the HW.
9997 * If there are multiple records in a packet, this would be the sequence
9998 * number of the last record.
9999 */
10000 uint64_t record_seq_num;
10001 /*
10002 * This field contains cumulative partial GHASH value of all the packets
10003 * decrypted by the HW associated with a TLS record. This field is valid
10004 * on when packets belonging to have arrived out-of-order and HW could
10005 * not decrypt every packet and authenticate the record. Partial GHASH is
10006 * only sent out with packet having the TAG field.
10007 */
10008 uint64_t partial_ghash;
10009 } tls_metadata_insync_msg_t, *ptls_metadata_insync_msg_t;
10010
10011 /* tls_metadata_resync_msg (size:256b/32B) */
10012
10013 typedef struct tls_metadata_resync_msg {
10014 uint32_t md_type_link_flags_kid_lo;
10015 /* This field classifies the data present in the meta-data. */
10016 #define TLS_METADATA_RESYNC_MSG_MD_TYPE_MASK UINT32_C(0x1f)
10017 #define TLS_METADATA_RESYNC_MSG_MD_TYPE_SFT 0
10018 /*
10019 * With this setting HW passes the TCP sequence number of the TLS
10020 * record that it is requesting a resync on in the meta data.
10021 */
10022 #define TLS_METADATA_RESYNC_MSG_MD_TYPE_TLS_RESYNC UINT32_C(0x2)
10023 #define TLS_METADATA_RESYNC_MSG_MD_TYPE_LAST TLS_METADATA_RESYNC_MSG_MD_TYPE_TLS_RESYNC
10024 /*
10025 * This field indicates where the next metadata block starts. It is
10026 * counted in 16B units. A value of zero indicates that there is no
10027 * metadata.
10028 */
10029 #define TLS_METADATA_RESYNC_MSG_LINK_MASK UINT32_C(0x1e0)
10030 #define TLS_METADATA_RESYNC_MSG_LINK_SFT 5
10031 /* These are flags present in the metadata. */
10032 #define TLS_METADATA_RESYNC_MSG_FLAGS_MASK UINT32_C(0x1fffe00)
10033 #define TLS_METADATA_RESYNC_MSG_FLAGS_SFT 9
10034 /*
10035 * A value of 1 implies that the packet was decrypted by HW. Otherwise
10036 * the packet is passed on as it came in on the wire.
10037 */
10038 #define TLS_METADATA_RESYNC_MSG_FLAGS_DECRYPTED UINT32_C(0x200)
10039 /*
10040 * This field indicates the state of the ghash field passed in the
10041 * meta-data.
10042 */
10043 #define TLS_METADATA_RESYNC_MSG_FLAGS_GHASH_MASK UINT32_C(0xc00)
10044 #define TLS_METADATA_RESYNC_MSG_FLAGS_GHASH_SFT 10
10045 /*
10046 * This enumeration states that the ghash is not valid in the
10047 * meta-data.
10048 */
10049 #define TLS_METADATA_RESYNC_MSG_FLAGS_GHASH_NOT_VALID (UINT32_C(0x0) << 10)
10050 #define TLS_METADATA_RESYNC_MSG_FLAGS_GHASH_LAST TLS_METADATA_RESYNC_MSG_FLAGS_GHASH_NOT_VALID
10051 /* This field indicates the status of tag authentication. */
10052 #define TLS_METADATA_RESYNC_MSG_FLAGS_TAG_AUTH_STATUS_MASK UINT32_C(0x3000)
10053 #define TLS_METADATA_RESYNC_MSG_FLAGS_TAG_AUTH_STATUS_SFT 12
10054 /*
10055 * This enumeration is set when there is no tags present in the
10056 * packet.
10057 */
10058 #define TLS_METADATA_RESYNC_MSG_FLAGS_TAG_AUTH_STATUS_NONE (UINT32_C(0x0) << 12)
10059 #define TLS_METADATA_RESYNC_MSG_FLAGS_TAG_AUTH_STATUS_LAST TLS_METADATA_RESYNC_MSG_FLAGS_TAG_AUTH_STATUS_NONE
10060 /*
10061 * A value of 1 indicates that this packet contains a record that
10062 * starts in the packet and extends beyond the packet.
10063 */
10064 #define TLS_METADATA_RESYNC_MSG_FLAGS_HEADER_FLDS_VALID UINT32_C(0x4000)
10065 /*
10066 * This value indicates the lower 7-bit of the Crypto Key ID
10067 * associated with this operation.
10068 */
10069 #define TLS_METADATA_RESYNC_MSG_KID_LO_MASK UINT32_C(0xfe000000)
10070 #define TLS_METADATA_RESYNC_MSG_KID_LO_SFT 25
10071 uint16_t kid_hi;
10072 /*
10073 * This value indicates the upper 13-bit of the Crypto Key ID
10074 * associated with this operation.
10075 */
10076 #define TLS_METADATA_RESYNC_MSG_KID_HI_MASK UINT32_C(0x1fff)
10077 #define TLS_METADATA_RESYNC_MSG_KID_HI_SFT 0
10078 /* This field is unused in this context. */
10079 uint16_t metadata_0;
10080 /*
10081 * This field indicates the TCP sequence number of the TLS record that HW
10082 * is requesting a resync on from the Driver. HW will keep a count of the
10083 * TLS records it found after this record (delta_records). Driver will
10084 * provide the TLS Record Sequence Number associated with the record. HW
10085 * will add the delta_records to the Record Sequence Number provided by
10086 * the driver and get back on sync.
10087 */
10088 uint32_t resync_record_tcp_seq_num;
10089 uint32_t unused0;
10090 /* This field is unused in this context. */
10091 uint64_t metadata_2;
10092 /* This field is unused in this context. */
10093 uint64_t metadata_3;
10094 } tls_metadata_resync_msg_t, *ptls_metadata_resync_msg_t;
10095
10096 /* tx_doorbell (size:32b/4B) */
10097
10098 typedef struct tx_doorbell {
10099 uint32_t key_idx;
10100 /*
10101 * BD Index of next BD that will be used to transmit data
10102 * on the TX ring mapped to this door bell. NIC may
10103 * read and process all BDs up to, but not including this
10104 * index.
10105 */
10106 #define TX_DOORBELL_IDX_MASK UINT32_C(0xffffff)
10107 #define TX_DOORBELL_IDX_SFT 0
10108 /*
10109 * This value indicates the type of door bell operation
10110 * that is begin requested. This value is '' for TX
10111 * door bell operations.
10112 */
10113 #define TX_DOORBELL_KEY_MASK UINT32_C(0xf0000000)
10114 #define TX_DOORBELL_KEY_SFT 28
10115 /* TX Operation */
10116 #define TX_DOORBELL_KEY_TX (UINT32_C(0x0) << 28)
10117 #define TX_DOORBELL_KEY_LAST TX_DOORBELL_KEY_TX
10118 } tx_doorbell_t, *ptx_doorbell_t;
10119
10120 /* rx_doorbell (size:32b/4B) */
10121
10122 typedef struct rx_doorbell {
10123 uint32_t key_idx;
10124 /*
10125 * BD Index of next BD that will be used for an empty receive
10126 * buffer on the RX ring mapped to this door bell. NIC may
10127 * read and process all BDs up to, but not including this
10128 * index.
10129 */
10130 #define RX_DOORBELL_IDX_MASK UINT32_C(0xffffff)
10131 #define RX_DOORBELL_IDX_SFT 0
10132 /*
10133 * This value indicates the type of door bell operation
10134 * that is begin requested. This value is '1' for RX
10135 * door bell operations.
10136 */
10137 #define RX_DOORBELL_KEY_MASK UINT32_C(0xf0000000)
10138 #define RX_DOORBELL_KEY_SFT 28
10139 /* RX Operation */
10140 #define RX_DOORBELL_KEY_RX (UINT32_C(0x1) << 28)
10141 #define RX_DOORBELL_KEY_LAST RX_DOORBELL_KEY_RX
10142 } rx_doorbell_t, *prx_doorbell_t;
10143
10144 /* cmpl_doorbell (size:32b/4B) */
10145
10146 typedef struct cmpl_doorbell {
10147 uint32_t key_mask_valid_idx;
10148 /*
10149 * BD Index of the most recently handed completion record
10150 * on the completion ring mapped to this door bell.
10151 * NIC may
10152 * write this location again with a new completion.
10153 */
10154 #define CMPL_DOORBELL_IDX_MASK UINT32_C(0xffffff)
10155 #define CMPL_DOORBELL_IDX_SFT 0
10156 /*
10157 * This indicates if the BDIDX value is valid for this
10158 * update when it is '1'. When it is '', the BDIDX
10159 * value should be ignored.
10160 */
10161 #define CMPL_DOORBELL_IDX_VALID UINT32_C(0x4000000)
10162 /*
10163 * This bit indicates the new interrupt mask state for the
10164 * interrupt associated with the BDIDX. A '1', means the
10165 * interrupt is to be masked. A '' indicates the interrupt
10166 * is to be unmasked.
10167 */
10168 #define CMPL_DOORBELL_MASK UINT32_C(0x8000000)
10169 /*
10170 * This value indicates the type of door bell operation
10171 * that is begin requested. This value is '2' for CMP
10172 * door bell operations.
10173 */
10174 #define CMPL_DOORBELL_KEY_MASK UINT32_C(0xf0000000)
10175 #define CMPL_DOORBELL_KEY_SFT 28
10176 /* Completion Operation */
10177 #define CMPL_DOORBELL_KEY_CMPL (UINT32_C(0x2) << 28)
10178 #define CMPL_DOORBELL_KEY_LAST CMPL_DOORBELL_KEY_CMPL
10179 } cmpl_doorbell_t, *pcmpl_doorbell_t;
10180
10181 /* status_doorbell (size:32b/4B) */
10182
10183 typedef struct status_doorbell {
10184 uint32_t key_idx;
10185 /*
10186 * BD Index of the status record for which space is now
10187 * available to the NIC.
10188 */
10189 #define STATUS_DOORBELL_IDX_MASK UINT32_C(0xffffff)
10190 #define STATUS_DOORBELL_IDX_SFT 0
10191 /*
10192 * This value indicates the type of door bell operation
10193 * that is begin requested. This value is '3' for Status
10194 * door bell operations.
10195 */
10196 #define STATUS_DOORBELL_KEY_MASK UINT32_C(0xf0000000)
10197 #define STATUS_DOORBELL_KEY_SFT 28
10198 /* Status Operation */
10199 #define STATUS_DOORBELL_KEY_STAT (UINT32_C(0x3) << 28)
10200 #define STATUS_DOORBELL_KEY_LAST STATUS_DOORBELL_KEY_STAT
10201 } status_doorbell_t, *pstatus_doorbell_t;
10202
10203 /* push32_doorbell (size:1024b/128B) */
10204
10205 typedef struct push32_doorbell {
10206 uint32_t key_sz_idx;
10207 /*
10208 * This is the BD Index of last BD of the push packet
10209 * that will be used to transmit data on the TX ring mapped
10210 * to this door bell.
10211 */
10212 #define PUSH32_DOORBELL_IDX_MASK UINT32_C(0xffffff)
10213 #define PUSH32_DOORBELL_IDX_SFT 0
10214 /*
10215 * This is the number of 16B BDs spaces consumed in the TX
10216 * Ring by the "backup" version of the packet being pushed.
10217 * A value of 1 is invalid since backup must start with a
10218 * long 32B BE.
10219 * A value of 2 indicates just the first 32B BE.
10220 * A value of 3 indicates 32B+16B BD. etc.
10221 * A value of 0 indicates 16x16B BD spaces are consumed.
10222 */
10223 #define PUSH32_DOORBELL_SZ_MASK UINT32_C(0xf000000)
10224 #define PUSH32_DOORBELL_SZ_SFT 24
10225 /*
10226 * This value indicates the type of door bell operation
10227 * that is begin requested. This value is 4 for push
10228 * door bell operations.
10229 */
10230 #define PUSH32_DOORBELL_KEY_MASK UINT32_C(0xf0000000)
10231 #define PUSH32_DOORBELL_KEY_SFT 28
10232 /* Push Operation */
10233 #define PUSH32_DOORBELL_KEY_PUSH (UINT32_C(0x4) << 28)
10234 #define PUSH32_DOORBELL_KEY_LAST PUSH32_DOORBELL_KEY_PUSH
10235 uint16_t flags_type;
10236 /* This value identifies the type of buffer descriptor. */
10237 #define PUSH32_DOORBELL_TYPE_MASK UINT32_C(0x3f)
10238 #define PUSH32_DOORBELL_TYPE_SFT 0
10239 /*
10240 * Indicates that this BD is 32B long and is used for
10241 * normal L2 packet transmission.
10242 */
10243 #define PUSH32_DOORBELL_TYPE_TX_BD_LONG UINT32_C(0x10)
10244 #define PUSH32_DOORBELL_TYPE_LAST PUSH32_DOORBELL_TYPE_TX_BD_LONG
10245 /*
10246 * All bits in this field must be valid on the first BD of a packet.
10247 * Only the packet_end bit must be valid for the remaining BDs
10248 * of a packet.
10249 */
10250 #define PUSH32_DOORBELL_FLAGS_MASK UINT32_C(0xffc0)
10251 #define PUSH32_DOORBELL_FLAGS_SFT 6
10252 /*
10253 * If set to 1, the packet ends with the data in the buffer
10254 * pointed to by this descriptor. This flag must be
10255 * valid on every BD.
10256 *
10257 * This bit must be set on all push doorbells.
10258 */
10259 #define PUSH32_DOORBELL_FLAGS_PACKET_END UINT32_C(0x40)
10260 /*
10261 * If set to 1, the device will not generate a completion for
10262 * this transmit packet unless there is an error in it's
10263 * processing.
10264 * If this bit
10265 * is set to 0, then the packet will be completed normally.
10266 *
10267 * This bit must be valid only on the first BD of a packet.
10268 */
10269 #define PUSH32_DOORBELL_FLAGS_NO_CMPL UINT32_C(0x80)
10270 /*
10271 * This value must match the sz field in the first
10272 * 32b of the push operation except that if
10273 * 16x16B BD locations
10274 * are consumed in the ring by this packet, then
10275 * this value must be 16 (not zero).
10276 */
10277 #define PUSH32_DOORBELL_FLAGS_BD_CNT_MASK UINT32_C(0x1f00)
10278 #define PUSH32_DOORBELL_FLAGS_BD_CNT_SFT 8
10279 /*
10280 * This value is a hint for the length of the entire packet.
10281 * It is used by the chip to optimize internal processing.
10282 *
10283 * The packet will be dropped if the hint is too short.
10284 *
10285 * This field is valid only on the first BD of a packet.
10286 */
10287 #define PUSH32_DOORBELL_FLAGS_LHINT_MASK UINT32_C(0x6000)
10288 #define PUSH32_DOORBELL_FLAGS_LHINT_SFT 13
10289 /* indicates packet length < 512B */
10290 #define PUSH32_DOORBELL_FLAGS_LHINT_LT512 (UINT32_C(0x0) << 13)
10291 /* indicates 512 <= packet length < 1KB */
10292 #define PUSH32_DOORBELL_FLAGS_LHINT_LT1K (UINT32_C(0x1) << 13)
10293 /* indicates 1KB <= packet length < 2KB */
10294 #define PUSH32_DOORBELL_FLAGS_LHINT_LT2K (UINT32_C(0x2) << 13)
10295 /* indicates packet length >= 2KB */
10296 #define PUSH32_DOORBELL_FLAGS_LHINT_GTE2K (UINT32_C(0x3) << 13)
10297 #define PUSH32_DOORBELL_FLAGS_LHINT_LAST PUSH32_DOORBELL_FLAGS_LHINT_GTE2K
10298 /*
10299 * If set to 1, the device immediately updates the Send Consumer
10300 * Index after the buffer associated with this descriptor has
10301 * been transferred via DMA to NIC memory from host memory. An
10302 * interrupt may or may not be generated according to the state
10303 * of the interrupt avoidance mechanisms. If this bit
10304 * is set to 0, then the Consumer Index is only updated as soon
10305 * as one of the host interrupt coalescing conditions has been met.
10306 *
10307 * This bit must be valid on the first BD of a packet.
10308 */
10309 #define PUSH32_DOORBELL_FLAGS_COAL_NOW UINT32_C(0x8000)
10310 /*
10311 * This is the length of the host physical buffer this BD describes
10312 * in bytes.
10313 *
10314 * This field must be valid on all BDs of a packet.
10315 */
10316 uint16_t len;
10317 /*
10318 * The opaque data field is pass through to the completion and can be
10319 * used for any data that the driver wants to associate with the
10320 * transmit BD.
10321 *
10322 * This field must be valid on the first BD of a packet.
10323 */
10324 uint32_t opaque;
10325 /*
10326 * All bits in this field must be valid on the first BD of a packet.
10327 * Their value on other BDs of the packet will be ignored.
10328 */
10329 uint16_t lflags;
10330 /*
10331 * If set to 1, the controller replaces the TCP/UPD checksum
10332 * fields of normal TCP/UPD checksum, or the inner TCP/UDP
10333 * checksum field of the encapsulated TCP/UDP packets with the
10334 * hardware calculated TCP/UDP checksum for the packet associated
10335 * with this descriptor. The flag is ignored if the LSO flag is set.
10336 *
10337 * This bit must be valid on the first BD of a packet.
10338 */
10339 #define PUSH32_DOORBELL_LFLAGS_TCP_UDP_CHKSUM UINT32_C(0x1)
10340 /*
10341 * If set to 1, the controller replaces the IP checksum of the
10342 * normal packets, or the inner IP checksum of the encapsulated
10343 * packets with the hardware calculated IP checksum for the
10344 * packet associated with this descriptor.
10345 *
10346 * This bit must be valid on the first BD of a packet.
10347 */
10348 #define PUSH32_DOORBELL_LFLAGS_IP_CHKSUM UINT32_C(0x2)
10349 /*
10350 * If set to 1, the controller will not append an Ethernet CRC
10351 * to the end of the frame.
10352 *
10353 * This bit must be valid on the first BD of a packet.
10354 *
10355 * Packet must be 64B or longer when this flag is set. It is not
10356 * useful to use this bit with any form of TX offload such as
10357 * CSO or LSO. The intent is that the packet from the host already
10358 * has a valid Ethernet CRC on the packet.
10359 */
10360 #define PUSH32_DOORBELL_LFLAGS_NOCRC UINT32_C(0x4)
10361 /*
10362 * If set to 1, the device will record the time at which the packet
10363 * was actually transmitted at the TX MAC.
10364 *
10365 * This bit must be valid on the first BD of a packet.
10366 */
10367 #define PUSH32_DOORBELL_LFLAGS_STAMP UINT32_C(0x8)
10368 /*
10369 * If set to 1, The controller replaces the tunnel IP checksum
10370 * field with hardware calculated IP checksum for the IP header
10371 * of the packet associated with this descriptor.
10372 *
10373 * For outer UDP checksum, global outer UDP checksum TE_NIC register
10374 * needs to be enabled. If the global outer UDP checksum TE_NIC register
10375 * bit is set, outer UDP checksum will be calculated for the following
10376 * cases:
10377 * 1. Packets with tcp_udp_chksum flag set to offload checksum for inner
10378 * packet AND the inner packet is TCP/UDP. If the inner packet is ICMP for
10379 * example (non-TCP/UDP), even if the tcp_udp_chksum is set, the outer UDP
10380 * checksum will not be calculated.
10381 * 2. Packets with lso flag set which implies inner TCP checksum calculation
10382 * as part of LSO operation.
10383 */
10384 #define PUSH32_DOORBELL_LFLAGS_T_IP_CHKSUM UINT32_C(0x10)
10385 /*
10386 * If set to 1, the device will treat this packet with LSO(Large
10387 * Send Offload) processing for both normal or encapsulated
10388 * packets, which is a form of TCP segmentation. When this bit
10389 * is 1, the hdr_size and mss fields must be valid. The driver
10390 * doesn't need to set t_ip_chksum, ip_chksum, and tcp_udp_chksum
10391 * flags since the controller will replace the appropriate
10392 * checksum fields for segmented packets.
10393 *
10394 * When this bit is 1, the hdr_size and mss fields must be valid.
10395 */
10396 #define PUSH32_DOORBELL_LFLAGS_LSO UINT32_C(0x20)
10397 /*
10398 * If set to zero when LSO is '1', then the IPID will be treated
10399 * as a 16b number and will be wrapped if it exceeds a value of
10400 * 0xffff.
10401 *
10402 * If set to one when LSO is '1', then the IPID will be treated
10403 * as a 15b number and will be wrapped if it exceeds a value 0f
10404 * 0x7fff.
10405 */
10406 #define PUSH32_DOORBELL_LFLAGS_IPID_FMT UINT32_C(0x40)
10407 /*
10408 * If set to zero when LSO is '1', then the IPID of the tunnel
10409 * IP header will not be modified during LSO operations.
10410 *
10411 * If set to one when LSO is '1', then the IPID of the tunnel
10412 * IP header will be incremented for each subsequent segment of an
10413 * LSO operation.
10414 *
10415 * The flag is ignored if the LSO packet is a normal (non-tunneled)
10416 * TCP packet.
10417 */
10418 #define PUSH32_DOORBELL_LFLAGS_T_IPID UINT32_C(0x80)
10419 /*
10420 * If set to '1', then the RoCE ICRC will be appended to the
10421 * packet. Packet must be a valid RoCE format packet.
10422 */
10423 #define PUSH32_DOORBELL_LFLAGS_ROCE_CRC UINT32_C(0x100)
10424 /*
10425 * If set to '1', then the FCoE CRC will be appended to the
10426 * packet. Packet must be a valid FCoE format packet.
10427 */
10428 #define PUSH32_DOORBELL_LFLAGS_FCOE_CRC UINT32_C(0x200)
10429 uint16_t hdr_size;
10430 /*
10431 * When LSO is '1', this field must contain the offset of the
10432 * TCP payload from the beginning of the packet in as
10433 * 16b words. In case of encapsulated/tunneling packet, this field
10434 * contains the offset of the inner TCP payload from beginning of the
10435 * packet as 16-bit words.
10436 *
10437 * This value must be valid on the first BD of a packet.
10438 */
10439 #define PUSH32_DOORBELL_HDR_SIZE_MASK UINT32_C(0x1ff)
10440 #define PUSH32_DOORBELL_HDR_SIZE_SFT 0
10441 uint32_t mss;
10442 /*
10443 * This is the MSS value that will be used to do the LSO processing.
10444 * The value is the length in bytes of the TCP payload for each
10445 * segment generated by the LSO operation.
10446 *
10447 * This value must be valid on the first BD of a packet.
10448 */
10449 #define PUSH32_DOORBELL_MSS_MASK UINT32_C(0x7fff)
10450 #define PUSH32_DOORBELL_MSS_SFT 0
10451 uint16_t unused_2;
10452 /*
10453 * This value selects a CFA action to perform on the packet.
10454 * Set this value to zero if no CFA action is desired.
10455 *
10456 * This value must be valid on the first BD of a packet.
10457 */
10458 uint16_t cfa_action;
10459 /*
10460 * This value is action meta-data that defines CFA edit operations
10461 * that are done in addition to any action editing.
10462 */
10463 uint32_t cfa_meta;
10464 /* When key=1, This is the VLAN tag VID value. */
10465 #define PUSH32_DOORBELL_CFA_META_VLAN_VID_MASK UINT32_C(0xfff)
10466 #define PUSH32_DOORBELL_CFA_META_VLAN_VID_SFT 0
10467 /* When key=1, This is the VLAN tag DE value. */
10468 #define PUSH32_DOORBELL_CFA_META_VLAN_DE UINT32_C(0x1000)
10469 /* When key=1, This is the VLAN tag PRI value. */
10470 #define PUSH32_DOORBELL_CFA_META_VLAN_PRI_MASK UINT32_C(0xe000)
10471 #define PUSH32_DOORBELL_CFA_META_VLAN_PRI_SFT 13
10472 /* When key=1, This is the VLAN tag TPID select value. */
10473 #define PUSH32_DOORBELL_CFA_META_VLAN_TPID_MASK UINT32_C(0x70000)
10474 #define PUSH32_DOORBELL_CFA_META_VLAN_TPID_SFT 16
10475 /* 0x88a8 */
10476 #define PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPID88A8 (UINT32_C(0x0) << 16)
10477 /* 0x8100 */
10478 #define PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPID8100 (UINT32_C(0x1) << 16)
10479 /* 0x9100 */
10480 #define PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPID9100 (UINT32_C(0x2) << 16)
10481 /* 0x9200 */
10482 #define PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPID9200 (UINT32_C(0x3) << 16)
10483 /* 0x9300 */
10484 #define PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPID9300 (UINT32_C(0x4) << 16)
10485 /* Value programmed in CFA VLANTPID register. */
10486 #define PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPIDCFG (UINT32_C(0x5) << 16)
10487 #define PUSH32_DOORBELL_CFA_META_VLAN_TPID_LAST PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPIDCFG
10488 /* When key=1, This is the VLAN tag TPID select value. */
10489 #define PUSH32_DOORBELL_CFA_META_VLAN_RESERVED_MASK UINT32_C(0xff80000)
10490 #define PUSH32_DOORBELL_CFA_META_VLAN_RESERVED_SFT 19
10491 /*
10492 * This field identifies the type of edit to be performed
10493 * on the packet.
10494 *
10495 * This value must be valid on the first BD of a packet.
10496 */
10497 #define PUSH32_DOORBELL_CFA_META_KEY_MASK UINT32_C(0xf0000000)
10498 #define PUSH32_DOORBELL_CFA_META_KEY_SFT 28
10499 /* No editing */
10500 #define PUSH32_DOORBELL_CFA_META_KEY_NONE (UINT32_C(0x0) << 28)
10501 /*
10502 * - meta[17:16] - TPID select value (0 = 0x8100).
10503 * - meta[15:12] - PRI/DE value.
10504 * - meta[11:0] - VID value.
10505 */
10506 #define PUSH32_DOORBELL_CFA_META_KEY_VLAN_TAG (UINT32_C(0x1) << 28)
10507 #define PUSH32_DOORBELL_CFA_META_KEY_LAST PUSH32_DOORBELL_CFA_META_KEY_VLAN_TAG
10508 /*
10509 * This is the data for the push packet. If the packet
10510 * data does not fit in the first pass, data writing
10511 * can continue at offset 4 of the doorbell for up to 4 additional
10512 * passes for a total data size of 512B maximum.
10513 */
10514 uint32_t data[25];
10515 } push32_doorbell_t, *ppush32_doorbell_t;
10516
10517 /*******************
10518 * hwrm_func_reset *
10519 *******************/
10520
10521
10522 /* hwrm_func_reset_input (size:192b/24B) */
10523
10524 typedef struct hwrm_func_reset_input {
10525 /* The HWRM command request type. */
10526 uint16_t req_type;
10527 /*
10528 * The completion ring to send the completion event on. This should
10529 * be the NQ ID returned from the `nq_alloc` HWRM command.
10530 */
10531 uint16_t cmpl_ring;
10532 /*
10533 * The sequence ID is used by the driver for tracking multiple
10534 * commands. This ID is treated as opaque data by the firmware and
10535 * the value is returned in the `hwrm_resp_hdr` upon completion.
10536 */
10537 uint16_t seq_id;
10538 /*
10539 * The target ID of the command:
10540 * * 0x0-0xFFF8 - The function ID
10541 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
10542 * * 0xFFFD - Reserved for user-space HWRM interface
10543 * * 0xFFFF - HWRM
10544 */
10545 uint16_t target_id;
10546 /*
10547 * A physical address pointer pointing to a host buffer that the
10548 * command's response data will be written. This can be either a host
10549 * physical address (HPA) or a guest physical address (GPA) and must
10550 * point to a physically contiguous block of memory.
10551 */
10552 uint64_t resp_addr;
10553 uint32_t enables;
10554 /*
10555 * This bit must be '1' for the vf_id_valid field to be
10556 * configured.
10557 */
10558 #define HWRM_FUNC_RESET_INPUT_ENABLES_VF_ID_VALID UINT32_C(0x1)
10559 /*
10560 * The ID of the VF that this PF is trying to reset.
10561 * Only the parent PF shall be allowed to reset a child VF.
10562 *
10563 * A parent PF driver shall use this field only when a specific child VF
10564 * is requested to be reset.
10565 */
10566 uint16_t vf_id;
10567 /* This value indicates the level of a function reset. */
10568 uint8_t func_reset_level;
10569 /*
10570 * Reset the caller function and its children VFs (if any). If no
10571 * children functions exist, then reset the caller function only.
10572 */
10573 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETALL UINT32_C(0x0)
10574 /* Reset the caller function only */
10575 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETME UINT32_C(0x1)
10576 /*
10577 * Reset all children VFs of the caller function driver if the
10578 * caller is a PF driver.
10579 * It is an error to specify this level by a VF driver.
10580 * It is an error to specify this level by a PF driver with
10581 * no children VFs.
10582 */
10583 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETCHILDREN UINT32_C(0x2)
10584 /*
10585 * Reset a specific VF of the caller function driver if the caller
10586 * is the parent PF driver.
10587 * It is an error to specify this level by a VF driver.
10588 * It is an error to specify this level by a PF driver that is not
10589 * the parent of the VF that is being requested to reset.
10590 */
10591 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF UINT32_C(0x3)
10592 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_LAST HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF
10593 uint8_t unused_0;
10594 } hwrm_func_reset_input_t, *phwrm_func_reset_input_t;
10595
10596 /* hwrm_func_reset_output (size:128b/16B) */
10597
10598 typedef struct hwrm_func_reset_output {
10599 /* The specific error status for the command. */
10600 uint16_t error_code;
10601 /* The HWRM command request type. */
10602 uint16_t req_type;
10603 /* The sequence ID from the original command. */
10604 uint16_t seq_id;
10605 /* The length of the response data in number of bytes. */
10606 uint16_t resp_len;
10607 uint8_t unused_0[7];
10608 /*
10609 * This field is used in Output records to indicate that the output
10610 * is completely written to RAM. This field should be read as '1'
10611 * to indicate that the output has been completely written.
10612 * When writing a command completion or response to an internal processor,
10613 * the order of writes has to be such that this field is written last.
10614 */
10615 uint8_t valid;
10616 } hwrm_func_reset_output_t, *phwrm_func_reset_output_t;
10617
10618 /********************
10619 * hwrm_func_getfid *
10620 ********************/
10621
10622
10623 /* hwrm_func_getfid_input (size:192b/24B) */
10624
10625 typedef struct hwrm_func_getfid_input {
10626 /* The HWRM command request type. */
10627 uint16_t req_type;
10628 /*
10629 * The completion ring to send the completion event on. This should
10630 * be the NQ ID returned from the `nq_alloc` HWRM command.
10631 */
10632 uint16_t cmpl_ring;
10633 /*
10634 * The sequence ID is used by the driver for tracking multiple
10635 * commands. This ID is treated as opaque data by the firmware and
10636 * the value is returned in the `hwrm_resp_hdr` upon completion.
10637 */
10638 uint16_t seq_id;
10639 /*
10640 * The target ID of the command:
10641 * * 0x0-0xFFF8 - The function ID
10642 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
10643 * * 0xFFFD - Reserved for user-space HWRM interface
10644 * * 0xFFFF - HWRM
10645 */
10646 uint16_t target_id;
10647 /*
10648 * A physical address pointer pointing to a host buffer that the
10649 * command's response data will be written. This can be either a host
10650 * physical address (HPA) or a guest physical address (GPA) and must
10651 * point to a physically contiguous block of memory.
10652 */
10653 uint64_t resp_addr;
10654 uint32_t enables;
10655 /*
10656 * This bit must be '1' for the pci_id field to be
10657 * configured.
10658 */
10659 #define HWRM_FUNC_GETFID_INPUT_ENABLES_PCI_ID UINT32_C(0x1)
10660 /*
10661 * This value is the PCI ID of the queried function.
10662 * If ARI is enabled, then it is
10663 * Bus Number (8b):Function Number(8b). Otherwise, it is
10664 * Bus Number (8b):Device Number (5b):Function Number(3b).
10665 */
10666 uint16_t pci_id;
10667 uint8_t unused_0[2];
10668 } hwrm_func_getfid_input_t, *phwrm_func_getfid_input_t;
10669
10670 /* hwrm_func_getfid_output (size:128b/16B) */
10671
10672 typedef struct hwrm_func_getfid_output {
10673 /* The specific error status for the command. */
10674 uint16_t error_code;
10675 /* The HWRM command request type. */
10676 uint16_t req_type;
10677 /* The sequence ID from the original command. */
10678 uint16_t seq_id;
10679 /* The length of the response data in number of bytes. */
10680 uint16_t resp_len;
10681 /*
10682 * FID value. This value is used to identify operations on the PCI
10683 * bus as belonging to a particular PCI function.
10684 */
10685 uint16_t fid;
10686 uint8_t unused_0[5];
10687 /*
10688 * This field is used in Output records to indicate that the output
10689 * is completely written to RAM. This field should be read as '1'
10690 * to indicate that the output has been completely written.
10691 * When writing a command completion or response to an internal processor,
10692 * the order of writes has to be such that this field is written last.
10693 */
10694 uint8_t valid;
10695 } hwrm_func_getfid_output_t, *phwrm_func_getfid_output_t;
10696
10697 /**********************
10698 * hwrm_func_vf_alloc *
10699 **********************/
10700
10701
10702 /* hwrm_func_vf_alloc_input (size:192b/24B) */
10703
10704 typedef struct hwrm_func_vf_alloc_input {
10705 /* The HWRM command request type. */
10706 uint16_t req_type;
10707 /*
10708 * The completion ring to send the completion event on. This should
10709 * be the NQ ID returned from the `nq_alloc` HWRM command.
10710 */
10711 uint16_t cmpl_ring;
10712 /*
10713 * The sequence ID is used by the driver for tracking multiple
10714 * commands. This ID is treated as opaque data by the firmware and
10715 * the value is returned in the `hwrm_resp_hdr` upon completion.
10716 */
10717 uint16_t seq_id;
10718 /*
10719 * The target ID of the command:
10720 * * 0x0-0xFFF8 - The function ID
10721 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
10722 * * 0xFFFD - Reserved for user-space HWRM interface
10723 * * 0xFFFF - HWRM
10724 */
10725 uint16_t target_id;
10726 /*
10727 * A physical address pointer pointing to a host buffer that the
10728 * command's response data will be written. This can be either a host
10729 * physical address (HPA) or a guest physical address (GPA) and must
10730 * point to a physically contiguous block of memory.
10731 */
10732 uint64_t resp_addr;
10733 uint32_t enables;
10734 /*
10735 * This bit must be '1' for the first_vf_id field to be
10736 * configured.
10737 */
10738 #define HWRM_FUNC_VF_ALLOC_INPUT_ENABLES_FIRST_VF_ID UINT32_C(0x1)
10739 /*
10740 * This value is used to identify a Virtual Function (VF).
10741 * The scope of VF ID is local within a PF.
10742 */
10743 uint16_t first_vf_id;
10744 /* The number of virtual functions requested. */
10745 uint16_t num_vfs;
10746 } hwrm_func_vf_alloc_input_t, *phwrm_func_vf_alloc_input_t;
10747
10748 /* hwrm_func_vf_alloc_output (size:128b/16B) */
10749
10750 typedef struct hwrm_func_vf_alloc_output {
10751 /* The specific error status for the command. */
10752 uint16_t error_code;
10753 /* The HWRM command request type. */
10754 uint16_t req_type;
10755 /* The sequence ID from the original command. */
10756 uint16_t seq_id;
10757 /* The length of the response data in number of bytes. */
10758 uint16_t resp_len;
10759 /* The ID of the first VF allocated. */
10760 uint16_t first_vf_id;
10761 uint8_t unused_0[5];
10762 /*
10763 * This field is used in Output records to indicate that the output
10764 * is completely written to RAM. This field should be read as '1'
10765 * to indicate that the output has been completely written.
10766 * When writing a command completion or response to an internal processor,
10767 * the order of writes has to be such that this field is written last.
10768 */
10769 uint8_t valid;
10770 } hwrm_func_vf_alloc_output_t, *phwrm_func_vf_alloc_output_t;
10771
10772 /*********************
10773 * hwrm_func_vf_free *
10774 *********************/
10775
10776
10777 /* hwrm_func_vf_free_input (size:192b/24B) */
10778
10779 typedef struct hwrm_func_vf_free_input {
10780 /* The HWRM command request type. */
10781 uint16_t req_type;
10782 /*
10783 * The completion ring to send the completion event on. This should
10784 * be the NQ ID returned from the `nq_alloc` HWRM command.
10785 */
10786 uint16_t cmpl_ring;
10787 /*
10788 * The sequence ID is used by the driver for tracking multiple
10789 * commands. This ID is treated as opaque data by the firmware and
10790 * the value is returned in the `hwrm_resp_hdr` upon completion.
10791 */
10792 uint16_t seq_id;
10793 /*
10794 * The target ID of the command:
10795 * * 0x0-0xFFF8 - The function ID
10796 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
10797 * * 0xFFFD - Reserved for user-space HWRM interface
10798 * * 0xFFFF - HWRM
10799 */
10800 uint16_t target_id;
10801 /*
10802 * A physical address pointer pointing to a host buffer that the
10803 * command's response data will be written. This can be either a host
10804 * physical address (HPA) or a guest physical address (GPA) and must
10805 * point to a physically contiguous block of memory.
10806 */
10807 uint64_t resp_addr;
10808 uint32_t enables;
10809 /*
10810 * This bit must be '1' for the first_vf_id field to be
10811 * configured.
10812 */
10813 #define HWRM_FUNC_VF_FREE_INPUT_ENABLES_FIRST_VF_ID UINT32_C(0x1)
10814 /*
10815 * This value is used to identify a Virtual Function (VF).
10816 * The scope of VF ID is local within a PF.
10817 */
10818 uint16_t first_vf_id;
10819 /*
10820 * The number of virtual functions requested.
10821 * 0xFFFF - Cleanup all children of this PF.
10822 */
10823 uint16_t num_vfs;
10824 } hwrm_func_vf_free_input_t, *phwrm_func_vf_free_input_t;
10825
10826 /* hwrm_func_vf_free_output (size:128b/16B) */
10827
10828 typedef struct hwrm_func_vf_free_output {
10829 /* The specific error status for the command. */
10830 uint16_t error_code;
10831 /* The HWRM command request type. */
10832 uint16_t req_type;
10833 /* The sequence ID from the original command. */
10834 uint16_t seq_id;
10835 /* The length of the response data in number of bytes. */
10836 uint16_t resp_len;
10837 uint8_t unused_0[7];
10838 /*
10839 * This field is used in Output records to indicate that the output
10840 * is completely written to RAM. This field should be read as '1'
10841 * to indicate that the output has been completely written.
10842 * When writing a command completion or response to an internal processor,
10843 * the order of writes has to be such that this field is written last.
10844 */
10845 uint8_t valid;
10846 } hwrm_func_vf_free_output_t, *phwrm_func_vf_free_output_t;
10847
10848 /********************
10849 * hwrm_func_vf_cfg *
10850 ********************/
10851
10852
10853 /* hwrm_func_vf_cfg_input (size:448b/56B) */
10854
10855 typedef struct hwrm_func_vf_cfg_input {
10856 /* The HWRM command request type. */
10857 uint16_t req_type;
10858 /*
10859 * The completion ring to send the completion event on. This should
10860 * be the NQ ID returned from the `nq_alloc` HWRM command.
10861 */
10862 uint16_t cmpl_ring;
10863 /*
10864 * The sequence ID is used by the driver for tracking multiple
10865 * commands. This ID is treated as opaque data by the firmware and
10866 * the value is returned in the `hwrm_resp_hdr` upon completion.
10867 */
10868 uint16_t seq_id;
10869 /*
10870 * The target ID of the command:
10871 * * 0x0-0xFFF8 - The function ID
10872 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
10873 * * 0xFFFD - Reserved for user-space HWRM interface
10874 * * 0xFFFF - HWRM
10875 */
10876 uint16_t target_id;
10877 /*
10878 * A physical address pointer pointing to a host buffer that the
10879 * command's response data will be written. This can be either a host
10880 * physical address (HPA) or a guest physical address (GPA) and must
10881 * point to a physically contiguous block of memory.
10882 */
10883 uint64_t resp_addr;
10884 uint32_t enables;
10885 /*
10886 * This bit must be '1' for the mtu field to be
10887 * configured.
10888 */
10889 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_MTU UINT32_C(0x1)
10890 /*
10891 * This bit must be '1' for the guest_vlan field to be
10892 * configured.
10893 */
10894 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_GUEST_VLAN UINT32_C(0x2)
10895 /*
10896 * This bit must be '1' for the async_event_cr field to be
10897 * configured.
10898 */
10899 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_ASYNC_EVENT_CR UINT32_C(0x4)
10900 /*
10901 * This bit must be '1' for the dflt_mac_addr field to be
10902 * configured.
10903 */
10904 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_DFLT_MAC_ADDR UINT32_C(0x8)
10905 /*
10906 * This bit must be '1' for the num_rsscos_ctxs field to be
10907 * configured.
10908 */
10909 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS UINT32_C(0x10)
10910 /*
10911 * This bit must be '1' for the num_cmpl_rings field to be
10912 * configured.
10913 */
10914 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_CMPL_RINGS UINT32_C(0x20)
10915 /*
10916 * This bit must be '1' for the num_tx_rings field to be
10917 * configured.
10918 */
10919 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_TX_RINGS UINT32_C(0x40)
10920 /*
10921 * This bit must be '1' for the num_rx_rings field to be
10922 * configured.
10923 */
10924 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_RX_RINGS UINT32_C(0x80)
10925 /*
10926 * This bit must be '1' for the num_l2_ctxs field to be
10927 * configured.
10928 */
10929 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_L2_CTXS UINT32_C(0x100)
10930 /*
10931 * This bit must be '1' for the num_vnics field to be
10932 * configured.
10933 */
10934 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_VNICS UINT32_C(0x200)
10935 /*
10936 * This bit must be '1' for the num_stat_ctxs field to be
10937 * configured.
10938 */
10939 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_STAT_CTXS UINT32_C(0x400)
10940 /*
10941 * This bit must be '1' for the num_hw_ring_grps field to be
10942 * configured.
10943 */
10944 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS UINT32_C(0x800)
10945 /*
10946 * The maximum transmission unit requested on the function.
10947 * The HWRM should make sure that the mtu of
10948 * the function does not exceed the mtu of the physical
10949 * port that this function is associated with.
10950 *
10951 * In addition to requesting mtu per function, it is
10952 * possible to configure mtu per transmit ring.
10953 * By default, the mtu of each transmit ring associated
10954 * with a function is equal to the mtu of the function.
10955 * The HWRM should make sure that the mtu of each transmit
10956 * ring that is assigned to a function has a valid mtu.
10957 */
10958 uint16_t mtu;
10959 /*
10960 * The guest VLAN for the function being configured.
10961 * This field's format is same as 802.1Q Tag's
10962 * Tag Control Information (TCI) format that includes both
10963 * Priority Code Point (PCP) and VLAN Identifier (VID).
10964 */
10965 uint16_t guest_vlan;
10966 /*
10967 * ID of the target completion ring for receiving asynchronous
10968 * event completions. If this field is not valid, then the
10969 * HWRM shall use the default completion ring of the function
10970 * that is being configured as the target completion ring for
10971 * providing any asynchronous event completions for that
10972 * function.
10973 * If this field is valid, then the HWRM shall use the
10974 * completion ring identified by this ID as the target
10975 * completion ring for providing any asynchronous event
10976 * completions for the function that is being configured.
10977 */
10978 uint16_t async_event_cr;
10979 /*
10980 * This value is the current MAC address requested by the VF
10981 * driver to be configured on this VF. A value of
10982 * 00-00-00-00-00-00 indicates no MAC address configuration
10983 * is requested by the VF driver.
10984 * The parent PF driver may reject or overwrite this
10985 * MAC address.
10986 */
10987 uint8_t dflt_mac_addr[6];
10988 uint32_t flags;
10989 /*
10990 * This bit requests that the firmware test to see if all the assets
10991 * requested in this command (i.e. number of TX rings) are available.
10992 * The firmware will return an error if the requested assets are
10993 * not available. The firwmare will NOT reserve the assets if they
10994 * are available.
10995 */
10996 #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_TX_ASSETS_TEST UINT32_C(0x1)
10997 /*
10998 * This bit requests that the firmware test to see if all the assets
10999 * requested in this command (i.e. number of RX rings) are available.
11000 * The firmware will return an error if the requested assets are
11001 * not available. The firwmare will NOT reserve the assets if they
11002 * are available.
11003 */
11004 #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RX_ASSETS_TEST UINT32_C(0x2)
11005 /*
11006 * This bit requests that the firmware test to see if all the assets
11007 * requested in this command (i.e. number of CMPL rings) are available.
11008 * The firmware will return an error if the requested assets are
11009 * not available. The firwmare will NOT reserve the assets if they
11010 * are available.
11011 */
11012 #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_CMPL_ASSETS_TEST UINT32_C(0x4)
11013 /*
11014 * This bit requests that the firmware test to see if all the assets
11015 * requested in this command (i.e. number of RSS ctx) are available.
11016 * The firmware will return an error if the requested assets are
11017 * not available. The firwmare will NOT reserve the assets if they
11018 * are available.
11019 */
11020 #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RSSCOS_CTX_ASSETS_TEST UINT32_C(0x8)
11021 /*
11022 * This bit requests that the firmware test to see if all the assets
11023 * requested in this command (i.e. number of ring groups) are available.
11024 * The firmware will return an error if the requested assets are
11025 * not available. The firwmare will NOT reserve the assets if they
11026 * are available.
11027 */
11028 #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RING_GRP_ASSETS_TEST UINT32_C(0x10)
11029 /*
11030 * This bit requests that the firmware test to see if all the assets
11031 * requested in this command (i.e. number of stat ctx) are available.
11032 * The firmware will return an error if the requested assets are
11033 * not available. The firwmare will NOT reserve the assets if they
11034 * are available.
11035 */
11036 #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_STAT_CTX_ASSETS_TEST UINT32_C(0x20)
11037 /*
11038 * This bit requests that the firmware test to see if all the assets
11039 * requested in this command (i.e. number of VNICs) are available.
11040 * The firmware will return an error if the requested assets are
11041 * not available. The firwmare will NOT reserve the assets if they
11042 * are available.
11043 */
11044 #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_VNIC_ASSETS_TEST UINT32_C(0x40)
11045 /*
11046 * This bit requests that the firmware test to see if all the assets
11047 * requested in this command (i.e. number of L2 ctx) are available.
11048 * The firmware will return an error if the requested assets are
11049 * not available. The firwmare will NOT reserve the assets if they
11050 * are available.
11051 */
11052 #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_L2_CTX_ASSETS_TEST UINT32_C(0x80)
11053 /*
11054 * If this bit is set to 1, the VF driver is requesting FW to enable
11055 * PPP TX PUSH feature on all the TX rings specified in the
11056 * num_tx_rings field. By default, the PPP TX push feature is
11057 * disabled for all the TX rings of the VF. This flag is ignored if
11058 * the num_tx_rings field is not specified or the VF doesn't support
11059 * PPP tx push feature.
11060 */
11061 #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_PPP_PUSH_MODE_ENABLE UINT32_C(0x100)
11062 /*
11063 * If this bit is set to 1, the VF driver is requesting FW to disable
11064 * PPP TX PUSH feature on all the TX rings of the VF. This flag is
11065 * ignored if the VF doesn't support PPP tx push feature.
11066 */
11067 #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_PPP_PUSH_MODE_DISABLE UINT32_C(0x200)
11068 /* The number of RSS/COS contexts requested for the VF. */
11069 uint16_t num_rsscos_ctxs;
11070 /* The number of completion rings requested for the VF. */
11071 uint16_t num_cmpl_rings;
11072 /* The number of transmit rings requested for the VF. */
11073 uint16_t num_tx_rings;
11074 /* The number of receive rings requested for the VF. */
11075 uint16_t num_rx_rings;
11076 /* The number of L2 contexts requested for the VF. */
11077 uint16_t num_l2_ctxs;
11078 /* The number of vnics requested for the VF. */
11079 uint16_t num_vnics;
11080 /* The number of statistic contexts requested for the VF. */
11081 uint16_t num_stat_ctxs;
11082 /* The number of HW ring groups requested for the VF. */
11083 uint16_t num_hw_ring_grps;
11084 uint8_t unused_0[4];
11085 } hwrm_func_vf_cfg_input_t, *phwrm_func_vf_cfg_input_t;
11086
11087 /* hwrm_func_vf_cfg_output (size:128b/16B) */
11088
11089 typedef struct hwrm_func_vf_cfg_output {
11090 /* The specific error status for the command. */
11091 uint16_t error_code;
11092 /* The HWRM command request type. */
11093 uint16_t req_type;
11094 /* The sequence ID from the original command. */
11095 uint16_t seq_id;
11096 /* The length of the response data in number of bytes. */
11097 uint16_t resp_len;
11098 uint8_t unused_0[7];
11099 /*
11100 * This field is used in Output records to indicate that the output
11101 * is completely written to RAM. This field should be read as '1'
11102 * to indicate that the output has been completely written.
11103 * When writing a command completion or response to an internal processor,
11104 * the order of writes has to be such that this field is written last.
11105 */
11106 uint8_t valid;
11107 } hwrm_func_vf_cfg_output_t, *phwrm_func_vf_cfg_output_t;
11108
11109 /*******************
11110 * hwrm_func_qcaps *
11111 *******************/
11112
11113
11114 /* hwrm_func_qcaps_input (size:192b/24B) */
11115
11116 typedef struct hwrm_func_qcaps_input {
11117 /* The HWRM command request type. */
11118 uint16_t req_type;
11119 /*
11120 * The completion ring to send the completion event on. This should
11121 * be the NQ ID returned from the `nq_alloc` HWRM command.
11122 */
11123 uint16_t cmpl_ring;
11124 /*
11125 * The sequence ID is used by the driver for tracking multiple
11126 * commands. This ID is treated as opaque data by the firmware and
11127 * the value is returned in the `hwrm_resp_hdr` upon completion.
11128 */
11129 uint16_t seq_id;
11130 /*
11131 * The target ID of the command:
11132 * * 0x0-0xFFF8 - The function ID
11133 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
11134 * * 0xFFFD - Reserved for user-space HWRM interface
11135 * * 0xFFFF - HWRM
11136 */
11137 uint16_t target_id;
11138 /*
11139 * A physical address pointer pointing to a host buffer that the
11140 * command's response data will be written. This can be either a host
11141 * physical address (HPA) or a guest physical address (GPA) and must
11142 * point to a physically contiguous block of memory.
11143 */
11144 uint64_t resp_addr;
11145 /*
11146 * Function ID of the function that is being queried.
11147 * 0xFF... (All Fs) if the query is for the requesting
11148 * function.
11149 * 0xFFFE (REQUESTING_PARENT_FID) This is a special FID
11150 * to be used by a trusted VF to query its parent PF.
11151 */
11152 uint16_t fid;
11153 uint8_t unused_0[6];
11154 } hwrm_func_qcaps_input_t, *phwrm_func_qcaps_input_t;
11155
11156 /* hwrm_func_qcaps_output (size:704b/88B) */
11157
11158 typedef struct hwrm_func_qcaps_output {
11159 /* The specific error status for the command. */
11160 uint16_t error_code;
11161 /* The HWRM command request type. */
11162 uint16_t req_type;
11163 /* The sequence ID from the original command. */
11164 uint16_t seq_id;
11165 /* The length of the response data in number of bytes. */
11166 uint16_t resp_len;
11167 /*
11168 * FID value. This value is used to identify operations on the PCI
11169 * bus as belonging to a particular PCI function.
11170 */
11171 uint16_t fid;
11172 /*
11173 * Port ID of port that this function is associated with.
11174 * Valid only for the PF.
11175 * 0xFF... (All Fs) if this function is not associated with
11176 * any port.
11177 * 0xFF... (All Fs) if this function is called from a VF.
11178 */
11179 uint16_t port_id;
11180 uint32_t flags;
11181 /* If 1, then Push mode is supported on this function. */
11182 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PUSH_MODE_SUPPORTED UINT32_C(0x1)
11183 /*
11184 * If 1, then the global MSI-X auto-masking is enabled for the
11185 * device.
11186 */
11187 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GLOBAL_MSIX_AUTOMASKING UINT32_C(0x2)
11188 /*
11189 * If 1, then the Precision Time Protocol (PTP) processing
11190 * is supported on this function.
11191 * The HWRM should enable PTP on only a single Physical
11192 * Function (PF) per port.
11193 */
11194 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED UINT32_C(0x4)
11195 /*
11196 * If 1, then RDMA over Converged Ethernet (RoCE) v1
11197 * is supported on this function.
11198 */
11199 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V1_SUPPORTED UINT32_C(0x8)
11200 /*
11201 * If 1, then RDMA over Converged Ethernet (RoCE) v2
11202 * is supported on this function.
11203 */
11204 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V2_SUPPORTED UINT32_C(0x10)
11205 /*
11206 * If 1, then control and configuration of WoL magic packet
11207 * are supported on this function.
11208 */
11209 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_MAGICPKT_SUPPORTED UINT32_C(0x20)
11210 /*
11211 * If 1, then control and configuration of bitmap pattern
11212 * packet are supported on this function.
11213 */
11214 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_BMP_SUPPORTED UINT32_C(0x40)
11215 /*
11216 * If set to 1, then the control and configuration of rate limit
11217 * of an allocated TX ring on the queried function is supported.
11218 */
11219 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_RING_RL_SUPPORTED UINT32_C(0x80)
11220 /*
11221 * If 1, then control and configuration of minimum and
11222 * maximum bandwidths are supported on the queried function.
11223 */
11224 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_BW_CFG_SUPPORTED UINT32_C(0x100)
11225 /*
11226 * If the query is for a VF, then this flag shall be ignored.
11227 * If this query is for a PF and this flag is set to 1,
11228 * then the PF has the capability to set the rate limits
11229 * on the TX rings of its children VFs.
11230 * If this query is for a PF and this flag is set to 0, then
11231 * the PF does not have the capability to set the rate limits
11232 * on the TX rings of its children VFs.
11233 */
11234 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_TX_RING_RL_SUPPORTED UINT32_C(0x200)
11235 /*
11236 * If the query is for a VF, then this flag shall be ignored.
11237 * If this query is for a PF and this flag is set to 1,
11238 * then the PF has the capability to set the minimum and/or
11239 * maximum bandwidths for its children VFs.
11240 * If this query is for a PF and this flag is set to 0, then
11241 * the PF does not have the capability to set the minimum or
11242 * maximum bandwidths for its children VFs.
11243 */
11244 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_BW_CFG_SUPPORTED UINT32_C(0x400)
11245 /*
11246 * Standard TX Ring mode is used for the allocation of TX ring
11247 * and underlying scheduling resources that allow bandwidth
11248 * reservation and limit settings on the queried function.
11249 * If set to 1, then standard TX ring mode is supported
11250 * on the queried function.
11251 * If set to 0, then standard TX ring mode is not available
11252 * on the queried function.
11253 */
11254 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_STD_TX_RING_MODE_SUPPORTED UINT32_C(0x800)
11255 /*
11256 * If the query is for a VF, then this flag shall be ignored,
11257 * If this query is for a PF and this flag is set to 1,
11258 * then the PF has the capability to detect GENEVE tunnel
11259 * flags.
11260 */
11261 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GENEVE_TUN_FLAGS_SUPPORTED UINT32_C(0x1000)
11262 /*
11263 * If the query is for a VF, then this flag shall be ignored,
11264 * If this query is for a PF and this flag is set to 1,
11265 * then the PF has the capability to detect NVGRE tunnel
11266 * flags.
11267 */
11268 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_NVGRE_TUN_FLAGS_SUPPORTED UINT32_C(0x2000)
11269 /*
11270 * If the query is for a VF, then this flag shall be ignored,
11271 * If this query is for a PF and this flag is set to 1,
11272 * then the PF has the capability to detect GRE tunnel
11273 * flags.
11274 */
11275 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GRE_TUN_FLAGS_SUPPORTED UINT32_C(0x4000)
11276 /*
11277 * If the query is for a VF, then this flag shall be ignored,
11278 * If this query is for a PF and this flag is set to 1,
11279 * then the PF has the capability to detect MPLS tunnel
11280 * flags.
11281 */
11282 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_MPLS_TUN_FLAGS_SUPPORTED UINT32_C(0x8000)
11283 /*
11284 * If the query is for a VF, then this flag shall be ignored,
11285 * If this query is for a PF and this flag is set to 1,
11286 * then the PF has the capability to support pcie stats.
11287 */
11288 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PCIE_STATS_SUPPORTED UINT32_C(0x10000)
11289 /*
11290 * If the query is for a VF, then this flag shall be ignored,
11291 * If this query is for a PF and this flag is set to 1,
11292 * then the PF has the capability to adopt the VF's belonging
11293 * to another PF.
11294 */
11295 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ADOPTED_PF_SUPPORTED UINT32_C(0x20000)
11296 /*
11297 * If the query is for a VF, then this flag shall be ignored,
11298 * If this query is for a PF and this flag is set to 1,
11299 * then the PF has the administrative privilege to configure another PF
11300 */
11301 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ADMIN_PF_SUPPORTED UINT32_C(0x40000)
11302 /*
11303 * If the query is for a VF, then this flag shall be ignored.
11304 * If this query is for a PF and this flag is set to 1, then
11305 * the PF will know that the firmware has the capability to track
11306 * the virtual link status.
11307 */
11308 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_LINK_ADMIN_STATUS_SUPPORTED UINT32_C(0x80000)
11309 /*
11310 * If 1, then this function supports the push mode that uses
11311 * write combine buffers and the long inline tx buffer descriptor.
11312 */
11313 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WCB_PUSH_MODE UINT32_C(0x100000)
11314 /*
11315 * If 1, then FW has capability to allocate TX rings dynamically
11316 * in ring alloc even if PF reserved pool is zero.
11317 * This bit will be used only for PFs.
11318 */
11319 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_DYNAMIC_TX_RING_ALLOC UINT32_C(0x200000)
11320 /*
11321 * When this bit is '1', it indicates that core firmware is
11322 * capable of Hot Reset.
11323 */
11324 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_HOT_RESET_CAPABLE UINT32_C(0x400000)
11325 /*
11326 * This flag will be set to 1 by the FW if FW supports adapter error
11327 * recovery.
11328 */
11329 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ERROR_RECOVERY_CAPABLE UINT32_C(0x800000)
11330 /*
11331 * If the query is for a VF, then this flag shall be ignored.
11332 * If this query is for a PF and this flag is set to 1, then
11333 * the PF has the capability to support extended stats.
11334 */
11335 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_STATS_SUPPORTED UINT32_C(0x1000000)
11336 /*
11337 * If the query is for a VF, then this flag shall be ignored.
11338 * If this query is for a PF and this flag is set to 1, then host
11339 * must initiate reset or reload (or fastboot) the firmware image
11340 * upon detection of device shutdown state.
11341 */
11342 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ERR_RECOVER_RELOAD UINT32_C(0x2000000)
11343 /*
11344 * If the query is for a VF, then this flag (always set to 0) shall
11345 * be ignored. If this query is for a PF and this flag is set to 1,
11346 * host, when registered for the default vnic change async event,
11347 * receives async notification whenever a default vnic state is
11348 * changed for any of child or adopted VFs.
11349 */
11350 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_NOTIFY_VF_DEF_VNIC_CHNG_SUPPORTED UINT32_C(0x4000000)
11351 /* If set to 1, then the vlan acceleration for TX is disabled. */
11352 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VLAN_ACCELERATION_TX_DISABLED UINT32_C(0x8000000)
11353 /*
11354 * When this bit is '1', it indicates that core firmware supports
11355 * DBG_COREDUMP_XXX commands.
11356 */
11357 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_COREDUMP_CMD_SUPPORTED UINT32_C(0x10000000)
11358 /*
11359 * When this bit is '1', it indicates that core firmware supports
11360 * DBG_CRASHDUMP_XXX commands.
11361 */
11362 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_CRASHDUMP_CMD_SUPPORTED UINT32_C(0x20000000)
11363 /*
11364 * If the query is for a VF, then this flag should be ignored.
11365 * If the query is for a PF and this flag is set to 1, then
11366 * the PF has the capability to support retrieval of
11367 * rx_port_stats_ext_pfc_wd statistics (supported by the PFC
11368 * WatchDog feature) via the hwrm_port_qstats_ext_pfc_wd command.
11369 * If this flag is set to 1, only that (supported) command should
11370 * be used for retrieval of PFC related statistics (rather than
11371 * hwrm_port_qstats_ext command, which could previously be used).
11372 */
11373 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PFC_WD_STATS_SUPPORTED UINT32_C(0x40000000)
11374 /*
11375 * When this bit is '1', it indicates that core firmware supports
11376 * DBG_QCAPS command
11377 */
11378 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_DBG_QCAPS_CMD_SUPPORTED UINT32_C(0x80000000)
11379 /*
11380 * This value is current MAC address configured for this
11381 * function. A value of 00-00-00-00-00-00 indicates no
11382 * MAC address is currently configured.
11383 */
11384 uint8_t mac_address[6];
11385 /*
11386 * The maximum number of RSS/COS contexts that can be
11387 * allocated to the function.
11388 */
11389 uint16_t max_rsscos_ctx;
11390 /*
11391 * The maximum number of completion rings that can be
11392 * allocated to the function.
11393 */
11394 uint16_t max_cmpl_rings;
11395 /*
11396 * The maximum number of transmit rings that can be
11397 * allocated to the function.
11398 */
11399 uint16_t max_tx_rings;
11400 /*
11401 * The maximum number of receive rings that can be
11402 * allocated to the function.
11403 */
11404 uint16_t max_rx_rings;
11405 /*
11406 * The maximum number of L2 contexts that can be
11407 * allocated to the function.
11408 */
11409 uint16_t max_l2_ctxs;
11410 /*
11411 * The maximum number of VNICs that can be
11412 * allocated to the function.
11413 */
11414 uint16_t max_vnics;
11415 /*
11416 * The identifier for the first VF enabled on a PF. This
11417 * is valid only on the PF with SR-IOV enabled.
11418 * 0xFF... (All Fs) if this command is called on a PF with
11419 * SR-IOV disabled or on a VF.
11420 */
11421 uint16_t first_vf_id;
11422 /*
11423 * The maximum number of VFs that can be
11424 * allocated to the function. This is valid only on the
11425 * PF with SR-IOV enabled. 0xFF... (All Fs) if this
11426 * command is called on a PF with SR-IOV disabled or
11427 * on a VF.
11428 */
11429 uint16_t max_vfs;
11430 /*
11431 * The maximum number of statistic contexts that can be
11432 * allocated to the function.
11433 */
11434 uint16_t max_stat_ctx;
11435 /*
11436 * The maximum number of Encapsulation records that can be
11437 * offloaded by this function.
11438 */
11439 uint32_t max_encap_records;
11440 /*
11441 * The maximum number of decapsulation records that can
11442 * be offloaded by this function.
11443 */
11444 uint32_t max_decap_records;
11445 /*
11446 * The maximum number of Exact Match (EM) flows that can be
11447 * offloaded by this function on the TX side.
11448 */
11449 uint32_t max_tx_em_flows;
11450 /*
11451 * The maximum number of Wildcard Match (WM) flows that can
11452 * be offloaded by this function on the TX side.
11453 */
11454 uint32_t max_tx_wm_flows;
11455 /*
11456 * The maximum number of Exact Match (EM) flows that can be
11457 * offloaded by this function on the RX side.
11458 */
11459 uint32_t max_rx_em_flows;
11460 /*
11461 * The maximum number of Wildcard Match (WM) flows that can
11462 * be offloaded by this function on the RX side.
11463 */
11464 uint32_t max_rx_wm_flows;
11465 /*
11466 * The maximum number of multicast filters that can
11467 * be supported by this function on the RX side.
11468 */
11469 uint32_t max_mcast_filters;
11470 /*
11471 * The maximum value of flow_id that can be supported
11472 * in completion records.
11473 */
11474 uint32_t max_flow_id;
11475 /*
11476 * The maximum number of HW ring groups that can be
11477 * supported on this function.
11478 */
11479 uint32_t max_hw_ring_grps;
11480 /*
11481 * The maximum number of strict priority transmit rings
11482 * that can be allocated to the function.
11483 * This number indicates the maximum number of TX rings
11484 * that can be assigned strict priorities out of the
11485 * maximum number of TX rings that can be allocated
11486 * (max_tx_rings) to the function.
11487 */
11488 uint16_t max_sp_tx_rings;
11489 uint8_t unused_0[2];
11490 uint32_t flags_ext;
11491 /*
11492 * If 1, the device can be configured to set the ECN bits in the
11493 * IP header of received packets if the receive queue length
11494 * exceeds a given threshold.
11495 */
11496 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_ECN_MARK_SUPPORTED UINT32_C(0x1)
11497 /*
11498 * If 1, the device can report the number of received packets
11499 * that it marked as having experienced congestion.
11500 */
11501 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_ECN_STATS_SUPPORTED UINT32_C(0x2)
11502 /*
11503 * If 1, the device can report extended hw statistics (including
11504 * additional tpa statistics).
11505 */
11506 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_EXT_HW_STATS_SUPPORTED UINT32_C(0x4)
11507 /*
11508 * If set to 1, then the core firmware has support to enable/
11509 * disable hot reset support for interface dynamically through
11510 * HWRM_FUNC_CFG.
11511 */
11512 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_HOT_RESET_IF_SUPPORT UINT32_C(0x8)
11513 /* If 1, the proxy mode is supported on this function */
11514 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PROXY_MODE_SUPPORT UINT32_C(0x10)
11515 /*
11516 * If 1, the tx rings source interface override feature is supported
11517 * on this function.
11518 */
11519 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_TX_PROXY_SRC_INTF_OVERRIDE_SUPPORT UINT32_C(0x20)
11520 /*
11521 * If 1, the device supports scheduler queues. SCHQs can be managed
11522 * using RING_SCHQ_ALLOC/CFG/FREE commands.
11523 */
11524 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_SCHQ_SUPPORTED UINT32_C(0x40)
11525 /*
11526 * If set to 1, then this function supports the TX push mode that
11527 * uses ping-pong buffers from the push pages.
11528 */
11529 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PPP_PUSH_MODE_SUPPORTED UINT32_C(0x80)
11530 /*
11531 * If set to 1, then this function doesn't have the privilege to
11532 * configure the EVB mode of the port it uses.
11533 */
11534 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_EVB_MODE_CFG_NOT_SUPPORTED UINT32_C(0x100)
11535 /*
11536 * If set to 1, then the HW and FW support the SoC packet DMA
11537 * datapath between SoC and NIC. This function can act as the
11538 * HWRM communication transport agent on behalf of the SoC SPD
11539 * software module. This capability is only advertised to the
11540 * SoC PFs.
11541 */
11542 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_SOC_SPD_SUPPORTED UINT32_C(0x200)
11543 /*
11544 * If set to 1, then this function supports FW_LIVEPATCH for
11545 * firmware livepatch commands.
11546 */
11547 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_FW_LIVEPATCH_SUPPORTED UINT32_C(0x400)
11548 /*
11549 * When this bit is '1', it indicates that core firmware is
11550 * capable of fast Reset.
11551 */
11552 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_FAST_RESET_CAPABLE UINT32_C(0x800)
11553 /*
11554 * When this bit is '1', it indicates that firmware and hardware
11555 * are capable of updating tx_metadata via hwrm_ring_cfg command.
11556 */
11557 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_TX_METADATA_CFG_CAPABLE UINT32_C(0x1000)
11558 /*
11559 * If set to 1, then the device can report the action
11560 * needed to activate set nvm options.
11561 */
11562 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_NVM_OPTION_ACTION_SUPPORTED UINT32_C(0x2000)
11563 /*
11564 * When this bit is '1', it indicates that the BD metadata feature
11565 * is supported for this function.
11566 */
11567 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_BD_METADATA_SUPPORTED UINT32_C(0x4000)
11568 /*
11569 * When this bit is '1', it indicates that the echo request feature
11570 * is supported for this function. If the driver registers for the
11571 * echo request asynchronous event, then the firmware can send an
11572 * unsolicited echo request to the driver and expect an echo
11573 * response.
11574 */
11575 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_ECHO_REQUEST_SUPPORTED UINT32_C(0x8000)
11576 /*
11577 * When this bit is '1', it indicates that core firmware supports
11578 * NPAR 1.2 on this function.
11579 */
11580 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_NPAR_1_2_SUPPORTED UINT32_C(0x10000)
11581 /* When this bit is '1', it indicates that PTM feature is supported. */
11582 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PTP_PTM_SUPPORTED UINT32_C(0x20000)
11583 /* When this bit is '1', it indicates that PPS feature is supported. */
11584 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PTP_PPS_SUPPORTED UINT32_C(0x40000)
11585 /*
11586 * When this bit is '1', it indicates that VF config. change
11587 * async event is supported on the parent PF if the async.
11588 * event is registered by the PF.
11589 */
11590 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_VF_CFG_ASYNC_FOR_PF_SUPPORTED UINT32_C(0x80000)
11591 /*
11592 * When this bit is '1', the NIC supports configuration of
11593 * partition_min_bw and partition_max_bw.
11594 */
11595 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PARTITION_BW_SUPPORTED UINT32_C(0x100000)
11596 /*
11597 * When this bit is '1', the FW supports configuration of
11598 * PCP and TPID values of the default VLAN.
11599 */
11600 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_DFLT_VLAN_TPID_PCP_SUPPORTED UINT32_C(0x200000)
11601 /* When this bit is '1', it indicates that HW and FW support KTLS. */
11602 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_KTLS_SUPPORTED UINT32_C(0x400000)
11603 /* The maximum number of SCHQs supported by this device. */
11604 uint8_t max_schqs;
11605 uint8_t mpc_chnls_cap;
11606 /*
11607 * When this bit is '1', it indicates that HW and firmware
11608 * supports the use of a MPC channel with destination set
11609 * to the TX crypto engine block.
11610 */
11611 #define HWRM_FUNC_QCAPS_OUTPUT_MPC_CHNLS_CAP_TCE UINT32_C(0x1)
11612 /*
11613 * When this bit is '1', it indicates that HW and firmware
11614 * supports the use of a MPC channel with destination set
11615 * to the RX crypto engine block.
11616 */
11617 #define HWRM_FUNC_QCAPS_OUTPUT_MPC_CHNLS_CAP_RCE UINT32_C(0x2)
11618 /*
11619 * When this bit is '1', it indicates that HW and firmware
11620 * supports the use of a MPC channel with destination set
11621 * to the TX configurable flow processing block.
11622 */
11623 #define HWRM_FUNC_QCAPS_OUTPUT_MPC_CHNLS_CAP_TE_CFA UINT32_C(0x4)
11624 /*
11625 * When this bit is '1', it indicates that HW and firmware
11626 * supports the use of a MPC channel with destination set
11627 * to the RX configurable flow processing block.
11628 */
11629 #define HWRM_FUNC_QCAPS_OUTPUT_MPC_CHNLS_CAP_RE_CFA UINT32_C(0x8)
11630 /*
11631 * When this bit is '1', it indicates that HW and firmware
11632 * supports the use of a MPC channel with destination set
11633 * to the primate processor block.
11634 */
11635 #define HWRM_FUNC_QCAPS_OUTPUT_MPC_CHNLS_CAP_PRIMATE UINT32_C(0x10)
11636 uint8_t unused_1;
11637 /*
11638 * This field is used in Output records to indicate that the output
11639 * is completely written to RAM. This field should be read as '1'
11640 * to indicate that the output has been completely written.
11641 * When writing a command completion or response to an internal processor,
11642 * the order of writes has to be such that this field is written last.
11643 */
11644 uint8_t valid;
11645 } hwrm_func_qcaps_output_t, *phwrm_func_qcaps_output_t;
11646
11647 /******************
11648 * hwrm_func_qcfg *
11649 ******************/
11650
11651
11652 /* hwrm_func_qcfg_input (size:192b/24B) */
11653
11654 typedef struct hwrm_func_qcfg_input {
11655 /* The HWRM command request type. */
11656 uint16_t req_type;
11657 /*
11658 * The completion ring to send the completion event on. This should
11659 * be the NQ ID returned from the `nq_alloc` HWRM command.
11660 */
11661 uint16_t cmpl_ring;
11662 /*
11663 * The sequence ID is used by the driver for tracking multiple
11664 * commands. This ID is treated as opaque data by the firmware and
11665 * the value is returned in the `hwrm_resp_hdr` upon completion.
11666 */
11667 uint16_t seq_id;
11668 /*
11669 * The target ID of the command:
11670 * * 0x0-0xFFF8 - The function ID
11671 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
11672 * * 0xFFFD - Reserved for user-space HWRM interface
11673 * * 0xFFFF - HWRM
11674 */
11675 uint16_t target_id;
11676 /*
11677 * A physical address pointer pointing to a host buffer that the
11678 * command's response data will be written. This can be either a host
11679 * physical address (HPA) or a guest physical address (GPA) and must
11680 * point to a physically contiguous block of memory.
11681 */
11682 uint64_t resp_addr;
11683 /*
11684 * Function ID of the function that is being queried.
11685 * 0xFF... (All Fs) if the query is for the requesting
11686 * function.
11687 * 0xFFFE (REQUESTING_PARENT_FID) This is a special FID
11688 * to be used by a trusted VF to query its parent PF.
11689 */
11690 uint16_t fid;
11691 uint8_t unused_0[6];
11692 } hwrm_func_qcfg_input_t, *phwrm_func_qcfg_input_t;
11693
11694 /* hwrm_func_qcfg_output (size:832b/104B) */
11695
11696 typedef struct hwrm_func_qcfg_output {
11697 /* The specific error status for the command. */
11698 uint16_t error_code;
11699 /* The HWRM command request type. */
11700 uint16_t req_type;
11701 /* The sequence ID from the original command. */
11702 uint16_t seq_id;
11703 /* The length of the response data in number of bytes. */
11704 uint16_t resp_len;
11705 /*
11706 * FID value. This value is used to identify operations on the PCI
11707 * bus as belonging to a particular PCI function.
11708 */
11709 uint16_t fid;
11710 /*
11711 * Port ID of port that this function is associated with.
11712 * 0xFF... (All Fs) if this function is not associated with
11713 * any port.
11714 */
11715 uint16_t port_id;
11716 /*
11717 * This value is the current VLAN setting for this
11718 * function. The value of 0 for this field indicates
11719 * no priority tagging or VLAN is used.
11720 * This field's format is same as 802.1Q Tag's
11721 * Tag Control Information (TCI) format that includes both
11722 * Priority Code Point (PCP) and VLAN Identifier (VID).
11723 */
11724 uint16_t vlan;
11725 uint16_t flags;
11726 /*
11727 * If 1, then magic packet based Out-Of-Box WoL is enabled on
11728 * the port associated with this function.
11729 */
11730 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_MAGICPKT_ENABLED UINT32_C(0x1)
11731 /*
11732 * If 1, then bitmap pattern based Out-Of-Box WoL packet is enabled
11733 * on the port associated with this function.
11734 */
11735 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_BMP_ENABLED UINT32_C(0x2)
11736 /*
11737 * If set to 1, then FW based DCBX agent is enabled and running on
11738 * the port associated with this function.
11739 * If set to 0, then DCBX agent is not running in the firmware.
11740 */
11741 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_DCBX_AGENT_ENABLED UINT32_C(0x4)
11742 /*
11743 * Standard TX Ring mode is used for the allocation of TX ring
11744 * and underlying scheduling resources that allow bandwidth
11745 * reservation and limit settings on the queried function.
11746 * If set to 1, then standard TX ring mode is enabled
11747 * on the queried function.
11748 * If set to 0, then the standard TX ring mode is disabled
11749 * on the queried function. In this extended TX ring resource
11750 * mode, the minimum and maximum bandwidth settings are not
11751 * supported to allow the allocation of TX rings to span multiple
11752 * scheduler nodes.
11753 */
11754 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_STD_TX_RING_MODE_ENABLED UINT32_C(0x8)
11755 /*
11756 * If set to 1 then FW based LLDP agent is enabled and running on
11757 * the port associated with this function.
11758 * If set to 0 then the LLDP agent is not running in the firmware.
11759 */
11760 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_LLDP_AGENT_ENABLED UINT32_C(0x10)
11761 /*
11762 * If set to 1, then multi-host mode is active for this function.
11763 * The NIC is attached to two or more independent host systems
11764 * through two or more PCIe endpoints.
11765 * If set to 0, then multi-host mode is inactive for this function
11766 * or not applicable for this device.
11767 */
11768 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_HOST UINT32_C(0x20)
11769 /*
11770 * If the function that is being queried is a PF, then the HWRM shall
11771 * set this field to 0 and the HWRM client shall ignore this field.
11772 * If the function that is being queried is a VF, then the HWRM shall
11773 * set this field to 1 if the queried VF is trusted, otherwise the HWRM
11774 * shall set this field to 0.
11775 */
11776 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_TRUSTED_VF UINT32_C(0x40)
11777 /*
11778 * If set to 1, then secure mode is enabled for this function or device.
11779 * If set to 0, then secure mode is disabled (or normal mode) for this
11780 * function or device.
11781 */
11782 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_SECURE_MODE_ENABLED UINT32_C(0x80)
11783 /*
11784 * If set to 1, then this PF is enabled with a preboot driver that
11785 * requires access to the legacy L2 ring model and legacy 32b
11786 * doorbells. If set to 0, then this PF is not allowed to use
11787 * the legacy L2 rings. This feature is not allowed on VFs and
11788 * is only relevant for devices that require a context backing
11789 * store.
11790 */
11791 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_PREBOOT_LEGACY_L2_RINGS UINT32_C(0x100)
11792 /*
11793 * If set to 1, then the firmware and all currently registered driver
11794 * instances support hot reset. The hot reset support will be updated
11795 * dynamically based on the driver interface advertisement.
11796 * If set to 0, then the adapter is not currently able to initiate
11797 * hot reset.
11798 */
11799 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_HOT_RESET_ALLOWED UINT32_C(0x200)
11800 /*
11801 * If set to 1, then the PPP tx push mode is enabled for all the
11802 * reserved TX rings of this function. If set to 0, then PPP tx push
11803 * mode is disabled for all the reserved TX rings of this function.
11804 */
11805 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_PPP_PUSH_MODE_ENABLED UINT32_C(0x400)
11806 /*
11807 * If set to 1, then the firmware will notify driver using async
11808 * event when a ring is disabled due to a Hardware error.
11809 */
11810 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_RING_MONITOR_ENABLED UINT32_C(0x800)
11811 /*
11812 * If set to 1, then the firmware and all currently registered driver
11813 * instances support fast reset. The fast reset support will be
11814 * updated dynamically based on the driver interface advertisement.
11815 * If set to 0, then the adapter is not currently able to initiate
11816 * fast reset.
11817 */
11818 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FAST_RESET_ALLOWED UINT32_C(0x1000)
11819 /*
11820 * If set to 1, then multi-root mode is active for this function.
11821 * The NIC is attached to a single host with a single operating
11822 * system, but through two or more PCIe endpoints.
11823 * If set to 0, then multi-root mode is inactive for this function
11824 * or not applicable for this device.
11825 */
11826 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_ROOT UINT32_C(0x2000)
11827 /*
11828 * This value is current MAC address configured for this
11829 * function. A value of 00-00-00-00-00-00 indicates no
11830 * MAC address is currently configured.
11831 */
11832 uint8_t mac_address[6];
11833 /*
11834 * This value is current PCI ID of this
11835 * function. If ARI is enabled, then it is
11836 * Bus Number (8b):Function Number(8b). Otherwise, it is
11837 * Bus Number (8b):Device Number (4b):Function Number(4b).
11838 * If multi-host mode is active, the 4 lsb will indicate
11839 * the PF index for this function.
11840 */
11841 uint16_t pci_id;
11842 /*
11843 * The number of RSS/COS contexts currently
11844 * allocated to the function.
11845 */
11846 uint16_t alloc_rsscos_ctx;
11847 /*
11848 * The number of completion rings currently allocated to
11849 * the function. This does not include the rings allocated
11850 * to any children functions if any.
11851 */
11852 uint16_t alloc_cmpl_rings;
11853 /*
11854 * The number of transmit rings currently allocated to
11855 * the function. This does not include the rings allocated
11856 * to any children functions if any.
11857 */
11858 uint16_t alloc_tx_rings;
11859 /*
11860 * The number of receive rings currently allocated to
11861 * the function. This does not include the rings allocated
11862 * to any children functions if any.
11863 */
11864 uint16_t alloc_rx_rings;
11865 /* The allocated number of L2 contexts to the function. */
11866 uint16_t alloc_l2_ctx;
11867 /* The allocated number of vnics to the function. */
11868 uint16_t alloc_vnics;
11869 /*
11870 * The maximum transmission unit of the function.
11871 * If the reported mtu value is non-zero then it will used for the
11872 * rings allocated on this function. otherwise the default
11873 * value is used if ring MTU is not specified.
11874 */
11875 uint16_t mtu;
11876 /*
11877 * The maximum receive unit of the function.
11878 * For vnics allocated on this function, this default
11879 * value is used if vnic MRU is not specified.
11880 */
11881 uint16_t mru;
11882 /* The statistics context assigned to a function. */
11883 uint16_t stat_ctx_id;
11884 /*
11885 * The HWRM shall return Unknown value for this field
11886 * when this command is used to query VF's configuration.
11887 */
11888 uint8_t port_partition_type;
11889 /* Single physical function */
11890 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_SPF UINT32_C(0x0)
11891 /* Multiple physical functions */
11892 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_MPFS UINT32_C(0x1)
11893 /* Network Partitioning 1.0 */
11894 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_0 UINT32_C(0x2)
11895 /* Network Partitioning 1.5 */
11896 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_5 UINT32_C(0x3)
11897 /* Network Partitioning 2.0 */
11898 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR2_0 UINT32_C(0x4)
11899 /* Network Partitioning 1.2 */
11900 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_2 UINT32_C(0x5)
11901 /* Unknown */
11902 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN UINT32_C(0xff)
11903 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_LAST HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN
11904 /*
11905 * This field will indicate number of physical functions on this port_partition.
11906 * HWRM shall return unavail (i.e. value of 0) for this field
11907 * when this command is used to query VF's configuration or
11908 * from older firmware that doesn't support this field.
11909 */
11910 uint8_t port_pf_cnt;
11911 /* number of PFs is not available */
11912 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL UINT32_C(0x0)
11913 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_LAST HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL
11914 /*
11915 * The default VNIC ID assigned to a function that is
11916 * being queried.
11917 */
11918 uint16_t dflt_vnic_id;
11919 uint16_t max_mtu_configured;
11920 /*
11921 * Minimum guaranteed transmit bandwidth for this function. When
11922 * specified for a PF, does not affect traffic from the PF's child VFs.
11923 * A value of 0 indicates the minimum bandwidth is not configured.
11924 */
11925 uint32_t min_bw;
11926 /* The bandwidth value. */
11927 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
11928 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_SFT 0
11929 /* The granularity of the value (bits or bytes). */
11930 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE UINT32_C(0x10000000)
11931 /* Value is in bits. */
11932 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
11933 /* Value is in bytes. */
11934 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
11935 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_LAST HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES
11936 /* bw_value_unit is 3 b */
11937 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
11938 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_SFT 29
11939 /* Value is in Mb or MB (base 10). */
11940 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
11941 /* Value is in Kb or KB (base 10). */
11942 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
11943 /* Value is in bits or bytes. */
11944 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
11945 /* Value is in Gb or GB (base 10). */
11946 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
11947 /* Value is in 1/100th of a percentage of link bandwidth. */
11948 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
11949 /* Invalid unit */
11950 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
11951 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_LAST HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID
11952 /*
11953 * Maximum transmit rate for this function. When specified for a PF,
11954 * does not affect traffic from the PF's child VFs.
11955 * A value of 0 indicates that the maximum bandwidth is not configured.
11956 */
11957 uint32_t max_bw;
11958 /* The bandwidth value. */
11959 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
11960 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_SFT 0
11961 /* The granularity of the value (bits or bytes). */
11962 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE UINT32_C(0x10000000)
11963 /* Value is in bits. */
11964 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
11965 /* Value is in bytes. */
11966 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
11967 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_LAST HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES
11968 /* bw_value_unit is 3 b */
11969 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
11970 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_SFT 29
11971 /* Value is in Mb or MB (base 10). */
11972 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
11973 /* Value is in Kb or KB (base 10). */
11974 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
11975 /* Value is in bits or bytes. */
11976 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
11977 /* Value is in Gb or GB (base 10). */
11978 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
11979 /* Value is in 1/100th of a percentage of link bandwidth. */
11980 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
11981 /* Invalid unit */
11982 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
11983 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_LAST HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID
11984 /*
11985 * This value indicates the Edge virtual bridge mode for the
11986 * domain that this function belongs to.
11987 */
11988 uint8_t evb_mode;
11989 /* No Edge Virtual Bridging (EVB) */
11990 #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
11991 /* Virtual Ethernet Bridge (VEB) */
11992 #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEB UINT32_C(0x1)
11993 /* Virtual Ethernet Port Aggregator (VEPA) */
11994 #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA UINT32_C(0x2)
11995 #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_LAST HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA
11996 uint8_t options;
11997 /*
11998 * This value indicates the PCIE device cache line size.
11999 * The cache line size allows the DMA writes to terminate and
12000 * start at the cache boundary.
12001 */
12002 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_MASK UINT32_C(0x3)
12003 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SFT 0
12004 /* Cache Line Size 64 bytes */
12005 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_64 UINT32_C(0x0)
12006 /* Cache Line Size 128 bytes */
12007 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_128 UINT32_C(0x1)
12008 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_LAST HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_128
12009 /* This value is the virtual link admin state setting. */
12010 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_MASK UINT32_C(0xc)
12011 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_SFT 2
12012 /* Admin link state is in forced down mode. */
12013 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_DOWN (UINT32_C(0x0) << 2)
12014 /* Admin link state is in forced up mode. */
12015 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_UP (UINT32_C(0x1) << 2)
12016 /* Admin link state is in auto mode - follows the physical link state. */
12017 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_AUTO (UINT32_C(0x2) << 2)
12018 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_LAST HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_AUTO
12019 /* Reserved for future. */
12020 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_RSVD_MASK UINT32_C(0xf0)
12021 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_RSVD_SFT 4
12022 /*
12023 * The number of VFs that are allocated to the function.
12024 * This is valid only on the PF with SR-IOV enabled.
12025 * 0xFF... (All Fs) if this command is called on a PF with
12026 * SR-IOV disabled or on a VF.
12027 */
12028 uint16_t alloc_vfs;
12029 /*
12030 * The number of allocated multicast filters for this
12031 * function on the RX side.
12032 */
12033 uint32_t alloc_mcast_filters;
12034 /*
12035 * The number of allocated HW ring groups for this
12036 * function.
12037 */
12038 uint32_t alloc_hw_ring_grps;
12039 /*
12040 * The number of strict priority transmit rings out of
12041 * currently allocated TX rings to the function
12042 * (alloc_tx_rings).
12043 */
12044 uint16_t alloc_sp_tx_rings;
12045 /*
12046 * The number of statistics contexts
12047 * currently reserved for the function.
12048 */
12049 uint16_t alloc_stat_ctx;
12050 /*
12051 * This field specifies how many NQs are reserved for the PF.
12052 * Remaining NQs that belong to the PF are available for VFs.
12053 * Once a PF has created VFs, it cannot change how many NQs are
12054 * reserved for itself (since the NQs must be contiguous in HW).
12055 */
12056 uint16_t alloc_msix;
12057 /*
12058 * The number of registered VF’s associated with the PF. This field
12059 * should be ignored when the request received on the VF interface.
12060 * This field will be updated on the PF interface to initiate
12061 * the unregister request on PF in the HOT Reset Process.
12062 */
12063 uint16_t registered_vfs;
12064 /*
12065 * The size of the doorbell BAR in KBytes reserved for L2 including
12066 * any area that is shared between L2 and RoCE. The L2 driver
12067 * should only map the L2 portion of the doorbell BAR. Any rounding
12068 * of the BAR size to the native CPU page size should be performed
12069 * by the driver. If the value is zero, no special partitioning
12070 * of the doorbell BAR between L2 and RoCE is required.
12071 */
12072 uint16_t l2_doorbell_bar_size_kb;
12073 uint8_t unused_1;
12074 /*
12075 * For backward compatibility this field must be set to 1.
12076 * Older drivers might look for this field to be 1 before
12077 * processing the message.
12078 */
12079 uint8_t always_1;
12080 /*
12081 * This GRC address location is used by the Host driver interfaces to poll
12082 * the adapter ready state to re-initiate the registration process again
12083 * after receiving the RESET Notify event.
12084 */
12085 uint32_t reset_addr_poll;
12086 /*
12087 * This field specifies legacy L2 doorbell size in KBytes. Drivers should use
12088 * this value to find out the doorbell page offset from the BAR.
12089 */
12090 uint16_t legacy_l2_db_size_kb;
12091 uint16_t svif_info;
12092 /*
12093 * This field specifies the source virtual interface of the function being
12094 * queried. Drivers can use this to program svif field in the L2 context
12095 * table
12096 */
12097 #define HWRM_FUNC_QCFG_OUTPUT_SVIF_INFO_SVIF_MASK UINT32_C(0x7fff)
12098 #define HWRM_FUNC_QCFG_OUTPUT_SVIF_INFO_SVIF_SFT 0
12099 /* This field specifies whether svif is valid or not */
12100 #define HWRM_FUNC_QCFG_OUTPUT_SVIF_INFO_SVIF_VALID UINT32_C(0x8000)
12101 uint8_t mpc_chnls;
12102 /*
12103 * When this bit is '1', it indicates that a MPC channel with
12104 * destination set to the TX crypto engine block is enabled.
12105 */
12106 #define HWRM_FUNC_QCFG_OUTPUT_MPC_CHNLS_TCE_ENABLED UINT32_C(0x1)
12107 /*
12108 * When this bit is '1', it indicates that a MPC channel with
12109 * destination set to the RX crypto engine block is enabled.
12110 */
12111 #define HWRM_FUNC_QCFG_OUTPUT_MPC_CHNLS_RCE_ENABLED UINT32_C(0x2)
12112 /*
12113 * When this bit is '1', it indicates that a MPC channel with
12114 * destination set to the TX configurable flow processing block is
12115 * enabled.
12116 */
12117 #define HWRM_FUNC_QCFG_OUTPUT_MPC_CHNLS_TE_CFA_ENABLED UINT32_C(0x4)
12118 /*
12119 * When this bit is '1', it indicates that a MPC channel with
12120 * destination set to the RX configurable flow processing block is
12121 * enabled.
12122 */
12123 #define HWRM_FUNC_QCFG_OUTPUT_MPC_CHNLS_RE_CFA_ENABLED UINT32_C(0x8)
12124 /*
12125 * When this bit is '1', it indicates that a MPC channel with
12126 * destination set to the primate processor block is enabled.
12127 */
12128 #define HWRM_FUNC_QCFG_OUTPUT_MPC_CHNLS_PRIMATE_ENABLED UINT32_C(0x10)
12129 uint8_t unused_2[3];
12130 /*
12131 * Minimum guaranteed bandwidth for the network partition made up
12132 * of the caller physical function and all its child virtual
12133 * functions. The rate is specified as a percentage of the bandwidth
12134 * of the link the partition is associated with. A value of 0
12135 * indicates that no minimum bandwidth is configured.
12136 * The format of this field is defined to match min_bw, even though
12137 * the partition minimum rate is always specified as a percentage.
12138 */
12139 uint32_t partition_min_bw;
12140 /* The bandwidth value. */
12141 #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
12142 #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_SFT 0
12143 /*
12144 * The granularity of the value (bits or bytes). Firmware never sets
12145 * this field.
12146 */
12147 #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_SCALE UINT32_C(0x10000000)
12148 /* Value is in bits. */
12149 #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
12150 /* Value is in bytes. */
12151 #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
12152 #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_SCALE_LAST HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_SCALE_BYTES
12153 /* Always percentage of link bandwidth. */
12154 #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
12155 #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_SFT 29
12156 /* Bandwidth value is in hundredths of a percent of link bandwidth. */
12157 #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
12158 #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_LAST HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_PERCENT1_100
12159 /*
12160 * The maximum bandwidth that may be used by the network partition
12161 * made up of the caller physical function and all its child virtual
12162 * functions. The rate is specified as a percentage of the bandwidth
12163 * of the link the partition is associated with. A value of 0
12164 * indicates that no maximum bandwidth is configured.
12165 * The format of this field is defined to match max_bw, even though
12166 * the partition bandwidth must be specified as a percentage.
12167 */
12168 uint32_t partition_max_bw;
12169 /* The bandwidth value. */
12170 #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
12171 #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_SFT 0
12172 /*
12173 * The granularity of the value (bits or bytes). Firmware never sets
12174 * this field.
12175 */
12176 #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_SCALE UINT32_C(0x10000000)
12177 /* Value is in bits. */
12178 #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
12179 /* Value is in bytes. */
12180 #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
12181 #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_SCALE_LAST HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_SCALE_BYTES
12182 /* Always a percentage of link bandwidth. */
12183 #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
12184 #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_SFT 29
12185 /* Value is in hundredths of a percent of link bandwidth. */
12186 #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
12187 #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_LAST HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_PERCENT1_100
12188 uint8_t unused_3[3];
12189 /*
12190 * This field is used in Output records to indicate that the output
12191 * is completely written to RAM. This field should be read as '1'
12192 * to indicate that the output has been completely written.
12193 * When writing a command completion or response to an internal processor,
12194 * the order of writes has to be such that this field is written last.
12195 */
12196 uint8_t valid;
12197 } hwrm_func_qcfg_output_t, *phwrm_func_qcfg_output_t;
12198
12199 /*****************
12200 * hwrm_func_cfg *
12201 *****************/
12202
12203
12204 /* hwrm_func_cfg_input (size:832b/104B) */
12205
12206 typedef struct hwrm_func_cfg_input {
12207 /* The HWRM command request type. */
12208 uint16_t req_type;
12209 /*
12210 * The completion ring to send the completion event on. This should
12211 * be the NQ ID returned from the `nq_alloc` HWRM command.
12212 */
12213 uint16_t cmpl_ring;
12214 /*
12215 * The sequence ID is used by the driver for tracking multiple
12216 * commands. This ID is treated as opaque data by the firmware and
12217 * the value is returned in the `hwrm_resp_hdr` upon completion.
12218 */
12219 uint16_t seq_id;
12220 /*
12221 * The target ID of the command:
12222 * * 0x0-0xFFF8 - The function ID
12223 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12224 * * 0xFFFD - Reserved for user-space HWRM interface
12225 * * 0xFFFF - HWRM
12226 */
12227 uint16_t target_id;
12228 /*
12229 * A physical address pointer pointing to a host buffer that the
12230 * command's response data will be written. This can be either a host
12231 * physical address (HPA) or a guest physical address (GPA) and must
12232 * point to a physically contiguous block of memory.
12233 */
12234 uint64_t resp_addr;
12235 /*
12236 * Function ID of the function that is being
12237 * configured.
12238 * If set to 0xFF... (All Fs), then the the configuration is
12239 * for the requesting function.
12240 */
12241 uint16_t fid;
12242 /*
12243 * This field specifies how many NQs will be reserved for the PF.
12244 * Remaining NQs that belong to the PF become available for VFs.
12245 * Once a PF has created VFs, it cannot change how many NQs are
12246 * reserved for itself (since the NQs must be contiguous in HW).
12247 */
12248 uint16_t num_msix;
12249 uint32_t flags;
12250 /*
12251 * When this bit is '1', the function is disabled with
12252 * source MAC address check.
12253 * This is an anti-spoofing check. If this flag is set,
12254 * then the function shall be configured to disallow
12255 * transmission of frames with the source MAC address that
12256 * is configured for this function.
12257 */
12258 #define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE UINT32_C(0x1)
12259 /*
12260 * When this bit is '1', the function is enabled with
12261 * source MAC address check.
12262 * This is an anti-spoofing check. If this flag is set,
12263 * then the function shall be configured to allow
12264 * transmission of frames with the source MAC address that
12265 * is configured for this function.
12266 */
12267 #define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE UINT32_C(0x2)
12268 /* reserved. */
12269 #define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_MASK UINT32_C(0x1fc)
12270 #define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_SFT 2
12271 /*
12272 * Standard TX Ring mode is used for the allocation of TX ring
12273 * and underlying scheduling resources that allow bandwidth
12274 * reservation and limit settings on the queried function.
12275 * If set to 1, then standard TX ring mode is requested to be
12276 * enabled on the function being configured.
12277 */
12278 #define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_ENABLE UINT32_C(0x200)
12279 /*
12280 * Standard TX Ring mode is used for the allocation of TX ring
12281 * and underlying scheduling resources that allow bandwidth
12282 * reservation and limit settings on the queried function.
12283 * If set to 1, then the standard TX ring mode is requested to
12284 * be disabled on the function being configured. In this extended
12285 * TX ring resource mode, the minimum and maximum bandwidth settings
12286 * are not supported to allow the allocation of TX rings to
12287 * span multiple scheduler nodes.
12288 */
12289 #define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_DISABLE UINT32_C(0x400)
12290 /*
12291 * If this bit is set, virtual mac address configured
12292 * in this command will be persistent over warm boot.
12293 */
12294 #define HWRM_FUNC_CFG_INPUT_FLAGS_VIRT_MAC_PERSIST UINT32_C(0x800)
12295 /*
12296 * This bit only applies to the VF. If this bit is set, the statistic
12297 * context counters will not be cleared when the statistic context is freed
12298 * or a function reset is called on VF. This bit will be cleared when the PF
12299 * is unloaded or a function reset is called on the PF.
12300 */
12301 #define HWRM_FUNC_CFG_INPUT_FLAGS_NO_AUTOCLEAR_STATISTIC UINT32_C(0x1000)
12302 /*
12303 * This bit requests that the firmware test to see if all the assets
12304 * requested in this command (i.e. number of TX rings) are available.
12305 * The firmware will return an error if the requested assets are
12306 * not available. The firwmare will NOT reserve the assets if they
12307 * are available.
12308 */
12309 #define HWRM_FUNC_CFG_INPUT_FLAGS_TX_ASSETS_TEST UINT32_C(0x2000)
12310 /*
12311 * This bit requests that the firmware test to see if all the assets
12312 * requested in this command (i.e. number of RX rings) are available.
12313 * The firmware will return an error if the requested assets are
12314 * not available. The firwmare will NOT reserve the assets if they
12315 * are available.
12316 */
12317 #define HWRM_FUNC_CFG_INPUT_FLAGS_RX_ASSETS_TEST UINT32_C(0x4000)
12318 /*
12319 * This bit requests that the firmware test to see if all the assets
12320 * requested in this command (i.e. number of CMPL rings) are available.
12321 * The firmware will return an error if the requested assets are
12322 * not available. The firwmare will NOT reserve the assets if they
12323 * are available.
12324 */
12325 #define HWRM_FUNC_CFG_INPUT_FLAGS_CMPL_ASSETS_TEST UINT32_C(0x8000)
12326 /*
12327 * This bit requests that the firmware test to see if all the assets
12328 * requested in this command (i.e. number of RSS ctx) are available.
12329 * The firmware will return an error if the requested assets are
12330 * not available. The firwmare will NOT reserve the assets if they
12331 * are available.
12332 */
12333 #define HWRM_FUNC_CFG_INPUT_FLAGS_RSSCOS_CTX_ASSETS_TEST UINT32_C(0x10000)
12334 /*
12335 * This bit requests that the firmware test to see if all the assets
12336 * requested in this command (i.e. number of ring groups) are available.
12337 * The firmware will return an error if the requested assets are
12338 * not available. The firwmare will NOT reserve the assets if they
12339 * are available.
12340 */
12341 #define HWRM_FUNC_CFG_INPUT_FLAGS_RING_GRP_ASSETS_TEST UINT32_C(0x20000)
12342 /*
12343 * This bit requests that the firmware test to see if all the assets
12344 * requested in this command (i.e. number of stat ctx) are available.
12345 * The firmware will return an error if the requested assets are
12346 * not available. The firwmare will NOT reserve the assets if they
12347 * are available.
12348 */
12349 #define HWRM_FUNC_CFG_INPUT_FLAGS_STAT_CTX_ASSETS_TEST UINT32_C(0x40000)
12350 /*
12351 * This bit requests that the firmware test to see if all the assets
12352 * requested in this command (i.e. number of VNICs) are available.
12353 * The firmware will return an error if the requested assets are
12354 * not available. The firwmare will NOT reserve the assets if they
12355 * are available.
12356 */
12357 #define HWRM_FUNC_CFG_INPUT_FLAGS_VNIC_ASSETS_TEST UINT32_C(0x80000)
12358 /*
12359 * This bit requests that the firmware test to see if all the assets
12360 * requested in this command (i.e. number of L2 ctx) are available.
12361 * The firmware will return an error if the requested assets are
12362 * not available. The firwmare will NOT reserve the assets if they
12363 * are available.
12364 */
12365 #define HWRM_FUNC_CFG_INPUT_FLAGS_L2_CTX_ASSETS_TEST UINT32_C(0x100000)
12366 /*
12367 * This configuration change can be initiated by a PF driver. This
12368 * configuration request shall be targeted to a VF. From local host
12369 * resident HWRM clients, only the parent PF driver shall be allowed
12370 * to initiate this change on one of its children VFs. If this bit is
12371 * set to 1, then the VF that is being configured is requested to be
12372 * trusted.
12373 */
12374 #define HWRM_FUNC_CFG_INPUT_FLAGS_TRUSTED_VF_ENABLE UINT32_C(0x200000)
12375 /*
12376 * When this bit it set, even if PF reserved pool size is zero,
12377 * FW will allow driver to create TX rings in ring alloc,
12378 * by reserving TX ring, S3 node dynamically.
12379 */
12380 #define HWRM_FUNC_CFG_INPUT_FLAGS_DYNAMIC_TX_RING_ALLOC UINT32_C(0x400000)
12381 /*
12382 * This bit requests that the firmware test to see if all the assets
12383 * requested in this command (i.e. number of NQ rings) are available.
12384 * The firmware will return an error if the requested assets are
12385 * not available. The firwmare will NOT reserve the assets if they
12386 * are available.
12387 */
12388 #define HWRM_FUNC_CFG_INPUT_FLAGS_NQ_ASSETS_TEST UINT32_C(0x800000)
12389 /*
12390 * This configuration change can be initiated by a PF driver. This
12391 * configuration request shall be targeted to a VF. From local host
12392 * resident HWRM clients, only the parent PF driver shall be allowed
12393 * to initiate this change on one of its children VFs. If this bit is
12394 * set to 1, then the VF that is being configured is requested to be
12395 * untrusted.
12396 */
12397 #define HWRM_FUNC_CFG_INPUT_FLAGS_TRUSTED_VF_DISABLE UINT32_C(0x1000000)
12398 /*
12399 * This bit is used by preboot drivers on a PF that require access
12400 * to the legacy L2 ring model and legacy 32b doorbells. This
12401 * feature is not allowed on VFs and is only relevant for devices
12402 * that require a context backing store.
12403 */
12404 #define HWRM_FUNC_CFG_INPUT_FLAGS_PREBOOT_LEGACY_L2_RINGS UINT32_C(0x2000000)
12405 /*
12406 * If this bit is set to 0, then the interface does not support hot
12407 * reset capability which it advertised with the hot_reset_support
12408 * flag in HWRM_FUNC_DRV_RGTR. If any of the function has set this
12409 * flag to 0, adapter cannot do the hot reset. In this state, if the
12410 * firmware receives a hot reset request, firmware must fail the
12411 * request. If this bit is set to 1, then interface is renabling the
12412 * hot reset capability.
12413 */
12414 #define HWRM_FUNC_CFG_INPUT_FLAGS_HOT_RESET_IF_EN_DIS UINT32_C(0x4000000)
12415 /*
12416 * If this bit is set to 1, the PF driver is requesting FW
12417 * to enable PPP TX PUSH feature on all the TX rings specified in
12418 * the num_tx_rings field. By default, the PPP TX push feature is
12419 * disabled for all the TX rings of the function. This flag is
12420 * ignored if num_tx_rings field is not specified or the function
12421 * doesn't support PPP tx push feature.
12422 */
12423 #define HWRM_FUNC_CFG_INPUT_FLAGS_PPP_PUSH_MODE_ENABLE UINT32_C(0x8000000)
12424 /*
12425 * If this bit is set to 1, the PF driver is requesting FW
12426 * to disable PPP TX PUSH feature on all the TX rings specified in
12427 * the num_tx_rings field. This flag is ignored if num_tx_rings
12428 * field is not specified or the function doesn't support PPP tx
12429 * push feature.
12430 */
12431 #define HWRM_FUNC_CFG_INPUT_FLAGS_PPP_PUSH_MODE_DISABLE UINT32_C(0x10000000)
12432 /*
12433 * If this bit is set to 1, the driver is requesting FW to enable
12434 * the BD_METADATA feature for this function. The FW returns error
12435 * on this request if the TX_METADATA is enabled for this function.
12436 */
12437 #define HWRM_FUNC_CFG_INPUT_FLAGS_BD_METADATA_ENABLE UINT32_C(0x20000000)
12438 /*
12439 * If this bit is set to 1, the driver is requesting FW to disable
12440 * the BD_METADATA feature for this function. The FW returns error
12441 * on this request if the TX_METADATA is enabled for this function.
12442 */
12443 #define HWRM_FUNC_CFG_INPUT_FLAGS_BD_METADATA_DISABLE UINT32_C(0x40000000)
12444 uint32_t enables;
12445 /*
12446 * This bit must be '1' for the mtu field to be
12447 * configured.
12448 */
12449 #define HWRM_FUNC_CFG_INPUT_ENABLES_MTU UINT32_C(0x1)
12450 /*
12451 * This bit must be '1' for the mru field to be
12452 * configured.
12453 */
12454 #define HWRM_FUNC_CFG_INPUT_ENABLES_MRU UINT32_C(0x2)
12455 /*
12456 * This bit must be '1' for the num_rsscos_ctxs field to be
12457 * configured.
12458 */
12459 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS UINT32_C(0x4)
12460 /*
12461 * This bit must be '1' for the num_cmpl_rings field to be
12462 * configured.
12463 */
12464 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_CMPL_RINGS UINT32_C(0x8)
12465 /*
12466 * This bit must be '1' for the num_tx_rings field to be
12467 * configured.
12468 */
12469 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_TX_RINGS UINT32_C(0x10)
12470 /*
12471 * This bit must be '1' for the num_rx_rings field to be
12472 * configured.
12473 */
12474 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RX_RINGS UINT32_C(0x20)
12475 /*
12476 * This bit must be '1' for the num_l2_ctxs field to be
12477 * configured.
12478 */
12479 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_L2_CTXS UINT32_C(0x40)
12480 /*
12481 * This bit must be '1' for the num_vnics field to be
12482 * configured.
12483 */
12484 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_VNICS UINT32_C(0x80)
12485 /*
12486 * This bit must be '1' for the num_stat_ctxs field to be
12487 * configured.
12488 */
12489 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_STAT_CTXS UINT32_C(0x100)
12490 /*
12491 * This bit must be '1' for the dflt_mac_addr field to be
12492 * configured.
12493 */
12494 #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_MAC_ADDR UINT32_C(0x200)
12495 /*
12496 * This bit must be '1' for the dflt_vlan field to be
12497 * configured.
12498 */
12499 #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_VLAN UINT32_C(0x400)
12500 /*
12501 * This bit must be '1' for the dflt_ip_addr field to be
12502 * configured.
12503 */
12504 #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_IP_ADDR UINT32_C(0x800)
12505 /*
12506 * This bit must be '1' for the min_bw field to be
12507 * configured.
12508 */
12509 #define HWRM_FUNC_CFG_INPUT_ENABLES_MIN_BW UINT32_C(0x1000)
12510 /*
12511 * This bit must be '1' for the max_bw field to be
12512 * configured.
12513 */
12514 #define HWRM_FUNC_CFG_INPUT_ENABLES_MAX_BW UINT32_C(0x2000)
12515 /*
12516 * This bit must be '1' for the async_event_cr field to be
12517 * configured.
12518 */
12519 #define HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR UINT32_C(0x4000)
12520 /*
12521 * This bit must be '1' for the vlan_antispoof_mode field to be
12522 * configured.
12523 */
12524 #define HWRM_FUNC_CFG_INPUT_ENABLES_VLAN_ANTISPOOF_MODE UINT32_C(0x8000)
12525 /*
12526 * This bit must be '1' for the allowed_vlan_pris field to be
12527 * configured.
12528 */
12529 #define HWRM_FUNC_CFG_INPUT_ENABLES_ALLOWED_VLAN_PRIS UINT32_C(0x10000)
12530 /*
12531 * This bit must be '1' for the evb_mode field to be
12532 * configured.
12533 */
12534 #define HWRM_FUNC_CFG_INPUT_ENABLES_EVB_MODE UINT32_C(0x20000)
12535 /*
12536 * This bit must be '1' for the num_mcast_filters field to be
12537 * configured.
12538 */
12539 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MCAST_FILTERS UINT32_C(0x40000)
12540 /*
12541 * This bit must be '1' for the num_hw_ring_grps field to be
12542 * configured.
12543 */
12544 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS UINT32_C(0x80000)
12545 /*
12546 * This bit must be '1' for the cache_linesize field to be
12547 * configured.
12548 */
12549 #define HWRM_FUNC_CFG_INPUT_ENABLES_CACHE_LINESIZE UINT32_C(0x100000)
12550 /*
12551 * This bit must be '1' for the num_msix field to be
12552 * configured.
12553 */
12554 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MSIX UINT32_C(0x200000)
12555 /*
12556 * This bit must be '1' for the link admin state field to be
12557 * configured.
12558 */
12559 #define HWRM_FUNC_CFG_INPUT_ENABLES_ADMIN_LINK_STATE UINT32_C(0x400000)
12560 /*
12561 * This bit must be '1' for the hot_reset_if_en_dis field to be
12562 * configured.
12563 */
12564 #define HWRM_FUNC_CFG_INPUT_ENABLES_HOT_RESET_IF_SUPPORT UINT32_C(0x800000)
12565 /*
12566 * This bit must be '1' for the schq_id field to be
12567 * configured.
12568 */
12569 #define HWRM_FUNC_CFG_INPUT_ENABLES_SCHQ_ID UINT32_C(0x1000000)
12570 /*
12571 * This bit must be '1' for the mpc_chnls field to be
12572 * configured.
12573 */
12574 #define HWRM_FUNC_CFG_INPUT_ENABLES_MPC_CHNLS UINT32_C(0x2000000)
12575 /*
12576 * This bit must be '1' for the partition_min_bw field to be
12577 * configured.
12578 */
12579 #define HWRM_FUNC_CFG_INPUT_ENABLES_PARTITION_MIN_BW UINT32_C(0x4000000)
12580 /*
12581 * This bit must be '1' for the partition_max_bw field to be
12582 * configured.
12583 */
12584 #define HWRM_FUNC_CFG_INPUT_ENABLES_PARTITION_MAX_BW UINT32_C(0x8000000)
12585 /*
12586 * This bit must be '1' for the tpid field to be
12587 * configured. This bit is only valid when dflt_vlan enable
12588 * bit is set.
12589 */
12590 #define HWRM_FUNC_CFG_INPUT_ENABLES_TPID UINT32_C(0x10000000)
12591 /*
12592 * The maximum transmission unit of the function.
12593 * The HWRM should make sure that the mtu of
12594 * the function does not exceed the mtu of the physical
12595 * port that this function is associated with.
12596 *
12597 * In addition to configuring mtu per function, it is
12598 * possible to configure mtu per transmit ring.
12599 * By default, the mtu of each transmit ring associated
12600 * with a function is equal to the mtu of the function.
12601 * The HWRM should make sure that the mtu of each transmit
12602 * ring that is assigned to a function has a valid mtu.
12603 */
12604 uint16_t mtu;
12605 /*
12606 * The maximum receive unit of the function.
12607 * The HWRM should make sure that the mru of
12608 * the function does not exceed the mru of the physical
12609 * port that this function is associated with.
12610 *
12611 * In addition to configuring mru per function, it is
12612 * possible to configure mru per vnic.
12613 * By default, the mru of each vnic associated
12614 * with a function is equal to the mru of the function.
12615 * The HWRM should make sure that the mru of each vnic
12616 * that is assigned to a function has a valid mru.
12617 */
12618 uint16_t mru;
12619 /*
12620 * The number of RSS/COS contexts requested for the
12621 * function.
12622 */
12623 uint16_t num_rsscos_ctxs;
12624 /*
12625 * The number of completion rings requested for the
12626 * function. This does not include the rings allocated
12627 * to any children functions if any.
12628 */
12629 uint16_t num_cmpl_rings;
12630 /*
12631 * The number of transmit rings requested for the function.
12632 * This does not include the rings allocated to any
12633 * children functions if any.
12634 */
12635 uint16_t num_tx_rings;
12636 /*
12637 * The number of receive rings requested for the function.
12638 * This does not include the rings allocated
12639 * to any children functions if any.
12640 */
12641 uint16_t num_rx_rings;
12642 /* The requested number of L2 contexts for the function. */
12643 uint16_t num_l2_ctxs;
12644 /* The requested number of vnics for the function. */
12645 uint16_t num_vnics;
12646 /* The requested number of statistic contexts for the function. */
12647 uint16_t num_stat_ctxs;
12648 /*
12649 * The number of HW ring groups that should
12650 * be reserved for this function.
12651 */
12652 uint16_t num_hw_ring_grps;
12653 /* The default MAC address for the function being configured. */
12654 uint8_t dflt_mac_addr[6];
12655 /*
12656 * The default VLAN for the function being configured.
12657 * This field's format is same as 802.1Q Tag's
12658 * Tag Control Information (TCI) format that includes both
12659 * Priority Code Point (PCP) and VLAN Identifier (VID).
12660 */
12661 uint16_t dflt_vlan;
12662 /*
12663 * The default IP address for the function being configured.
12664 * This address is only used in enabling source property check.
12665 */
12666 uint32_t dflt_ip_addr[4];
12667 /*
12668 * Minimum guaranteed transmit bandwidth for this function. When
12669 * specified for a PF, does not affect traffic from the PF's child VFs.
12670 * A value of 0 indicates the minimum bandwidth is not configured.
12671 */
12672 uint32_t min_bw;
12673 /* The bandwidth value. */
12674 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
12675 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_SFT 0
12676 /* The granularity of the value (bits or bytes). */
12677 #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE UINT32_C(0x10000000)
12678 /* Value is in bits. */
12679 #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
12680 /* Value is in bytes. */
12681 #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
12682 #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_LAST HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES
12683 /* bw_value_unit is 3 b */
12684 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
12685 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_SFT 29
12686 /* Value is in Mb or MB (base 10). */
12687 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
12688 /* Value is in Kb or KB (base 10). */
12689 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
12690 /* Value is in bits or bytes. */
12691 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
12692 /* Value is in Gb or GB (base 10). */
12693 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
12694 /* Value is in 1/100th of a percentage of total bandwidth. */
12695 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
12696 /* Invalid unit */
12697 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
12698 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_LAST HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID
12699 /*
12700 * Maximum transmit rate for this function. When specified for a PF,
12701 * does not affect traffic from the PF's child VFs.
12702 * A value of 0 indicates that the maximum bandwidth is not configured.
12703 */
12704 uint32_t max_bw;
12705 /* The bandwidth value. */
12706 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
12707 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_SFT 0
12708 /* The granularity of the value (bits or bytes). */
12709 #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE UINT32_C(0x10000000)
12710 /* Value is in bits. */
12711 #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
12712 /* Value is in bytes. */
12713 #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
12714 #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_LAST HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES
12715 /* bw_value_unit is 3 b */
12716 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
12717 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_SFT 29
12718 /* Value is in Mb or MB (base 10). */
12719 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
12720 /* Value is in Kb or KB (base 10). */
12721 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
12722 /* Value is in bits or bytes. */
12723 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
12724 /* Value is in Gb or GB (base 10). */
12725 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
12726 /* Value is in 1/100th of a percentage of total bandwidth. */
12727 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
12728 /* Invalid unit */
12729 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
12730 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_LAST HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
12731 /*
12732 * ID of the target completion ring for receiving asynchronous
12733 * event completions. If this field is not valid, then the
12734 * HWRM shall use the default completion ring of the function
12735 * that is being configured as the target completion ring for
12736 * providing any asynchronous event completions for that
12737 * function.
12738 * If this field is valid, then the HWRM shall use the
12739 * completion ring identified by this ID as the target
12740 * completion ring for providing any asynchronous event
12741 * completions for the function that is being configured.
12742 */
12743 uint16_t async_event_cr;
12744 /* VLAN Anti-spoofing mode. */
12745 uint8_t vlan_antispoof_mode;
12746 /* No VLAN anti-spoofing checks are enabled */
12747 #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_NOCHECK UINT32_C(0x0)
12748 /* Validate VLAN against the configured VLAN(s) */
12749 #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_VALIDATE_VLAN UINT32_C(0x1)
12750 /* Insert VLAN if it does not exist, otherwise discard */
12751 #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_IF_VLANDNE UINT32_C(0x2)
12752 /* Insert VLAN if it does not exist, override VLAN if it exists */
12753 #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN UINT32_C(0x3)
12754 #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_LAST HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN
12755 /*
12756 * This bit field defines VLAN PRIs that are allowed on
12757 * this function.
12758 * If nth bit is set, then VLAN PRI n is allowed on this
12759 * function.
12760 */
12761 uint8_t allowed_vlan_pris;
12762 /*
12763 * The evb_mode is configured on a per port basis. The default evb_mode
12764 * is configured based on the NVM EVB mode setting upon firmware
12765 * initialization. The HWRM allows a PF driver to change EVB mode for a
12766 * port used by the PF only when one of the following conditions is
12767 * satisfied.
12768 * 1. The current operating mode is single function mode.
12769 * (ie. one PF per port)
12770 * 2. For SmartNIC, any one of the PAXC PFs is permitted to change the
12771 * EVB mode of the port used by the PAXC PF. None of the X86 PFs
12772 * should have privileges.
12773 * The HWRM doesn't permit any PFs to change the underlying EVB mode
12774 * when running as MHB or NPAR mode in performance NIC configuration.
12775 * The HWRM doesn't permit a VF driver to change the EVB mode.
12776 * Once the HWRM determines a function doesn't meet the conditions
12777 * to configure the EVB mode, it sets the evb_mode_cfg_not_supported
12778 * flag in HWRM_FUNC_QCAPS command response for the function.
12779 * The HWRM takes into account the switching of EVB mode from one to
12780 * another and reconfigure hardware resources as reqiured. The
12781 * switching from VEB to VEPA mode requires the disabling of the
12782 * loopback traffic. Additionally, source knockouts are handled
12783 * differently in VEB and VEPA modes.
12784 */
12785 uint8_t evb_mode;
12786 /* No Edge Virtual Bridging (EVB) */
12787 #define HWRM_FUNC_CFG_INPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
12788 /* Virtual Ethernet Bridge (VEB) */
12789 #define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEB UINT32_C(0x1)
12790 /* Virtual Ethernet Port Aggregator (VEPA) */
12791 #define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA UINT32_C(0x2)
12792 #define HWRM_FUNC_CFG_INPUT_EVB_MODE_LAST HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA
12793 uint8_t options;
12794 /*
12795 * This value indicates the PCIE device cache line size.
12796 * The cache line size allows the DMA writes to terminate and
12797 * start at the cache boundary.
12798 */
12799 #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_MASK UINT32_C(0x3)
12800 #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SFT 0
12801 /* Cache Line Size 64 bytes */
12802 #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_64 UINT32_C(0x0)
12803 /* Cache Line Size 128 bytes */
12804 #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_128 UINT32_C(0x1)
12805 #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_LAST HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_128
12806 /* This value is the virtual link admin state setting. */
12807 #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_MASK UINT32_C(0xc)
12808 #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_SFT 2
12809 /* Admin state is forced down. */
12810 #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_DOWN (UINT32_C(0x0) << 2)
12811 /* Admin state is forced up. */
12812 #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_UP (UINT32_C(0x1) << 2)
12813 /* Admin state is in auto mode - is to follow the physical link state. */
12814 #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_AUTO (UINT32_C(0x2) << 2)
12815 #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_LAST HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_AUTO
12816 /* Reserved for future. */
12817 #define HWRM_FUNC_CFG_INPUT_OPTIONS_RSVD_MASK UINT32_C(0xf0)
12818 #define HWRM_FUNC_CFG_INPUT_OPTIONS_RSVD_SFT 4
12819 /*
12820 * The number of multicast filters that should
12821 * be reserved for this function on the RX side.
12822 */
12823 uint16_t num_mcast_filters;
12824 /* Used by a PF driver to associate a SCHQ with a VF. */
12825 uint16_t schq_id;
12826 uint16_t mpc_chnls;
12827 /*
12828 * When this bit is '1', the caller requests to enable a MPC
12829 * channel with destination to the TX crypto engine block.
12830 * When this bit is ‘0’, this flag has no effect.
12831 */
12832 #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_TCE_ENABLE UINT32_C(0x1)
12833 /*
12834 * When this bit is '1', the caller requests to disable a MPC
12835 * channel with destination to the TX crypto engine block.
12836 * When this bit is ‘0’, this flag has no effect.
12837 */
12838 #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_TCE_DISABLE UINT32_C(0x2)
12839 /*
12840 * When this bit is '1', the caller requests to enable a MPC
12841 * channel with destination to the RX crypto engine block.
12842 * When this bit is ‘0’, this flag has no effect.
12843 */
12844 #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_RCE_ENABLE UINT32_C(0x4)
12845 /*
12846 * When this bit is '1', the caller requests to disable a MPC
12847 * channel with destination to the RX crypto engine block.
12848 * When this bit is ‘0’, this flag has no effect.
12849 */
12850 #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_RCE_DISABLE UINT32_C(0x8)
12851 /*
12852 * When this bit is '1', the caller requests to enable a MPC
12853 * channel with destination to the TX configurable flow processing
12854 * block. When this bit is ‘0’, this flag has no effect.
12855 */
12856 #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_TE_CFA_ENABLE UINT32_C(0x10)
12857 /*
12858 * When this bit is '1', the caller requests to disable a MPC
12859 * channel with destination to the TX configurable flow processing
12860 * block block. When this bit is ‘0’, this flag has no effect.
12861 */
12862 #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_TE_CFA_DISABLE UINT32_C(0x20)
12863 /*
12864 * When this bit is '1', the caller requests to enable a MPC
12865 * channel with destination to the RX configurable flow processing
12866 * block. When this bit is ‘0’, this flag has no effect.
12867 */
12868 #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_RE_CFA_ENABLE UINT32_C(0x40)
12869 /*
12870 * When this bit is '1', the caller requests to disable a MPC
12871 * channel with destination to the RX configurable flow processing
12872 * block block. When this bit is ‘0’, this flag has no effect.
12873 */
12874 #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_RE_CFA_DISABLE UINT32_C(0x80)
12875 /*
12876 * When this bit is '1', the caller requests to enable a MPC
12877 * channel with destination to the primate processor block.
12878 * When this bit is ‘0’, this flag has no effect.
12879 */
12880 #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_PRIMATE_ENABLE UINT32_C(0x100)
12881 /*
12882 * When this bit is '1', the caller requests to disable a MPC
12883 * channel with destination to the primate processor block.
12884 * When this bit is ‘0’, this flag has no effect.
12885 */
12886 #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_PRIMATE_DISABLE UINT32_C(0x200)
12887 /*
12888 * Minimum guaranteed bandwidth for the network partition made up
12889 * of the caller physical function and all its child virtual
12890 * functions. The rate is specified as a percentage of the bandwidth
12891 * of the link the partition is associated with. A value of 0
12892 * indicates that no minimum bandwidth is configured. The sum of the
12893 * minimum bandwidths for all partitions on a link must not exceed
12894 * 100%.
12895 * The format of this field is defined to match min_bw, even though
12896 * it does not allow all the options for min_bw at this time.
12897 */
12898 uint32_t partition_min_bw;
12899 /* The bandwidth value. */
12900 #define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
12901 #define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_SFT 0
12902 /*
12903 * The granularity of the value (bits or bytes). Firmware ignores
12904 * this field.
12905 */
12906 #define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_SCALE UINT32_C(0x10000000)
12907 /* Value is in bits. */
12908 #define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
12909 /* Value is in bytes. */
12910 #define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
12911 #define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_SCALE_LAST HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_SCALE_BYTES
12912 /* Bandwidth units. Must be set to percent1_100. */
12913 #define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
12914 #define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_SFT 29
12915 /* Value is in hundredths of a percent of link bandwidth. */
12916 #define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
12917 #define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_LAST HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_PERCENT1_100
12918 /*
12919 * The maximum bandwidth that may be used by the network partition
12920 * made up of the caller physical function and all its child virtual
12921 * functions. The rate is specified as a percentage of the bandwidth
12922 * of the link the partition is associated with. A value of 0
12923 * indicates that no maximum bandwidth is configured.
12924 * The format of this field is defined to match max_bw, even though it
12925 * does not allow all the options for max_bw at this time.
12926 */
12927 uint32_t partition_max_bw;
12928 /* The bandwidth value. */
12929 #define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
12930 #define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_SFT 0
12931 /*
12932 * The granularity of the value (bits or bytes). Firmware ignores
12933 * this field.
12934 */
12935 #define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_SCALE UINT32_C(0x10000000)
12936 /* Value is in bits. */
12937 #define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
12938 /* Value is in bytes. */
12939 #define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
12940 #define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_SCALE_LAST HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_SCALE_BYTES
12941 /* Bandwidth units. Must be set to percent1_100. */
12942 #define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
12943 #define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_SFT 29
12944 /* Value is in hundredths of a percent of link bandwidth. */
12945 #define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
12946 #define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_LAST HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_PERCENT1_100
12947 /*
12948 * The TPID for the function for which default VLAN
12949 * is configured. If the dflt_vlan is not specified
12950 * with the TPID, FW returns error. If the TPID is
12951 * not specified with dflt_vlan, the default TPID of
12952 * 0x8100 will be used. This field is specified in
12953 * network byte order.
12954 */
12955 uint16_t tpid;
12956 uint8_t unused_0[2];
12957 } hwrm_func_cfg_input_t, *phwrm_func_cfg_input_t;
12958
12959 /* hwrm_func_cfg_output (size:128b/16B) */
12960
12961 typedef struct hwrm_func_cfg_output {
12962 /* The specific error status for the command. */
12963 uint16_t error_code;
12964 /* The HWRM command request type. */
12965 uint16_t req_type;
12966 /* The sequence ID from the original command. */
12967 uint16_t seq_id;
12968 /* The length of the response data in number of bytes. */
12969 uint16_t resp_len;
12970 uint8_t unused_0[7];
12971 /*
12972 * This field is used in Output records to indicate that the output
12973 * is completely written to RAM. This field should be read as '1'
12974 * to indicate that the output has been completely written.
12975 * When writing a command completion or response to an internal processor,
12976 * the order of writes has to be such that this field is written last.
12977 */
12978 uint8_t valid;
12979 } hwrm_func_cfg_output_t, *phwrm_func_cfg_output_t;
12980
12981 /********************
12982 * hwrm_func_qstats *
12983 ********************/
12984
12985
12986 /* hwrm_func_qstats_input (size:192b/24B) */
12987
12988 typedef struct hwrm_func_qstats_input {
12989 /* The HWRM command request type. */
12990 uint16_t req_type;
12991 /*
12992 * The completion ring to send the completion event on. This should
12993 * be the NQ ID returned from the `nq_alloc` HWRM command.
12994 */
12995 uint16_t cmpl_ring;
12996 /*
12997 * The sequence ID is used by the driver for tracking multiple
12998 * commands. This ID is treated as opaque data by the firmware and
12999 * the value is returned in the `hwrm_resp_hdr` upon completion.
13000 */
13001 uint16_t seq_id;
13002 /*
13003 * The target ID of the command:
13004 * * 0x0-0xFFF8 - The function ID
13005 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13006 * * 0xFFFD - Reserved for user-space HWRM interface
13007 * * 0xFFFF - HWRM
13008 */
13009 uint16_t target_id;
13010 /*
13011 * A physical address pointer pointing to a host buffer that the
13012 * command's response data will be written. This can be either a host
13013 * physical address (HPA) or a guest physical address (GPA) and must
13014 * point to a physically contiguous block of memory.
13015 */
13016 uint64_t resp_addr;
13017 /*
13018 * Function ID of the function that is being queried.
13019 * 0xFF... (All Fs) if the query is for the requesting
13020 * function.
13021 * A privileged PF can query for other function's statistics.
13022 */
13023 uint16_t fid;
13024 /* This flags indicates the type of statistics request. */
13025 uint8_t flags;
13026 /* This value is not used to avoid backward compatibility issues. */
13027 #define HWRM_FUNC_QSTATS_INPUT_FLAGS_UNUSED UINT32_C(0x0)
13028 /*
13029 * flags should be set to 1 when request is for only RoCE statistics.
13030 * This will be honored only if the caller_fid is a privileged PF.
13031 * In all other cases FID and caller_fid should be the same.
13032 */
13033 #define HWRM_FUNC_QSTATS_INPUT_FLAGS_ROCE_ONLY UINT32_C(0x1)
13034 /*
13035 * flags should be set to 2 when request is for the counter mask,
13036 * representing the width of each of the stats counters, rather
13037 * than counters themselves.
13038 */
13039 #define HWRM_FUNC_QSTATS_INPUT_FLAGS_COUNTER_MASK UINT32_C(0x2)
13040 #define HWRM_FUNC_QSTATS_INPUT_FLAGS_LAST HWRM_FUNC_QSTATS_INPUT_FLAGS_COUNTER_MASK
13041 uint8_t unused_0[5];
13042 } hwrm_func_qstats_input_t, *phwrm_func_qstats_input_t;
13043
13044 /* hwrm_func_qstats_output (size:1408b/176B) */
13045
13046 typedef struct hwrm_func_qstats_output {
13047 /* The specific error status for the command. */
13048 uint16_t error_code;
13049 /* The HWRM command request type. */
13050 uint16_t req_type;
13051 /* The sequence ID from the original command. */
13052 uint16_t seq_id;
13053 /* The length of the response data in number of bytes. */
13054 uint16_t resp_len;
13055 /* Number of transmitted unicast packets on the function. */
13056 uint64_t tx_ucast_pkts;
13057 /* Number of transmitted multicast packets on the function. */
13058 uint64_t tx_mcast_pkts;
13059 /* Number of transmitted broadcast packets on the function. */
13060 uint64_t tx_bcast_pkts;
13061 /*
13062 * Number of transmitted packets that were discarded due to
13063 * internal NIC resource problems. For transmit, this
13064 * can only happen if TMP is configured to allow dropping
13065 * in HOL blocking conditions, which is not a normal
13066 * configuration.
13067 */
13068 uint64_t tx_discard_pkts;
13069 /*
13070 * Number of dropped packets on transmit path on the function.
13071 * These are packets that have been marked for drop by
13072 * the TE CFA block or are packets that exceeded the
13073 * transmit MTU limit for the function.
13074 */
13075 uint64_t tx_drop_pkts;
13076 /* Number of transmitted bytes for unicast traffic on the function. */
13077 uint64_t tx_ucast_bytes;
13078 /* Number of transmitted bytes for multicast traffic on the function. */
13079 uint64_t tx_mcast_bytes;
13080 /* Number of transmitted bytes for broadcast traffic on the function. */
13081 uint64_t tx_bcast_bytes;
13082 /* Number of received unicast packets on the function. */
13083 uint64_t rx_ucast_pkts;
13084 /* Number of received multicast packets on the function. */
13085 uint64_t rx_mcast_pkts;
13086 /* Number of received broadcast packets on the function. */
13087 uint64_t rx_bcast_pkts;
13088 /*
13089 * Number of received packets that were discarded on the function
13090 * due to resource limitations. This can happen for 3 reasons.
13091 * # The BD used for the packet has a bad format.
13092 * # There were no BDs available in the ring for the packet.
13093 * # There were no BDs available on-chip for the packet.
13094 */
13095 uint64_t rx_discard_pkts;
13096 /*
13097 * Number of dropped packets on received path on the function.
13098 * These are packets that have been marked for drop by the
13099 * RE CFA.
13100 */
13101 uint64_t rx_drop_pkts;
13102 /* Number of received bytes for unicast traffic on the function. */
13103 uint64_t rx_ucast_bytes;
13104 /* Number of received bytes for multicast traffic on the function. */
13105 uint64_t rx_mcast_bytes;
13106 /* Number of received bytes for broadcast traffic on the function. */
13107 uint64_t rx_bcast_bytes;
13108 /* Number of aggregated unicast packets on the function. */
13109 uint64_t rx_agg_pkts;
13110 /* Number of aggregated unicast bytes on the function. */
13111 uint64_t rx_agg_bytes;
13112 /* Number of aggregation events on the function. */
13113 uint64_t rx_agg_events;
13114 /* Number of aborted aggregations on the function. */
13115 uint64_t rx_agg_aborts;
13116 uint8_t unused_0[7];
13117 /*
13118 * This field is used in Output records to indicate that the output
13119 * is completely written to RAM. This field should be read as '1'
13120 * to indicate that the output has been completely written.
13121 * When writing a command completion or response to an internal processor,
13122 * the order of writes has to be such that this field is written last.
13123 */
13124 uint8_t valid;
13125 } hwrm_func_qstats_output_t, *phwrm_func_qstats_output_t;
13126
13127 /************************
13128 * hwrm_func_qstats_ext *
13129 ************************/
13130
13131
13132 /* hwrm_func_qstats_ext_input (size:256b/32B) */
13133
13134 typedef struct hwrm_func_qstats_ext_input {
13135 /* The HWRM command request type. */
13136 uint16_t req_type;
13137 /*
13138 * The completion ring to send the completion event on. This should
13139 * be the NQ ID returned from the `nq_alloc` HWRM command.
13140 */
13141 uint16_t cmpl_ring;
13142 /*
13143 * The sequence ID is used by the driver for tracking multiple
13144 * commands. This ID is treated as opaque data by the firmware and
13145 * the value is returned in the `hwrm_resp_hdr` upon completion.
13146 */
13147 uint16_t seq_id;
13148 /*
13149 * The target ID of the command:
13150 * * 0x0-0xFFF8 - The function ID
13151 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13152 * * 0xFFFD - Reserved for user-space HWRM interface
13153 * * 0xFFFF - HWRM
13154 */
13155 uint16_t target_id;
13156 /*
13157 * A physical address pointer pointing to a host buffer that the
13158 * command's response data will be written. This can be either a host
13159 * physical address (HPA) or a guest physical address (GPA) and must
13160 * point to a physically contiguous block of memory.
13161 */
13162 uint64_t resp_addr;
13163 /*
13164 * Function ID of the function that is being queried.
13165 * 0xFF... (All Fs) if the query is for the requesting
13166 * function.
13167 * A privileged PF can query for other function's statistics.
13168 */
13169 uint16_t fid;
13170 /* This flags indicates the type of statistics request. */
13171 uint8_t flags;
13172 /* This value is not used to avoid backward compatibility issues. */
13173 #define HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_UNUSED UINT32_C(0x0)
13174 /*
13175 * flags should be set to 1 when request is for only RoCE statistics.
13176 * This will be honored only if the caller_fid is a privileged PF.
13177 * In all other cases FID and caller_fid should be the same.
13178 */
13179 #define HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_ROCE_ONLY UINT32_C(0x1)
13180 /*
13181 * flags should be set to 2 when request is for the counter mask
13182 * representing the width of each of the stats counters, rather
13183 * than counters themselves.
13184 */
13185 #define HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_COUNTER_MASK UINT32_C(0x2)
13186 #define HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_LAST HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_COUNTER_MASK
13187 uint8_t unused_0[1];
13188 uint32_t enables;
13189 /*
13190 * This bit must be '1' for the schq_id and traffic_class fields to
13191 * be configured.
13192 */
13193 #define HWRM_FUNC_QSTATS_EXT_INPUT_ENABLES_SCHQ_ID UINT32_C(0x1)
13194 /* Specifies the SCHQ for which to gather statistics */
13195 uint16_t schq_id;
13196 /*
13197 * Specifies the traffic class for which to gather statistics. Valid
13198 * values are 0 through (max_configurable_queues - 1), where
13199 * max_configurable_queues is in the response of HWRM_QUEUE_QPORTCFG
13200 */
13201 uint16_t traffic_class;
13202 uint8_t unused_1[4];
13203 } hwrm_func_qstats_ext_input_t, *phwrm_func_qstats_ext_input_t;
13204
13205 /* hwrm_func_qstats_ext_output (size:1536b/192B) */
13206
13207 typedef struct hwrm_func_qstats_ext_output {
13208 /* The specific error status for the command. */
13209 uint16_t error_code;
13210 /* The HWRM command request type. */
13211 uint16_t req_type;
13212 /* The sequence ID from the original command. */
13213 uint16_t seq_id;
13214 /* The length of the response data in number of bytes. */
13215 uint16_t resp_len;
13216 /* Number of received unicast packets */
13217 uint64_t rx_ucast_pkts;
13218 /* Number of received multicast packets */
13219 uint64_t rx_mcast_pkts;
13220 /* Number of received broadcast packets */
13221 uint64_t rx_bcast_pkts;
13222 /* Number of discarded packets on received path */
13223 uint64_t rx_discard_pkts;
13224 /* Number of packets on receive path with error */
13225 uint64_t rx_error_pkts;
13226 /* Number of received bytes for unicast traffic */
13227 uint64_t rx_ucast_bytes;
13228 /* Number of received bytes for multicast traffic */
13229 uint64_t rx_mcast_bytes;
13230 /* Number of received bytes for broadcast traffic */
13231 uint64_t rx_bcast_bytes;
13232 /* Number of transmitted unicast packets */
13233 uint64_t tx_ucast_pkts;
13234 /* Number of transmitted multicast packets */
13235 uint64_t tx_mcast_pkts;
13236 /* Number of transmitted broadcast packets */
13237 uint64_t tx_bcast_pkts;
13238 /* Number of packets on transmit path with error */
13239 uint64_t tx_error_pkts;
13240 /* Number of discarded packets on transmit path */
13241 uint64_t tx_discard_pkts;
13242 /* Number of transmitted bytes for unicast traffic */
13243 uint64_t tx_ucast_bytes;
13244 /* Number of transmitted bytes for multicast traffic */
13245 uint64_t tx_mcast_bytes;
13246 /* Number of transmitted bytes for broadcast traffic */
13247 uint64_t tx_bcast_bytes;
13248 /* Number of TPA eligible packets */
13249 uint64_t rx_tpa_eligible_pkt;
13250 /* Number of TPA eligible bytes */
13251 uint64_t rx_tpa_eligible_bytes;
13252 /* Number of TPA packets */
13253 uint64_t rx_tpa_pkt;
13254 /* Number of TPA bytes */
13255 uint64_t rx_tpa_bytes;
13256 /* Number of TPA errors */
13257 uint64_t rx_tpa_errors;
13258 /* Number of TPA errors */
13259 uint64_t rx_tpa_events;
13260 uint8_t unused_0[7];
13261 /*
13262 * This field is used in Output records to indicate that the output
13263 * is completely written to RAM. This field should be read as '1'
13264 * to indicate that the output has been completely written.
13265 * When writing a command completion or response to an internal processor,
13266 * the order of writes has to be such that this field is written last.
13267 */
13268 uint8_t valid;
13269 } hwrm_func_qstats_ext_output_t, *phwrm_func_qstats_ext_output_t;
13270
13271 /***********************
13272 * hwrm_func_clr_stats *
13273 ***********************/
13274
13275
13276 /* hwrm_func_clr_stats_input (size:192b/24B) */
13277
13278 typedef struct hwrm_func_clr_stats_input {
13279 /* The HWRM command request type. */
13280 uint16_t req_type;
13281 /*
13282 * The completion ring to send the completion event on. This should
13283 * be the NQ ID returned from the `nq_alloc` HWRM command.
13284 */
13285 uint16_t cmpl_ring;
13286 /*
13287 * The sequence ID is used by the driver for tracking multiple
13288 * commands. This ID is treated as opaque data by the firmware and
13289 * the value is returned in the `hwrm_resp_hdr` upon completion.
13290 */
13291 uint16_t seq_id;
13292 /*
13293 * The target ID of the command:
13294 * * 0x0-0xFFF8 - The function ID
13295 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13296 * * 0xFFFD - Reserved for user-space HWRM interface
13297 * * 0xFFFF - HWRM
13298 */
13299 uint16_t target_id;
13300 /*
13301 * A physical address pointer pointing to a host buffer that the
13302 * command's response data will be written. This can be either a host
13303 * physical address (HPA) or a guest physical address (GPA) and must
13304 * point to a physically contiguous block of memory.
13305 */
13306 uint64_t resp_addr;
13307 /*
13308 * Function ID of the function.
13309 * 0xFF... (All Fs) if the query is for the requesting
13310 * function.
13311 */
13312 uint16_t fid;
13313 uint8_t unused_0[6];
13314 } hwrm_func_clr_stats_input_t, *phwrm_func_clr_stats_input_t;
13315
13316 /* hwrm_func_clr_stats_output (size:128b/16B) */
13317
13318 typedef struct hwrm_func_clr_stats_output {
13319 /* The specific error status for the command. */
13320 uint16_t error_code;
13321 /* The HWRM command request type. */
13322 uint16_t req_type;
13323 /* The sequence ID from the original command. */
13324 uint16_t seq_id;
13325 /* The length of the response data in number of bytes. */
13326 uint16_t resp_len;
13327 uint8_t unused_0[7];
13328 /*
13329 * This field is used in Output records to indicate that the output
13330 * is completely written to RAM. This field should be read as '1'
13331 * to indicate that the output has been completely written.
13332 * When writing a command completion or response to an internal processor,
13333 * the order of writes has to be such that this field is written last.
13334 */
13335 uint8_t valid;
13336 } hwrm_func_clr_stats_output_t, *phwrm_func_clr_stats_output_t;
13337
13338 /**************************
13339 * hwrm_func_vf_resc_free *
13340 **************************/
13341
13342
13343 /* hwrm_func_vf_resc_free_input (size:192b/24B) */
13344
13345 typedef struct hwrm_func_vf_resc_free_input {
13346 /* The HWRM command request type. */
13347 uint16_t req_type;
13348 /*
13349 * The completion ring to send the completion event on. This should
13350 * be the NQ ID returned from the `nq_alloc` HWRM command.
13351 */
13352 uint16_t cmpl_ring;
13353 /*
13354 * The sequence ID is used by the driver for tracking multiple
13355 * commands. This ID is treated as opaque data by the firmware and
13356 * the value is returned in the `hwrm_resp_hdr` upon completion.
13357 */
13358 uint16_t seq_id;
13359 /*
13360 * The target ID of the command:
13361 * * 0x0-0xFFF8 - The function ID
13362 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13363 * * 0xFFFD - Reserved for user-space HWRM interface
13364 * * 0xFFFF - HWRM
13365 */
13366 uint16_t target_id;
13367 /*
13368 * A physical address pointer pointing to a host buffer that the
13369 * command's response data will be written. This can be either a host
13370 * physical address (HPA) or a guest physical address (GPA) and must
13371 * point to a physically contiguous block of memory.
13372 */
13373 uint64_t resp_addr;
13374 /*
13375 * This value is used to identify a Virtual Function (VF).
13376 * The scope of VF ID is local within a PF.
13377 */
13378 uint16_t vf_id;
13379 uint8_t unused_0[6];
13380 } hwrm_func_vf_resc_free_input_t, *phwrm_func_vf_resc_free_input_t;
13381
13382 /* hwrm_func_vf_resc_free_output (size:128b/16B) */
13383
13384 typedef struct hwrm_func_vf_resc_free_output {
13385 /* The specific error status for the command. */
13386 uint16_t error_code;
13387 /* The HWRM command request type. */
13388 uint16_t req_type;
13389 /* The sequence ID from the original command. */
13390 uint16_t seq_id;
13391 /* The length of the response data in number of bytes. */
13392 uint16_t resp_len;
13393 uint8_t unused_0[7];
13394 /*
13395 * This field is used in Output records to indicate that the output
13396 * is completely written to RAM. This field should be read as '1'
13397 * to indicate that the output has been completely written.
13398 * When writing a command completion or response to an internal processor,
13399 * the order of writes has to be such that this field is written last.
13400 */
13401 uint8_t valid;
13402 } hwrm_func_vf_resc_free_output_t, *phwrm_func_vf_resc_free_output_t;
13403
13404 /**********************
13405 * hwrm_func_drv_rgtr *
13406 **********************/
13407
13408
13409 /* hwrm_func_drv_rgtr_input (size:896b/112B) */
13410
13411 typedef struct hwrm_func_drv_rgtr_input {
13412 /* The HWRM command request type. */
13413 uint16_t req_type;
13414 /*
13415 * The completion ring to send the completion event on. This should
13416 * be the NQ ID returned from the `nq_alloc` HWRM command.
13417 */
13418 uint16_t cmpl_ring;
13419 /*
13420 * The sequence ID is used by the driver for tracking multiple
13421 * commands. This ID is treated as opaque data by the firmware and
13422 * the value is returned in the `hwrm_resp_hdr` upon completion.
13423 */
13424 uint16_t seq_id;
13425 /*
13426 * The target ID of the command:
13427 * * 0x0-0xFFF8 - The function ID
13428 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13429 * * 0xFFFD - Reserved for user-space HWRM interface
13430 * * 0xFFFF - HWRM
13431 */
13432 uint16_t target_id;
13433 /*
13434 * A physical address pointer pointing to a host buffer that the
13435 * command's response data will be written. This can be either a host
13436 * physical address (HPA) or a guest physical address (GPA) and must
13437 * point to a physically contiguous block of memory.
13438 */
13439 uint64_t resp_addr;
13440 uint32_t flags;
13441 /*
13442 * When this bit is '1', the function driver is requesting
13443 * all requests from its children VF drivers to be
13444 * forwarded to itself.
13445 * This flag can only be set by the PF driver.
13446 * If a VF driver sets this flag, it should be ignored
13447 * by the HWRM.
13448 */
13449 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_ALL_MODE UINT32_C(0x1)
13450 /*
13451 * When this bit is '1', the function is requesting none of
13452 * the requests from its children VF drivers to be
13453 * forwarded to itself.
13454 * This flag can only be set by the PF driver.
13455 * If a VF driver sets this flag, it should be ignored
13456 * by the HWRM.
13457 */
13458 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_NONE_MODE UINT32_C(0x2)
13459 /*
13460 * When this bit is '1', then ver_maj_8b, ver_min_8b, ver_upd_8b
13461 * fields shall be ignored and ver_maj, ver_min, ver_upd
13462 * and ver_patch shall be used for the driver version information.
13463 * When this bit is '', then ver_maj_8b, ver_min_8b, ver_upd_8b
13464 * fields shall be used for the driver version information and
13465 * ver_maj, ver_min, ver_upd and ver_patch shall be ignored.
13466 */
13467 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_16BIT_VER_MODE UINT32_C(0x4)
13468 /*
13469 * When this bit is '1', the function is indicating support of
13470 * 64bit flow handle. The firmware that only supports 64bit flow
13471 * handle should check this bit before allowing processing of
13472 * HWRM_CFA_FLOW_XXX commands from the requesting function as firmware
13473 * with 64bit flow handle support can only be compatible with drivers
13474 * that support 64bit flow handle. The legacy drivers that don't support
13475 * 64bit flow handle won't be able to use HWRM_CFA_FLOW_XXX commands when
13476 * running with new firmware that only supports 64bit flow handle. The new
13477 * firmware support 64bit flow handle returns HWRM_ERR_CODE_CMD_NOT_SUPPORTED
13478 * status to the legacy driver when encounters these commands.
13479 */
13480 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FLOW_HANDLE_64BIT_MODE UINT32_C(0x8)
13481 /*
13482 * When this bit is '1', the function is indicating support of
13483 * Hot Reset. The driver interface will destroy the resources,
13484 * unregister the function and register again up on receiving
13485 * the RESET_NOTIFY Async notification from the core firmware.
13486 * The core firmware will this use flag and trigger the Hot Reset
13487 * process only if all the registered driver instances are capable
13488 * of this support.
13489 */
13490 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_HOT_RESET_SUPPORT UINT32_C(0x10)
13491 /*
13492 * When this bit is 1, the function is indicating the support of the
13493 * error recovery capability. Error recovery support will be used by
13494 * firmware only if all the driver instances support error recovery
13495 * process. By setting this bit, driver is indicating support for
13496 * corresponding async event completion message. These will be
13497 * delivered to the driver even if they did not register for it.
13498 * If supported, after receiving reset notify async event with fatal
13499 * flag set in event data1, then all the drivers have to tear down
13500 * their resources without sending any HWRM commands to FW.
13501 */
13502 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_ERROR_RECOVERY_SUPPORT UINT32_C(0x20)
13503 /*
13504 * When this bit is 1, the function is indicating the support of the
13505 * Master capability. The Firmware will use this capability to select the
13506 * Master function. The master function will be used to initiate
13507 * designated functionality like error recovery etc… If none of the
13508 * registered PF’s or trusted VF’s indicate this support, then
13509 * firmware will select the 1st registered PF as Master capable instance.
13510 */
13511 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_MASTER_SUPPORT UINT32_C(0x40)
13512 /*
13513 * When this bit is 1, the function is indicating the support of the
13514 * fast reset capability. Fast reset support will be used by
13515 * firmware only if all the driver instances support fast reset
13516 * process. By setting this bit, driver is indicating support for
13517 * corresponding async event completion message. These will be
13518 * delivered to the driver even if they did not register for it.
13519 * If supported, after receiving reset notify async event with fast
13520 * reset flag set in event data1, then all the drivers have to tear
13521 * down their resources without sending any HWRM commands to FW.
13522 */
13523 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FAST_RESET_SUPPORT UINT32_C(0x80)
13524 uint32_t enables;
13525 /*
13526 * This bit must be '1' for the os_type field to be
13527 * configured.
13528 */
13529 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_OS_TYPE UINT32_C(0x1)
13530 /*
13531 * This bit must be '1' for the ver field to be
13532 * configured.
13533 */
13534 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER UINT32_C(0x2)
13535 /*
13536 * This bit must be '1' for the timestamp field to be
13537 * configured.
13538 */
13539 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_TIMESTAMP UINT32_C(0x4)
13540 /*
13541 * This bit must be '1' for the vf_req_fwd field to be
13542 * configured.
13543 */
13544 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VF_REQ_FWD UINT32_C(0x8)
13545 /*
13546 * This bit must be '1' for the async_event_fwd field to be
13547 * configured.
13548 */
13549 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD UINT32_C(0x10)
13550 /* This value indicates the type of OS. The values are based on CIM_OperatingSystem.mof file as published by the DMTF. */
13551 uint16_t os_type;
13552 /* Unknown */
13553 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UNKNOWN UINT32_C(0x0)
13554 /* Other OS not listed below. */
13555 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_OTHER UINT32_C(0x1)
13556 /* MSDOS OS. */
13557 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_MSDOS UINT32_C(0xe)
13558 /* Windows OS. */
13559 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WINDOWS UINT32_C(0x12)
13560 /* Solaris OS. */
13561 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_SOLARIS UINT32_C(0x1d)
13562 /* Linux OS. */
13563 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LINUX UINT32_C(0x24)
13564 /* FreeBSD OS. */
13565 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_FREEBSD UINT32_C(0x2a)
13566 /* VMware ESXi OS. */
13567 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_ESXI UINT32_C(0x68)
13568 /* Microsoft Windows 8 64-bit OS. */
13569 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN864 UINT32_C(0x73)
13570 /* Microsoft Windows Server 2012 R2 OS. */
13571 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74)
13572 /* UEFI driver. */
13573 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UEFI UINT32_C(0x8000)
13574 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LAST HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UEFI
13575 /* This is the 8bit major version of the driver. */
13576 uint8_t ver_maj_8b;
13577 /* This is the 8bit minor version of the driver. */
13578 uint8_t ver_min_8b;
13579 /* This is the 8bit update version of the driver. */
13580 uint8_t ver_upd_8b;
13581 uint8_t unused_0[3];
13582 /*
13583 * This is a 32-bit timestamp provided by the driver for
13584 * keep alive.
13585 * The timestamp is in multiples of 1ms.
13586 */
13587 uint32_t timestamp;
13588 uint8_t unused_1[4];
13589 /*
13590 * This is a 256-bit bit mask provided by the PF driver for
13591 * letting the HWRM know what commands issued by the VF driver
13592 * to the HWRM should be forwarded to the PF driver.
13593 * Nth bit refers to the Nth req_type.
13594 *
13595 * Setting Nth bit to 1 indicates that requests from the
13596 * VF driver with req_type equal to N shall be forwarded to
13597 * the parent PF driver.
13598 *
13599 * This field is not valid for the VF driver.
13600 */
13601 uint32_t vf_req_fwd[8];
13602 /*
13603 * This is a 256-bit bit mask provided by the function driver
13604 * (PF or VF driver) to indicate the list of asynchronous event
13605 * completions to be forwarded.
13606 *
13607 * Nth bit refers to the Nth event_id.
13608 *
13609 * Setting Nth bit to 1 by the function driver shall result in
13610 * the HWRM forwarding asynchronous event completion with
13611 * event_id equal to N.
13612 *
13613 * If all bits are set to 0 (value of 0), then the HWRM shall
13614 * not forward any asynchronous event completion to this
13615 * function driver.
13616 */
13617 uint32_t async_event_fwd[8];
13618 /* This is the 16bit major version of the driver. */
13619 uint16_t ver_maj;
13620 /* This is the 16bit minor version of the driver. */
13621 uint16_t ver_min;
13622 /* This is the 16bit update version of the driver. */
13623 uint16_t ver_upd;
13624 /* This is the 16bit patch version of the driver. */
13625 uint16_t ver_patch;
13626 } hwrm_func_drv_rgtr_input_t, *phwrm_func_drv_rgtr_input_t;
13627
13628 /* hwrm_func_drv_rgtr_output (size:128b/16B) */
13629
13630 typedef struct hwrm_func_drv_rgtr_output {
13631 /* The specific error status for the command. */
13632 uint16_t error_code;
13633 /* The HWRM command request type. */
13634 uint16_t req_type;
13635 /* The sequence ID from the original command. */
13636 uint16_t seq_id;
13637 /* The length of the response data in number of bytes. */
13638 uint16_t resp_len;
13639 uint32_t flags;
13640 /*
13641 * When this bit is '1', it indicates that the
13642 * HWRM_FUNC_DRV_IF_CHANGE call is supported.
13643 */
13644 #define HWRM_FUNC_DRV_RGTR_OUTPUT_FLAGS_IF_CHANGE_SUPPORTED UINT32_C(0x1)
13645 uint8_t unused_0[3];
13646 /*
13647 * This field is used in Output records to indicate that the output
13648 * is completely written to RAM. This field should be read as '1'
13649 * to indicate that the output has been completely written.
13650 * When writing a command completion or response to an internal processor,
13651 * the order of writes has to be such that this field is written last.
13652 */
13653 uint8_t valid;
13654 } hwrm_func_drv_rgtr_output_t, *phwrm_func_drv_rgtr_output_t;
13655
13656 /************************
13657 * hwrm_func_drv_unrgtr *
13658 ************************/
13659
13660
13661 /* hwrm_func_drv_unrgtr_input (size:192b/24B) */
13662
13663 typedef struct hwrm_func_drv_unrgtr_input {
13664 /* The HWRM command request type. */
13665 uint16_t req_type;
13666 /*
13667 * The completion ring to send the completion event on. This should
13668 * be the NQ ID returned from the `nq_alloc` HWRM command.
13669 */
13670 uint16_t cmpl_ring;
13671 /*
13672 * The sequence ID is used by the driver for tracking multiple
13673 * commands. This ID is treated as opaque data by the firmware and
13674 * the value is returned in the `hwrm_resp_hdr` upon completion.
13675 */
13676 uint16_t seq_id;
13677 /*
13678 * The target ID of the command:
13679 * * 0x0-0xFFF8 - The function ID
13680 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13681 * * 0xFFFD - Reserved for user-space HWRM interface
13682 * * 0xFFFF - HWRM
13683 */
13684 uint16_t target_id;
13685 /*
13686 * A physical address pointer pointing to a host buffer that the
13687 * command's response data will be written. This can be either a host
13688 * physical address (HPA) or a guest physical address (GPA) and must
13689 * point to a physically contiguous block of memory.
13690 */
13691 uint64_t resp_addr;
13692 uint32_t flags;
13693 /*
13694 * When this bit is '1', the function driver is notifying
13695 * the HWRM to prepare for the shutdown.
13696 */
13697 #define HWRM_FUNC_DRV_UNRGTR_INPUT_FLAGS_PREPARE_FOR_SHUTDOWN UINT32_C(0x1)
13698 uint8_t unused_0[4];
13699 } hwrm_func_drv_unrgtr_input_t, *phwrm_func_drv_unrgtr_input_t;
13700
13701 /* hwrm_func_drv_unrgtr_output (size:128b/16B) */
13702
13703 typedef struct hwrm_func_drv_unrgtr_output {
13704 /* The specific error status for the command. */
13705 uint16_t error_code;
13706 /* The HWRM command request type. */
13707 uint16_t req_type;
13708 /* The sequence ID from the original command. */
13709 uint16_t seq_id;
13710 /* The length of the response data in number of bytes. */
13711 uint16_t resp_len;
13712 uint8_t unused_0[7];
13713 /*
13714 * This field is used in Output records to indicate that the output
13715 * is completely written to RAM. This field should be read as '1'
13716 * to indicate that the output has been completely written.
13717 * When writing a command completion or response to an internal processor,
13718 * the order of writes has to be such that this field is written last.
13719 */
13720 uint8_t valid;
13721 } hwrm_func_drv_unrgtr_output_t, *phwrm_func_drv_unrgtr_output_t;
13722
13723 /**********************
13724 * hwrm_func_buf_rgtr *
13725 **********************/
13726
13727
13728 /* hwrm_func_buf_rgtr_input (size:1024b/128B) */
13729
13730 typedef struct hwrm_func_buf_rgtr_input {
13731 /* The HWRM command request type. */
13732 uint16_t req_type;
13733 /*
13734 * The completion ring to send the completion event on. This should
13735 * be the NQ ID returned from the `nq_alloc` HWRM command.
13736 */
13737 uint16_t cmpl_ring;
13738 /*
13739 * The sequence ID is used by the driver for tracking multiple
13740 * commands. This ID is treated as opaque data by the firmware and
13741 * the value is returned in the `hwrm_resp_hdr` upon completion.
13742 */
13743 uint16_t seq_id;
13744 /*
13745 * The target ID of the command:
13746 * * 0x0-0xFFF8 - The function ID
13747 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13748 * * 0xFFFD - Reserved for user-space HWRM interface
13749 * * 0xFFFF - HWRM
13750 */
13751 uint16_t target_id;
13752 /*
13753 * A physical address pointer pointing to a host buffer that the
13754 * command's response data will be written. This can be either a host
13755 * physical address (HPA) or a guest physical address (GPA) and must
13756 * point to a physically contiguous block of memory.
13757 */
13758 uint64_t resp_addr;
13759 uint32_t enables;
13760 /*
13761 * This bit must be '1' for the vf_id field to be
13762 * configured.
13763 */
13764 #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_VF_ID UINT32_C(0x1)
13765 /*
13766 * This bit must be '1' for the err_buf_addr field to be
13767 * configured.
13768 */
13769 #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_ERR_BUF_ADDR UINT32_C(0x2)
13770 /*
13771 * This value is used to identify a Virtual Function (VF).
13772 * The scope of VF ID is local within a PF.
13773 */
13774 uint16_t vf_id;
13775 /*
13776 * This field represents the number of pages used for request
13777 * buffer(s).
13778 */
13779 uint16_t req_buf_num_pages;
13780 /*
13781 * This field represents the page size used for request
13782 * buffer(s).
13783 */
13784 uint16_t req_buf_page_size;
13785 /* 16 bytes */
13786 #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_16B UINT32_C(0x4)
13787 /* 4 Kbytes */
13788 #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4K UINT32_C(0xc)
13789 /* 8 Kbytes */
13790 #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_8K UINT32_C(0xd)
13791 /* 64 Kbytes */
13792 #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_64K UINT32_C(0x10)
13793 /* 2 Mbytes */
13794 #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_2M UINT32_C(0x15)
13795 /* 4 Mbytes */
13796 #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4M UINT32_C(0x16)
13797 /* 1 Gbytes */
13798 #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G UINT32_C(0x1e)
13799 #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_LAST HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G
13800 /* The length of the request buffer per VF in bytes. */
13801 uint16_t req_buf_len;
13802 /* The length of the response buffer in bytes. */
13803 uint16_t resp_buf_len;
13804 uint8_t unused_0[2];
13805 /* This field represents the page address of page #0. */
13806 uint64_t req_buf_page_addr0;
13807 /* This field represents the page address of page #1. */
13808 uint64_t req_buf_page_addr1;
13809 /* This field represents the page address of page #2. */
13810 uint64_t req_buf_page_addr2;
13811 /* This field represents the page address of page #3. */
13812 uint64_t req_buf_page_addr3;
13813 /* This field represents the page address of page #4. */
13814 uint64_t req_buf_page_addr4;
13815 /* This field represents the page address of page #5. */
13816 uint64_t req_buf_page_addr5;
13817 /* This field represents the page address of page #6. */
13818 uint64_t req_buf_page_addr6;
13819 /* This field represents the page address of page #7. */
13820 uint64_t req_buf_page_addr7;
13821 /* This field represents the page address of page #8. */
13822 uint64_t req_buf_page_addr8;
13823 /* This field represents the page address of page #9. */
13824 uint64_t req_buf_page_addr9;
13825 /*
13826 * This field is used to receive the error reporting from
13827 * the chipset. Only applicable for PFs.
13828 */
13829 uint64_t error_buf_addr;
13830 /*
13831 * This field is used to receive the response forwarded by the
13832 * HWRM.
13833 */
13834 uint64_t resp_buf_addr;
13835 } hwrm_func_buf_rgtr_input_t, *phwrm_func_buf_rgtr_input_t;
13836
13837 /* hwrm_func_buf_rgtr_output (size:128b/16B) */
13838
13839 typedef struct hwrm_func_buf_rgtr_output {
13840 /* The specific error status for the command. */
13841 uint16_t error_code;
13842 /* The HWRM command request type. */
13843 uint16_t req_type;
13844 /* The sequence ID from the original command. */
13845 uint16_t seq_id;
13846 /* The length of the response data in number of bytes. */
13847 uint16_t resp_len;
13848 uint8_t unused_0[7];
13849 /*
13850 * This field is used in Output records to indicate that the output
13851 * is completely written to RAM. This field should be read as '1'
13852 * to indicate that the output has been completely written.
13853 * When writing a command completion or response to an internal processor,
13854 * the order of writes has to be such that this field is written last.
13855 */
13856 uint8_t valid;
13857 } hwrm_func_buf_rgtr_output_t, *phwrm_func_buf_rgtr_output_t;
13858
13859 /************************
13860 * hwrm_func_buf_unrgtr *
13861 ************************/
13862
13863
13864 /* hwrm_func_buf_unrgtr_input (size:192b/24B) */
13865
13866 typedef struct hwrm_func_buf_unrgtr_input {
13867 /* The HWRM command request type. */
13868 uint16_t req_type;
13869 /*
13870 * The completion ring to send the completion event on. This should
13871 * be the NQ ID returned from the `nq_alloc` HWRM command.
13872 */
13873 uint16_t cmpl_ring;
13874 /*
13875 * The sequence ID is used by the driver for tracking multiple
13876 * commands. This ID is treated as opaque data by the firmware and
13877 * the value is returned in the `hwrm_resp_hdr` upon completion.
13878 */
13879 uint16_t seq_id;
13880 /*
13881 * The target ID of the command:
13882 * * 0x0-0xFFF8 - The function ID
13883 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13884 * * 0xFFFD - Reserved for user-space HWRM interface
13885 * * 0xFFFF - HWRM
13886 */
13887 uint16_t target_id;
13888 /*
13889 * A physical address pointer pointing to a host buffer that the
13890 * command's response data will be written. This can be either a host
13891 * physical address (HPA) or a guest physical address (GPA) and must
13892 * point to a physically contiguous block of memory.
13893 */
13894 uint64_t resp_addr;
13895 uint32_t enables;
13896 /*
13897 * This bit must be '1' for the vf_id field to be
13898 * configured.
13899 */
13900 #define HWRM_FUNC_BUF_UNRGTR_INPUT_ENABLES_VF_ID UINT32_C(0x1)
13901 /*
13902 * This value is used to identify a Virtual Function (VF).
13903 * The scope of VF ID is local within a PF.
13904 */
13905 uint16_t vf_id;
13906 uint8_t unused_0[2];
13907 } hwrm_func_buf_unrgtr_input_t, *phwrm_func_buf_unrgtr_input_t;
13908
13909 /* hwrm_func_buf_unrgtr_output (size:128b/16B) */
13910
13911 typedef struct hwrm_func_buf_unrgtr_output {
13912 /* The specific error status for the command. */
13913 uint16_t error_code;
13914 /* The HWRM command request type. */
13915 uint16_t req_type;
13916 /* The sequence ID from the original command. */
13917 uint16_t seq_id;
13918 /* The length of the response data in number of bytes. */
13919 uint16_t resp_len;
13920 uint8_t unused_0[7];
13921 /*
13922 * This field is used in Output records to indicate that the output
13923 * is completely written to RAM. This field should be read as '1'
13924 * to indicate that the output has been completely written.
13925 * When writing a command completion or response to an internal processor,
13926 * the order of writes has to be such that this field is written last.
13927 */
13928 uint8_t valid;
13929 } hwrm_func_buf_unrgtr_output_t, *phwrm_func_buf_unrgtr_output_t;
13930
13931 /**********************
13932 * hwrm_func_drv_qver *
13933 **********************/
13934
13935
13936 /* hwrm_func_drv_qver_input (size:192b/24B) */
13937
13938 typedef struct hwrm_func_drv_qver_input {
13939 /* The HWRM command request type. */
13940 uint16_t req_type;
13941 /*
13942 * The completion ring to send the completion event on. This should
13943 * be the NQ ID returned from the `nq_alloc` HWRM command.
13944 */
13945 uint16_t cmpl_ring;
13946 /*
13947 * The sequence ID is used by the driver for tracking multiple
13948 * commands. This ID is treated as opaque data by the firmware and
13949 * the value is returned in the `hwrm_resp_hdr` upon completion.
13950 */
13951 uint16_t seq_id;
13952 /*
13953 * The target ID of the command:
13954 * * 0x0-0xFFF8 - The function ID
13955 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13956 * * 0xFFFD - Reserved for user-space HWRM interface
13957 * * 0xFFFF - HWRM
13958 */
13959 uint16_t target_id;
13960 /*
13961 * A physical address pointer pointing to a host buffer that the
13962 * command's response data will be written. This can be either a host
13963 * physical address (HPA) or a guest physical address (GPA) and must
13964 * point to a physically contiguous block of memory.
13965 */
13966 uint64_t resp_addr;
13967 /* Reserved for future use. */
13968 uint32_t reserved;
13969 /*
13970 * Function ID of the function that is being queried.
13971 * 0xFF... (All Fs) if the query is for the requesting
13972 * function.
13973 */
13974 uint16_t fid;
13975 uint8_t unused_0[2];
13976 } hwrm_func_drv_qver_input_t, *phwrm_func_drv_qver_input_t;
13977
13978 /* hwrm_func_drv_qver_output (size:256b/32B) */
13979
13980 typedef struct hwrm_func_drv_qver_output {
13981 /* The specific error status for the command. */
13982 uint16_t error_code;
13983 /* The HWRM command request type. */
13984 uint16_t req_type;
13985 /* The sequence ID from the original command. */
13986 uint16_t seq_id;
13987 /* The length of the response data in number of bytes. */
13988 uint16_t resp_len;
13989 /* This value indicates the type of OS. The values are based on CIM_OperatingSystem.mof file as published by the DMTF. */
13990 uint16_t os_type;
13991 /* Unknown */
13992 #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UNKNOWN UINT32_C(0x0)
13993 /* Other OS not listed below. */
13994 #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_OTHER UINT32_C(0x1)
13995 /* MSDOS OS. */
13996 #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_MSDOS UINT32_C(0xe)
13997 /* Windows OS. */
13998 #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WINDOWS UINT32_C(0x12)
13999 /* Solaris OS. */
14000 #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_SOLARIS UINT32_C(0x1d)
14001 /* Linux OS. */
14002 #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_LINUX UINT32_C(0x24)
14003 /* FreeBSD OS. */
14004 #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_FREEBSD UINT32_C(0x2a)
14005 /* VMware ESXi OS. */
14006 #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_ESXI UINT32_C(0x68)
14007 /* Microsoft Windows 8 64-bit OS. */
14008 #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN864 UINT32_C(0x73)
14009 /* Microsoft Windows Server 2012 R2 OS. */
14010 #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74)
14011 /* UEFI driver. */
14012 #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UEFI UINT32_C(0x8000)
14013 #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_LAST HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UEFI
14014 /* This is the 8bit major version of the driver. */
14015 uint8_t ver_maj_8b;
14016 /* This is the 8bit minor version of the driver. */
14017 uint8_t ver_min_8b;
14018 /* This is the 8bit update version of the driver. */
14019 uint8_t ver_upd_8b;
14020 uint8_t unused_0[3];
14021 /* This is the 16bit major version of the driver. */
14022 uint16_t ver_maj;
14023 /* This is the 16bit minor version of the driver. */
14024 uint16_t ver_min;
14025 /* This is the 16bit update version of the driver. */
14026 uint16_t ver_upd;
14027 /* This is the 16bit patch version of the driver. */
14028 uint16_t ver_patch;
14029 uint8_t unused_1[7];
14030 /*
14031 * This field is used in Output records to indicate that the output
14032 * is completely written to RAM. This field should be read as '1'
14033 * to indicate that the output has been completely written.
14034 * When writing a command completion or response to an internal processor,
14035 * the order of writes has to be such that this field is written last.
14036 */
14037 uint8_t valid;
14038 } hwrm_func_drv_qver_output_t, *phwrm_func_drv_qver_output_t;
14039
14040 /****************************
14041 * hwrm_func_resource_qcaps *
14042 ****************************/
14043
14044
14045 /* hwrm_func_resource_qcaps_input (size:192b/24B) */
14046
14047 typedef struct hwrm_func_resource_qcaps_input {
14048 /* The HWRM command request type. */
14049 uint16_t req_type;
14050 /*
14051 * The completion ring to send the completion event on. This should
14052 * be the NQ ID returned from the `nq_alloc` HWRM command.
14053 */
14054 uint16_t cmpl_ring;
14055 /*
14056 * The sequence ID is used by the driver for tracking multiple
14057 * commands. This ID is treated as opaque data by the firmware and
14058 * the value is returned in the `hwrm_resp_hdr` upon completion.
14059 */
14060 uint16_t seq_id;
14061 /*
14062 * The target ID of the command:
14063 * * 0x0-0xFFF8 - The function ID
14064 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14065 * * 0xFFFD - Reserved for user-space HWRM interface
14066 * * 0xFFFF - HWRM
14067 */
14068 uint16_t target_id;
14069 /*
14070 * A physical address pointer pointing to a host buffer that the
14071 * command's response data will be written. This can be either a host
14072 * physical address (HPA) or a guest physical address (GPA) and must
14073 * point to a physically contiguous block of memory.
14074 */
14075 uint64_t resp_addr;
14076 /*
14077 * Function ID of the function that is being queried.
14078 * 0xFF... (All Fs) if the query is for the requesting
14079 * function.
14080 */
14081 uint16_t fid;
14082 uint8_t unused_0[6];
14083 } hwrm_func_resource_qcaps_input_t, *phwrm_func_resource_qcaps_input_t;
14084
14085 /* hwrm_func_resource_qcaps_output (size:448b/56B) */
14086
14087 typedef struct hwrm_func_resource_qcaps_output {
14088 /* The specific error status for the command. */
14089 uint16_t error_code;
14090 /* The HWRM command request type. */
14091 uint16_t req_type;
14092 /* The sequence ID from the original command. */
14093 uint16_t seq_id;
14094 /* The length of the response data in number of bytes. */
14095 uint16_t resp_len;
14096 /* Maximum guaranteed number of VFs supported by PF. Not applicable for VFs. */
14097 uint16_t max_vfs;
14098 /* Maximum guaranteed number of MSI-X vectors supported by function */
14099 uint16_t max_msix;
14100 /* Hint of strategy to be used by PF driver to reserve resources for its VF */
14101 uint16_t vf_reservation_strategy;
14102 /* The PF driver should evenly divide its remaining resources among all VFs. */
14103 #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MAXIMAL UINT32_C(0x0)
14104 /* The PF driver should only reserve minimal resources for each VF. */
14105 #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL UINT32_C(0x1)
14106 /*
14107 * The PF driver should not reserve any resources for each VF until the
14108 * the VF interface is brought up.
14109 */
14110 #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC UINT32_C(0x2)
14111 #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_LAST HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC
14112 /* Minimum guaranteed number of RSS/COS contexts */
14113 uint16_t min_rsscos_ctx;
14114 /* Maximum non-guaranteed number of RSS/COS contexts */
14115 uint16_t max_rsscos_ctx;
14116 /* Minimum guaranteed number of completion rings */
14117 uint16_t min_cmpl_rings;
14118 /* Maximum non-guaranteed number of completion rings */
14119 uint16_t max_cmpl_rings;
14120 /* Minimum guaranteed number of transmit rings */
14121 uint16_t min_tx_rings;
14122 /* Maximum non-guaranteed number of transmit rings */
14123 uint16_t max_tx_rings;
14124 /* Minimum guaranteed number of receive rings */
14125 uint16_t min_rx_rings;
14126 /* Maximum non-guaranteed number of receive rings */
14127 uint16_t max_rx_rings;
14128 /* Minimum guaranteed number of L2 contexts */
14129 uint16_t min_l2_ctxs;
14130 /* Maximum non-guaranteed number of L2 contexts */
14131 uint16_t max_l2_ctxs;
14132 /* Minimum guaranteed number of VNICs */
14133 uint16_t min_vnics;
14134 /* Maximum non-guaranteed number of VNICs */
14135 uint16_t max_vnics;
14136 /* Minimum guaranteed number of statistic contexts */
14137 uint16_t min_stat_ctx;
14138 /* Maximum non-guaranteed number of statistic contexts */
14139 uint16_t max_stat_ctx;
14140 /* Minimum guaranteed number of ring groups */
14141 uint16_t min_hw_ring_grps;
14142 /* Maximum non-guaranteed number of ring groups */
14143 uint16_t max_hw_ring_grps;
14144 /*
14145 * Maximum number of inputs into the transmit scheduler for this function.
14146 * The number of TX rings assigned to the function cannot exceed this value.
14147 */
14148 uint16_t max_tx_scheduler_inputs;
14149 uint16_t flags;
14150 /*
14151 * When this bit is '1', it indicates that VF_RESOURCE_CFG supports
14152 * feature to reserve all minimum resources when minimum >= 1, otherwise
14153 * returns an error.
14154 */
14155 #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_FLAGS_MIN_GUARANTEED UINT32_C(0x1)
14156 uint8_t unused_0[5];
14157 /*
14158 * This field is used in Output records to indicate that the output
14159 * is completely written to RAM. This field should be read as '1'
14160 * to indicate that the output has been completely written.
14161 * When writing a command completion or response to an internal processor,
14162 * the order of writes has to be such that this field is written last.
14163 */
14164 uint8_t valid;
14165 } hwrm_func_resource_qcaps_output_t, *phwrm_func_resource_qcaps_output_t;
14166
14167 /*****************************
14168 * hwrm_func_vf_resource_cfg *
14169 *****************************/
14170
14171
14172 /* hwrm_func_vf_resource_cfg_input (size:448b/56B) */
14173
14174 typedef struct hwrm_func_vf_resource_cfg_input {
14175 /* The HWRM command request type. */
14176 uint16_t req_type;
14177 /*
14178 * The completion ring to send the completion event on. This should
14179 * be the NQ ID returned from the `nq_alloc` HWRM command.
14180 */
14181 uint16_t cmpl_ring;
14182 /*
14183 * The sequence ID is used by the driver for tracking multiple
14184 * commands. This ID is treated as opaque data by the firmware and
14185 * the value is returned in the `hwrm_resp_hdr` upon completion.
14186 */
14187 uint16_t seq_id;
14188 /*
14189 * The target ID of the command:
14190 * * 0x0-0xFFF8 - The function ID
14191 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14192 * * 0xFFFD - Reserved for user-space HWRM interface
14193 * * 0xFFFF - HWRM
14194 */
14195 uint16_t target_id;
14196 /*
14197 * A physical address pointer pointing to a host buffer that the
14198 * command's response data will be written. This can be either a host
14199 * physical address (HPA) or a guest physical address (GPA) and must
14200 * point to a physically contiguous block of memory.
14201 */
14202 uint64_t resp_addr;
14203 /* VF ID that is being configured by PF */
14204 uint16_t vf_id;
14205 /* Maximum guaranteed number of MSI-X vectors for the function */
14206 uint16_t max_msix;
14207 /* Minimum guaranteed number of RSS/COS contexts */
14208 uint16_t min_rsscos_ctx;
14209 /* Maximum non-guaranteed number of RSS/COS contexts */
14210 uint16_t max_rsscos_ctx;
14211 /* Minimum guaranteed number of completion rings */
14212 uint16_t min_cmpl_rings;
14213 /* Maximum non-guaranteed number of completion rings */
14214 uint16_t max_cmpl_rings;
14215 /* Minimum guaranteed number of transmit rings */
14216 uint16_t min_tx_rings;
14217 /* Maximum non-guaranteed number of transmit rings */
14218 uint16_t max_tx_rings;
14219 /* Minimum guaranteed number of receive rings */
14220 uint16_t min_rx_rings;
14221 /* Maximum non-guaranteed number of receive rings */
14222 uint16_t max_rx_rings;
14223 /* Minimum guaranteed number of L2 contexts */
14224 uint16_t min_l2_ctxs;
14225 /* Maximum non-guaranteed number of L2 contexts */
14226 uint16_t max_l2_ctxs;
14227 /* Minimum guaranteed number of VNICs */
14228 uint16_t min_vnics;
14229 /* Maximum non-guaranteed number of VNICs */
14230 uint16_t max_vnics;
14231 /* Minimum guaranteed number of statistic contexts */
14232 uint16_t min_stat_ctx;
14233 /* Maximum non-guaranteed number of statistic contexts */
14234 uint16_t max_stat_ctx;
14235 /* Minimum guaranteed number of ring groups */
14236 uint16_t min_hw_ring_grps;
14237 /* Maximum non-guaranteed number of ring groups */
14238 uint16_t max_hw_ring_grps;
14239 uint16_t flags;
14240 /*
14241 * If this bit is set, all minimum resources requested should be
14242 * reserved if minimum >= 1, otherwise return error. In case of
14243 * error, keep all existing reservations before the call.
14244 */
14245 #define HWRM_FUNC_VF_RESOURCE_CFG_INPUT_FLAGS_MIN_GUARANTEED UINT32_C(0x1)
14246 uint8_t unused_0[2];
14247 } hwrm_func_vf_resource_cfg_input_t, *phwrm_func_vf_resource_cfg_input_t;
14248
14249 /* hwrm_func_vf_resource_cfg_output (size:256b/32B) */
14250
14251 typedef struct hwrm_func_vf_resource_cfg_output {
14252 /* The specific error status for the command. */
14253 uint16_t error_code;
14254 /* The HWRM command request type. */
14255 uint16_t req_type;
14256 /* The sequence ID from the original command. */
14257 uint16_t seq_id;
14258 /* The length of the response data in number of bytes. */
14259 uint16_t resp_len;
14260 /* Reserved number of RSS/COS contexts */
14261 uint16_t reserved_rsscos_ctx;
14262 /* Reserved number of completion rings */
14263 uint16_t reserved_cmpl_rings;
14264 /* Reserved number of transmit rings */
14265 uint16_t reserved_tx_rings;
14266 /* Reserved number of receive rings */
14267 uint16_t reserved_rx_rings;
14268 /* Reserved number of L2 contexts */
14269 uint16_t reserved_l2_ctxs;
14270 /* Reserved number of VNICs */
14271 uint16_t reserved_vnics;
14272 /* Reserved number of statistic contexts */
14273 uint16_t reserved_stat_ctx;
14274 /* Reserved number of ring groups */
14275 uint16_t reserved_hw_ring_grps;
14276 uint8_t unused_0[7];
14277 /*
14278 * This field is used in Output records to indicate that the output
14279 * is completely written to RAM. This field should be read as '1'
14280 * to indicate that the output has been completely written.
14281 * When writing a command completion or response to an internal processor,
14282 * the order of writes has to be such that this field is written last.
14283 */
14284 uint8_t valid;
14285 } hwrm_func_vf_resource_cfg_output_t, *phwrm_func_vf_resource_cfg_output_t;
14286
14287 /*********************************
14288 * hwrm_func_backing_store_qcaps *
14289 *********************************/
14290
14291
14292 /* hwrm_func_backing_store_qcaps_input (size:128b/16B) */
14293
14294 typedef struct hwrm_func_backing_store_qcaps_input {
14295 /* The HWRM command request type. */
14296 uint16_t req_type;
14297 /*
14298 * The completion ring to send the completion event on. This should
14299 * be the NQ ID returned from the `nq_alloc` HWRM command.
14300 */
14301 uint16_t cmpl_ring;
14302 /*
14303 * The sequence ID is used by the driver for tracking multiple
14304 * commands. This ID is treated as opaque data by the firmware and
14305 * the value is returned in the `hwrm_resp_hdr` upon completion.
14306 */
14307 uint16_t seq_id;
14308 /*
14309 * The target ID of the command:
14310 * * 0x0-0xFFF8 - The function ID
14311 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14312 * * 0xFFFD - Reserved for user-space HWRM interface
14313 * * 0xFFFF - HWRM
14314 */
14315 uint16_t target_id;
14316 /*
14317 * A physical address pointer pointing to a host buffer that the
14318 * command's response data will be written. This can be either a host
14319 * physical address (HPA) or a guest physical address (GPA) and must
14320 * point to a physically contiguous block of memory.
14321 */
14322 uint64_t resp_addr;
14323 } hwrm_func_backing_store_qcaps_input_t, *phwrm_func_backing_store_qcaps_input_t;
14324
14325 /* hwrm_func_backing_store_qcaps_output (size:832b/104B) */
14326
14327 typedef struct hwrm_func_backing_store_qcaps_output {
14328 /* The specific error status for the command. */
14329 uint16_t error_code;
14330 /* The HWRM command request type. */
14331 uint16_t req_type;
14332 /* The sequence ID from the original command. */
14333 uint16_t seq_id;
14334 /* The length of the response data in number of bytes. */
14335 uint16_t resp_len;
14336 /* Maximum number of QP context entries supported for this function. */
14337 uint32_t qp_max_entries;
14338 /*
14339 * Minimum number of QP context entries that are needed to be reserved
14340 * for QP1 for the PF and its VFs. PF drivers must allocate at least
14341 * this many QP context entries, even if RoCE will not be used.
14342 */
14343 uint16_t qp_min_qp1_entries;
14344 /* Maximum number of QP context entries that can be used for L2. */
14345 uint16_t qp_max_l2_entries;
14346 /* Number of bytes that must be allocated for each context entry. */
14347 uint16_t qp_entry_size;
14348 /* Maximum number of SRQ context entries that can be used for L2. */
14349 uint16_t srq_max_l2_entries;
14350 /* Maximum number of SRQ context entries supported for this function. */
14351 uint32_t srq_max_entries;
14352 /* Number of bytes that must be allocated for each context entry. */
14353 uint16_t srq_entry_size;
14354 /* Maximum number of CQ context entries that can be used for L2. */
14355 uint16_t cq_max_l2_entries;
14356 /* Maximum number of CQ context entries supported for this function. */
14357 uint32_t cq_max_entries;
14358 /* Number of bytes that must be allocated for each context entry. */
14359 uint16_t cq_entry_size;
14360 /* Maximum number of VNIC context entries supported for this function. */
14361 uint16_t vnic_max_vnic_entries;
14362 /* Maximum number of Ring table context entries supported for this function. */
14363 uint16_t vnic_max_ring_table_entries;
14364 /* Number of bytes that must be allocated for each context entry. */
14365 uint16_t vnic_entry_size;
14366 /* Maximum number of statistic context entries supported for this function. */
14367 uint32_t stat_max_entries;
14368 /* Number of bytes that must be allocated for each context entry. */
14369 uint16_t stat_entry_size;
14370 /* Number of bytes that must be allocated for each context entry. */
14371 uint16_t tqm_entry_size;
14372 /* Minimum number of TQM context entries required per ring. */
14373 uint32_t tqm_min_entries_per_ring;
14374 /*
14375 * Maximum number of TQM context entries supported per ring. This is
14376 * actually a recommended TQM queue size based on worst case usage of
14377 * the TQM queue.
14378 *
14379 * TQM fastpath rings should be sized large enough to accommodate the
14380 * maximum number of QPs (either L2 or RoCE, or both if shared)
14381 * that can be enqueued to the TQM ring.
14382 *
14383 * TQM slowpath rings should be sized as follows:
14384 *
14385 * num_entries = num_vnics + num_l2_tx_rings + 2 * num_roce_qps + tqm_min_size
14386 *
14387 * Where:
14388 * num_vnics is the number of VNICs allocated in the VNIC backing store
14389 * num_l2_tx_rings is the number of L2 rings in the QP backing store
14390 * num_roce_qps is the number of RoCE QPs in the QP backing store
14391 * tqm_min_size is tqm_min_entries_per_ring reported by
14392 * HWRM_FUNC_BACKING_STORE_QCAPS
14393 *
14394 * Note that TQM ring sizes cannot be extended while the system is
14395 * operational. If a PF driver needs to extend a TQM ring, it needs
14396 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
14397 * the backing store.
14398 */
14399 uint32_t tqm_max_entries_per_ring;
14400 /*
14401 * Maximum number of MR plus AV context entries supported for this
14402 * function.
14403 */
14404 uint32_t mrav_max_entries;
14405 /* Number of bytes that must be allocated for each context entry. */
14406 uint16_t mrav_entry_size;
14407 /* Number of bytes that must be allocated for each context entry. */
14408 uint16_t tim_entry_size;
14409 /* Maximum number of Timer context entries supported for this function. */
14410 uint32_t tim_max_entries;
14411 /*
14412 * When this field is zero, the 32b `mrav_num_entries` field in the
14413 * `backing_store_cfg` and `backing_store_qcfg` commands represents
14414 * the total number of MR plus AV entries allowed in the MR/AV backing
14415 * store PBL.
14416 *
14417 * When this field is non-zero, the 32b `mrav_num_entries` field in
14418 * the `backing_store_cfg` and `backing_store_qcfg` commands is
14419 * logically divided into two 16b fields. Bits `[31:16]` represents
14420 * the `mr_num_entries` and bits `[15:0]` represents `av_num_entries`.
14421 * Both of these values are represented in a unit granularity
14422 * specified by this field. For example, if this field is 16 and
14423 * `mrav_num_entries` is `0x02000100`, then the number of MR entries
14424 * is 8192 and the number of AV entries is 4096.
14425 */
14426 uint16_t mrav_num_entries_units;
14427 /*
14428 * The number of entries specified for any TQM ring must be a
14429 * multiple of this value to prevent any resource allocation
14430 * limitations.
14431 */
14432 uint8_t tqm_entries_multiple;
14433 /*
14434 * Initializer to be used by drivers
14435 * to initialize context memory to ensure
14436 * context subsystem flags an error for an attack
14437 * before the first time context load.
14438 */
14439 uint8_t ctx_kind_initializer;
14440 /*
14441 * Specifies which context kinds need to be initialized with the
14442 * ctx_kind_initializer.
14443 */
14444 uint16_t ctx_init_mask;
14445 /*
14446 * If this bit is '1' then this context type should be initialized
14447 * with the ctx_kind_initializer at the specified offset.
14448 */
14449 #define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_QP UINT32_C(0x1)
14450 /*
14451 * If this bit is '1' then this context type should be initialized
14452 * with the ctx_kind_initializer at the specified offset.
14453 */
14454 #define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_SRQ UINT32_C(0x2)
14455 /*
14456 * If this bit is '1' then this context type should be initialized
14457 * with the ctx_kind_initializer at the specified offset.
14458 */
14459 #define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_CQ UINT32_C(0x4)
14460 /*
14461 * If this bit is '1' then this context type should be initialized
14462 * with the ctx_kind_initializer at the specified offset.
14463 */
14464 #define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_VNIC UINT32_C(0x8)
14465 /*
14466 * If this bit is '1' then this context type should be initialized
14467 * with the ctx_kind_initializer at the specified offset.
14468 */
14469 #define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_STAT UINT32_C(0x10)
14470 /*
14471 * If this bit is '1' then this context type should be initialized
14472 * with the ctx_kind_initializer at the specified offset.
14473 */
14474 #define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_MRAV UINT32_C(0x20)
14475 /*
14476 * If this bit is '1' then the Tx KTLS context type should be
14477 * initialized with the ctx_kind_initializer at the specified offset.
14478 */
14479 #define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_TKC UINT32_C(0x40)
14480 /*
14481 * If this bit is '1' then the Rx KTLS context type should be
14482 * initialized with the ctx_kind_initializer at the specified offset.
14483 */
14484 #define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_RKC UINT32_C(0x80)
14485 /*
14486 * Specifies the doubleword offset of ctx_kind_initializer for this
14487 * context type.
14488 */
14489 uint8_t qp_init_offset;
14490 /*
14491 * Specifies the doubleword offset of ctx_kind_initializer for this
14492 * context type.
14493 */
14494 uint8_t srq_init_offset;
14495 /*
14496 * Specifies the doubleword offset of ctx_kind_initializer for this
14497 * context type.
14498 */
14499 uint8_t cq_init_offset;
14500 /*
14501 * Specifies the doubleword offset of ctx_kind_initializer for this
14502 * context type.
14503 */
14504 uint8_t vnic_init_offset;
14505 /*
14506 * Count of TQM fastpath rings to be used for allocating backing store.
14507 * Backing store configuration must be specified for each TQM ring from
14508 * this count in `backing_store_cfg`.
14509 * Only first 8 TQM FP rings will be advertised with this field.
14510 */
14511 uint8_t tqm_fp_rings_count;
14512 /*
14513 * Specifies the doubleword offset of ctx_kind_initializer for this
14514 * context type.
14515 */
14516 uint8_t stat_init_offset;
14517 /*
14518 * Specifies the doubleword offset of ctx_kind_initializer for this
14519 * context type.
14520 */
14521 uint8_t mrav_init_offset;
14522 /*
14523 * Count of TQM extended fastpath rings to be used for allocating
14524 * backing store beyond 8 rings(rings 9,10,11)
14525 * Backing store configuration must be specified for each TQM ring from
14526 * this count in `backing_store_cfg`.
14527 */
14528 uint8_t tqm_fp_rings_count_ext;
14529 /*
14530 * Specifies the doubleword offset of ctx_kind_initializer for Tx
14531 * KTLS context type.
14532 */
14533 uint8_t tkc_init_offset;
14534 /*
14535 * Specifies the doubleword offset of ctx_kind_initializer for Rx
14536 * KTLS context type.
14537 */
14538 uint8_t rkc_init_offset;
14539 /* Tx KTLS context entry size in bytes. */
14540 uint16_t tkc_entry_size;
14541 /* Rx KTLS context entry size in bytes. */
14542 uint16_t rkc_entry_size;
14543 /*
14544 * Maximum number of Tx KTLS context entries supported for this
14545 * function.
14546 */
14547 uint32_t tkc_max_entries;
14548 /*
14549 * Maximum number of Rx KTLS context entries supported for this
14550 * function.
14551 */
14552 uint32_t rkc_max_entries;
14553 /* Reserved for future. */
14554 uint8_t rsvd[7];
14555 /*
14556 * This field is used in Output records to indicate that the output
14557 * is completely written to RAM. This field should be read as '1'
14558 * to indicate that the output has been completely written.
14559 * When writing a command completion or response to an internal processor,
14560 * the order of writes has to be such that this field is written last.
14561 */
14562 uint8_t valid;
14563 } hwrm_func_backing_store_qcaps_output_t, *phwrm_func_backing_store_qcaps_output_t;
14564
14565 /* tqm_fp_ring_cfg (size:128b/16B) */
14566
14567 typedef struct tqm_fp_ring_cfg {
14568 /* TQM ring page size and level. */
14569 uint8_t tqm_ring_pg_size_tqm_ring_lvl;
14570 /* TQM ring PBL indirect levels. */
14571 #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_MASK UINT32_C(0xf)
14572 #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_SFT 0
14573 /* PBL pointer is physical start address. */
14574 #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_LVL_0 UINT32_C(0x0)
14575 /* PBL pointer points to PTE table. */
14576 #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_LVL_1 UINT32_C(0x1)
14577 /*
14578 * PBL pointer points to PDE table with each entry pointing to
14579 * PTE tables.
14580 */
14581 #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_LVL_2 UINT32_C(0x2)
14582 #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_LAST TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_LVL_2
14583 /* TQM ring page size. */
14584 #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_MASK UINT32_C(0xf0)
14585 #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_SFT 4
14586 /* 4KB. */
14587 #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
14588 /* 8KB. */
14589 #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
14590 /* 64KB. */
14591 #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
14592 /* 2MB. */
14593 #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
14594 /* 8MB. */
14595 #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
14596 /* 1GB. */
14597 #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
14598 #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_LAST TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_1G
14599 uint8_t unused[3];
14600 /* Number of TQM ring entries. */
14601 uint32_t tqm_ring_num_entries;
14602 /* TQM ring page directory. */
14603 uint64_t tqm_ring_page_dir;
14604 } tqm_fp_ring_cfg_t, *ptqm_fp_ring_cfg_t;
14605
14606 /*******************************
14607 * hwrm_func_backing_store_cfg *
14608 *******************************/
14609
14610
14611 /* hwrm_func_backing_store_cfg_input (size:2688b/336B) */
14612
14613 typedef struct hwrm_func_backing_store_cfg_input {
14614 /* The HWRM command request type. */
14615 uint16_t req_type;
14616 /*
14617 * The completion ring to send the completion event on. This should
14618 * be the NQ ID returned from the `nq_alloc` HWRM command.
14619 */
14620 uint16_t cmpl_ring;
14621 /*
14622 * The sequence ID is used by the driver for tracking multiple
14623 * commands. This ID is treated as opaque data by the firmware and
14624 * the value is returned in the `hwrm_resp_hdr` upon completion.
14625 */
14626 uint16_t seq_id;
14627 /*
14628 * The target ID of the command:
14629 * * 0x0-0xFFF8 - The function ID
14630 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14631 * * 0xFFFD - Reserved for user-space HWRM interface
14632 * * 0xFFFF - HWRM
14633 */
14634 uint16_t target_id;
14635 /*
14636 * A physical address pointer pointing to a host buffer that the
14637 * command's response data will be written. This can be either a host
14638 * physical address (HPA) or a guest physical address (GPA) and must
14639 * point to a physically contiguous block of memory.
14640 */
14641 uint64_t resp_addr;
14642 uint32_t flags;
14643 /*
14644 * When set, the firmware only uses on-chip resources and does not
14645 * expect any backing store to be provided by the host driver. This
14646 * mode provides minimal L2 functionality (e.g. limited L2 resources,
14647 * no RoCE).
14648 */
14649 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_FLAGS_PREBOOT_MODE UINT32_C(0x1)
14650 /*
14651 * When set, the 32b `mrav_num_entries` field is logically divided
14652 * into two 16b fields, `mr_num_entries` and `av_num_entries`.
14653 */
14654 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_FLAGS_MRAV_RESERVATION_SPLIT UINT32_C(0x2)
14655 uint32_t enables;
14656 /*
14657 * This bit must be '1' for the qp fields to be
14658 * configured.
14659 */
14660 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_QP UINT32_C(0x1)
14661 /*
14662 * This bit must be '1' for the srq fields to be
14663 * configured.
14664 */
14665 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_SRQ UINT32_C(0x2)
14666 /*
14667 * This bit must be '1' for the cq fields to be
14668 * configured.
14669 */
14670 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_CQ UINT32_C(0x4)
14671 /*
14672 * This bit must be '1' for the vnic fields to be
14673 * configured.
14674 */
14675 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_VNIC UINT32_C(0x8)
14676 /*
14677 * This bit must be '1' for the stat fields to be
14678 * configured.
14679 */
14680 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_STAT UINT32_C(0x10)
14681 /*
14682 * This bit must be '1' for the tqm_sp fields to be
14683 * configured.
14684 */
14685 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_SP UINT32_C(0x20)
14686 /*
14687 * This bit must be '1' for the tqm_ring0 fields to be
14688 * configured.
14689 */
14690 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING0 UINT32_C(0x40)
14691 /*
14692 * This bit must be '1' for the tqm_ring1 fields to be
14693 * configured.
14694 */
14695 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING1 UINT32_C(0x80)
14696 /*
14697 * This bit must be '1' for the tqm_ring2 fields to be
14698 * configured.
14699 */
14700 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING2 UINT32_C(0x100)
14701 /*
14702 * This bit must be '1' for the tqm_ring3 fields to be
14703 * configured.
14704 */
14705 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING3 UINT32_C(0x200)
14706 /*
14707 * This bit must be '1' for the tqm_ring4 fields to be
14708 * configured.
14709 */
14710 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING4 UINT32_C(0x400)
14711 /*
14712 * This bit must be '1' for the tqm_ring5 fields to be
14713 * configured.
14714 */
14715 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING5 UINT32_C(0x800)
14716 /*
14717 * This bit must be '1' for the tqm_ring6 fields to be
14718 * configured.
14719 */
14720 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING6 UINT32_C(0x1000)
14721 /*
14722 * This bit must be '1' for the tqm_ring7 fields to be
14723 * configured.
14724 */
14725 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING7 UINT32_C(0x2000)
14726 /*
14727 * This bit must be '1' for the mrav fields to be
14728 * configured.
14729 */
14730 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_MRAV UINT32_C(0x4000)
14731 /*
14732 * This bit must be '1' for the tim fields to be
14733 * configured.
14734 */
14735 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TIM UINT32_C(0x8000)
14736 /*
14737 * This bit must be '1' for the tqm_ring8 fields to be
14738 * configured.
14739 */
14740 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING8 UINT32_C(0x10000)
14741 /*
14742 * This bit must be '1' for the tqm_ring9 fields to be
14743 * configured.
14744 */
14745 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING9 UINT32_C(0x20000)
14746 /*
14747 * This bit must be '1' for the tqm_ring10 fields to be
14748 * configured.
14749 */
14750 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING10 UINT32_C(0x40000)
14751 /*
14752 * This bit must be '1' for the Tx KTLS context
14753 * fields to be configured.
14754 */
14755 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TKC UINT32_C(0x80000)
14756 /*
14757 * This bit must be '1' for the Rx KTLS context
14758 * fields to be configured.
14759 */
14760 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_RKC UINT32_C(0x100000)
14761 /* QPC page size and level. */
14762 uint8_t qpc_pg_size_qpc_lvl;
14763 /* QPC PBL indirect levels. */
14764 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_MASK UINT32_C(0xf)
14765 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_SFT 0
14766 /* PBL pointer is physical start address. */
14767 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_0 UINT32_C(0x0)
14768 /* PBL pointer points to PTE table. */
14769 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_1 UINT32_C(0x1)
14770 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
14771 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_2 UINT32_C(0x2)
14772 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_2
14773 /* QPC page size. */
14774 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_MASK UINT32_C(0xf0)
14775 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_SFT 4
14776 /* 4KB. */
14777 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
14778 /* 8KB. */
14779 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
14780 /* 64KB. */
14781 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
14782 /* 2MB. */
14783 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
14784 /* 8MB. */
14785 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
14786 /* 1GB. */
14787 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
14788 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_1G
14789 /* SRQ page size and level. */
14790 uint8_t srq_pg_size_srq_lvl;
14791 /* SRQ PBL indirect levels. */
14792 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_MASK UINT32_C(0xf)
14793 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_SFT 0
14794 /* PBL pointer is physical start address. */
14795 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_0 UINT32_C(0x0)
14796 /* PBL pointer points to PTE table. */
14797 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_1 UINT32_C(0x1)
14798 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
14799 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_2 UINT32_C(0x2)
14800 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_2
14801 /* SRQ page size. */
14802 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_MASK UINT32_C(0xf0)
14803 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_SFT 4
14804 /* 4KB. */
14805 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
14806 /* 8KB. */
14807 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
14808 /* 64KB. */
14809 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
14810 /* 2MB. */
14811 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
14812 /* 8MB. */
14813 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
14814 /* 1GB. */
14815 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
14816 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_1G
14817 /* CQ page size and level. */
14818 uint8_t cq_pg_size_cq_lvl;
14819 /* CQ PBL indirect levels. */
14820 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_MASK UINT32_C(0xf)
14821 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_SFT 0
14822 /* PBL pointer is physical start address. */
14823 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_0 UINT32_C(0x0)
14824 /* PBL pointer points to PTE table. */
14825 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_1 UINT32_C(0x1)
14826 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
14827 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_2 UINT32_C(0x2)
14828 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_2
14829 /* CQ page size. */
14830 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_MASK UINT32_C(0xf0)
14831 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_SFT 4
14832 /* 4KB. */
14833 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
14834 /* 8KB. */
14835 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
14836 /* 64KB. */
14837 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
14838 /* 2MB. */
14839 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
14840 /* 8MB. */
14841 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
14842 /* 1GB. */
14843 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
14844 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_1G
14845 /* VNIC page size and level. */
14846 uint8_t vnic_pg_size_vnic_lvl;
14847 /* VNIC PBL indirect levels. */
14848 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_MASK UINT32_C(0xf)
14849 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_SFT 0
14850 /* PBL pointer is physical start address. */
14851 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_0 UINT32_C(0x0)
14852 /* PBL pointer points to PTE table. */
14853 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_1 UINT32_C(0x1)
14854 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
14855 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_2 UINT32_C(0x2)
14856 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_2
14857 /* VNIC page size. */
14858 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_MASK UINT32_C(0xf0)
14859 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_SFT 4
14860 /* 4KB. */
14861 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
14862 /* 8KB. */
14863 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
14864 /* 64KB. */
14865 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
14866 /* 2MB. */
14867 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
14868 /* 8MB. */
14869 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
14870 /* 1GB. */
14871 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
14872 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_1G
14873 /* Stat page size and level. */
14874 uint8_t stat_pg_size_stat_lvl;
14875 /* Stat PBL indirect levels. */
14876 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_MASK UINT32_C(0xf)
14877 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_SFT 0
14878 /* PBL pointer is physical start address. */
14879 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_0 UINT32_C(0x0)
14880 /* PBL pointer points to PTE table. */
14881 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_1 UINT32_C(0x1)
14882 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
14883 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_2 UINT32_C(0x2)
14884 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_2
14885 /* Stat page size. */
14886 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_MASK UINT32_C(0xf0)
14887 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_SFT 4
14888 /* 4KB. */
14889 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
14890 /* 8KB. */
14891 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
14892 /* 64KB. */
14893 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
14894 /* 2MB. */
14895 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
14896 /* 8MB. */
14897 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
14898 /* 1GB. */
14899 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
14900 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_1G
14901 /* TQM slow path page size and level. */
14902 uint8_t tqm_sp_pg_size_tqm_sp_lvl;
14903 /* TQM slow path PBL indirect levels. */
14904 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_MASK UINT32_C(0xf)
14905 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_SFT 0
14906 /* PBL pointer is physical start address. */
14907 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_0 UINT32_C(0x0)
14908 /* PBL pointer points to PTE table. */
14909 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_1 UINT32_C(0x1)
14910 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
14911 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_2 UINT32_C(0x2)
14912 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_2
14913 /* TQM slow path page size. */
14914 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_MASK UINT32_C(0xf0)
14915 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_SFT 4
14916 /* 4KB. */
14917 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
14918 /* 8KB. */
14919 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
14920 /* 64KB. */
14921 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
14922 /* 2MB. */
14923 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
14924 /* 8MB. */
14925 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
14926 /* 1GB. */
14927 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
14928 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_1G
14929 /* TQM ring 0 page size and level. */
14930 uint8_t tqm_ring0_pg_size_tqm_ring0_lvl;
14931 /* TQM ring 0 PBL indirect levels. */
14932 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_MASK UINT32_C(0xf)
14933 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_SFT 0
14934 /* PBL pointer is physical start address. */
14935 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_0 UINT32_C(0x0)
14936 /* PBL pointer points to PTE table. */
14937 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_1 UINT32_C(0x1)
14938 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
14939 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_2 UINT32_C(0x2)
14940 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_2
14941 /* TQM ring 0 page size. */
14942 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_MASK UINT32_C(0xf0)
14943 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_SFT 4
14944 /* 4KB. */
14945 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
14946 /* 8KB. */
14947 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
14948 /* 64KB. */
14949 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
14950 /* 2MB. */
14951 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
14952 /* 8MB. */
14953 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
14954 /* 1GB. */
14955 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
14956 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_1G
14957 /* TQM ring 1 page size and level. */
14958 uint8_t tqm_ring1_pg_size_tqm_ring1_lvl;
14959 /* TQM ring 1 PBL indirect levels. */
14960 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_MASK UINT32_C(0xf)
14961 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_SFT 0
14962 /* PBL pointer is physical start address. */
14963 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_0 UINT32_C(0x0)
14964 /* PBL pointer points to PTE table. */
14965 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_1 UINT32_C(0x1)
14966 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
14967 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_2 UINT32_C(0x2)
14968 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_2
14969 /* TQM ring 1 page size. */
14970 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_MASK UINT32_C(0xf0)
14971 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_SFT 4
14972 /* 4KB. */
14973 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
14974 /* 8KB. */
14975 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
14976 /* 64KB. */
14977 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
14978 /* 2MB. */
14979 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
14980 /* 8MB. */
14981 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
14982 /* 1GB. */
14983 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
14984 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_1G
14985 /* TQM ring 2 page size and level. */
14986 uint8_t tqm_ring2_pg_size_tqm_ring2_lvl;
14987 /* TQM ring 2 PBL indirect levels. */
14988 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_MASK UINT32_C(0xf)
14989 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_SFT 0
14990 /* PBL pointer is physical start address. */
14991 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_0 UINT32_C(0x0)
14992 /* PBL pointer points to PTE table. */
14993 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_1 UINT32_C(0x1)
14994 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
14995 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_2 UINT32_C(0x2)
14996 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_2
14997 /* TQM ring 2 page size. */
14998 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_MASK UINT32_C(0xf0)
14999 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_SFT 4
15000 /* 4KB. */
15001 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
15002 /* 8KB. */
15003 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
15004 /* 64KB. */
15005 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
15006 /* 2MB. */
15007 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
15008 /* 8MB. */
15009 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
15010 /* 1GB. */
15011 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
15012 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_1G
15013 /* TQM ring 3 page size and level. */
15014 uint8_t tqm_ring3_pg_size_tqm_ring3_lvl;
15015 /* TQM ring 3 PBL indirect levels. */
15016 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_MASK UINT32_C(0xf)
15017 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_SFT 0
15018 /* PBL pointer is physical start address. */
15019 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_0 UINT32_C(0x0)
15020 /* PBL pointer points to PTE table. */
15021 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_1 UINT32_C(0x1)
15022 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15023 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_2 UINT32_C(0x2)
15024 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_2
15025 /* TQM ring 3 page size. */
15026 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_MASK UINT32_C(0xf0)
15027 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_SFT 4
15028 /* 4KB. */
15029 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
15030 /* 8KB. */
15031 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
15032 /* 64KB. */
15033 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
15034 /* 2MB. */
15035 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
15036 /* 8MB. */
15037 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
15038 /* 1GB. */
15039 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
15040 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_1G
15041 /* TQM ring 4 page size and level. */
15042 uint8_t tqm_ring4_pg_size_tqm_ring4_lvl;
15043 /* TQM ring 4 PBL indirect levels. */
15044 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_MASK UINT32_C(0xf)
15045 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_SFT 0
15046 /* PBL pointer is physical start address. */
15047 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_0 UINT32_C(0x0)
15048 /* PBL pointer points to PTE table. */
15049 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_1 UINT32_C(0x1)
15050 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15051 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_2 UINT32_C(0x2)
15052 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_2
15053 /* TQM ring 4 page size. */
15054 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_MASK UINT32_C(0xf0)
15055 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_SFT 4
15056 /* 4KB. */
15057 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
15058 /* 8KB. */
15059 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
15060 /* 64KB. */
15061 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
15062 /* 2MB. */
15063 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
15064 /* 8MB. */
15065 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
15066 /* 1GB. */
15067 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
15068 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_1G
15069 /* TQM ring 5 page size and level. */
15070 uint8_t tqm_ring5_pg_size_tqm_ring5_lvl;
15071 /* TQM ring 5 PBL indirect levels. */
15072 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_MASK UINT32_C(0xf)
15073 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_SFT 0
15074 /* PBL pointer is physical start address. */
15075 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_0 UINT32_C(0x0)
15076 /* PBL pointer points to PTE table. */
15077 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_1 UINT32_C(0x1)
15078 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15079 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_2 UINT32_C(0x2)
15080 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_2
15081 /* TQM ring 5 page size. */
15082 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_MASK UINT32_C(0xf0)
15083 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_SFT 4
15084 /* 4KB. */
15085 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
15086 /* 8KB. */
15087 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
15088 /* 64KB. */
15089 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
15090 /* 2MB. */
15091 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
15092 /* 8MB. */
15093 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
15094 /* 1GB. */
15095 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
15096 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_1G
15097 /* TQM ring 6 page size and level. */
15098 uint8_t tqm_ring6_pg_size_tqm_ring6_lvl;
15099 /* TQM ring 6 PBL indirect levels. */
15100 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_MASK UINT32_C(0xf)
15101 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_SFT 0
15102 /* PBL pointer is physical start address. */
15103 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_0 UINT32_C(0x0)
15104 /* PBL pointer points to PTE table. */
15105 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_1 UINT32_C(0x1)
15106 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15107 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_2 UINT32_C(0x2)
15108 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_2
15109 /* TQM ring 6 page size. */
15110 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_MASK UINT32_C(0xf0)
15111 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_SFT 4
15112 /* 4KB. */
15113 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
15114 /* 8KB. */
15115 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
15116 /* 64KB. */
15117 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
15118 /* 2MB. */
15119 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
15120 /* 8MB. */
15121 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
15122 /* 1GB. */
15123 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
15124 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_1G
15125 /* TQM ring 7 page size and level. */
15126 uint8_t tqm_ring7_pg_size_tqm_ring7_lvl;
15127 /* TQM ring 7 PBL indirect levels. */
15128 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_MASK UINT32_C(0xf)
15129 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_SFT 0
15130 /* PBL pointer is physical start address. */
15131 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_0 UINT32_C(0x0)
15132 /* PBL pointer points to PTE table. */
15133 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_1 UINT32_C(0x1)
15134 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15135 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_2 UINT32_C(0x2)
15136 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_2
15137 /* TQM ring 7 page size. */
15138 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_MASK UINT32_C(0xf0)
15139 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_SFT 4
15140 /* 4KB. */
15141 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
15142 /* 8KB. */
15143 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
15144 /* 64KB. */
15145 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
15146 /* 2MB. */
15147 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
15148 /* 8MB. */
15149 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
15150 /* 1GB. */
15151 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
15152 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_1G
15153 /* MR/AV page size and level. */
15154 uint8_t mrav_pg_size_mrav_lvl;
15155 /* MR/AV PBL indirect levels. */
15156 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_MASK UINT32_C(0xf)
15157 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_SFT 0
15158 /* PBL pointer is physical start address. */
15159 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_0 UINT32_C(0x0)
15160 /* PBL pointer points to PTE table. */
15161 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_1 UINT32_C(0x1)
15162 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15163 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_2 UINT32_C(0x2)
15164 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_2
15165 /* MR/AV page size. */
15166 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_MASK UINT32_C(0xf0)
15167 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_SFT 4
15168 /* 4KB. */
15169 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
15170 /* 8KB. */
15171 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
15172 /* 64KB. */
15173 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
15174 /* 2MB. */
15175 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
15176 /* 8MB. */
15177 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
15178 /* 1GB. */
15179 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
15180 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_1G
15181 /* Timer page size and level. */
15182 uint8_t tim_pg_size_tim_lvl;
15183 /* Timer PBL indirect levels. */
15184 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_MASK UINT32_C(0xf)
15185 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_SFT 0
15186 /* PBL pointer is physical start address. */
15187 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_0 UINT32_C(0x0)
15188 /* PBL pointer points to PTE table. */
15189 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_1 UINT32_C(0x1)
15190 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15191 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_2 UINT32_C(0x2)
15192 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_2
15193 /* Timer page size. */
15194 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_MASK UINT32_C(0xf0)
15195 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_SFT 4
15196 /* 4KB. */
15197 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
15198 /* 8KB. */
15199 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
15200 /* 64KB. */
15201 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
15202 /* 2MB. */
15203 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
15204 /* 8MB. */
15205 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
15206 /* 1GB. */
15207 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
15208 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_1G
15209 /* QP page directory. */
15210 uint64_t qpc_page_dir;
15211 /* SRQ page directory. */
15212 uint64_t srq_page_dir;
15213 /* CQ page directory. */
15214 uint64_t cq_page_dir;
15215 /* VNIC page directory. */
15216 uint64_t vnic_page_dir;
15217 /* Stat page directory. */
15218 uint64_t stat_page_dir;
15219 /* TQM slowpath page directory. */
15220 uint64_t tqm_sp_page_dir;
15221 /* TQM ring 0 page directory. */
15222 uint64_t tqm_ring0_page_dir;
15223 /* TQM ring 1 page directory. */
15224 uint64_t tqm_ring1_page_dir;
15225 /* TQM ring 2 page directory. */
15226 uint64_t tqm_ring2_page_dir;
15227 /* TQM ring 3 page directory. */
15228 uint64_t tqm_ring3_page_dir;
15229 /* TQM ring 4 page directory. */
15230 uint64_t tqm_ring4_page_dir;
15231 /* TQM ring 5 page directory. */
15232 uint64_t tqm_ring5_page_dir;
15233 /* TQM ring 6 page directory. */
15234 uint64_t tqm_ring6_page_dir;
15235 /* TQM ring 7 page directory. */
15236 uint64_t tqm_ring7_page_dir;
15237 /* MR/AV page directory. */
15238 uint64_t mrav_page_dir;
15239 /* Timer page directory. */
15240 uint64_t tim_page_dir;
15241 /* Number of QPs. */
15242 uint32_t qp_num_entries;
15243 /* Number of SRQs. */
15244 uint32_t srq_num_entries;
15245 /* Number of CQs. */
15246 uint32_t cq_num_entries;
15247 /* Number of Stats. */
15248 uint32_t stat_num_entries;
15249 /*
15250 * Number of TQM slowpath entries.
15251 *
15252 * TQM slowpath rings should be sized as follows:
15253 *
15254 * num_entries = num_vnics + num_l2_tx_rings + 2 * num_roce_qps + tqm_min_size
15255 *
15256 * Where:
15257 * num_vnics is the number of VNICs allocated in the VNIC backing store
15258 * num_l2_tx_rings is the number of L2 rings in the QP backing store
15259 * num_roce_qps is the number of RoCE QPs in the QP backing store
15260 * tqm_min_size is tqm_min_entries_per_ring reported by
15261 * HWRM_FUNC_BACKING_STORE_QCAPS
15262 *
15263 * Note that TQM ring sizes cannot be extended while the system is
15264 * operational. If a PF driver needs to extend a TQM ring, it needs
15265 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
15266 * the backing store.
15267 */
15268 uint32_t tqm_sp_num_entries;
15269 /*
15270 * Number of TQM ring 0 entries.
15271 *
15272 * TQM fastpath rings should be sized large enough to accommodate the
15273 * maximum number of QPs (either L2 or RoCE, or both if shared)
15274 * that can be enqueued to the TQM ring.
15275 *
15276 * Note that TQM ring sizes cannot be extended while the system is
15277 * operational. If a PF driver needs to extend a TQM ring, it needs
15278 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
15279 * the backing store.
15280 */
15281 uint32_t tqm_ring0_num_entries;
15282 /*
15283 * Number of TQM ring 1 entries.
15284 *
15285 * TQM fastpath rings should be sized large enough to accommodate the
15286 * maximum number of QPs (either L2 or RoCE, or both if shared)
15287 * that can be enqueued to the TQM ring.
15288 *
15289 * Note that TQM ring sizes cannot be extended while the system is
15290 * operational. If a PF driver needs to extend a TQM ring, it needs
15291 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
15292 * the backing store.
15293 */
15294 uint32_t tqm_ring1_num_entries;
15295 /*
15296 * Number of TQM ring 2 entries.
15297 *
15298 * TQM fastpath rings should be sized large enough to accommodate the
15299 * maximum number of QPs (either L2 or RoCE, or both if shared)
15300 * that can be enqueued to the TQM ring.
15301 *
15302 * Note that TQM ring sizes cannot be extended while the system is
15303 * operational. If a PF driver needs to extend a TQM ring, it needs
15304 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
15305 * the backing store.
15306 */
15307 uint32_t tqm_ring2_num_entries;
15308 /*
15309 * Number of TQM ring 3 entries.
15310 *
15311 * TQM fastpath rings should be sized large enough to accommodate the
15312 * maximum number of QPs (either L2 or RoCE, or both if shared)
15313 * that can be enqueued to the TQM ring.
15314 *
15315 * Note that TQM ring sizes cannot be extended while the system is
15316 * operational. If a PF driver needs to extend a TQM ring, it needs
15317 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
15318 * the backing store.
15319 */
15320 uint32_t tqm_ring3_num_entries;
15321 /*
15322 * Number of TQM ring 4 entries.
15323 *
15324 * TQM fastpath rings should be sized large enough to accommodate the
15325 * maximum number of QPs (either L2 or RoCE, or both if shared)
15326 * that can be enqueued to the TQM ring.
15327 *
15328 * Note that TQM ring sizes cannot be extended while the system is
15329 * operational. If a PF driver needs to extend a TQM ring, it needs
15330 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
15331 * the backing store.
15332 */
15333 uint32_t tqm_ring4_num_entries;
15334 /*
15335 * Number of TQM ring 5 entries.
15336 *
15337 * TQM fastpath rings should be sized large enough to accommodate the
15338 * maximum number of QPs (either L2 or RoCE, or both if shared)
15339 * that can be enqueued to the TQM ring.
15340 *
15341 * Note that TQM ring sizes cannot be extended while the system is
15342 * operational. If a PF driver needs to extend a TQM ring, it needs
15343 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
15344 * the backing store.
15345 */
15346 uint32_t tqm_ring5_num_entries;
15347 /*
15348 * Number of TQM ring 6 entries.
15349 *
15350 * TQM fastpath rings should be sized large enough to accommodate the
15351 * maximum number of QPs (either L2 or RoCE, or both if shared)
15352 * that can be enqueued to the TQM ring.
15353 *
15354 * Note that TQM ring sizes cannot be extended while the system is
15355 * operational. If a PF driver needs to extend a TQM ring, it needs
15356 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
15357 * the backing store.
15358 */
15359 uint32_t tqm_ring6_num_entries;
15360 /*
15361 * Number of TQM ring 7 entries.
15362 *
15363 * TQM fastpath rings should be sized large enough to accommodate the
15364 * maximum number of QPs (either L2 or RoCE, or both if shared)
15365 * that can be enqueued to the TQM ring.
15366 *
15367 * Note that TQM ring sizes cannot be extended while the system is
15368 * operational. If a PF driver needs to extend a TQM ring, it needs
15369 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
15370 * the backing store.
15371 */
15372 uint32_t tqm_ring7_num_entries;
15373 /*
15374 * If the MR/AV split reservation flag is not set, then this field
15375 * represents the total number of MR plus AV entries. For versions
15376 * of firmware that support the split reservation, when it is not
15377 * specified half of the entries will be reserved for MRs and the
15378 * other half for AVs.
15379 *
15380 * If the MR/AV split reservation flag is set, then this
15381 * field is logically divided into two 16b fields. Bits `[31:16]`
15382 * represents the `mr_num_entries` and bits `[15:0]` represents
15383 * `av_num_entries`. The granularity of these values is defined by
15384 * the `mrav_num_entries_unit` field returned by the
15385 * `backing_store_qcaps` command.
15386 */
15387 uint32_t mrav_num_entries;
15388 /* Number of Timer entries. */
15389 uint32_t tim_num_entries;
15390 /* Number of entries to reserve for QP1 */
15391 uint16_t qp_num_qp1_entries;
15392 /* Number of entries to reserve for L2 */
15393 uint16_t qp_num_l2_entries;
15394 /* Number of bytes that have been allocated for each context entry. */
15395 uint16_t qp_entry_size;
15396 /* Number of entries to reserve for L2 */
15397 uint16_t srq_num_l2_entries;
15398 /* Number of bytes that have been allocated for each context entry. */
15399 uint16_t srq_entry_size;
15400 /* Number of entries to reserve for L2 */
15401 uint16_t cq_num_l2_entries;
15402 /* Number of bytes that have been allocated for each context entry. */
15403 uint16_t cq_entry_size;
15404 /* Number of entries to reserve for VNIC entries */
15405 uint16_t vnic_num_vnic_entries;
15406 /* Number of entries to reserve for Ring table entries */
15407 uint16_t vnic_num_ring_table_entries;
15408 /* Number of bytes that have been allocated for each context entry. */
15409 uint16_t vnic_entry_size;
15410 /* Number of bytes that have been allocated for each context entry. */
15411 uint16_t stat_entry_size;
15412 /* Number of bytes that have been allocated for each context entry. */
15413 uint16_t tqm_entry_size;
15414 /* Number of bytes that have been allocated for each context entry. */
15415 uint16_t mrav_entry_size;
15416 /* Number of bytes that have been allocated for each context entry. */
15417 uint16_t tim_entry_size;
15418 /* TQM ring page size and level. */
15419 uint8_t tqm_ring8_pg_size_tqm_ring_lvl;
15420 /* TQM ring PBL indirect levels. */
15421 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_MASK UINT32_C(0xf)
15422 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_SFT 0
15423 /* PBL pointer is physical start address. */
15424 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_LVL_0 UINT32_C(0x0)
15425 /* PBL pointer points to PTE table. */
15426 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_LVL_1 UINT32_C(0x1)
15427 /*
15428 * PBL pointer points to PDE table with each entry pointing to
15429 * PTE tables.
15430 */
15431 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_LVL_2 UINT32_C(0x2)
15432 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_LVL_2
15433 /* TQM ring page size. */
15434 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_MASK UINT32_C(0xf0)
15435 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_SFT 4
15436 /* 4KB. */
15437 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
15438 /* 8KB. */
15439 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
15440 /* 64KB. */
15441 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
15442 /* 2MB. */
15443 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
15444 /* 8MB. */
15445 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
15446 /* 1GB. */
15447 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
15448 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_1G
15449 uint8_t ring8_unused[3];
15450 /* Number of TQM ring entries. */
15451 uint32_t tqm_ring8_num_entries;
15452 /* TQM ring page directory. */
15453 uint64_t tqm_ring8_page_dir;
15454 /* TQM ring page size and level. */
15455 uint8_t tqm_ring9_pg_size_tqm_ring_lvl;
15456 /* TQM ring PBL indirect levels. */
15457 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_MASK UINT32_C(0xf)
15458 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_SFT 0
15459 /* PBL pointer is physical start address. */
15460 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_LVL_0 UINT32_C(0x0)
15461 /* PBL pointer points to PTE table. */
15462 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_LVL_1 UINT32_C(0x1)
15463 /*
15464 * PBL pointer points to PDE table with each entry pointing to
15465 * PTE tables.
15466 */
15467 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_LVL_2 UINT32_C(0x2)
15468 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_LVL_2
15469 /* TQM ring page size. */
15470 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_MASK UINT32_C(0xf0)
15471 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_SFT 4
15472 /* 4KB. */
15473 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
15474 /* 8KB. */
15475 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
15476 /* 64KB. */
15477 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
15478 /* 2MB. */
15479 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
15480 /* 8MB. */
15481 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
15482 /* 1GB. */
15483 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
15484 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_1G
15485 uint8_t ring9_unused[3];
15486 /* Number of TQM ring entries. */
15487 uint32_t tqm_ring9_num_entries;
15488 /* TQM ring page directory. */
15489 uint64_t tqm_ring9_page_dir;
15490 /* TQM ring page size and level. */
15491 uint8_t tqm_ring10_pg_size_tqm_ring_lvl;
15492 /* TQM ring PBL indirect levels. */
15493 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_MASK UINT32_C(0xf)
15494 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_SFT 0
15495 /* PBL pointer is physical start address. */
15496 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_LVL_0 UINT32_C(0x0)
15497 /* PBL pointer points to PTE table. */
15498 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_LVL_1 UINT32_C(0x1)
15499 /*
15500 * PBL pointer points to PDE table with each entry pointing to
15501 * PTE tables.
15502 */
15503 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_LVL_2 UINT32_C(0x2)
15504 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_LVL_2
15505 /* TQM ring page size. */
15506 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_MASK UINT32_C(0xf0)
15507 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_SFT 4
15508 /* 4KB. */
15509 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
15510 /* 8KB. */
15511 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
15512 /* 64KB. */
15513 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
15514 /* 2MB. */
15515 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
15516 /* 8MB. */
15517 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
15518 /* 1GB. */
15519 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
15520 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_1G
15521 uint8_t ring10_unused[3];
15522 /* Number of TQM ring entries. */
15523 uint32_t tqm_ring10_num_entries;
15524 /* TQM ring page directory. */
15525 uint64_t tqm_ring10_page_dir;
15526 /* Number of Tx KTLS context entries allocated. */
15527 uint32_t tkc_num_entries;
15528 /* Number of Rx KTLS context entries allocated. */
15529 uint32_t rkc_num_entries;
15530 /* Tx KTLS context page directory. */
15531 uint64_t tkc_page_dir;
15532 /* Rx KTLS context page directory. */
15533 uint64_t rkc_page_dir;
15534 /* Number of bytes allocated for each Tx KTLS context entry. */
15535 uint16_t tkc_entry_size;
15536 /* Number of bytes allocated for each Rx KTLS context entry. */
15537 uint16_t rkc_entry_size;
15538 /* Tx KTLS context page size and level. */
15539 uint8_t tkc_pg_size_tkc_lvl;
15540 /* Tx KTLS context PBL indirect levels. */
15541 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_MASK UINT32_C(0xf)
15542 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_SFT 0
15543 /* PBL pointer is physical start address. */
15544 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_LVL_0 UINT32_C(0x0)
15545 /* PBL pointer points to PTE table. */
15546 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_LVL_1 UINT32_C(0x1)
15547 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15548 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_LVL_2 UINT32_C(0x2)
15549 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_LVL_2
15550 /* Tx KTLS context page size. */
15551 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_MASK UINT32_C(0xf0)
15552 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_SFT 4
15553 /* 4KB. */
15554 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
15555 /* 8KB. */
15556 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
15557 /* 64KB. */
15558 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
15559 /* 2MB. */
15560 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
15561 /* 8MB. */
15562 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
15563 /* 1GB. */
15564 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
15565 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_1G
15566 /* Rx KTLS context page size and level. */
15567 uint8_t rkc_pg_size_tkc_lvl;
15568 /* Rx KTLS context PBL indirect levels. */
15569 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_MASK UINT32_C(0xf)
15570 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_SFT 0
15571 /* PBL pointer is physical start address. */
15572 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_LVL_0 UINT32_C(0x0)
15573 /* PBL pointer points to PTE table. */
15574 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_LVL_1 UINT32_C(0x1)
15575 /*
15576 * PBL pointer points to PDE table with each entry pointing to
15577 * PTE tables.
15578 */
15579 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_LVL_2 UINT32_C(0x2)
15580 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_LVL_2
15581 /* Rx KTLS context page size. */
15582 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_MASK UINT32_C(0xf0)
15583 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_SFT 4
15584 /* 4KB. */
15585 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
15586 /* 8KB. */
15587 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
15588 /* 64KB. */
15589 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
15590 /* 2MB. */
15591 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
15592 /* 8MB. */
15593 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
15594 /* 1GB. */
15595 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
15596 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_1G
15597 /* Reserved for future. */
15598 uint8_t rsvd[2];
15599 } hwrm_func_backing_store_cfg_input_t, *phwrm_func_backing_store_cfg_input_t;
15600
15601 /* hwrm_func_backing_store_cfg_output (size:128b/16B) */
15602
15603 typedef struct hwrm_func_backing_store_cfg_output {
15604 /* The specific error status for the command. */
15605 uint16_t error_code;
15606 /* The HWRM command request type. */
15607 uint16_t req_type;
15608 /* The sequence ID from the original command. */
15609 uint16_t seq_id;
15610 /* The length of the response data in number of bytes. */
15611 uint16_t resp_len;
15612 uint8_t unused_0[7];
15613 /*
15614 * This field is used in Output records to indicate that the output
15615 * is completely written to RAM. This field should be read as '1'
15616 * to indicate that the output has been completely written.
15617 * When writing a command completion or response to an internal processor,
15618 * the order of writes has to be such that this field is written last.
15619 */
15620 uint8_t valid;
15621 } hwrm_func_backing_store_cfg_output_t, *phwrm_func_backing_store_cfg_output_t;
15622
15623 /********************************
15624 * hwrm_func_backing_store_qcfg *
15625 ********************************/
15626
15627
15628 /* hwrm_func_backing_store_qcfg_input (size:128b/16B) */
15629
15630 typedef struct hwrm_func_backing_store_qcfg_input {
15631 /* The HWRM command request type. */
15632 uint16_t req_type;
15633 /*
15634 * The completion ring to send the completion event on. This should
15635 * be the NQ ID returned from the `nq_alloc` HWRM command.
15636 */
15637 uint16_t cmpl_ring;
15638 /*
15639 * The sequence ID is used by the driver for tracking multiple
15640 * commands. This ID is treated as opaque data by the firmware and
15641 * the value is returned in the `hwrm_resp_hdr` upon completion.
15642 */
15643 uint16_t seq_id;
15644 /*
15645 * The target ID of the command:
15646 * * 0x0-0xFFF8 - The function ID
15647 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
15648 * * 0xFFFD - Reserved for user-space HWRM interface
15649 * * 0xFFFF - HWRM
15650 */
15651 uint16_t target_id;
15652 /*
15653 * A physical address pointer pointing to a host buffer that the
15654 * command's response data will be written. This can be either a host
15655 * physical address (HPA) or a guest physical address (GPA) and must
15656 * point to a physically contiguous block of memory.
15657 */
15658 uint64_t resp_addr;
15659 } hwrm_func_backing_store_qcfg_input_t, *phwrm_func_backing_store_qcfg_input_t;
15660
15661 /* hwrm_func_backing_store_qcfg_output (size:2496b/312B) */
15662
15663 typedef struct hwrm_func_backing_store_qcfg_output {
15664 /* The specific error status for the command. */
15665 uint16_t error_code;
15666 /* The HWRM command request type. */
15667 uint16_t req_type;
15668 /* The sequence ID from the original command. */
15669 uint16_t seq_id;
15670 /* The length of the response data in number of bytes. */
15671 uint16_t resp_len;
15672 uint32_t flags;
15673 /*
15674 * When set, the firmware only uses on-chip resources and does not
15675 * expect any backing store to be provided by the host driver. This
15676 * mode provides minimal L2 functionality (e.g. limited L2 resources,
15677 * no RoCE).
15678 */
15679 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_FLAGS_PREBOOT_MODE UINT32_C(0x1)
15680 /*
15681 * When set, the 32b `mrav_num_entries` field is logically divided
15682 * into two 16b fields, `mr_num_entries` and `av_num_entries`.
15683 */
15684 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_FLAGS_MRAV_RESERVATION_SPLIT UINT32_C(0x2)
15685 uint32_t enables;
15686 /*
15687 * This bit must be '1' for the qp fields to be
15688 * configured.
15689 */
15690 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_QP UINT32_C(0x1)
15691 /*
15692 * This bit must be '1' for the srq fields to be
15693 * configured.
15694 */
15695 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_SRQ UINT32_C(0x2)
15696 /*
15697 * This bit must be '1' for the cq fields to be
15698 * configured.
15699 */
15700 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_CQ UINT32_C(0x4)
15701 /*
15702 * This bit must be '1' for the vnic fields to be
15703 * configured.
15704 */
15705 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_VNIC UINT32_C(0x8)
15706 /*
15707 * This bit must be '1' for the stat fields to be
15708 * configured.
15709 */
15710 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_STAT UINT32_C(0x10)
15711 /*
15712 * This bit must be '1' for the tqm_sp fields to be
15713 * configured.
15714 */
15715 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_SP UINT32_C(0x20)
15716 /*
15717 * This bit must be '1' for the tqm_ring0 fields to be
15718 * configured.
15719 */
15720 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING0 UINT32_C(0x40)
15721 /*
15722 * This bit must be '1' for the tqm_ring1 fields to be
15723 * configured.
15724 */
15725 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING1 UINT32_C(0x80)
15726 /*
15727 * This bit must be '1' for the tqm_ring2 fields to be
15728 * configured.
15729 */
15730 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING2 UINT32_C(0x100)
15731 /*
15732 * This bit must be '1' for the tqm_ring3 fields to be
15733 * configured.
15734 */
15735 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING3 UINT32_C(0x200)
15736 /*
15737 * This bit must be '1' for the tqm_ring4 fields to be
15738 * configured.
15739 */
15740 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING4 UINT32_C(0x400)
15741 /*
15742 * This bit must be '1' for the tqm_ring5 fields to be
15743 * configured.
15744 */
15745 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING5 UINT32_C(0x800)
15746 /*
15747 * This bit must be '1' for the tqm_ring6 fields to be
15748 * configured.
15749 */
15750 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING6 UINT32_C(0x1000)
15751 /*
15752 * This bit must be '1' for the tqm_ring7 fields to be
15753 * configured.
15754 */
15755 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING7 UINT32_C(0x2000)
15756 /*
15757 * This bit must be '1' for the mrav fields to be
15758 * configured.
15759 */
15760 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_MRAV UINT32_C(0x4000)
15761 /*
15762 * This bit must be '1' for the tim fields to be
15763 * configured.
15764 */
15765 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TIM UINT32_C(0x8000)
15766 /*
15767 * This bit must be '1' for the tqm_ring8 fields to be
15768 * configured.
15769 */
15770 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING8 UINT32_C(0x10000)
15771 /*
15772 * This bit must be '1' for the tqm_ring9 fields to be
15773 * configured.
15774 */
15775 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING9 UINT32_C(0x20000)
15776 /*
15777 * This bit must be '1' for the tqm_ring10 fields to be
15778 * configured.
15779 */
15780 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING10 UINT32_C(0x40000)
15781 /*
15782 * This bit must be '1' for the Tx KTLS context
15783 * fields to be configured.
15784 */
15785 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TKC UINT32_C(0x80000)
15786 /*
15787 * This bit must be '1' for the Rx KTLS context
15788 * fields to be configured.
15789 */
15790 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_RKC UINT32_C(0x100000)
15791 /* QPC page size and level. */
15792 uint8_t qpc_pg_size_qpc_lvl;
15793 /* QPC PBL indirect levels. */
15794 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_MASK UINT32_C(0xf)
15795 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_SFT 0
15796 /* PBL pointer is physical start address. */
15797 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_0 UINT32_C(0x0)
15798 /* PBL pointer points to PTE table. */
15799 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_1 UINT32_C(0x1)
15800 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15801 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_2 UINT32_C(0x2)
15802 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_2
15803 /* QPC page size. */
15804 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_MASK UINT32_C(0xf0)
15805 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_SFT 4
15806 /* 4KB. */
15807 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
15808 /* 8KB. */
15809 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
15810 /* 64KB. */
15811 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
15812 /* 2MB. */
15813 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
15814 /* 8MB. */
15815 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
15816 /* 1GB. */
15817 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
15818 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_1G
15819 /* SRQ page size and level. */
15820 uint8_t srq_pg_size_srq_lvl;
15821 /* SRQ PBL indirect levels. */
15822 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_MASK UINT32_C(0xf)
15823 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_SFT 0
15824 /* PBL pointer is physical start address. */
15825 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_0 UINT32_C(0x0)
15826 /* PBL pointer points to PTE table. */
15827 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_1 UINT32_C(0x1)
15828 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15829 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_2 UINT32_C(0x2)
15830 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_2
15831 /* SRQ page size. */
15832 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_MASK UINT32_C(0xf0)
15833 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_SFT 4
15834 /* 4KB. */
15835 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
15836 /* 8KB. */
15837 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
15838 /* 64KB. */
15839 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
15840 /* 2MB. */
15841 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
15842 /* 8MB. */
15843 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
15844 /* 1GB. */
15845 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
15846 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_1G
15847 /* CQ page size and level. */
15848 uint8_t cq_pg_size_cq_lvl;
15849 /* CQ PBL indirect levels. */
15850 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_MASK UINT32_C(0xf)
15851 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_SFT 0
15852 /* PBL pointer is physical start address. */
15853 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_0 UINT32_C(0x0)
15854 /* PBL pointer points to PTE table. */
15855 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_1 UINT32_C(0x1)
15856 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15857 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_2 UINT32_C(0x2)
15858 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_2
15859 /* CQ page size. */
15860 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_MASK UINT32_C(0xf0)
15861 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_SFT 4
15862 /* 4KB. */
15863 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
15864 /* 8KB. */
15865 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
15866 /* 64KB. */
15867 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
15868 /* 2MB. */
15869 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
15870 /* 8MB. */
15871 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
15872 /* 1GB. */
15873 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
15874 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_1G
15875 /* VNIC page size and level. */
15876 uint8_t vnic_pg_size_vnic_lvl;
15877 /* VNIC PBL indirect levels. */
15878 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_MASK UINT32_C(0xf)
15879 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_SFT 0
15880 /* PBL pointer is physical start address. */
15881 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_0 UINT32_C(0x0)
15882 /* PBL pointer points to PTE table. */
15883 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_1 UINT32_C(0x1)
15884 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15885 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_2 UINT32_C(0x2)
15886 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_2
15887 /* VNIC page size. */
15888 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_MASK UINT32_C(0xf0)
15889 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_SFT 4
15890 /* 4KB. */
15891 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
15892 /* 8KB. */
15893 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
15894 /* 64KB. */
15895 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
15896 /* 2MB. */
15897 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
15898 /* 8MB. */
15899 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
15900 /* 1GB. */
15901 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
15902 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_1G
15903 /* Stat page size and level. */
15904 uint8_t stat_pg_size_stat_lvl;
15905 /* Stat PBL indirect levels. */
15906 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_MASK UINT32_C(0xf)
15907 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_SFT 0
15908 /* PBL pointer is physical start address. */
15909 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_0 UINT32_C(0x0)
15910 /* PBL pointer points to PTE table. */
15911 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_1 UINT32_C(0x1)
15912 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15913 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_2 UINT32_C(0x2)
15914 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_2
15915 /* Stat page size. */
15916 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_MASK UINT32_C(0xf0)
15917 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_SFT 4
15918 /* 4KB. */
15919 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
15920 /* 8KB. */
15921 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
15922 /* 64KB. */
15923 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
15924 /* 2MB. */
15925 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
15926 /* 8MB. */
15927 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
15928 /* 1GB. */
15929 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
15930 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_1G
15931 /* TQM slow path page size and level. */
15932 uint8_t tqm_sp_pg_size_tqm_sp_lvl;
15933 /* TQM slow path PBL indirect levels. */
15934 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_MASK UINT32_C(0xf)
15935 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_SFT 0
15936 /* PBL pointer is physical start address. */
15937 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_0 UINT32_C(0x0)
15938 /* PBL pointer points to PTE table. */
15939 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_1 UINT32_C(0x1)
15940 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15941 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_2 UINT32_C(0x2)
15942 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_2
15943 /* TQM slow path page size. */
15944 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_MASK UINT32_C(0xf0)
15945 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_SFT 4
15946 /* 4KB. */
15947 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
15948 /* 8KB. */
15949 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
15950 /* 64KB. */
15951 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
15952 /* 2MB. */
15953 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
15954 /* 8MB. */
15955 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
15956 /* 1GB. */
15957 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
15958 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_1G
15959 /* TQM ring 0 page size and level. */
15960 uint8_t tqm_ring0_pg_size_tqm_ring0_lvl;
15961 /* TQM ring 0 PBL indirect levels. */
15962 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_MASK UINT32_C(0xf)
15963 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_SFT 0
15964 /* PBL pointer is physical start address. */
15965 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_0 UINT32_C(0x0)
15966 /* PBL pointer points to PTE table. */
15967 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_1 UINT32_C(0x1)
15968 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15969 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_2 UINT32_C(0x2)
15970 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_2
15971 /* TQM ring 0 page size. */
15972 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_MASK UINT32_C(0xf0)
15973 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_SFT 4
15974 /* 4KB. */
15975 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
15976 /* 8KB. */
15977 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
15978 /* 64KB. */
15979 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
15980 /* 2MB. */
15981 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
15982 /* 8MB. */
15983 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
15984 /* 1GB. */
15985 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
15986 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_1G
15987 /* TQM ring 1 page size and level. */
15988 uint8_t tqm_ring1_pg_size_tqm_ring1_lvl;
15989 /* TQM ring 1 PBL indirect levels. */
15990 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_MASK UINT32_C(0xf)
15991 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_SFT 0
15992 /* PBL pointer is physical start address. */
15993 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_0 UINT32_C(0x0)
15994 /* PBL pointer points to PTE table. */
15995 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_1 UINT32_C(0x1)
15996 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15997 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_2 UINT32_C(0x2)
15998 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_2
15999 /* TQM ring 1 page size. */
16000 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_MASK UINT32_C(0xf0)
16001 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_SFT 4
16002 /* 4KB. */
16003 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
16004 /* 8KB. */
16005 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
16006 /* 64KB. */
16007 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
16008 /* 2MB. */
16009 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
16010 /* 8MB. */
16011 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
16012 /* 1GB. */
16013 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
16014 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_1G
16015 /* TQM ring 2 page size and level. */
16016 uint8_t tqm_ring2_pg_size_tqm_ring2_lvl;
16017 /* TQM ring 2 PBL indirect levels. */
16018 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_MASK UINT32_C(0xf)
16019 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_SFT 0
16020 /* PBL pointer is physical start address. */
16021 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_0 UINT32_C(0x0)
16022 /* PBL pointer points to PTE table. */
16023 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_1 UINT32_C(0x1)
16024 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
16025 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_2 UINT32_C(0x2)
16026 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_2
16027 /* TQM ring 2 page size. */
16028 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_MASK UINT32_C(0xf0)
16029 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_SFT 4
16030 /* 4KB. */
16031 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
16032 /* 8KB. */
16033 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
16034 /* 64KB. */
16035 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
16036 /* 2MB. */
16037 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
16038 /* 8MB. */
16039 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
16040 /* 1GB. */
16041 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
16042 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_1G
16043 /* TQM ring 3 page size and level. */
16044 uint8_t tqm_ring3_pg_size_tqm_ring3_lvl;
16045 /* TQM ring 3 PBL indirect levels. */
16046 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_MASK UINT32_C(0xf)
16047 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_SFT 0
16048 /* PBL pointer is physical start address. */
16049 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_0 UINT32_C(0x0)
16050 /* PBL pointer points to PTE table. */
16051 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_1 UINT32_C(0x1)
16052 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
16053 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_2 UINT32_C(0x2)
16054 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_2
16055 /* TQM ring 3 page size. */
16056 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_MASK UINT32_C(0xf0)
16057 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_SFT 4
16058 /* 4KB. */
16059 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
16060 /* 8KB. */
16061 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
16062 /* 64KB. */
16063 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
16064 /* 2MB. */
16065 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
16066 /* 8MB. */
16067 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
16068 /* 1GB. */
16069 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
16070 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_1G
16071 /* TQM ring 4 page size and level. */
16072 uint8_t tqm_ring4_pg_size_tqm_ring4_lvl;
16073 /* TQM ring 4 PBL indirect levels. */
16074 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_MASK UINT32_C(0xf)
16075 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_SFT 0
16076 /* PBL pointer is physical start address. */
16077 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_0 UINT32_C(0x0)
16078 /* PBL pointer points to PTE table. */
16079 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_1 UINT32_C(0x1)
16080 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
16081 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_2 UINT32_C(0x2)
16082 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_2
16083 /* TQM ring 4 page size. */
16084 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_MASK UINT32_C(0xf0)
16085 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_SFT 4
16086 /* 4KB. */
16087 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
16088 /* 8KB. */
16089 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
16090 /* 64KB. */
16091 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
16092 /* 2MB. */
16093 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
16094 /* 8MB. */
16095 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
16096 /* 1GB. */
16097 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
16098 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_1G
16099 /* TQM ring 5 page size and level. */
16100 uint8_t tqm_ring5_pg_size_tqm_ring5_lvl;
16101 /* TQM ring 5 PBL indirect levels. */
16102 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_MASK UINT32_C(0xf)
16103 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_SFT 0
16104 /* PBL pointer is physical start address. */
16105 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_0 UINT32_C(0x0)
16106 /* PBL pointer points to PTE table. */
16107 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_1 UINT32_C(0x1)
16108 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
16109 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_2 UINT32_C(0x2)
16110 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_2
16111 /* TQM ring 5 page size. */
16112 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_MASK UINT32_C(0xf0)
16113 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_SFT 4
16114 /* 4KB. */
16115 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
16116 /* 8KB. */
16117 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
16118 /* 64KB. */
16119 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
16120 /* 2MB. */
16121 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
16122 /* 8MB. */
16123 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
16124 /* 1GB. */
16125 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
16126 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_1G
16127 /* TQM ring 6 page size and level. */
16128 uint8_t tqm_ring6_pg_size_tqm_ring6_lvl;
16129 /* TQM ring 6 PBL indirect levels. */
16130 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_MASK UINT32_C(0xf)
16131 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_SFT 0
16132 /* PBL pointer is physical start address. */
16133 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_0 UINT32_C(0x0)
16134 /* PBL pointer points to PTE table. */
16135 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_1 UINT32_C(0x1)
16136 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
16137 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_2 UINT32_C(0x2)
16138 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_2
16139 /* TQM ring 6 page size. */
16140 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_MASK UINT32_C(0xf0)
16141 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_SFT 4
16142 /* 4KB. */
16143 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
16144 /* 8KB. */
16145 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
16146 /* 64KB. */
16147 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
16148 /* 2MB. */
16149 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
16150 /* 8MB. */
16151 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
16152 /* 1GB. */
16153 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
16154 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_1G
16155 /* TQM ring 7 page size and level. */
16156 uint8_t tqm_ring7_pg_size_tqm_ring7_lvl;
16157 /* TQM ring 7 PBL indirect levels. */
16158 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_MASK UINT32_C(0xf)
16159 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_SFT 0
16160 /* PBL pointer is physical start address. */
16161 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_0 UINT32_C(0x0)
16162 /* PBL pointer points to PTE table. */
16163 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_1 UINT32_C(0x1)
16164 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
16165 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_2 UINT32_C(0x2)
16166 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_2
16167 /* TQM ring 7 page size. */
16168 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_MASK UINT32_C(0xf0)
16169 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_SFT 4
16170 /* 4KB. */
16171 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
16172 /* 8KB. */
16173 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
16174 /* 64KB. */
16175 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
16176 /* 2MB. */
16177 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
16178 /* 8MB. */
16179 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
16180 /* 1GB. */
16181 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
16182 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_1G
16183 /* MR/AV page size and level. */
16184 uint8_t mrav_pg_size_mrav_lvl;
16185 /* MR/AV PBL indirect levels. */
16186 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_MASK UINT32_C(0xf)
16187 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_SFT 0
16188 /* PBL pointer is physical start address. */
16189 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_0 UINT32_C(0x0)
16190 /* PBL pointer points to PTE table. */
16191 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_1 UINT32_C(0x1)
16192 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
16193 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_2 UINT32_C(0x2)
16194 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_2
16195 /* MR/AV page size. */
16196 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_MASK UINT32_C(0xf0)
16197 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_SFT 4
16198 /* 4KB. */
16199 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
16200 /* 8KB. */
16201 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
16202 /* 64KB. */
16203 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
16204 /* 2MB. */
16205 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
16206 /* 8MB. */
16207 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
16208 /* 1GB. */
16209 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
16210 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_1G
16211 /* Timer page size and level. */
16212 uint8_t tim_pg_size_tim_lvl;
16213 /* Timer PBL indirect levels. */
16214 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_MASK UINT32_C(0xf)
16215 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_SFT 0
16216 /* PBL pointer is physical start address. */
16217 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_0 UINT32_C(0x0)
16218 /* PBL pointer points to PTE table. */
16219 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_1 UINT32_C(0x1)
16220 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
16221 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_2 UINT32_C(0x2)
16222 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_2
16223 /* Timer page size. */
16224 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_MASK UINT32_C(0xf0)
16225 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_SFT 4
16226 /* 4KB. */
16227 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
16228 /* 8KB. */
16229 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
16230 /* 64KB. */
16231 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
16232 /* 2MB. */
16233 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
16234 /* 8MB. */
16235 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
16236 /* 1GB. */
16237 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
16238 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_1G
16239 /* QP page directory. */
16240 uint64_t qpc_page_dir;
16241 /* SRQ page directory. */
16242 uint64_t srq_page_dir;
16243 /* CQ page directory. */
16244 uint64_t cq_page_dir;
16245 /* VNIC page directory. */
16246 uint64_t vnic_page_dir;
16247 /* Stat page directory. */
16248 uint64_t stat_page_dir;
16249 /* TQM slowpath page directory. */
16250 uint64_t tqm_sp_page_dir;
16251 /* TQM ring 0 page directory. */
16252 uint64_t tqm_ring0_page_dir;
16253 /* TQM ring 1 page directory. */
16254 uint64_t tqm_ring1_page_dir;
16255 /* TQM ring 2 page directory. */
16256 uint64_t tqm_ring2_page_dir;
16257 /* TQM ring 3 page directory. */
16258 uint64_t tqm_ring3_page_dir;
16259 /* TQM ring 4 page directory. */
16260 uint64_t tqm_ring4_page_dir;
16261 /* TQM ring 5 page directory. */
16262 uint64_t tqm_ring5_page_dir;
16263 /* TQM ring 6 page directory. */
16264 uint64_t tqm_ring6_page_dir;
16265 /* TQM ring 7 page directory. */
16266 uint64_t tqm_ring7_page_dir;
16267 /* MR/AV page directory. */
16268 uint64_t mrav_page_dir;
16269 /* Timer page directory. */
16270 uint64_t tim_page_dir;
16271 /* Number of entries to reserve for QP1 */
16272 uint16_t qp_num_qp1_entries;
16273 /* Number of entries to reserve for L2 */
16274 uint16_t qp_num_l2_entries;
16275 /* Number of QPs. */
16276 uint32_t qp_num_entries;
16277 /* Number of SRQs. */
16278 uint32_t srq_num_entries;
16279 /* Number of entries to reserve for L2 */
16280 uint16_t srq_num_l2_entries;
16281 /* Number of entries to reserve for L2 */
16282 uint16_t cq_num_l2_entries;
16283 /* Number of CQs. */
16284 uint32_t cq_num_entries;
16285 /* Number of entries to reserve for VNIC entries */
16286 uint16_t vnic_num_vnic_entries;
16287 /* Number of entries to reserve for Ring table entries */
16288 uint16_t vnic_num_ring_table_entries;
16289 /* Number of Stats. */
16290 uint32_t stat_num_entries;
16291 /* Number of TQM slowpath entries. */
16292 uint32_t tqm_sp_num_entries;
16293 /* Number of TQM ring 0 entries. */
16294 uint32_t tqm_ring0_num_entries;
16295 /* Number of TQM ring 1 entries. */
16296 uint32_t tqm_ring1_num_entries;
16297 /* Number of TQM ring 2 entries. */
16298 uint32_t tqm_ring2_num_entries;
16299 /* Number of TQM ring 3 entries. */
16300 uint32_t tqm_ring3_num_entries;
16301 /* Number of TQM ring 4 entries. */
16302 uint32_t tqm_ring4_num_entries;
16303 /* Number of TQM ring 5 entries. */
16304 uint32_t tqm_ring5_num_entries;
16305 /* Number of TQM ring 6 entries. */
16306 uint32_t tqm_ring6_num_entries;
16307 /* Number of TQM ring 7 entries. */
16308 uint32_t tqm_ring7_num_entries;
16309 /*
16310 * If the MR/AV split reservation flag is not set, then this field
16311 * represents the total number of MR plus AV entries. For versions
16312 * of firmware that support the split reservation, when it is not
16313 * specified half of the entries will be reserved for MRs and the
16314 * other half for AVs.
16315 *
16316 * If the MR/AV split reservation flag is set, then this
16317 * field is logically divided into two 16b fields. Bits `[31:16]`
16318 * represents the `mr_num_entries` and bits `[15:0]` represents
16319 * `av_num_entries`. The granularity of these values is defined by
16320 * the `mrav_num_entries_unit` field returned by the
16321 * `backing_store_qcaps` command.
16322 */
16323 uint32_t mrav_num_entries;
16324 /* Number of Timer entries. */
16325 uint32_t tim_num_entries;
16326 /* TQM ring page size and level. */
16327 uint8_t tqm_ring8_pg_size_tqm_ring_lvl;
16328 /* TQM ring PBL indirect levels. */
16329 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_MASK UINT32_C(0xf)
16330 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_SFT 0
16331 /* PBL pointer is physical start address. */
16332 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_LVL_0 UINT32_C(0x0)
16333 /* PBL pointer points to PTE table. */
16334 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_LVL_1 UINT32_C(0x1)
16335 /*
16336 * PBL pointer points to PDE table with each entry pointing to
16337 * PTE tables.
16338 */
16339 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_LVL_2 UINT32_C(0x2)
16340 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_LVL_2
16341 /* TQM ring page size. */
16342 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_MASK UINT32_C(0xf0)
16343 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_SFT 4
16344 /* 4KB. */
16345 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
16346 /* 8KB. */
16347 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
16348 /* 64KB. */
16349 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
16350 /* 2MB. */
16351 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
16352 /* 8MB. */
16353 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
16354 /* 1GB. */
16355 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
16356 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_1G
16357 uint8_t ring8_unused[3];
16358 /* Number of TQM ring entries. */
16359 uint32_t tqm_ring8_num_entries;
16360 /* TQM ring page directory. */
16361 uint64_t tqm_ring8_page_dir;
16362 /* TQM ring page size and level. */
16363 uint8_t tqm_ring9_pg_size_tqm_ring_lvl;
16364 /* TQM ring PBL indirect levels. */
16365 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_MASK UINT32_C(0xf)
16366 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_SFT 0
16367 /* PBL pointer is physical start address. */
16368 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_LVL_0 UINT32_C(0x0)
16369 /* PBL pointer points to PTE table. */
16370 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_LVL_1 UINT32_C(0x1)
16371 /*
16372 * PBL pointer points to PDE table with each entry pointing to
16373 * PTE tables.
16374 */
16375 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_LVL_2 UINT32_C(0x2)
16376 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_LVL_2
16377 /* TQM ring page size. */
16378 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_MASK UINT32_C(0xf0)
16379 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_SFT 4
16380 /* 4KB. */
16381 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
16382 /* 8KB. */
16383 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
16384 /* 64KB. */
16385 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
16386 /* 2MB. */
16387 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
16388 /* 8MB. */
16389 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
16390 /* 1GB. */
16391 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
16392 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_1G
16393 uint8_t ring9_unused[3];
16394 /* Number of TQM ring entries. */
16395 uint32_t tqm_ring9_num_entries;
16396 /* TQM ring page directory. */
16397 uint64_t tqm_ring9_page_dir;
16398 /* TQM ring page size and level. */
16399 uint8_t tqm_ring10_pg_size_tqm_ring_lvl;
16400 /* TQM ring PBL indirect levels. */
16401 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_MASK UINT32_C(0xf)
16402 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_SFT 0
16403 /* PBL pointer is physical start address. */
16404 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_LVL_0 UINT32_C(0x0)
16405 /* PBL pointer points to PTE table. */
16406 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_LVL_1 UINT32_C(0x1)
16407 /*
16408 * PBL pointer points to PDE table with each entry pointing to
16409 * PTE tables.
16410 */
16411 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_LVL_2 UINT32_C(0x2)
16412 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_LVL_2
16413 /* TQM ring page size. */
16414 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_MASK UINT32_C(0xf0)
16415 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_SFT 4
16416 /* 4KB. */
16417 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
16418 /* 8KB. */
16419 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
16420 /* 64KB. */
16421 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
16422 /* 2MB. */
16423 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
16424 /* 8MB. */
16425 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
16426 /* 1GB. */
16427 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
16428 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_1G
16429 uint8_t ring10_unused[3];
16430 /* Number of TQM ring entries. */
16431 uint32_t tqm_ring10_num_entries;
16432 /* TQM ring page directory. */
16433 uint64_t tqm_ring10_page_dir;
16434 /* Number of Tx KTLS context entries. */
16435 uint32_t tkc_num_entries;
16436 /* Number of Rx KTLS context entries. */
16437 uint32_t rkc_num_entries;
16438 /* Tx KTLS context page directory. */
16439 uint64_t tkc_page_dir;
16440 /* Rx KTLS context page directory. */
16441 uint64_t rkc_page_dir;
16442 /* Tx KTLS context page size and level. */
16443 uint8_t tkc_pg_size_tkc_lvl;
16444 /* Tx KTLS context PBL indirect levels. */
16445 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_MASK UINT32_C(0xf)
16446 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_SFT 0
16447 /* PBL pointer is physical start address. */
16448 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_LVL_0 UINT32_C(0x0)
16449 /* PBL pointer points to PTE table. */
16450 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_LVL_1 UINT32_C(0x1)
16451 /*
16452 * PBL pointer points to PDE table with each entry pointing to
16453 * PTE tables.
16454 */
16455 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_LVL_2 UINT32_C(0x2)
16456 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_LVL_2
16457 /* Tx KTLS context page size. */
16458 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_MASK UINT32_C(0xf0)
16459 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_SFT 4
16460 /* 4KB. */
16461 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
16462 /* 8KB. */
16463 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
16464 /* 64KB. */
16465 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
16466 /* 2MB. */
16467 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
16468 /* 8MB. */
16469 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
16470 /* 1GB. */
16471 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
16472 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_1G
16473 /* Rx KTLS context page size and level. */
16474 uint8_t rkc_pg_size_tkc_lvl;
16475 /* Rx KTLS context PBL indirect levels. */
16476 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_MASK UINT32_C(0xf)
16477 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_SFT 0
16478 /* PBL pointer is physical start address. */
16479 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_LVL_0 UINT32_C(0x0)
16480 /* PBL pointer points to PTE table. */
16481 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_LVL_1 UINT32_C(0x1)
16482 /*
16483 * PBL pointer points to PDE table with each entry pointing to
16484 * PTE tables.
16485 */
16486 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_LVL_2 UINT32_C(0x2)
16487 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_LVL_2
16488 /* Rx KTLS context page size. */
16489 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_MASK UINT32_C(0xf0)
16490 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_SFT 4
16491 /* 4KB. */
16492 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
16493 /* 8KB. */
16494 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
16495 /* 64KB. */
16496 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
16497 /* 2MB. */
16498 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
16499 /* 8MB. */
16500 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
16501 /* 1GB. */
16502 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
16503 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_LAST HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_1G
16504 uint8_t unused_1[5];
16505 /*
16506 * This field is used in Output records to indicate that the output
16507 * is completely written to RAM. This field should be read as 1
16508 * to indicate that the output has been completely written.
16509 * When writing a command completion or response to an internal
16510 * processor, the order of writes has to be such that this field
16511 * is written last.
16512 */
16513 uint8_t valid;
16514 } hwrm_func_backing_store_qcfg_output_t, *phwrm_func_backing_store_qcfg_output_t;
16515
16516 /****************************
16517 * hwrm_error_recovery_qcfg *
16518 ****************************/
16519
16520
16521 /* hwrm_error_recovery_qcfg_input (size:192b/24B) */
16522
16523 typedef struct hwrm_error_recovery_qcfg_input {
16524 /* The HWRM command request type. */
16525 uint16_t req_type;
16526 /*
16527 * The completion ring to send the completion event on. This should
16528 * be the NQ ID returned from the `nq_alloc` HWRM command.
16529 */
16530 uint16_t cmpl_ring;
16531 /*
16532 * The sequence ID is used by the driver for tracking multiple
16533 * commands. This ID is treated as opaque data by the firmware and
16534 * the value is returned in the `hwrm_resp_hdr` upon completion.
16535 */
16536 uint16_t seq_id;
16537 /*
16538 * The target ID of the command:
16539 * * 0x0-0xFFF8 - The function ID
16540 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16541 * * 0xFFFD - Reserved for user-space HWRM interface
16542 * * 0xFFFF - HWRM
16543 */
16544 uint16_t target_id;
16545 /*
16546 * A physical address pointer pointing to a host buffer that the
16547 * command's response data will be written. This can be either a host
16548 * physical address (HPA) or a guest physical address (GPA) and must
16549 * point to a physically contiguous block of memory.
16550 */
16551 uint64_t resp_addr;
16552 uint8_t unused_0[8];
16553 } hwrm_error_recovery_qcfg_input_t, *phwrm_error_recovery_qcfg_input_t;
16554
16555 /* hwrm_error_recovery_qcfg_output (size:1664b/208B) */
16556
16557 typedef struct hwrm_error_recovery_qcfg_output {
16558 /* The specific error status for the command. */
16559 uint16_t error_code;
16560 /* The HWRM command request type. */
16561 uint16_t req_type;
16562 /* The sequence ID from the original command. */
16563 uint16_t seq_id;
16564 /* The length of the response data in number of bytes. */
16565 uint16_t resp_len;
16566 uint32_t flags;
16567 /*
16568 * When this flag is set to 1, error recovery will be initiated
16569 * through master function driver.
16570 */
16571 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_HOST UINT32_C(0x1)
16572 /*
16573 * When this flag is set to 1, error recovery will be performed
16574 * through Co processor.
16575 */
16576 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_CO_CPU UINT32_C(0x2)
16577 /*
16578 * Driver Polling frequency. This value is in units of 100msec.
16579 * Typical value would be 10 to indicate 1sec.
16580 * Drivers can poll FW health status, Heartbeat, reset_counter with
16581 * this frequency.
16582 */
16583 uint32_t driver_polling_freq;
16584 /*
16585 * This value is in units of 100msec.
16586 * Typical value would be 30 to indicate 3sec.
16587 * Master function wait period from detecting a fatal error to
16588 * initiating reset. In this time period Master PF expects every
16589 * active driver will detect fatal error.
16590 */
16591 uint32_t master_func_wait_period;
16592 /*
16593 * This value is in units of 100msec.
16594 * Typical value would be 50 to indicate 5sec.
16595 * Normal function wait period from fatal error detection to
16596 * polling FW health status. In this time period, drivers should not
16597 * do any PCIe MMIO transaction and should not send any HWRM commands.
16598 */
16599 uint32_t normal_func_wait_period;
16600 /*
16601 * This value is in units of 100msec.
16602 * Typical value would be 20 to indicate 2sec.
16603 * This field indicates that, master function wait period after chip
16604 * reset. After this time, master function should reinitialize with
16605 * FW.
16606 */
16607 uint32_t master_func_wait_period_after_reset;
16608 /*
16609 * This value is in units of 100msec.
16610 * Typical value would be 60 to indicate 6sec.
16611 * This field is applicable to both master and normal functions.
16612 * Even after chip reset, if FW status not changed to ready,
16613 * then all the functions can poll for this much time and bailout.
16614 */
16615 uint32_t max_bailout_time_after_reset;
16616 /*
16617 * FW health status register.
16618 * Lower 2 bits indicates address space location and upper 30 bits
16619 * indicates upper 30bits of the register address.
16620 * A value of 0xFFFF-FFFF indicates this register does not exist.
16621 */
16622 uint32_t fw_health_status_reg;
16623 /* Lower 2 bits indicates address space location. */
16624 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_MASK UINT32_C(0x3)
16625 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_SFT 0
16626 /*
16627 * If value is 0, this register is located in PCIe config space.
16628 * Drivers have to map appropriate window to access this
16629 * register.
16630 */
16631 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_PCIE_CFG UINT32_C(0x0)
16632 /*
16633 * If value is 1, this register is located in GRC address space.
16634 * Drivers have to map appropriate window to access this
16635 * register.
16636 */
16637 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_GRC UINT32_C(0x1)
16638 /*
16639 * If value is 2, this register is located in first BAR address
16640 * space. Drivers have to map appropriate window to access this
16641 * register.
16642 */
16643 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_BAR0 UINT32_C(0x2)
16644 /*
16645 * If value is 3, this register is located in second BAR address
16646 * space. Drivers have to map appropriate window to access this
16647 * Drivers have to map appropriate window to access this
16648 * register.
16649 */
16650 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_BAR1 UINT32_C(0x3)
16651 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_LAST HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_BAR1
16652 /* Upper 30bits of the register address. */
16653 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_MASK UINT32_C(0xfffffffc)
16654 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SFT 2
16655 /*
16656 * FW HeartBeat register.
16657 * Lower 2 bits indicates address space location and upper 30 bits
16658 * indicates actual address.
16659 * A value of 0xFFFF-FFFF indicates this register does not exist.
16660 */
16661 uint32_t fw_heartbeat_reg;
16662 /* Lower 2 bits indicates address space location. */
16663 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_MASK UINT32_C(0x3)
16664 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_SFT 0
16665 /*
16666 * If value is 0, this register is located in PCIe config space.
16667 * Drivers have to map appropriate window to access this
16668 * register.
16669 */
16670 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_PCIE_CFG UINT32_C(0x0)
16671 /*
16672 * If value is 1, this register is located in GRC address space.
16673 * Drivers have to map appropriate window to access this
16674 * register.
16675 */
16676 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_GRC UINT32_C(0x1)
16677 /*
16678 * If value is 2, this register is located in first BAR address
16679 * space. Drivers have to map appropriate window to access this
16680 * register.
16681 */
16682 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR0 UINT32_C(0x2)
16683 /*
16684 * If value is 3, this register is located in second BAR address
16685 * space. Drivers have to map appropriate window to access this
16686 * register.
16687 */
16688 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR1 UINT32_C(0x3)
16689 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_LAST HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR1
16690 /* Upper 30bits of the register address. */
16691 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_MASK UINT32_C(0xfffffffc)
16692 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SFT 2
16693 /*
16694 * FW reset counter.
16695 * Lower 2 bits indicates address space location and upper 30 bits
16696 * indicates actual address.
16697 * A value of 0xFFFF-FFFF indicates this register does not exist.
16698 */
16699 uint32_t fw_reset_cnt_reg;
16700 /* Lower 2 bits indicates address space location. */
16701 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_MASK UINT32_C(0x3)
16702 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_SFT 0
16703 /*
16704 * If value is 0, this register is located in PCIe config space.
16705 * Drivers have to map appropriate window to access this
16706 * register.
16707 */
16708 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_PCIE_CFG UINT32_C(0x0)
16709 /*
16710 * If value is 1, this register is located in GRC address space.
16711 * Drivers have to map appropriate window to access this
16712 * register.
16713 */
16714 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_GRC UINT32_C(0x1)
16715 /*
16716 * If value is 2, this register is located in first BAR address
16717 * space. Drivers have to map appropriate window to access this
16718 * register.
16719 */
16720 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR0 UINT32_C(0x2)
16721 /*
16722 * If value is 3, this register is located in second BAR address
16723 * space. Drivers have to map appropriate window to access this
16724 * register.
16725 */
16726 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR1 UINT32_C(0x3)
16727 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_LAST HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR1
16728 /* Upper 30bits of the register address. */
16729 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_MASK UINT32_C(0xfffffffc)
16730 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SFT 2
16731 /*
16732 * Reset Inprogress Register address for PFs.
16733 * Lower 2 bits indicates address space location and upper 30 bits
16734 * indicates actual address.
16735 * A value of 0xFFFF-FFFF indicates this register does not exist.
16736 */
16737 uint32_t reset_inprogress_reg;
16738 /* Lower 2 bits indicates address space location. */
16739 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_MASK UINT32_C(0x3)
16740 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_SFT 0
16741 /*
16742 * If value is 0, this register is located in PCIe config space.
16743 * Drivers have to map appropriate window to access this
16744 * register.
16745 */
16746 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_PCIE_CFG UINT32_C(0x0)
16747 /*
16748 * If value is 1, this register is located in GRC address space.
16749 * Drivers have to map appropriate window to access this
16750 * register.
16751 */
16752 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_GRC UINT32_C(0x1)
16753 /*
16754 * If value is 2, this register is located in first BAR address
16755 * space. Drivers have to map appropriate window to access this
16756 * register.
16757 */
16758 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR0 UINT32_C(0x2)
16759 /*
16760 * If value is 3, this register is located in second BAR address
16761 * space. Drivers have to map appropriate window to access this
16762 * register.
16763 */
16764 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR1 UINT32_C(0x3)
16765 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_LAST HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR1
16766 /* Upper 30bits of the register address. */
16767 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_MASK UINT32_C(0xfffffffc)
16768 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SFT 2
16769 /* This field indicates the mask value for reset_inprogress_reg. */
16770 uint32_t reset_inprogress_reg_mask;
16771 uint8_t unused_0[3];
16772 /*
16773 * Array of registers and value count to reset the Chip
16774 * Each array count has reset_reg, reset_reg_val, delay_after_reset
16775 * in TLV format. Depending upon Chip type, number of reset registers
16776 * will vary. Drivers have to write reset_reg_val in the reset_reg
16777 * location in the same sequence in order to recover from a fatal
16778 * error.
16779 */
16780 uint8_t reg_array_cnt;
16781 /*
16782 * Reset register.
16783 * Lower 2 bits indicates address space location and upper 30 bits
16784 * indicates actual address.
16785 * A value of 0xFFFF-FFFF indicates this register does not exist.
16786 */
16787 uint32_t reset_reg[16];
16788 /* Lower 2 bits indicates address space location. */
16789 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_MASK UINT32_C(0x3)
16790 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_SFT 0
16791 /*
16792 * If value is 0, this register is located in PCIe config space.
16793 * Drivers have to map appropriate window to access this
16794 * register.
16795 */
16796 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_PCIE_CFG UINT32_C(0x0)
16797 /*
16798 * If value is 1, this register is located in GRC address space.
16799 * Drivers have to map appropriate window to access this
16800 * register.
16801 */
16802 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_GRC UINT32_C(0x1)
16803 /*
16804 * If value is 2, this register is located in first BAR address
16805 * space. Drivers have to map appropriate window to access this
16806 * register.
16807 */
16808 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR0 UINT32_C(0x2)
16809 /*
16810 * If value is 3, this register is located in second BAR address
16811 * space. Drivers have to map appropriate window to access this
16812 * register.
16813 */
16814 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR1 UINT32_C(0x3)
16815 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_LAST HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR1
16816 /* Upper 30bits of the register address. */
16817 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_MASK UINT32_C(0xfffffffc)
16818 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SFT 2
16819 /* Value to be written in reset_reg to reset the controller. */
16820 uint32_t reset_reg_val[16];
16821 /*
16822 * This value is in units of 1msec.
16823 * Typical value would be 10 to indicate 10msec.
16824 * Some of the operations like Core reset require delay before
16825 * accessing PCIE MMIO register space.
16826 * If this value is non-zero, drivers have to wait for
16827 * this much time after writing reset_reg_val in reset_reg.
16828 */
16829 uint8_t delay_after_reset[16];
16830 /*
16831 * Error recovery counter.
16832 * Lower 2 bits indicates address space location and upper 30 bits
16833 * indicates actual address.
16834 * A value of 0xFFFF-FFFF indicates this register does not exist.
16835 */
16836 uint32_t err_recovery_cnt_reg;
16837 /* Lower 2 bits indicates address space location. */
16838 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_MASK UINT32_C(0x3)
16839 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_SFT 0
16840 /*
16841 * If value is 0, this register is located in PCIe config space.
16842 * Drivers have to map appropriate window to access this
16843 * register.
16844 */
16845 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_PCIE_CFG UINT32_C(0x0)
16846 /*
16847 * If value is 1, this register is located in GRC address space.
16848 * Drivers have to map appropriate window to access this
16849 * register.
16850 */
16851 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_GRC UINT32_C(0x1)
16852 /*
16853 * If value is 2, this register is located in first BAR address
16854 * space. Drivers have to map appropriate window to access this
16855 * register.
16856 */
16857 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_BAR0 UINT32_C(0x2)
16858 /*
16859 * If value is 3, this register is located in second BAR address
16860 * space. Drivers have to map appropriate window to access this
16861 * register.
16862 */
16863 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_BAR1 UINT32_C(0x3)
16864 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_LAST HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_BAR1
16865 /* Upper 30bits of the register address. */
16866 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_MASK UINT32_C(0xfffffffc)
16867 #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SFT 2
16868 uint8_t unused_1[3];
16869 /*
16870 * This field is used in Output records to indicate that the output
16871 * is completely written to RAM. This field should be read as '1'
16872 * to indicate that the output has been completely written.
16873 * When writing a command completion or response to an internal
16874 * processor, the order of writes has to be such that this field
16875 * is written last.
16876 */
16877 uint8_t valid;
16878 } hwrm_error_recovery_qcfg_output_t, *phwrm_error_recovery_qcfg_output_t;
16879
16880 /***************************
16881 * hwrm_func_echo_response *
16882 ***************************/
16883
16884
16885 /* hwrm_func_echo_response_input (size:192b/24B) */
16886
16887 typedef struct hwrm_func_echo_response_input {
16888 /* The HWRM command request type. */
16889 uint16_t req_type;
16890 /*
16891 * The completion ring to send the completion event on. This should
16892 * be the NQ ID returned from the `nq_alloc` HWRM command.
16893 */
16894 uint16_t cmpl_ring;
16895 /*
16896 * The sequence ID is used by the driver for tracking multiple
16897 * commands. This ID is treated as opaque data by the firmware and
16898 * the value is returned in the `hwrm_resp_hdr` upon completion.
16899 */
16900 uint16_t seq_id;
16901 /*
16902 * The target ID of the command:
16903 * * 0x0-0xFFF8 - The function ID
16904 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16905 * * 0xFFFD - Reserved for user-space HWRM interface
16906 * * 0xFFFF - HWRM
16907 */
16908 uint16_t target_id;
16909 /*
16910 * A physical address pointer pointing to a host buffer that the
16911 * command's response data will be written. This can be either a host
16912 * physical address (HPA) or a guest physical address (GPA) and must
16913 * point to a physically contiguous block of memory.
16914 */
16915 uint64_t resp_addr;
16916 uint32_t event_data1;
16917 uint32_t event_data2;
16918 } hwrm_func_echo_response_input_t, *phwrm_func_echo_response_input_t;
16919
16920 /* hwrm_func_echo_response_output (size:128b/16B) */
16921
16922 typedef struct hwrm_func_echo_response_output {
16923 /* The specific error status for the command. */
16924 uint16_t error_code;
16925 /* The HWRM command request type. */
16926 uint16_t req_type;
16927 /* The sequence ID from the original command. */
16928 uint16_t seq_id;
16929 /* The length of the response data in number of bytes. */
16930 uint16_t resp_len;
16931 uint8_t unused_0[7];
16932 /*
16933 * This field is used in Output records to indicate that the output
16934 * is completely written to RAM. This field should be read as '1'
16935 * to indicate that the output has been completely written.
16936 * When writing a command completion or response to an internal processor,
16937 * the order of writes has to be such that this field is written last.
16938 */
16939 uint8_t valid;
16940 } hwrm_func_echo_response_output_t, *phwrm_func_echo_response_output_t;
16941
16942 /**************************
16943 * hwrm_func_ptp_pin_qcfg *
16944 **************************/
16945
16946
16947 /* hwrm_func_ptp_pin_qcfg_input (size:192b/24B) */
16948
16949 typedef struct hwrm_func_ptp_pin_qcfg_input {
16950 /* The HWRM command request type. */
16951 uint16_t req_type;
16952 /*
16953 * The completion ring to send the completion event on. This should
16954 * be the NQ ID returned from the `nq_alloc` HWRM command.
16955 */
16956 uint16_t cmpl_ring;
16957 /*
16958 * The sequence ID is used by the driver for tracking multiple
16959 * commands. This ID is treated as opaque data by the firmware and
16960 * the value is returned in the `hwrm_resp_hdr` upon completion.
16961 */
16962 uint16_t seq_id;
16963 /*
16964 * The target ID of the command:
16965 * * 0x0-0xFFF8 - The function ID
16966 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16967 * * 0xFFFD - Reserved for user-space HWRM interface
16968 * * 0xFFFF - HWRM
16969 */
16970 uint16_t target_id;
16971 /*
16972 * A physical address pointer pointing to a host buffer that the
16973 * command's response data will be written. This can be either a host
16974 * physical address (HPA) or a guest physical address (GPA) and must
16975 * point to a physically contiguous block of memory.
16976 */
16977 uint64_t resp_addr;
16978 uint8_t unused_0[8];
16979 } hwrm_func_ptp_pin_qcfg_input_t, *phwrm_func_ptp_pin_qcfg_input_t;
16980
16981 /* hwrm_func_ptp_pin_qcfg_output (size:128b/16B) */
16982
16983 typedef struct hwrm_func_ptp_pin_qcfg_output {
16984 /* The specific error status for the command. */
16985 uint16_t error_code;
16986 /* The HWRM command request type. */
16987 uint16_t req_type;
16988 /* The sequence ID from the original command. */
16989 uint16_t seq_id;
16990 /* The length of the response data in number of bytes. */
16991 uint16_t resp_len;
16992 /*
16993 * The number of TSIO pins that are configured on this board
16994 * Up to 4 pins can be returned in the response.
16995 */
16996 uint8_t num_pins;
16997 /* Pin state */
16998 uint8_t state;
16999 /*
17000 * When this bit is '1', TSIO pin 0 is enabled.
17001 * When this bit is '', TSIO pin 0 is disabled.
17002 */
17003 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_STATE_PIN0_ENABLED UINT32_C(0x1)
17004 /*
17005 * When this bit is '1', TSIO pin 1 is enabled.
17006 * When this bit is '', TSIO pin 1 is disabled.
17007 */
17008 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_STATE_PIN1_ENABLED UINT32_C(0x2)
17009 /*
17010 * When this bit is '1', TSIO pin 2 is enabled.
17011 * When this bit is '', TSIO pin 2 is disabled.
17012 */
17013 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_STATE_PIN2_ENABLED UINT32_C(0x4)
17014 /*
17015 * When this bit is '1', TSIO pin 3 is enabled.
17016 * When this bit is '', TSIO pin 3 is disabled.
17017 */
17018 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_STATE_PIN3_ENABLED UINT32_C(0x8)
17019 /* Type of function for Pin #0. */
17020 uint8_t pin0_usage;
17021 /* No function is configured. */
17022 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_NONE UINT32_C(0x0)
17023 /* PPS IN is configured. */
17024 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_PPS_IN UINT32_C(0x1)
17025 /* PPS OUT is configured. */
17026 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_PPS_OUT UINT32_C(0x2)
17027 /* SYNC IN is configured. */
17028 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_SYNC_IN UINT32_C(0x3)
17029 /* SYNC OUT is configured. */
17030 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_SYNC_OUT UINT32_C(0x4)
17031 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_LAST HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_SYNC_OUT
17032 /* Type of function for Pin #1. */
17033 uint8_t pin1_usage;
17034 /* No function is configured. */
17035 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_NONE UINT32_C(0x0)
17036 /* PPS IN is configured. */
17037 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_PPS_IN UINT32_C(0x1)
17038 /* PPS OUT is configured. */
17039 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_PPS_OUT UINT32_C(0x2)
17040 /* SYNC IN is configured. */
17041 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_SYNC_IN UINT32_C(0x3)
17042 /* SYNC OUT is configured. */
17043 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_SYNC_OUT UINT32_C(0x4)
17044 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_LAST HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_SYNC_OUT
17045 /* Type of function for Pin #2. */
17046 uint8_t pin2_usage;
17047 /* No function is configured. */
17048 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_NONE UINT32_C(0x0)
17049 /* PPS IN is configured. */
17050 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_PPS_IN UINT32_C(0x1)
17051 /* PPS OUT is configured. */
17052 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_PPS_OUT UINT32_C(0x2)
17053 /* SYNC IN is configured. */
17054 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_SYNC_IN UINT32_C(0x3)
17055 /* SYNC OUT is configured. */
17056 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_SYNC_OUT UINT32_C(0x4)
17057 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_LAST HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_SYNC_OUT
17058 /* Type of function for Pin #3. */
17059 uint8_t pin3_usage;
17060 /* No function is configured. */
17061 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_NONE UINT32_C(0x0)
17062 /* PPS IN is configured. */
17063 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_PPS_IN UINT32_C(0x1)
17064 /* PPS OUT is configured. */
17065 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_PPS_OUT UINT32_C(0x2)
17066 /* SYNC IN is configured. */
17067 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_SYNC_IN UINT32_C(0x3)
17068 /* SYNC OUT is configured. */
17069 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_SYNC_OUT UINT32_C(0x4)
17070 #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_LAST HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_SYNC_OUT
17071 uint8_t unused_0;
17072 /*
17073 * This field is used in Output records to indicate that the output
17074 * is completely written to RAM. This field should be read as '1'
17075 * to indicate that the output has been completely written.
17076 * When writing a command completion or response to an internal processor,
17077 * the order of writes has to be such that this field is written last.
17078 */
17079 uint8_t valid;
17080 } hwrm_func_ptp_pin_qcfg_output_t, *phwrm_func_ptp_pin_qcfg_output_t;
17081
17082 /*************************
17083 * hwrm_func_ptp_pin_cfg *
17084 *************************/
17085
17086
17087 /* hwrm_func_ptp_pin_cfg_input (size:256b/32B) */
17088
17089 typedef struct hwrm_func_ptp_pin_cfg_input {
17090 /* The HWRM command request type. */
17091 uint16_t req_type;
17092 /*
17093 * The completion ring to send the completion event on. This should
17094 * be the NQ ID returned from the `nq_alloc` HWRM command.
17095 */
17096 uint16_t cmpl_ring;
17097 /*
17098 * The sequence ID is used by the driver for tracking multiple
17099 * commands. This ID is treated as opaque data by the firmware and
17100 * the value is returned in the `hwrm_resp_hdr` upon completion.
17101 */
17102 uint16_t seq_id;
17103 /*
17104 * The target ID of the command:
17105 * * 0x0-0xFFF8 - The function ID
17106 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17107 * * 0xFFFD - Reserved for user-space HWRM interface
17108 * * 0xFFFF - HWRM
17109 */
17110 uint16_t target_id;
17111 /*
17112 * A physical address pointer pointing to a host buffer that the
17113 * command's response data will be written. This can be either a host
17114 * physical address (HPA) or a guest physical address (GPA) and must
17115 * point to a physically contiguous block of memory.
17116 */
17117 uint64_t resp_addr;
17118 uint32_t enables;
17119 /*
17120 * This bit must be '1' for the pin0_state field to be
17121 * configured.
17122 */
17123 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN0_STATE UINT32_C(0x1)
17124 /*
17125 * This bit must be '1' for the pin0_usage field to be
17126 * configured.
17127 */
17128 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN0_USAGE UINT32_C(0x2)
17129 /*
17130 * This bit must be '1' for the pin1_state field to be
17131 * configured.
17132 */
17133 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN1_STATE UINT32_C(0x4)
17134 /*
17135 * This bit must be '1' for the pin1_usage field to be
17136 * configured.
17137 */
17138 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN1_USAGE UINT32_C(0x8)
17139 /*
17140 * This bit must be '1' for the pin2_state field to be
17141 * configured.
17142 */
17143 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN2_STATE UINT32_C(0x10)
17144 /*
17145 * This bit must be '1' for the pin2_usage field to be
17146 * configured.
17147 */
17148 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN2_USAGE UINT32_C(0x20)
17149 /*
17150 * This bit must be '1' for the pin3_state field to be
17151 * configured.
17152 */
17153 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN3_STATE UINT32_C(0x40)
17154 /*
17155 * This bit must be '1' for the pin3_usage field to be
17156 * configured.
17157 */
17158 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN3_USAGE UINT32_C(0x80)
17159 /* Enable or disable functionality of Pin #0. */
17160 uint8_t pin0_state;
17161 /* Disabled */
17162 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_STATE_DISABLED UINT32_C(0x0)
17163 /* Enabled */
17164 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_STATE_ENABLED UINT32_C(0x1)
17165 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_STATE_LAST HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_STATE_ENABLED
17166 /* Configure function for TSIO pin#0. */
17167 uint8_t pin0_usage;
17168 /* No function is configured. */
17169 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_NONE UINT32_C(0x0)
17170 /* PPS IN is configured. */
17171 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_PPS_IN UINT32_C(0x1)
17172 /* PPS OUT is configured. */
17173 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_PPS_OUT UINT32_C(0x2)
17174 /* SYNC IN is configured. */
17175 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_SYNC_IN UINT32_C(0x3)
17176 /* SYNC OUT is configured. */
17177 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_SYNC_OUT UINT32_C(0x4)
17178 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_LAST HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_SYNC_OUT
17179 /* Enable or disable functionality of Pin #1. */
17180 uint8_t pin1_state;
17181 /* Disabled */
17182 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_STATE_DISABLED UINT32_C(0x0)
17183 /* Enabled */
17184 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_STATE_ENABLED UINT32_C(0x1)
17185 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_STATE_LAST HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_STATE_ENABLED
17186 /* Configure function for TSIO pin#1. */
17187 uint8_t pin1_usage;
17188 /* No function is configured. */
17189 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_NONE UINT32_C(0x0)
17190 /* PPS IN is configured. */
17191 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_PPS_IN UINT32_C(0x1)
17192 /* PPS OUT is configured. */
17193 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_PPS_OUT UINT32_C(0x2)
17194 /* SYNC IN is configured. */
17195 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_SYNC_IN UINT32_C(0x3)
17196 /* SYNC OUT is configured. */
17197 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_SYNC_OUT UINT32_C(0x4)
17198 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_LAST HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_SYNC_OUT
17199 /* Enable or disable functionality of Pin #2. */
17200 uint8_t pin2_state;
17201 /* Disabled */
17202 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_STATE_DISABLED UINT32_C(0x0)
17203 /* Enabled */
17204 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_STATE_ENABLED UINT32_C(0x1)
17205 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_STATE_LAST HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_STATE_ENABLED
17206 /* Configure function for TSIO pin#2. */
17207 uint8_t pin2_usage;
17208 /* No function is configured. */
17209 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_NONE UINT32_C(0x0)
17210 /* PPS IN is configured. */
17211 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_PPS_IN UINT32_C(0x1)
17212 /* PPS OUT is configured. */
17213 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_PPS_OUT UINT32_C(0x2)
17214 /* SYNC IN is configured. */
17215 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_SYNC_IN UINT32_C(0x3)
17216 /* SYNC OUT is configured. */
17217 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_SYNC_OUT UINT32_C(0x4)
17218 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_LAST HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_SYNC_OUT
17219 /* Enable or disable functionality of Pin #3. */
17220 uint8_t pin3_state;
17221 /* Disabled */
17222 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_STATE_DISABLED UINT32_C(0x0)
17223 /* Enabled */
17224 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_STATE_ENABLED UINT32_C(0x1)
17225 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_STATE_LAST HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_STATE_ENABLED
17226 /* Configure function for TSIO pin#3. */
17227 uint8_t pin3_usage;
17228 /* No function is configured. */
17229 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_NONE UINT32_C(0x0)
17230 /* PPS IN is configured. */
17231 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_PPS_IN UINT32_C(0x1)
17232 /* PPS OUT is configured. */
17233 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_PPS_OUT UINT32_C(0x2)
17234 /* SYNC IN is configured. */
17235 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_SYNC_IN UINT32_C(0x3)
17236 /* SYNC OUT is configured. */
17237 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_SYNC_OUT UINT32_C(0x4)
17238 #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_LAST HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_SYNC_OUT
17239 uint8_t unused_0[4];
17240 } hwrm_func_ptp_pin_cfg_input_t, *phwrm_func_ptp_pin_cfg_input_t;
17241
17242 /* hwrm_func_ptp_pin_cfg_output (size:128b/16B) */
17243
17244 typedef struct hwrm_func_ptp_pin_cfg_output {
17245 /* The specific error status for the command. */
17246 uint16_t error_code;
17247 /* The HWRM command request type. */
17248 uint16_t req_type;
17249 /* The sequence ID from the original command. */
17250 uint16_t seq_id;
17251 /* The length of the response data in number of bytes. */
17252 uint16_t resp_len;
17253 uint8_t unused_0[7];
17254 /*
17255 * This field is used in Output records to indicate that the output
17256 * is completely written to RAM. This field should be read as '1'
17257 * to indicate that the output has been completely written.
17258 * When writing a command completion or response to an internal processor,
17259 * the order of writes has to be such that this field is written last.
17260 */
17261 uint8_t valid;
17262 } hwrm_func_ptp_pin_cfg_output_t, *phwrm_func_ptp_pin_cfg_output_t;
17263
17264 /*********************
17265 * hwrm_func_ptp_cfg *
17266 *********************/
17267
17268
17269 /* hwrm_func_ptp_cfg_input (size:320b/40B) */
17270
17271 typedef struct hwrm_func_ptp_cfg_input {
17272 /* The HWRM command request type. */
17273 uint16_t req_type;
17274 /*
17275 * The completion ring to send the completion event on. This should
17276 * be the NQ ID returned from the `nq_alloc` HWRM command.
17277 */
17278 uint16_t cmpl_ring;
17279 /*
17280 * The sequence ID is used by the driver for tracking multiple
17281 * commands. This ID is treated as opaque data by the firmware and
17282 * the value is returned in the `hwrm_resp_hdr` upon completion.
17283 */
17284 uint16_t seq_id;
17285 /*
17286 * The target ID of the command:
17287 * * 0x0-0xFFF8 - The function ID
17288 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17289 * * 0xFFFD - Reserved for user-space HWRM interface
17290 * * 0xFFFF - HWRM
17291 */
17292 uint16_t target_id;
17293 /*
17294 * A physical address pointer pointing to a host buffer that the
17295 * command's response data will be written. This can be either a host
17296 * physical address (HPA) or a guest physical address (GPA) and must
17297 * point to a physically contiguous block of memory.
17298 */
17299 uint64_t resp_addr;
17300 uint16_t enables;
17301 /*
17302 * This bit must be '1' for the ptp_pps_event field to be
17303 * configured.
17304 */
17305 #define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_PPS_EVENT UINT32_C(0x1)
17306 /*
17307 * This bit must be '1' for the ptp_freq_adj_dll_source field to be
17308 * configured.
17309 */
17310 #define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_DLL_SOURCE UINT32_C(0x2)
17311 /*
17312 * This bit must be '1' for the ptp_freq_adj_dll_phase field to be
17313 * configured.
17314 */
17315 #define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_DLL_PHASE UINT32_C(0x4)
17316 /*
17317 * This bit must be '1' for the ptp_freq_adj_ext_period field to be
17318 * configured.
17319 */
17320 #define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_EXT_PERIOD UINT32_C(0x8)
17321 /*
17322 * This bit must be '1' for the ptp_freq_adj_ext_up field to be
17323 * configured.
17324 */
17325 #define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_EXT_UP UINT32_C(0x10)
17326 /*
17327 * This bit must be '1' for the ptp_freq_adj_ext_phase field to be
17328 * configured.
17329 */
17330 #define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_EXT_PHASE UINT32_C(0x20)
17331 /* This field is used to enable interrupt for a specific PPS event. */
17332 uint8_t ptp_pps_event;
17333 /*
17334 * When this bit is set to '1', interrupt is enabled for internal
17335 * PPS event. Latches timestamp on PPS_OUT TSIO Pin. If user does
17336 * not configure PPS_OUT on a TSIO pin, then firmware will allocate
17337 * PPS_OUT to an unallocated pin.
17338 */
17339 #define HWRM_FUNC_PTP_CFG_INPUT_PTP_PPS_EVENT_INTERNAL UINT32_C(0x1)
17340 /*
17341 * When this bit is set to '1', interrupt is enabled for external
17342 * PPS event. Latches timestamp on PPS_IN TSIO pin.
17343 */
17344 #define HWRM_FUNC_PTP_CFG_INPUT_PTP_PPS_EVENT_EXTERNAL UINT32_C(0x2)
17345 /*
17346 * This field is used to set the source signal used to discipline
17347 * PHC (PTP Hardware Clock)
17348 */
17349 uint8_t ptp_freq_adj_dll_source;
17350 /* No source is selected. Use servo to discipline PHC */
17351 #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_NONE UINT32_C(0x0)
17352 /* TSIO Pin #0 is selected as source signal. */
17353 #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_TSIO_0 UINT32_C(0x1)
17354 /* TSIO Pin #1 is selected as source signal. */
17355 #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_TSIO_1 UINT32_C(0x2)
17356 /* TSIO Pin #2 is selected as source signal. */
17357 #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_TSIO_2 UINT32_C(0x3)
17358 /* TSIO Pin #3 is selected as source signal. */
17359 #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_TSIO_3 UINT32_C(0x4)
17360 /* Port #0 is selected as source signal. */
17361 #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_PORT_0 UINT32_C(0x5)
17362 /* Port #1 is selected as source signal. */
17363 #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_PORT_1 UINT32_C(0x6)
17364 /* Port #2 is selected as source signal. */
17365 #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_PORT_2 UINT32_C(0x7)
17366 /* Port #3 is selected as source signal. */
17367 #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_PORT_3 UINT32_C(0x8)
17368 /* Invalid signal. */
17369 #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_INVALID UINT32_C(0xff)
17370 #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_LAST HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_INVALID
17371 /*
17372 * This field is used to provide phase adjustment for DLL
17373 * used to discipline PHC (PTP Hardware clock)
17374 */
17375 uint8_t ptp_freq_adj_dll_phase;
17376 /* No Phase adjustment. */
17377 #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_PHASE_NONE UINT32_C(0x0)
17378 /* 4Khz sync in frequency. */
17379 #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_PHASE_4K UINT32_C(0x1)
17380 /* 8Khz sync in frequency. */
17381 #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_PHASE_8K UINT32_C(0x2)
17382 /* 10Mhz sync in frequency. */
17383 #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_PHASE_10M UINT32_C(0x3)
17384 #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_PHASE_LAST HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_PHASE_10M
17385 uint8_t unused_0[3];
17386 /*
17387 * Period in nanoseconds (ns) for external signal
17388 * input.
17389 */
17390 uint32_t ptp_freq_adj_ext_period;
17391 /*
17392 * Up time in nanoseconds (ns) of the duty cycle
17393 * of the external signal. This value should be
17394 * less than ptp_freq_adj_ext_period.
17395 */
17396 uint32_t ptp_freq_adj_ext_up;
17397 /*
17398 * Phase value is provided. Lower 16 bits of the
17399 * field are used for Phase input.
17400 */
17401 uint32_t ptp_freq_adj_ext_phase_lower;
17402 /*
17403 * Phase value is provided. This 32 bit field is used
17404 * with the 16 bit value from ptp_freq_adj_ext_phase_lower
17405 * to provide a 48 bit value input for Phase.
17406 */
17407 uint32_t ptp_freq_adj_ext_phase_upper;
17408 } hwrm_func_ptp_cfg_input_t, *phwrm_func_ptp_cfg_input_t;
17409
17410 /* hwrm_func_ptp_cfg_output (size:128b/16B) */
17411
17412 typedef struct hwrm_func_ptp_cfg_output {
17413 /* The specific error status for the command. */
17414 uint16_t error_code;
17415 /* The HWRM command request type. */
17416 uint16_t req_type;
17417 /* The sequence ID from the original command. */
17418 uint16_t seq_id;
17419 /* The length of the response data in number of bytes. */
17420 uint16_t resp_len;
17421 uint8_t unused_0[7];
17422 /*
17423 * This field is used in Output records to indicate that the output
17424 * is completely written to RAM. This field should be read as '1'
17425 * to indicate that the output has been completely written.
17426 * When writing a command completion or response to an internal processor,
17427 * the order of writes has to be such that this field is written last.
17428 */
17429 uint8_t valid;
17430 } hwrm_func_ptp_cfg_output_t, *phwrm_func_ptp_cfg_output_t;
17431
17432 /**************************
17433 * hwrm_func_ptp_ts_query *
17434 **************************/
17435
17436
17437 /* hwrm_func_ptp_ts_query_input (size:192b/24B) */
17438
17439 typedef struct hwrm_func_ptp_ts_query_input {
17440 /* The HWRM command request type. */
17441 uint16_t req_type;
17442 /*
17443 * The completion ring to send the completion event on. This should
17444 * be the NQ ID returned from the `nq_alloc` HWRM command.
17445 */
17446 uint16_t cmpl_ring;
17447 /*
17448 * The sequence ID is used by the driver for tracking multiple
17449 * commands. This ID is treated as opaque data by the firmware and
17450 * the value is returned in the `hwrm_resp_hdr` upon completion.
17451 */
17452 uint16_t seq_id;
17453 /*
17454 * The target ID of the command:
17455 * * 0x0-0xFFF8 - The function ID
17456 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17457 * * 0xFFFD - Reserved for user-space HWRM interface
17458 * * 0xFFFF - HWRM
17459 */
17460 uint16_t target_id;
17461 /*
17462 * A physical address pointer pointing to a host buffer that the
17463 * command's response data will be written. This can be either a host
17464 * physical address (HPA) or a guest physical address (GPA) and must
17465 * point to a physically contiguous block of memory.
17466 */
17467 uint64_t resp_addr;
17468 uint32_t flags;
17469 /* If set, the response includes PPS event timestamps */
17470 #define HWRM_FUNC_PTP_TS_QUERY_INPUT_FLAGS_PPS_TIME UINT32_C(0x1)
17471 /* If set, the response includes PTM timestamps */
17472 #define HWRM_FUNC_PTP_TS_QUERY_INPUT_FLAGS_PTM_TIME UINT32_C(0x2)
17473 uint8_t unused_0[4];
17474 } hwrm_func_ptp_ts_query_input_t, *phwrm_func_ptp_ts_query_input_t;
17475
17476 /* hwrm_func_ptp_ts_query_output (size:320b/40B) */
17477
17478 typedef struct hwrm_func_ptp_ts_query_output {
17479 /* The specific error status for the command. */
17480 uint16_t error_code;
17481 /* The HWRM command request type. */
17482 uint16_t req_type;
17483 /* The sequence ID from the original command. */
17484 uint16_t seq_id;
17485 /* The length of the response data in number of bytes. */
17486 uint16_t resp_len;
17487 /* Timestamp value of last PPS event latched. */
17488 uint64_t pps_event_ts;
17489 /* PTM local timestamp value. */
17490 uint64_t ptm_res_local_ts;
17491 /* PTM Master timestamp value. */
17492 uint64_t ptm_pmstr_ts;
17493 /* PTM Master propagation delay */
17494 uint32_t ptm_mstr_prop_dly;
17495 uint8_t unused_0[3];
17496 /*
17497 * This field is used in Output records to indicate that the output
17498 * is completely written to RAM. This field should be read as '1'
17499 * to indicate that the output has been completely written.
17500 * When writing a command completion or response to an internal processor,
17501 * the order of writes has to be such that this field is written last.
17502 */
17503 uint8_t valid;
17504 } hwrm_func_ptp_ts_query_output_t, *phwrm_func_ptp_ts_query_output_t;
17505
17506 /***********************
17507 * hwrm_func_vlan_qcfg *
17508 ***********************/
17509
17510
17511 /* hwrm_func_vlan_qcfg_input (size:192b/24B) */
17512
17513 typedef struct hwrm_func_vlan_qcfg_input {
17514 /* The HWRM command request type. */
17515 uint16_t req_type;
17516 /*
17517 * The completion ring to send the completion event on. This should
17518 * be the NQ ID returned from the `nq_alloc` HWRM command.
17519 */
17520 uint16_t cmpl_ring;
17521 /*
17522 * The sequence ID is used by the driver for tracking multiple
17523 * commands. This ID is treated as opaque data by the firmware and
17524 * the value is returned in the `hwrm_resp_hdr` upon completion.
17525 */
17526 uint16_t seq_id;
17527 /*
17528 * The target ID of the command:
17529 * * 0x0-0xFFF8 - The function ID
17530 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17531 * * 0xFFFD - Reserved for user-space HWRM interface
17532 * * 0xFFFF - HWRM
17533 */
17534 uint16_t target_id;
17535 /*
17536 * A physical address pointer pointing to a host buffer that the
17537 * command's response data will be written. This can be either a host
17538 * physical address (HPA) or a guest physical address (GPA) and must
17539 * point to a physically contiguous block of memory.
17540 */
17541 uint64_t resp_addr;
17542 /*
17543 * Function ID of the function that is being
17544 * configured.
17545 * If set to 0xFF... (All Fs), then the configuration is
17546 * for the requesting function.
17547 */
17548 uint16_t fid;
17549 uint8_t unused_0[6];
17550 } hwrm_func_vlan_qcfg_input_t, *phwrm_func_vlan_qcfg_input_t;
17551
17552 /* hwrm_func_vlan_qcfg_output (size:320b/40B) */
17553
17554 typedef struct hwrm_func_vlan_qcfg_output {
17555 /* The specific error status for the command. */
17556 uint16_t error_code;
17557 /* The HWRM command request type. */
17558 uint16_t req_type;
17559 /* The sequence ID from the original command. */
17560 uint16_t seq_id;
17561 /* The length of the response data in number of bytes. */
17562 uint16_t resp_len;
17563 uint64_t unused_0;
17564 /* S-TAG VLAN identifier configured for the function. */
17565 uint16_t stag_vid;
17566 /* S-TAG PCP value configured for the function. */
17567 uint8_t stag_pcp;
17568 uint8_t unused_1;
17569 /*
17570 * S-TAG TPID value configured for the function. This field is specified in
17571 * network byte order.
17572 */
17573 uint16_t stag_tpid;
17574 /* C-TAG VLAN identifier configured for the function. */
17575 uint16_t ctag_vid;
17576 /* C-TAG PCP value configured for the function. */
17577 uint8_t ctag_pcp;
17578 uint8_t unused_2;
17579 /*
17580 * C-TAG TPID value configured for the function. This field is specified in
17581 * network byte order.
17582 */
17583 uint16_t ctag_tpid;
17584 /* Future use. */
17585 uint32_t rsvd2;
17586 /* Future use. */
17587 uint32_t rsvd3;
17588 uint8_t unused_3[3];
17589 /*
17590 * This field is used in Output records to indicate that the output
17591 * is completely written to RAM. This field should be read as '1'
17592 * to indicate that the output has been completely written.
17593 * When writing a command completion or response to an internal processor,
17594 * the order of writes has to be such that this field is written last.
17595 */
17596 uint8_t valid;
17597 } hwrm_func_vlan_qcfg_output_t, *phwrm_func_vlan_qcfg_output_t;
17598
17599 /**********************
17600 * hwrm_func_vlan_cfg *
17601 **********************/
17602
17603
17604 /* hwrm_func_vlan_cfg_input (size:384b/48B) */
17605
17606 typedef struct hwrm_func_vlan_cfg_input {
17607 /* The HWRM command request type. */
17608 uint16_t req_type;
17609 /*
17610 * The completion ring to send the completion event on. This should
17611 * be the NQ ID returned from the `nq_alloc` HWRM command.
17612 */
17613 uint16_t cmpl_ring;
17614 /*
17615 * The sequence ID is used by the driver for tracking multiple
17616 * commands. This ID is treated as opaque data by the firmware and
17617 * the value is returned in the `hwrm_resp_hdr` upon completion.
17618 */
17619 uint16_t seq_id;
17620 /*
17621 * The target ID of the command:
17622 * * 0x0-0xFFF8 - The function ID
17623 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17624 * * 0xFFFD - Reserved for user-space HWRM interface
17625 * * 0xFFFF - HWRM
17626 */
17627 uint16_t target_id;
17628 /*
17629 * A physical address pointer pointing to a host buffer that the
17630 * command's response data will be written. This can be either a host
17631 * physical address (HPA) or a guest physical address (GPA) and must
17632 * point to a physically contiguous block of memory.
17633 */
17634 uint64_t resp_addr;
17635 /*
17636 * Function ID of the function that is being
17637 * configured.
17638 * If set to 0xFF... (All Fs), then the configuration is
17639 * for the requesting function.
17640 */
17641 uint16_t fid;
17642 uint8_t unused_0[2];
17643 uint32_t enables;
17644 /*
17645 * This bit must be '1' for the stag_vid field to be
17646 * configured.
17647 */
17648 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_VID UINT32_C(0x1)
17649 /*
17650 * This bit must be '1' for the ctag_vid field to be
17651 * configured.
17652 */
17653 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_VID UINT32_C(0x2)
17654 /*
17655 * This bit must be '1' for the stag_pcp field to be
17656 * configured.
17657 */
17658 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_PCP UINT32_C(0x4)
17659 /*
17660 * This bit must be '1' for the ctag_pcp field to be
17661 * configured.
17662 */
17663 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_PCP UINT32_C(0x8)
17664 /*
17665 * This bit must be '1' for the stag_tpid field to be
17666 * configured.
17667 */
17668 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_TPID UINT32_C(0x10)
17669 /*
17670 * This bit must be '1' for the ctag_tpid field to be
17671 * configured.
17672 */
17673 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_TPID UINT32_C(0x20)
17674 /* S-TAG VLAN identifier configured for the function. */
17675 uint16_t stag_vid;
17676 /* S-TAG PCP value configured for the function. */
17677 uint8_t stag_pcp;
17678 uint8_t unused_1;
17679 /*
17680 * S-TAG TPID value configured for the function. This field is specified in
17681 * network byte order.
17682 */
17683 uint16_t stag_tpid;
17684 /* C-TAG VLAN identifier configured for the function. */
17685 uint16_t ctag_vid;
17686 /* C-TAG PCP value configured for the function. */
17687 uint8_t ctag_pcp;
17688 uint8_t unused_2;
17689 /*
17690 * C-TAG TPID value configured for the function. This field is specified in
17691 * network byte order.
17692 */
17693 uint16_t ctag_tpid;
17694 /* Future use. */
17695 uint32_t rsvd1;
17696 /* Future use. */
17697 uint32_t rsvd2;
17698 uint8_t unused_3[4];
17699 } hwrm_func_vlan_cfg_input_t, *phwrm_func_vlan_cfg_input_t;
17700
17701 /* hwrm_func_vlan_cfg_output (size:128b/16B) */
17702
17703 typedef struct hwrm_func_vlan_cfg_output {
17704 /* The specific error status for the command. */
17705 uint16_t error_code;
17706 /* The HWRM command request type. */
17707 uint16_t req_type;
17708 /* The sequence ID from the original command. */
17709 uint16_t seq_id;
17710 /* The length of the response data in number of bytes. */
17711 uint16_t resp_len;
17712 uint8_t unused_0[7];
17713 /*
17714 * This field is used in Output records to indicate that the output
17715 * is completely written to RAM. This field should be read as '1'
17716 * to indicate that the output has been completely written.
17717 * When writing a command completion or response to an internal processor,
17718 * the order of writes has to be such that this field is written last.
17719 */
17720 uint8_t valid;
17721 } hwrm_func_vlan_cfg_output_t, *phwrm_func_vlan_cfg_output_t;
17722
17723 /*******************************
17724 * hwrm_func_vf_vnic_ids_query *
17725 *******************************/
17726
17727
17728 /* hwrm_func_vf_vnic_ids_query_input (size:256b/32B) */
17729
17730 typedef struct hwrm_func_vf_vnic_ids_query_input {
17731 /* The HWRM command request type. */
17732 uint16_t req_type;
17733 /*
17734 * The completion ring to send the completion event on. This should
17735 * be the NQ ID returned from the `nq_alloc` HWRM command.
17736 */
17737 uint16_t cmpl_ring;
17738 /*
17739 * The sequence ID is used by the driver for tracking multiple
17740 * commands. This ID is treated as opaque data by the firmware and
17741 * the value is returned in the `hwrm_resp_hdr` upon completion.
17742 */
17743 uint16_t seq_id;
17744 /*
17745 * The target ID of the command:
17746 * * 0x0-0xFFF8 - The function ID
17747 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17748 * * 0xFFFD - Reserved for user-space HWRM interface
17749 * * 0xFFFF - HWRM
17750 */
17751 uint16_t target_id;
17752 /*
17753 * A physical address pointer pointing to a host buffer that the
17754 * command's response data will be written. This can be either a host
17755 * physical address (HPA) or a guest physical address (GPA) and must
17756 * point to a physically contiguous block of memory.
17757 */
17758 uint64_t resp_addr;
17759 /*
17760 * This value is used to identify a Virtual Function (VF).
17761 * The scope of VF ID is local within a PF.
17762 */
17763 uint16_t vf_id;
17764 uint8_t unused_0[2];
17765 /* Max number of vnic ids in vnic id table */
17766 uint32_t max_vnic_id_cnt;
17767 /* This is the address for VF VNIC ID table */
17768 uint64_t vnic_id_tbl_addr;
17769 } hwrm_func_vf_vnic_ids_query_input_t, *phwrm_func_vf_vnic_ids_query_input_t;
17770
17771 /* hwrm_func_vf_vnic_ids_query_output (size:128b/16B) */
17772
17773 typedef struct hwrm_func_vf_vnic_ids_query_output {
17774 /* The specific error status for the command. */
17775 uint16_t error_code;
17776 /* The HWRM command request type. */
17777 uint16_t req_type;
17778 /* The sequence ID from the original command. */
17779 uint16_t seq_id;
17780 /* The length of the response data in number of bytes. */
17781 uint16_t resp_len;
17782 /*
17783 * Actual number of vnic ids
17784 *
17785 * Each VNIC ID is written as a 32-bit number.
17786 */
17787 uint32_t vnic_id_cnt;
17788 uint8_t unused_0[3];
17789 /*
17790 * This field is used in Output records to indicate that the output
17791 * is completely written to RAM. This field should be read as '1'
17792 * to indicate that the output has been completely written.
17793 * When writing a command completion or response to an internal processor,
17794 * the order of writes has to be such that this field is written last.
17795 */
17796 uint8_t valid;
17797 } hwrm_func_vf_vnic_ids_query_output_t, *phwrm_func_vf_vnic_ids_query_output_t;
17798
17799 /***********************
17800 * hwrm_func_vf_bw_cfg *
17801 ***********************/
17802
17803
17804 /* hwrm_func_vf_bw_cfg_input (size:960b/120B) */
17805
17806 typedef struct hwrm_func_vf_bw_cfg_input {
17807 /* The HWRM command request type. */
17808 uint16_t req_type;
17809 /*
17810 * The completion ring to send the completion event on. This should
17811 * be the NQ ID returned from the `nq_alloc` HWRM command.
17812 */
17813 uint16_t cmpl_ring;
17814 /*
17815 * The sequence ID is used by the driver for tracking multiple
17816 * commands. This ID is treated as opaque data by the firmware and
17817 * the value is returned in the `hwrm_resp_hdr` upon completion.
17818 */
17819 uint16_t seq_id;
17820 /*
17821 * The target ID of the command:
17822 * * 0x0-0xFFF8 - The function ID
17823 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17824 * * 0xFFFD - Reserved for user-space HWRM interface
17825 * * 0xFFFF - HWRM
17826 */
17827 uint16_t target_id;
17828 /*
17829 * A physical address pointer pointing to a host buffer that the
17830 * command's response data will be written. This can be either a host
17831 * physical address (HPA) or a guest physical address (GPA) and must
17832 * point to a physically contiguous block of memory.
17833 */
17834 uint64_t resp_addr;
17835 /*
17836 * The number of VF functions that are being configured.
17837 * The cmd space allows up to 50 VFs' BW to be configured with one cmd.
17838 */
17839 uint16_t num_vfs;
17840 uint16_t unused[3];
17841 /* These 16-bit fields contain the VF fid and the rate scale percentage. */
17842 uint16_t vfn[48];
17843 /* The physical VF id the adjustment will be made to. */
17844 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_VFID_MASK UINT32_C(0xfff)
17845 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_VFID_SFT 0
17846 /*
17847 * This field configures the rate scale percentage of the VF as specified
17848 * by the physical VF id.
17849 */
17850 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_MASK UINT32_C(0xf000)
17851 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_SFT 12
17852 /* 0% of the max tx rate */
17853 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_0 (UINT32_C(0x0) << 12)
17854 /* 6.66% of the max tx rate */
17855 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_6_66 (UINT32_C(0x1) << 12)
17856 /* 13.33% of the max tx rate */
17857 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_13_33 (UINT32_C(0x2) << 12)
17858 /* 20% of the max tx rate */
17859 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_20 (UINT32_C(0x3) << 12)
17860 /* 26.66% of the max tx rate */
17861 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_26_66 (UINT32_C(0x4) << 12)
17862 /* 33% of the max tx rate */
17863 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_33_33 (UINT32_C(0x5) << 12)
17864 /* 40% of the max tx rate */
17865 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_40 (UINT32_C(0x6) << 12)
17866 /* 46.66% of the max tx rate */
17867 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_46_66 (UINT32_C(0x7) << 12)
17868 /* 53.33% of the max tx rate */
17869 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_53_33 (UINT32_C(0x8) << 12)
17870 /* 60% of the max tx rate */
17871 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_60 (UINT32_C(0x9) << 12)
17872 /* 66.66% of the max tx rate */
17873 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_66_66 (UINT32_C(0xa) << 12)
17874 /* 53.33% of the max tx rate */
17875 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_73_33 (UINT32_C(0xb) << 12)
17876 /* 80% of the max tx rate */
17877 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_80 (UINT32_C(0xc) << 12)
17878 /* 86.66% of the max tx rate */
17879 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_86_66 (UINT32_C(0xd) << 12)
17880 /* 93.33% of the max tx rate */
17881 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_93_33 (UINT32_C(0xe) << 12)
17882 /* 100% of the max tx rate */
17883 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_100 (UINT32_C(0xf) << 12)
17884 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_LAST HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_100
17885 } hwrm_func_vf_bw_cfg_input_t, *phwrm_func_vf_bw_cfg_input_t;
17886
17887 /* hwrm_func_vf_bw_cfg_output (size:128b/16B) */
17888
17889 typedef struct hwrm_func_vf_bw_cfg_output {
17890 /* The specific error status for the command. */
17891 uint16_t error_code;
17892 /* The HWRM command request type. */
17893 uint16_t req_type;
17894 /* The sequence ID from the original command. */
17895 uint16_t seq_id;
17896 /* The length of the response data in number of bytes. */
17897 uint16_t resp_len;
17898 uint8_t unused_0[7];
17899 /*
17900 * This field is used in Output records to indicate that the output
17901 * is completely written to RAM. This field should be read as '1'
17902 * to indicate that the output has been completely written.
17903 * When writing a command completion or response to an internal processor,
17904 * the order of writes has to be such that this field is written last.
17905 */
17906 uint8_t valid;
17907 } hwrm_func_vf_bw_cfg_output_t, *phwrm_func_vf_bw_cfg_output_t;
17908
17909 /************************
17910 * hwrm_func_vf_bw_qcfg *
17911 ************************/
17912
17913
17914 /* hwrm_func_vf_bw_qcfg_input (size:960b/120B) */
17915
17916 typedef struct hwrm_func_vf_bw_qcfg_input {
17917 /* The HWRM command request type. */
17918 uint16_t req_type;
17919 /*
17920 * The completion ring to send the completion event on. This should
17921 * be the NQ ID returned from the `nq_alloc` HWRM command.
17922 */
17923 uint16_t cmpl_ring;
17924 /*
17925 * The sequence ID is used by the driver for tracking multiple
17926 * commands. This ID is treated as opaque data by the firmware and
17927 * the value is returned in the `hwrm_resp_hdr` upon completion.
17928 */
17929 uint16_t seq_id;
17930 /*
17931 * The target ID of the command:
17932 * * 0x0-0xFFF8 - The function ID
17933 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17934 * * 0xFFFD - Reserved for user-space HWRM interface
17935 * * 0xFFFF - HWRM
17936 */
17937 uint16_t target_id;
17938 /*
17939 * A physical address pointer pointing to a host buffer that the
17940 * command's response data will be written. This can be either a host
17941 * physical address (HPA) or a guest physical address (GPA) and must
17942 * point to a physically contiguous block of memory.
17943 */
17944 uint64_t resp_addr;
17945 /*
17946 * The number of VF functions that are being queried.
17947 * The inline response space allows the host to query up to 50 VFs'
17948 * rate scale percentage
17949 */
17950 uint16_t num_vfs;
17951 uint16_t unused[3];
17952 /* These 16-bit fields contain the VF fid */
17953 uint16_t vfn[48];
17954 /* The physical VF id of interest */
17955 #define HWRM_FUNC_VF_BW_QCFG_INPUT_VFN_VFID_MASK UINT32_C(0xfff)
17956 #define HWRM_FUNC_VF_BW_QCFG_INPUT_VFN_VFID_SFT 0
17957 } hwrm_func_vf_bw_qcfg_input_t, *phwrm_func_vf_bw_qcfg_input_t;
17958
17959 /* hwrm_func_vf_bw_qcfg_output (size:960b/120B) */
17960
17961 typedef struct hwrm_func_vf_bw_qcfg_output {
17962 /* The specific error status for the command. */
17963 uint16_t error_code;
17964 /* The HWRM command request type. */
17965 uint16_t req_type;
17966 /* The sequence ID from the original command. */
17967 uint16_t seq_id;
17968 /* The length of the response data in number of bytes. */
17969 uint16_t resp_len;
17970 /*
17971 * The number of VF functions that are being queried.
17972 * The inline response space allows the host to query up to 50 VFs' rate
17973 * scale percentage
17974 */
17975 uint16_t num_vfs;
17976 uint16_t unused[3];
17977 /* These 16-bit fields contain the VF fid and the rate scale percentage. */
17978 uint16_t vfn[48];
17979 /* The physical VF id the adjustment will be made to. */
17980 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_VFID_MASK UINT32_C(0xfff)
17981 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_VFID_SFT 0
17982 /*
17983 * This field configures the rate scale percentage of the VF as specified
17984 * by the physical VF id.
17985 */
17986 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_MASK UINT32_C(0xf000)
17987 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_SFT 12
17988 /* 0% of the max tx rate */
17989 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_0 (UINT32_C(0x0) << 12)
17990 /* 6.66% of the max tx rate */
17991 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_6_66 (UINT32_C(0x1) << 12)
17992 /* 13.33% of the max tx rate */
17993 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_13_33 (UINT32_C(0x2) << 12)
17994 /* 20% of the max tx rate */
17995 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_20 (UINT32_C(0x3) << 12)
17996 /* 26.66% of the max tx rate */
17997 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_26_66 (UINT32_C(0x4) << 12)
17998 /* 33% of the max tx rate */
17999 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_33_33 (UINT32_C(0x5) << 12)
18000 /* 40% of the max tx rate */
18001 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_40 (UINT32_C(0x6) << 12)
18002 /* 46.66% of the max tx rate */
18003 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_46_66 (UINT32_C(0x7) << 12)
18004 /* 53.33% of the max tx rate */
18005 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_53_33 (UINT32_C(0x8) << 12)
18006 /* 60% of the max tx rate */
18007 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_60 (UINT32_C(0x9) << 12)
18008 /* 66.66% of the max tx rate */
18009 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_66_66 (UINT32_C(0xa) << 12)
18010 /* 53.33% of the max tx rate */
18011 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_73_33 (UINT32_C(0xb) << 12)
18012 /* 80% of the max tx rate */
18013 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_80 (UINT32_C(0xc) << 12)
18014 /* 86.66% of the max tx rate */
18015 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_86_66 (UINT32_C(0xd) << 12)
18016 /* 93.33% of the max tx rate */
18017 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_93_33 (UINT32_C(0xe) << 12)
18018 /* 100% of the max tx rate */
18019 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_100 (UINT32_C(0xf) << 12)
18020 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_LAST HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_100
18021 uint8_t unused_0[7];
18022 /*
18023 * This field is used in Output records to indicate that the output
18024 * is completely written to RAM. This field should be read as '1'
18025 * to indicate that the output has been completely written.
18026 * When writing a command completion or response to an internal processor,
18027 * the order of writes has to be such that this field is written last.
18028 */
18029 uint8_t valid;
18030 } hwrm_func_vf_bw_qcfg_output_t, *phwrm_func_vf_bw_qcfg_output_t;
18031
18032 /***************************
18033 * hwrm_func_drv_if_change *
18034 ***************************/
18035
18036
18037 /* hwrm_func_drv_if_change_input (size:192b/24B) */
18038
18039 typedef struct hwrm_func_drv_if_change_input {
18040 /* The HWRM command request type. */
18041 uint16_t req_type;
18042 /*
18043 * The completion ring to send the completion event on. This should
18044 * be the NQ ID returned from the `nq_alloc` HWRM command.
18045 */
18046 uint16_t cmpl_ring;
18047 /*
18048 * The sequence ID is used by the driver for tracking multiple
18049 * commands. This ID is treated as opaque data by the firmware and
18050 * the value is returned in the `hwrm_resp_hdr` upon completion.
18051 */
18052 uint16_t seq_id;
18053 /*
18054 * The target ID of the command:
18055 * * 0x0-0xFFF8 - The function ID
18056 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18057 * * 0xFFFD - Reserved for user-space HWRM interface
18058 * * 0xFFFF - HWRM
18059 */
18060 uint16_t target_id;
18061 /*
18062 * A physical address pointer pointing to a host buffer that the
18063 * command's response data will be written. This can be either a host
18064 * physical address (HPA) or a guest physical address (GPA) and must
18065 * point to a physically contiguous block of memory.
18066 */
18067 uint64_t resp_addr;
18068 uint32_t flags;
18069 /*
18070 * When this bit is '1', the function driver is indicating
18071 * that the IF state is changing to UP state. The call should
18072 * be made at the beginning of the driver's open call before
18073 * resources are allocated. After making the call, the driver
18074 * should check the response to see if any resources may have
18075 * changed (see the response below). If the driver fails
18076 * the open call, the driver should make this call again with
18077 * this bit cleared to indicate that the IF state is not UP.
18078 * During the driver's close call when the IF state is changing
18079 * to DOWN, the driver should make this call with the bit cleared
18080 * after all resources have been freed.
18081 */
18082 #define HWRM_FUNC_DRV_IF_CHANGE_INPUT_FLAGS_UP UINT32_C(0x1)
18083 uint32_t unused;
18084 } hwrm_func_drv_if_change_input_t, *phwrm_func_drv_if_change_input_t;
18085
18086 /* hwrm_func_drv_if_change_output (size:128b/16B) */
18087
18088 typedef struct hwrm_func_drv_if_change_output {
18089 /* The specific error status for the command. */
18090 uint16_t error_code;
18091 /* The HWRM command request type. */
18092 uint16_t req_type;
18093 /* The sequence ID from the original command. */
18094 uint16_t seq_id;
18095 /* The length of the response data in number of bytes. */
18096 uint16_t resp_len;
18097 uint32_t flags;
18098 /*
18099 * When this bit is '1', it indicates that the resources reserved
18100 * for this function may have changed. The driver should check
18101 * resource capabilities and reserve resources again before
18102 * allocating resources.
18103 */
18104 #define HWRM_FUNC_DRV_IF_CHANGE_OUTPUT_FLAGS_RESC_CHANGE UINT32_C(0x1)
18105 /*
18106 * When this bit is '1', it indicates that the firmware got changed / reset.
18107 * The driver should do complete re-initialization when that bit is set.
18108 */
18109 #define HWRM_FUNC_DRV_IF_CHANGE_OUTPUT_FLAGS_HOT_FW_RESET_DONE UINT32_C(0x2)
18110 uint8_t unused_0[3];
18111 /*
18112 * This field is used in Output records to indicate that the output
18113 * is completely written to RAM. This field should be read as '1'
18114 * to indicate that the output has been completely written.
18115 * When writing a command completion or response to an internal processor,
18116 * the order of writes has to be such that this field is written last.
18117 */
18118 uint8_t valid;
18119 } hwrm_func_drv_if_change_output_t, *phwrm_func_drv_if_change_output_t;
18120
18121 /*******************************
18122 * hwrm_func_host_pf_ids_query *
18123 *******************************/
18124
18125
18126 /* hwrm_func_host_pf_ids_query_input (size:192b/24B) */
18127
18128 typedef struct hwrm_func_host_pf_ids_query_input {
18129 /* The HWRM command request type. */
18130 uint16_t req_type;
18131 /*
18132 * The completion ring to send the completion event on. This should
18133 * be the NQ ID returned from the `nq_alloc` HWRM command.
18134 */
18135 uint16_t cmpl_ring;
18136 /*
18137 * The sequence ID is used by the driver for tracking multiple
18138 * commands. This ID is treated as opaque data by the firmware and
18139 * the value is returned in the `hwrm_resp_hdr` upon completion.
18140 */
18141 uint16_t seq_id;
18142 /*
18143 * The target ID of the command:
18144 * * 0x0-0xFFF8 - The function ID
18145 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18146 * * 0xFFFD - Reserved for user-space HWRM interface
18147 * * 0xFFFF - HWRM
18148 */
18149 uint16_t target_id;
18150 /*
18151 * A physical address pointer pointing to a host buffer that the
18152 * command's response data will be written. This can be either a host
18153 * physical address (HPA) or a guest physical address (GPA) and must
18154 * point to a physically contiguous block of memory.
18155 */
18156 uint64_t resp_addr;
18157 uint8_t host;
18158 /*
18159 * # If this bit is set to '1', the query will contain PF(s)
18160 * belongs to SOC host.
18161 */
18162 #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_SOC UINT32_C(0x1)
18163 /*
18164 * # If this bit is set to '1', the query will contain PF(s)
18165 * belongs to EP0 host.
18166 */
18167 #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_0 UINT32_C(0x2)
18168 /*
18169 * # If this bit is set to '1', the query will contain PF(s)
18170 * belongs to EP1 host.
18171 */
18172 #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_1 UINT32_C(0x4)
18173 /*
18174 * # If this bit is set to '1', the query will contain PF(s)
18175 * belongs to EP2 host.
18176 */
18177 #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_2 UINT32_C(0x8)
18178 /*
18179 * # If this bit is set to '1', the query will contain PF(s)
18180 * belongs to EP3 host.
18181 */
18182 #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_3 UINT32_C(0x10)
18183 /*
18184 * This provides a filter of what PF(s) will be returned in the
18185 * query..
18186 */
18187 uint8_t filter;
18188 /*
18189 * all available PF(s) belong to the host(s) (defined in the
18190 * host field). This includes the hidden PFs.
18191 */
18192 #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ALL UINT32_C(0x0)
18193 /*
18194 * all available PF(s) belong to the host(s) (defined in the
18195 * host field) that is available for L2 traffic.
18196 */
18197 #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_L2 UINT32_C(0x1)
18198 /*
18199 * all available PF(s) belong to the host(s) (defined in the
18200 * host field) that is available for ROCE traffic.
18201 */
18202 #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ROCE UINT32_C(0x2)
18203 #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_LAST HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ROCE
18204 uint8_t unused_1[6];
18205 } hwrm_func_host_pf_ids_query_input_t, *phwrm_func_host_pf_ids_query_input_t;
18206
18207 /* hwrm_func_host_pf_ids_query_output (size:128b/16B) */
18208
18209 typedef struct hwrm_func_host_pf_ids_query_output {
18210 /* The specific error status for the command. */
18211 uint16_t error_code;
18212 /* The HWRM command request type. */
18213 uint16_t req_type;
18214 /* The sequence ID from the original command. */
18215 uint16_t seq_id;
18216 /* The length of the response data in number of bytes. */
18217 uint16_t resp_len;
18218 /* This provides the first PF ID of the device. */
18219 uint16_t first_pf_id;
18220 uint16_t pf_ordinal_mask;
18221 /*
18222 * When this bit is '1', it indicates first PF belongs to one of
18223 * the hosts defined in the input request.
18224 */
18225 #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_0 UINT32_C(0x1)
18226 /*
18227 * When this bit is '1', it indicates 2nd PF belongs to one of the
18228 * hosts defined in the input request.
18229 */
18230 #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_1 UINT32_C(0x2)
18231 /*
18232 * When this bit is '1', it indicates 3rd PF belongs to one of the
18233 * hosts defined in the input request.
18234 */
18235 #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_2 UINT32_C(0x4)
18236 /*
18237 * When this bit is '1', it indicates 4th PF belongs to one of the
18238 * hosts defined in the input request.
18239 */
18240 #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_3 UINT32_C(0x8)
18241 /*
18242 * When this bit is '1', it indicates 5th PF belongs to one of the
18243 * hosts defined in the input request.
18244 */
18245 #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_4 UINT32_C(0x10)
18246 /*
18247 * When this bit is '1', it indicates 6th PF belongs to one of the
18248 * hosts defined in the input request.
18249 */
18250 #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_5 UINT32_C(0x20)
18251 /*
18252 * When this bit is '1', it indicates 7th PF belongs to one of the
18253 * hosts defined in the input request.
18254 */
18255 #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_6 UINT32_C(0x40)
18256 /*
18257 * When this bit is '1', it indicates 8th PF belongs to one of the
18258 * hosts defined in the input request.
18259 */
18260 #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_7 UINT32_C(0x80)
18261 /*
18262 * When this bit is '1', it indicates 9th PF belongs to one of the
18263 * hosts defined in the input request.
18264 */
18265 #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_8 UINT32_C(0x100)
18266 /*
18267 * When this bit is '1', it indicates 10th PF belongs to one of the
18268 * hosts defined in the input request.
18269 */
18270 #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_9 UINT32_C(0x200)
18271 /*
18272 * When this bit is '1', it indicates 11th PF belongs to one of the
18273 * hosts defined in the input request.
18274 */
18275 #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_10 UINT32_C(0x400)
18276 /*
18277 * When this bit is '1', it indicates 12th PF belongs to one of the
18278 * hosts defined in the input request.
18279 */
18280 #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_11 UINT32_C(0x800)
18281 /*
18282 * When this bit is '1', it indicates 13th PF belongs to one of the
18283 * hosts defined in the input request.
18284 */
18285 #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_12 UINT32_C(0x1000)
18286 /*
18287 * When this bit is '1', it indicates 14th PF belongs to one of the
18288 * hosts defined in the input request.
18289 */
18290 #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_13 UINT32_C(0x2000)
18291 /*
18292 * When this bit is '1', it indicates 15th PF belongs to one of the
18293 * hosts defined in the input request.
18294 */
18295 #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_14 UINT32_C(0x4000)
18296 /*
18297 * When this bit is '1', it indicates 16th PF belongs to one of the
18298 * hosts defined in the input request.
18299 */
18300 #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_15 UINT32_C(0x8000)
18301 uint8_t unused_1[3];
18302 /*
18303 * This field is used in Output records to indicate that the output
18304 * is completely written to RAM. This field should be read as '1'
18305 * to indicate that the output has been completely written.
18306 * When writing a command completion or response to an internal processor,
18307 * the order of writes has to be such that this field is written last.
18308 */
18309 uint8_t valid;
18310 } hwrm_func_host_pf_ids_query_output_t, *phwrm_func_host_pf_ids_query_output_t;
18311
18312 /*********************
18313 * hwrm_func_spd_cfg *
18314 *********************/
18315
18316
18317 /* hwrm_func_spd_cfg_input (size:384b/48B) */
18318
18319 typedef struct hwrm_func_spd_cfg_input {
18320 /* The HWRM command request type. */
18321 uint16_t req_type;
18322 /*
18323 * The completion ring to send the completion event on. This should
18324 * be the NQ ID returned from the `nq_alloc` HWRM command.
18325 */
18326 uint16_t cmpl_ring;
18327 /*
18328 * The sequence ID is used by the driver for tracking multiple
18329 * commands. This ID is treated as opaque data by the firmware and
18330 * the value is returned in the `hwrm_resp_hdr` upon completion.
18331 */
18332 uint16_t seq_id;
18333 /*
18334 * The target ID of the command:
18335 * * 0x0-0xFFF8 - The function ID
18336 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18337 * * 0xFFFD - Reserved for user-space HWRM interface
18338 * * 0xFFFF - HWRM
18339 */
18340 uint16_t target_id;
18341 /*
18342 * A physical address pointer pointing to a host buffer that the
18343 * command's response data will be written. This can be either a host
18344 * physical address (HPA) or a guest physical address (GPA) and must
18345 * point to a physically contiguous block of memory.
18346 */
18347 uint64_t resp_addr;
18348 uint32_t flags;
18349 /* Set this bit is '1' to enable the SPD datapath forwarding. */
18350 #define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_FWD_ENABLE UINT32_C(0x1)
18351 /* Set this bit is '1' to disable the SPD datapath forwarding. */
18352 #define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_FWD_DISABLE UINT32_C(0x2)
18353 /*
18354 * Set this bit is '1' to enable the SPD datapath checksum
18355 * feature.
18356 */
18357 #define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_CSUM_ENABLE UINT32_C(0x4)
18358 /*
18359 * Set this bit is '1' to disable the SPD datapath checksum
18360 * feature.
18361 */
18362 #define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_CSUM_DISABLE UINT32_C(0x8)
18363 /*
18364 * Set this bit is '1' to enable the SPD datapath debug
18365 * feature.
18366 */
18367 #define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_DBG_ENABLE UINT32_C(0x10)
18368 /*
18369 * Set this bit is '1' to disable the SPD datapath debug
18370 * feature.
18371 */
18372 #define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_DBG_DISABLE UINT32_C(0x20)
18373 uint32_t enables;
18374 /*
18375 * This bit must be '1' for the ethertype field to be
18376 * configured.
18377 */
18378 #define HWRM_FUNC_SPD_CFG_INPUT_ENABLES_ETHERTYPE UINT32_C(0x1)
18379 /*
18380 * This bit must be '1' for the hash_mode_flags field to be
18381 * configured.
18382 */
18383 #define HWRM_FUNC_SPD_CFG_INPUT_ENABLES_HASH_MODE_FLAGS UINT32_C(0x2)
18384 /*
18385 * This bit must be '1' for the hash_type field to be
18386 * configured.
18387 */
18388 #define HWRM_FUNC_SPD_CFG_INPUT_ENABLES_HASH_TYPE UINT32_C(0x4)
18389 /*
18390 * This bit must be '1' for the ring_tbl_addr field to be
18391 * configured.
18392 */
18393 #define HWRM_FUNC_SPD_CFG_INPUT_ENABLES_RING_TBL_ADDR UINT32_C(0x8)
18394 /*
18395 * This bit must be '1' for the hash_key_tbl_addr field to be
18396 * configured.
18397 */
18398 #define HWRM_FUNC_SPD_CFG_INPUT_ENABLES_HASH_KEY_TBL_ADDR UINT32_C(0x10)
18399 /*
18400 * Ethertype value used in the encapsulated SPD packet header.
18401 * The user must chooose a value that is not conflicting with
18402 * publicly defined ethertype values. By default, the ethertype
18403 * value of 0xffff is used if there is no user specified value.
18404 */
18405 uint16_t ethertype;
18406 /* Flags to specify different RSS hash modes. */
18407 uint8_t hash_mode_flags;
18408 /*
18409 * When this bit is '1', it indicates using current RSS
18410 * hash mode setting configured in the device.
18411 */
18412 #define HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_DEFAULT UINT32_C(0x1)
18413 /*
18414 * When this bit is '1', it indicates requesting support of
18415 * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
18416 * l4.src, l4.dest} for tunnel packets. For none-tunnel
18417 * packets, the RSS hash is computed over the normal
18418 * src/dest l3 and src/dest l4 headers.
18419 */
18420 #define HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_4 UINT32_C(0x2)
18421 /*
18422 * When this bit is '1', it indicates requesting support of
18423 * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
18424 * tunnel packets. For none-tunnel packets, the RSS hash is
18425 * computed over the normal src/dest l3 headers.
18426 */
18427 #define HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_2 UINT32_C(0x4)
18428 /*
18429 * When this bit is '1', it indicates requesting support of
18430 * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
18431 * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
18432 * packets, the RSS hash is computed over the normal
18433 * src/dest l3 and src/dest l4 headers.
18434 */
18435 #define HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_4 UINT32_C(0x8)
18436 /*
18437 * When this bit is '1', it indicates requesting support of
18438 * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
18439 * tunnel packets. For none-tunnel packets, the RSS hash is
18440 * computed over the normal src/dest l3 headers.
18441 */
18442 #define HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_2 UINT32_C(0x10)
18443 uint8_t unused_1;
18444 uint32_t hash_type;
18445 /*
18446 * When this bit is '1', the RSS hash shall be computed
18447 * over source and destination IPv4 addresses of IPv4
18448 * packets.
18449 */
18450 #define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_IPV4 UINT32_C(0x1)
18451 /*
18452 * When this bit is '1', the RSS hash shall be computed
18453 * over source/destination IPv4 addresses and
18454 * source/destination ports of TCP/IPv4 packets.
18455 */
18456 #define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_TCP_IPV4 UINT32_C(0x2)
18457 /*
18458 * When this bit is '1', the RSS hash shall be computed
18459 * over source/destination IPv4 addresses and
18460 * source/destination ports of UDP/IPv4 packets.
18461 */
18462 #define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_UDP_IPV4 UINT32_C(0x4)
18463 /*
18464 * When this bit is '1', the RSS hash shall be computed
18465 * over source and destination IPv4 addresses of IPv6
18466 * packets.
18467 */
18468 #define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_IPV6 UINT32_C(0x8)
18469 /*
18470 * When this bit is '1', the RSS hash shall be computed
18471 * over source/destination IPv6 addresses and
18472 * source/destination ports of TCP/IPv6 packets.
18473 */
18474 #define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_TCP_IPV6 UINT32_C(0x10)
18475 /*
18476 * When this bit is '1', the RSS hash shall be computed
18477 * over source/destination IPv6 addresses and
18478 * source/destination ports of UDP/IPv6 packets.
18479 */
18480 #define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_UDP_IPV6 UINT32_C(0x20)
18481 /* This is the address for rss ring group table */
18482 uint64_t ring_grp_tbl_addr;
18483 /* This is the address for rss hash key table */
18484 uint64_t hash_key_tbl_addr;
18485 } hwrm_func_spd_cfg_input_t, *phwrm_func_spd_cfg_input_t;
18486
18487 /* hwrm_func_spd_cfg_output (size:128b/16B) */
18488
18489 typedef struct hwrm_func_spd_cfg_output {
18490 /* The specific error status for the command. */
18491 uint16_t error_code;
18492 /* The HWRM command request type. */
18493 uint16_t req_type;
18494 /* The sequence ID from the original command. */
18495 uint16_t seq_id;
18496 /* The length of the response data in number of bytes. */
18497 uint16_t resp_len;
18498 uint8_t unused_0[7];
18499 /*
18500 * This field is used in Output records to indicate that the output
18501 * is completely written to RAM. This field should be read as '1'
18502 * to indicate that the output has been completely written.
18503 * When writing a command completion or response to an internal processor,
18504 * the order of writes has to be such that this field is written last.
18505 */
18506 uint8_t valid;
18507 } hwrm_func_spd_cfg_output_t, *phwrm_func_spd_cfg_output_t;
18508
18509 /**********************
18510 * hwrm_func_spd_qcfg *
18511 **********************/
18512
18513
18514 /* hwrm_func_spd_qcfg_input (size:128b/16B) */
18515
18516 typedef struct hwrm_func_spd_qcfg_input {
18517 /* The HWRM command request type. */
18518 uint16_t req_type;
18519 /*
18520 * The completion ring to send the completion event on. This should
18521 * be the NQ ID returned from the `nq_alloc` HWRM command.
18522 */
18523 uint16_t cmpl_ring;
18524 /*
18525 * The sequence ID is used by the driver for tracking multiple
18526 * commands. This ID is treated as opaque data by the firmware and
18527 * the value is returned in the `hwrm_resp_hdr` upon completion.
18528 */
18529 uint16_t seq_id;
18530 /*
18531 * The target ID of the command:
18532 * * 0x0-0xFFF8 - The function ID
18533 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18534 * * 0xFFFD - Reserved for user-space HWRM interface
18535 * * 0xFFFF - HWRM
18536 */
18537 uint16_t target_id;
18538 /*
18539 * A physical address pointer pointing to a host buffer that the
18540 * command's response data will be written. This can be either a host
18541 * physical address (HPA) or a guest physical address (GPA) and must
18542 * point to a physically contiguous block of memory.
18543 */
18544 uint64_t resp_addr;
18545 } hwrm_func_spd_qcfg_input_t, *phwrm_func_spd_qcfg_input_t;
18546
18547 /* hwrm_func_spd_qcfg_output (size:512b/64B) */
18548
18549 typedef struct hwrm_func_spd_qcfg_output {
18550 /* The specific error status for the command. */
18551 uint16_t error_code;
18552 /* The HWRM command request type. */
18553 uint16_t req_type;
18554 /* The sequence ID from the original command. */
18555 uint16_t seq_id;
18556 /* The length of the response data in number of bytes. */
18557 uint16_t resp_len;
18558 uint32_t flags;
18559 /*
18560 * The SPD datapath forwarding is currently enabled when this
18561 * flag is set to '1'.
18562 */
18563 #define HWRM_FUNC_SPD_QCFG_OUTPUT_FLAGS_FWD_ENABLED UINT32_C(0x1)
18564 /*
18565 * The SPD datapath checksum feature is currently enabled when
18566 * this flag is set to '1'.
18567 */
18568 #define HWRM_FUNC_SPD_QCFG_OUTPUT_FLAGS_CSUM_ENABLED UINT32_C(0x2)
18569 /*
18570 * The SPD datapath debug feature is currently enabled when
18571 * this flag is set to '1'.
18572 */
18573 #define HWRM_FUNC_SPD_QCFG_OUTPUT_FLAGS_DBG_ENABLED UINT32_C(0x4)
18574 uint32_t hash_type;
18575 /*
18576 * When this bit is '1', the RSS hash shall be computed
18577 * over source and destination IPv4 addresses of IPv4
18578 * packets.
18579 */
18580 #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_IPV4 UINT32_C(0x1)
18581 /*
18582 * When this bit is '1', the RSS hash shall be computed
18583 * over source/destination IPv4 addresses and
18584 * source/destination ports of TCP/IPv4 packets.
18585 */
18586 #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_TCP_IPV4 UINT32_C(0x2)
18587 /*
18588 * When this bit is '1', the RSS hash shall be computed
18589 * over source/destination IPv4 addresses and
18590 * source/destination ports of UDP/IPv4 packets.
18591 */
18592 #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_UDP_IPV4 UINT32_C(0x4)
18593 /*
18594 * When this bit is '1', the RSS hash shall be computed
18595 * over source and destination IPv4 addresses of IPv6
18596 * packets.
18597 */
18598 #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_IPV6 UINT32_C(0x8)
18599 /*
18600 * When this bit is '1', the RSS hash shall be computed
18601 * over source/destination IPv6 addresses and
18602 * source/destination ports of TCP/IPv6 packets.
18603 */
18604 #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_TCP_IPV6 UINT32_C(0x10)
18605 /*
18606 * When this bit is '1', the RSS hash shall be computed
18607 * over source/destination IPv6 addresses and
18608 * source/destination ports of UDP/IPv6 packets.
18609 */
18610 #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_UDP_IPV6 UINT32_C(0x20)
18611 /* This is the value of rss hash key */
18612 uint32_t hash_key[10];
18613 /* Flags to specify different RSS hash modes. */
18614 uint8_t hash_mode_flags;
18615 /*
18616 * When this bit is '1', it indicates using current RSS
18617 * hash mode setting configured in the device.
18618 */
18619 #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_MODE_FLAGS_DEFAULT UINT32_C(0x1)
18620 /*
18621 * When this bit is '1', it indicates requesting support of
18622 * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
18623 * l4.src, l4.dest} for tunnel packets. For none-tunnel
18624 * packets, the RSS hash is computed over the normal
18625 * src/dest l3 and src/dest l4 headers.
18626 */
18627 #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_4 UINT32_C(0x2)
18628 /*
18629 * When this bit is '1', it indicates requesting support of
18630 * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
18631 * tunnel packets. For none-tunnel packets, the RSS hash is
18632 * computed over the normal src/dest l3 headers.
18633 */
18634 #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_2 UINT32_C(0x4)
18635 /*
18636 * When this bit is '1', it indicates requesting support of
18637 * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
18638 * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
18639 * packets, the RSS hash is computed over the normal
18640 * src/dest l3 and src/dest l4 headers.
18641 */
18642 #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_4 UINT32_C(0x8)
18643 /*
18644 * When this bit is '1', it indicates requesting support of
18645 * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
18646 * tunnel packets. For none-tunnel packets, the RSS hash is
18647 * computed over the normal src/dest l3 headers.
18648 */
18649 #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_2 UINT32_C(0x10)
18650 uint8_t unused_1;
18651 /*
18652 * Ethertype value used in the encapsulated SPD packet header.
18653 * The user must chooose a value that is not conflicting with
18654 * publicly defined ethertype values. By default, the ethertype
18655 * value of 0xffff is used if there is no user specified value.
18656 */
18657 uint16_t ethertype;
18658 uint8_t unused_2[3];
18659 /*
18660 * This field is used in Output records to indicate that the output
18661 * is completely written to RAM. This field should be read as '1'
18662 * to indicate that the output has been completely written.
18663 * When writing a command completion or response to an internal processor,
18664 * the order of writes has to be such that this field is written last.
18665 */
18666 uint8_t valid;
18667 } hwrm_func_spd_qcfg_output_t, *phwrm_func_spd_qcfg_output_t;
18668
18669 /*********************
18670 * hwrm_port_phy_cfg *
18671 *********************/
18672
18673
18674 /* hwrm_port_phy_cfg_input (size:448b/56B) */
18675
18676 typedef struct hwrm_port_phy_cfg_input {
18677 /* The HWRM command request type. */
18678 uint16_t req_type;
18679 /*
18680 * The completion ring to send the completion event on. This should
18681 * be the NQ ID returned from the `nq_alloc` HWRM command.
18682 */
18683 uint16_t cmpl_ring;
18684 /*
18685 * The sequence ID is used by the driver for tracking multiple
18686 * commands. This ID is treated as opaque data by the firmware and
18687 * the value is returned in the `hwrm_resp_hdr` upon completion.
18688 */
18689 uint16_t seq_id;
18690 /*
18691 * The target ID of the command:
18692 * * 0x0-0xFFF8 - The function ID
18693 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18694 * * 0xFFFD - Reserved for user-space HWRM interface
18695 * * 0xFFFF - HWRM
18696 */
18697 uint16_t target_id;
18698 /*
18699 * A physical address pointer pointing to a host buffer that the
18700 * command's response data will be written. This can be either a host
18701 * physical address (HPA) or a guest physical address (GPA) and must
18702 * point to a physically contiguous block of memory.
18703 */
18704 uint64_t resp_addr;
18705 uint32_t flags;
18706 /*
18707 * When this bit is set to '1', the PHY for the port shall
18708 * be reset.
18709 *
18710 * # If this bit is set to 1, then the HWRM shall reset the
18711 * PHY after applying PHY configuration changes specified
18712 * in this command.
18713 * # In order to guarantee that PHY configuration changes
18714 * specified in this command take effect, the HWRM
18715 * client should set this flag to 1.
18716 * # If this bit is not set to 1, then the HWRM may reset
18717 * the PHY depending on the current PHY configuration and
18718 * settings specified in this command.
18719 */
18720 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY UINT32_C(0x1)
18721 /* deprecated bit. Do not use!!! */
18722 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_DEPRECATED UINT32_C(0x2)
18723 /*
18724 * When this bit is set to '1', and the force_pam4_link_speed
18725 * bit in the 'enables' field is '', the link shall be forced
18726 * to the force_link_speed value.
18727 *
18728 * When this bit is set to '1', and the force_pam4_link_speed
18729 * bit in the 'enables' field is '1', the link shall be forced
18730 * to the force_pam4_link_speed value.
18731 *
18732 * When this bit is set to '1', the HWRM client should
18733 * not enable any of the auto negotiation related
18734 * fields represented by auto_XXX fields in this command.
18735 * When this bit is set to '1' and the HWRM client has
18736 * enabled a auto_XXX field in this command, then the
18737 * HWRM shall ignore the enabled auto_XXX field.
18738 *
18739 * When this bit is set to zero, the link
18740 * shall be allowed to autoneg.
18741 */
18742 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE UINT32_C(0x4)
18743 /*
18744 * When this bit is set to '1', the auto-negotiation process
18745 * shall be restarted on the link.
18746 */
18747 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG UINT32_C(0x8)
18748 /*
18749 * When this bit is set to '1', Energy Efficient Ethernet
18750 * (EEE) is requested to be enabled on this link.
18751 * If EEE is not supported on this port, then this flag
18752 * shall be ignored by the HWRM.
18753 */
18754 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_ENABLE UINT32_C(0x10)
18755 /*
18756 * When this bit is set to '1', Energy Efficient Ethernet
18757 * (EEE) is requested to be disabled on this link.
18758 * If EEE is not supported on this port, then this flag
18759 * shall be ignored by the HWRM.
18760 */
18761 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_DISABLE UINT32_C(0x20)
18762 /*
18763 * When this bit is set to '1' and EEE is enabled on this
18764 * link, then TX LPI is requested to be enabled on the link.
18765 * If EEE is not supported on this port, then this flag
18766 * shall be ignored by the HWRM.
18767 * If EEE is disabled on this port, then this flag shall be
18768 * ignored by the HWRM.
18769 */
18770 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_ENABLE UINT32_C(0x40)
18771 /*
18772 * When this bit is set to '1' and EEE is enabled on this
18773 * link, then TX LPI is requested to be disabled on the link.
18774 * If EEE is not supported on this port, then this flag
18775 * shall be ignored by the HWRM.
18776 * If EEE is disabled on this port, then this flag shall be
18777 * ignored by the HWRM.
18778 */
18779 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_DISABLE UINT32_C(0x80)
18780 /*
18781 * When set to 1, then the HWRM shall enable FEC autonegotitation
18782 * on this port if supported. When enabled, at least one of the
18783 * FEC modes must be advertised by enabling the fec_clause_74_enable,
18784 * fec_clause_91_enable, fec_rs544_1xn_enable, fec_rs544_ieee_enable,
18785 * fec_rs272_1xn_enable, or fec_rs272_ieee_enable flag. If none
18786 * of the FEC mode is currently enabled, the HWRM shall choose
18787 * a default advertisement setting.
18788 * The default advertisement setting can be queried by calling
18789 * hwrm_port_phy_qcfg. Note that the link speed must be
18790 * in autonegotiation mode for FEC autonegotiation to take effect.
18791 * When set to 0, then this flag shall be ignored.
18792 * If FEC autonegotiation is not supported, then the HWRM shall ignore this
18793 * flag.
18794 */
18795 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_ENABLE UINT32_C(0x100)
18796 /*
18797 * When set to 1, then the HWRM shall disable FEC autonegotiation
18798 * on this port and use forced FEC mode. In forced FEC mode, one
18799 * or more FEC forced settings under the same clause can be set.
18800 * When set to 0, then this flag shall be ignored.
18801 * If FEC autonegotiation is not supported, then the HWRM shall ignore this
18802 * flag.
18803 */
18804 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_DISABLE UINT32_C(0x200)
18805 /*
18806 * When set to 1, then the HWRM shall enable FEC CLAUSE 74 (Fire Code)
18807 * on this port if supported, by advertising FEC CLAUSE 74 if
18808 * FEC autonegotiation is enabled or force enabled otherwise.
18809 * When set to 0, then this flag shall be ignored.
18810 * If FEC CLAUSE 74 is not supported, then the HWRM shall ignore this
18811 * flag.
18812 */
18813 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_ENABLE UINT32_C(0x400)
18814 /*
18815 * When set to 1, then the HWRM shall disable FEC CLAUSE 74 (Fire Code)
18816 * on this port if supported, by not advertising FEC CLAUSE 74 if
18817 * FEC autonegotiation is enabled or force disabled otherwise.
18818 * When set to 0, then this flag shall be ignored.
18819 * If FEC CLAUSE 74 is not supported, then the HWRM shall ignore this
18820 * flag.
18821 */
18822 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_DISABLE UINT32_C(0x800)
18823 /*
18824 * When set to 1, then the HWRM shall enable FEC CLAUSE 91
18825 * (Reed Solomon RS(528,514) for NRZ) on this port if supported,
18826 * by advertising FEC RS(528,514) if FEC autonegotiation is enabled
18827 * or force enabled otherwise. In forced FEC mode, this flag
18828 * will only take effect if the speed is NRZ. Additional
18829 * RS544 or RS272 flags (also under clause 91) may be set for PAM4
18830 * in forced FEC mode.
18831 * When set to 0, then this flag shall be ignored.
18832 * If FEC RS(528,514) is not supported, then the HWRM shall ignore
18833 * this flag.
18834 */
18835 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_ENABLE UINT32_C(0x1000)
18836 /*
18837 * When set to 1, then the HWRM shall disable FEC CLAUSE 91
18838 * (Reed Solomon RS(528,514) for NRZ) on this port if supported, by
18839 * not advertising RS(528,514) if FEC autonegotiation is enabled or
18840 * force disabled otherwise. When set to 0, then this flag shall be
18841 * ignored. If FEC RS(528,514) is not supported, then the HWRM
18842 * shall ignore this flag.
18843 */
18844 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_DISABLE UINT32_C(0x2000)
18845 /*
18846 * When this bit is set to '1', the link shall be forced to
18847 * be taken down.
18848 *
18849 * # When this bit is set to '1", all other
18850 * command input settings related to the link speed shall
18851 * be ignored.
18852 * Once the link state is forced down, it can be
18853 * explicitly cleared from that state by setting this flag
18854 * to ''.
18855 * # If this flag is set to '', then the link shall be
18856 * cleared from forced down state if the link is in forced
18857 * down state.
18858 * There may be conditions (e.g. out-of-band or sideband
18859 * configuration changes for the link) outside the scope
18860 * of the HWRM implementation that may clear forced down
18861 * link state.
18862 */
18863 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE_LINK_DWN UINT32_C(0x4000)
18864 /*
18865 * When set to 1, then the HWRM shall enable FEC RS544_1XN
18866 * on this port if supported, by advertising FEC RS544_1XN if
18867 * FEC autonegotiation is enabled or force enabled otherwise.
18868 * In forced mode, this flag will only take effect if the speed is
18869 * PAM4. If this flag and fec_rs544_ieee_enable are set, the
18870 * HWRM shall choose one of the RS544 modes.
18871 * When set to 0, then this flag shall be ignored.
18872 * If FEC RS544_1XN is not supported, then the HWRM shall ignore this
18873 * flag.
18874 */
18875 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS544_1XN_ENABLE UINT32_C(0x8000)
18876 /*
18877 * When set to 1, then the HWRM shall disable FEC RS544_1XN
18878 * on this port if supported, by not advertising FEC RS544_1XN if
18879 * FEC autonegotiation is enabled or force disabled otherwise.
18880 * When set to 0, then this flag shall be ignored.
18881 * If FEC RS544_1XN is not supported, then the HWRM shall ignore this
18882 * flag.
18883 */
18884 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS544_1XN_DISABLE UINT32_C(0x10000)
18885 /*
18886 * When set to 1, then the HWRM shall enable FEC RS(544,514)
18887 * on this port if supported, by advertising FEC RS(544,514) if
18888 * FEC autonegotiation is enabled or force enabled otherwise.
18889 * In forced mode, this flag will only take effect if the speed is
18890 * PAM4. If this flag and fec_rs544_1xn_enable are set, the
18891 * HWRM shall choose one of the RS544 modes.
18892 * When set to 0, then this flag shall be ignored.
18893 * If FEC RS(544,514) is not supported, then the HWRM shall ignore
18894 * this flag.
18895 */
18896 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS544_IEEE_ENABLE UINT32_C(0x20000)
18897 /*
18898 * When set to 1, then the HWRM shall disable FEC RS(544,514)
18899 * on this port if supported, by not advertising FEC RS(544,514) if
18900 * FEC autonegotiation is enabled or force disabled otherwise.
18901 * When set to 0, then this flag shall be ignored.
18902 * If FEC RS(544,514) is not supported, then the HWRM shall ignore
18903 * this flag.
18904 */
18905 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS544_IEEE_DISABLE UINT32_C(0x40000)
18906 /*
18907 * When set to 1, then the HWRM shall enable FEC RS272_1XN
18908 * on this port if supported, by advertising FEC RS272_1XN if
18909 * FEC autonegotiation is enabled or force enabled otherwise.
18910 * In forced mode, this flag will only take effect if the speed is
18911 * PAM4. If this flag and fec_rs272_ieee_enable are set, the
18912 * HWRM shall choose one of the RS272 modes. Note that RS272
18913 * and RS544 modes cannot be set at the same time in forced FEC mode.
18914 * When set to 0, then this flag shall be ignored.
18915 * If FEC RS272_1XN is not supported, then the HWRM shall ignore this
18916 * flag.
18917 */
18918 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS272_1XN_ENABLE UINT32_C(0x80000)
18919 /*
18920 * When set to 1, then the HWRM shall disable FEC RS272_1XN
18921 * on this port if supported, by not advertising FEC RS272_1XN if
18922 * FEC autonegotiation is enabled or force disabled otherwise.
18923 * When set to 0, then this flag shall be ignored.
18924 * If FEC RS272_1XN is not supported, then the HWRM shall ignore
18925 * this flag.
18926 */
18927 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS272_1XN_DISABLE UINT32_C(0x100000)
18928 /*
18929 * When set to 1, then the HWRM shall enable FEC RS(272,257)
18930 * on this port if supported, by advertising FEC RS(272,257) if
18931 * FEC autonegotiation is enabled or force enabled otherwise.
18932 * In forced mode, this flag will only take effect if the speed is
18933 * PAM4. If this flag and fec_rs272_1xn_enable are set, the
18934 * HWRM shall choose one of the RS272 modes. Note that RS272
18935 * and RS544 modes cannot be set at the same time in forced FEC mode.
18936 * When set to 0, then this flag shall be ignored.
18937 * If FEC RS(272,257) is not supported, then the HWRM shall ignore
18938 * this flag.
18939 */
18940 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS272_IEEE_ENABLE UINT32_C(0x200000)
18941 /*
18942 * When set to 1, then the HWRM shall disable FEC RS(272,257)
18943 * on this port if supported, by not advertising FEC RS(272,257) if
18944 * FEC autonegotiation is enabled or force disabled otherwise.
18945 * When set to 0, then this flag shall be ignored.
18946 * If FEC RS(272,257) is not supported, then the HWRM shall ignore
18947 * this flag.
18948 */
18949 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS272_IEEE_DISABLE UINT32_C(0x400000)
18950 uint32_t enables;
18951 /*
18952 * This bit must be '1' for the auto_mode field to be
18953 * configured.
18954 */
18955 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE UINT32_C(0x1)
18956 /*
18957 * This bit must be '1' for the auto_duplex field to be
18958 * configured.
18959 */
18960 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_DUPLEX UINT32_C(0x2)
18961 /*
18962 * This bit must be '1' for the auto_pause field to be
18963 * configured.
18964 */
18965 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAUSE UINT32_C(0x4)
18966 /*
18967 * This bit must be '1' for the auto_link_speed field to be
18968 * configured.
18969 */
18970 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED UINT32_C(0x8)
18971 /*
18972 * This bit must be '1' for the auto_link_speed_mask field to be
18973 * configured.
18974 */
18975 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK UINT32_C(0x10)
18976 /*
18977 * This bit must be '1' for the wirespeed field to be
18978 * configured.
18979 */
18980 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_WIRESPEED UINT32_C(0x20)
18981 /*
18982 * This bit must be '1' for the lpbk field to be
18983 * configured.
18984 */
18985 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_LPBK UINT32_C(0x40)
18986 /*
18987 * This bit must be '1' for the preemphasis field to be
18988 * configured.
18989 */
18990 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_PREEMPHASIS UINT32_C(0x80)
18991 /*
18992 * This bit must be '1' for the force_pause field to be
18993 * configured.
18994 */
18995 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAUSE UINT32_C(0x100)
18996 /*
18997 * This bit must be '1' for the eee_link_speed_mask field to be
18998 * configured.
18999 */
19000 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_EEE_LINK_SPEED_MASK UINT32_C(0x200)
19001 /*
19002 * This bit must be '1' for the tx_lpi_timer field to be
19003 * configured.
19004 */
19005 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_TX_LPI_TIMER UINT32_C(0x400)
19006 /*
19007 * This bit must be '1' for the force_pam4_link_speed field to be
19008 * configured.
19009 */
19010 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAM4_LINK_SPEED UINT32_C(0x800)
19011 /*
19012 * This bit must be '1' for the auto_pam4_link_speed_mask field to
19013 * be configured.
19014 */
19015 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAM4_LINK_SPEED_MASK UINT32_C(0x1000)
19016 /* Port ID of port that is to be configured. */
19017 uint16_t port_id;
19018 /*
19019 * This is the speed that will be used if the force
19020 * bit is '1'. If unsupported speed is selected, an error
19021 * will be generated.
19022 */
19023 uint16_t force_link_speed;
19024 /* 100Mb link speed */
19025 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
19026 /* 1Gb link speed */
19027 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_1GB UINT32_C(0xa)
19028 /* 2Gb link speed */
19029 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2GB UINT32_C(0x14)
19030 /* 25Gb link speed */
19031 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
19032 /* 10Gb link speed */
19033 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10GB UINT32_C(0x64)
19034 /* 20Mb link speed */
19035 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_20GB UINT32_C(0xc8)
19036 /* 25Gb link speed */
19037 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_25GB UINT32_C(0xfa)
19038 /* 40Gb link speed */
19039 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_40GB UINT32_C(0x190)
19040 /* 50Gb link speed */
19041 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB UINT32_C(0x1f4)
19042 /* 100Gb link speed */
19043 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB UINT32_C(0x3e8)
19044 /* 10Mb link speed */
19045 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB UINT32_C(0xffff)
19046 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_LAST HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB
19047 /*
19048 * This value is used to identify what autoneg mode is
19049 * used when the link speed is not being forced.
19050 */
19051 uint8_t auto_mode;
19052 /* Disable autoneg or autoneg disabled. No speeds are selected. */
19053 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_NONE UINT32_C(0x0)
19054 /* Select all possible speeds for autoneg mode. */
19055 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS UINT32_C(0x1)
19056 /*
19057 * Select only the auto_link_speed speed for autoneg mode. This mode has
19058 * been DEPRECATED. An HWRM client should not use this mode.
19059 */
19060 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_SPEED UINT32_C(0x2)
19061 /*
19062 * Select the auto_link_speed or any speed below that speed for autoneg.
19063 * This mode has been DEPRECATED. An HWRM client should not use this mode.
19064 */
19065 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
19066 /*
19067 * Select the speeds based on the corresponding link speed mask values
19068 * that are provided. The included speeds are specified in the
19069 * auto_link_speed and auto_pam4_link_speed fields.
19070 */
19071 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK UINT32_C(0x4)
19072 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_LAST HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK
19073 /*
19074 * This is the duplex setting that will be used if the autoneg_mode
19075 * is "one_speed" or "one_or_below".
19076 */
19077 uint8_t auto_duplex;
19078 /* Half Duplex will be requested. */
19079 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_HALF UINT32_C(0x0)
19080 /* Full duplex will be requested. */
19081 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_FULL UINT32_C(0x1)
19082 /* Both Half and Full dupex will be requested. */
19083 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH UINT32_C(0x2)
19084 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_LAST HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH
19085 /*
19086 * This value is used to configure the pause that will be
19087 * used for autonegotiation.
19088 * Add text on the usage of auto_pause and force_pause.
19089 */
19090 uint8_t auto_pause;
19091 /*
19092 * When this bit is '1', Generation of tx pause messages
19093 * has been requested. Disabled otherwise.
19094 */
19095 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_TX UINT32_C(0x1)
19096 /*
19097 * When this bit is '1', Reception of rx pause messages
19098 * has been requested. Disabled otherwise.
19099 */
19100 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_RX UINT32_C(0x2)
19101 /*
19102 * When set to 1, the advertisement of pause is enabled.
19103 *
19104 * # When the auto_mode is not set to none and this flag is
19105 * set to 1, then the auto_pause bits on this port are being
19106 * advertised and autoneg pause results are being interpreted.
19107 * # When the auto_mode is not set to none and this
19108 * flag is set to 0, the pause is forced as indicated in
19109 * force_pause, and also advertised as auto_pause bits, but
19110 * the autoneg results are not interpreted since the pause
19111 * configuration is being forced.
19112 * # When the auto_mode is set to none and this flag is set to
19113 * 1, auto_pause bits should be ignored and should be set to 0.
19114 */
19115 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_AUTONEG_PAUSE UINT32_C(0x4)
19116 uint8_t unused_0;
19117 /*
19118 * This is the speed that will be used if the autoneg_mode
19119 * is "one_speed" or "one_or_below". If an unsupported speed
19120 * is selected, an error will be generated.
19121 */
19122 uint16_t auto_link_speed;
19123 /* 100Mb link speed */
19124 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
19125 /* 1Gb link speed */
19126 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_1GB UINT32_C(0xa)
19127 /* 2Gb link speed */
19128 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2GB UINT32_C(0x14)
19129 /* 25Gb link speed */
19130 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
19131 /* 10Gb link speed */
19132 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10GB UINT32_C(0x64)
19133 /* 20Mb link speed */
19134 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_20GB UINT32_C(0xc8)
19135 /* 25Gb link speed */
19136 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_25GB UINT32_C(0xfa)
19137 /* 40Gb link speed */
19138 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_40GB UINT32_C(0x190)
19139 /* 50Gb link speed */
19140 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_50GB UINT32_C(0x1f4)
19141 /* 100Gb link speed */
19142 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
19143 /* 10Mb link speed */
19144 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB UINT32_C(0xffff)
19145 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_LAST HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB
19146 /*
19147 * This is a mask of link speeds that will be used if
19148 * autoneg_mode is "mask". If unsupported speed is enabled
19149 * an error will be generated.
19150 */
19151 uint16_t auto_link_speed_mask;
19152 /* 100Mb link speed (Half-duplex) */
19153 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MBHD UINT32_C(0x1)
19154 /* 100Mb link speed (Full-duplex) */
19155 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MB UINT32_C(0x2)
19156 /* 1Gb link speed (Half-duplex) */
19157 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GBHD UINT32_C(0x4)
19158 /* 1Gb link speed (Full-duplex) */
19159 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GB UINT32_C(0x8)
19160 /* 2Gb link speed */
19161 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2GB UINT32_C(0x10)
19162 /* 25Gb link speed */
19163 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2_5GB UINT32_C(0x20)
19164 /* 10Gb link speed */
19165 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10GB UINT32_C(0x40)
19166 /* 20Gb link speed */
19167 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_20GB UINT32_C(0x80)
19168 /* 25Gb link speed */
19169 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_25GB UINT32_C(0x100)
19170 /* 40Gb link speed */
19171 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_40GB UINT32_C(0x200)
19172 /* 50Gb link speed */
19173 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_50GB UINT32_C(0x400)
19174 /* 100Gb link speed */
19175 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100GB UINT32_C(0x800)
19176 /* 10Mb link speed (Half-duplex) */
19177 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MBHD UINT32_C(0x1000)
19178 /* 10Mb link speed (Full-duplex) */
19179 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MB UINT32_C(0x2000)
19180 /* This value controls the wirespeed feature. */
19181 uint8_t wirespeed;
19182 /* Wirespeed feature is disabled. */
19183 #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_OFF UINT32_C(0x0)
19184 /* Wirespeed feature is enabled. */
19185 #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON UINT32_C(0x1)
19186 #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_LAST HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON
19187 /* This value controls the loopback setting for the PHY. */
19188 uint8_t lpbk;
19189 /* No loopback is selected. Normal operation. */
19190 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_NONE UINT32_C(0x0)
19191 /*
19192 * The HW will be configured with local loopback such that
19193 * host data is sent back to the host without modification.
19194 */
19195 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LOCAL UINT32_C(0x1)
19196 /*
19197 * The HW will be configured with remote loopback such that
19198 * port logic will send packets back out the transmitter that
19199 * are received.
19200 */
19201 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_REMOTE UINT32_C(0x2)
19202 /*
19203 * The HW will be configured with external loopback such that
19204 * host data is sent on the transmitter and based on the external
19205 * loopback connection the data will be received without modification.
19206 */
19207 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_EXTERNAL UINT32_C(0x3)
19208 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LAST HWRM_PORT_PHY_CFG_INPUT_LPBK_EXTERNAL
19209 /*
19210 * This value is used to configure the pause that will be
19211 * used for force mode.
19212 */
19213 uint8_t force_pause;
19214 /*
19215 * When this bit is '1', Generation of tx pause messages
19216 * is supported. Disabled otherwise.
19217 */
19218 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_TX UINT32_C(0x1)
19219 /*
19220 * When this bit is '1', Reception of rx pause messages
19221 * is supported. Disabled otherwise.
19222 */
19223 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_RX UINT32_C(0x2)
19224 uint8_t unused_1;
19225 /*
19226 * This value controls the pre-emphasis to be used for the
19227 * link. Driver should not set this value (use
19228 * enable.preemphasis = 0) unless driver is sure of setting.
19229 * Normally HWRM FW will determine proper pre-emphasis.
19230 */
19231 uint32_t preemphasis;
19232 /*
19233 * Setting for link speed mask that is used to
19234 * advertise speeds during autonegotiation when EEE is enabled.
19235 * This field is valid only when EEE is enabled.
19236 * The speeds specified in this field shall be a subset of
19237 * speeds specified in auto_link_speed_mask.
19238 * If EEE is enabled,then at least one speed shall be provided
19239 * in this mask.
19240 */
19241 uint16_t eee_link_speed_mask;
19242 /* Reserved */
19243 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD1 UINT32_C(0x1)
19244 /* 100Mb link speed (Full-duplex) */
19245 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_100MB UINT32_C(0x2)
19246 /* Reserved */
19247 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD2 UINT32_C(0x4)
19248 /* 1Gb link speed (Full-duplex) */
19249 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_1GB UINT32_C(0x8)
19250 /* Reserved */
19251 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD3 UINT32_C(0x10)
19252 /* Reserved */
19253 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD4 UINT32_C(0x20)
19254 /* 10Gb link speed */
19255 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_10GB UINT32_C(0x40)
19256 /*
19257 * This is the speed that will be used if the force and force_pam4
19258 * bits are '1'. If unsupported speed is selected, an error
19259 * will be generated.
19260 */
19261 uint16_t force_pam4_link_speed;
19262 /* 50Gb link speed */
19263 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_50GB UINT32_C(0x1f4)
19264 /* 100Gb link speed */
19265 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_100GB UINT32_C(0x3e8)
19266 /* 200Gb link speed */
19267 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_200GB UINT32_C(0x7d0)
19268 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_LAST HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_200GB
19269 /*
19270 * Requested setting of TX LPI timer in microseconds.
19271 * This field is valid only when EEE is enabled and TX LPI is
19272 * enabled.
19273 */
19274 uint32_t tx_lpi_timer;
19275 #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_MASK UINT32_C(0xffffff)
19276 #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_SFT 0
19277 /* This field specifies which PAM4 speeds are enabled for auto mode. */
19278 uint16_t auto_link_pam4_speed_mask;
19279 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_PAM4_SPEED_MASK_50G UINT32_C(0x1)
19280 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_PAM4_SPEED_MASK_100G UINT32_C(0x2)
19281 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_PAM4_SPEED_MASK_200G UINT32_C(0x4)
19282 uint8_t unused_2[2];
19283 } hwrm_port_phy_cfg_input_t, *phwrm_port_phy_cfg_input_t;
19284
19285 /* hwrm_port_phy_cfg_output (size:128b/16B) */
19286
19287 typedef struct hwrm_port_phy_cfg_output {
19288 /* The specific error status for the command. */
19289 uint16_t error_code;
19290 /* The HWRM command request type. */
19291 uint16_t req_type;
19292 /* The sequence ID from the original command. */
19293 uint16_t seq_id;
19294 /* The length of the response data in number of bytes. */
19295 uint16_t resp_len;
19296 uint8_t unused_0[7];
19297 /*
19298 * This field is used in Output records to indicate that the output
19299 * is completely written to RAM. This field should be read as '1'
19300 * to indicate that the output has been completely written.
19301 * When writing a command completion or response to an internal processor,
19302 * the order of writes has to be such that this field is written last.
19303 */
19304 uint8_t valid;
19305 } hwrm_port_phy_cfg_output_t, *phwrm_port_phy_cfg_output_t;
19306
19307 /* hwrm_port_phy_cfg_cmd_err (size:64b/8B) */
19308
19309 typedef struct hwrm_port_phy_cfg_cmd_err {
19310 /*
19311 * command specific error codes that goes to
19312 * the cmd_err field in Common HWRM Error Response.
19313 */
19314 uint8_t code;
19315 /* Unknown error */
19316 #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
19317 /* Unable to complete operation due to invalid speed */
19318 #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_ILLEGAL_SPEED UINT32_C(0x1)
19319 /*
19320 * retry the command since the phy is not ready.
19321 * retry count is returned in opaque_0.
19322 * This is only valid for the first command and
19323 * this value will not change for successive calls.
19324 * but if a 0 is returned at any time then this should
19325 * be treated as an un recoverable failure,
19326 *
19327 * retry interval in milli seconds is returned in opaque_1.
19328 * This specifies the time that user should wait before
19329 * issuing the next port_phy_cfg command.
19330 */
19331 #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_RETRY UINT32_C(0x2)
19332 #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_LAST HWRM_PORT_PHY_CFG_CMD_ERR_CODE_RETRY
19333 uint8_t unused_0[7];
19334 } hwrm_port_phy_cfg_cmd_err_t, *phwrm_port_phy_cfg_cmd_err_t;
19335
19336 /**********************
19337 * hwrm_port_phy_qcfg *
19338 **********************/
19339
19340
19341 /* hwrm_port_phy_qcfg_input (size:192b/24B) */
19342
19343 typedef struct hwrm_port_phy_qcfg_input {
19344 /* The HWRM command request type. */
19345 uint16_t req_type;
19346 /*
19347 * The completion ring to send the completion event on. This should
19348 * be the NQ ID returned from the `nq_alloc` HWRM command.
19349 */
19350 uint16_t cmpl_ring;
19351 /*
19352 * The sequence ID is used by the driver for tracking multiple
19353 * commands. This ID is treated as opaque data by the firmware and
19354 * the value is returned in the `hwrm_resp_hdr` upon completion.
19355 */
19356 uint16_t seq_id;
19357 /*
19358 * The target ID of the command:
19359 * * 0x0-0xFFF8 - The function ID
19360 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
19361 * * 0xFFFD - Reserved for user-space HWRM interface
19362 * * 0xFFFF - HWRM
19363 */
19364 uint16_t target_id;
19365 /*
19366 * A physical address pointer pointing to a host buffer that the
19367 * command's response data will be written. This can be either a host
19368 * physical address (HPA) or a guest physical address (GPA) and must
19369 * point to a physically contiguous block of memory.
19370 */
19371 uint64_t resp_addr;
19372 /* Port ID of port that is to be queried. */
19373 uint16_t port_id;
19374 uint8_t unused_0[6];
19375 } hwrm_port_phy_qcfg_input_t, *phwrm_port_phy_qcfg_input_t;
19376
19377 /* hwrm_port_phy_qcfg_output (size:768b/96B) */
19378
19379 typedef struct hwrm_port_phy_qcfg_output {
19380 /* The specific error status for the command. */
19381 uint16_t error_code;
19382 /* The HWRM command request type. */
19383 uint16_t req_type;
19384 /* The sequence ID from the original command. */
19385 uint16_t seq_id;
19386 /* The length of the response data in number of bytes. */
19387 uint16_t resp_len;
19388 /* This value indicates the current link status. */
19389 uint8_t link;
19390 /* There is no link or cable detected. */
19391 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_NO_LINK UINT32_C(0x0)
19392 /* There is no link, but a cable has been detected. */
19393 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SIGNAL UINT32_C(0x1)
19394 /* There is a link. */
19395 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK UINT32_C(0x2)
19396 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LAST HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK
19397 uint8_t active_fec_signal_mode;
19398 /*
19399 * This value indicates the current link signaling mode of the
19400 * connection.
19401 */
19402 #define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_MASK UINT32_C(0xf)
19403 #define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_SFT 0
19404 /* NRZ signaling */
19405 #define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_NRZ UINT32_C(0x0)
19406 /* PAM4 signaling */
19407 #define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_PAM4 UINT32_C(0x1)
19408 #define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_LAST HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_PAM4
19409 /* This value indicates the current active FEC mode. */
19410 #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_MASK UINT32_C(0xf0)
19411 #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_SFT 4
19412 /* No active FEC */
19413 #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_NONE_ACTIVE (UINT32_C(0x0) << 4)
19414 /* FEC CLAUSE 74 (Fire Code) active, autonegotiated or forced. */
19415 #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_CLAUSE74_ACTIVE (UINT32_C(0x1) << 4)
19416 /* FEC CLAUSE 91 RS(528,514) active, autonegoatiated or forced. */
19417 #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_CLAUSE91_ACTIVE (UINT32_C(0x2) << 4)
19418 /* FEC RS544_1XN active, autonegoatiated or forced. */
19419 #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_RS544_1XN_ACTIVE (UINT32_C(0x3) << 4)
19420 /* FEC RS(544,528) active, autonegoatiated or forced. */
19421 #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_RS544_IEEE_ACTIVE (UINT32_C(0x4) << 4)
19422 /* FEC RS272_1XN active, autonegotiated or forced. */
19423 #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_RS272_1XN_ACTIVE (UINT32_C(0x5) << 4)
19424 /* FEC RS(272,257) active, autonegoatiated or forced. */
19425 #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_RS272_IEEE_ACTIVE (UINT32_C(0x6) << 4)
19426 #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_LAST HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_RS272_IEEE_ACTIVE
19427 /*
19428 * This value indicates the current link speed of the connection.
19429 * The signal_mode field indicates if the link is using
19430 * NRZ or PAM4 signaling.
19431 */
19432 uint16_t link_speed;
19433 /* 100Mb link speed */
19434 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100MB UINT32_C(0x1)
19435 /* 1Gb link speed */
19436 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_1GB UINT32_C(0xa)
19437 /* 2Gb link speed */
19438 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2GB UINT32_C(0x14)
19439 /* 25Gb link speed */
19440 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2_5GB UINT32_C(0x19)
19441 /* 10Gb link speed */
19442 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10GB UINT32_C(0x64)
19443 /* 20Mb link speed */
19444 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_20GB UINT32_C(0xc8)
19445 /* 25Gb link speed */
19446 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_25GB UINT32_C(0xfa)
19447 /* 40Gb link speed */
19448 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_40GB UINT32_C(0x190)
19449 /* 50Gb link speed */
19450 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_50GB UINT32_C(0x1f4)
19451 /* 100Gb link speed */
19452 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100GB UINT32_C(0x3e8)
19453 /* 200Gb link speed */
19454 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_200GB UINT32_C(0x7d0)
19455 /* 10Mb link speed */
19456 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB UINT32_C(0xffff)
19457 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_LAST HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB
19458 /*
19459 * This value is indicates the duplex of the current
19460 * configuration.
19461 */
19462 uint8_t duplex_cfg;
19463 /* Half Duplex connection. */
19464 #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_HALF UINT32_C(0x0)
19465 /* Full duplex connection. */
19466 #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL UINT32_C(0x1)
19467 #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_LAST HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL
19468 /*
19469 * This value is used to indicate the current
19470 * pause configuration. When autoneg is enabled, this value
19471 * represents the autoneg results of pause configuration.
19472 */
19473 uint8_t pause;
19474 /*
19475 * When this bit is '1', Generation of tx pause messages
19476 * is supported. Disabled otherwise.
19477 */
19478 #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_TX UINT32_C(0x1)
19479 /*
19480 * When this bit is '1', Reception of rx pause messages
19481 * is supported. Disabled otherwise.
19482 */
19483 #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX UINT32_C(0x2)
19484 /*
19485 * The supported speeds for the port. This is a bit mask.
19486 * For each speed that is supported, the corresponding
19487 * bit will be set to '1'.
19488 */
19489 uint16_t support_speeds;
19490 /* 100Mb link speed (Half-duplex) */
19491 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MBHD UINT32_C(0x1)
19492 /* 100Mb link speed (Full-duplex) */
19493 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MB UINT32_C(0x2)
19494 /* 1Gb link speed (Half-duplex) */
19495 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GBHD UINT32_C(0x4)
19496 /* 1Gb link speed (Full-duplex) */
19497 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GB UINT32_C(0x8)
19498 /* 2Gb link speed */
19499 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2GB UINT32_C(0x10)
19500 /* 25Gb link speed */
19501 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2_5GB UINT32_C(0x20)
19502 /* 10Gb link speed */
19503 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10GB UINT32_C(0x40)
19504 /* 20Gb link speed */
19505 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_20GB UINT32_C(0x80)
19506 /* 25Gb link speed */
19507 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_25GB UINT32_C(0x100)
19508 /* 40Gb link speed */
19509 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_40GB UINT32_C(0x200)
19510 /* 50Gb link speed */
19511 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_50GB UINT32_C(0x400)
19512 /* 100Gb link speed */
19513 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100GB UINT32_C(0x800)
19514 /* 10Mb link speed (Half-duplex) */
19515 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MBHD UINT32_C(0x1000)
19516 /* 10Mb link speed (Full-duplex) */
19517 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MB UINT32_C(0x2000)
19518 /*
19519 * Current setting of forced link speed.
19520 * When the link speed is not being forced, this
19521 * value shall be set to 0.
19522 */
19523 uint16_t force_link_speed;
19524 /* 100Mb link speed */
19525 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
19526 /* 1Gb link speed */
19527 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_1GB UINT32_C(0xa)
19528 /* 2Gb link speed */
19529 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2GB UINT32_C(0x14)
19530 /* 25Gb link speed */
19531 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
19532 /* 10Gb link speed */
19533 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10GB UINT32_C(0x64)
19534 /* 20Mb link speed */
19535 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_20GB UINT32_C(0xc8)
19536 /* 25Gb link speed */
19537 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_25GB UINT32_C(0xfa)
19538 /* 40Gb link speed */
19539 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_40GB UINT32_C(0x190)
19540 /* 50Gb link speed */
19541 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_50GB UINT32_C(0x1f4)
19542 /* 100Gb link speed */
19543 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100GB UINT32_C(0x3e8)
19544 /* 10Mb link speed */
19545 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB UINT32_C(0xffff)
19546 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_LAST HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB
19547 /* Current setting of auto negotiation mode. */
19548 uint8_t auto_mode;
19549 /* Disable autoneg or autoneg disabled. No speeds are selected. */
19550 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_NONE UINT32_C(0x0)
19551 /* Select all possible speeds for autoneg mode. */
19552 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ALL_SPEEDS UINT32_C(0x1)
19553 /*
19554 * Select only the auto_link_speed speed for autoneg mode. This mode has
19555 * been DEPRECATED. An HWRM client should not use this mode.
19556 */
19557 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_SPEED UINT32_C(0x2)
19558 /*
19559 * Select the auto_link_speed or any speed below that speed for autoneg.
19560 * This mode has been DEPRECATED. An HWRM client should not use this mode.
19561 */
19562 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
19563 /*
19564 * Select the speeds based on the corresponding link speed mask value
19565 * that is provided.
19566 */
19567 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK UINT32_C(0x4)
19568 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_LAST HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK
19569 /*
19570 * Current setting of pause autonegotiation.
19571 * Move autoneg_pause flag here.
19572 */
19573 uint8_t auto_pause;
19574 /*
19575 * When this bit is '1', Generation of tx pause messages
19576 * has been requested. Disabled otherwise.
19577 */
19578 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_TX UINT32_C(0x1)
19579 /*
19580 * When this bit is '1', Reception of rx pause messages
19581 * has been requested. Disabled otherwise.
19582 */
19583 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_RX UINT32_C(0x2)
19584 /*
19585 * When set to 1, the advertisement of pause is enabled.
19586 *
19587 * # When the auto_mode is not set to none and this flag is
19588 * set to 1, then the auto_pause bits on this port are being
19589 * advertised and autoneg pause results are being interpreted.
19590 * # When the auto_mode is not set to none and this
19591 * flag is set to 0, the pause is forced as indicated in
19592 * force_pause, and also advertised as auto_pause bits, but
19593 * the autoneg results are not interpreted since the pause
19594 * configuration is being forced.
19595 * # When the auto_mode is set to none and this flag is set to
19596 * 1, auto_pause bits should be ignored and should be set to 0.
19597 */
19598 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_AUTONEG_PAUSE UINT32_C(0x4)
19599 /*
19600 * Current setting for auto_link_speed. This field is only
19601 * valid when auto_mode is set to "one_speed" or "one_or_below".
19602 */
19603 uint16_t auto_link_speed;
19604 /* 100Mb link speed */
19605 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
19606 /* 1Gb link speed */
19607 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_1GB UINT32_C(0xa)
19608 /* 2Gb link speed */
19609 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2GB UINT32_C(0x14)
19610 /* 25Gb link speed */
19611 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
19612 /* 10Gb link speed */
19613 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10GB UINT32_C(0x64)
19614 /* 20Mb link speed */
19615 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_20GB UINT32_C(0xc8)
19616 /* 25Gb link speed */
19617 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_25GB UINT32_C(0xfa)
19618 /* 40Gb link speed */
19619 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_40GB UINT32_C(0x190)
19620 /* 50Gb link speed */
19621 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_50GB UINT32_C(0x1f4)
19622 /* 100Gb link speed */
19623 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
19624 /* 10Mb link speed */
19625 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB UINT32_C(0xffff)
19626 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_LAST HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB
19627 /*
19628 * Current setting for auto_link_speed_mask that is used to
19629 * advertise speeds during autonegotiation.
19630 * This field is only valid when auto_mode is set to "mask".
19631 * The speeds specified in this field shall be a subset of
19632 * supported speeds on this port.
19633 */
19634 uint16_t auto_link_speed_mask;
19635 /* 100Mb link speed (Half-duplex) */
19636 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MBHD UINT32_C(0x1)
19637 /* 100Mb link speed (Full-duplex) */
19638 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MB UINT32_C(0x2)
19639 /* 1Gb link speed (Half-duplex) */
19640 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GBHD UINT32_C(0x4)
19641 /* 1Gb link speed (Full-duplex) */
19642 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GB UINT32_C(0x8)
19643 /* 2Gb link speed */
19644 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2GB UINT32_C(0x10)
19645 /* 25Gb link speed */
19646 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2_5GB UINT32_C(0x20)
19647 /* 10Gb link speed */
19648 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10GB UINT32_C(0x40)
19649 /* 20Gb link speed */
19650 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_20GB UINT32_C(0x80)
19651 /* 25Gb link speed */
19652 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_25GB UINT32_C(0x100)
19653 /* 40Gb link speed */
19654 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_40GB UINT32_C(0x200)
19655 /* 50Gb link speed */
19656 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_50GB UINT32_C(0x400)
19657 /* 100Gb link speed */
19658 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100GB UINT32_C(0x800)
19659 /* 10Mb link speed (Half-duplex) */
19660 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MBHD UINT32_C(0x1000)
19661 /* 10Mb link speed (Full-duplex) */
19662 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MB UINT32_C(0x2000)
19663 /* Current setting for wirespeed. */
19664 uint8_t wirespeed;
19665 /* Wirespeed feature is disabled. */
19666 #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_OFF UINT32_C(0x0)
19667 /* Wirespeed feature is enabled. */
19668 #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON UINT32_C(0x1)
19669 #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_LAST HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON
19670 /* Current setting for loopback. */
19671 uint8_t lpbk;
19672 /* No loopback is selected. Normal operation. */
19673 #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_NONE UINT32_C(0x0)
19674 /*
19675 * The HW will be configured with local loopback such that
19676 * host data is sent back to the host without modification.
19677 */
19678 #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LOCAL UINT32_C(0x1)
19679 /*
19680 * The HW will be configured with remote loopback such that
19681 * port logic will send packets back out the transmitter that
19682 * are received.
19683 */
19684 #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
19685 /*
19686 * The HW will be configured with external loopback such that
19687 * host data is sent on the transmitter and based on the external
19688 * loopback connection the data will be received without modification.
19689 */
19690 #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_EXTERNAL UINT32_C(0x3)
19691 #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LAST HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_EXTERNAL
19692 /*
19693 * Current setting of forced pause.
19694 * When the pause configuration is not being forced, then
19695 * this value shall be set to 0.
19696 */
19697 uint8_t force_pause;
19698 /*
19699 * When this bit is '1', Generation of tx pause messages
19700 * is supported. Disabled otherwise.
19701 */
19702 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_TX UINT32_C(0x1)
19703 /*
19704 * When this bit is '1', Reception of rx pause messages
19705 * is supported. Disabled otherwise.
19706 */
19707 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_RX UINT32_C(0x2)
19708 /*
19709 * This value indicates the current status of the optics module on
19710 * this port.
19711 */
19712 uint8_t module_status;
19713 /* Module is inserted and accepted */
19714 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NONE UINT32_C(0x0)
19715 /* Module is rejected and transmit side Laser is disabled. */
19716 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_DISABLETX UINT32_C(0x1)
19717 /* Module mismatch warning. */
19718 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_WARNINGMSG UINT32_C(0x2)
19719 /* Module is rejected and powered down. */
19720 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_PWRDOWN UINT32_C(0x3)
19721 /* Module is not inserted. */
19722 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTINSERTED UINT32_C(0x4)
19723 /* Module is powered down because of over current fault. */
19724 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_CURRENTFAULT UINT32_C(0x5)
19725 /* Module status is not applicable. */
19726 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE UINT32_C(0xff)
19727 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_LAST HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE
19728 /* Current setting for preemphasis. */
19729 uint32_t preemphasis;
19730 /* This field represents the major version of the PHY. */
19731 uint8_t phy_maj;
19732 /* This field represents the minor version of the PHY. */
19733 uint8_t phy_min;
19734 /* This field represents the build version of the PHY. */
19735 uint8_t phy_bld;
19736 /* This value represents a PHY type. */
19737 uint8_t phy_type;
19738 /* Unknown */
19739 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN UINT32_C(0x0)
19740 /* BASE-CR */
19741 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASECR UINT32_C(0x1)
19742 /* BASE-KR4 (Deprecated) */
19743 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4 UINT32_C(0x2)
19744 /* BASE-LR */
19745 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASELR UINT32_C(0x3)
19746 /* BASE-SR */
19747 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASESR UINT32_C(0x4)
19748 /* BASE-KR2 (Deprecated) */
19749 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2 UINT32_C(0x5)
19750 /* BASE-KX */
19751 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKX UINT32_C(0x6)
19752 /* BASE-KR */
19753 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR UINT32_C(0x7)
19754 /* BASE-T */
19755 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET UINT32_C(0x8)
19756 /* EEE capable BASE-T */
19757 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASETE UINT32_C(0x9)
19758 /* SGMII connected external PHY */
19759 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_SGMIIEXTPHY UINT32_C(0xa)
19760 /* 25G_BASECR_CA_L */
19761 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_L UINT32_C(0xb)
19762 /* 25G_BASECR_CA_S */
19763 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_S UINT32_C(0xc)
19764 /* 25G_BASECR_CA_N */
19765 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_N UINT32_C(0xd)
19766 /* 25G_BASESR */
19767 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASESR UINT32_C(0xe)
19768 /* 100G_BASECR4 */
19769 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASECR4 UINT32_C(0xf)
19770 /* 100G_BASESR4 */
19771 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR4 UINT32_C(0x10)
19772 /* 100G_BASELR4 */
19773 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASELR4 UINT32_C(0x11)
19774 /* 100G_BASEER4 */
19775 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASEER4 UINT32_C(0x12)
19776 /* 100G_BASESR10 */
19777 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR10 UINT32_C(0x13)
19778 /* 40G_BASECR4 */
19779 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASECR4 UINT32_C(0x14)
19780 /* 40G_BASESR4 */
19781 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASESR4 UINT32_C(0x15)
19782 /* 40G_BASELR4 */
19783 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASELR4 UINT32_C(0x16)
19784 /* 40G_BASEER4 */
19785 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASEER4 UINT32_C(0x17)
19786 /* 40G_ACTIVE_CABLE */
19787 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_ACTIVE_CABLE UINT32_C(0x18)
19788 /* 1G_baseT */
19789 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASET UINT32_C(0x19)
19790 /* 1G_baseSX */
19791 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASESX UINT32_C(0x1a)
19792 /* 1G_baseCX */
19793 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASECX UINT32_C(0x1b)
19794 /* 100G_BASECR4 */
19795 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASECR4 UINT32_C(0x1c)
19796 /* 100G_BASESR4 */
19797 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASESR4 UINT32_C(0x1d)
19798 /* 100G_BASELR4 */
19799 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASELR4 UINT32_C(0x1e)
19800 /* 100G_BASEER4 */
19801 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASEER4 UINT32_C(0x1f)
19802 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_LAST HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASEER4
19803 /* This value represents a media type. */
19804 uint8_t media_type;
19805 /* Unknown */
19806 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_UNKNOWN UINT32_C(0x0)
19807 /* Twisted Pair */
19808 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_TP UINT32_C(0x1)
19809 /* Direct Attached Copper */
19810 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_DAC UINT32_C(0x2)
19811 /* Fiber */
19812 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE UINT32_C(0x3)
19813 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_LAST HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE
19814 /* This value represents a transceiver type. */
19815 uint8_t xcvr_pkg_type;
19816 /* PHY and MAC are in the same package */
19817 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_INTERNAL UINT32_C(0x1)
19818 /* PHY and MAC are in different packages */
19819 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL UINT32_C(0x2)
19820 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_LAST HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL
19821 uint8_t eee_config_phy_addr;
19822 /* This field represents PHY address. */
19823 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_MASK UINT32_C(0x1f)
19824 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_SFT 0
19825 /*
19826 * This field represents flags related to EEE configuration.
19827 * These EEE configuration flags are valid only when the
19828 * auto_mode is not set to none (in other words autonegotiation
19829 * is enabled).
19830 */
19831 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_MASK UINT32_C(0xe0)
19832 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_SFT 5
19833 /*
19834 * When set to 1, Energy Efficient Ethernet (EEE) mode is enabled.
19835 * Speeds for autoneg with EEE mode enabled
19836 * are based on eee_link_speed_mask.
19837 */
19838 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ENABLED UINT32_C(0x20)
19839 /*
19840 * This flag is valid only when eee_enabled is set to 1.
19841 *
19842 * # If eee_enabled is set to 0, then EEE mode is disabled
19843 * and this flag shall be ignored.
19844 * # If eee_enabled is set to 1 and this flag is set to 1,
19845 * then Energy Efficient Ethernet (EEE) mode is enabled
19846 * and in use.
19847 * # If eee_enabled is set to 1 and this flag is set to 0,
19848 * then Energy Efficient Ethernet (EEE) mode is enabled
19849 * but is currently not in use.
19850 */
19851 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ACTIVE UINT32_C(0x40)
19852 /*
19853 * This flag is valid only when eee_enabled is set to 1.
19854 *
19855 * # If eee_enabled is set to 0, then EEE mode is disabled
19856 * and this flag shall be ignored.
19857 * # If eee_enabled is set to 1 and this flag is set to 1,
19858 * then Energy Efficient Ethernet (EEE) mode is enabled
19859 * and TX LPI is enabled.
19860 * # If eee_enabled is set to 1 and this flag is set to 0,
19861 * then Energy Efficient Ethernet (EEE) mode is enabled
19862 * but TX LPI is disabled.
19863 */
19864 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_TX_LPI UINT32_C(0x80)
19865 /*
19866 * When set to 1, the parallel detection is used to determine
19867 * the speed of the link partner.
19868 *
19869 * Parallel detection is used when a autonegotiation capable
19870 * device is connected to a link parter that is not capable
19871 * of autonegotiation.
19872 */
19873 uint8_t parallel_detect;
19874 /*
19875 * When set to 1, the parallel detection is used to determine
19876 * the speed of the link partner.
19877 *
19878 * Parallel detection is used when a autonegotiation capable
19879 * device is connected to a link parter that is not capable
19880 * of autonegotiation.
19881 */
19882 #define HWRM_PORT_PHY_QCFG_OUTPUT_PARALLEL_DETECT UINT32_C(0x1)
19883 /*
19884 * The advertised speeds for the port by the link partner.
19885 * Each advertised speed will be set to '1'.
19886 */
19887 uint16_t link_partner_adv_speeds;
19888 /* 100Mb link speed (Half-duplex) */
19889 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MBHD UINT32_C(0x1)
19890 /* 100Mb link speed (Full-duplex) */
19891 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MB UINT32_C(0x2)
19892 /* 1Gb link speed (Half-duplex) */
19893 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GBHD UINT32_C(0x4)
19894 /* 1Gb link speed (Full-duplex) */
19895 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GB UINT32_C(0x8)
19896 /* 2Gb link speed */
19897 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2GB UINT32_C(0x10)
19898 /* 25Gb link speed */
19899 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2_5GB UINT32_C(0x20)
19900 /* 10Gb link speed */
19901 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10GB UINT32_C(0x40)
19902 /* 20Gb link speed */
19903 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_20GB UINT32_C(0x80)
19904 /* 25Gb link speed */
19905 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_25GB UINT32_C(0x100)
19906 /* 40Gb link speed */
19907 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_40GB UINT32_C(0x200)
19908 /* 50Gb link speed */
19909 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_50GB UINT32_C(0x400)
19910 /* 100Gb link speed */
19911 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100GB UINT32_C(0x800)
19912 /* 10Mb link speed (Half-duplex) */
19913 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MBHD UINT32_C(0x1000)
19914 /* 10Mb link speed (Full-duplex) */
19915 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MB UINT32_C(0x2000)
19916 /*
19917 * The advertised autoneg for the port by the link partner.
19918 * This field is deprecated and should be set to 0.
19919 */
19920 uint8_t link_partner_adv_auto_mode;
19921 /* Disable autoneg or autoneg disabled. No speeds are selected. */
19922 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_NONE UINT32_C(0x0)
19923 /* Select all possible speeds for autoneg mode. */
19924 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ALL_SPEEDS UINT32_C(0x1)
19925 /*
19926 * Select only the auto_link_speed speed for autoneg mode. This mode has
19927 * been DEPRECATED. An HWRM client should not use this mode.
19928 */
19929 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_SPEED UINT32_C(0x2)
19930 /*
19931 * Select the auto_link_speed or any speed below that speed for autoneg.
19932 * This mode has been DEPRECATED. An HWRM client should not use this mode.
19933 */
19934 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
19935 /*
19936 * Select the speeds based on the corresponding link speed mask value
19937 * that is provided.
19938 */
19939 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK UINT32_C(0x4)
19940 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_LAST HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK
19941 /* The advertised pause settings on the port by the link partner. */
19942 uint8_t link_partner_adv_pause;
19943 /*
19944 * When this bit is '1', Generation of tx pause messages
19945 * is supported. Disabled otherwise.
19946 */
19947 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_TX UINT32_C(0x1)
19948 /*
19949 * When this bit is '1', Reception of rx pause messages
19950 * is supported. Disabled otherwise.
19951 */
19952 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_RX UINT32_C(0x2)
19953 /*
19954 * Current setting for link speed mask that is used to
19955 * advertise speeds during autonegotiation when EEE is enabled.
19956 * This field is valid only when eee_enabled flags is set to 1.
19957 * The speeds specified in this field shall be a subset of
19958 * speeds specified in auto_link_speed_mask.
19959 */
19960 uint16_t adv_eee_link_speed_mask;
19961 /* Reserved */
19962 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD1 UINT32_C(0x1)
19963 /* 100Mb link speed (Full-duplex) */
19964 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_100MB UINT32_C(0x2)
19965 /* Reserved */
19966 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD2 UINT32_C(0x4)
19967 /* 1Gb link speed (Full-duplex) */
19968 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_1GB UINT32_C(0x8)
19969 /* Reserved */
19970 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD3 UINT32_C(0x10)
19971 /* Reserved */
19972 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD4 UINT32_C(0x20)
19973 /* 10Gb link speed */
19974 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_10GB UINT32_C(0x40)
19975 /*
19976 * Current setting for link speed mask that is advertised by
19977 * the link partner when EEE is enabled.
19978 * This field is valid only when eee_enabled flags is set to 1.
19979 */
19980 uint16_t link_partner_adv_eee_link_speed_mask;
19981 /* Reserved */
19982 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD1 UINT32_C(0x1)
19983 /* 100Mb link speed (Full-duplex) */
19984 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_100MB UINT32_C(0x2)
19985 /* Reserved */
19986 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD2 UINT32_C(0x4)
19987 /* 1Gb link speed (Full-duplex) */
19988 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_1GB UINT32_C(0x8)
19989 /* Reserved */
19990 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD3 UINT32_C(0x10)
19991 /* Reserved */
19992 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD4 UINT32_C(0x20)
19993 /* 10Gb link speed */
19994 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_10GB UINT32_C(0x40)
19995 uint32_t xcvr_identifier_type_tx_lpi_timer;
19996 /*
19997 * Current setting of TX LPI timer in microseconds.
19998 * This field is valid only when_eee_enabled flag is set to 1
19999 * and tx_lpi_enabled is set to 1.
20000 */
20001 #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_MASK UINT32_C(0xffffff)
20002 #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_SFT 0
20003 /* This value represents transceiver identifier type. */
20004 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_MASK UINT32_C(0xff000000)
20005 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFT 24
20006 /* Unknown */
20007 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_UNKNOWN (UINT32_C(0x0) << 24)
20008 /* SFP/SFP+/SFP28 */
20009 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFP (UINT32_C(0x3) << 24)
20010 /* QSFP+ */
20011 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP (UINT32_C(0xc) << 24)
20012 /* QSFP+ */
20013 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFPPLUS (UINT32_C(0xd) << 24)
20014 /* QSFP28 */
20015 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28 (UINT32_C(0x11) << 24)
20016 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_LAST HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28
20017 /*
20018 * This value represents the current configuration of
20019 * Forward Error Correction (FEC) on the port.
20020 */
20021 uint16_t fec_cfg;
20022 /*
20023 * When set to 1, then FEC is not supported on this port. If this flag
20024 * is set to 1, then all other FEC configuration flags shall be ignored.
20025 * When set to 0, then FEC is supported as indicated by other
20026 * configuration flags.
20027 */
20028 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_NONE_SUPPORTED UINT32_C(0x1)
20029 /*
20030 * When set to 1, then FEC autonegotiation is supported on this port.
20031 * When set to 0, then FEC autonegotiation is not supported on this port.
20032 */
20033 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_SUPPORTED UINT32_C(0x2)
20034 /*
20035 * When set to 1, then FEC autonegotiation is enabled on this port.
20036 * When set to 0, then FEC autonegotiation is disabled if supported.
20037 * This flag should be ignored if FEC autonegotiation is not supported on this port.
20038 */
20039 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_ENABLED UINT32_C(0x4)
20040 /*
20041 * When set to 1, then FEC CLAUSE 74 (Fire Code) is supported on this port.
20042 * When set to 0, then FEC CLAUSE 74 (Fire Code) is not supported on this port.
20043 */
20044 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_SUPPORTED UINT32_C(0x8)
20045 /*
20046 * When set to 1, then FEC CLAUSE 74 (Fire Code) is enabled on this
20047 * port. This means that FEC CLAUSE 74 is either advertised if
20048 * FEC autonegotiation is enabled or FEC CLAUSE 74 is force enabled.
20049 * When set to 0, then FEC CLAUSE 74 (Fire Code) is disabled if supported.
20050 * This flag should be ignored if FEC CLAUSE 74 is not supported on this port.
20051 */
20052 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_ENABLED UINT32_C(0x10)
20053 /*
20054 * When set to 1, then FEC CLAUSE 91 (Reed Solomon RS(528,514) for
20055 * NRZ) is supported on this port.
20056 * When set to 0, then FEC RS(528,418) is not supported on this port.
20057 */
20058 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_SUPPORTED UINT32_C(0x20)
20059 /*
20060 * When set to 1, then FEC CLAUSE 91 (Reed Solomon RS(528,514) for
20061 * NRZ) is enabled on this port. This means that FEC RS(528,514) is
20062 * either advertised if FEC autonegotiation is enabled or FEC
20063 * RS(528,514) is force enabled. When set to 0, then FEC RS(528,514)
20064 * is disabled if supported.
20065 * This flag should be ignored if FEC CLAUSE 91 is not supported on this port.
20066 */
20067 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_ENABLED UINT32_C(0x40)
20068 /*
20069 * When set to 1, then FEC RS544_1XN is supported on this port.
20070 * When set to 0, then FEC RS544_1XN is not supported on this port.
20071 */
20072 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_1XN_SUPPORTED UINT32_C(0x80)
20073 /*
20074 * When set to 1, then RS544_1XN is enabled on this
20075 * port. This means that FEC RS544_1XN is either advertised if
20076 * FEC autonegotiation is enabled or FEC RS544_1XN is force enabled.
20077 * When set to 0, then FEC RS544_1XN is disabled if supported.
20078 * This flag should be ignored if FEC RS544_1XN is not supported on this port.
20079 */
20080 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_1XN_ENABLED UINT32_C(0x100)
20081 /*
20082 * When set to 1, then FEC RS(544,514) is supported on this port.
20083 * When set to 0, then FEC RS(544,514) is not supported on this port.
20084 */
20085 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_IEEE_SUPPORTED UINT32_C(0x200)
20086 /*
20087 * When set to 1, then RS(544,514) is enabled on this
20088 * port. This means that FEC RS(544,514) is either advertised if
20089 * FEC autonegotiation is enabled or FEC RS(544,514) is force
20090 * enabled. When set to 0, then FEC RS(544,514) is disabled if supported.
20091 * This flag should be ignored if FEC RS(544,514) is not supported on this port.
20092 */
20093 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_IEEE_ENABLED UINT32_C(0x400)
20094 /*
20095 * When set to 1, then FEC RS272_1XN is supported on this port.
20096 * When set to 0, then FEC RS272_1XN is not supported on this port.
20097 */
20098 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS272_1XN_SUPPORTED UINT32_C(0x800)
20099 /*
20100 * When set to 1, then RS272_1XN is enabled on this
20101 * port. This means that FEC RS272_1XN is either advertised if
20102 * FEC autonegotiation is enabled or FEC RS272_1XN is force
20103 * enabled. When set to 0, then FEC RS272_1XN is disabled if supported.
20104 * This flag should be ignored if FEC RS272_1XN is not supported on this port.
20105 */
20106 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS272_1XN_ENABLED UINT32_C(0x1000)
20107 /*
20108 * When set to 1, then FEC RS(272,514) is supported on this port.
20109 * When set to 0, then FEC RS(272,514) is not supported on this port.
20110 */
20111 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS272_IEEE_SUPPORTED UINT32_C(0x2000)
20112 /*
20113 * When set to 1, then RS(272,257) is enabled on this
20114 * port. This means that FEC RS(272,257) is either advertised if
20115 * FEC autonegotiation is enabled or FEC RS(272,257) is force
20116 * enabled. When set to 0, then FEC RS(272,257) is disabled if supported.
20117 * This flag should be ignored if FEC RS(272,257) is not supported on this port.
20118 */
20119 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS272_IEEE_ENABLED UINT32_C(0x4000)
20120 /*
20121 * This value is indicates the duplex of the current
20122 * connection state.
20123 */
20124 uint8_t duplex_state;
20125 /* Half Duplex connection. */
20126 #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_HALF UINT32_C(0x0)
20127 /* Full duplex connection. */
20128 #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL UINT32_C(0x1)
20129 #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_LAST HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL
20130 /* Option flags fields. */
20131 uint8_t option_flags;
20132 /* When this bit is '1', Media auto detect is enabled. */
20133 #define HWRM_PORT_PHY_QCFG_OUTPUT_OPTION_FLAGS_MEDIA_AUTO_DETECT UINT32_C(0x1)
20134 /*
20135 * When this bit is '1', active_fec_signal_mode can be
20136 * trusted.
20137 */
20138 #define HWRM_PORT_PHY_QCFG_OUTPUT_OPTION_FLAGS_SIGNAL_MODE_KNOWN UINT32_C(0x2)
20139 /*
20140 * Up to 16 bytes of null padded ASCII string representing
20141 * PHY vendor.
20142 * If the string is set to null, then the vendor name is not
20143 * available.
20144 */
20145 char phy_vendor_name[16];
20146 /*
20147 * Up to 16 bytes of null padded ASCII string that
20148 * identifies vendor specific part number of the PHY.
20149 * If the string is set to null, then the vendor specific
20150 * part number is not available.
20151 */
20152 char phy_vendor_partnumber[16];
20153 /*
20154 * The supported PAM4 speeds for the port. This is a bit mask.
20155 * For each speed that is supported, the corresponding
20156 * bit will be set to '1'.
20157 */
20158 uint16_t support_pam4_speeds;
20159 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_50G UINT32_C(0x1)
20160 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_100G UINT32_C(0x2)
20161 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_200G UINT32_C(0x4)
20162 /*
20163 * Current setting of forced PAM4 link speed.
20164 * When the link speed is not being forced, this
20165 * value shall be set to 0.
20166 */
20167 uint16_t force_pam4_link_speed;
20168 /* 50Gb link speed */
20169 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAM4_LINK_SPEED_50GB UINT32_C(0x1f4)
20170 /* 100Gb link speed */
20171 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAM4_LINK_SPEED_100GB UINT32_C(0x3e8)
20172 /* 200Gb link speed */
20173 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAM4_LINK_SPEED_200GB UINT32_C(0x7d0)
20174 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAM4_LINK_SPEED_LAST HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAM4_LINK_SPEED_200GB
20175 /*
20176 * Current setting for auto_pam4_link_speed_mask that is used to
20177 * advertise speeds during autonegotiation.
20178 * This field is only valid when auto_mode is set to "mask".
20179 * The speeds specified in this field shall be a subset of
20180 * supported speeds on this port.
20181 */
20182 uint16_t auto_pam4_link_speed_mask;
20183 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAM4_LINK_SPEED_MASK_50G UINT32_C(0x1)
20184 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAM4_LINK_SPEED_MASK_100G UINT32_C(0x2)
20185 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAM4_LINK_SPEED_MASK_200G UINT32_C(0x4)
20186 /*
20187 * The advertised PAM4 speeds for the port by the link partner.
20188 * Each advertised speed will be set to '1'.
20189 */
20190 uint8_t link_partner_pam4_adv_speeds;
20191 /* 50Gb link speed */
20192 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_PAM4_ADV_SPEEDS_50GB UINT32_C(0x1)
20193 /* 100Gb link speed */
20194 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_PAM4_ADV_SPEEDS_100GB UINT32_C(0x2)
20195 /* 200Gb link speed */
20196 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_PAM4_ADV_SPEEDS_200GB UINT32_C(0x4)
20197 /*
20198 * This field is used in Output records to indicate that the output
20199 * is completely written to RAM. This field should be read as '1'
20200 * to indicate that the output has been completely written.
20201 * When writing a command completion or response to an internal processor,
20202 * the order of writes has to be such that this field is written last.
20203 */
20204 uint8_t valid;
20205 } hwrm_port_phy_qcfg_output_t, *phwrm_port_phy_qcfg_output_t;
20206
20207 /*********************
20208 * hwrm_port_mac_cfg *
20209 *********************/
20210
20211
20212 /* hwrm_port_mac_cfg_input (size:384b/48B) */
20213
20214 typedef struct hwrm_port_mac_cfg_input {
20215 /* The HWRM command request type. */
20216 uint16_t req_type;
20217 /*
20218 * The completion ring to send the completion event on. This should
20219 * be the NQ ID returned from the `nq_alloc` HWRM command.
20220 */
20221 uint16_t cmpl_ring;
20222 /*
20223 * The sequence ID is used by the driver for tracking multiple
20224 * commands. This ID is treated as opaque data by the firmware and
20225 * the value is returned in the `hwrm_resp_hdr` upon completion.
20226 */
20227 uint16_t seq_id;
20228 /*
20229 * The target ID of the command:
20230 * * 0x0-0xFFF8 - The function ID
20231 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
20232 * * 0xFFFD - Reserved for user-space HWRM interface
20233 * * 0xFFFF - HWRM
20234 */
20235 uint16_t target_id;
20236 /*
20237 * A physical address pointer pointing to a host buffer that the
20238 * command's response data will be written. This can be either a host
20239 * physical address (HPA) or a guest physical address (GPA) and must
20240 * point to a physically contiguous block of memory.
20241 */
20242 uint64_t resp_addr;
20243 /*
20244 * In this field, there are a number of CoS mappings related flags
20245 * that are used to configure CoS mappings and their corresponding
20246 * priorities in the hardware.
20247 * For the priorities of CoS mappings, the HWRM uses the following
20248 * priority order (high to low) by default:
20249 * # vlan pri
20250 * # ip_dscp
20251 * # tunnel_vlan_pri
20252 * # default cos
20253 *
20254 * A subset of CoS mappings can be enabled.
20255 * If a priority is not specified for an enabled CoS mapping, the
20256 * priority will be assigned in the above order for the enabled CoS
20257 * mappings. For example, if vlan_pri and ip_dscp CoS mappings are
20258 * enabled and their priorities are not specified, the following
20259 * priority order (high to low) will be used by the HWRM:
20260 * # vlan_pri
20261 * # ip_dscp
20262 * # default cos
20263 *
20264 * vlan_pri CoS mapping together with default CoS with lower priority
20265 * are enabled by default by the HWRM.
20266 */
20267 uint32_t flags;
20268 /*
20269 * When this bit is '1', this command will configure
20270 * the MAC to match the current link state of the PHY.
20271 * If the link is not established on the PHY, then this
20272 * bit has no effect.
20273 */
20274 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_MATCH_LINK UINT32_C(0x1)
20275 /*
20276 * When this bit is set to '1', the inner VLAN PRI to CoS mapping
20277 * is requested to be enabled.
20278 */
20279 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_ENABLE UINT32_C(0x2)
20280 /*
20281 * When this bit is set to '1', tunnel VLAN PRI field to
20282 * CoS mapping is requested to be enabled.
20283 */
20284 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_ENABLE UINT32_C(0x4)
20285 /*
20286 * When this bit is set to '1', the IP DSCP to CoS mapping is
20287 * requested to be enabled.
20288 */
20289 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_ENABLE UINT32_C(0x8)
20290 /*
20291 * When this bit is '1', the HWRM is requested to
20292 * enable timestamp capture capability on the receive side
20293 * of this port.
20294 */
20295 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE UINT32_C(0x10)
20296 /*
20297 * When this bit is '1', the HWRM is requested to
20298 * disable timestamp capture capability on the receive side
20299 * of this port.
20300 */
20301 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_DISABLE UINT32_C(0x20)
20302 /*
20303 * When this bit is '1', the HWRM is requested to
20304 * enable timestamp capture capability on the transmit side
20305 * of this port.
20306 */
20307 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE UINT32_C(0x40)
20308 /*
20309 * When this bit is '1', the HWRM is requested to
20310 * disable timestamp capture capability on the transmit side
20311 * of this port.
20312 */
20313 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_DISABLE UINT32_C(0x80)
20314 /*
20315 * When this bit is '1', the Out-Of-Box WoL is requested to
20316 * be enabled on this port.
20317 */
20318 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_ENABLE UINT32_C(0x100)
20319 /*
20320 * When this bit is '1', the Out-Of-Box WoL is requested to
20321 * be disabled on this port.
20322 */
20323 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_DISABLE UINT32_C(0x200)
20324 /*
20325 * When this bit is set to '1', the inner VLAN PRI to CoS mapping
20326 * is requested to be disabled.
20327 */
20328 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_DISABLE UINT32_C(0x400)
20329 /*
20330 * When this bit is set to '1', tunnel VLAN PRI field to
20331 * CoS mapping is requested to be disabled.
20332 */
20333 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_DISABLE UINT32_C(0x800)
20334 /*
20335 * When this bit is set to '1', the IP DSCP to CoS mapping is
20336 * requested to be disabled.
20337 */
20338 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_DISABLE UINT32_C(0x1000)
20339 /*
20340 * When this bit is set to '1', and the ptp_tx_ts_capture_enable
20341 * bit is set, then the device uses one step Tx timestamping.
20342 * This bit is temporary and used for experimental purposes.
20343 */
20344 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_ONE_STEP_TX_TS UINT32_C(0x2000)
20345 uint32_t enables;
20346 /*
20347 * This bit must be '1' for the ipg field to be
20348 * configured.
20349 */
20350 #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_IPG UINT32_C(0x1)
20351 /*
20352 * This bit must be '1' for the lpbk field to be
20353 * configured.
20354 */
20355 #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_LPBK UINT32_C(0x2)
20356 /*
20357 * This bit must be '1' for the vlan_pri2cos_map_pri field to be
20358 * configured.
20359 */
20360 #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_VLAN_PRI2COS_MAP_PRI UINT32_C(0x4)
20361 /*
20362 * This bit must be '1' for the tunnel_pri2cos_map_pri field to be
20363 * configured.
20364 */
20365 #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TUNNEL_PRI2COS_MAP_PRI UINT32_C(0x10)
20366 /*
20367 * This bit must be '1' for the dscp2cos_map_pri field to be
20368 * configured.
20369 */
20370 #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_DSCP2COS_MAP_PRI UINT32_C(0x20)
20371 /*
20372 * This bit must be '1' for the rx_ts_capture_ptp_msg_type field to be
20373 * configured.
20374 */
20375 #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_RX_TS_CAPTURE_PTP_MSG_TYPE UINT32_C(0x40)
20376 /*
20377 * This bit must be '1' for the tx_ts_capture_ptp_msg_type field to be
20378 * configured.
20379 */
20380 #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TX_TS_CAPTURE_PTP_MSG_TYPE UINT32_C(0x80)
20381 /*
20382 * This bit must be '1' for the cos_field_cfg field to be
20383 * configured.
20384 */
20385 #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_COS_FIELD_CFG UINT32_C(0x100)
20386 /*
20387 * This bit must be '1' for the ptp_freq_adj_ppb field to be
20388 * configured.
20389 */
20390 #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_PPB UINT32_C(0x200)
20391 /* Port ID of port that is to be configured. */
20392 uint16_t port_id;
20393 /*
20394 * This value is used to configure the minimum IPG that will
20395 * be sent between packets by this port.
20396 */
20397 uint8_t ipg;
20398 /* This value controls the loopback setting for the MAC. */
20399 uint8_t lpbk;
20400 /* No loopback is selected. Normal operation. */
20401 #define HWRM_PORT_MAC_CFG_INPUT_LPBK_NONE UINT32_C(0x0)
20402 /*
20403 * The HW will be configured with local loopback such that
20404 * host data is sent back to the host without modification.
20405 */
20406 #define HWRM_PORT_MAC_CFG_INPUT_LPBK_LOCAL UINT32_C(0x1)
20407 /*
20408 * The HW will be configured with remote loopback such that
20409 * port logic will send packets back out the transmitter that
20410 * are received.
20411 */
20412 #define HWRM_PORT_MAC_CFG_INPUT_LPBK_REMOTE UINT32_C(0x2)
20413 #define HWRM_PORT_MAC_CFG_INPUT_LPBK_LAST HWRM_PORT_MAC_CFG_INPUT_LPBK_REMOTE
20414 /*
20415 * This value controls the priority setting of VLAN PRI to CoS
20416 * mapping based on VLAN Tags of inner packet headers of
20417 * tunneled packets or packet headers of non-tunneled packets.
20418 *
20419 * # Each XXX_pri variable shall have a unique priority value
20420 * when it is being specified.
20421 * # When comparing priorities of mappings, higher value
20422 * indicates higher priority.
20423 * For example, a value of 0-3 is returned where 0 is being
20424 * the lowest priority and 3 is being the highest priority.
20425 */
20426 uint8_t vlan_pri2cos_map_pri;
20427 /* Reserved field. */
20428 uint8_t reserved1;
20429 /*
20430 * This value controls the priority setting of VLAN PRI to CoS
20431 * mapping based on VLAN Tags of tunneled header.
20432 * This mapping only applies when tunneled headers
20433 * are present.
20434 *
20435 * # Each XXX_pri variable shall have a unique priority value
20436 * when it is being specified.
20437 * # When comparing priorities of mappings, higher value
20438 * indicates higher priority.
20439 * For example, a value of 0-3 is returned where 0 is being
20440 * the lowest priority and 3 is being the highest priority.
20441 */
20442 uint8_t tunnel_pri2cos_map_pri;
20443 /*
20444 * This value controls the priority setting of IP DSCP to CoS
20445 * mapping based on inner IP header of tunneled packets or
20446 * IP header of non-tunneled packets.
20447 *
20448 * # Each XXX_pri variable shall have a unique priority value
20449 * when it is being specified.
20450 * # When comparing priorities of mappings, higher value
20451 * indicates higher priority.
20452 * For example, a value of 0-3 is returned where 0 is being
20453 * the lowest priority and 3 is being the highest priority.
20454 */
20455 uint8_t dscp2pri_map_pri;
20456 /*
20457 * This is a 16-bit bit mask that is used to request a
20458 * specific configuration of time stamp capture of PTP messages
20459 * on the receive side of this port.
20460 * This field shall be ignored if the ptp_rx_ts_capture_enable
20461 * flag is not set in this command.
20462 * Otherwise, if bit 'i' is set, then the HWRM is being
20463 * requested to configure the receive side of the port to
20464 * capture the time stamp of every received PTP message
20465 * with messageType field value set to i.
20466 */
20467 uint16_t rx_ts_capture_ptp_msg_type;
20468 /*
20469 * This is a 16-bit bit mask that is used to request a
20470 * specific configuration of time stamp capture of PTP messages
20471 * on the transmit side of this port.
20472 * This field shall be ignored if the ptp_tx_ts_capture_enable
20473 * flag is not set in this command.
20474 * Otherwise, if bit 'i' is set, then the HWRM is being
20475 * requested to configure the transmit side of the port to
20476 * capture the time stamp of every transmitted PTP message
20477 * with messageType field value set to i.
20478 */
20479 uint16_t tx_ts_capture_ptp_msg_type;
20480 /* Configuration of CoS fields. */
20481 uint8_t cos_field_cfg;
20482 /* Reserved */
20483 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_RSVD1 UINT32_C(0x1)
20484 /*
20485 * This field is used to specify selection of VLAN PRI value
20486 * based on whether one or two VLAN Tags are present in
20487 * the inner packet headers of tunneled packets or
20488 * non-tunneled packets.
20489 * This field is valid only if inner VLAN PRI to CoS mapping
20490 * is enabled.
20491 * If VLAN PRI to CoS mapping is not enabled, then this
20492 * field shall be ignored.
20493 */
20494 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK UINT32_C(0x6)
20495 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT 1
20496 /*
20497 * Select inner VLAN PRI when 1 or 2 VLAN Tags are
20498 * present in the inner packet headers
20499 */
20500 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST (UINT32_C(0x0) << 1)
20501 /*
20502 * Select outer VLAN Tag PRI when 2 VLAN Tags are
20503 * present in the inner packet headers.
20504 * No VLAN PRI shall be selected for this configuration
20505 * if only one VLAN Tag is present in the inner
20506 * packet headers.
20507 */
20508 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER (UINT32_C(0x1) << 1)
20509 /*
20510 * Select outermost VLAN PRI when 1 or 2 VLAN Tags
20511 * are present in the inner packet headers
20512 */
20513 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST (UINT32_C(0x2) << 1)
20514 /* Unspecified */
20515 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED (UINT32_C(0x3) << 1)
20516 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_LAST HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED
20517 /*
20518 * This field is used to specify selection of tunnel VLAN
20519 * PRI value based on whether one or two VLAN Tags are
20520 * present in tunnel headers.
20521 * This field is valid only if tunnel VLAN PRI to CoS mapping
20522 * is enabled.
20523 * If tunnel VLAN PRI to CoS mapping is not enabled, then this
20524 * field shall be ignored.
20525 */
20526 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK UINT32_C(0x18)
20527 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT 3
20528 /*
20529 * Select inner VLAN PRI when 1 or 2 VLAN Tags are
20530 * present in the tunnel packet headers
20531 */
20532 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST (UINT32_C(0x0) << 3)
20533 /*
20534 * Select outer VLAN Tag PRI when 2 VLAN Tags are
20535 * present in the tunnel packet headers.
20536 * No tunnel VLAN PRI shall be selected for this
20537 * configuration if only one VLAN Tag is present in
20538 * the tunnel packet headers.
20539 */
20540 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER (UINT32_C(0x1) << 3)
20541 /*
20542 * Select outermost VLAN PRI when 1 or 2 VLAN Tags
20543 * are present in the tunnel packet headers
20544 */
20545 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST (UINT32_C(0x2) << 3)
20546 /* Unspecified */
20547 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED (UINT32_C(0x3) << 3)
20548 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_LAST HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED
20549 /*
20550 * This field shall be used to provide default CoS value
20551 * that has been configured on this port.
20552 * This field is valid only if default CoS mapping
20553 * is enabled.
20554 * If default CoS mapping is not enabled, then this
20555 * field shall be ignored.
20556 */
20557 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_MASK UINT32_C(0xe0)
20558 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_SFT 5
20559 uint8_t unused_0[3];
20560 /*
20561 * This signed field specifies by how much to adjust the frequency
20562 * of sync timer updates (measured in parts per billion).
20563 */
20564 int32_t ptp_freq_adj_ppb;
20565 uint8_t unused_1[4];
20566 } hwrm_port_mac_cfg_input_t, *phwrm_port_mac_cfg_input_t;
20567
20568 /* hwrm_port_mac_cfg_output (size:128b/16B) */
20569
20570 typedef struct hwrm_port_mac_cfg_output {
20571 /* The specific error status for the command. */
20572 uint16_t error_code;
20573 /* The HWRM command request type. */
20574 uint16_t req_type;
20575 /* The sequence ID from the original command. */
20576 uint16_t seq_id;
20577 /* The length of the response data in number of bytes. */
20578 uint16_t resp_len;
20579 /*
20580 * This is the configured maximum length of Ethernet packet
20581 * payload that is allowed to be received on the port.
20582 * This value does not include the number of bytes used by
20583 * Ethernet header and trailer (CRC).
20584 */
20585 uint16_t mru;
20586 /*
20587 * This is the configured maximum length of Ethernet packet
20588 * payload that is allowed to be transmitted on the port.
20589 * This value does not include the number of bytes used by
20590 * Ethernet header and trailer (CRC).
20591 */
20592 uint16_t mtu;
20593 /* Current configuration of the IPG value. */
20594 uint8_t ipg;
20595 /* Current value of the loopback value. */
20596 uint8_t lpbk;
20597 /* No loopback is selected. Normal operation. */
20598 #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_NONE UINT32_C(0x0)
20599 /*
20600 * The HW will be configured with local loopback such that
20601 * host data is sent back to the host without modification.
20602 */
20603 #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_LOCAL UINT32_C(0x1)
20604 /*
20605 * The HW will be configured with remote loopback such that
20606 * port logic will send packets back out the transmitter that
20607 * are received.
20608 */
20609 #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
20610 #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_LAST HWRM_PORT_MAC_CFG_OUTPUT_LPBK_REMOTE
20611 uint8_t unused_0;
20612 /*
20613 * This field is used in Output records to indicate that the output
20614 * is completely written to RAM. This field should be read as '1'
20615 * to indicate that the output has been completely written.
20616 * When writing a command completion or response to an internal processor,
20617 * the order of writes has to be such that this field is written last.
20618 */
20619 uint8_t valid;
20620 } hwrm_port_mac_cfg_output_t, *phwrm_port_mac_cfg_output_t;
20621
20622 /**********************
20623 * hwrm_port_mac_qcfg *
20624 **********************/
20625
20626
20627 /* hwrm_port_mac_qcfg_input (size:192b/24B) */
20628
20629 typedef struct hwrm_port_mac_qcfg_input {
20630 /* The HWRM command request type. */
20631 uint16_t req_type;
20632 /*
20633 * The completion ring to send the completion event on. This should
20634 * be the NQ ID returned from the `nq_alloc` HWRM command.
20635 */
20636 uint16_t cmpl_ring;
20637 /*
20638 * The sequence ID is used by the driver for tracking multiple
20639 * commands. This ID is treated as opaque data by the firmware and
20640 * the value is returned in the `hwrm_resp_hdr` upon completion.
20641 */
20642 uint16_t seq_id;
20643 /*
20644 * The target ID of the command:
20645 * * 0x0-0xFFF8 - The function ID
20646 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
20647 * * 0xFFFD - Reserved for user-space HWRM interface
20648 * * 0xFFFF - HWRM
20649 */
20650 uint16_t target_id;
20651 /*
20652 * A physical address pointer pointing to a host buffer that the
20653 * command's response data will be written. This can be either a host
20654 * physical address (HPA) or a guest physical address (GPA) and must
20655 * point to a physically contiguous block of memory.
20656 */
20657 uint64_t resp_addr;
20658 /* Port ID of port that is to be configured. */
20659 uint16_t port_id;
20660 uint8_t unused_0[6];
20661 } hwrm_port_mac_qcfg_input_t, *phwrm_port_mac_qcfg_input_t;
20662
20663 /* hwrm_port_mac_qcfg_output (size:256b/32B) */
20664
20665 typedef struct hwrm_port_mac_qcfg_output {
20666 /* The specific error status for the command. */
20667 uint16_t error_code;
20668 /* The HWRM command request type. */
20669 uint16_t req_type;
20670 /* The sequence ID from the original command. */
20671 uint16_t seq_id;
20672 /* The length of the response data in number of bytes. */
20673 uint16_t resp_len;
20674 /*
20675 * This is the configured maximum length of Ethernet packet
20676 * payload that is allowed to be received on the port.
20677 * This value does not include the number of bytes used by the
20678 * Ethernet header and trailer (CRC).
20679 */
20680 uint16_t mru;
20681 /*
20682 * This is the configured maximum length of Ethernet packet
20683 * payload that is allowed to be transmitted on the port.
20684 * This value does not include the number of bytes used by the
20685 * Ethernet header and trailer (CRC).
20686 */
20687 uint16_t mtu;
20688 /*
20689 * The minimum IPG that will
20690 * be sent between packets by this port.
20691 */
20692 uint8_t ipg;
20693 /* The loopback setting for the MAC. */
20694 uint8_t lpbk;
20695 /* No loopback is selected. Normal operation. */
20696 #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_NONE UINT32_C(0x0)
20697 /*
20698 * The HW will be configured with local loopback such that
20699 * host data is sent back to the host without modification.
20700 */
20701 #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_LOCAL UINT32_C(0x1)
20702 /*
20703 * The HW will be configured with remote loopback such that
20704 * port logic will send packets back out the transmitter that
20705 * are received.
20706 */
20707 #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
20708 #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_LAST HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_REMOTE
20709 /*
20710 * Priority setting for VLAN PRI to CoS mapping.
20711 * # Each XXX_pri variable shall have a unique priority value
20712 * when it is being used.
20713 * # When comparing priorities of mappings, higher value
20714 * indicates higher priority.
20715 * For example, a value of 0-3 is returned where 0 is being
20716 * the lowest priority and 3 is being the highest priority.
20717 * # If the correspoding CoS mapping is not enabled, then this
20718 * field should be ignored.
20719 * # This value indicates the normalized priority value retained
20720 * in the HWRM.
20721 */
20722 uint8_t vlan_pri2cos_map_pri;
20723 /*
20724 * In this field, a number of CoS mappings related flags
20725 * are used to indicate configured CoS mappings.
20726 */
20727 uint8_t flags;
20728 /*
20729 * When this bit is set to '1', the inner VLAN PRI to CoS mapping
20730 * is enabled.
20731 */
20732 #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_VLAN_PRI2COS_ENABLE UINT32_C(0x1)
20733 /*
20734 * When this bit is set to '1', tunnel VLAN PRI field to
20735 * CoS mapping is enabled.
20736 */
20737 #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_TUNNEL_PRI2COS_ENABLE UINT32_C(0x2)
20738 /*
20739 * When this bit is set to '1', the IP DSCP to CoS mapping is
20740 * enabled.
20741 */
20742 #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_IP_DSCP2COS_ENABLE UINT32_C(0x4)
20743 /*
20744 * When this bit is '1', the Out-Of-Box WoL is enabled on this
20745 * port.
20746 */
20747 #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_OOB_WOL_ENABLE UINT32_C(0x8)
20748 /* When this bit is '1', PTP is enabled for RX on this port. */
20749 #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE UINT32_C(0x10)
20750 /* When this bit is '1', PTP is enabled for TX on this port. */
20751 #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE UINT32_C(0x20)
20752 /*
20753 * Priority setting for tunnel VLAN PRI to CoS mapping.
20754 * # Each XXX_pri variable shall have a unique priority value
20755 * when it is being used.
20756 * # When comparing priorities of mappings, higher value
20757 * indicates higher priority.
20758 * For example, a value of 0-3 is returned where 0 is being
20759 * the lowest priority and 3 is being the highest priority.
20760 * # If the correspoding CoS mapping is not enabled, then this
20761 * field should be ignored.
20762 * # This value indicates the normalized priority value retained
20763 * in the HWRM.
20764 */
20765 uint8_t tunnel_pri2cos_map_pri;
20766 /*
20767 * Priority setting for DSCP to PRI mapping.
20768 * # Each XXX_pri variable shall have a unique priority value
20769 * when it is being used.
20770 * # When comparing priorities of mappings, higher value
20771 * indicates higher priority.
20772 * For example, a value of 0-3 is returned where 0 is being
20773 * the lowest priority and 3 is being the highest priority.
20774 * # If the correspoding CoS mapping is not enabled, then this
20775 * field should be ignored.
20776 * # This value indicates the normalized priority value retained
20777 * in the HWRM.
20778 */
20779 uint8_t dscp2pri_map_pri;
20780 /*
20781 * This is a 16-bit bit mask that represents the
20782 * current configuration of time stamp capture of PTP messages
20783 * on the receive side of this port.
20784 * If bit 'i' is set, then the receive side of the port
20785 * is configured to capture the time stamp of every
20786 * received PTP message with messageType field value set
20787 * to i.
20788 * If all bits are set to 0 (i.e. field value set 0),
20789 * then the receive side of the port is not configured
20790 * to capture timestamp for PTP messages.
20791 * If all bits are set to 1, then the receive side of the
20792 * port is configured to capture timestamp for all PTP
20793 * messages.
20794 */
20795 uint16_t rx_ts_capture_ptp_msg_type;
20796 /*
20797 * This is a 16-bit bit mask that represents the
20798 * current configuration of time stamp capture of PTP messages
20799 * on the transmit side of this port.
20800 * If bit 'i' is set, then the transmit side of the port
20801 * is configured to capture the time stamp of every
20802 * received PTP message with messageType field value set
20803 * to i.
20804 * If all bits are set to 0 (i.e. field value set 0),
20805 * then the transmit side of the port is not configured
20806 * to capture timestamp for PTP messages.
20807 * If all bits are set to 1, then the transmit side of the
20808 * port is configured to capture timestamp for all PTP
20809 * messages.
20810 */
20811 uint16_t tx_ts_capture_ptp_msg_type;
20812 /* Configuration of CoS fields. */
20813 uint8_t cos_field_cfg;
20814 /* Reserved */
20815 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_RSVD UINT32_C(0x1)
20816 /*
20817 * This field is used for selecting VLAN PRI value
20818 * based on whether one or two VLAN Tags are present in
20819 * the inner packet headers of tunneled packets or
20820 * non-tunneled packets.
20821 */
20822 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK UINT32_C(0x6)
20823 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT 1
20824 /*
20825 * Select inner VLAN PRI when 1 or 2 VLAN Tags are
20826 * present in the inner packet headers
20827 */
20828 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST (UINT32_C(0x0) << 1)
20829 /*
20830 * Select outer VLAN Tag PRI when 2 VLAN Tags are
20831 * present in the inner packet headers.
20832 * No VLAN PRI is selected for this configuration
20833 * if only one VLAN Tag is present in the inner
20834 * packet headers.
20835 */
20836 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER (UINT32_C(0x1) << 1)
20837 /*
20838 * Select outermost VLAN PRI when 1 or 2 VLAN Tags
20839 * are present in the inner packet headers
20840 */
20841 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST (UINT32_C(0x2) << 1)
20842 /* Unspecified */
20843 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED (UINT32_C(0x3) << 1)
20844 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_LAST HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED
20845 /*
20846 * This field is used for selecting tunnel VLAN PRI value
20847 * based on whether one or two VLAN Tags are present in
20848 * the tunnel headers of tunneled packets. This selection
20849 * does not apply to non-tunneled packets.
20850 */
20851 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK UINT32_C(0x18)
20852 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT 3
20853 /*
20854 * Select inner VLAN PRI when 1 or 2 VLAN Tags are
20855 * present in the tunnel packet headers
20856 */
20857 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST (UINT32_C(0x0) << 3)
20858 /*
20859 * Select outer VLAN Tag PRI when 2 VLAN Tags are
20860 * present in the tunnel packet headers.
20861 * No VLAN PRI is selected for this configuration
20862 * if only one VLAN Tag is present in the tunnel
20863 * packet headers.
20864 */
20865 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER (UINT32_C(0x1) << 3)
20866 /*
20867 * Select outermost VLAN PRI when 1 or 2 VLAN Tags
20868 * are present in the tunnel packet headers
20869 */
20870 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST (UINT32_C(0x2) << 3)
20871 /* Unspecified */
20872 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED (UINT32_C(0x3) << 3)
20873 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_LAST HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED
20874 /*
20875 * This field is used to provide default CoS value that
20876 * has been configured on this port.
20877 */
20878 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_MASK UINT32_C(0xe0)
20879 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_SFT 5
20880 uint8_t unused_1;
20881 uint16_t port_svif_info;
20882 /*
20883 * This field specifies the source virtual interface of the port being
20884 * queried. Drivers can use this to program port svif field in the
20885 * L2 context table
20886 */
20887 #define HWRM_PORT_MAC_QCFG_OUTPUT_PORT_SVIF_INFO_PORT_SVIF_MASK UINT32_C(0x7fff)
20888 #define HWRM_PORT_MAC_QCFG_OUTPUT_PORT_SVIF_INFO_PORT_SVIF_SFT 0
20889 /* This field specifies whether port_svif is valid or not */
20890 #define HWRM_PORT_MAC_QCFG_OUTPUT_PORT_SVIF_INFO_PORT_SVIF_VALID UINT32_C(0x8000)
20891 uint8_t unused_2[5];
20892 /*
20893 * This field is used in Output records to indicate that the output
20894 * is completely written to RAM. This field should be read as '1'
20895 * to indicate that the output has been completely written.
20896 * When writing a command completion or response to an internal processor,
20897 * the order of writes has to be such that this field is written last.
20898 */
20899 uint8_t valid;
20900 } hwrm_port_mac_qcfg_output_t, *phwrm_port_mac_qcfg_output_t;
20901
20902 /**************************
20903 * hwrm_port_mac_ptp_qcfg *
20904 **************************/
20905
20906
20907 /* hwrm_port_mac_ptp_qcfg_input (size:192b/24B) */
20908
20909 typedef struct hwrm_port_mac_ptp_qcfg_input {
20910 /* The HWRM command request type. */
20911 uint16_t req_type;
20912 /*
20913 * The completion ring to send the completion event on. This should
20914 * be the NQ ID returned from the `nq_alloc` HWRM command.
20915 */
20916 uint16_t cmpl_ring;
20917 /*
20918 * The sequence ID is used by the driver for tracking multiple
20919 * commands. This ID is treated as opaque data by the firmware and
20920 * the value is returned in the `hwrm_resp_hdr` upon completion.
20921 */
20922 uint16_t seq_id;
20923 /*
20924 * The target ID of the command:
20925 * * 0x0-0xFFF8 - The function ID
20926 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
20927 * * 0xFFFD - Reserved for user-space HWRM interface
20928 * * 0xFFFF - HWRM
20929 */
20930 uint16_t target_id;
20931 /*
20932 * A physical address pointer pointing to a host buffer that the
20933 * command's response data will be written. This can be either a host
20934 * physical address (HPA) or a guest physical address (GPA) and must
20935 * point to a physically contiguous block of memory.
20936 */
20937 uint64_t resp_addr;
20938 /* Port ID of port that is being queried. */
20939 uint16_t port_id;
20940 uint8_t unused_0[6];
20941 } hwrm_port_mac_ptp_qcfg_input_t, *phwrm_port_mac_ptp_qcfg_input_t;
20942
20943 /* hwrm_port_mac_ptp_qcfg_output (size:640b/80B) */
20944
20945 typedef struct hwrm_port_mac_ptp_qcfg_output {
20946 /* The specific error status for the command. */
20947 uint16_t error_code;
20948 /* The HWRM command request type. */
20949 uint16_t req_type;
20950 /* The sequence ID from the original command. */
20951 uint16_t seq_id;
20952 /* The length of the response data in number of bytes. */
20953 uint16_t resp_len;
20954 /*
20955 * In this field, a number of PTP related flags
20956 * are used to indicate configured PTP capabilities.
20957 */
20958 uint8_t flags;
20959 /*
20960 * When this bit is set to '1', the PTP related registers are
20961 * directly accessible by the host.
20962 */
20963 #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_DIRECT_ACCESS UINT32_C(0x1)
20964 /*
20965 * When this bit is set to '1', the device supports one-step
20966 * Tx timestamping.
20967 */
20968 #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_ONE_STEP_TX_TS UINT32_C(0x4)
20969 /*
20970 * When this bit is set to '1', the PTP information is accessible
20971 * via HWRM commands.
20972 */
20973 #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_HWRM_ACCESS UINT32_C(0x8)
20974 uint8_t unused_0[3];
20975 /* Offset of the PTP register for the lower 32 bits of timestamp for RX. */
20976 uint32_t rx_ts_reg_off_lower;
20977 /* Offset of the PTP register for the upper 32 bits of timestamp for RX. */
20978 uint32_t rx_ts_reg_off_upper;
20979 /* Offset of the PTP register for the sequence ID for RX. */
20980 uint32_t rx_ts_reg_off_seq_id;
20981 /* Offset of the first PTP source ID for RX. */
20982 uint32_t rx_ts_reg_off_src_id_0;
20983 /* Offset of the second PTP source ID for RX. */
20984 uint32_t rx_ts_reg_off_src_id_1;
20985 /* Offset of the third PTP source ID for RX. */
20986 uint32_t rx_ts_reg_off_src_id_2;
20987 /* Offset of the domain ID for RX. */
20988 uint32_t rx_ts_reg_off_domain_id;
20989 /* Offset of the PTP FIFO register for RX. */
20990 uint32_t rx_ts_reg_off_fifo;
20991 /* Offset of the PTP advance FIFO register for RX. */
20992 uint32_t rx_ts_reg_off_fifo_adv;
20993 /* PTP timestamp granularity for RX. */
20994 uint32_t rx_ts_reg_off_granularity;
20995 /* Offset of the PTP register for the lower 32 bits of timestamp for TX. */
20996 uint32_t tx_ts_reg_off_lower;
20997 /* Offset of the PTP register for the upper 32 bits of timestamp for TX. */
20998 uint32_t tx_ts_reg_off_upper;
20999 /* Offset of the PTP register for the sequence ID for TX. */
21000 uint32_t tx_ts_reg_off_seq_id;
21001 /* Offset of the PTP FIFO register for TX. */
21002 uint32_t tx_ts_reg_off_fifo;
21003 /* PTP timestamp granularity for TX. */
21004 uint32_t tx_ts_reg_off_granularity;
21005 uint8_t unused_1[7];
21006 /*
21007 * This field is used in Output records to indicate that the output
21008 * is completely written to RAM. This field should be read as '1'
21009 * to indicate that the output has been completely written.
21010 * When writing a command completion or response to an internal processor,
21011 * the order of writes has to be such that this field is written last.
21012 */
21013 uint8_t valid;
21014 } hwrm_port_mac_ptp_qcfg_output_t, *phwrm_port_mac_ptp_qcfg_output_t;
21015
21016 /* Port Tx Statistics Format */
21017 /* tx_port_stats (size:3264b/408B) */
21018
21019 typedef struct tx_port_stats {
21020 /* Total Number of 64 Bytes frames transmitted */
21021 uint64_t tx_64b_frames;
21022 /* Total Number of 65-127 Bytes frames transmitted */
21023 uint64_t tx_65b_127b_frames;
21024 /* Total Number of 128-255 Bytes frames transmitted */
21025 uint64_t tx_128b_255b_frames;
21026 /* Total Number of 256-511 Bytes frames transmitted */
21027 uint64_t tx_256b_511b_frames;
21028 /* Total Number of 512-1023 Bytes frames transmitted */
21029 uint64_t tx_512b_1023b_frames;
21030 /* Total Number of 1024-1518 Bytes frames transmitted */
21031 uint64_t tx_1024b_1518b_frames;
21032 /*
21033 * Total Number of each good VLAN (exludes FCS errors)
21034 * frame transmitted which is 1519 to 1522 bytes in length
21035 * inclusive (excluding framing bits but including FCS bytes).
21036 */
21037 uint64_t tx_good_vlan_frames;
21038 /* Total Number of 1519-2047 Bytes frames transmitted */
21039 uint64_t tx_1519b_2047b_frames;
21040 /* Total Number of 2048-4095 Bytes frames transmitted */
21041 uint64_t tx_2048b_4095b_frames;
21042 /* Total Number of 4096-9216 Bytes frames transmitted */
21043 uint64_t tx_4096b_9216b_frames;
21044 /* Total Number of 9217-16383 Bytes frames transmitted */
21045 uint64_t tx_9217b_16383b_frames;
21046 /* Total Number of good frames transmitted */
21047 uint64_t tx_good_frames;
21048 /* Total Number of frames transmitted */
21049 uint64_t tx_total_frames;
21050 /* Total number of unicast frames transmitted */
21051 uint64_t tx_ucast_frames;
21052 /* Total number of multicast frames transmitted */
21053 uint64_t tx_mcast_frames;
21054 /* Total number of broadcast frames transmitted */
21055 uint64_t tx_bcast_frames;
21056 /* Total number of PAUSE control frames transmitted */
21057 uint64_t tx_pause_frames;
21058 /*
21059 * Total number of PFC/per-priority PAUSE
21060 * control frames transmitted
21061 */
21062 uint64_t tx_pfc_frames;
21063 /* Total number of jabber frames transmitted */
21064 uint64_t tx_jabber_frames;
21065 /* Total number of frames transmitted with FCS error */
21066 uint64_t tx_fcs_err_frames;
21067 /* Total number of control frames transmitted */
21068 uint64_t tx_control_frames;
21069 /* Total number of over-sized frames transmitted */
21070 uint64_t tx_oversz_frames;
21071 /* Total number of frames with single deferral */
21072 uint64_t tx_single_dfrl_frames;
21073 /* Total number of frames with multiple deferrals */
21074 uint64_t tx_multi_dfrl_frames;
21075 /* Total number of frames with single collision */
21076 uint64_t tx_single_coll_frames;
21077 /* Total number of frames with multiple collisions */
21078 uint64_t tx_multi_coll_frames;
21079 /* Total number of frames with late collisions */
21080 uint64_t tx_late_coll_frames;
21081 /* Total number of frames with excessive collisions */
21082 uint64_t tx_excessive_coll_frames;
21083 /* Total number of fragmented frames transmitted */
21084 uint64_t tx_frag_frames;
21085 /* Total number of transmit errors */
21086 uint64_t tx_err;
21087 /* Total number of single VLAN tagged frames transmitted */
21088 uint64_t tx_tagged_frames;
21089 /* Total number of double VLAN tagged frames transmitted */
21090 uint64_t tx_dbl_tagged_frames;
21091 /* Total number of runt frames transmitted */
21092 uint64_t tx_runt_frames;
21093 /* Total number of TX FIFO under runs */
21094 uint64_t tx_fifo_underruns;
21095 /*
21096 * Total number of PFC frames with PFC enabled bit for
21097 * Pri 0 transmitted
21098 */
21099 uint64_t tx_pfc_ena_frames_pri0;
21100 /*
21101 * Total number of PFC frames with PFC enabled bit for
21102 * Pri 1 transmitted
21103 */
21104 uint64_t tx_pfc_ena_frames_pri1;
21105 /*
21106 * Total number of PFC frames with PFC enabled bit for
21107 * Pri 2 transmitted
21108 */
21109 uint64_t tx_pfc_ena_frames_pri2;
21110 /*
21111 * Total number of PFC frames with PFC enabled bit for
21112 * Pri 3 transmitted
21113 */
21114 uint64_t tx_pfc_ena_frames_pri3;
21115 /*
21116 * Total number of PFC frames with PFC enabled bit for
21117 * Pri 4 transmitted
21118 */
21119 uint64_t tx_pfc_ena_frames_pri4;
21120 /*
21121 * Total number of PFC frames with PFC enabled bit for
21122 * Pri 5 transmitted
21123 */
21124 uint64_t tx_pfc_ena_frames_pri5;
21125 /*
21126 * Total number of PFC frames with PFC enabled bit for
21127 * Pri 6 transmitted
21128 */
21129 uint64_t tx_pfc_ena_frames_pri6;
21130 /*
21131 * Total number of PFC frames with PFC enabled bit for
21132 * Pri 7 transmitted
21133 */
21134 uint64_t tx_pfc_ena_frames_pri7;
21135 /* Total number of EEE LPI Events on TX */
21136 uint64_t tx_eee_lpi_events;
21137 /* EEE LPI Duration Counter on TX */
21138 uint64_t tx_eee_lpi_duration;
21139 /*
21140 * Total number of Link Level Flow Control (LLFC) messages
21141 * transmitted
21142 */
21143 uint64_t tx_llfc_logical_msgs;
21144 /* Total number of HCFC messages transmitted */
21145 uint64_t tx_hcfc_msgs;
21146 /* Total number of TX collisions */
21147 uint64_t tx_total_collisions;
21148 /* Total number of transmitted bytes */
21149 uint64_t tx_bytes;
21150 /* Total number of end-to-end HOL frames */
21151 uint64_t tx_xthol_frames;
21152 /* Total Tx Drops per Port reported by STATS block */
21153 uint64_t tx_stat_discard;
21154 /* Total Tx Error Drops per Port reported by STATS block */
21155 uint64_t tx_stat_error;
21156 } tx_port_stats_t, *ptx_port_stats_t;
21157
21158 /* Port Rx Statistics Format */
21159 /* rx_port_stats (size:4224b/528B) */
21160
21161 typedef struct rx_port_stats {
21162 /* Total Number of 64 Bytes frames received */
21163 uint64_t rx_64b_frames;
21164 /* Total Number of 65-127 Bytes frames received */
21165 uint64_t rx_65b_127b_frames;
21166 /* Total Number of 128-255 Bytes frames received */
21167 uint64_t rx_128b_255b_frames;
21168 /* Total Number of 256-511 Bytes frames received */
21169 uint64_t rx_256b_511b_frames;
21170 /* Total Number of 512-1023 Bytes frames received */
21171 uint64_t rx_512b_1023b_frames;
21172 /* Total Number of 1024-1518 Bytes frames received */
21173 uint64_t rx_1024b_1518b_frames;
21174 /*
21175 * Total Number of each good VLAN (exludes FCS errors)
21176 * frame received which is 1519 to 1522 bytes in length
21177 * inclusive (excluding framing bits but including FCS bytes).
21178 */
21179 uint64_t rx_good_vlan_frames;
21180 /* Total Number of 1519-2047 Bytes frames received */
21181 uint64_t rx_1519b_2047b_frames;
21182 /* Total Number of 2048-4095 Bytes frames received */
21183 uint64_t rx_2048b_4095b_frames;
21184 /* Total Number of 4096-9216 Bytes frames received */
21185 uint64_t rx_4096b_9216b_frames;
21186 /* Total Number of 9217-16383 Bytes frames received */
21187 uint64_t rx_9217b_16383b_frames;
21188 /* Total number of frames received */
21189 uint64_t rx_total_frames;
21190 /* Total number of unicast frames received */
21191 uint64_t rx_ucast_frames;
21192 /* Total number of multicast frames received */
21193 uint64_t rx_mcast_frames;
21194 /* Total number of broadcast frames received */
21195 uint64_t rx_bcast_frames;
21196 /* Total number of received frames with FCS error */
21197 uint64_t rx_fcs_err_frames;
21198 /* Total number of control frames received */
21199 uint64_t rx_ctrl_frames;
21200 /* Total number of PAUSE frames received */
21201 uint64_t rx_pause_frames;
21202 /* Total number of PFC frames received */
21203 uint64_t rx_pfc_frames;
21204 /*
21205 * Total number of frames received with an unsupported
21206 * opcode
21207 */
21208 uint64_t rx_unsupported_opcode_frames;
21209 /*
21210 * Total number of frames received with an unsupported
21211 * DA for pause and PFC
21212 */
21213 uint64_t rx_unsupported_da_pausepfc_frames;
21214 /* Total number of frames received with an unsupported SA */
21215 uint64_t rx_wrong_sa_frames;
21216 /* Total number of received packets with alignment error */
21217 uint64_t rx_align_err_frames;
21218 /* Total number of received frames with out-of-range length */
21219 uint64_t rx_oor_len_frames;
21220 /* Total number of received frames with error termination */
21221 uint64_t rx_code_err_frames;
21222 /*
21223 * Total number of received frames with a false carrier is
21224 * detected during idle, as defined by RX_ER samples active
21225 * and RXD is 0xE. The event is reported along with the
21226 * statistics generated on the next received frame. Only
21227 * one false carrier condition can be detected and logged
21228 * between frames.
21229 *
21230 * Carrier event, valid for 10M/100M speed modes only.
21231 */
21232 uint64_t rx_false_carrier_frames;
21233 /* Total number of over-sized frames received */
21234 uint64_t rx_ovrsz_frames;
21235 /* Total number of jabber packets received */
21236 uint64_t rx_jbr_frames;
21237 /* Total number of received frames with MTU error */
21238 uint64_t rx_mtu_err_frames;
21239 /* Total number of received frames with CRC match */
21240 uint64_t rx_match_crc_frames;
21241 /* Total number of frames received promiscuously */
21242 uint64_t rx_promiscuous_frames;
21243 /*
21244 * Total number of received frames with one or two VLAN
21245 * tags
21246 */
21247 uint64_t rx_tagged_frames;
21248 /* Total number of received frames with two VLAN tags */
21249 uint64_t rx_double_tagged_frames;
21250 /* Total number of truncated frames received */
21251 uint64_t rx_trunc_frames;
21252 /* Total number of good frames (without errors) received */
21253 uint64_t rx_good_frames;
21254 /*
21255 * Total number of received PFC frames with transition from
21256 * XON to XOFF on Pri 0
21257 */
21258 uint64_t rx_pfc_xon2xoff_frames_pri0;
21259 /*
21260 * Total number of received PFC frames with transition from
21261 * XON to XOFF on Pri 1
21262 */
21263 uint64_t rx_pfc_xon2xoff_frames_pri1;
21264 /*
21265 * Total number of received PFC frames with transition from
21266 * XON to XOFF on Pri 2
21267 */
21268 uint64_t rx_pfc_xon2xoff_frames_pri2;
21269 /*
21270 * Total number of received PFC frames with transition from
21271 * XON to XOFF on Pri 3
21272 */
21273 uint64_t rx_pfc_xon2xoff_frames_pri3;
21274 /*
21275 * Total number of received PFC frames with transition from
21276 * XON to XOFF on Pri 4
21277 */
21278 uint64_t rx_pfc_xon2xoff_frames_pri4;
21279 /*
21280 * Total number of received PFC frames with transition from
21281 * XON to XOFF on Pri 5
21282 */
21283 uint64_t rx_pfc_xon2xoff_frames_pri5;
21284 /*
21285 * Total number of received PFC frames with transition from
21286 * XON to XOFF on Pri 6
21287 */
21288 uint64_t rx_pfc_xon2xoff_frames_pri6;
21289 /*
21290 * Total number of received PFC frames with transition from
21291 * XON to XOFF on Pri 7
21292 */
21293 uint64_t rx_pfc_xon2xoff_frames_pri7;
21294 /*
21295 * Total number of received PFC frames with PFC enabled
21296 * bit for Pri 0
21297 */
21298 uint64_t rx_pfc_ena_frames_pri0;
21299 /*
21300 * Total number of received PFC frames with PFC enabled
21301 * bit for Pri 1
21302 */
21303 uint64_t rx_pfc_ena_frames_pri1;
21304 /*
21305 * Total number of received PFC frames with PFC enabled
21306 * bit for Pri 2
21307 */
21308 uint64_t rx_pfc_ena_frames_pri2;
21309 /*
21310 * Total number of received PFC frames with PFC enabled
21311 * bit for Pri 3
21312 */
21313 uint64_t rx_pfc_ena_frames_pri3;
21314 /*
21315 * Total number of received PFC frames with PFC enabled
21316 * bit for Pri 4
21317 */
21318 uint64_t rx_pfc_ena_frames_pri4;
21319 /*
21320 * Total number of received PFC frames with PFC enabled
21321 * bit for Pri 5
21322 */
21323 uint64_t rx_pfc_ena_frames_pri5;
21324 /*
21325 * Total number of received PFC frames with PFC enabled
21326 * bit for Pri 6
21327 */
21328 uint64_t rx_pfc_ena_frames_pri6;
21329 /*
21330 * Total number of received PFC frames with PFC enabled
21331 * bit for Pri 7
21332 */
21333 uint64_t rx_pfc_ena_frames_pri7;
21334 /* Total Number of frames received with SCH CRC error */
21335 uint64_t rx_sch_crc_err_frames;
21336 /* Total Number of under-sized frames received */
21337 uint64_t rx_undrsz_frames;
21338 /* Total Number of fragmented frames received */
21339 uint64_t rx_frag_frames;
21340 /* Total number of RX EEE LPI Events */
21341 uint64_t rx_eee_lpi_events;
21342 /* EEE LPI Duration Counter on RX */
21343 uint64_t rx_eee_lpi_duration;
21344 /*
21345 * Total number of physical type Link Level Flow Control
21346 * (LLFC) messages received
21347 */
21348 uint64_t rx_llfc_physical_msgs;
21349 /*
21350 * Total number of logical type Link Level Flow Control
21351 * (LLFC) messages received
21352 */
21353 uint64_t rx_llfc_logical_msgs;
21354 /*
21355 * Total number of logical type Link Level Flow Control
21356 * (LLFC) messages received with CRC error
21357 */
21358 uint64_t rx_llfc_msgs_with_crc_err;
21359 /* Total number of HCFC messages received */
21360 uint64_t rx_hcfc_msgs;
21361 /* Total number of HCFC messages received with CRC error */
21362 uint64_t rx_hcfc_msgs_with_crc_err;
21363 /* Total number of received bytes */
21364 uint64_t rx_bytes;
21365 /* Total number of bytes received in runt frames */
21366 uint64_t rx_runt_bytes;
21367 /* Total number of runt frames received */
21368 uint64_t rx_runt_frames;
21369 /* Total Rx Discards per Port reported by STATS block */
21370 uint64_t rx_stat_discard;
21371 uint64_t rx_stat_err;
21372 } rx_port_stats_t, *prx_port_stats_t;
21373
21374 /********************
21375 * hwrm_port_qstats *
21376 ********************/
21377
21378
21379 /* hwrm_port_qstats_input (size:320b/40B) */
21380
21381 typedef struct hwrm_port_qstats_input {
21382 /* The HWRM command request type. */
21383 uint16_t req_type;
21384 /*
21385 * The completion ring to send the completion event on. This should
21386 * be the NQ ID returned from the `nq_alloc` HWRM command.
21387 */
21388 uint16_t cmpl_ring;
21389 /*
21390 * The sequence ID is used by the driver for tracking multiple
21391 * commands. This ID is treated as opaque data by the firmware and
21392 * the value is returned in the `hwrm_resp_hdr` upon completion.
21393 */
21394 uint16_t seq_id;
21395 /*
21396 * The target ID of the command:
21397 * * 0x0-0xFFF8 - The function ID
21398 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21399 * * 0xFFFD - Reserved for user-space HWRM interface
21400 * * 0xFFFF - HWRM
21401 */
21402 uint16_t target_id;
21403 /*
21404 * A physical address pointer pointing to a host buffer that the
21405 * command's response data will be written. This can be either a host
21406 * physical address (HPA) or a guest physical address (GPA) and must
21407 * point to a physically contiguous block of memory.
21408 */
21409 uint64_t resp_addr;
21410 /* Port ID of port that is being queried. */
21411 uint16_t port_id;
21412 uint8_t flags;
21413 /* This value is not used to avoid backward compatibility issues. */
21414 #define HWRM_PORT_QSTATS_INPUT_FLAGS_UNUSED UINT32_C(0x0)
21415 /*
21416 * This bit is set to 1 when request is for a counter mask,
21417 * representing the width of each of the stats counters, rather
21418 * than counters themselves.
21419 */
21420 #define HWRM_PORT_QSTATS_INPUT_FLAGS_COUNTER_MASK UINT32_C(0x1)
21421 #define HWRM_PORT_QSTATS_INPUT_FLAGS_LAST HWRM_PORT_QSTATS_INPUT_FLAGS_COUNTER_MASK
21422 uint8_t unused_0[5];
21423 /*
21424 * This is the host address where
21425 * Tx port statistics will be stored
21426 */
21427 uint64_t tx_stat_host_addr;
21428 /*
21429 * This is the host address where
21430 * Rx port statistics will be stored
21431 */
21432 uint64_t rx_stat_host_addr;
21433 } hwrm_port_qstats_input_t, *phwrm_port_qstats_input_t;
21434
21435 /* hwrm_port_qstats_output (size:128b/16B) */
21436
21437 typedef struct hwrm_port_qstats_output {
21438 /* The specific error status for the command. */
21439 uint16_t error_code;
21440 /* The HWRM command request type. */
21441 uint16_t req_type;
21442 /* The sequence ID from the original command. */
21443 uint16_t seq_id;
21444 /* The length of the response data in number of bytes. */
21445 uint16_t resp_len;
21446 /* The size of TX port statistics block in bytes. */
21447 uint16_t tx_stat_size;
21448 /* The size of RX port statistics block in bytes. */
21449 uint16_t rx_stat_size;
21450 uint8_t unused_0[3];
21451 /*
21452 * This field is used in Output records to indicate that the output
21453 * is completely written to RAM. This field should be read as '1'
21454 * to indicate that the output has been completely written.
21455 * When writing a command completion or response to an internal processor,
21456 * the order of writes has to be such that this field is written last.
21457 */
21458 uint8_t valid;
21459 } hwrm_port_qstats_output_t, *phwrm_port_qstats_output_t;
21460
21461 /* Port Tx Statistics extended Format */
21462 /* tx_port_stats_ext (size:2048b/256B) */
21463
21464 typedef struct tx_port_stats_ext {
21465 /* Total number of tx bytes count on cos queue 0 */
21466 uint64_t tx_bytes_cos0;
21467 /* Total number of tx bytes count on cos queue 1 */
21468 uint64_t tx_bytes_cos1;
21469 /* Total number of tx bytes count on cos queue 2 */
21470 uint64_t tx_bytes_cos2;
21471 /* Total number of tx bytes count on cos queue 3 */
21472 uint64_t tx_bytes_cos3;
21473 /* Total number of tx bytes count on cos queue 4 */
21474 uint64_t tx_bytes_cos4;
21475 /* Total number of tx bytes count on cos queue 5 */
21476 uint64_t tx_bytes_cos5;
21477 /* Total number of tx bytes count on cos queue 6 */
21478 uint64_t tx_bytes_cos6;
21479 /* Total number of tx bytes count on cos queue 7 */
21480 uint64_t tx_bytes_cos7;
21481 /* Total number of tx packets count on cos queue 0 */
21482 uint64_t tx_packets_cos0;
21483 /* Total number of tx packets count on cos queue 1 */
21484 uint64_t tx_packets_cos1;
21485 /* Total number of tx packets count on cos queue 2 */
21486 uint64_t tx_packets_cos2;
21487 /* Total number of tx packets count on cos queue 3 */
21488 uint64_t tx_packets_cos3;
21489 /* Total number of tx packets count on cos queue 4 */
21490 uint64_t tx_packets_cos4;
21491 /* Total number of tx packets count on cos queue 5 */
21492 uint64_t tx_packets_cos5;
21493 /* Total number of tx packets count on cos queue 6 */
21494 uint64_t tx_packets_cos6;
21495 /* Total number of tx packets count on cos queue 7 */
21496 uint64_t tx_packets_cos7;
21497 /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 0 */
21498 uint64_t pfc_pri0_tx_duration_us;
21499 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 0 */
21500 uint64_t pfc_pri0_tx_transitions;
21501 /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 1 */
21502 uint64_t pfc_pri1_tx_duration_us;
21503 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 1 */
21504 uint64_t pfc_pri1_tx_transitions;
21505 /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 2 */
21506 uint64_t pfc_pri2_tx_duration_us;
21507 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 2 */
21508 uint64_t pfc_pri2_tx_transitions;
21509 /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 3 */
21510 uint64_t pfc_pri3_tx_duration_us;
21511 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 3 */
21512 uint64_t pfc_pri3_tx_transitions;
21513 /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 4 */
21514 uint64_t pfc_pri4_tx_duration_us;
21515 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 4 */
21516 uint64_t pfc_pri4_tx_transitions;
21517 /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 5 */
21518 uint64_t pfc_pri5_tx_duration_us;
21519 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 5 */
21520 uint64_t pfc_pri5_tx_transitions;
21521 /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 6 */
21522 uint64_t pfc_pri6_tx_duration_us;
21523 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 6 */
21524 uint64_t pfc_pri6_tx_transitions;
21525 /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 7 */
21526 uint64_t pfc_pri7_tx_duration_us;
21527 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 7 */
21528 uint64_t pfc_pri7_tx_transitions;
21529 } tx_port_stats_ext_t, *ptx_port_stats_ext_t;
21530
21531 /* Port Rx Statistics extended Format */
21532 /* rx_port_stats_ext (size:3648b/456B) */
21533
21534 typedef struct rx_port_stats_ext {
21535 /* Number of times link state changed to down */
21536 uint64_t link_down_events;
21537 /* Number of times the idle rings with pause bit are found */
21538 uint64_t continuous_pause_events;
21539 /* Number of times the active rings pause bit resumed back */
21540 uint64_t resume_pause_events;
21541 /* Number of times, the ROCE cos queue PFC is disabled to avoid pause flood/burst */
21542 uint64_t continuous_roce_pause_events;
21543 /* Number of times, the ROCE cos queue PFC is enabled back */
21544 uint64_t resume_roce_pause_events;
21545 /* Total number of rx bytes count on cos queue 0 */
21546 uint64_t rx_bytes_cos0;
21547 /* Total number of rx bytes count on cos queue 1 */
21548 uint64_t rx_bytes_cos1;
21549 /* Total number of rx bytes count on cos queue 2 */
21550 uint64_t rx_bytes_cos2;
21551 /* Total number of rx bytes count on cos queue 3 */
21552 uint64_t rx_bytes_cos3;
21553 /* Total number of rx bytes count on cos queue 4 */
21554 uint64_t rx_bytes_cos4;
21555 /* Total number of rx bytes count on cos queue 5 */
21556 uint64_t rx_bytes_cos5;
21557 /* Total number of rx bytes count on cos queue 6 */
21558 uint64_t rx_bytes_cos6;
21559 /* Total number of rx bytes count on cos queue 7 */
21560 uint64_t rx_bytes_cos7;
21561 /* Total number of rx packets count on cos queue 0 */
21562 uint64_t rx_packets_cos0;
21563 /* Total number of rx packets count on cos queue 1 */
21564 uint64_t rx_packets_cos1;
21565 /* Total number of rx packets count on cos queue 2 */
21566 uint64_t rx_packets_cos2;
21567 /* Total number of rx packets count on cos queue 3 */
21568 uint64_t rx_packets_cos3;
21569 /* Total number of rx packets count on cos queue 4 */
21570 uint64_t rx_packets_cos4;
21571 /* Total number of rx packets count on cos queue 5 */
21572 uint64_t rx_packets_cos5;
21573 /* Total number of rx packets count on cos queue 6 */
21574 uint64_t rx_packets_cos6;
21575 /* Total number of rx packets count on cos queue 7 */
21576 uint64_t rx_packets_cos7;
21577 /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 0 */
21578 uint64_t pfc_pri0_rx_duration_us;
21579 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 0 */
21580 uint64_t pfc_pri0_rx_transitions;
21581 /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 1 */
21582 uint64_t pfc_pri1_rx_duration_us;
21583 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 1 */
21584 uint64_t pfc_pri1_rx_transitions;
21585 /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 2 */
21586 uint64_t pfc_pri2_rx_duration_us;
21587 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 2 */
21588 uint64_t pfc_pri2_rx_transitions;
21589 /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 3 */
21590 uint64_t pfc_pri3_rx_duration_us;
21591 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 3 */
21592 uint64_t pfc_pri3_rx_transitions;
21593 /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 4 */
21594 uint64_t pfc_pri4_rx_duration_us;
21595 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 4 */
21596 uint64_t pfc_pri4_rx_transitions;
21597 /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 5 */
21598 uint64_t pfc_pri5_rx_duration_us;
21599 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 5 */
21600 uint64_t pfc_pri5_rx_transitions;
21601 /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 6 */
21602 uint64_t pfc_pri6_rx_duration_us;
21603 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 6 */
21604 uint64_t pfc_pri6_rx_transitions;
21605 /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 7 */
21606 uint64_t pfc_pri7_rx_duration_us;
21607 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 7 */
21608 uint64_t pfc_pri7_rx_transitions;
21609 /* Total number of received bits */
21610 uint64_t rx_bits;
21611 /* The number of events where the port receive buffer was over 85% full */
21612 uint64_t rx_buffer_passed_threshold;
21613 /*
21614 * The number of symbol errors that wasn't corrected by FEC correction
21615 * alogirithm
21616 */
21617 uint64_t rx_pcs_symbol_err;
21618 /* The number of corrected bits on the port according to active FEC */
21619 uint64_t rx_corrected_bits;
21620 /* Total number of rx discard bytes count on cos queue 0 */
21621 uint64_t rx_discard_bytes_cos0;
21622 /* Total number of rx discard bytes count on cos queue 1 */
21623 uint64_t rx_discard_bytes_cos1;
21624 /* Total number of rx discard bytes count on cos queue 2 */
21625 uint64_t rx_discard_bytes_cos2;
21626 /* Total number of rx discard bytes count on cos queue 3 */
21627 uint64_t rx_discard_bytes_cos3;
21628 /* Total number of rx discard bytes count on cos queue 4 */
21629 uint64_t rx_discard_bytes_cos4;
21630 /* Total number of rx discard bytes count on cos queue 5 */
21631 uint64_t rx_discard_bytes_cos5;
21632 /* Total number of rx discard bytes count on cos queue 6 */
21633 uint64_t rx_discard_bytes_cos6;
21634 /* Total number of rx discard bytes count on cos queue 7 */
21635 uint64_t rx_discard_bytes_cos7;
21636 /* Total number of rx discard packets count on cos queue 0 */
21637 uint64_t rx_discard_packets_cos0;
21638 /* Total number of rx discard packets count on cos queue 1 */
21639 uint64_t rx_discard_packets_cos1;
21640 /* Total number of rx discard packets count on cos queue 2 */
21641 uint64_t rx_discard_packets_cos2;
21642 /* Total number of rx discard packets count on cos queue 3 */
21643 uint64_t rx_discard_packets_cos3;
21644 /* Total number of rx discard packets count on cos queue 4 */
21645 uint64_t rx_discard_packets_cos4;
21646 /* Total number of rx discard packets count on cos queue 5 */
21647 uint64_t rx_discard_packets_cos5;
21648 /* Total number of rx discard packets count on cos queue 6 */
21649 uint64_t rx_discard_packets_cos6;
21650 /* Total number of rx discard packets count on cos queue 7 */
21651 uint64_t rx_discard_packets_cos7;
21652 } rx_port_stats_ext_t, *prx_port_stats_ext_t;
21653
21654 /*
21655 * Port Rx Statistics extended PFC WatchDog Format.
21656 * StormDetect and StormRevert event determination is based
21657 * on an integration period and a percentage threshold.
21658 * StormDetect event - when percentage of XOFF frames received
21659 * within an integration period exceeds the configured threshold.
21660 * StormRevert event - when percentage of XON frames received
21661 * within an integration period exceeds the configured threshold.
21662 * Actual number of XOFF/XON frames for the events to be triggered
21663 * depends on both configured integration period and sampling rate.
21664 * The statistics in this structure represent counts of specified
21665 * events from the moment the feature (PFC WatchDog) is enabled via
21666 * hwrm_queue_pfc_enable_cfg call.
21667 */
21668 /* rx_port_stats_ext_pfc_wd (size:5120b/640B) */
21669
21670 typedef struct rx_port_stats_ext_pfc_wd {
21671 /*
21672 * Total number of PFC WatchDog StormDetect events detected
21673 * for Pri 0
21674 */
21675 uint64_t rx_pfc_watchdog_storms_detected_pri0;
21676 /*
21677 * Total number of PFC WatchDog StormDetect events detected
21678 * for Pri 1
21679 */
21680 uint64_t rx_pfc_watchdog_storms_detected_pri1;
21681 /*
21682 * Total number of PFC WatchDog StormDetect events detected
21683 * for Pri 2
21684 */
21685 uint64_t rx_pfc_watchdog_storms_detected_pri2;
21686 /*
21687 * Total number of PFC WatchDog StormDetect events detected
21688 * for Pri 3
21689 */
21690 uint64_t rx_pfc_watchdog_storms_detected_pri3;
21691 /*
21692 * Total number of PFC WatchDog StormDetect events detected
21693 * for Pri 4
21694 */
21695 uint64_t rx_pfc_watchdog_storms_detected_pri4;
21696 /*
21697 * Total number of PFC WatchDog StormDetect events detected
21698 * for Pri 5
21699 */
21700 uint64_t rx_pfc_watchdog_storms_detected_pri5;
21701 /*
21702 * Total number of PFC WatchDog StormDetect events detected
21703 * for Pri 6
21704 */
21705 uint64_t rx_pfc_watchdog_storms_detected_pri6;
21706 /*
21707 * Total number of PFC WatchDog StormDetect events detected
21708 * for Pri 7
21709 */
21710 uint64_t rx_pfc_watchdog_storms_detected_pri7;
21711 /*
21712 * Total number of PFC WatchDog StormRevert events detected
21713 * for Pri 0
21714 */
21715 uint64_t rx_pfc_watchdog_storms_reverted_pri0;
21716 /*
21717 * Total number of PFC WatchDog StormRevert events detected
21718 * for Pri 1
21719 */
21720 uint64_t rx_pfc_watchdog_storms_reverted_pri1;
21721 /*
21722 * Total number of PFC WatchDog StormRevert events detected
21723 * for Pri 2
21724 */
21725 uint64_t rx_pfc_watchdog_storms_reverted_pri2;
21726 /*
21727 * Total number of PFC WatchDog StormRevert events detected
21728 * for Pri 3
21729 */
21730 uint64_t rx_pfc_watchdog_storms_reverted_pri3;
21731 /*
21732 * Total number of PFC WatchDog StormRevert events detected
21733 * for Pri 4
21734 */
21735 uint64_t rx_pfc_watchdog_storms_reverted_pri4;
21736 /*
21737 * Total number of PFC WatchDog StormRevert events detected
21738 * for Pri 5
21739 */
21740 uint64_t rx_pfc_watchdog_storms_reverted_pri5;
21741 /*
21742 * Total number of PFC WatchDog StormRevert events detected
21743 * for Pri 6
21744 */
21745 uint64_t rx_pfc_watchdog_storms_reverted_pri6;
21746 /*
21747 * Total number of PFC WatchDog StormRevert events detected
21748 * for Pri 7
21749 */
21750 uint64_t rx_pfc_watchdog_storms_reverted_pri7;
21751 /*
21752 * Total number of packets received during PFC watchdog storm
21753 * for pri 0
21754 */
21755 uint64_t rx_pfc_watchdog_storms_rx_packets_pri0;
21756 /*
21757 * Total number of packets received during PFC watchdog storm
21758 * for pri 1
21759 */
21760 uint64_t rx_pfc_watchdog_storms_rx_packets_pri1;
21761 /*
21762 * Total number of packets received during PFC watchdog storm
21763 * for pri 2
21764 */
21765 uint64_t rx_pfc_watchdog_storms_rx_packets_pri2;
21766 /*
21767 * Total number of packets received during PFC watchdog storm
21768 * for pri 3
21769 */
21770 uint64_t rx_pfc_watchdog_storms_rx_packets_pri3;
21771 /*
21772 * Total number of packets received during PFC watchdog storm
21773 * for pri 4
21774 */
21775 uint64_t rx_pfc_watchdog_storms_rx_packets_pri4;
21776 /*
21777 * Total number of packets received during PFC watchdog storm
21778 * for pri 5
21779 */
21780 uint64_t rx_pfc_watchdog_storms_rx_packets_pri5;
21781 /*
21782 * Total number of packets received during PFC watchdog storm
21783 * for pri 6
21784 */
21785 uint64_t rx_pfc_watchdog_storms_rx_packets_pri6;
21786 /*
21787 * Total number of packets received during PFC watchdog storm
21788 * for pri 7
21789 */
21790 uint64_t rx_pfc_watchdog_storms_rx_packets_pri7;
21791 /*
21792 * Total number of bytes received during PFC watchdog storm
21793 * for pri 0
21794 */
21795 uint64_t rx_pfc_watchdog_storms_rx_bytes_pri0;
21796 /*
21797 * Total number of bytes received during PFC watchdog storm
21798 * for pri 1
21799 */
21800 uint64_t rx_pfc_watchdog_storms_rx_bytes_pri1;
21801 /*
21802 * Total number of bytes received during PFC watchdog storm
21803 * for pri 2
21804 */
21805 uint64_t rx_pfc_watchdog_storms_rx_bytes_pri2;
21806 /*
21807 * Total number of bytes received during PFC watchdog storm
21808 * for pri 3
21809 */
21810 uint64_t rx_pfc_watchdog_storms_rx_bytes_pri3;
21811 /*
21812 * Total number of bytes received during PFC watchdog storm
21813 * for pri 4
21814 */
21815 uint64_t rx_pfc_watchdog_storms_rx_bytes_pri4;
21816 /*
21817 * Total number of bytes received during PFC watchdog storm
21818 * for pri 5
21819 */
21820 uint64_t rx_pfc_watchdog_storms_rx_bytes_pri5;
21821 /*
21822 * Total number of bytes received during PFC watchdog storm
21823 * for pri 6
21824 */
21825 uint64_t rx_pfc_watchdog_storms_rx_bytes_pri6;
21826 /*
21827 * Total number of bytes received during PFC watchdog storm
21828 * for pri 7
21829 */
21830 uint64_t rx_pfc_watchdog_storms_rx_bytes_pri7;
21831 /*
21832 * Total number of packets dropped on rx during PFC watchdog storm
21833 * for pri 0
21834 */
21835 uint64_t rx_pfc_watchdog_storms_rx_packets_dropped_pri0;
21836 /*
21837 * Total number of packets dropped on rx during PFC watchdog storm
21838 * for pri 1
21839 */
21840 uint64_t rx_pfc_watchdog_storms_rx_packets_dropped_pri1;
21841 /*
21842 * Total number of packets dropped on rx during PFC watchdog storm
21843 * for pri 2
21844 */
21845 uint64_t rx_pfc_watchdog_storms_rx_packets_dropped_pri2;
21846 /*
21847 * Total number of packets dropped on rx during PFC watchdog storm
21848 * for pri 3
21849 */
21850 uint64_t rx_pfc_watchdog_storms_rx_packets_dropped_pri3;
21851 /*
21852 * Total number of packets dropped on rx during PFC watchdog storm
21853 * for pri 4
21854 */
21855 uint64_t rx_pfc_watchdog_storms_rx_packets_dropped_pri4;
21856 /*
21857 * Total number of packets dropped on rx during PFC watchdog storm
21858 * for pri 5
21859 */
21860 uint64_t rx_pfc_watchdog_storms_rx_packets_dropped_pri5;
21861 /*
21862 * Total number of packets dropped on rx during PFC watchdog storm
21863 * for pri 6
21864 */
21865 uint64_t rx_pfc_watchdog_storms_rx_packets_dropped_pri6;
21866 /*
21867 * Total number of packets dropped on rx during PFC watchdog storm
21868 * for pri 7
21869 */
21870 uint64_t rx_pfc_watchdog_storms_rx_packets_dropped_pri7;
21871 /*
21872 * Total number of bytes dropped on rx during PFC watchdog storm
21873 * for pri 0
21874 */
21875 uint64_t rx_pfc_watchdog_storms_rx_bytes_dropped_pri0;
21876 /*
21877 * Total number of bytes dropped on rx during PFC watchdog storm
21878 * for pri 1
21879 */
21880 uint64_t rx_pfc_watchdog_storms_rx_bytes_dropped_pri1;
21881 /*
21882 * Total number of bytes dropped on rx during PFC watchdog storm
21883 * for pri 2
21884 */
21885 uint64_t rx_pfc_watchdog_storms_rx_bytes_dropped_pri2;
21886 /*
21887 * Total number of bytes dropped on rx during PFC watchdog storm
21888 * for pri 3
21889 */
21890 uint64_t rx_pfc_watchdog_storms_rx_bytes_dropped_pri3;
21891 /*
21892 * Total number of bytes dropped on rx during PFC watchdog storm
21893 * for pri 4
21894 */
21895 uint64_t rx_pfc_watchdog_storms_rx_bytes_dropped_pri4;
21896 /*
21897 * Total number of bytes dropped on rx during PFC watchdog storm
21898 * for pri 5
21899 */
21900 uint64_t rx_pfc_watchdog_storms_rx_bytes_dropped_pri5;
21901 /*
21902 * Total number of bytes dropped on rx during PFC watchdog storm
21903 * for pri 6
21904 */
21905 uint64_t rx_pfc_watchdog_storms_rx_bytes_dropped_pri6;
21906 /*
21907 * Total number of bytes dropped on rx during PFC watchdog storm
21908 * for pri 7
21909 */
21910 uint64_t rx_pfc_watchdog_storms_rx_bytes_dropped_pri7;
21911 /*
21912 * Number of packets received during last PFC watchdog storm
21913 * for pri 0
21914 */
21915 uint64_t rx_pfc_watchdog_last_storm_rx_packets_pri0;
21916 /*
21917 * Number of packets received during last PFC watchdog storm
21918 * for pri 1
21919 */
21920 uint64_t rx_pfc_watchdog_last_storm_rx_packets_pri1;
21921 /*
21922 * Number of packets received during last PFC watchdog storm
21923 * for pri 2
21924 */
21925 uint64_t rx_pfc_watchdog_last_storm_rx_packets_pri2;
21926 /*
21927 * Number of packets received during last PFC watchdog storm
21928 * for pri 3
21929 */
21930 uint64_t rx_pfc_watchdog_last_storm_rx_packets_pri3;
21931 /*
21932 * Number of packets received during last PFC watchdog storm
21933 * for pri 4
21934 */
21935 uint64_t rx_pfc_watchdog_last_storm_rx_packets_pri4;
21936 /*
21937 * Number of packets received during last PFC watchdog storm
21938 * for pri 5
21939 */
21940 uint64_t rx_pfc_watchdog_last_storm_rx_packets_pri5;
21941 /*
21942 * Number of packets received during last PFC watchdog storm
21943 * for pri 6
21944 */
21945 uint64_t rx_pfc_watchdog_last_storm_rx_packets_pri6;
21946 /*
21947 * Number of packets received during last PFC watchdog storm
21948 * for pri 7
21949 */
21950 uint64_t rx_pfc_watchdog_last_storm_rx_packets_pri7;
21951 /*
21952 * Number of bytes received during last PFC watchdog storm
21953 * for pri 0
21954 */
21955 uint64_t rx_pfc_watchdog_last_storm_rx_bytes_pri0;
21956 /*
21957 * Number of bytes received during last PFC watchdog storm
21958 * for pri 1
21959 */
21960 uint64_t rx_pfc_watchdog_last_storm_rx_bytes_pri1;
21961 /*
21962 * Number of bytes received during last PFC watchdog storm
21963 * for pri 2
21964 */
21965 uint64_t rx_pfc_watchdog_last_storm_rx_bytes_pri2;
21966 /*
21967 * Number of bytes received during last PFC watchdog storm
21968 * for pri 3
21969 */
21970 uint64_t rx_pfc_watchdog_last_storm_rx_bytes_pri3;
21971 /*
21972 * Number of bytes received during last PFC watchdog storm
21973 * for pri 4
21974 */
21975 uint64_t rx_pfc_watchdog_last_storm_rx_bytes_pri4;
21976 /*
21977 * Number of bytes received during last PFC watchdog storm
21978 * for pri 5
21979 */
21980 uint64_t rx_pfc_watchdog_last_storm_rx_bytes_pri5;
21981 /*
21982 * Number of bytes received during last PFC watchdog storm
21983 * for pri 6
21984 */
21985 uint64_t rx_pfc_watchdog_last_storm_rx_bytes_pri6;
21986 /*
21987 * Number of bytes received during last PFC watchdog storm
21988 * for pri 7
21989 */
21990 uint64_t rx_pfc_watchdog_last_storm_rx_bytes_pri7;
21991 /*
21992 * Number of packets dropped on rx during last PFC watchdog storm
21993 * for pri 0
21994 */
21995 uint64_t rx_pfc_watchdog_last_storm_rx_packets_dropped_pri0;
21996 /*
21997 * Number of packets dropped on rx during last PFC watchdog storm
21998 * for pri 1
21999 */
22000 uint64_t rx_pfc_watchdog_last_storm_rx_packets_dropped_pri1;
22001 /*
22002 * Number of packets dropped on rx during last PFC watchdog storm
22003 * for pri 2
22004 */
22005 uint64_t rx_pfc_watchdog_last_storm_rx_packets_dropped_pri2;
22006 /*
22007 * Number of packets dropped on rx during last PFC watchdog storm
22008 * for pri 3
22009 */
22010 uint64_t rx_pfc_watchdog_last_storm_rx_packets_dropped_pri3;
22011 /*
22012 * Number of packets dropped on rx during last PFC watchdog storm
22013 * for pri 4
22014 */
22015 uint64_t rx_pfc_watchdog_last_storm_rx_packets_dropped_pri4;
22016 /*
22017 * Number of packets dropped on rx during last PFC watchdog storm
22018 * for pri 5
22019 */
22020 uint64_t rx_pfc_watchdog_last_storm_rx_packets_dropped_pri5;
22021 /*
22022 * Number of packets dropped on rx during last PFC watchdog storm
22023 * for pri 6
22024 */
22025 uint64_t rx_pfc_watchdog_last_storm_rx_packets_dropped_pri6;
22026 /*
22027 * Number of packets dropped on rx during last PFC watchdog storm
22028 * for pri 7
22029 */
22030 uint64_t rx_pfc_watchdog_last_storm_rx_packets_dropped_pri7;
22031 /*
22032 * Total number of bytes dropped on rx during PFC watchdog storm
22033 * for pri 0
22034 */
22035 uint64_t rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri0;
22036 /*
22037 * Number of bytes dropped on rx during last PFC watchdog storm
22038 * for pri 1
22039 */
22040 uint64_t rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri1;
22041 /*
22042 * Number of bytes dropped on rx during last PFC watchdog storm
22043 * for pri 2
22044 */
22045 uint64_t rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri2;
22046 /*
22047 * Number of bytes dropped on rx during last PFC watchdog storm
22048 * for pri 3
22049 */
22050 uint64_t rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri3;
22051 /*
22052 * Number of bytes dropped on rx during last PFC watchdog storm
22053 * for pri 4
22054 */
22055 uint64_t rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri4;
22056 /*
22057 * Number of bytes dropped on rx during last PFC watchdog storm
22058 * for pri 5
22059 */
22060 uint64_t rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri5;
22061 /*
22062 * Number of bytes dropped on rx during last PFC watchdog storm
22063 * for pri 6
22064 */
22065 uint64_t rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri6;
22066 /*
22067 * Number of bytes dropped on rx during last PFC watchdog storm
22068 * for pri 7
22069 */
22070 uint64_t rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri7;
22071 } rx_port_stats_ext_pfc_wd_t, *prx_port_stats_ext_pfc_wd_t;
22072
22073 /************************
22074 * hwrm_port_qstats_ext *
22075 ************************/
22076
22077
22078 /* hwrm_port_qstats_ext_input (size:320b/40B) */
22079
22080 typedef struct hwrm_port_qstats_ext_input {
22081 /* The HWRM command request type. */
22082 uint16_t req_type;
22083 /*
22084 * The completion ring to send the completion event on. This should
22085 * be the NQ ID returned from the `nq_alloc` HWRM command.
22086 */
22087 uint16_t cmpl_ring;
22088 /*
22089 * The sequence ID is used by the driver for tracking multiple
22090 * commands. This ID is treated as opaque data by the firmware and
22091 * the value is returned in the `hwrm_resp_hdr` upon completion.
22092 */
22093 uint16_t seq_id;
22094 /*
22095 * The target ID of the command:
22096 * * 0x0-0xFFF8 - The function ID
22097 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22098 * * 0xFFFD - Reserved for user-space HWRM interface
22099 * * 0xFFFF - HWRM
22100 */
22101 uint16_t target_id;
22102 /*
22103 * A physical address pointer pointing to a host buffer that the
22104 * command's response data will be written. This can be either a host
22105 * physical address (HPA) or a guest physical address (GPA) and must
22106 * point to a physically contiguous block of memory.
22107 */
22108 uint64_t resp_addr;
22109 /* Port ID of port that is being queried. */
22110 uint16_t port_id;
22111 /*
22112 * The size of TX port extended
22113 * statistics block in bytes.
22114 */
22115 uint16_t tx_stat_size;
22116 /*
22117 * The size of RX port extended
22118 * statistics block in bytes
22119 */
22120 uint16_t rx_stat_size;
22121 uint8_t flags;
22122 /* This value is not used to avoid backward compatibility issues. */
22123 #define HWRM_PORT_QSTATS_EXT_INPUT_FLAGS_UNUSED UINT32_C(0x0)
22124 /*
22125 * This bit is set to 1 when request is for the counter mask,
22126 * representing width of each of the stats counters, rather than
22127 * counters themselves.
22128 */
22129 #define HWRM_PORT_QSTATS_EXT_INPUT_FLAGS_COUNTER_MASK UINT32_C(0x1)
22130 #define HWRM_PORT_QSTATS_EXT_INPUT_FLAGS_LAST HWRM_PORT_QSTATS_EXT_INPUT_FLAGS_COUNTER_MASK
22131 uint8_t unused_0;
22132 /*
22133 * This is the host address where
22134 * Tx port statistics will be stored
22135 */
22136 uint64_t tx_stat_host_addr;
22137 /*
22138 * This is the host address where
22139 * Rx port statistics will be stored
22140 */
22141 uint64_t rx_stat_host_addr;
22142 } hwrm_port_qstats_ext_input_t, *phwrm_port_qstats_ext_input_t;
22143
22144 /* hwrm_port_qstats_ext_output (size:128b/16B) */
22145
22146 typedef struct hwrm_port_qstats_ext_output {
22147 /* The specific error status for the command. */
22148 uint16_t error_code;
22149 /* The HWRM command request type. */
22150 uint16_t req_type;
22151 /* The sequence ID from the original command. */
22152 uint16_t seq_id;
22153 /* The length of the response data in number of bytes. */
22154 uint16_t resp_len;
22155 /* The size of TX port statistics block in bytes. */
22156 uint16_t tx_stat_size;
22157 /* The size of RX port statistics block in bytes. */
22158 uint16_t rx_stat_size;
22159 /* Total number of active cos queues available. */
22160 uint16_t total_active_cos_queues;
22161 uint8_t flags;
22162 /*
22163 * If set to 1, then this field indicates that clear
22164 * roce specific counters is supported.
22165 */
22166 #define HWRM_PORT_QSTATS_EXT_OUTPUT_FLAGS_CLEAR_ROCE_COUNTERS_SUPPORTED UINT32_C(0x1)
22167 /*
22168 * This field is used in Output records to indicate that the output
22169 * is completely written to RAM. This field should be read as '1'
22170 * to indicate that the output has been completely written.
22171 * When writing a command completion or response to an internal processor,
22172 * the order of writes has to be such that this field is written last.
22173 */
22174 uint8_t valid;
22175 } hwrm_port_qstats_ext_output_t, *phwrm_port_qstats_ext_output_t;
22176
22177 /*******************************
22178 * hwrm_port_qstats_ext_pfc_wd *
22179 *******************************/
22180
22181
22182 /* hwrm_port_qstats_ext_pfc_wd_input (size:256b/32B) */
22183
22184 typedef struct hwrm_port_qstats_ext_pfc_wd_input {
22185 /* The HWRM command request type. */
22186 uint16_t req_type;
22187 /*
22188 * The completion ring to send the completion event on. This should
22189 * be the NQ ID returned from the `nq_alloc` HWRM command.
22190 */
22191 uint16_t cmpl_ring;
22192 /*
22193 * The sequence ID is used by the driver for tracking multiple
22194 * commands. This ID is treated as opaque data by the firmware and
22195 * the value is returned in the `hwrm_resp_hdr` upon completion.
22196 */
22197 uint16_t seq_id;
22198 /*
22199 * The target ID of the command:
22200 * * 0x0-0xFFF8 - The function ID
22201 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22202 * * 0xFFFD - Reserved for user-space HWRM interface
22203 * * 0xFFFF - HWRM
22204 */
22205 uint16_t target_id;
22206 /*
22207 * A physical address pointer pointing to a host buffer that the
22208 * command's response data will be written. This can be either a host
22209 * physical address (HPA) or a guest physical address (GPA) and must
22210 * point to a physically contiguous block of memory.
22211 */
22212 uint64_t resp_addr;
22213 /* Port ID of port that is being queried. */
22214 uint16_t port_id;
22215 /*
22216 * The size of rx_port_stats_ext_pfc_wd
22217 * block in bytes
22218 */
22219 uint16_t pfc_wd_stat_size;
22220 uint8_t unused_0[4];
22221 /*
22222 * This is the host address where
22223 * rx_port_stats_ext_pfc_wd will be stored
22224 */
22225 uint64_t pfc_wd_stat_host_addr;
22226 } hwrm_port_qstats_ext_pfc_wd_input_t, *phwrm_port_qstats_ext_pfc_wd_input_t;
22227
22228 /* hwrm_port_qstats_ext_pfc_wd_output (size:128b/16B) */
22229
22230 typedef struct hwrm_port_qstats_ext_pfc_wd_output {
22231 /* The specific error status for the command. */
22232 uint16_t error_code;
22233 /* The HWRM command request type. */
22234 uint16_t req_type;
22235 /* The sequence ID from the original command. */
22236 uint16_t seq_id;
22237 /* The length of the response data in number of bytes. */
22238 uint16_t resp_len;
22239 /*
22240 * The size of rx_port_stats_ext_pfc_wd
22241 * statistics block in bytes.
22242 */
22243 uint16_t pfc_wd_stat_size;
22244 uint8_t flags;
22245 /*
22246 * This field is used in Output records to indicate that the output
22247 * is completely written to RAM. This field should be read as '1'
22248 * to indicate that the output has been completely written.
22249 * When writing a command completion or response to an internal processor,
22250 * the order of writes has to be such that this field is written last.
22251 */
22252 uint8_t valid;
22253 uint8_t unused_0[4];
22254 } hwrm_port_qstats_ext_pfc_wd_output_t, *phwrm_port_qstats_ext_pfc_wd_output_t;
22255
22256 /*************************
22257 * hwrm_port_lpbk_qstats *
22258 *************************/
22259
22260
22261 /* hwrm_port_lpbk_qstats_input (size:128b/16B) */
22262
22263 typedef struct hwrm_port_lpbk_qstats_input {
22264 /* The HWRM command request type. */
22265 uint16_t req_type;
22266 /*
22267 * The completion ring to send the completion event on. This should
22268 * be the NQ ID returned from the `nq_alloc` HWRM command.
22269 */
22270 uint16_t cmpl_ring;
22271 /*
22272 * The sequence ID is used by the driver for tracking multiple
22273 * commands. This ID is treated as opaque data by the firmware and
22274 * the value is returned in the `hwrm_resp_hdr` upon completion.
22275 */
22276 uint16_t seq_id;
22277 /*
22278 * The target ID of the command:
22279 * * 0x0-0xFFF8 - The function ID
22280 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22281 * * 0xFFFD - Reserved for user-space HWRM interface
22282 * * 0xFFFF - HWRM
22283 */
22284 uint16_t target_id;
22285 /*
22286 * A physical address pointer pointing to a host buffer that the
22287 * command's response data will be written. This can be either a host
22288 * physical address (HPA) or a guest physical address (GPA) and must
22289 * point to a physically contiguous block of memory.
22290 */
22291 uint64_t resp_addr;
22292 } hwrm_port_lpbk_qstats_input_t, *phwrm_port_lpbk_qstats_input_t;
22293
22294 /* hwrm_port_lpbk_qstats_output (size:768b/96B) */
22295
22296 typedef struct hwrm_port_lpbk_qstats_output {
22297 /* The specific error status for the command. */
22298 uint16_t error_code;
22299 /* The HWRM command request type. */
22300 uint16_t req_type;
22301 /* The sequence ID from the original command. */
22302 uint16_t seq_id;
22303 /* The length of the response data in number of bytes. */
22304 uint16_t resp_len;
22305 /* Number of transmitted unicast frames */
22306 uint64_t lpbk_ucast_frames;
22307 /* Number of transmitted multicast frames */
22308 uint64_t lpbk_mcast_frames;
22309 /* Number of transmitted broadcast frames */
22310 uint64_t lpbk_bcast_frames;
22311 /* Number of transmitted bytes for unicast traffic */
22312 uint64_t lpbk_ucast_bytes;
22313 /* Number of transmitted bytes for multicast traffic */
22314 uint64_t lpbk_mcast_bytes;
22315 /* Number of transmitted bytes for broadcast traffic */
22316 uint64_t lpbk_bcast_bytes;
22317 /* Total Tx Drops for loopback traffic reported by STATS block */
22318 uint64_t tx_stat_discard;
22319 /* Total Tx Error Drops for loopback traffic reported by STATS block */
22320 uint64_t tx_stat_error;
22321 /* Total Rx Drops for loopback traffic reported by STATS block */
22322 uint64_t rx_stat_discard;
22323 /* Total Rx Error Drops for loopback traffic reported by STATS block */
22324 uint64_t rx_stat_error;
22325 uint8_t unused_0[7];
22326 /*
22327 * This field is used in Output records to indicate that the output
22328 * is completely written to RAM. This field should be read as '1'
22329 * to indicate that the output has been completely written.
22330 * When writing a command completion or response to an internal processor,
22331 * the order of writes has to be such that this field is written last.
22332 */
22333 uint8_t valid;
22334 } hwrm_port_lpbk_qstats_output_t, *phwrm_port_lpbk_qstats_output_t;
22335
22336 /************************
22337 * hwrm_port_ecn_qstats *
22338 ************************/
22339
22340
22341 /* hwrm_port_ecn_qstats_input (size:256b/32B) */
22342
22343 typedef struct hwrm_port_ecn_qstats_input {
22344 /* The HWRM command request type. */
22345 uint16_t req_type;
22346 /*
22347 * The completion ring to send the completion event on. This should
22348 * be the NQ ID returned from the `nq_alloc` HWRM command.
22349 */
22350 uint16_t cmpl_ring;
22351 /*
22352 * The sequence ID is used by the driver for tracking multiple
22353 * commands. This ID is treated as opaque data by the firmware and
22354 * the value is returned in the `hwrm_resp_hdr` upon completion.
22355 */
22356 uint16_t seq_id;
22357 /*
22358 * The target ID of the command:
22359 * * 0x0-0xFFF8 - The function ID
22360 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22361 * * 0xFFFD - Reserved for user-space HWRM interface
22362 * * 0xFFFF - HWRM
22363 */
22364 uint16_t target_id;
22365 /*
22366 * A physical address pointer pointing to a host buffer that the
22367 * command's response data will be written. This can be either a host
22368 * physical address (HPA) or a guest physical address (GPA) and must
22369 * point to a physically contiguous block of memory.
22370 */
22371 uint64_t resp_addr;
22372 /*
22373 * Port ID of port that is being queried. Unused if NIC is in
22374 * multi-host mode.
22375 */
22376 uint16_t port_id;
22377 /*
22378 * Size of the DMA buffer the caller has allocated for the firmware to
22379 * write into.
22380 */
22381 uint16_t ecn_stat_buf_size;
22382 uint8_t flags;
22383 /* This value is not used to avoid backward compatibility issues. */
22384 #define HWRM_PORT_ECN_QSTATS_INPUT_FLAGS_UNUSED UINT32_C(0x0)
22385 /*
22386 * This bit is set to 1 when request is for a counter mask,
22387 * representing the width of each of the stats counters, rather
22388 * than counters themselves.
22389 */
22390 #define HWRM_PORT_ECN_QSTATS_INPUT_FLAGS_COUNTER_MASK UINT32_C(0x1)
22391 #define HWRM_PORT_ECN_QSTATS_INPUT_FLAGS_LAST HWRM_PORT_ECN_QSTATS_INPUT_FLAGS_COUNTER_MASK
22392 uint8_t unused_0[3];
22393 /*
22394 * This is the host address where
22395 * ECN port statistics will be stored
22396 */
22397 uint64_t ecn_stat_host_addr;
22398 } hwrm_port_ecn_qstats_input_t, *phwrm_port_ecn_qstats_input_t;
22399
22400 /* hwrm_port_ecn_qstats_output (size:128b/16B) */
22401
22402 typedef struct hwrm_port_ecn_qstats_output {
22403 /* The specific error status for the command. */
22404 uint16_t error_code;
22405 /* The HWRM command request type. */
22406 uint16_t req_type;
22407 /* The sequence ID from the original command. */
22408 uint16_t seq_id;
22409 /* The length of the response data in number of bytes. */
22410 uint16_t resp_len;
22411 /* Number of bytes of stats the firmware wrote to the DMA buffer. */
22412 uint16_t ecn_stat_buf_size;
22413 /*
22414 * Bitmask that indicates which CoS queues have ECN marking enabled.
22415 * Bit i corresponds to CoS queue i.
22416 */
22417 uint8_t mark_en;
22418 uint8_t unused_0[4];
22419 /*
22420 * This field is used in Output records to indicate that the output
22421 * is completely written to RAM. This field should be read as '1'
22422 * to indicate that the output has been completely written.
22423 * When writing a command completion or response to an internal processor,
22424 * the order of writes has to be such that this field is written last.
22425 */
22426 uint8_t valid;
22427 } hwrm_port_ecn_qstats_output_t, *phwrm_port_ecn_qstats_output_t;
22428
22429 /* ECN mark statistics format */
22430 /* port_stats_ecn (size:512b/64B) */
22431
22432 typedef struct port_stats_ecn {
22433 /*
22434 * Number of packets marked in CoS queue 0.
22435 * Or, if the driver requested counter masks, a mask to indicate the size
22436 * of the counter.
22437 */
22438 uint64_t mark_cnt_cos0;
22439 /*
22440 * Number of packets marked in CoS queue 1.
22441 * Or, if the driver requested counter masks, a mask to indicate the size
22442 * of the counter.
22443 */
22444 uint64_t mark_cnt_cos1;
22445 /*
22446 * Number of packets marked in CoS queue 2.
22447 * Or, if the driver requested counter masks, a mask to indicate the size
22448 * of the counter.
22449 */
22450 uint64_t mark_cnt_cos2;
22451 /*
22452 * Number of packets marked in CoS queue 3.
22453 * Or, if the driver requested counter masks, a mask to indicate the size
22454 * of the counter.
22455 */
22456 uint64_t mark_cnt_cos3;
22457 /*
22458 * Number of packets marked in CoS queue 4.
22459 * Or, if the driver requested counter masks, a mask to indicate the size
22460 * of the counter.
22461 */
22462 uint64_t mark_cnt_cos4;
22463 /*
22464 * Number of packets marked in CoS queue 5.
22465 * Or, if the driver requested counter masks, a mask to indicate the size
22466 * of the counter.
22467 */
22468 uint64_t mark_cnt_cos5;
22469 /*
22470 * Number of packets marked in CoS queue 6.
22471 * Or, if the driver requested counter masks, a mask to indicate the size
22472 * of the counter.
22473 */
22474 uint64_t mark_cnt_cos6;
22475 /*
22476 * Number of packets marked in CoS queue 7.
22477 * Or, if the driver requested counter masks, a mask to indicate the size
22478 * of the counter.
22479 */
22480 uint64_t mark_cnt_cos7;
22481 } port_stats_ecn_t, *pport_stats_ecn_t;
22482
22483 /***********************
22484 * hwrm_port_clr_stats *
22485 ***********************/
22486
22487
22488 /* hwrm_port_clr_stats_input (size:192b/24B) */
22489
22490 typedef struct hwrm_port_clr_stats_input {
22491 /* The HWRM command request type. */
22492 uint16_t req_type;
22493 /*
22494 * The completion ring to send the completion event on. This should
22495 * be the NQ ID returned from the `nq_alloc` HWRM command.
22496 */
22497 uint16_t cmpl_ring;
22498 /*
22499 * The sequence ID is used by the driver for tracking multiple
22500 * commands. This ID is treated as opaque data by the firmware and
22501 * the value is returned in the `hwrm_resp_hdr` upon completion.
22502 */
22503 uint16_t seq_id;
22504 /*
22505 * The target ID of the command:
22506 * * 0x0-0xFFF8 - The function ID
22507 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22508 * * 0xFFFD - Reserved for user-space HWRM interface
22509 * * 0xFFFF - HWRM
22510 */
22511 uint16_t target_id;
22512 /*
22513 * A physical address pointer pointing to a host buffer that the
22514 * command's response data will be written. This can be either a host
22515 * physical address (HPA) or a guest physical address (GPA) and must
22516 * point to a physically contiguous block of memory.
22517 */
22518 uint64_t resp_addr;
22519 /* Port ID of port that is being queried. */
22520 uint16_t port_id;
22521 uint8_t flags;
22522 /*
22523 * If set to 1, then this field indicates clear the following RoCE
22524 * specific counters.
22525 * RoCE associated TX/RX cos counters
22526 * CNP associated TX/RX cos counters
22527 * RoCE/CNP specific TX/RX flow counters
22528 * Firmware will determine the RoCE/CNP cos queue based on qos profile.
22529 * This flag is honored only when RoCE is enabled on that port.
22530 */
22531 #define HWRM_PORT_CLR_STATS_INPUT_FLAGS_ROCE_COUNTERS UINT32_C(0x1)
22532 uint8_t unused_0[5];
22533 } hwrm_port_clr_stats_input_t, *phwrm_port_clr_stats_input_t;
22534
22535 /* hwrm_port_clr_stats_output (size:128b/16B) */
22536
22537 typedef struct hwrm_port_clr_stats_output {
22538 /* The specific error status for the command. */
22539 uint16_t error_code;
22540 /* The HWRM command request type. */
22541 uint16_t req_type;
22542 /* The sequence ID from the original command. */
22543 uint16_t seq_id;
22544 /* The length of the response data in number of bytes. */
22545 uint16_t resp_len;
22546 uint8_t unused_0[7];
22547 /*
22548 * This field is used in Output records to indicate that the output
22549 * is completely written to RAM. This field should be read as '1'
22550 * to indicate that the output has been completely written.
22551 * When writing a command completion or response to an internal processor,
22552 * the order of writes has to be such that this field is written last.
22553 */
22554 uint8_t valid;
22555 } hwrm_port_clr_stats_output_t, *phwrm_port_clr_stats_output_t;
22556
22557 /***********************
22558 * hwrm_port_phy_qcaps *
22559 ***********************/
22560
22561
22562 /* hwrm_port_phy_qcaps_input (size:192b/24B) */
22563
22564 typedef struct hwrm_port_phy_qcaps_input {
22565 /* The HWRM command request type. */
22566 uint16_t req_type;
22567 /*
22568 * The completion ring to send the completion event on. This should
22569 * be the NQ ID returned from the `nq_alloc` HWRM command.
22570 */
22571 uint16_t cmpl_ring;
22572 /*
22573 * The sequence ID is used by the driver for tracking multiple
22574 * commands. This ID is treated as opaque data by the firmware and
22575 * the value is returned in the `hwrm_resp_hdr` upon completion.
22576 */
22577 uint16_t seq_id;
22578 /*
22579 * The target ID of the command:
22580 * * 0x0-0xFFF8 - The function ID
22581 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22582 * * 0xFFFD - Reserved for user-space HWRM interface
22583 * * 0xFFFF - HWRM
22584 */
22585 uint16_t target_id;
22586 /*
22587 * A physical address pointer pointing to a host buffer that the
22588 * command's response data will be written. This can be either a host
22589 * physical address (HPA) or a guest physical address (GPA) and must
22590 * point to a physically contiguous block of memory.
22591 */
22592 uint64_t resp_addr;
22593 /* Port ID of port that is being queried. */
22594 uint16_t port_id;
22595 uint8_t unused_0[6];
22596 } hwrm_port_phy_qcaps_input_t, *phwrm_port_phy_qcaps_input_t;
22597
22598 /* hwrm_port_phy_qcaps_output (size:256b/32B) */
22599
22600 typedef struct hwrm_port_phy_qcaps_output {
22601 /* The specific error status for the command. */
22602 uint16_t error_code;
22603 /* The HWRM command request type. */
22604 uint16_t req_type;
22605 /* The sequence ID from the original command. */
22606 uint16_t seq_id;
22607 /* The length of the response data in number of bytes. */
22608 uint16_t resp_len;
22609 /* PHY capability flags */
22610 uint8_t flags;
22611 /*
22612 * If set to 1, then this field indicates that the
22613 * link is capable of supporting EEE.
22614 */
22615 #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EEE_SUPPORTED UINT32_C(0x1)
22616 /*
22617 * If set to 1, then this field indicates that the
22618 * PHY is capable of supporting external loopback.
22619 */
22620 #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EXTERNAL_LPBK_SUPPORTED UINT32_C(0x2)
22621 /*
22622 * If set to 1, then this field indicates that the
22623 * PHY is capable of supporting loopback in autoneg mode.
22624 */
22625 #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_AUTONEG_LPBK_SUPPORTED UINT32_C(0x4)
22626 /*
22627 * Indicates if the configuration of shared PHY settings is supported.
22628 * In cases where a physical port is shared by multiple functions
22629 * (e.g. NPAR, multihost, etc), the configuration of PHY
22630 * settings may not be allowed. Callers to HWRM_PORT_PHY_CFG will
22631 * get an HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED error in this case.
22632 */
22633 #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_SHARED_PHY_CFG_SUPPORTED UINT32_C(0x8)
22634 /*
22635 * If set to 1, it indicates that the port counters and extended
22636 * port counters will not reset when the firmware shuts down or
22637 * resets the PHY. These counters will only be reset during power
22638 * cycle or by calling HWRM_PORT_CLR_STATS.
22639 * If set to 0, the state of the counters is unspecified when
22640 * firmware shuts down or resets the PHY.
22641 */
22642 #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_CUMULATIVE_COUNTERS_ON_RESET UINT32_C(0x10)
22643 /*
22644 * If set to 1, then this field indicates that the
22645 * local loopback is not supported on this controller.
22646 */
22647 #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_LOCAL_LPBK_NOT_SUPPORTED UINT32_C(0x20)
22648 /*
22649 * If set to 1, then this field indicates that the
22650 * PHY/Link down policy during PF shutdown is totally
22651 * controlled by the firmware. It can shutdown the link
22652 * even when there are active VFs associated with the PF.
22653 * Host PF driver can send HWRM_PHY_CFG command to bring
22654 * down the PHY even when the port is shared between VFs
22655 * and PFs.
22656 */
22657 #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_FW_MANAGED_LINK_DOWN UINT32_C(0x40)
22658 /*
22659 * If set to 1, this field indicates that the FCS may
22660 * be disabled for a given packet via the transmit
22661 * buffer descriptor.
22662 */
22663 #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_NO_FCS UINT32_C(0x80)
22664 /* Number of front panel ports for this device. */
22665 uint8_t port_cnt;
22666 /* Not supported or unknown */
22667 #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_UNKNOWN UINT32_C(0x0)
22668 /* single port device */
22669 #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_1 UINT32_C(0x1)
22670 /* 2-port device */
22671 #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_2 UINT32_C(0x2)
22672 /* 3-port device */
22673 #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_3 UINT32_C(0x3)
22674 /* 4-port device */
22675 #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_4 UINT32_C(0x4)
22676 #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_LAST HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_4
22677 /*
22678 * This is a bit mask to indicate what speeds are supported
22679 * as forced speeds on this link.
22680 * For each speed that can be forced on this link, the
22681 * corresponding mask bit shall be set to '1'.
22682 */
22683 uint16_t supported_speeds_force_mode;
22684 /* 100Mb link speed (Half-duplex) */
22685 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MBHD UINT32_C(0x1)
22686 /* 100Mb link speed (Full-duplex) */
22687 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MB UINT32_C(0x2)
22688 /* 1Gb link speed (Half-duplex) */
22689 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GBHD UINT32_C(0x4)
22690 /* 1Gb link speed (Full-duplex) */
22691 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GB UINT32_C(0x8)
22692 /* 2Gb link speed */
22693 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2GB UINT32_C(0x10)
22694 /* 25Gb link speed */
22695 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2_5GB UINT32_C(0x20)
22696 /* 10Gb link speed */
22697 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10GB UINT32_C(0x40)
22698 /* 20Gb link speed */
22699 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_20GB UINT32_C(0x80)
22700 /* 25Gb link speed */
22701 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_25GB UINT32_C(0x100)
22702 /* 40Gb link speed */
22703 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_40GB UINT32_C(0x200)
22704 /* 50Gb link speed */
22705 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_50GB UINT32_C(0x400)
22706 /* 100Gb link speed */
22707 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100GB UINT32_C(0x800)
22708 /* 10Mb link speed (Half-duplex) */
22709 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MBHD UINT32_C(0x1000)
22710 /* 10Mb link speed (Full-duplex) */
22711 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MB UINT32_C(0x2000)
22712 /*
22713 * This is a bit mask to indicate what speeds are supported
22714 * for autonegotiation on this link.
22715 * For each speed that can be autonegotiated on this link, the
22716 * corresponding mask bit shall be set to '1'.
22717 */
22718 uint16_t supported_speeds_auto_mode;
22719 /* 100Mb link speed (Half-duplex) */
22720 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MBHD UINT32_C(0x1)
22721 /* 100Mb link speed (Full-duplex) */
22722 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MB UINT32_C(0x2)
22723 /* 1Gb link speed (Half-duplex) */
22724 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GBHD UINT32_C(0x4)
22725 /* 1Gb link speed (Full-duplex) */
22726 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GB UINT32_C(0x8)
22727 /* 2Gb link speed */
22728 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2GB UINT32_C(0x10)
22729 /* 25Gb link speed */
22730 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2_5GB UINT32_C(0x20)
22731 /* 10Gb link speed */
22732 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10GB UINT32_C(0x40)
22733 /* 20Gb link speed */
22734 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_20GB UINT32_C(0x80)
22735 /* 25Gb link speed */
22736 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_25GB UINT32_C(0x100)
22737 /* 40Gb link speed */
22738 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_40GB UINT32_C(0x200)
22739 /* 50Gb link speed */
22740 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_50GB UINT32_C(0x400)
22741 /* 100Gb link speed */
22742 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100GB UINT32_C(0x800)
22743 /* 10Mb link speed (Half-duplex) */
22744 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MBHD UINT32_C(0x1000)
22745 /* 10Mb link speed (Full-duplex) */
22746 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MB UINT32_C(0x2000)
22747 /*
22748 * This is a bit mask to indicate what speeds are supported
22749 * for EEE on this link.
22750 * For each speed that can be autonegotiated when EEE is enabled
22751 * on this link, the corresponding mask bit shall be set to '1'.
22752 * This field is only valid when the eee_suppotred is set to '1'.
22753 */
22754 uint16_t supported_speeds_eee_mode;
22755 /* Reserved */
22756 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD1 UINT32_C(0x1)
22757 /* 100Mb link speed (Full-duplex) */
22758 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_100MB UINT32_C(0x2)
22759 /* Reserved */
22760 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD2 UINT32_C(0x4)
22761 /* 1Gb link speed (Full-duplex) */
22762 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_1GB UINT32_C(0x8)
22763 /* Reserved */
22764 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD3 UINT32_C(0x10)
22765 /* Reserved */
22766 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD4 UINT32_C(0x20)
22767 /* 10Gb link speed */
22768 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_10GB UINT32_C(0x40)
22769 uint32_t tx_lpi_timer_low;
22770 /*
22771 * The lowest value of TX LPI timer that can be set on this link
22772 * when EEE is enabled. This value is in microseconds.
22773 * This field is valid only when_eee_supported is set to '1'.
22774 */
22775 #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_MASK UINT32_C(0xffffff)
22776 #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_SFT 0
22777 /*
22778 * Reserved field. The HWRM shall set this field to 0.
22779 * An HWRM client shall ignore this field.
22780 */
22781 #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_MASK UINT32_C(0xff000000)
22782 #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_SFT 24
22783 uint32_t valid_tx_lpi_timer_high;
22784 /*
22785 * The highest value of TX LPI timer that can be set on this link
22786 * when EEE is enabled. This value is in microseconds.
22787 * This field is valid only when_eee_supported is set to '1'.
22788 */
22789 #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_MASK UINT32_C(0xffffff)
22790 #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_SFT 0
22791 /*
22792 * Reserved field. The HWRM shall set this field to 0.
22793 * An HWRM client shall ignore this field.
22794 */
22795 #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD_MASK UINT32_C(0xff000000)
22796 #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD_SFT 24
22797 /*
22798 * This field is used to advertise which PAM4 speeds are supported
22799 * in auto mode.
22800 */
22801 uint16_t supported_pam4_speeds_auto_mode;
22802 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_AUTO_MODE_50G UINT32_C(0x1)
22803 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_AUTO_MODE_100G UINT32_C(0x2)
22804 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_AUTO_MODE_200G UINT32_C(0x4)
22805 /*
22806 * This field is used to advertise which PAM4 speeds are supported
22807 * in forced mode.
22808 */
22809 uint16_t supported_pam4_speeds_force_mode;
22810 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_FORCE_MODE_50G UINT32_C(0x1)
22811 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_FORCE_MODE_100G UINT32_C(0x2)
22812 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_FORCE_MODE_200G UINT32_C(0x4)
22813 uint8_t unused_0[3];
22814 /*
22815 * This field is used in Output records to indicate that the output
22816 * is completely written to RAM. This field should be read as '1'
22817 * to indicate that the output has been completely written.
22818 * When writing a command completion or response to an internal processor,
22819 * the order of writes has to be such that this field is written last.
22820 */
22821 uint8_t valid;
22822 } hwrm_port_phy_qcaps_output_t, *phwrm_port_phy_qcaps_output_t;
22823
22824 /****************************
22825 * hwrm_port_phy_mdio_write *
22826 ****************************/
22827
22828
22829 /* hwrm_port_phy_mdio_write_input (size:320b/40B) */
22830
22831 typedef struct hwrm_port_phy_mdio_write_input {
22832 /* The HWRM command request type. */
22833 uint16_t req_type;
22834 /*
22835 * The completion ring to send the completion event on. This should
22836 * be the NQ ID returned from the `nq_alloc` HWRM command.
22837 */
22838 uint16_t cmpl_ring;
22839 /*
22840 * The sequence ID is used by the driver for tracking multiple
22841 * commands. This ID is treated as opaque data by the firmware and
22842 * the value is returned in the `hwrm_resp_hdr` upon completion.
22843 */
22844 uint16_t seq_id;
22845 /*
22846 * The target ID of the command:
22847 * * 0x0-0xFFF8 - The function ID
22848 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22849 * * 0xFFFD - Reserved for user-space HWRM interface
22850 * * 0xFFFF - HWRM
22851 */
22852 uint16_t target_id;
22853 /*
22854 * A physical address pointer pointing to a host buffer that the
22855 * command's response data will be written. This can be either a host
22856 * physical address (HPA) or a guest physical address (GPA) and must
22857 * point to a physically contiguous block of memory.
22858 */
22859 uint64_t resp_addr;
22860 /* Reserved for future use. */
22861 uint64_t unused_0;
22862 /* Port ID of port. */
22863 uint16_t port_id;
22864 /* If phy_address is 0xFF, port_id will be used to derive phy_addr. */
22865 uint8_t phy_addr;
22866 /* 8-bit device address. */
22867 uint8_t dev_addr;
22868 /* 16-bit register address. */
22869 uint16_t reg_addr;
22870 /* 16-bit register data. */
22871 uint16_t reg_data;
22872 /*
22873 * When this bit is set to 1 a Clause 45 mdio access is done.
22874 * when this bit is set to 0 a Clause 22 mdio access is done.
22875 */
22876 uint8_t cl45_mdio;
22877 /* */
22878 uint8_t unused_1[7];
22879 } hwrm_port_phy_mdio_write_input_t, *phwrm_port_phy_mdio_write_input_t;
22880
22881 /* hwrm_port_phy_mdio_write_output (size:128b/16B) */
22882
22883 typedef struct hwrm_port_phy_mdio_write_output {
22884 /* The specific error status for the command. */
22885 uint16_t error_code;
22886 /* The HWRM command request type. */
22887 uint16_t req_type;
22888 /* The sequence ID from the original command. */
22889 uint16_t seq_id;
22890 /* The length of the response data in number of bytes. */
22891 uint16_t resp_len;
22892 uint8_t unused_0[7];
22893 /*
22894 * This field is used in Output records to indicate that the output
22895 * is completely written to RAM. This field should be read as '1'
22896 * to indicate that the output has been completely written.
22897 * When writing a command completion or response to an internal processor,
22898 * the order of writes has to be such that this field is written last.
22899 */
22900 uint8_t valid;
22901 } hwrm_port_phy_mdio_write_output_t, *phwrm_port_phy_mdio_write_output_t;
22902
22903 /***************************
22904 * hwrm_port_phy_mdio_read *
22905 ***************************/
22906
22907
22908 /* hwrm_port_phy_mdio_read_input (size:256b/32B) */
22909
22910 typedef struct hwrm_port_phy_mdio_read_input {
22911 /* The HWRM command request type. */
22912 uint16_t req_type;
22913 /*
22914 * The completion ring to send the completion event on. This should
22915 * be the NQ ID returned from the `nq_alloc` HWRM command.
22916 */
22917 uint16_t cmpl_ring;
22918 /*
22919 * The sequence ID is used by the driver for tracking multiple
22920 * commands. This ID is treated as opaque data by the firmware and
22921 * the value is returned in the `hwrm_resp_hdr` upon completion.
22922 */
22923 uint16_t seq_id;
22924 /*
22925 * The target ID of the command:
22926 * * 0x0-0xFFF8 - The function ID
22927 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22928 * * 0xFFFD - Reserved for user-space HWRM interface
22929 * * 0xFFFF - HWRM
22930 */
22931 uint16_t target_id;
22932 /*
22933 * A physical address pointer pointing to a host buffer that the
22934 * command's response data will be written. This can be either a host
22935 * physical address (HPA) or a guest physical address (GPA) and must
22936 * point to a physically contiguous block of memory.
22937 */
22938 uint64_t resp_addr;
22939 /* Reserved for future use. */
22940 uint64_t unused_0;
22941 /* Port ID of port. */
22942 uint16_t port_id;
22943 /* If phy_address is 0xFF, port_id will be used to derive phy_addr. */
22944 uint8_t phy_addr;
22945 /* 8-bit device address. */
22946 uint8_t dev_addr;
22947 /* 16-bit register address. */
22948 uint16_t reg_addr;
22949 /*
22950 * When this bit is set to 1 a Clause 45 mdio access is done.
22951 * when this bit is set to 0 a Clause 22 mdio access is done.
22952 */
22953 uint8_t cl45_mdio;
22954 /* */
22955 uint8_t unused_1;
22956 } hwrm_port_phy_mdio_read_input_t, *phwrm_port_phy_mdio_read_input_t;
22957
22958 /* hwrm_port_phy_mdio_read_output (size:128b/16B) */
22959
22960 typedef struct hwrm_port_phy_mdio_read_output {
22961 /* The specific error status for the command. */
22962 uint16_t error_code;
22963 /* The HWRM command request type. */
22964 uint16_t req_type;
22965 /* The sequence ID from the original command. */
22966 uint16_t seq_id;
22967 /* The length of the response data in number of bytes. */
22968 uint16_t resp_len;
22969 /* 16-bit register data. */
22970 uint16_t reg_data;
22971 uint8_t unused_0[5];
22972 /*
22973 * This field is used in Output records to indicate that the output
22974 * is completely written to RAM. This field should be read as '1'
22975 * to indicate that the output has been completely written.
22976 * When writing a command completion or response to an internal processor,
22977 * the order of writes has to be such that this field is written last.
22978 */
22979 uint8_t valid;
22980 } hwrm_port_phy_mdio_read_output_t, *phwrm_port_phy_mdio_read_output_t;
22981
22982 /*********************
22983 * hwrm_port_led_cfg *
22984 *********************/
22985
22986
22987 /* hwrm_port_led_cfg_input (size:512b/64B) */
22988
22989 typedef struct hwrm_port_led_cfg_input {
22990 /* The HWRM command request type. */
22991 uint16_t req_type;
22992 /*
22993 * The completion ring to send the completion event on. This should
22994 * be the NQ ID returned from the `nq_alloc` HWRM command.
22995 */
22996 uint16_t cmpl_ring;
22997 /*
22998 * The sequence ID is used by the driver for tracking multiple
22999 * commands. This ID is treated as opaque data by the firmware and
23000 * the value is returned in the `hwrm_resp_hdr` upon completion.
23001 */
23002 uint16_t seq_id;
23003 /*
23004 * The target ID of the command:
23005 * * 0x0-0xFFF8 - The function ID
23006 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23007 * * 0xFFFD - Reserved for user-space HWRM interface
23008 * * 0xFFFF - HWRM
23009 */
23010 uint16_t target_id;
23011 /*
23012 * A physical address pointer pointing to a host buffer that the
23013 * command's response data will be written. This can be either a host
23014 * physical address (HPA) or a guest physical address (GPA) and must
23015 * point to a physically contiguous block of memory.
23016 */
23017 uint64_t resp_addr;
23018 uint32_t enables;
23019 /*
23020 * This bit must be '1' for the led0_id field to be
23021 * configured.
23022 */
23023 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_ID UINT32_C(0x1)
23024 /*
23025 * This bit must be '1' for the led0_state field to be
23026 * configured.
23027 */
23028 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_STATE UINT32_C(0x2)
23029 /*
23030 * This bit must be '1' for the led0_color field to be
23031 * configured.
23032 */
23033 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_COLOR UINT32_C(0x4)
23034 /*
23035 * This bit must be '1' for the led0_blink_on field to be
23036 * configured.
23037 */
23038 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_ON UINT32_C(0x8)
23039 /*
23040 * This bit must be '1' for the led0_blink_off field to be
23041 * configured.
23042 */
23043 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_OFF UINT32_C(0x10)
23044 /*
23045 * This bit must be '1' for the led0_group_id field to be
23046 * configured.
23047 */
23048 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_GROUP_ID UINT32_C(0x20)
23049 /*
23050 * This bit must be '1' for the led1_id field to be
23051 * configured.
23052 */
23053 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_ID UINT32_C(0x40)
23054 /*
23055 * This bit must be '1' for the led1_state field to be
23056 * configured.
23057 */
23058 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_STATE UINT32_C(0x80)
23059 /*
23060 * This bit must be '1' for the led1_color field to be
23061 * configured.
23062 */
23063 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_COLOR UINT32_C(0x100)
23064 /*
23065 * This bit must be '1' for the led1_blink_on field to be
23066 * configured.
23067 */
23068 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_ON UINT32_C(0x200)
23069 /*
23070 * This bit must be '1' for the led1_blink_off field to be
23071 * configured.
23072 */
23073 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_OFF UINT32_C(0x400)
23074 /*
23075 * This bit must be '1' for the led1_group_id field to be
23076 * configured.
23077 */
23078 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_GROUP_ID UINT32_C(0x800)
23079 /*
23080 * This bit must be '1' for the led2_id field to be
23081 * configured.
23082 */
23083 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_ID UINT32_C(0x1000)
23084 /*
23085 * This bit must be '1' for the led2_state field to be
23086 * configured.
23087 */
23088 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_STATE UINT32_C(0x2000)
23089 /*
23090 * This bit must be '1' for the led2_color field to be
23091 * configured.
23092 */
23093 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_COLOR UINT32_C(0x4000)
23094 /*
23095 * This bit must be '1' for the led2_blink_on field to be
23096 * configured.
23097 */
23098 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_ON UINT32_C(0x8000)
23099 /*
23100 * This bit must be '1' for the led2_blink_off field to be
23101 * configured.
23102 */
23103 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_OFF UINT32_C(0x10000)
23104 /*
23105 * This bit must be '1' for the led2_group_id field to be
23106 * configured.
23107 */
23108 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_GROUP_ID UINT32_C(0x20000)
23109 /*
23110 * This bit must be '1' for the led3_id field to be
23111 * configured.
23112 */
23113 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_ID UINT32_C(0x40000)
23114 /*
23115 * This bit must be '1' for the led3_state field to be
23116 * configured.
23117 */
23118 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_STATE UINT32_C(0x80000)
23119 /*
23120 * This bit must be '1' for the led3_color field to be
23121 * configured.
23122 */
23123 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_COLOR UINT32_C(0x100000)
23124 /*
23125 * This bit must be '1' for the led3_blink_on field to be
23126 * configured.
23127 */
23128 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_ON UINT32_C(0x200000)
23129 /*
23130 * This bit must be '1' for the led3_blink_off field to be
23131 * configured.
23132 */
23133 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_OFF UINT32_C(0x400000)
23134 /*
23135 * This bit must be '1' for the led3_group_id field to be
23136 * configured.
23137 */
23138 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_GROUP_ID UINT32_C(0x800000)
23139 /* Port ID of port whose LEDs are configured. */
23140 uint16_t port_id;
23141 /*
23142 * The number of LEDs that are being configured.
23143 * Up to 4 LEDs can be configured with this command.
23144 */
23145 uint8_t num_leds;
23146 /* Reserved field. */
23147 uint8_t rsvd;
23148 /* An identifier for the LED #0. */
23149 uint8_t led0_id;
23150 /* The requested state of the LED #0. */
23151 uint8_t led0_state;
23152 /* Default state of the LED */
23153 #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_DEFAULT UINT32_C(0x0)
23154 /* Off */
23155 #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_OFF UINT32_C(0x1)
23156 /* On */
23157 #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_ON UINT32_C(0x2)
23158 /* Blink */
23159 #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINK UINT32_C(0x3)
23160 /* Blink Alternately */
23161 #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
23162 #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_LAST HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT
23163 /* The requested color of LED #0. */
23164 uint8_t led0_color;
23165 /* Default */
23166 #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_DEFAULT UINT32_C(0x0)
23167 /* Amber */
23168 #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_AMBER UINT32_C(0x1)
23169 /* Green */
23170 #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREEN UINT32_C(0x2)
23171 /* Green or Amber */
23172 #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
23173 #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_LAST HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER
23174 uint8_t unused_0;
23175 /*
23176 * If the LED #0 state is "blink" or "blinkalt", then
23177 * this field represents the requested time in milliseconds
23178 * to keep LED on between cycles.
23179 */
23180 uint16_t led0_blink_on;
23181 /*
23182 * If the LED #0 state is "blink" or "blinkalt", then
23183 * this field represents the requested time in milliseconds
23184 * to keep LED off between cycles.
23185 */
23186 uint16_t led0_blink_off;
23187 /*
23188 * An identifier for the group of LEDs that LED #0 belongs
23189 * to.
23190 * If set to 0, then the LED #0 shall not be grouped and
23191 * shall be treated as an individual resource.
23192 * For all other non-zero values of this field, LED #0 shall
23193 * be grouped together with the LEDs with the same group ID
23194 * value.
23195 */
23196 uint8_t led0_group_id;
23197 /* Reserved field. */
23198 uint8_t rsvd0;
23199 /* An identifier for the LED #1. */
23200 uint8_t led1_id;
23201 /* The requested state of the LED #1. */
23202 uint8_t led1_state;
23203 /* Default state of the LED */
23204 #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_DEFAULT UINT32_C(0x0)
23205 /* Off */
23206 #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_OFF UINT32_C(0x1)
23207 /* On */
23208 #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_ON UINT32_C(0x2)
23209 /* Blink */
23210 #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINK UINT32_C(0x3)
23211 /* Blink Alternately */
23212 #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
23213 #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_LAST HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT
23214 /* The requested color of LED #1. */
23215 uint8_t led1_color;
23216 /* Default */
23217 #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_DEFAULT UINT32_C(0x0)
23218 /* Amber */
23219 #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_AMBER UINT32_C(0x1)
23220 /* Green */
23221 #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREEN UINT32_C(0x2)
23222 /* Green or Amber */
23223 #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
23224 #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_LAST HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER
23225 uint8_t unused_1;
23226 /*
23227 * If the LED #1 state is "blink" or "blinkalt", then
23228 * this field represents the requested time in milliseconds
23229 * to keep LED on between cycles.
23230 */
23231 uint16_t led1_blink_on;
23232 /*
23233 * If the LED #1 state is "blink" or "blinkalt", then
23234 * this field represents the requested time in milliseconds
23235 * to keep LED off between cycles.
23236 */
23237 uint16_t led1_blink_off;
23238 /*
23239 * An identifier for the group of LEDs that LED #1 belongs
23240 * to.
23241 * If set to 0, then the LED #1 shall not be grouped and
23242 * shall be treated as an individual resource.
23243 * For all other non-zero values of this field, LED #1 shall
23244 * be grouped together with the LEDs with the same group ID
23245 * value.
23246 */
23247 uint8_t led1_group_id;
23248 /* Reserved field. */
23249 uint8_t rsvd1;
23250 /* An identifier for the LED #2. */
23251 uint8_t led2_id;
23252 /* The requested state of the LED #2. */
23253 uint8_t led2_state;
23254 /* Default state of the LED */
23255 #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_DEFAULT UINT32_C(0x0)
23256 /* Off */
23257 #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_OFF UINT32_C(0x1)
23258 /* On */
23259 #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_ON UINT32_C(0x2)
23260 /* Blink */
23261 #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINK UINT32_C(0x3)
23262 /* Blink Alternately */
23263 #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
23264 #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_LAST HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT
23265 /* The requested color of LED #2. */
23266 uint8_t led2_color;
23267 /* Default */
23268 #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_DEFAULT UINT32_C(0x0)
23269 /* Amber */
23270 #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_AMBER UINT32_C(0x1)
23271 /* Green */
23272 #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREEN UINT32_C(0x2)
23273 /* Green or Amber */
23274 #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
23275 #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_LAST HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER
23276 uint8_t unused_2;
23277 /*
23278 * If the LED #2 state is "blink" or "blinkalt", then
23279 * this field represents the requested time in milliseconds
23280 * to keep LED on between cycles.
23281 */
23282 uint16_t led2_blink_on;
23283 /*
23284 * If the LED #2 state is "blink" or "blinkalt", then
23285 * this field represents the requested time in milliseconds
23286 * to keep LED off between cycles.
23287 */
23288 uint16_t led2_blink_off;
23289 /*
23290 * An identifier for the group of LEDs that LED #2 belongs
23291 * to.
23292 * If set to 0, then the LED #2 shall not be grouped and
23293 * shall be treated as an individual resource.
23294 * For all other non-zero values of this field, LED #2 shall
23295 * be grouped together with the LEDs with the same group ID
23296 * value.
23297 */
23298 uint8_t led2_group_id;
23299 /* Reserved field. */
23300 uint8_t rsvd2;
23301 /* An identifier for the LED #3. */
23302 uint8_t led3_id;
23303 /* The requested state of the LED #3. */
23304 uint8_t led3_state;
23305 /* Default state of the LED */
23306 #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_DEFAULT UINT32_C(0x0)
23307 /* Off */
23308 #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_OFF UINT32_C(0x1)
23309 /* On */
23310 #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_ON UINT32_C(0x2)
23311 /* Blink */
23312 #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINK UINT32_C(0x3)
23313 /* Blink Alternately */
23314 #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
23315 #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_LAST HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT
23316 /* The requested color of LED #3. */
23317 uint8_t led3_color;
23318 /* Default */
23319 #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_DEFAULT UINT32_C(0x0)
23320 /* Amber */
23321 #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_AMBER UINT32_C(0x1)
23322 /* Green */
23323 #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREEN UINT32_C(0x2)
23324 /* Green or Amber */
23325 #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
23326 #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_LAST HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER
23327 uint8_t unused_3;
23328 /*
23329 * If the LED #3 state is "blink" or "blinkalt", then
23330 * this field represents the requested time in milliseconds
23331 * to keep LED on between cycles.
23332 */
23333 uint16_t led3_blink_on;
23334 /*
23335 * If the LED #3 state is "blink" or "blinkalt", then
23336 * this field represents the requested time in milliseconds
23337 * to keep LED off between cycles.
23338 */
23339 uint16_t led3_blink_off;
23340 /*
23341 * An identifier for the group of LEDs that LED #3 belongs
23342 * to.
23343 * If set to 0, then the LED #3 shall not be grouped and
23344 * shall be treated as an individual resource.
23345 * For all other non-zero values of this field, LED #3 shall
23346 * be grouped together with the LEDs with the same group ID
23347 * value.
23348 */
23349 uint8_t led3_group_id;
23350 /* Reserved field. */
23351 uint8_t rsvd3;
23352 } hwrm_port_led_cfg_input_t, *phwrm_port_led_cfg_input_t;
23353
23354 /* hwrm_port_led_cfg_output (size:128b/16B) */
23355
23356 typedef struct hwrm_port_led_cfg_output {
23357 /* The specific error status for the command. */
23358 uint16_t error_code;
23359 /* The HWRM command request type. */
23360 uint16_t req_type;
23361 /* The sequence ID from the original command. */
23362 uint16_t seq_id;
23363 /* The length of the response data in number of bytes. */
23364 uint16_t resp_len;
23365 uint8_t unused_0[7];
23366 /*
23367 * This field is used in Output records to indicate that the output
23368 * is completely written to RAM. This field should be read as '1'
23369 * to indicate that the output has been completely written.
23370 * When writing a command completion or response to an internal processor,
23371 * the order of writes has to be such that this field is written last.
23372 */
23373 uint8_t valid;
23374 } hwrm_port_led_cfg_output_t, *phwrm_port_led_cfg_output_t;
23375
23376 /**********************
23377 * hwrm_port_led_qcfg *
23378 **********************/
23379
23380
23381 /* hwrm_port_led_qcfg_input (size:192b/24B) */
23382
23383 typedef struct hwrm_port_led_qcfg_input {
23384 /* The HWRM command request type. */
23385 uint16_t req_type;
23386 /*
23387 * The completion ring to send the completion event on. This should
23388 * be the NQ ID returned from the `nq_alloc` HWRM command.
23389 */
23390 uint16_t cmpl_ring;
23391 /*
23392 * The sequence ID is used by the driver for tracking multiple
23393 * commands. This ID is treated as opaque data by the firmware and
23394 * the value is returned in the `hwrm_resp_hdr` upon completion.
23395 */
23396 uint16_t seq_id;
23397 /*
23398 * The target ID of the command:
23399 * * 0x0-0xFFF8 - The function ID
23400 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23401 * * 0xFFFD - Reserved for user-space HWRM interface
23402 * * 0xFFFF - HWRM
23403 */
23404 uint16_t target_id;
23405 /*
23406 * A physical address pointer pointing to a host buffer that the
23407 * command's response data will be written. This can be either a host
23408 * physical address (HPA) or a guest physical address (GPA) and must
23409 * point to a physically contiguous block of memory.
23410 */
23411 uint64_t resp_addr;
23412 /* Port ID of port whose LED configuration is being queried. */
23413 uint16_t port_id;
23414 uint8_t unused_0[6];
23415 } hwrm_port_led_qcfg_input_t, *phwrm_port_led_qcfg_input_t;
23416
23417 /* hwrm_port_led_qcfg_output (size:448b/56B) */
23418
23419 typedef struct hwrm_port_led_qcfg_output {
23420 /* The specific error status for the command. */
23421 uint16_t error_code;
23422 /* The HWRM command request type. */
23423 uint16_t req_type;
23424 /* The sequence ID from the original command. */
23425 uint16_t seq_id;
23426 /* The length of the response data in number of bytes. */
23427 uint16_t resp_len;
23428 /*
23429 * The number of LEDs that are configured on this port.
23430 * Up to 4 LEDs can be returned in the response.
23431 */
23432 uint8_t num_leds;
23433 /* An identifier for the LED #0. */
23434 uint8_t led0_id;
23435 /* The type of LED #0. */
23436 uint8_t led0_type;
23437 /* Speed LED */
23438 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_SPEED UINT32_C(0x0)
23439 /* Activity LED */
23440 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
23441 /* Invalid */
23442 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID UINT32_C(0xff)
23443 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_LAST HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID
23444 /* The current state of the LED #0. */
23445 uint8_t led0_state;
23446 /* Default state of the LED */
23447 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_DEFAULT UINT32_C(0x0)
23448 /* Off */
23449 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_OFF UINT32_C(0x1)
23450 /* On */
23451 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_ON UINT32_C(0x2)
23452 /* Blink */
23453 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINK UINT32_C(0x3)
23454 /* Blink Alternately */
23455 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
23456 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_LAST HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT
23457 /* The color of LED #0. */
23458 uint8_t led0_color;
23459 /* Default */
23460 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_DEFAULT UINT32_C(0x0)
23461 /* Amber */
23462 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_AMBER UINT32_C(0x1)
23463 /* Green */
23464 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREEN UINT32_C(0x2)
23465 /* Green or Amber */
23466 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
23467 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_LAST HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER
23468 uint8_t unused_0;
23469 /*
23470 * If the LED #0 state is "blink" or "blinkalt", then
23471 * this field represents the requested time in milliseconds
23472 * to keep LED on between cycles.
23473 */
23474 uint16_t led0_blink_on;
23475 /*
23476 * If the LED #0 state is "blink" or "blinkalt", then
23477 * this field represents the requested time in milliseconds
23478 * to keep LED off between cycles.
23479 */
23480 uint16_t led0_blink_off;
23481 /*
23482 * An identifier for the group of LEDs that LED #0 belongs
23483 * to.
23484 * If set to 0, then the LED #0 is not grouped.
23485 * For all other non-zero values of this field, LED #0 is
23486 * grouped together with the LEDs with the same group ID
23487 * value.
23488 */
23489 uint8_t led0_group_id;
23490 /* An identifier for the LED #1. */
23491 uint8_t led1_id;
23492 /* The type of LED #1. */
23493 uint8_t led1_type;
23494 /* Speed LED */
23495 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_SPEED UINT32_C(0x0)
23496 /* Activity LED */
23497 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
23498 /* Invalid */
23499 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID UINT32_C(0xff)
23500 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_LAST HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID
23501 /* The current state of the LED #1. */
23502 uint8_t led1_state;
23503 /* Default state of the LED */
23504 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_DEFAULT UINT32_C(0x0)
23505 /* Off */
23506 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_OFF UINT32_C(0x1)
23507 /* On */
23508 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_ON UINT32_C(0x2)
23509 /* Blink */
23510 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINK UINT32_C(0x3)
23511 /* Blink Alternately */
23512 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
23513 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_LAST HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT
23514 /* The color of LED #1. */
23515 uint8_t led1_color;
23516 /* Default */
23517 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_DEFAULT UINT32_C(0x0)
23518 /* Amber */
23519 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_AMBER UINT32_C(0x1)
23520 /* Green */
23521 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREEN UINT32_C(0x2)
23522 /* Green or Amber */
23523 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
23524 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_LAST HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER
23525 uint8_t unused_1;
23526 /*
23527 * If the LED #1 state is "blink" or "blinkalt", then
23528 * this field represents the requested time in milliseconds
23529 * to keep LED on between cycles.
23530 */
23531 uint16_t led1_blink_on;
23532 /*
23533 * If the LED #1 state is "blink" or "blinkalt", then
23534 * this field represents the requested time in milliseconds
23535 * to keep LED off between cycles.
23536 */
23537 uint16_t led1_blink_off;
23538 /*
23539 * An identifier for the group of LEDs that LED #1 belongs
23540 * to.
23541 * If set to 0, then the LED #1 is not grouped.
23542 * For all other non-zero values of this field, LED #1 is
23543 * grouped together with the LEDs with the same group ID
23544 * value.
23545 */
23546 uint8_t led1_group_id;
23547 /* An identifier for the LED #2. */
23548 uint8_t led2_id;
23549 /* The type of LED #2. */
23550 uint8_t led2_type;
23551 /* Speed LED */
23552 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_SPEED UINT32_C(0x0)
23553 /* Activity LED */
23554 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
23555 /* Invalid */
23556 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID UINT32_C(0xff)
23557 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_LAST HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID
23558 /* The current state of the LED #2. */
23559 uint8_t led2_state;
23560 /* Default state of the LED */
23561 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_DEFAULT UINT32_C(0x0)
23562 /* Off */
23563 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_OFF UINT32_C(0x1)
23564 /* On */
23565 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_ON UINT32_C(0x2)
23566 /* Blink */
23567 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINK UINT32_C(0x3)
23568 /* Blink Alternately */
23569 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
23570 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_LAST HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT
23571 /* The color of LED #2. */
23572 uint8_t led2_color;
23573 /* Default */
23574 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_DEFAULT UINT32_C(0x0)
23575 /* Amber */
23576 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_AMBER UINT32_C(0x1)
23577 /* Green */
23578 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREEN UINT32_C(0x2)
23579 /* Green or Amber */
23580 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
23581 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_LAST HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER
23582 uint8_t unused_2;
23583 /*
23584 * If the LED #2 state is "blink" or "blinkalt", then
23585 * this field represents the requested time in milliseconds
23586 * to keep LED on between cycles.
23587 */
23588 uint16_t led2_blink_on;
23589 /*
23590 * If the LED #2 state is "blink" or "blinkalt", then
23591 * this field represents the requested time in milliseconds
23592 * to keep LED off between cycles.
23593 */
23594 uint16_t led2_blink_off;
23595 /*
23596 * An identifier for the group of LEDs that LED #2 belongs
23597 * to.
23598 * If set to 0, then the LED #2 is not grouped.
23599 * For all other non-zero values of this field, LED #2 is
23600 * grouped together with the LEDs with the same group ID
23601 * value.
23602 */
23603 uint8_t led2_group_id;
23604 /* An identifier for the LED #3. */
23605 uint8_t led3_id;
23606 /* The type of LED #3. */
23607 uint8_t led3_type;
23608 /* Speed LED */
23609 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_SPEED UINT32_C(0x0)
23610 /* Activity LED */
23611 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
23612 /* Invalid */
23613 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID UINT32_C(0xff)
23614 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_LAST HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID
23615 /* The current state of the LED #3. */
23616 uint8_t led3_state;
23617 /* Default state of the LED */
23618 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_DEFAULT UINT32_C(0x0)
23619 /* Off */
23620 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_OFF UINT32_C(0x1)
23621 /* On */
23622 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_ON UINT32_C(0x2)
23623 /* Blink */
23624 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINK UINT32_C(0x3)
23625 /* Blink Alternately */
23626 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
23627 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_LAST HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT
23628 /* The color of LED #3. */
23629 uint8_t led3_color;
23630 /* Default */
23631 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_DEFAULT UINT32_C(0x0)
23632 /* Amber */
23633 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_AMBER UINT32_C(0x1)
23634 /* Green */
23635 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREEN UINT32_C(0x2)
23636 /* Green or Amber */
23637 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
23638 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_LAST HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER
23639 uint8_t unused_3;
23640 /*
23641 * If the LED #3 state is "blink" or "blinkalt", then
23642 * this field represents the requested time in milliseconds
23643 * to keep LED on between cycles.
23644 */
23645 uint16_t led3_blink_on;
23646 /*
23647 * If the LED #3 state is "blink" or "blinkalt", then
23648 * this field represents the requested time in milliseconds
23649 * to keep LED off between cycles.
23650 */
23651 uint16_t led3_blink_off;
23652 /*
23653 * An identifier for the group of LEDs that LED #3 belongs
23654 * to.
23655 * If set to 0, then the LED #3 is not grouped.
23656 * For all other non-zero values of this field, LED #3 is
23657 * grouped together with the LEDs with the same group ID
23658 * value.
23659 */
23660 uint8_t led3_group_id;
23661 uint8_t unused_4[6];
23662 /*
23663 * This field is used in Output records to indicate that the output
23664 * is completely written to RAM. This field should be read as '1'
23665 * to indicate that the output has been completely written.
23666 * When writing a command completion or response to an internal processor,
23667 * the order of writes has to be such that this field is written last.
23668 */
23669 uint8_t valid;
23670 } hwrm_port_led_qcfg_output_t, *phwrm_port_led_qcfg_output_t;
23671
23672 /***********************
23673 * hwrm_port_led_qcaps *
23674 ***********************/
23675
23676
23677 /* hwrm_port_led_qcaps_input (size:192b/24B) */
23678
23679 typedef struct hwrm_port_led_qcaps_input {
23680 /* The HWRM command request type. */
23681 uint16_t req_type;
23682 /*
23683 * The completion ring to send the completion event on. This should
23684 * be the NQ ID returned from the `nq_alloc` HWRM command.
23685 */
23686 uint16_t cmpl_ring;
23687 /*
23688 * The sequence ID is used by the driver for tracking multiple
23689 * commands. This ID is treated as opaque data by the firmware and
23690 * the value is returned in the `hwrm_resp_hdr` upon completion.
23691 */
23692 uint16_t seq_id;
23693 /*
23694 * The target ID of the command:
23695 * * 0x0-0xFFF8 - The function ID
23696 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23697 * * 0xFFFD - Reserved for user-space HWRM interface
23698 * * 0xFFFF - HWRM
23699 */
23700 uint16_t target_id;
23701 /*
23702 * A physical address pointer pointing to a host buffer that the
23703 * command's response data will be written. This can be either a host
23704 * physical address (HPA) or a guest physical address (GPA) and must
23705 * point to a physically contiguous block of memory.
23706 */
23707 uint64_t resp_addr;
23708 /* Port ID of port whose LED configuration is being queried. */
23709 uint16_t port_id;
23710 uint8_t unused_0[6];
23711 } hwrm_port_led_qcaps_input_t, *phwrm_port_led_qcaps_input_t;
23712
23713 /* hwrm_port_led_qcaps_output (size:384b/48B) */
23714
23715 typedef struct hwrm_port_led_qcaps_output {
23716 /* The specific error status for the command. */
23717 uint16_t error_code;
23718 /* The HWRM command request type. */
23719 uint16_t req_type;
23720 /* The sequence ID from the original command. */
23721 uint16_t seq_id;
23722 /* The length of the response data in number of bytes. */
23723 uint16_t resp_len;
23724 /*
23725 * The number of LEDs that are configured on this port.
23726 * Up to 4 LEDs can be returned in the response.
23727 */
23728 uint8_t num_leds;
23729 /* Reserved for future use. */
23730 uint8_t unused[3];
23731 /* An identifier for the LED #0. */
23732 uint8_t led0_id;
23733 /* The type of LED #0. */
23734 uint8_t led0_type;
23735 /* Speed LED */
23736 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_SPEED UINT32_C(0x0)
23737 /* Activity LED */
23738 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
23739 /* Invalid */
23740 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID UINT32_C(0xff)
23741 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_LAST HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID
23742 /*
23743 * An identifier for the group of LEDs that LED #0 belongs
23744 * to.
23745 * If set to 0, then the LED #0 cannot be grouped.
23746 * For all other non-zero values of this field, LED #0 is
23747 * grouped together with the LEDs with the same group ID
23748 * value.
23749 */
23750 uint8_t led0_group_id;
23751 uint8_t unused_0;
23752 /* The states supported by LED #0. */
23753 uint16_t led0_state_caps;
23754 /*
23755 * If set to 1, this LED is enabled.
23756 * If set to 0, this LED is disabled.
23757 */
23758 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ENABLED UINT32_C(0x1)
23759 /*
23760 * If set to 1, off state is supported on this LED.
23761 * If set to 0, off state is not supported on this LED.
23762 */
23763 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_OFF_SUPPORTED UINT32_C(0x2)
23764 /*
23765 * If set to 1, on state is supported on this LED.
23766 * If set to 0, on state is not supported on this LED.
23767 */
23768 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ON_SUPPORTED UINT32_C(0x4)
23769 /*
23770 * If set to 1, blink state is supported on this LED.
23771 * If set to 0, blink state is not supported on this LED.
23772 */
23773 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_SUPPORTED UINT32_C(0x8)
23774 /*
23775 * If set to 1, blink_alt state is supported on this LED.
23776 * If set to 0, blink_alt state is not supported on this LED.
23777 */
23778 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_ALT_SUPPORTED UINT32_C(0x10)
23779 /* The colors supported by LED #0. */
23780 uint16_t led0_color_caps;
23781 /* reserved. */
23782 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_RSVD UINT32_C(0x1)
23783 /*
23784 * If set to 1, Amber color is supported on this LED.
23785 * If set to 0, Amber color is not supported on this LED.
23786 */
23787 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_AMBER_SUPPORTED UINT32_C(0x2)
23788 /*
23789 * If set to 1, Green color is supported on this LED.
23790 * If set to 0, Green color is not supported on this LED.
23791 */
23792 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_GREEN_SUPPORTED UINT32_C(0x4)
23793 /* An identifier for the LED #1. */
23794 uint8_t led1_id;
23795 /* The type of LED #1. */
23796 uint8_t led1_type;
23797 /* Speed LED */
23798 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_SPEED UINT32_C(0x0)
23799 /* Activity LED */
23800 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
23801 /* Invalid */
23802 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID UINT32_C(0xff)
23803 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_LAST HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID
23804 /*
23805 * An identifier for the group of LEDs that LED #1 belongs
23806 * to.
23807 * If set to 0, then the LED #0 cannot be grouped.
23808 * For all other non-zero values of this field, LED #0 is
23809 * grouped together with the LEDs with the same group ID
23810 * value.
23811 */
23812 uint8_t led1_group_id;
23813 uint8_t unused_1;
23814 /* The states supported by LED #1. */
23815 uint16_t led1_state_caps;
23816 /*
23817 * If set to 1, this LED is enabled.
23818 * If set to 0, this LED is disabled.
23819 */
23820 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ENABLED UINT32_C(0x1)
23821 /*
23822 * If set to 1, off state is supported on this LED.
23823 * If set to 0, off state is not supported on this LED.
23824 */
23825 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_OFF_SUPPORTED UINT32_C(0x2)
23826 /*
23827 * If set to 1, on state is supported on this LED.
23828 * If set to 0, on state is not supported on this LED.
23829 */
23830 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ON_SUPPORTED UINT32_C(0x4)
23831 /*
23832 * If set to 1, blink state is supported on this LED.
23833 * If set to 0, blink state is not supported on this LED.
23834 */
23835 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_SUPPORTED UINT32_C(0x8)
23836 /*
23837 * If set to 1, blink_alt state is supported on this LED.
23838 * If set to 0, blink_alt state is not supported on this LED.
23839 */
23840 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_ALT_SUPPORTED UINT32_C(0x10)
23841 /* The colors supported by LED #1. */
23842 uint16_t led1_color_caps;
23843 /* reserved. */
23844 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_RSVD UINT32_C(0x1)
23845 /*
23846 * If set to 1, Amber color is supported on this LED.
23847 * If set to 0, Amber color is not supported on this LED.
23848 */
23849 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_AMBER_SUPPORTED UINT32_C(0x2)
23850 /*
23851 * If set to 1, Green color is supported on this LED.
23852 * If set to 0, Green color is not supported on this LED.
23853 */
23854 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_GREEN_SUPPORTED UINT32_C(0x4)
23855 /* An identifier for the LED #2. */
23856 uint8_t led2_id;
23857 /* The type of LED #2. */
23858 uint8_t led2_type;
23859 /* Speed LED */
23860 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_SPEED UINT32_C(0x0)
23861 /* Activity LED */
23862 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
23863 /* Invalid */
23864 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID UINT32_C(0xff)
23865 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_LAST HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID
23866 /*
23867 * An identifier for the group of LEDs that LED #0 belongs
23868 * to.
23869 * If set to 0, then the LED #0 cannot be grouped.
23870 * For all other non-zero values of this field, LED #0 is
23871 * grouped together with the LEDs with the same group ID
23872 * value.
23873 */
23874 uint8_t led2_group_id;
23875 uint8_t unused_2;
23876 /* The states supported by LED #2. */
23877 uint16_t led2_state_caps;
23878 /*
23879 * If set to 1, this LED is enabled.
23880 * If set to 0, this LED is disabled.
23881 */
23882 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ENABLED UINT32_C(0x1)
23883 /*
23884 * If set to 1, off state is supported on this LED.
23885 * If set to 0, off state is not supported on this LED.
23886 */
23887 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_OFF_SUPPORTED UINT32_C(0x2)
23888 /*
23889 * If set to 1, on state is supported on this LED.
23890 * If set to 0, on state is not supported on this LED.
23891 */
23892 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ON_SUPPORTED UINT32_C(0x4)
23893 /*
23894 * If set to 1, blink state is supported on this LED.
23895 * If set to 0, blink state is not supported on this LED.
23896 */
23897 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_SUPPORTED UINT32_C(0x8)
23898 /*
23899 * If set to 1, blink_alt state is supported on this LED.
23900 * If set to 0, blink_alt state is not supported on this LED.
23901 */
23902 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_ALT_SUPPORTED UINT32_C(0x10)
23903 /* The colors supported by LED #2. */
23904 uint16_t led2_color_caps;
23905 /* reserved. */
23906 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_RSVD UINT32_C(0x1)
23907 /*
23908 * If set to 1, Amber color is supported on this LED.
23909 * If set to 0, Amber color is not supported on this LED.
23910 */
23911 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_AMBER_SUPPORTED UINT32_C(0x2)
23912 /*
23913 * If set to 1, Green color is supported on this LED.
23914 * If set to 0, Green color is not supported on this LED.
23915 */
23916 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_GREEN_SUPPORTED UINT32_C(0x4)
23917 /* An identifier for the LED #3. */
23918 uint8_t led3_id;
23919 /* The type of LED #3. */
23920 uint8_t led3_type;
23921 /* Speed LED */
23922 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_SPEED UINT32_C(0x0)
23923 /* Activity LED */
23924 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
23925 /* Invalid */
23926 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID UINT32_C(0xff)
23927 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_LAST HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID
23928 /*
23929 * An identifier for the group of LEDs that LED #3 belongs
23930 * to.
23931 * If set to 0, then the LED #0 cannot be grouped.
23932 * For all other non-zero values of this field, LED #0 is
23933 * grouped together with the LEDs with the same group ID
23934 * value.
23935 */
23936 uint8_t led3_group_id;
23937 uint8_t unused_3;
23938 /* The states supported by LED #3. */
23939 uint16_t led3_state_caps;
23940 /*
23941 * If set to 1, this LED is enabled.
23942 * If set to 0, this LED is disabled.
23943 */
23944 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ENABLED UINT32_C(0x1)
23945 /*
23946 * If set to 1, off state is supported on this LED.
23947 * If set to 0, off state is not supported on this LED.
23948 */
23949 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_OFF_SUPPORTED UINT32_C(0x2)
23950 /*
23951 * If set to 1, on state is supported on this LED.
23952 * If set to 0, on state is not supported on this LED.
23953 */
23954 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ON_SUPPORTED UINT32_C(0x4)
23955 /*
23956 * If set to 1, blink state is supported on this LED.
23957 * If set to 0, blink state is not supported on this LED.
23958 */
23959 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_SUPPORTED UINT32_C(0x8)
23960 /*
23961 * If set to 1, blink_alt state is supported on this LED.
23962 * If set to 0, blink_alt state is not supported on this LED.
23963 */
23964 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_ALT_SUPPORTED UINT32_C(0x10)
23965 /* The colors supported by LED #3. */
23966 uint16_t led3_color_caps;
23967 /* reserved. */
23968 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_RSVD UINT32_C(0x1)
23969 /*
23970 * If set to 1, Amber color is supported on this LED.
23971 * If set to 0, Amber color is not supported on this LED.
23972 */
23973 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_AMBER_SUPPORTED UINT32_C(0x2)
23974 /*
23975 * If set to 1, Green color is supported on this LED.
23976 * If set to 0, Green color is not supported on this LED.
23977 */
23978 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_GREEN_SUPPORTED UINT32_C(0x4)
23979 uint8_t unused_4[3];
23980 /*
23981 * This field is used in Output records to indicate that the output
23982 * is completely written to RAM. This field should be read as '1'
23983 * to indicate that the output has been completely written.
23984 * When writing a command completion or response to an internal processor,
23985 * the order of writes has to be such that this field is written last.
23986 */
23987 uint8_t valid;
23988 } hwrm_port_led_qcaps_output_t, *phwrm_port_led_qcaps_output_t;
23989
23990 /***********************
23991 * hwrm_port_prbs_test *
23992 ***********************/
23993
23994
23995 /* hwrm_port_prbs_test_input (size:384b/48B) */
23996
23997 typedef struct hwrm_port_prbs_test_input {
23998 /* The HWRM command request type. */
23999 uint16_t req_type;
24000 /*
24001 * The completion ring to send the completion event on. This should
24002 * be the NQ ID returned from the `nq_alloc` HWRM command.
24003 */
24004 uint16_t cmpl_ring;
24005 /*
24006 * The sequence ID is used by the driver for tracking multiple
24007 * commands. This ID is treated as opaque data by the firmware and
24008 * the value is returned in the `hwrm_resp_hdr` upon completion.
24009 */
24010 uint16_t seq_id;
24011 /*
24012 * The target ID of the command:
24013 * * 0x0-0xFFF8 - The function ID
24014 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24015 * * 0xFFFD - Reserved for user-space HWRM interface
24016 * * 0xFFFF - HWRM
24017 */
24018 uint16_t target_id;
24019 /*
24020 * A physical address pointer pointing to a host buffer that the
24021 * command's response data will be written. This can be either a host
24022 * physical address (HPA) or a guest physical address (GPA) and must
24023 * point to a physically contiguous block of memory.
24024 */
24025 uint64_t resp_addr;
24026 /* Host address data is to DMA'd to. */
24027 uint64_t resp_data_addr;
24028 /*
24029 * Size of the buffer pointed to by resp_data_addr. The firmware may
24030 * use this entire buffer or less than the entire buffer, but never more.
24031 */
24032 uint16_t data_len;
24033 uint16_t unused_0;
24034 uint32_t unused_1;
24035 /* Port ID of port where PRBS test to be run. */
24036 uint16_t port_id;
24037 /* Polynomial selection for PRBS test. */
24038 uint16_t poly;
24039 /* PRBS7 */
24040 #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS7 UINT32_C(0x0)
24041 /* PRBS9 */
24042 #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS9 UINT32_C(0x1)
24043 /* PRBS11 */
24044 #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS11 UINT32_C(0x2)
24045 /* PRBS15 */
24046 #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS15 UINT32_C(0x3)
24047 /* PRBS23 */
24048 #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS23 UINT32_C(0x4)
24049 /* PRBS31 */
24050 #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS31 UINT32_C(0x5)
24051 /* PRBS58 */
24052 #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS58 UINT32_C(0x6)
24053 /* Invalid */
24054 #define HWRM_PORT_PRBS_TEST_INPUT_POLY_INVALID UINT32_C(0xff)
24055 #define HWRM_PORT_PRBS_TEST_INPUT_POLY_LAST HWRM_PORT_PRBS_TEST_INPUT_POLY_INVALID
24056 /*
24057 * Configuration bits for PRBS test.
24058 * Use enable bit to start/stop test.
24059 * Use tx/rx lane map bits to run test on specific lanes,
24060 * if set to 0 test will be run on all lanes.
24061 */
24062 uint16_t prbs_config;
24063 /*
24064 * Set 0 to stop test currently in progress
24065 * Set 1 to start test with configuration provided.
24066 */
24067 #define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_START_STOP UINT32_C(0x1)
24068 /*
24069 * If set to 1, tx_lane_map bitmap should have lane bits set.
24070 * If set to 0, test will be run on all lanes for this port.
24071 */
24072 #define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_TX_LANE_MAP_VALID UINT32_C(0x2)
24073 /*
24074 * If set to 1, rx_lane_map bitmap should have lane bits set.
24075 * If set to 0, test will be run on all lanes for this port.
24076 */
24077 #define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_RX_LANE_MAP_VALID UINT32_C(0x4)
24078 /* Duration in seconds to run the PRBS test. */
24079 uint16_t timeout;
24080 /*
24081 * If tx_lane_map_valid is set to 1, this field is a bitmap
24082 * of tx lanes to run PRBS test. bit0 = lane0,
24083 * bit1 = lane1 ..bit31 = lane31
24084 */
24085 uint32_t tx_lane_map;
24086 /*
24087 * If rx_lane_map_valid is set to 1, this field is a bitmap
24088 * of rx lanes to run PRBS test. bit0 = lane0,
24089 * bit1 = lane1 ..bit31 = lane31
24090 */
24091 uint32_t rx_lane_map;
24092 } hwrm_port_prbs_test_input_t, *phwrm_port_prbs_test_input_t;
24093
24094 /* hwrm_port_prbs_test_output (size:128b/16B) */
24095
24096 typedef struct hwrm_port_prbs_test_output {
24097 /* The specific error status for the command. */
24098 uint16_t error_code;
24099 /* The HWRM command request type. */
24100 uint16_t req_type;
24101 /* The sequence ID from the original command. */
24102 uint16_t seq_id;
24103 /* The length of the response data in number of bytes. */
24104 uint16_t resp_len;
24105 /* Total length of stored data. */
24106 uint16_t total_data_len;
24107 uint16_t unused_0;
24108 uint8_t unused_1[3];
24109 /*
24110 * This field is used in Output records to indicate that the output
24111 * is completely written to RAM. This field should be read as '1'
24112 * to indicate that the output has been completely written.
24113 * When writing a command completion or response to an internal processor,
24114 * the order of writes has to be such that this field is written last.
24115 */
24116 uint8_t valid;
24117 } hwrm_port_prbs_test_output_t, *phwrm_port_prbs_test_output_t;
24118
24119 /**********************
24120 * hwrm_port_dsc_dump *
24121 **********************/
24122
24123
24124 /* hwrm_port_dsc_dump_input (size:320b/40B) */
24125
24126 typedef struct hwrm_port_dsc_dump_input {
24127 /* The HWRM command request type. */
24128 uint16_t req_type;
24129 /*
24130 * The completion ring to send the completion event on. This should
24131 * be the NQ ID returned from the `nq_alloc` HWRM command.
24132 */
24133 uint16_t cmpl_ring;
24134 /*
24135 * The sequence ID is used by the driver for tracking multiple
24136 * commands. This ID is treated as opaque data by the firmware and
24137 * the value is returned in the `hwrm_resp_hdr` upon completion.
24138 */
24139 uint16_t seq_id;
24140 /*
24141 * The target ID of the command:
24142 * * 0x0-0xFFF8 - The function ID
24143 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24144 * * 0xFFFD - Reserved for user-space HWRM interface
24145 * * 0xFFFF - HWRM
24146 */
24147 uint16_t target_id;
24148 /*
24149 * A physical address pointer pointing to a host buffer that the
24150 * command's response data will be written. This can be either a host
24151 * physical address (HPA) or a guest physical address (GPA) and must
24152 * point to a physically contiguous block of memory.
24153 */
24154 uint64_t resp_addr;
24155 /* Host address where response diagnostic data is returned. */
24156 uint64_t resp_data_addr;
24157 /*
24158 * Size of the buffer pointed to by resp_data_addr. The firmware
24159 * may use this entire buffer or less than the entire buffer, but
24160 * never more.
24161 */
24162 uint16_t data_len;
24163 uint16_t unused_0;
24164 uint32_t unused_1;
24165 /* Port ID of port where dsc dump to be collected. */
24166 uint16_t port_id;
24167 /* Diag level specified by the user */
24168 uint16_t diag_level;
24169 /* SRDS_DIAG_LANE */
24170 #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_LANE UINT32_C(0x0)
24171 /* SRDS_DIAG_CORE */
24172 #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_CORE UINT32_C(0x1)
24173 /* SRDS_DIAG_EVENT */
24174 #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_EVENT UINT32_C(0x2)
24175 /* SRDS_DIAG_EYE */
24176 #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_EYE UINT32_C(0x3)
24177 /* SRDS_DIAG_REG_CORE */
24178 #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_REG_CORE UINT32_C(0x4)
24179 /* SRDS_DIAG_REG_LANE */
24180 #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_REG_LANE UINT32_C(0x5)
24181 /* SRDS_DIAG_UC_CORE */
24182 #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_UC_CORE UINT32_C(0x6)
24183 /* SRDS_DIAG_UC_LANE */
24184 #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_UC_LANE UINT32_C(0x7)
24185 /* SRDS_DIAG_LANE_DEBUG */
24186 #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_LANE_DEBUG UINT32_C(0x8)
24187 /* SRDS_DIAG_BER_VERT */
24188 #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_BER_VERT UINT32_C(0x9)
24189 /* SRDS_DIAG_BER_HORZ */
24190 #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_BER_HORZ UINT32_C(0xa)
24191 /* SRDS_DIAG_EVENT_SAFE */
24192 #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_EVENT_SAFE UINT32_C(0xb)
24193 /* SRDS_DIAG_TIMESTAMP */
24194 #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_TIMESTAMP UINT32_C(0xc)
24195 #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_LAST HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_TIMESTAMP
24196 /*
24197 * This field is a lane number
24198 * on which to collect the dsc dump
24199 */
24200 uint16_t lane_number;
24201 /*
24202 * Configuration bits.
24203 * Use enable bit to start dsc dump or retrieve dump
24204 */
24205 uint16_t dsc_dump_config;
24206 /*
24207 * Set 0 to retrieve the dsc dump
24208 * Set 1 to start the dsc dump
24209 */
24210 #define HWRM_PORT_DSC_DUMP_INPUT_DSC_DUMP_CONFIG_START_RETRIEVE UINT32_C(0x1)
24211 } hwrm_port_dsc_dump_input_t, *phwrm_port_dsc_dump_input_t;
24212
24213 /* hwrm_port_dsc_dump_output (size:128b/16B) */
24214
24215 typedef struct hwrm_port_dsc_dump_output {
24216 /* The specific error status for the command. */
24217 uint16_t error_code;
24218 /* The HWRM command request type. */
24219 uint16_t req_type;
24220 /* The sequence ID from the original command. */
24221 uint16_t seq_id;
24222 /* The length of the response data in number of bytes. */
24223 uint16_t resp_len;
24224 /* Total length of stored data. */
24225 uint16_t total_data_len;
24226 uint16_t unused_0;
24227 uint8_t unused_1[3];
24228 /*
24229 * This field is used in Output records to indicate that the output
24230 * is completely written to RAM. This field should be read as '1'
24231 * to indicate that the output has been completely written.
24232 * When writing a command completion or response to an internal processor,
24233 * the order of writes has to be such that this field is written last.
24234 */
24235 uint8_t valid;
24236 } hwrm_port_dsc_dump_output_t, *phwrm_port_dsc_dump_output_t;
24237
24238 /******************************
24239 * hwrm_port_sfp_sideband_cfg *
24240 ******************************/
24241
24242
24243 /* hwrm_port_sfp_sideband_cfg_input (size:256b/32B) */
24244
24245 typedef struct hwrm_port_sfp_sideband_cfg_input {
24246 /* The HWRM command request type. */
24247 uint16_t req_type;
24248 /*
24249 * The completion ring to send the completion event on. This should
24250 * be the NQ ID returned from the `nq_alloc` HWRM command.
24251 */
24252 uint16_t cmpl_ring;
24253 /*
24254 * The sequence ID is used by the driver for tracking multiple
24255 * commands. This ID is treated as opaque data by the firmware and
24256 * the value is returned in the `hwrm_resp_hdr` upon completion.
24257 */
24258 uint16_t seq_id;
24259 /*
24260 * The target ID of the command:
24261 * * 0x0-0xFFF8 - The function ID
24262 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24263 * * 0xFFFD - Reserved for user-space HWRM interface
24264 * * 0xFFFF - HWRM
24265 */
24266 uint16_t target_id;
24267 /*
24268 * A physical address pointer pointing to a host buffer that the
24269 * command's response data will be written. This can be either a host
24270 * physical address (HPA) or a guest physical address (GPA) and must
24271 * point to a physically contiguous block of memory.
24272 */
24273 uint64_t resp_addr;
24274 /* Port ID of port that is to be queried. */
24275 uint16_t port_id;
24276 uint8_t unused_0[6];
24277 /*
24278 * This bitfield is used to specify which bits from the 'flags'
24279 * fields are being configured by the caller.
24280 */
24281 uint32_t enables;
24282 /* This bit must be '1' for rs0 to be configured. */
24283 #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_RS0 UINT32_C(0x1)
24284 /* This bit must be '1' for rs1 to be configured. */
24285 #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_RS1 UINT32_C(0x2)
24286 /* This bit must be '1' for tx_disable to be configured. */
24287 #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_TX_DIS UINT32_C(0x4)
24288 /*
24289 * This bit must be '1' for mod_sel to be configured.
24290 * Valid only on QSFP modules
24291 */
24292 #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_MOD_SEL UINT32_C(0x8)
24293 /* This bit must be '1' for reset_l to be configured. */
24294 #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_RESET_L UINT32_C(0x10)
24295 /* This bit must be '1' for lp_mode to be configured. */
24296 #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_LP_MODE UINT32_C(0x20)
24297 /* This bit must be '1' for pwr_disable to be configured. */
24298 #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_PWR_DIS UINT32_C(0x40)
24299 /*
24300 * Only bits that have corresponding bits in the 'enables'
24301 * bitfield are processed by the firmware, all other bits
24302 * of 'flags' are ignored.
24303 */
24304 uint32_t flags;
24305 /*
24306 * This bit along with rs1 configures the current speed of the dual
24307 * rate module. If these pins are GNDed then the speed can be changed
24308 * by driectly writing to EEPROM.
24309 */
24310 #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_RS0 UINT32_C(0x1)
24311 /*
24312 * This bit along with rs0 configures the current speed of the dual
24313 * rate module. If these pins are GNDed then the speed can be changed
24314 * by driectly writing to EEPROM.
24315 */
24316 #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_RS1 UINT32_C(0x2)
24317 /*
24318 * When this bit is set to '1', tx_disable is set.
24319 * On a 1G BASE-T module, if this bit is set,
24320 * module PHY registers will not be accessible.
24321 */
24322 #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_TX_DIS UINT32_C(0x4)
24323 /*
24324 * When this bit is set to '1', this module is selected.
24325 * Valid only on QSFP modules
24326 */
24327 #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_MOD_SEL UINT32_C(0x8)
24328 /*
24329 * If reset_l is set to 0, Module will be taken out of reset
24330 * and other signals will be set to their requested state once
24331 * the module is out of reset.
24332 * Valid only on QSFP modules
24333 */
24334 #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_RESET_L UINT32_C(0x10)
24335 /*
24336 * When this bit is set to '1', the module will be configured
24337 * in low power mode.
24338 * Valid only on QSFP modules
24339 */
24340 #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_LP_MODE UINT32_C(0x20)
24341 /* When this bit is set to '1', the module will be powered down. */
24342 #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_PWR_DIS UINT32_C(0x40)
24343 } hwrm_port_sfp_sideband_cfg_input_t, *phwrm_port_sfp_sideband_cfg_input_t;
24344
24345 /* hwrm_port_sfp_sideband_cfg_output (size:128b/16B) */
24346
24347 typedef struct hwrm_port_sfp_sideband_cfg_output {
24348 /* The specific error status for the command. */
24349 uint16_t error_code;
24350 /* The HWRM command request type. */
24351 uint16_t req_type;
24352 /* The sequence ID from the original command. */
24353 uint16_t seq_id;
24354 /* The length of the response data in number of bytes. */
24355 uint16_t resp_len;
24356 uint8_t unused[7];
24357 /*
24358 * This field is used in Output records to indicate that the output
24359 * is completely written to RAM. This field should be read as '1'
24360 * to indicate that the output has been completely written. When
24361 * writing a command completion or response to an internal processor,
24362 * the order of writes has to be such that this field is written last.
24363 */
24364 uint8_t valid;
24365 } hwrm_port_sfp_sideband_cfg_output_t, *phwrm_port_sfp_sideband_cfg_output_t;
24366
24367 /*******************************
24368 * hwrm_port_sfp_sideband_qcfg *
24369 *******************************/
24370
24371
24372 /* hwrm_port_sfp_sideband_qcfg_input (size:192b/24B) */
24373
24374 typedef struct hwrm_port_sfp_sideband_qcfg_input {
24375 /* The HWRM command request type. */
24376 uint16_t req_type;
24377 /*
24378 * The completion ring to send the completion event on. This should
24379 * be the NQ ID returned from the `nq_alloc` HWRM command.
24380 */
24381 uint16_t cmpl_ring;
24382 /*
24383 * The sequence ID is used by the driver for tracking multiple
24384 * commands. This ID is treated as opaque data by the firmware and
24385 * the value is returned in the `hwrm_resp_hdr` upon completion.
24386 */
24387 uint16_t seq_id;
24388 /*
24389 * The target ID of the command:
24390 * * 0x0-0xFFF8 - The function ID
24391 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24392 * * 0xFFFD - Reserved for user-space HWRM interface
24393 * * 0xFFFF - HWRM
24394 */
24395 uint16_t target_id;
24396 /*
24397 * A physical address pointer pointing to a host buffer that the
24398 * command's response data will be written. This can be either a host
24399 * physical address (HPA) or a guest physical address (GPA) and must
24400 * point to a physically contiguous block of memory.
24401 */
24402 uint64_t resp_addr;
24403 /* Port ID of port that is to be queried. */
24404 uint16_t port_id;
24405 uint8_t unused_0[6];
24406 } hwrm_port_sfp_sideband_qcfg_input_t, *phwrm_port_sfp_sideband_qcfg_input_t;
24407
24408 /* hwrm_port_sfp_sideband_qcfg_output (size:192b/24B) */
24409
24410 typedef struct hwrm_port_sfp_sideband_qcfg_output {
24411 /* The specific error status for the command. */
24412 uint16_t error_code;
24413 /* The HWRM command request type. */
24414 uint16_t req_type;
24415 /* The sequence ID from the original command. */
24416 uint16_t seq_id;
24417 /* The length of the response data in number of bytes. */
24418 uint16_t resp_len;
24419 /*
24420 * Bitmask indicating which sideband signals are valid.
24421 * This is based on the board and nvm cfg that is present on the board.
24422 */
24423 uint32_t supported_mask;
24424 uint32_t sideband_signals;
24425 /* When this bit is set to '1', the Module is absent. */
24426 #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_MOD_ABS UINT32_C(0x1)
24427 /*
24428 * When this bit is set to '1', there is no valid signal on RX.
24429 * This signal is a filtered version of Signal Detect.
24430 */
24431 #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_RX_LOS UINT32_C(0x2)
24432 /*
24433 * This bit along with rs1 indiactes the current speed of the dual
24434 * rate module.If these pins are grounded then the speed can be
24435 * changed by driectky writing to EEPROM.
24436 */
24437 #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_RS0 UINT32_C(0x4)
24438 /*
24439 * This bit along with rs0 indiactes the current speed of the dual
24440 * rate module.If these pins are grounded then the speed can be
24441 * changed by driectky writing to EEPROM.
24442 */
24443 #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_RS1 UINT32_C(0x8)
24444 /*
24445 * When this bit is set to '1', tx_disable is set.
24446 * On a 1G BASE-T module, if this bit is set, module PHY
24447 * registers will not be accessible.
24448 */
24449 #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_TX_DIS UINT32_C(0x10)
24450 /* When this bit is set to '1', tx_fault is set. */
24451 #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_TX_FAULT UINT32_C(0x20)
24452 /*
24453 * When this bit is set to '1', module is selected.
24454 * Valid only on QSFP modules
24455 */
24456 #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_MOD_SEL UINT32_C(0x40)
24457 /*
24458 * When this bit is set to '', the module is held in reset.
24459 * if reset_l is set to 1,first module is taken out of reset
24460 * and other signals will be set to their requested state.
24461 * Valid only on QSFP modules.
24462 */
24463 #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_RESET_L UINT32_C(0x80)
24464 /*
24465 * When this bit is set to '1', the module is in low power mode.
24466 * Valid only on QSFP modules
24467 */
24468 #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_LP_MODE UINT32_C(0x100)
24469 /* When this bit is set to '1', module is in power down state. */
24470 #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_PWR_DIS UINT32_C(0x200)
24471 uint8_t unused[7];
24472 /*
24473 * This field is used in Output records to indicate that the output
24474 * is completely written to RAM. This field should be read as '1'
24475 * to indicate that the output has been completely written. When
24476 * writing a command completion or response to an internal processor,
24477 * the order of writes has to be such that this field is written last.
24478 */
24479 uint8_t valid;
24480 } hwrm_port_sfp_sideband_qcfg_output_t, *phwrm_port_sfp_sideband_qcfg_output_t;
24481
24482 /**********************************
24483 * hwrm_port_phy_mdio_bus_acquire *
24484 **********************************/
24485
24486
24487 /* hwrm_port_phy_mdio_bus_acquire_input (size:192b/24B) */
24488
24489 typedef struct hwrm_port_phy_mdio_bus_acquire_input {
24490 /* The HWRM command request type. */
24491 uint16_t req_type;
24492 /*
24493 * The completion ring to send the completion event on. This should
24494 * be the NQ ID returned from the `nq_alloc` HWRM command.
24495 */
24496 uint16_t cmpl_ring;
24497 /*
24498 * The sequence ID is used by the driver for tracking multiple
24499 * commands. This ID is treated as opaque data by the firmware and
24500 * the value is returned in the `hwrm_resp_hdr` upon completion.
24501 */
24502 uint16_t seq_id;
24503 /*
24504 * The target ID of the command:
24505 * * 0x0-0xFFF8 - The function ID
24506 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24507 * * 0xFFFD - Reserved for user-space HWRM interface
24508 * * 0xFFFF - HWRM
24509 */
24510 uint16_t target_id;
24511 /*
24512 * A physical address pointer pointing to a host buffer that the
24513 * command's response data will be written. This can be either a host
24514 * physical address (HPA) or a guest physical address (GPA) and must
24515 * point to a physically contiguous block of memory.
24516 */
24517 uint64_t resp_addr;
24518 /* Port ID of the port. */
24519 uint16_t port_id;
24520 /*
24521 * client_id of the client requesting BUS access.
24522 * Any value from 0x10 to 0xFFFF can be used.
24523 * Client should make sure that the returned client_id
24524 * in response matches the client_id in request.
24525 * 0-0xF are reserved for internal use.
24526 */
24527 uint16_t client_id;
24528 /*
24529 * Timeout in milli seconds, MDIO BUS will be released automatically
24530 * after this time, if another mdio acquire command is not received
24531 * within the timeout window from the same client.
24532 * A 0xFFFF will hold the bus until this bus is released.
24533 */
24534 uint16_t mdio_bus_timeout;
24535 uint8_t unused_0[2];
24536 } hwrm_port_phy_mdio_bus_acquire_input_t, *phwrm_port_phy_mdio_bus_acquire_input_t;
24537
24538 /* hwrm_port_phy_mdio_bus_acquire_output (size:128b/16B) */
24539
24540 typedef struct hwrm_port_phy_mdio_bus_acquire_output {
24541 /* The specific error status for the command. */
24542 uint16_t error_code;
24543 /* The HWRM command request type. */
24544 uint16_t req_type;
24545 /* The sequence ID from the original command. */
24546 uint16_t seq_id;
24547 /* The length of the response data in number of bytes. */
24548 uint16_t resp_len;
24549 uint16_t unused_0;
24550 /*
24551 * client_id of the module holding the BUS.
24552 * 0-0xF are reserved for internal use.
24553 */
24554 uint16_t client_id;
24555 uint8_t unused_1[3];
24556 /*
24557 * This field is used in Output records to indicate that the output
24558 * is completely written to RAM. This field should be read as '1'
24559 * to indicate that the output has been completely written.
24560 * When writing a command completion or response to an internal processor,
24561 * the order of writes has to be such that this field is written last.
24562 */
24563 uint8_t valid;
24564 } hwrm_port_phy_mdio_bus_acquire_output_t, *phwrm_port_phy_mdio_bus_acquire_output_t;
24565
24566 /**********************************
24567 * hwrm_port_phy_mdio_bus_release *
24568 **********************************/
24569
24570
24571 /* hwrm_port_phy_mdio_bus_release_input (size:192b/24B) */
24572
24573 typedef struct hwrm_port_phy_mdio_bus_release_input {
24574 /* The HWRM command request type. */
24575 uint16_t req_type;
24576 /*
24577 * The completion ring to send the completion event on. This should
24578 * be the NQ ID returned from the `nq_alloc` HWRM command.
24579 */
24580 uint16_t cmpl_ring;
24581 /*
24582 * The sequence ID is used by the driver for tracking multiple
24583 * commands. This ID is treated as opaque data by the firmware and
24584 * the value is returned in the `hwrm_resp_hdr` upon completion.
24585 */
24586 uint16_t seq_id;
24587 /*
24588 * The target ID of the command:
24589 * * 0x0-0xFFF8 - The function ID
24590 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24591 * * 0xFFFD - Reserved for user-space HWRM interface
24592 * * 0xFFFF - HWRM
24593 */
24594 uint16_t target_id;
24595 /*
24596 * A physical address pointer pointing to a host buffer that the
24597 * command's response data will be written. This can be either a host
24598 * physical address (HPA) or a guest physical address (GPA) and must
24599 * point to a physically contiguous block of memory.
24600 */
24601 uint64_t resp_addr;
24602 /* Port ID of the port. */
24603 uint16_t port_id;
24604 /*
24605 * client_id of the client requesting BUS release.
24606 * A client should not release any other clients BUS.
24607 */
24608 uint16_t client_id;
24609 uint8_t unused_0[4];
24610 } hwrm_port_phy_mdio_bus_release_input_t, *phwrm_port_phy_mdio_bus_release_input_t;
24611
24612 /* hwrm_port_phy_mdio_bus_release_output (size:128b/16B) */
24613
24614 typedef struct hwrm_port_phy_mdio_bus_release_output {
24615 /* The specific error status for the command. */
24616 uint16_t error_code;
24617 /* The HWRM command request type. */
24618 uint16_t req_type;
24619 /* The sequence ID from the original command. */
24620 uint16_t seq_id;
24621 /* The length of the response data in number of bytes. */
24622 uint16_t resp_len;
24623 uint16_t unused_0;
24624 /* The BUS is released if client_id matches the client_id in request. */
24625 uint16_t clients_id;
24626 uint8_t unused_1[3];
24627 /*
24628 * This field is used in Output records to indicate that the output
24629 * is completely written to RAM. This field should be read as '1'
24630 * to indicate that the output has been completely written.
24631 * When writing a command completion or response to an internal processor,
24632 * the order of writes has to be such that this field is written last.
24633 */
24634 uint8_t valid;
24635 } hwrm_port_phy_mdio_bus_release_output_t, *phwrm_port_phy_mdio_bus_release_output_t;
24636
24637 /************************
24638 * hwrm_port_tx_fir_cfg *
24639 ************************/
24640
24641
24642 /* hwrm_port_tx_fir_cfg_input (size:320b/40B) */
24643
24644 typedef struct hwrm_port_tx_fir_cfg_input {
24645 /* The HWRM command request type. */
24646 uint16_t req_type;
24647 /*
24648 * The completion ring to send the completion event on. This should
24649 * be the NQ ID returned from the `nq_alloc` HWRM command.
24650 */
24651 uint16_t cmpl_ring;
24652 /*
24653 * The sequence ID is used by the driver for tracking multiple
24654 * commands. This ID is treated as opaque data by the firmware and
24655 * the value is returned in the `hwrm_resp_hdr` upon completion.
24656 */
24657 uint16_t seq_id;
24658 /*
24659 * The target ID of the command:
24660 * * 0x0-0xFFF8 - The function ID
24661 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24662 * * 0xFFFD - Reserved for user-space HWRM interface
24663 * * 0xFFFF - HWRM
24664 */
24665 uint16_t target_id;
24666 /*
24667 * A physical address pointer pointing to a host buffer that the
24668 * command's response data will be written. This can be either a host
24669 * physical address (HPA) or a guest physical address (GPA) and must
24670 * point to a physically contiguous block of memory.
24671 */
24672 uint64_t resp_addr;
24673 /* Modulation types of TX FIR: NRZ, PAM4. */
24674 uint8_t mod_type;
24675 /* For NRZ */
24676 #define HWRM_PORT_TX_FIR_CFG_INPUT_MOD_TYPE_NRZ UINT32_C(0x0)
24677 /* For PAM4 */
24678 #define HWRM_PORT_TX_FIR_CFG_INPUT_MOD_TYPE_PAM4 UINT32_C(0x1)
24679 #define HWRM_PORT_TX_FIR_CFG_INPUT_MOD_TYPE_LAST HWRM_PORT_TX_FIR_CFG_INPUT_MOD_TYPE_PAM4
24680 /* The lane mask of the lane TX FIR will be configured. */
24681 uint8_t lane_mask;
24682 uint8_t unused_0[2];
24683 /* Value1 of TX FIR, required for NRZ or PAM4. */
24684 uint32_t txfir_val_1;
24685 /* Value2 of TX FIR, required for NRZ or PAM4. */
24686 uint32_t txfir_val_2;
24687 /* Value3 of TX FIR, required for PAM4. */
24688 uint32_t txfir_val_3;
24689 /* Value4 of TX FIR, required for PAM4. */
24690 uint32_t txfir_val_4;
24691 uint8_t unused_1[4];
24692 } hwrm_port_tx_fir_cfg_input_t, *phwrm_port_tx_fir_cfg_input_t;
24693
24694 /* hwrm_port_tx_fir_cfg_output (size:128b/16B) */
24695
24696 typedef struct hwrm_port_tx_fir_cfg_output {
24697 /* The specific error status for the command. */
24698 uint16_t error_code;
24699 /* The HWRM command request type. */
24700 uint16_t req_type;
24701 /* The sequence ID from the original command. */
24702 uint16_t seq_id;
24703 /* The length of the response data in number of bytes. */
24704 uint16_t resp_len;
24705 uint8_t unused[7];
24706 /*
24707 * This field is used in Output records to indicate that the output
24708 * is completely written to RAM. This field should be read as '1'
24709 * to indicate that the output has been completely written.
24710 * When writing a command completion or response to an internal processor,
24711 * the order of writes has to be such that this field is written last.
24712 */
24713 uint8_t valid;
24714 } hwrm_port_tx_fir_cfg_output_t, *phwrm_port_tx_fir_cfg_output_t;
24715
24716 /*************************
24717 * hwrm_port_tx_fir_qcfg *
24718 *************************/
24719
24720
24721 /* hwrm_port_tx_fir_qcfg_input (size:192b/24B) */
24722
24723 typedef struct hwrm_port_tx_fir_qcfg_input {
24724 /* The HWRM command request type. */
24725 uint16_t req_type;
24726 /*
24727 * The completion ring to send the completion event on. This should
24728 * be the NQ ID returned from the `nq_alloc` HWRM command.
24729 */
24730 uint16_t cmpl_ring;
24731 /*
24732 * The sequence ID is used by the driver for tracking multiple
24733 * commands. This ID is treated as opaque data by the firmware and
24734 * the value is returned in the `hwrm_resp_hdr` upon completion.
24735 */
24736 uint16_t seq_id;
24737 /*
24738 * The target ID of the command:
24739 * * 0x0-0xFFF8 - The function ID
24740 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24741 * * 0xFFFD - Reserved for user-space HWRM interface
24742 * * 0xFFFF - HWRM
24743 */
24744 uint16_t target_id;
24745 /*
24746 * A physical address pointer pointing to a host buffer that the
24747 * command's response data will be written. This can be either a host
24748 * physical address (HPA) or a guest physical address (GPA) and must
24749 * point to a physically contiguous block of memory.
24750 */
24751 uint64_t resp_addr;
24752 /* Modulation types of TX FIR: NRZ, PAM4. */
24753 uint8_t mod_type;
24754 /* For NRZ */
24755 #define HWRM_PORT_TX_FIR_QCFG_INPUT_MOD_TYPE_NRZ UINT32_C(0x0)
24756 /* For PAM4 */
24757 #define HWRM_PORT_TX_FIR_QCFG_INPUT_MOD_TYPE_PAM4 UINT32_C(0x1)
24758 #define HWRM_PORT_TX_FIR_QCFG_INPUT_MOD_TYPE_LAST HWRM_PORT_TX_FIR_QCFG_INPUT_MOD_TYPE_PAM4
24759 /* The ID of the lane TX FIR will be queried. */
24760 uint8_t lane_id;
24761 uint8_t unused[6];
24762 } hwrm_port_tx_fir_qcfg_input_t, *phwrm_port_tx_fir_qcfg_input_t;
24763
24764 /* hwrm_port_tx_fir_qcfg_output (size:256b/32B) */
24765
24766 typedef struct hwrm_port_tx_fir_qcfg_output {
24767 /* The specific error status for the command. */
24768 uint16_t error_code;
24769 /* The HWRM command request type. */
24770 uint16_t req_type;
24771 /* The sequence ID from the original command. */
24772 uint16_t seq_id;
24773 /* The length of the response data in number of bytes. */
24774 uint16_t resp_len;
24775 /* Value1 of TX FIR, required for NRZ or PAM4. */
24776 uint32_t txfir_val_1;
24777 /* Value2 of TX FIR, required for NRZ or PAM4. */
24778 uint32_t txfir_val_2;
24779 /* Value3 of TX FIR, required for PAM4. */
24780 uint32_t txfir_val_3;
24781 /* Value4 of TX FIR, required for PAM4. */
24782 uint32_t txfir_val_4;
24783 uint8_t unused[7];
24784 /*
24785 * This field is used in Output records to indicate that the output
24786 * is completely written to RAM. This field should be read as '1'
24787 * to indicate that the output has been completely written.
24788 * When writing a command completion or response to an internal processor,
24789 * the order of writes has to be such that this field is written last.
24790 */
24791 uint8_t valid;
24792 } hwrm_port_tx_fir_qcfg_output_t, *phwrm_port_tx_fir_qcfg_output_t;
24793
24794 /***********************
24795 * hwrm_queue_qportcfg *
24796 ***********************/
24797
24798
24799 /* hwrm_queue_qportcfg_input (size:192b/24B) */
24800
24801 typedef struct hwrm_queue_qportcfg_input {
24802 /* The HWRM command request type. */
24803 uint16_t req_type;
24804 /*
24805 * The completion ring to send the completion event on. This should
24806 * be the NQ ID returned from the `nq_alloc` HWRM command.
24807 */
24808 uint16_t cmpl_ring;
24809 /*
24810 * The sequence ID is used by the driver for tracking multiple
24811 * commands. This ID is treated as opaque data by the firmware and
24812 * the value is returned in the `hwrm_resp_hdr` upon completion.
24813 */
24814 uint16_t seq_id;
24815 /*
24816 * The target ID of the command:
24817 * * 0x0-0xFFF8 - The function ID
24818 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24819 * * 0xFFFD - Reserved for user-space HWRM interface
24820 * * 0xFFFF - HWRM
24821 */
24822 uint16_t target_id;
24823 /*
24824 * A physical address pointer pointing to a host buffer that the
24825 * command's response data will be written. This can be either a host
24826 * physical address (HPA) or a guest physical address (GPA) and must
24827 * point to a physically contiguous block of memory.
24828 */
24829 uint64_t resp_addr;
24830 uint32_t flags;
24831 /*
24832 * Enumeration denoting the RX, TX type of the resource.
24833 * This enumeration is used for resources that are similar for both
24834 * TX and RX paths of the chip.
24835 */
24836 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH UINT32_C(0x1)
24837 /* tx path */
24838 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX UINT32_C(0x0)
24839 /* rx path */
24840 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX UINT32_C(0x1)
24841 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_LAST HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX
24842 /*
24843 * Port ID of port for which the queue configuration is being
24844 * queried. This field is only required when sent by IPC.
24845 */
24846 uint16_t port_id;
24847 /*
24848 * Drivers will set this capability when it can use
24849 * queue_idx_service_profile to map the queues to application.
24850 */
24851 uint8_t drv_qmap_cap;
24852 /* disabled */
24853 #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_DISABLED UINT32_C(0x0)
24854 /* enabled */
24855 #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED UINT32_C(0x1)
24856 #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_LAST HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED
24857 uint8_t unused_0;
24858 } hwrm_queue_qportcfg_input_t, *phwrm_queue_qportcfg_input_t;
24859
24860 /* hwrm_queue_qportcfg_output (size:1344b/168B) */
24861
24862 typedef struct hwrm_queue_qportcfg_output {
24863 /* The specific error status for the command. */
24864 uint16_t error_code;
24865 /* The HWRM command request type. */
24866 uint16_t req_type;
24867 /* The sequence ID from the original command. */
24868 uint16_t seq_id;
24869 /* The length of the response data in number of bytes. */
24870 uint16_t resp_len;
24871 /*
24872 * The maximum number of queues that can be configured on this
24873 * port.
24874 * Valid values range from 1 through 8.
24875 */
24876 uint8_t max_configurable_queues;
24877 /*
24878 * The maximum number of lossless queues that can be configured
24879 * on this port.
24880 * Valid values range from 0 through 8.
24881 */
24882 uint8_t max_configurable_lossless_queues;
24883 /*
24884 * Bitmask indicating which queues can be configured by the
24885 * hwrm_queue_cfg command.
24886 *
24887 * Each bit represents a specific queue where bit 0 represents
24888 * queue 0 and bit 7 represents queue 7.
24889 * # A value of 0 indicates that the queue is not configurable
24890 * by the hwrm_queue_cfg command.
24891 * # A value of 1 indicates that the queue is configurable.
24892 * # A hwrm_queue_cfg command shall return error when trying to
24893 * configure a queue not configurable.
24894 */
24895 uint8_t queue_cfg_allowed;
24896 /* Information about queue configuration. */
24897 uint8_t queue_cfg_info;
24898 /*
24899 * If this flag is set to '1', then the queues are
24900 * configured asymmetrically on TX and RX sides.
24901 * If this flag is set to '', then the queues are
24902 * configured symmetrically on TX and RX sides. For
24903 * symmetric configuration, the queue configuration
24904 * including queue ids and service profiles on the
24905 * TX side is the same as the corresponding queue
24906 * configuration on the RX side.
24907 */
24908 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG UINT32_C(0x1)
24909 /*
24910 * If this flag is set to '1', then service_profile will carry
24911 * either lossy/lossless type and the new service_profile_type
24912 * field will be used to determine if the queue is for L2/ROCE/CNP.
24913 */
24914 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_CFG_INFO_USE_PROFILE_TYPE UINT32_C(0x2)
24915 /*
24916 * Bitmask indicating which queues can be configured by the
24917 * hwrm_queue_pfcenable_cfg command.
24918 *
24919 * Each bit represents a specific priority where bit 0 represents
24920 * priority 0 and bit 7 represents priority 7.
24921 * # A value of 0 indicates that the priority is not configurable by
24922 * the hwrm_queue_pfcenable_cfg command.
24923 * # A value of 1 indicates that the priority is configurable.
24924 * # A hwrm_queue_pfcenable_cfg command shall return error when
24925 * trying to configure a priority that is not configurable.
24926 */
24927 uint8_t queue_pfcenable_cfg_allowed;
24928 /*
24929 * Bitmask indicating which queues can be configured by the
24930 * hwrm_queue_pri2cos_cfg command.
24931 *
24932 * Each bit represents a specific queue where bit 0 represents
24933 * queue 0 and bit 7 represents queue 7.
24934 * # A value of 0 indicates that the queue is not configurable
24935 * by the hwrm_queue_pri2cos_cfg command.
24936 * # A value of 1 indicates that the queue is configurable.
24937 * # A hwrm_queue_pri2cos_cfg command shall return error when
24938 * trying to configure a queue that is not configurable.
24939 */
24940 uint8_t queue_pri2cos_cfg_allowed;
24941 /*
24942 * Bitmask indicating which queues can be configured by the
24943 * hwrm_queue_pri2cos_cfg command.
24944 *
24945 * Each bit represents a specific queue where bit 0 represents
24946 * queue 0 and bit 7 represents queue 7.
24947 * # A value of 0 indicates that the queue is not configurable
24948 * by the hwrm_queue_pri2cos_cfg command.
24949 * # A value of 1 indicates that the queue is configurable.
24950 * # A hwrm_queue_pri2cos_cfg command shall return error when
24951 * trying to configure a queue not configurable.
24952 */
24953 uint8_t queue_cos2bw_cfg_allowed;
24954 /*
24955 * ID of CoS Queue 0.
24956 * FF - Invalid id
24957 *
24958 * # This ID can be used on any subsequent call to an hwrm command
24959 * that takes a queue id.
24960 * # IDs must always be queried by this command before any use
24961 * by the driver or software.
24962 * # The CoS queue index is obtained by applying modulo 10 to the
24963 * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
24964 * The CoS queue index is used to reference port statistics for the
24965 * CoS queue.
24966 * # A value of 0xff indicates that the queue is not available.
24967 * # Available queues may not be in sequential order.
24968 */
24969 uint8_t queue_id0;
24970 /* This value specifies service profile kind for CoS queue */
24971 uint8_t queue_id0_service_profile;
24972 /* Lossy (best-effort) */
24973 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY UINT32_C(0x0)
24974 /* Lossless */
24975 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
24976 /* Lossless RoCE (deprecated) */
24977 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_ROCE UINT32_C(0x1)
24978 /* Lossy RoCE CNP (deprecated) */
24979 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY_ROCE_CNP UINT32_C(0x2)
24980 /* Lossless NIC (deprecated) */
24981 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_NIC UINT32_C(0x3)
24982 /* Set to 0xFF... (All Fs) if there is no service profile specified */
24983 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN UINT32_C(0xff)
24984 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LAST HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN
24985 /*
24986 * ID of CoS Queue 1.
24987 * FF - Invalid id
24988 *
24989 * # This ID can be used on any subsequent call to an hwrm command
24990 * that takes a queue id.
24991 * # IDs must always be queried by this command before any use
24992 * by the driver or software.
24993 * # The CoS queue index is obtained by applying modulo 10 to the
24994 * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
24995 * The CoS queue index is used to reference port statistics for the
24996 * CoS queue.
24997 * # A value of 0xff indicates that the queue is not available.
24998 * # Available queues may not be in sequential order.
24999 */
25000 uint8_t queue_id1;
25001 /* This value specifies service profile kind for CoS queue */
25002 uint8_t queue_id1_service_profile;
25003 /* Lossy (best-effort) */
25004 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY UINT32_C(0x0)
25005 /* Lossless */
25006 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
25007 /* Lossless RoCE (deprecated) */
25008 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_ROCE UINT32_C(0x1)
25009 /* Lossy RoCE CNP (deprecated) */
25010 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY_ROCE_CNP UINT32_C(0x2)
25011 /* Lossless NIC (deprecated) */
25012 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_NIC UINT32_C(0x3)
25013 /* Set to 0xFF... (All Fs) if there is no service profile specified */
25014 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN UINT32_C(0xff)
25015 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LAST HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN
25016 /*
25017 * ID of CoS Queue 2.
25018 * FF - Invalid id
25019 *
25020 * # This ID can be used on any subsequent call to an hwrm command
25021 * that takes a queue id.
25022 * # IDs must always be queried by this command before any use
25023 * by the driver or software.
25024 * # The CoS queue index is obtained by applying modulo 10 to the
25025 * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
25026 * The CoS queue index is used to reference port statistics for the
25027 * CoS queue.
25028 * # A value of 0xff indicates that the queue is not available.
25029 * # Available queues may not be in sequential order.
25030 */
25031 uint8_t queue_id2;
25032 /* This value specifies service profile kind for CoS queue */
25033 uint8_t queue_id2_service_profile;
25034 /* Lossy (best-effort) */
25035 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY UINT32_C(0x0)
25036 /* Lossless */
25037 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
25038 /* Lossless RoCE (deprecated) */
25039 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_ROCE UINT32_C(0x1)
25040 /* Lossy RoCE CNP (deprecated) */
25041 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY_ROCE_CNP UINT32_C(0x2)
25042 /* Lossless NIC (deprecated) */
25043 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_NIC UINT32_C(0x3)
25044 /* Set to 0xFF... (All Fs) if there is no service profile specified */
25045 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN UINT32_C(0xff)
25046 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LAST HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN
25047 /*
25048 * ID of CoS Queue 3.
25049 * FF - Invalid id
25050 *
25051 * # This ID can be used on any subsequent call to an hwrm command
25052 * that takes a queue id.
25053 * # IDs must always be queried by this command before any use
25054 * by the driver or software.
25055 * # The CoS queue index is obtained by applying modulo 10 to the
25056 * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
25057 * The CoS queue index is used to reference port statistics for the
25058 * CoS queue.
25059 * # A value of 0xff indicates that the queue is not available.
25060 * # Available queues may not be in sequential order.
25061 */
25062 uint8_t queue_id3;
25063 /* This value specifies service profile kind for CoS queue */
25064 uint8_t queue_id3_service_profile;
25065 /* Lossy (best-effort) */
25066 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY UINT32_C(0x0)
25067 /* Lossless */
25068 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
25069 /* Lossless RoCE (deprecated) */
25070 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_ROCE UINT32_C(0x1)
25071 /* Lossy RoCE CNP (deprecated) */
25072 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY_ROCE_CNP UINT32_C(0x2)
25073 /* Lossless NIC (deprecated) */
25074 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_NIC UINT32_C(0x3)
25075 /* Set to 0xFF... (All Fs) if there is no service profile specified */
25076 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN UINT32_C(0xff)
25077 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LAST HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN
25078 /*
25079 * ID of CoS Queue 4.
25080 * FF - Invalid id
25081 *
25082 * # This ID can be used on any subsequent call to an hwrm command
25083 * that takes a queue id.
25084 * # IDs must always be queried by this command before any use
25085 * by the driver or software.
25086 * # The CoS queue index is obtained by applying modulo 10 to the
25087 * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
25088 * The CoS queue index is used to reference port statistics for the
25089 * CoS queue.
25090 * # A value of 0xff indicates that the queue is not available.
25091 * # Available queues may not be in sequential order.
25092 */
25093 uint8_t queue_id4;
25094 /* This value specifies service profile kind for CoS queue */
25095 uint8_t queue_id4_service_profile;
25096 /* Lossy (best-effort) */
25097 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY UINT32_C(0x0)
25098 /* Lossless */
25099 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
25100 /* Lossless RoCE (deprecated) */
25101 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_ROCE UINT32_C(0x1)
25102 /* Lossy RoCE CNP (deprecated) */
25103 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY_ROCE_CNP UINT32_C(0x2)
25104 /* Lossless NIC (deprecated) */
25105 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_NIC UINT32_C(0x3)
25106 /* Set to 0xFF... (All Fs) if there is no service profile specified */
25107 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN UINT32_C(0xff)
25108 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LAST HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN
25109 /*
25110 * ID of CoS Queue 5.
25111 * FF - Invalid id
25112 *
25113 * # This ID can be used on any subsequent call to an hwrm command
25114 * that takes a queue id.
25115 * # IDs must always be queried by this command before any use
25116 * by the driver or software.
25117 * # The CoS queue index is obtained by applying modulo 10 to the
25118 * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
25119 * The CoS queue index is used to reference port statistics for the
25120 * CoS queue.
25121 * # A value of 0xff indicates that the queue is not available.
25122 * # Available queues may not be in sequential order.
25123 */
25124 uint8_t queue_id5;
25125 /* This value specifies service profile kind for CoS queue */
25126 uint8_t queue_id5_service_profile;
25127 /* Lossy (best-effort) */
25128 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY UINT32_C(0x0)
25129 /* Lossless */
25130 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
25131 /* Lossless RoCE (deprecated) */
25132 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_ROCE UINT32_C(0x1)
25133 /* Lossy RoCE CNP (deprecated) */
25134 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY_ROCE_CNP UINT32_C(0x2)
25135 /* Lossless NIC (deprecated) */
25136 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_NIC UINT32_C(0x3)
25137 /* Set to 0xFF... (All Fs) if there is no service profile specified */
25138 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN UINT32_C(0xff)
25139 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LAST HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN
25140 /*
25141 * ID of CoS Queue 6.
25142 * FF - Invalid id
25143 *
25144 * # This ID can be used on any subsequent call to an hwrm command
25145 * that takes a queue id.
25146 * # IDs must always be queried by this command before any use
25147 * by the driver or software.
25148 * # The CoS queue index is obtained by applying modulo 10 to the
25149 * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
25150 * The CoS queue index is used to reference port statistics for the
25151 * CoS queue.
25152 * # A value of 0xff indicates that the queue is not available.
25153 * # Available queues may not be in sequential order.
25154 */
25155 uint8_t queue_id6;
25156 /* This value specifies service profile kind for CoS queue */
25157 uint8_t queue_id6_service_profile;
25158 /* Lossy (best-effort) */
25159 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY UINT32_C(0x0)
25160 /* Lossless */
25161 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
25162 /* Lossless RoCE (deprecated) */
25163 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_ROCE UINT32_C(0x1)
25164 /* Lossy RoCE CNP (deprecated) */
25165 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY_ROCE_CNP UINT32_C(0x2)
25166 /* Lossless NIC (deprecated) */
25167 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_NIC UINT32_C(0x3)
25168 /* Set to 0xFF... (All Fs) if there is no service profile specified */
25169 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN UINT32_C(0xff)
25170 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LAST HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN
25171 /*
25172 * ID of CoS Queue 7.
25173 * FF - Invalid id
25174 *
25175 * # This ID can be used on any subsequent call to an hwrm command
25176 * that takes a queue id.
25177 * # IDs must always be queried by this command before any use
25178 * by the driver or software.
25179 * # The CoS queue index is obtained by applying modulo 10 to the
25180 * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
25181 * The CoS queue index is used to reference port statistics for the
25182 * CoS queue.
25183 * # A value of 0xff indicates that the queue is not available.
25184 * # Available queues may not be in sequential order.
25185 */
25186 uint8_t queue_id7;
25187 /* This value specifies service profile kind for CoS queue */
25188 uint8_t queue_id7_service_profile;
25189 /* Lossy (best-effort) */
25190 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY UINT32_C(0x0)
25191 /* Lossless */
25192 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
25193 /* Lossless RoCE (deprecated) */
25194 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_ROCE UINT32_C(0x1)
25195 /* Lossy RoCE CNP (deprecated) */
25196 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY_ROCE_CNP UINT32_C(0x2)
25197 /* Lossless NIC (deprecated) */
25198 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_NIC UINT32_C(0x3)
25199 /* Set to 0xFF... (All Fs) if there is no service profile specified */
25200 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN UINT32_C(0xff)
25201 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LAST HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN
25202 /*
25203 * This value specifies traffic type for the service profile. We can
25204 * have a TC mapped to multiple traffic types. For example shared
25205 * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
25206 * A value of zero is considered as invalid.
25207 */
25208 uint8_t queue_id0_service_profile_type;
25209 /* Recommended to be used for RoCE traffic only. */
25210 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_TYPE_ROCE UINT32_C(0x1)
25211 /* Recommended to be used for NIC/L2 traffic only. */
25212 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_TYPE_NIC UINT32_C(0x2)
25213 /* Recommended to be used for CNP traffic only. */
25214 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_TYPE_CNP UINT32_C(0x4)
25215 /*
25216 * Up to 16 bytes of null padded ASCII string describing this queue.
25217 * The queue name includes a CoS queue index and, in some cases, text
25218 * that distinguishes the queue from other queues in the group.
25219 */
25220 char qid0_name[16];
25221 /* Up to 16 bytes of null padded ASCII string describing this queue. */
25222 char qid1_name[16];
25223 /* Up to 16 bytes of null padded ASCII string describing this queue. */
25224 char qid2_name[16];
25225 /* Up to 16 bytes of null padded ASCII string describing this queue. */
25226 char qid3_name[16];
25227 /* Up to 16 bytes of null padded ASCII string describing this queue. */
25228 char qid4_name[16];
25229 /* Up to 16 bytes of null padded ASCII string describing this queue. */
25230 char qid5_name[16];
25231 /* Up to 16 bytes of null padded ASCII string describing this queue. */
25232 char qid6_name[16];
25233 /* Up to 16 bytes of null padded ASCII string describing this queue. */
25234 char qid7_name[16];
25235 /*
25236 * This value specifies traffic type for the service profile. We can
25237 * have a TC mapped to multiple traffic types. For example shared
25238 * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
25239 * A value of zero is considered as invalid.
25240 */
25241 uint8_t queue_id1_service_profile_type;
25242 /* Recommended to be used for RoCE traffic only. */
25243 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_TYPE_ROCE UINT32_C(0x1)
25244 /* Recommended to be used for NIC/L2 traffic only. */
25245 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_TYPE_NIC UINT32_C(0x2)
25246 /* Recommended to be used for CNP traffic only. */
25247 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_TYPE_CNP UINT32_C(0x4)
25248 /*
25249 * This value specifies traffic type for the service profile. We can
25250 * have a TC mapped to multiple traffic types. For example shared
25251 * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
25252 * A value of zero is considered as invalid.
25253 */
25254 uint8_t queue_id2_service_profile_type;
25255 /* Recommended to be used for RoCE traffic only. */
25256 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_TYPE_ROCE UINT32_C(0x1)
25257 /* Recommended to be used for NIC/L2 traffic only. */
25258 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_TYPE_NIC UINT32_C(0x2)
25259 /* Recommended to be used for CNP traffic only. */
25260 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_TYPE_CNP UINT32_C(0x4)
25261 /*
25262 * This value specifies traffic type for the service profile. We can
25263 * have a TC mapped to multiple traffic types. For example shared
25264 * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
25265 * A value of zero is considered as invalid.
25266 */
25267 uint8_t queue_id3_service_profile_type;
25268 /* Recommended to be used for RoCE traffic only. */
25269 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_TYPE_ROCE UINT32_C(0x1)
25270 /* Recommended to be used for NIC/L2 traffic only. */
25271 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_TYPE_NIC UINT32_C(0x2)
25272 /* Recommended to be used for CNP traffic only. */
25273 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_TYPE_CNP UINT32_C(0x4)
25274 /*
25275 * This value specifies traffic type for the service profile. We can
25276 * have a TC mapped to multiple traffic types. For example shared
25277 * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
25278 * A value of zero is considered as invalid.
25279 */
25280 uint8_t queue_id4_service_profile_type;
25281 /* Recommended to be used for RoCE traffic only. */
25282 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_TYPE_ROCE UINT32_C(0x1)
25283 /* Recommended to be used for NIC/L2 traffic only. */
25284 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_TYPE_NIC UINT32_C(0x2)
25285 /* Recommended to be used for CNP traffic only. */
25286 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_TYPE_CNP UINT32_C(0x4)
25287 /*
25288 * This value specifies traffic type for the service profile. We can
25289 * have a TC mapped to multiple traffic types. For example shared
25290 * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
25291 * A value of zero is considered as invalid.
25292 */
25293 uint8_t queue_id5_service_profile_type;
25294 /* Recommended to be used for RoCE traffic only. */
25295 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_TYPE_ROCE UINT32_C(0x1)
25296 /* Recommended to be used for NIC/L2 traffic only. */
25297 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_TYPE_NIC UINT32_C(0x2)
25298 /* Recommended to be used for CNP traffic only. */
25299 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_TYPE_CNP UINT32_C(0x4)
25300 /*
25301 * This value specifies traffic type for the service profile. We can
25302 * have a TC mapped to multiple traffic types. For example shared
25303 * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
25304 * A value of zero is considered as invalid.
25305 */
25306 uint8_t queue_id6_service_profile_type;
25307 /* Recommended to be used for RoCE traffic only. */
25308 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_TYPE_ROCE UINT32_C(0x1)
25309 /* Recommended to be used for NIC/L2 traffic only. */
25310 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_TYPE_NIC UINT32_C(0x2)
25311 /* Recommended to be used for CNP traffic only. */
25312 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_TYPE_CNP UINT32_C(0x4)
25313 /*
25314 * This value specifies traffic type for the service profile. We can
25315 * have a TC mapped to multiple traffic types. For example shared
25316 * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
25317 * A value of zero is considered as invalid.
25318 */
25319 uint8_t queue_id7_service_profile_type;
25320 /* Recommended to be used for RoCE traffic only. */
25321 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_TYPE_ROCE UINT32_C(0x1)
25322 /* Recommended to be used for NIC/L2 traffic only. */
25323 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_TYPE_NIC UINT32_C(0x2)
25324 /* Recommended to be used for CNP traffic only. */
25325 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_TYPE_CNP UINT32_C(0x4)
25326 /*
25327 * This field is used in Output records to indicate that the output
25328 * is completely written to RAM. This field should be read as '1'
25329 * to indicate that the output has been completely written.
25330 * When writing a command completion or response to an internal processor,
25331 * the order of writes has to be such that this field is written last.
25332 */
25333 uint8_t valid;
25334 } hwrm_queue_qportcfg_output_t, *phwrm_queue_qportcfg_output_t;
25335
25336 /*******************
25337 * hwrm_queue_qcfg *
25338 *******************/
25339
25340
25341 /* hwrm_queue_qcfg_input (size:192b/24B) */
25342
25343 typedef struct hwrm_queue_qcfg_input {
25344 /* The HWRM command request type. */
25345 uint16_t req_type;
25346 /*
25347 * The completion ring to send the completion event on. This should
25348 * be the NQ ID returned from the `nq_alloc` HWRM command.
25349 */
25350 uint16_t cmpl_ring;
25351 /*
25352 * The sequence ID is used by the driver for tracking multiple
25353 * commands. This ID is treated as opaque data by the firmware and
25354 * the value is returned in the `hwrm_resp_hdr` upon completion.
25355 */
25356 uint16_t seq_id;
25357 /*
25358 * The target ID of the command:
25359 * * 0x0-0xFFF8 - The function ID
25360 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25361 * * 0xFFFD - Reserved for user-space HWRM interface
25362 * * 0xFFFF - HWRM
25363 */
25364 uint16_t target_id;
25365 /*
25366 * A physical address pointer pointing to a host buffer that the
25367 * command's response data will be written. This can be either a host
25368 * physical address (HPA) or a guest physical address (GPA) and must
25369 * point to a physically contiguous block of memory.
25370 */
25371 uint64_t resp_addr;
25372 uint32_t flags;
25373 /*
25374 * Enumeration denoting the RX, TX type of the resource.
25375 * This enumeration is used for resources that are similar for both
25376 * TX and RX paths of the chip.
25377 */
25378 #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH UINT32_C(0x1)
25379 /* tx path */
25380 #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_TX UINT32_C(0x0)
25381 /* rx path */
25382 #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX UINT32_C(0x1)
25383 #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_LAST HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX
25384 /* Queue ID of the queue. */
25385 uint32_t queue_id;
25386 } hwrm_queue_qcfg_input_t, *phwrm_queue_qcfg_input_t;
25387
25388 /* hwrm_queue_qcfg_output (size:128b/16B) */
25389
25390 typedef struct hwrm_queue_qcfg_output {
25391 /* The specific error status for the command. */
25392 uint16_t error_code;
25393 /* The HWRM command request type. */
25394 uint16_t req_type;
25395 /* The sequence ID from the original command. */
25396 uint16_t seq_id;
25397 /* The length of the response data in number of bytes. */
25398 uint16_t resp_len;
25399 /*
25400 * This value is the estimate packet length used in the
25401 * TX arbiter.
25402 */
25403 uint32_t queue_len;
25404 /* This value is applicable to CoS queues only. */
25405 uint8_t service_profile;
25406 /* Lossy (best-effort) */
25407 #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSY UINT32_C(0x0)
25408 /* Lossless */
25409 #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
25410 /* Set to 0xFF... (All Fs) if there is no service profile specified */
25411 #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_UNKNOWN UINT32_C(0xff)
25412 #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LAST HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_UNKNOWN
25413 /* Information about queue configuration. */
25414 uint8_t queue_cfg_info;
25415 /*
25416 * If this flag is set to '1', then the queue is
25417 * configured asymmetrically on TX and RX sides.
25418 * If this flag is set to '', then this queue is
25419 * configured symmetrically on TX and RX sides.
25420 */
25421 #define HWRM_QUEUE_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG UINT32_C(0x1)
25422 uint8_t unused_0;
25423 /*
25424 * This field is used in Output records to indicate that the output
25425 * is completely written to RAM. This field should be read as '1'
25426 * to indicate that the output has been completely written.
25427 * When writing a command completion or response to an internal processor,
25428 * the order of writes has to be such that this field is written last.
25429 */
25430 uint8_t valid;
25431 } hwrm_queue_qcfg_output_t, *phwrm_queue_qcfg_output_t;
25432
25433 /******************
25434 * hwrm_queue_cfg *
25435 ******************/
25436
25437
25438 /* hwrm_queue_cfg_input (size:320b/40B) */
25439
25440 typedef struct hwrm_queue_cfg_input {
25441 /* The HWRM command request type. */
25442 uint16_t req_type;
25443 /*
25444 * The completion ring to send the completion event on. This should
25445 * be the NQ ID returned from the `nq_alloc` HWRM command.
25446 */
25447 uint16_t cmpl_ring;
25448 /*
25449 * The sequence ID is used by the driver for tracking multiple
25450 * commands. This ID is treated as opaque data by the firmware and
25451 * the value is returned in the `hwrm_resp_hdr` upon completion.
25452 */
25453 uint16_t seq_id;
25454 /*
25455 * The target ID of the command:
25456 * * 0x0-0xFFF8 - The function ID
25457 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25458 * * 0xFFFD - Reserved for user-space HWRM interface
25459 * * 0xFFFF - HWRM
25460 */
25461 uint16_t target_id;
25462 /*
25463 * A physical address pointer pointing to a host buffer that the
25464 * command's response data will be written. This can be either a host
25465 * physical address (HPA) or a guest physical address (GPA) and must
25466 * point to a physically contiguous block of memory.
25467 */
25468 uint64_t resp_addr;
25469 uint32_t flags;
25470 /*
25471 * Enumeration denoting the RX, TX, or both directions applicable to the resource.
25472 * This enumeration is used for resources that are similar for both
25473 * TX and RX paths of the chip.
25474 */
25475 #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_MASK UINT32_C(0x3)
25476 #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_SFT 0
25477 /* tx path */
25478 #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_TX UINT32_C(0x0)
25479 /* rx path */
25480 #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_RX UINT32_C(0x1)
25481 /* Bi-directional (Symmetrically applicable to TX and RX paths) */
25482 #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR UINT32_C(0x2)
25483 #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_LAST HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR
25484 uint32_t enables;
25485 /*
25486 * This bit must be '1' for the dflt_len field to be
25487 * configured.
25488 */
25489 #define HWRM_QUEUE_CFG_INPUT_ENABLES_DFLT_LEN UINT32_C(0x1)
25490 /*
25491 * This bit must be '1' for the service_profile field to be
25492 * configured.
25493 */
25494 #define HWRM_QUEUE_CFG_INPUT_ENABLES_SERVICE_PROFILE UINT32_C(0x2)
25495 /* Queue ID of queue that is to be configured by this function. */
25496 uint32_t queue_id;
25497 /*
25498 * This value is a the estimate packet length used in the
25499 * TX arbiter.
25500 * Set to 0xFF... (All Fs) to not adjust this value.
25501 */
25502 uint32_t dflt_len;
25503 /* This value is applicable to CoS queues only. */
25504 uint8_t service_profile;
25505 /* Lossy (best-effort) */
25506 #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSY UINT32_C(0x0)
25507 /* Lossless */
25508 #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
25509 /* Set to 0xFF... (All Fs) if there is no service profile specified */
25510 #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN UINT32_C(0xff)
25511 #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LAST HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN
25512 uint8_t unused_0[7];
25513 } hwrm_queue_cfg_input_t, *phwrm_queue_cfg_input_t;
25514
25515 /* hwrm_queue_cfg_output (size:128b/16B) */
25516
25517 typedef struct hwrm_queue_cfg_output {
25518 /* The specific error status for the command. */
25519 uint16_t error_code;
25520 /* The HWRM command request type. */
25521 uint16_t req_type;
25522 /* The sequence ID from the original command. */
25523 uint16_t seq_id;
25524 /* The length of the response data in number of bytes. */
25525 uint16_t resp_len;
25526 uint8_t unused_0[7];
25527 /*
25528 * This field is used in Output records to indicate that the output
25529 * is completely written to RAM. This field should be read as '1'
25530 * to indicate that the output has been completely written.
25531 * When writing a command completion or response to an internal processor,
25532 * the order of writes has to be such that this field is written last.
25533 */
25534 uint8_t valid;
25535 } hwrm_queue_cfg_output_t, *phwrm_queue_cfg_output_t;
25536
25537 /*****************************
25538 * hwrm_queue_pfcenable_qcfg *
25539 *****************************/
25540
25541
25542 /* hwrm_queue_pfcenable_qcfg_input (size:192b/24B) */
25543
25544 typedef struct hwrm_queue_pfcenable_qcfg_input {
25545 /* The HWRM command request type. */
25546 uint16_t req_type;
25547 /*
25548 * The completion ring to send the completion event on. This should
25549 * be the NQ ID returned from the `nq_alloc` HWRM command.
25550 */
25551 uint16_t cmpl_ring;
25552 /*
25553 * The sequence ID is used by the driver for tracking multiple
25554 * commands. This ID is treated as opaque data by the firmware and
25555 * the value is returned in the `hwrm_resp_hdr` upon completion.
25556 */
25557 uint16_t seq_id;
25558 /*
25559 * The target ID of the command:
25560 * * 0x0-0xFFF8 - The function ID
25561 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25562 * * 0xFFFD - Reserved for user-space HWRM interface
25563 * * 0xFFFF - HWRM
25564 */
25565 uint16_t target_id;
25566 /*
25567 * A physical address pointer pointing to a host buffer that the
25568 * command's response data will be written. This can be either a host
25569 * physical address (HPA) or a guest physical address (GPA) and must
25570 * point to a physically contiguous block of memory.
25571 */
25572 uint64_t resp_addr;
25573 /*
25574 * Port ID of port for which the table is being configured.
25575 * The HWRM needs to check whether this function is allowed
25576 * to configure pri2cos mapping on this port.
25577 */
25578 uint16_t port_id;
25579 uint8_t unused_0[6];
25580 } hwrm_queue_pfcenable_qcfg_input_t, *phwrm_queue_pfcenable_qcfg_input_t;
25581
25582 /* hwrm_queue_pfcenable_qcfg_output (size:128b/16B) */
25583
25584 typedef struct hwrm_queue_pfcenable_qcfg_output {
25585 /* The specific error status for the command. */
25586 uint16_t error_code;
25587 /* The HWRM command request type. */
25588 uint16_t req_type;
25589 /* The sequence ID from the original command. */
25590 uint16_t seq_id;
25591 /* The length of the response data in number of bytes. */
25592 uint16_t resp_len;
25593 uint32_t flags;
25594 /* If set to 1, then PFC is enabled on PRI 0. */
25595 #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI0_PFC_ENABLED UINT32_C(0x1)
25596 /* If set to 1, then PFC is enabled on PRI 1. */
25597 #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI1_PFC_ENABLED UINT32_C(0x2)
25598 /* If set to 1, then PFC is enabled on PRI 2. */
25599 #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI2_PFC_ENABLED UINT32_C(0x4)
25600 /* If set to 1, then PFC is enabled on PRI 3. */
25601 #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI3_PFC_ENABLED UINT32_C(0x8)
25602 /* If set to 1, then PFC is enabled on PRI 4. */
25603 #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI4_PFC_ENABLED UINT32_C(0x10)
25604 /* If set to 1, then PFC is enabled on PRI 5. */
25605 #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI5_PFC_ENABLED UINT32_C(0x20)
25606 /* If set to 1, then PFC is enabled on PRI 6. */
25607 #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI6_PFC_ENABLED UINT32_C(0x40)
25608 /* If set to 1, then PFC is enabled on PRI 7. */
25609 #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI7_PFC_ENABLED UINT32_C(0x80)
25610 /* If set to 1, then PFC WatchDog is requested to be enabled on PRI0. */
25611 #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI0_PFC_WATCHDOG_ENABLED UINT32_C(0x100)
25612 /* If set to 1, then PFC WatchDog is requested to be enabled on PRI1. */
25613 #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI1_PFC_WATCHDOG_ENABLED UINT32_C(0x200)
25614 /* If set to 1, then PFC WatchDog is requested to be enabled on PRI2. */
25615 #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI2_PFC_WATCHDOG_ENABLED UINT32_C(0x400)
25616 /* If set to 1, then PFC WatchDog is requested to be enabled on PRI3. */
25617 #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI3_PFC_WATCHDOG_ENABLED UINT32_C(0x800)
25618 /* If set to 1, then PFC WatchDog is requested to be enabled on PRI4. */
25619 #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI4_PFC_WATCHDOG_ENABLED UINT32_C(0x1000)
25620 /* If set to 1, then PFC WatchDog is requested to be enabled on PRI5. */
25621 #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI5_PFC_WATCHDOG_ENABLED UINT32_C(0x2000)
25622 /* If set to 1, then PFC WatchDog is requested to be enabled on PRI6. */
25623 #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI6_PFC_WATCHDOG_ENABLED UINT32_C(0x4000)
25624 /* If set to 1, then PFC WatchDog is requested to be enabled on PRI7. */
25625 #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI7_PFC_WATCHDOG_ENABLED UINT32_C(0x8000)
25626 uint8_t unused_0[3];
25627 /*
25628 * This field is used in Output records to indicate that the output
25629 * is completely written to RAM. This field should be read as '1'
25630 * to indicate that the output has been completely written.
25631 * When writing a command completion or response to an internal processor,
25632 * the order of writes has to be such that this field is written last.
25633 */
25634 uint8_t valid;
25635 } hwrm_queue_pfcenable_qcfg_output_t, *phwrm_queue_pfcenable_qcfg_output_t;
25636
25637 /****************************
25638 * hwrm_queue_pfcenable_cfg *
25639 ****************************/
25640
25641
25642 /* hwrm_queue_pfcenable_cfg_input (size:192b/24B) */
25643
25644 typedef struct hwrm_queue_pfcenable_cfg_input {
25645 /* The HWRM command request type. */
25646 uint16_t req_type;
25647 /*
25648 * The completion ring to send the completion event on. This should
25649 * be the NQ ID returned from the `nq_alloc` HWRM command.
25650 */
25651 uint16_t cmpl_ring;
25652 /*
25653 * The sequence ID is used by the driver for tracking multiple
25654 * commands. This ID is treated as opaque data by the firmware and
25655 * the value is returned in the `hwrm_resp_hdr` upon completion.
25656 */
25657 uint16_t seq_id;
25658 /*
25659 * The target ID of the command:
25660 * * 0x0-0xFFF8 - The function ID
25661 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25662 * * 0xFFFD - Reserved for user-space HWRM interface
25663 * * 0xFFFF - HWRM
25664 */
25665 uint16_t target_id;
25666 /*
25667 * A physical address pointer pointing to a host buffer that the
25668 * command's response data will be written. This can be either a host
25669 * physical address (HPA) or a guest physical address (GPA) and must
25670 * point to a physically contiguous block of memory.
25671 */
25672 uint64_t resp_addr;
25673 uint32_t flags;
25674 /* If set to 1, then PFC is requested to be enabled on PRI 0. */
25675 #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI0_PFC_ENABLED UINT32_C(0x1)
25676 /* If set to 1, then PFC is requested to be enabled on PRI 1. */
25677 #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI1_PFC_ENABLED UINT32_C(0x2)
25678 /* If set to 1, then PFC is requested to be enabled on PRI 2. */
25679 #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI2_PFC_ENABLED UINT32_C(0x4)
25680 /* If set to 1, then PFC is requested to be enabled on PRI 3. */
25681 #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI3_PFC_ENABLED UINT32_C(0x8)
25682 /* If set to 1, then PFC is requested to be enabled on PRI 4. */
25683 #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI4_PFC_ENABLED UINT32_C(0x10)
25684 /* If set to 1, then PFC is requested to be enabled on PRI 5. */
25685 #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI5_PFC_ENABLED UINT32_C(0x20)
25686 /* If set to 1, then PFC is requested to be enabled on PRI 6. */
25687 #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI6_PFC_ENABLED UINT32_C(0x40)
25688 /* If set to 1, then PFC is requested to be enabled on PRI 7. */
25689 #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI7_PFC_ENABLED UINT32_C(0x80)
25690 /* If set to 1, then PFC WatchDog is requested to be enabled on PRI0. */
25691 #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI0_PFC_WATCHDOG_ENABLED UINT32_C(0x100)
25692 /* If set to 1, then PFC WatchDog is requested to be enabled on PRI1. */
25693 #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI1_PFC_WATCHDOG_ENABLED UINT32_C(0x200)
25694 /* If set to 1, then PFC WatchDog is requested to be enabled on PRI2. */
25695 #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI2_PFC_WATCHDOG_ENABLED UINT32_C(0x400)
25696 /* If set to 1, then PFC WatchDog is requested to be enabled on PRI3. */
25697 #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI3_PFC_WATCHDOG_ENABLED UINT32_C(0x800)
25698 /* If set to 1, then PFC WatchDog is requested to be enabled on PRI4. */
25699 #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI4_PFC_WATCHDOG_ENABLED UINT32_C(0x1000)
25700 /* If set to 1, then PFC WatchDog is requested to be enabled on PRI5. */
25701 #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI5_PFC_WATCHDOG_ENABLED UINT32_C(0x2000)
25702 /* If set to 1, then PFC WatchDog is requested to be enabled on PRI6. */
25703 #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI6_PFC_WATCHDOG_ENABLED UINT32_C(0x4000)
25704 /* If set to 1, then PFC WatchDog is requested to be enabled on PRI7. */
25705 #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI7_PFC_WATCHDOG_ENABLED UINT32_C(0x8000)
25706 /*
25707 * Port ID of port for which the table is being configured.
25708 * The HWRM needs to check whether this function is allowed
25709 * to configure pri2cos mapping on this port.
25710 */
25711 uint16_t port_id;
25712 uint8_t unused_0[2];
25713 } hwrm_queue_pfcenable_cfg_input_t, *phwrm_queue_pfcenable_cfg_input_t;
25714
25715 /* hwrm_queue_pfcenable_cfg_output (size:128b/16B) */
25716
25717 typedef struct hwrm_queue_pfcenable_cfg_output {
25718 /* The specific error status for the command. */
25719 uint16_t error_code;
25720 /* The HWRM command request type. */
25721 uint16_t req_type;
25722 /* The sequence ID from the original command. */
25723 uint16_t seq_id;
25724 /* The length of the response data in number of bytes. */
25725 uint16_t resp_len;
25726 uint8_t unused_0[7];
25727 /*
25728 * This field is used in Output records to indicate that the output
25729 * is completely written to RAM. This field should be read as '1'
25730 * to indicate that the output has been completely written.
25731 * When writing a command completion or response to an internal processor,
25732 * the order of writes has to be such that this field is written last.
25733 */
25734 uint8_t valid;
25735 } hwrm_queue_pfcenable_cfg_output_t, *phwrm_queue_pfcenable_cfg_output_t;
25736
25737 /***************************
25738 * hwrm_queue_pri2cos_qcfg *
25739 ***************************/
25740
25741
25742 /* hwrm_queue_pri2cos_qcfg_input (size:192b/24B) */
25743
25744 typedef struct hwrm_queue_pri2cos_qcfg_input {
25745 /* The HWRM command request type. */
25746 uint16_t req_type;
25747 /*
25748 * The completion ring to send the completion event on. This should
25749 * be the NQ ID returned from the `nq_alloc` HWRM command.
25750 */
25751 uint16_t cmpl_ring;
25752 /*
25753 * The sequence ID is used by the driver for tracking multiple
25754 * commands. This ID is treated as opaque data by the firmware and
25755 * the value is returned in the `hwrm_resp_hdr` upon completion.
25756 */
25757 uint16_t seq_id;
25758 /*
25759 * The target ID of the command:
25760 * * 0x0-0xFFF8 - The function ID
25761 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25762 * * 0xFFFD - Reserved for user-space HWRM interface
25763 * * 0xFFFF - HWRM
25764 */
25765 uint16_t target_id;
25766 /*
25767 * A physical address pointer pointing to a host buffer that the
25768 * command's response data will be written. This can be either a host
25769 * physical address (HPA) or a guest physical address (GPA) and must
25770 * point to a physically contiguous block of memory.
25771 */
25772 uint64_t resp_addr;
25773 uint32_t flags;
25774 /*
25775 * Enumeration denoting the RX, TX type of the resource.
25776 * This enumeration is used for resources that are similar for both
25777 * TX and RX paths of the chip.
25778 */
25779 #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH UINT32_C(0x1)
25780 /* tx path */
25781 #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_TX UINT32_C(0x0)
25782 /* rx path */
25783 #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX UINT32_C(0x1)
25784 #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_LAST HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX
25785 /*
25786 * When this bit is set to '', the query is
25787 * for PRI from tunnel headers.
25788 * When this bit is set to '1', the query is
25789 * for PRI from inner packet headers.
25790 */
25791 #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_IVLAN UINT32_C(0x2)
25792 /*
25793 * Port ID of port for which the table is being configured.
25794 * The HWRM needs to check whether this function is allowed
25795 * to configure pri2cos mapping on this port.
25796 */
25797 uint8_t port_id;
25798 uint8_t unused_0[3];
25799 } hwrm_queue_pri2cos_qcfg_input_t, *phwrm_queue_pri2cos_qcfg_input_t;
25800
25801 /* hwrm_queue_pri2cos_qcfg_output (size:192b/24B) */
25802
25803 typedef struct hwrm_queue_pri2cos_qcfg_output {
25804 /* The specific error status for the command. */
25805 uint16_t error_code;
25806 /* The HWRM command request type. */
25807 uint16_t req_type;
25808 /* The sequence ID from the original command. */
25809 uint16_t seq_id;
25810 /* The length of the response data in number of bytes. */
25811 uint16_t resp_len;
25812 /*
25813 * CoS Queue assigned to priority 0. This value can only
25814 * be changed before traffic has started.
25815 * A value of 0xff indicates that no CoS queue is assigned to the
25816 * specified priority.
25817 */
25818 uint8_t pri0_cos_queue_id;
25819 /*
25820 * CoS Queue assigned to priority 1. This value can only
25821 * be changed before traffic has started.
25822 * A value of 0xff indicates that no CoS queue is assigned to the
25823 * specified priority.
25824 */
25825 uint8_t pri1_cos_queue_id;
25826 /*
25827 * CoS Queue assigned to priority 2. This value can only
25828 * be changed before traffic has started.
25829 * A value of 0xff indicates that no CoS queue is assigned to the
25830 * specified priority.
25831 */
25832 uint8_t pri2_cos_queue_id;
25833 /*
25834 * CoS Queue assigned to priority 3. This value can only
25835 * be changed before traffic has started.
25836 * A value of 0xff indicates that no CoS queue is assigned to the
25837 * specified priority.
25838 */
25839 uint8_t pri3_cos_queue_id;
25840 /*
25841 * CoS Queue assigned to priority 4. This value can only
25842 * be changed before traffic has started.
25843 * A value of 0xff indicates that no CoS queue is assigned to the
25844 * specified priority.
25845 */
25846 uint8_t pri4_cos_queue_id;
25847 /*
25848 * CoS Queue assigned to priority 5. This value can only
25849 * be changed before traffic has started.
25850 * A value of 0xff indicates that no CoS queue is assigned to the
25851 * specified priority.
25852 */
25853 uint8_t pri5_cos_queue_id;
25854 /*
25855 * CoS Queue assigned to priority 6. This value can only
25856 * be changed before traffic has started.
25857 * A value of 0xff indicates that no CoS queue is assigned to the
25858 * specified priority.
25859 */
25860 uint8_t pri6_cos_queue_id;
25861 /*
25862 * CoS Queue assigned to priority 7. This value can only
25863 * be changed before traffic has started.
25864 * A value of 0xff indicates that no CoS queue is assigned to the
25865 * specified priority.
25866 */
25867 uint8_t pri7_cos_queue_id;
25868 /* Information about queue configuration. */
25869 uint8_t queue_cfg_info;
25870 /*
25871 * If this flag is set to '1', then the PRI to CoS
25872 * configuration is asymmetric on TX and RX sides.
25873 * If this flag is set to '', then PRI to CoS configuration
25874 * is symmetric on TX and RX sides.
25875 */
25876 #define HWRM_QUEUE_PRI2COS_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG UINT32_C(0x1)
25877 uint8_t unused_0[6];
25878 /*
25879 * This field is used in Output records to indicate that the output
25880 * is completely written to RAM. This field should be read as '1'
25881 * to indicate that the output has been completely written.
25882 * When writing a command completion or response to an internal processor,
25883 * the order of writes has to be such that this field is written last.
25884 */
25885 uint8_t valid;
25886 } hwrm_queue_pri2cos_qcfg_output_t, *phwrm_queue_pri2cos_qcfg_output_t;
25887
25888 /**************************
25889 * hwrm_queue_pri2cos_cfg *
25890 **************************/
25891
25892
25893 /* hwrm_queue_pri2cos_cfg_input (size:320b/40B) */
25894
25895 typedef struct hwrm_queue_pri2cos_cfg_input {
25896 /* The HWRM command request type. */
25897 uint16_t req_type;
25898 /*
25899 * The completion ring to send the completion event on. This should
25900 * be the NQ ID returned from the `nq_alloc` HWRM command.
25901 */
25902 uint16_t cmpl_ring;
25903 /*
25904 * The sequence ID is used by the driver for tracking multiple
25905 * commands. This ID is treated as opaque data by the firmware and
25906 * the value is returned in the `hwrm_resp_hdr` upon completion.
25907 */
25908 uint16_t seq_id;
25909 /*
25910 * The target ID of the command:
25911 * * 0x0-0xFFF8 - The function ID
25912 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25913 * * 0xFFFD - Reserved for user-space HWRM interface
25914 * * 0xFFFF - HWRM
25915 */
25916 uint16_t target_id;
25917 /*
25918 * A physical address pointer pointing to a host buffer that the
25919 * command's response data will be written. This can be either a host
25920 * physical address (HPA) or a guest physical address (GPA) and must
25921 * point to a physically contiguous block of memory.
25922 */
25923 uint64_t resp_addr;
25924 uint32_t flags;
25925 /*
25926 * Enumeration denoting the RX, TX, or both directions applicable to the resource.
25927 * This enumeration is used for resources that are similar for both
25928 * TX and RX paths of the chip.
25929 */
25930 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_MASK UINT32_C(0x3)
25931 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_SFT 0
25932 /* tx path */
25933 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_TX UINT32_C(0x0)
25934 /* rx path */
25935 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_RX UINT32_C(0x1)
25936 /* Bi-directional (Symmetrically applicable to TX and RX paths) */
25937 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR UINT32_C(0x2)
25938 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_LAST HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR
25939 /*
25940 * When this bit is set to '', the mapping is requested
25941 * for PRI from tunnel headers.
25942 * When this bit is set to '1', the mapping is requested
25943 * for PRI from inner packet headers.
25944 */
25945 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_IVLAN UINT32_C(0x4)
25946 uint32_t enables;
25947 /*
25948 * This bit must be '1' for the pri0_cos_queue_id field to be
25949 * configured.
25950 */
25951 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI0_COS_QUEUE_ID UINT32_C(0x1)
25952 /*
25953 * This bit must be '1' for the pri1_cos_queue_id field to be
25954 * configured.
25955 */
25956 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI1_COS_QUEUE_ID UINT32_C(0x2)
25957 /*
25958 * This bit must be '1' for the pri2_cos_queue_id field to be
25959 * configured.
25960 */
25961 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI2_COS_QUEUE_ID UINT32_C(0x4)
25962 /*
25963 * This bit must be '1' for the pri3_cos_queue_id field to be
25964 * configured.
25965 */
25966 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI3_COS_QUEUE_ID UINT32_C(0x8)
25967 /*
25968 * This bit must be '1' for the pri4_cos_queue_id field to be
25969 * configured.
25970 */
25971 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI4_COS_QUEUE_ID UINT32_C(0x10)
25972 /*
25973 * This bit must be '1' for the pri5_cos_queue_id field to be
25974 * configured.
25975 */
25976 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI5_COS_QUEUE_ID UINT32_C(0x20)
25977 /*
25978 * This bit must be '1' for the pri6_cos_queue_id field to be
25979 * configured.
25980 */
25981 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI6_COS_QUEUE_ID UINT32_C(0x40)
25982 /*
25983 * This bit must be '1' for the pri7_cos_queue_id field to be
25984 * configured.
25985 */
25986 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI7_COS_QUEUE_ID UINT32_C(0x80)
25987 /*
25988 * Port ID of port for which the table is being configured.
25989 * The HWRM needs to check whether this function is allowed
25990 * to configure pri2cos mapping on this port.
25991 */
25992 uint8_t port_id;
25993 /*
25994 * CoS Queue assigned to priority 0. This value can only
25995 * be changed before traffic has started.
25996 */
25997 uint8_t pri0_cos_queue_id;
25998 /*
25999 * CoS Queue assigned to priority 1. This value can only
26000 * be changed before traffic has started.
26001 */
26002 uint8_t pri1_cos_queue_id;
26003 /*
26004 * CoS Queue assigned to priority 2 This value can only
26005 * be changed before traffic has started.
26006 */
26007 uint8_t pri2_cos_queue_id;
26008 /*
26009 * CoS Queue assigned to priority 3. This value can only
26010 * be changed before traffic has started.
26011 */
26012 uint8_t pri3_cos_queue_id;
26013 /*
26014 * CoS Queue assigned to priority 4. This value can only
26015 * be changed before traffic has started.
26016 */
26017 uint8_t pri4_cos_queue_id;
26018 /*
26019 * CoS Queue assigned to priority 5. This value can only
26020 * be changed before traffic has started.
26021 */
26022 uint8_t pri5_cos_queue_id;
26023 /*
26024 * CoS Queue assigned to priority 6. This value can only
26025 * be changed before traffic has started.
26026 */
26027 uint8_t pri6_cos_queue_id;
26028 /*
26029 * CoS Queue assigned to priority 7. This value can only
26030 * be changed before traffic has started.
26031 */
26032 uint8_t pri7_cos_queue_id;
26033 uint8_t unused_0[7];
26034 } hwrm_queue_pri2cos_cfg_input_t, *phwrm_queue_pri2cos_cfg_input_t;
26035
26036 /* hwrm_queue_pri2cos_cfg_output (size:128b/16B) */
26037
26038 typedef struct hwrm_queue_pri2cos_cfg_output {
26039 /* The specific error status for the command. */
26040 uint16_t error_code;
26041 /* The HWRM command request type. */
26042 uint16_t req_type;
26043 /* The sequence ID from the original command. */
26044 uint16_t seq_id;
26045 /* The length of the response data in number of bytes. */
26046 uint16_t resp_len;
26047 uint8_t unused_0[7];
26048 /*
26049 * This field is used in Output records to indicate that the output
26050 * is completely written to RAM. This field should be read as '1'
26051 * to indicate that the output has been completely written.
26052 * When writing a command completion or response to an internal processor,
26053 * the order of writes has to be such that this field is written last.
26054 */
26055 uint8_t valid;
26056 } hwrm_queue_pri2cos_cfg_output_t, *phwrm_queue_pri2cos_cfg_output_t;
26057
26058 /**************************
26059 * hwrm_queue_cos2bw_qcfg *
26060 **************************/
26061
26062
26063 /* hwrm_queue_cos2bw_qcfg_input (size:192b/24B) */
26064
26065 typedef struct hwrm_queue_cos2bw_qcfg_input {
26066 /* The HWRM command request type. */
26067 uint16_t req_type;
26068 /*
26069 * The completion ring to send the completion event on. This should
26070 * be the NQ ID returned from the `nq_alloc` HWRM command.
26071 */
26072 uint16_t cmpl_ring;
26073 /*
26074 * The sequence ID is used by the driver for tracking multiple
26075 * commands. This ID is treated as opaque data by the firmware and
26076 * the value is returned in the `hwrm_resp_hdr` upon completion.
26077 */
26078 uint16_t seq_id;
26079 /*
26080 * The target ID of the command:
26081 * * 0x0-0xFFF8 - The function ID
26082 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26083 * * 0xFFFD - Reserved for user-space HWRM interface
26084 * * 0xFFFF - HWRM
26085 */
26086 uint16_t target_id;
26087 /*
26088 * A physical address pointer pointing to a host buffer that the
26089 * command's response data will be written. This can be either a host
26090 * physical address (HPA) or a guest physical address (GPA) and must
26091 * point to a physically contiguous block of memory.
26092 */
26093 uint64_t resp_addr;
26094 /*
26095 * Port ID of port for which the table is being configured.
26096 * The HWRM needs to check whether this function is allowed
26097 * to configure TC BW assignment on this port.
26098 */
26099 uint16_t port_id;
26100 uint8_t unused_0[6];
26101 } hwrm_queue_cos2bw_qcfg_input_t, *phwrm_queue_cos2bw_qcfg_input_t;
26102
26103 /* hwrm_queue_cos2bw_qcfg_output (size:896b/112B) */
26104
26105 typedef struct hwrm_queue_cos2bw_qcfg_output {
26106 /* The specific error status for the command. */
26107 uint16_t error_code;
26108 /* The HWRM command request type. */
26109 uint16_t req_type;
26110 /* The sequence ID from the original command. */
26111 uint16_t seq_id;
26112 /* The length of the response data in number of bytes. */
26113 uint16_t resp_len;
26114 /* ID of CoS Queue 0. */
26115 uint8_t queue_id0;
26116 uint8_t unused_0;
26117 uint16_t unused_1;
26118 /*
26119 * Minimum BW allocated to CoS Queue.
26120 * The HWRM will translate this value into byte counter and
26121 * time interval used for this COS inside the device.
26122 */
26123 uint32_t queue_id0_min_bw;
26124 /* The bandwidth value. */
26125 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
26126 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT 0
26127 /* The granularity of the value (bits or bytes). */
26128 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE UINT32_C(0x10000000)
26129 /* Value is in bits. */
26130 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
26131 /* Value is in bytes. */
26132 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
26133 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES
26134 /* bw_value_unit is 3 b */
26135 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
26136 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT 29
26137 /* Value is in Mb or MB (base 10). */
26138 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
26139 /* Value is in Kb or KB (base 10). */
26140 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
26141 /* Value is in bits or bytes. */
26142 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
26143 /* Value is in Gb or GB (base 10). */
26144 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
26145 /* Value is in 1/100th of a percentage of total bandwidth. */
26146 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
26147 /* Invalid unit */
26148 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
26149 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID
26150 /*
26151 * Maximum BW allocated to CoS Queue.
26152 * The HWRM will translate this value into byte counter and
26153 * time interval used for this COS inside the device.
26154 */
26155 uint32_t queue_id0_max_bw;
26156 /* The bandwidth value. */
26157 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
26158 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT 0
26159 /* The granularity of the value (bits or bytes). */
26160 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE UINT32_C(0x10000000)
26161 /* Value is in bits. */
26162 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
26163 /* Value is in bytes. */
26164 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
26165 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES
26166 /* bw_value_unit is 3 b */
26167 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
26168 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT 29
26169 /* Value is in Mb or MB (base 10). */
26170 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
26171 /* Value is in Kb or KB (base 10). */
26172 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
26173 /* Value is in bits or bytes. */
26174 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
26175 /* Value is in Gb or GB (base 10). */
26176 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
26177 /* Value is in 1/100th of a percentage of total bandwidth. */
26178 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
26179 /* Invalid unit */
26180 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
26181 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID
26182 /* Transmission Selection Algorithm (TSA) for CoS Queue. */
26183 uint8_t queue_id0_tsa_assign;
26184 /* Strict Priority */
26185 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_SP UINT32_C(0x0)
26186 /* Enhanced Transmission Selection */
26187 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_ETS UINT32_C(0x1)
26188 /* reserved. */
26189 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
26190 /* reserved. */
26191 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
26192 /*
26193 * Priority level for strict priority. Valid only when the
26194 * tsa_assign is 0 - Strict Priority (SP)
26195 * 0..7 - Valid values.
26196 * 8..255 - Reserved.
26197 */
26198 uint8_t queue_id0_pri_lvl;
26199 /*
26200 * Weight used to allocate remaining BW for this COS after
26201 * servicing guaranteed bandwidths for all COS.
26202 */
26203 uint8_t queue_id0_bw_weight;
26204 /* ID of CoS Queue 1. */
26205 uint8_t queue_id1;
26206 /*
26207 * Minimum BW allocated to CoS Queue.
26208 * The HWRM will translate this value into byte counter and
26209 * time interval used for this COS inside the device.
26210 */
26211 uint32_t queue_id1_min_bw;
26212 /* The bandwidth value. */
26213 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
26214 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT 0
26215 /* The granularity of the value (bits or bytes). */
26216 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE UINT32_C(0x10000000)
26217 /* Value is in bits. */
26218 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
26219 /* Value is in bytes. */
26220 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
26221 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES
26222 /* bw_value_unit is 3 b */
26223 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
26224 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT 29
26225 /* Value is in Mb or MB (base 10). */
26226 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
26227 /* Value is in Kb or KB (base 10). */
26228 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
26229 /* Value is in bits or bytes. */
26230 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
26231 /* Value is in Gb or GB (base 10). */
26232 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
26233 /* Value is in 1/100th of a percentage of total bandwidth. */
26234 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
26235 /* Invalid unit */
26236 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
26237 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID
26238 /*
26239 * Maximum BW allocated to CoS queue.
26240 * The HWRM will translate this value into byte counter and
26241 * time interval used for this COS inside the device.
26242 */
26243 uint32_t queue_id1_max_bw;
26244 /* The bandwidth value. */
26245 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
26246 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT 0
26247 /* The granularity of the value (bits or bytes). */
26248 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE UINT32_C(0x10000000)
26249 /* Value is in bits. */
26250 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
26251 /* Value is in bytes. */
26252 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
26253 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES
26254 /* bw_value_unit is 3 b */
26255 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
26256 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT 29
26257 /* Value is in Mb or MB (base 10). */
26258 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
26259 /* Value is in Kb or KB (base 10). */
26260 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
26261 /* Value is in bits or bytes. */
26262 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
26263 /* Value is in Gb or GB (base 10). */
26264 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
26265 /* Value is in 1/100th of a percentage of total bandwidth. */
26266 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
26267 /* Invalid unit */
26268 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
26269 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID
26270 /* Transmission Selection Algorithm (TSA) for CoS Queue. */
26271 uint8_t queue_id1_tsa_assign;
26272 /* Strict Priority */
26273 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_SP UINT32_C(0x0)
26274 /* Enhanced Transmission Selection */
26275 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_ETS UINT32_C(0x1)
26276 /* reserved. */
26277 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
26278 /* reserved. */
26279 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
26280 /*
26281 * Priority level for strict priority. Valid only when the
26282 * tsa_assign is 0 - Strict Priority (SP)
26283 * 0..7 - Valid values.
26284 * 8..255 - Reserved.
26285 */
26286 uint8_t queue_id1_pri_lvl;
26287 /*
26288 * Weight used to allocate remaining BW for this COS after
26289 * servicing guaranteed bandwidths for all COS.
26290 */
26291 uint8_t queue_id1_bw_weight;
26292 /* ID of CoS Queue 2. */
26293 uint8_t queue_id2;
26294 /*
26295 * Minimum BW allocated to CoS Queue.
26296 * The HWRM will translate this value into byte counter and
26297 * time interval used for this COS inside the device.
26298 */
26299 uint32_t queue_id2_min_bw;
26300 /* The bandwidth value. */
26301 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
26302 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT 0
26303 /* The granularity of the value (bits or bytes). */
26304 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE UINT32_C(0x10000000)
26305 /* Value is in bits. */
26306 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
26307 /* Value is in bytes. */
26308 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
26309 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES
26310 /* bw_value_unit is 3 b */
26311 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
26312 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT 29
26313 /* Value is in Mb or MB (base 10). */
26314 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
26315 /* Value is in Kb or KB (base 10). */
26316 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
26317 /* Value is in bits or bytes. */
26318 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
26319 /* Value is in Gb or GB (base 10). */
26320 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
26321 /* Value is in 1/100th of a percentage of total bandwidth. */
26322 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
26323 /* Invalid unit */
26324 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
26325 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID
26326 /*
26327 * Maximum BW allocated to CoS queue.
26328 * The HWRM will translate this value into byte counter and
26329 * time interval used for this COS inside the device.
26330 */
26331 uint32_t queue_id2_max_bw;
26332 /* The bandwidth value. */
26333 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
26334 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT 0
26335 /* The granularity of the value (bits or bytes). */
26336 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE UINT32_C(0x10000000)
26337 /* Value is in bits. */
26338 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
26339 /* Value is in bytes. */
26340 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
26341 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES
26342 /* bw_value_unit is 3 b */
26343 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
26344 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT 29
26345 /* Value is in Mb or MB (base 10). */
26346 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
26347 /* Value is in Kb or KB (base 10). */
26348 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
26349 /* Value is in bits or bytes. */
26350 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
26351 /* Value is in Gb or GB (base 10). */
26352 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
26353 /* Value is in 1/100th of a percentage of total bandwidth. */
26354 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
26355 /* Invalid unit */
26356 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
26357 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID
26358 /* Transmission Selection Algorithm (TSA) for CoS Queue. */
26359 uint8_t queue_id2_tsa_assign;
26360 /* Strict Priority */
26361 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_SP UINT32_C(0x0)
26362 /* Enhanced Transmission Selection */
26363 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_ETS UINT32_C(0x1)
26364 /* reserved. */
26365 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
26366 /* reserved. */
26367 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
26368 /*
26369 * Priority level for strict priority. Valid only when the
26370 * tsa_assign is 0 - Strict Priority (SP)
26371 * 0..7 - Valid values.
26372 * 8..255 - Reserved.
26373 */
26374 uint8_t queue_id2_pri_lvl;
26375 /*
26376 * Weight used to allocate remaining BW for this COS after
26377 * servicing guaranteed bandwidths for all COS.
26378 */
26379 uint8_t queue_id2_bw_weight;
26380 /* ID of CoS Queue 3. */
26381 uint8_t queue_id3;
26382 /*
26383 * Minimum BW allocated to CoS Queue.
26384 * The HWRM will translate this value into byte counter and
26385 * time interval used for this COS inside the device.
26386 */
26387 uint32_t queue_id3_min_bw;
26388 /* The bandwidth value. */
26389 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
26390 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT 0
26391 /* The granularity of the value (bits or bytes). */
26392 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE UINT32_C(0x10000000)
26393 /* Value is in bits. */
26394 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
26395 /* Value is in bytes. */
26396 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
26397 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES
26398 /* bw_value_unit is 3 b */
26399 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
26400 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT 29
26401 /* Value is in Mb or MB (base 10). */
26402 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
26403 /* Value is in Kb or KB (base 10). */
26404 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
26405 /* Value is in bits or bytes. */
26406 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
26407 /* Value is in Gb or GB (base 10). */
26408 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
26409 /* Value is in 1/100th of a percentage of total bandwidth. */
26410 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
26411 /* Invalid unit */
26412 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
26413 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID
26414 /*
26415 * Maximum BW allocated to CoS queue.
26416 * The HWRM will translate this value into byte counter and
26417 * time interval used for this COS inside the device.
26418 */
26419 uint32_t queue_id3_max_bw;
26420 /* The bandwidth value. */
26421 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
26422 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT 0
26423 /* The granularity of the value (bits or bytes). */
26424 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE UINT32_C(0x10000000)
26425 /* Value is in bits. */
26426 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
26427 /* Value is in bytes. */
26428 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
26429 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES
26430 /* bw_value_unit is 3 b */
26431 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
26432 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT 29
26433 /* Value is in Mb or MB (base 10). */
26434 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
26435 /* Value is in Kb or KB (base 10). */
26436 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
26437 /* Value is in bits or bytes. */
26438 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
26439 /* Value is in Gb or GB (base 10). */
26440 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
26441 /* Value is in 1/100th of a percentage of total bandwidth. */
26442 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
26443 /* Invalid unit */
26444 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
26445 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID
26446 /* Transmission Selection Algorithm (TSA) for CoS Queue. */
26447 uint8_t queue_id3_tsa_assign;
26448 /* Strict Priority */
26449 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_SP UINT32_C(0x0)
26450 /* Enhanced Transmission Selection */
26451 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_ETS UINT32_C(0x1)
26452 /* reserved. */
26453 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
26454 /* reserved. */
26455 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
26456 /*
26457 * Priority level for strict priority. Valid only when the
26458 * tsa_assign is 0 - Strict Priority (SP)
26459 * 0..7 - Valid values.
26460 * 8..255 - Reserved.
26461 */
26462 uint8_t queue_id3_pri_lvl;
26463 /*
26464 * Weight used to allocate remaining BW for this COS after
26465 * servicing guaranteed bandwidths for all COS.
26466 */
26467 uint8_t queue_id3_bw_weight;
26468 /* ID of CoS Queue 4. */
26469 uint8_t queue_id4;
26470 /*
26471 * Minimum BW allocated to CoS Queue.
26472 * The HWRM will translate this value into byte counter and
26473 * time interval used for this COS inside the device.
26474 */
26475 uint32_t queue_id4_min_bw;
26476 /* The bandwidth value. */
26477 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
26478 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT 0
26479 /* The granularity of the value (bits or bytes). */
26480 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE UINT32_C(0x10000000)
26481 /* Value is in bits. */
26482 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
26483 /* Value is in bytes. */
26484 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
26485 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES
26486 /* bw_value_unit is 3 b */
26487 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
26488 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT 29
26489 /* Value is in Mb or MB (base 10). */
26490 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
26491 /* Value is in Kb or KB (base 10). */
26492 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
26493 /* Value is in bits or bytes. */
26494 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
26495 /* Value is in Gb or GB (base 10). */
26496 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
26497 /* Value is in 1/100th of a percentage of total bandwidth. */
26498 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
26499 /* Invalid unit */
26500 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
26501 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID
26502 /*
26503 * Maximum BW allocated to CoS queue.
26504 * The HWRM will translate this value into byte counter and
26505 * time interval used for this COS inside the device.
26506 */
26507 uint32_t queue_id4_max_bw;
26508 /* The bandwidth value. */
26509 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
26510 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT 0
26511 /* The granularity of the value (bits or bytes). */
26512 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE UINT32_C(0x10000000)
26513 /* Value is in bits. */
26514 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
26515 /* Value is in bytes. */
26516 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
26517 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES
26518 /* bw_value_unit is 3 b */
26519 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
26520 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT 29
26521 /* Value is in Mb or MB (base 10). */
26522 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
26523 /* Value is in Kb or KB (base 10). */
26524 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
26525 /* Value is in bits or bytes. */
26526 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
26527 /* Value is in Gb or GB (base 10). */
26528 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
26529 /* Value is in 1/100th of a percentage of total bandwidth. */
26530 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
26531 /* Invalid unit */
26532 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
26533 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID
26534 /* Transmission Selection Algorithm (TSA) for CoS Queue. */
26535 uint8_t queue_id4_tsa_assign;
26536 /* Strict Priority */
26537 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_SP UINT32_C(0x0)
26538 /* Enhanced Transmission Selection */
26539 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_ETS UINT32_C(0x1)
26540 /* reserved. */
26541 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
26542 /* reserved. */
26543 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
26544 /*
26545 * Priority level for strict priority. Valid only when the
26546 * tsa_assign is 0 - Strict Priority (SP)
26547 * 0..7 - Valid values.
26548 * 8..255 - Reserved.
26549 */
26550 uint8_t queue_id4_pri_lvl;
26551 /*
26552 * Weight used to allocate remaining BW for this COS after
26553 * servicing guaranteed bandwidths for all COS.
26554 */
26555 uint8_t queue_id4_bw_weight;
26556 /* ID of CoS Queue 5. */
26557 uint8_t queue_id5;
26558 /*
26559 * Minimum BW allocated to CoS Queue.
26560 * The HWRM will translate this value into byte counter and
26561 * time interval used for this COS inside the device.
26562 */
26563 uint32_t queue_id5_min_bw;
26564 /* The bandwidth value. */
26565 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
26566 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT 0
26567 /* The granularity of the value (bits or bytes). */
26568 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE UINT32_C(0x10000000)
26569 /* Value is in bits. */
26570 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
26571 /* Value is in bytes. */
26572 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
26573 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES
26574 /* bw_value_unit is 3 b */
26575 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
26576 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT 29
26577 /* Value is in Mb or MB (base 10). */
26578 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
26579 /* Value is in Kb or KB (base 10). */
26580 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
26581 /* Value is in bits or bytes. */
26582 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
26583 /* Value is in Gb or GB (base 10). */
26584 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
26585 /* Value is in 1/100th of a percentage of total bandwidth. */
26586 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
26587 /* Invalid unit */
26588 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
26589 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID
26590 /*
26591 * Maximum BW allocated to CoS queue.
26592 * The HWRM will translate this value into byte counter and
26593 * time interval used for this COS inside the device.
26594 */
26595 uint32_t queue_id5_max_bw;
26596 /* The bandwidth value. */
26597 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
26598 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT 0
26599 /* The granularity of the value (bits or bytes). */
26600 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE UINT32_C(0x10000000)
26601 /* Value is in bits. */
26602 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
26603 /* Value is in bytes. */
26604 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
26605 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES
26606 /* bw_value_unit is 3 b */
26607 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
26608 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT 29
26609 /* Value is in Mb or MB (base 10). */
26610 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
26611 /* Value is in Kb or KB (base 10). */
26612 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
26613 /* Value is in bits or bytes. */
26614 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
26615 /* Value is in Gb or GB (base 10). */
26616 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
26617 /* Value is in 1/100th of a percentage of total bandwidth. */
26618 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
26619 /* Invalid unit */
26620 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
26621 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID
26622 /* Transmission Selection Algorithm (TSA) for CoS Queue. */
26623 uint8_t queue_id5_tsa_assign;
26624 /* Strict Priority */
26625 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_SP UINT32_C(0x0)
26626 /* Enhanced Transmission Selection */
26627 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_ETS UINT32_C(0x1)
26628 /* reserved. */
26629 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
26630 /* reserved. */
26631 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
26632 /*
26633 * Priority level for strict priority. Valid only when the
26634 * tsa_assign is 0 - Strict Priority (SP)
26635 * 0..7 - Valid values.
26636 * 8..255 - Reserved.
26637 */
26638 uint8_t queue_id5_pri_lvl;
26639 /*
26640 * Weight used to allocate remaining BW for this COS after
26641 * servicing guaranteed bandwidths for all COS.
26642 */
26643 uint8_t queue_id5_bw_weight;
26644 /* ID of CoS Queue 6. */
26645 uint8_t queue_id6;
26646 /*
26647 * Minimum BW allocated to CoS Queue.
26648 * The HWRM will translate this value into byte counter and
26649 * time interval used for this COS inside the device.
26650 */
26651 uint32_t queue_id6_min_bw;
26652 /* The bandwidth value. */
26653 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
26654 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT 0
26655 /* The granularity of the value (bits or bytes). */
26656 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE UINT32_C(0x10000000)
26657 /* Value is in bits. */
26658 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
26659 /* Value is in bytes. */
26660 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
26661 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES
26662 /* bw_value_unit is 3 b */
26663 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
26664 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT 29
26665 /* Value is in Mb or MB (base 10). */
26666 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
26667 /* Value is in Kb or KB (base 10). */
26668 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
26669 /* Value is in bits or bytes. */
26670 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
26671 /* Value is in Gb or GB (base 10). */
26672 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
26673 /* Value is in 1/100th of a percentage of total bandwidth. */
26674 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
26675 /* Invalid unit */
26676 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
26677 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID
26678 /*
26679 * Maximum BW allocated to CoS queue.
26680 * The HWRM will translate this value into byte counter and
26681 * time interval used for this COS inside the device.
26682 */
26683 uint32_t queue_id6_max_bw;
26684 /* The bandwidth value. */
26685 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
26686 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT 0
26687 /* The granularity of the value (bits or bytes). */
26688 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE UINT32_C(0x10000000)
26689 /* Value is in bits. */
26690 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
26691 /* Value is in bytes. */
26692 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
26693 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES
26694 /* bw_value_unit is 3 b */
26695 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
26696 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT 29
26697 /* Value is in Mb or MB (base 10). */
26698 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
26699 /* Value is in Kb or KB (base 10). */
26700 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
26701 /* Value is in bits or bytes. */
26702 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
26703 /* Value is in Gb or GB (base 10). */
26704 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
26705 /* Value is in 1/100th of a percentage of total bandwidth. */
26706 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
26707 /* Invalid unit */
26708 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
26709 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID
26710 /* Transmission Selection Algorithm (TSA) for CoS Queue. */
26711 uint8_t queue_id6_tsa_assign;
26712 /* Strict Priority */
26713 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_SP UINT32_C(0x0)
26714 /* Enhanced Transmission Selection */
26715 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_ETS UINT32_C(0x1)
26716 /* reserved. */
26717 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
26718 /* reserved. */
26719 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
26720 /*
26721 * Priority level for strict priority. Valid only when the
26722 * tsa_assign is 0 - Strict Priority (SP)
26723 * 0..7 - Valid values.
26724 * 8..255 - Reserved.
26725 */
26726 uint8_t queue_id6_pri_lvl;
26727 /*
26728 * Weight used to allocate remaining BW for this COS after
26729 * servicing guaranteed bandwidths for all COS.
26730 */
26731 uint8_t queue_id6_bw_weight;
26732 /* ID of CoS Queue 7. */
26733 uint8_t queue_id7;
26734 /*
26735 * Minimum BW allocated to CoS Queue.
26736 * The HWRM will translate this value into byte counter and
26737 * time interval used for this COS inside the device.
26738 */
26739 uint32_t queue_id7_min_bw;
26740 /* The bandwidth value. */
26741 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
26742 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT 0
26743 /* The granularity of the value (bits or bytes). */
26744 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE UINT32_C(0x10000000)
26745 /* Value is in bits. */
26746 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
26747 /* Value is in bytes. */
26748 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
26749 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES
26750 /* bw_value_unit is 3 b */
26751 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
26752 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT 29
26753 /* Value is in Mb or MB (base 10). */
26754 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
26755 /* Value is in Kb or KB (base 10). */
26756 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
26757 /* Value is in bits or bytes. */
26758 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
26759 /* Value is in Gb or GB (base 10). */
26760 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
26761 /* Value is in 1/100th of a percentage of total bandwidth. */
26762 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
26763 /* Invalid unit */
26764 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
26765 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID
26766 /*
26767 * Maximum BW allocated to CoS queue.
26768 * The HWRM will translate this value into byte counter and
26769 * time interval used for this COS inside the device.
26770 */
26771 uint32_t queue_id7_max_bw;
26772 /* The bandwidth value. */
26773 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
26774 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT 0
26775 /* The granularity of the value (bits or bytes). */
26776 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE UINT32_C(0x10000000)
26777 /* Value is in bits. */
26778 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
26779 /* Value is in bytes. */
26780 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
26781 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES
26782 /* bw_value_unit is 3 b */
26783 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
26784 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT 29
26785 /* Value is in Mb or MB (base 10). */
26786 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
26787 /* Value is in Kb or KB (base 10). */
26788 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
26789 /* Value is in bits or bytes. */
26790 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
26791 /* Value is in Gb or GB (base 10). */
26792 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
26793 /* Value is in 1/100th of a percentage of total bandwidth. */
26794 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
26795 /* Invalid unit */
26796 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
26797 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID
26798 /* Transmission Selection Algorithm (TSA) for CoS Queue. */
26799 uint8_t queue_id7_tsa_assign;
26800 /* Strict Priority */
26801 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_SP UINT32_C(0x0)
26802 /* Enhanced Transmission Selection */
26803 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_ETS UINT32_C(0x1)
26804 /* reserved. */
26805 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
26806 /* reserved. */
26807 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
26808 /*
26809 * Priority level for strict priority. Valid only when the
26810 * tsa_assign is 0 - Strict Priority (SP)
26811 * 0..7 - Valid values.
26812 * 8..255 - Reserved.
26813 */
26814 uint8_t queue_id7_pri_lvl;
26815 /*
26816 * Weight used to allocate remaining BW for this COS after
26817 * servicing guaranteed bandwidths for all COS.
26818 */
26819 uint8_t queue_id7_bw_weight;
26820 uint8_t unused_2[4];
26821 /*
26822 * This field is used in Output records to indicate that the output
26823 * is completely written to RAM. This field should be read as '1'
26824 * to indicate that the output has been completely written.
26825 * When writing a command completion or response to an internal processor,
26826 * the order of writes has to be such that this field is written last.
26827 */
26828 uint8_t valid;
26829 } hwrm_queue_cos2bw_qcfg_output_t, *phwrm_queue_cos2bw_qcfg_output_t;
26830
26831 /*************************
26832 * hwrm_queue_cos2bw_cfg *
26833 *************************/
26834
26835
26836 /* hwrm_queue_cos2bw_cfg_input (size:1024b/128B) */
26837
26838 typedef struct hwrm_queue_cos2bw_cfg_input {
26839 /* The HWRM command request type. */
26840 uint16_t req_type;
26841 /*
26842 * The completion ring to send the completion event on. This should
26843 * be the NQ ID returned from the `nq_alloc` HWRM command.
26844 */
26845 uint16_t cmpl_ring;
26846 /*
26847 * The sequence ID is used by the driver for tracking multiple
26848 * commands. This ID is treated as opaque data by the firmware and
26849 * the value is returned in the `hwrm_resp_hdr` upon completion.
26850 */
26851 uint16_t seq_id;
26852 /*
26853 * The target ID of the command:
26854 * * 0x0-0xFFF8 - The function ID
26855 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26856 * * 0xFFFD - Reserved for user-space HWRM interface
26857 * * 0xFFFF - HWRM
26858 */
26859 uint16_t target_id;
26860 /*
26861 * A physical address pointer pointing to a host buffer that the
26862 * command's response data will be written. This can be either a host
26863 * physical address (HPA) or a guest physical address (GPA) and must
26864 * point to a physically contiguous block of memory.
26865 */
26866 uint64_t resp_addr;
26867 uint32_t flags;
26868 uint32_t enables;
26869 /*
26870 * If this bit is set to 1, then all queue_id0 related
26871 * parameters in this command are valid.
26872 */
26873 #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID0_VALID UINT32_C(0x1)
26874 /*
26875 * If this bit is set to 1, then all queue_id1 related
26876 * parameters in this command are valid.
26877 */
26878 #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID1_VALID UINT32_C(0x2)
26879 /*
26880 * If this bit is set to 1, then all queue_id2 related
26881 * parameters in this command are valid.
26882 */
26883 #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID2_VALID UINT32_C(0x4)
26884 /*
26885 * If this bit is set to 1, then all queue_id3 related
26886 * parameters in this command are valid.
26887 */
26888 #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID3_VALID UINT32_C(0x8)
26889 /*
26890 * If this bit is set to 1, then all queue_id4 related
26891 * parameters in this command are valid.
26892 */
26893 #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID4_VALID UINT32_C(0x10)
26894 /*
26895 * If this bit is set to 1, then all queue_id5 related
26896 * parameters in this command are valid.
26897 */
26898 #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID5_VALID UINT32_C(0x20)
26899 /*
26900 * If this bit is set to 1, then all queue_id6 related
26901 * parameters in this command are valid.
26902 */
26903 #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID6_VALID UINT32_C(0x40)
26904 /*
26905 * If this bit is set to 1, then all queue_id7 related
26906 * parameters in this command are valid.
26907 */
26908 #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID7_VALID UINT32_C(0x80)
26909 /*
26910 * Port ID of port for which the table is being configured.
26911 * The HWRM needs to check whether this function is allowed
26912 * to configure TC BW assignment on this port.
26913 */
26914 uint16_t port_id;
26915 /* ID of CoS Queue 0. */
26916 uint8_t queue_id0;
26917 uint8_t unused_0;
26918 /*
26919 * Minimum BW allocated to CoS Queue.
26920 * The HWRM will translate this value into byte counter and
26921 * time interval used for this COS inside the device.
26922 */
26923 uint32_t queue_id0_min_bw;
26924 /* The bandwidth value. */
26925 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
26926 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT 0
26927 /* The granularity of the value (bits or bytes). */
26928 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE UINT32_C(0x10000000)
26929 /* Value is in bits. */
26930 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
26931 /* Value is in bytes. */
26932 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
26933 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES
26934 /* bw_value_unit is 3 b */
26935 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
26936 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT 29
26937 /* Value is in Mb or MB (base 10). */
26938 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
26939 /* Value is in Kb or KB (base 10). */
26940 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
26941 /* Value is in bits or bytes. */
26942 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
26943 /* Value is in Gb or GB (base 10). */
26944 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
26945 /* Value is in 1/100th of a percentage of total bandwidth. */
26946 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
26947 /* Invalid unit */
26948 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
26949 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID
26950 /*
26951 * Maximum BW allocated to CoS Queue.
26952 * The HWRM will translate this value into byte counter and
26953 * time interval used for this COS inside the device.
26954 */
26955 uint32_t queue_id0_max_bw;
26956 /* The bandwidth value. */
26957 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
26958 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT 0
26959 /* The granularity of the value (bits or bytes). */
26960 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE UINT32_C(0x10000000)
26961 /* Value is in bits. */
26962 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
26963 /* Value is in bytes. */
26964 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
26965 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES
26966 /* bw_value_unit is 3 b */
26967 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
26968 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT 29
26969 /* Value is in Mb or MB (base 10). */
26970 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
26971 /* Value is in Kb or KB (base 10). */
26972 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
26973 /* Value is in bits or bytes. */
26974 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
26975 /* Value is in Gb or GB (base 10). */
26976 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
26977 /* Value is in 1/100th of a percentage of total bandwidth. */
26978 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
26979 /* Invalid unit */
26980 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
26981 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID
26982 /* Transmission Selection Algorithm (TSA) for CoS Queue. */
26983 uint8_t queue_id0_tsa_assign;
26984 /* Strict Priority */
26985 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_SP UINT32_C(0x0)
26986 /* Enhanced Transmission Selection */
26987 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_ETS UINT32_C(0x1)
26988 /* reserved. */
26989 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
26990 /* reserved. */
26991 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
26992 /*
26993 * Priority level for strict priority. Valid only when the
26994 * tsa_assign is 0 - Strict Priority (SP)
26995 * 0..7 - Valid values.
26996 * 8..255 - Reserved.
26997 */
26998 uint8_t queue_id0_pri_lvl;
26999 /*
27000 * Weight used to allocate remaining BW for this COS after
27001 * servicing guaranteed bandwidths for all COS.
27002 */
27003 uint8_t queue_id0_bw_weight;
27004 /* ID of CoS Queue 1. */
27005 uint8_t queue_id1;
27006 /*
27007 * Minimum BW allocated to CoS Queue.
27008 * The HWRM will translate this value into byte counter and
27009 * time interval used for this COS inside the device.
27010 */
27011 uint32_t queue_id1_min_bw;
27012 /* The bandwidth value. */
27013 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
27014 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT 0
27015 /* The granularity of the value (bits or bytes). */
27016 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE UINT32_C(0x10000000)
27017 /* Value is in bits. */
27018 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
27019 /* Value is in bytes. */
27020 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
27021 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES
27022 /* bw_value_unit is 3 b */
27023 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
27024 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT 29
27025 /* Value is in Mb or MB (base 10). */
27026 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
27027 /* Value is in Kb or KB (base 10). */
27028 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
27029 /* Value is in bits or bytes. */
27030 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
27031 /* Value is in Gb or GB (base 10). */
27032 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
27033 /* Value is in 1/100th of a percentage of total bandwidth. */
27034 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
27035 /* Invalid unit */
27036 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
27037 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID
27038 /*
27039 * Maximum BW allocated to CoS queue.
27040 * The HWRM will translate this value into byte counter and
27041 * time interval used for this COS inside the device.
27042 */
27043 uint32_t queue_id1_max_bw;
27044 /* The bandwidth value. */
27045 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
27046 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT 0
27047 /* The granularity of the value (bits or bytes). */
27048 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE UINT32_C(0x10000000)
27049 /* Value is in bits. */
27050 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
27051 /* Value is in bytes. */
27052 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
27053 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES
27054 /* bw_value_unit is 3 b */
27055 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
27056 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT 29
27057 /* Value is in Mb or MB (base 10). */
27058 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
27059 /* Value is in Kb or KB (base 10). */
27060 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
27061 /* Value is in bits or bytes. */
27062 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
27063 /* Value is in Gb or GB (base 10). */
27064 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
27065 /* Value is in 1/100th of a percentage of total bandwidth. */
27066 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
27067 /* Invalid unit */
27068 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
27069 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID
27070 /* Transmission Selection Algorithm (TSA) for CoS Queue. */
27071 uint8_t queue_id1_tsa_assign;
27072 /* Strict Priority */
27073 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_SP UINT32_C(0x0)
27074 /* Enhanced Transmission Selection */
27075 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_ETS UINT32_C(0x1)
27076 /* reserved. */
27077 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
27078 /* reserved. */
27079 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
27080 /*
27081 * Priority level for strict priority. Valid only when the
27082 * tsa_assign is 0 - Strict Priority (SP)
27083 * 0..7 - Valid values.
27084 * 8..255 - Reserved.
27085 */
27086 uint8_t queue_id1_pri_lvl;
27087 /*
27088 * Weight used to allocate remaining BW for this COS after
27089 * servicing guaranteed bandwidths for all COS.
27090 */
27091 uint8_t queue_id1_bw_weight;
27092 /* ID of CoS Queue 2. */
27093 uint8_t queue_id2;
27094 /*
27095 * Minimum BW allocated to CoS Queue.
27096 * The HWRM will translate this value into byte counter and
27097 * time interval used for this COS inside the device.
27098 */
27099 uint32_t queue_id2_min_bw;
27100 /* The bandwidth value. */
27101 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
27102 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT 0
27103 /* The granularity of the value (bits or bytes). */
27104 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE UINT32_C(0x10000000)
27105 /* Value is in bits. */
27106 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
27107 /* Value is in bytes. */
27108 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
27109 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES
27110 /* bw_value_unit is 3 b */
27111 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
27112 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT 29
27113 /* Value is in Mb or MB (base 10). */
27114 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
27115 /* Value is in Kb or KB (base 10). */
27116 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
27117 /* Value is in bits or bytes. */
27118 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
27119 /* Value is in Gb or GB (base 10). */
27120 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
27121 /* Value is in 1/100th of a percentage of total bandwidth. */
27122 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
27123 /* Invalid unit */
27124 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
27125 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID
27126 /*
27127 * Maximum BW allocated to CoS queue.
27128 * The HWRM will translate this value into byte counter and
27129 * time interval used for this COS inside the device.
27130 */
27131 uint32_t queue_id2_max_bw;
27132 /* The bandwidth value. */
27133 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
27134 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT 0
27135 /* The granularity of the value (bits or bytes). */
27136 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE UINT32_C(0x10000000)
27137 /* Value is in bits. */
27138 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
27139 /* Value is in bytes. */
27140 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
27141 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES
27142 /* bw_value_unit is 3 b */
27143 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
27144 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT 29
27145 /* Value is in Mb or MB (base 10). */
27146 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
27147 /* Value is in Kb or KB (base 10). */
27148 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
27149 /* Value is in bits or bytes. */
27150 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
27151 /* Value is in Gb or GB (base 10). */
27152 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
27153 /* Value is in 1/100th of a percentage of total bandwidth. */
27154 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
27155 /* Invalid unit */
27156 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
27157 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID
27158 /* Transmission Selection Algorithm (TSA) for CoS Queue. */
27159 uint8_t queue_id2_tsa_assign;
27160 /* Strict Priority */
27161 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_SP UINT32_C(0x0)
27162 /* Enhanced Transmission Selection */
27163 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_ETS UINT32_C(0x1)
27164 /* reserved. */
27165 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
27166 /* reserved. */
27167 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
27168 /*
27169 * Priority level for strict priority. Valid only when the
27170 * tsa_assign is 0 - Strict Priority (SP)
27171 * 0..7 - Valid values.
27172 * 8..255 - Reserved.
27173 */
27174 uint8_t queue_id2_pri_lvl;
27175 /*
27176 * Weight used to allocate remaining BW for this COS after
27177 * servicing guaranteed bandwidths for all COS.
27178 */
27179 uint8_t queue_id2_bw_weight;
27180 /* ID of CoS Queue 3. */
27181 uint8_t queue_id3;
27182 /*
27183 * Minimum BW allocated to CoS Queue.
27184 * The HWRM will translate this value into byte counter and
27185 * time interval used for this COS inside the device.
27186 */
27187 uint32_t queue_id3_min_bw;
27188 /* The bandwidth value. */
27189 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
27190 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT 0
27191 /* The granularity of the value (bits or bytes). */
27192 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE UINT32_C(0x10000000)
27193 /* Value is in bits. */
27194 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
27195 /* Value is in bytes. */
27196 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
27197 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES
27198 /* bw_value_unit is 3 b */
27199 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
27200 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT 29
27201 /* Value is in Mb or MB (base 10). */
27202 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
27203 /* Value is in Kb or KB (base 10). */
27204 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
27205 /* Value is in bits or bytes. */
27206 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
27207 /* Value is in Gb or GB (base 10). */
27208 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
27209 /* Value is in 1/100th of a percentage of total bandwidth. */
27210 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
27211 /* Invalid unit */
27212 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
27213 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID
27214 /*
27215 * Maximum BW allocated to CoS queue.
27216 * The HWRM will translate this value into byte counter and
27217 * time interval used for this COS inside the device.
27218 */
27219 uint32_t queue_id3_max_bw;
27220 /* The bandwidth value. */
27221 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
27222 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT 0
27223 /* The granularity of the value (bits or bytes). */
27224 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE UINT32_C(0x10000000)
27225 /* Value is in bits. */
27226 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
27227 /* Value is in bytes. */
27228 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
27229 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES
27230 /* bw_value_unit is 3 b */
27231 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
27232 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT 29
27233 /* Value is in Mb or MB (base 10). */
27234 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
27235 /* Value is in Kb or KB (base 10). */
27236 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
27237 /* Value is in bits or bytes. */
27238 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
27239 /* Value is in Gb or GB (base 10). */
27240 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
27241 /* Value is in 1/100th of a percentage of total bandwidth. */
27242 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
27243 /* Invalid unit */
27244 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
27245 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID
27246 /* Transmission Selection Algorithm (TSA) for CoS Queue. */
27247 uint8_t queue_id3_tsa_assign;
27248 /* Strict Priority */
27249 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_SP UINT32_C(0x0)
27250 /* Enhanced Transmission Selection */
27251 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_ETS UINT32_C(0x1)
27252 /* reserved. */
27253 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
27254 /* reserved. */
27255 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
27256 /*
27257 * Priority level for strict priority. Valid only when the
27258 * tsa_assign is 0 - Strict Priority (SP)
27259 * 0..7 - Valid values.
27260 * 8..255 - Reserved.
27261 */
27262 uint8_t queue_id3_pri_lvl;
27263 /*
27264 * Weight used to allocate remaining BW for this COS after
27265 * servicing guaranteed bandwidths for all COS.
27266 */
27267 uint8_t queue_id3_bw_weight;
27268 /* ID of CoS Queue 4. */
27269 uint8_t queue_id4;
27270 /*
27271 * Minimum BW allocated to CoS Queue.
27272 * The HWRM will translate this value into byte counter and
27273 * time interval used for this COS inside the device.
27274 */
27275 uint32_t queue_id4_min_bw;
27276 /* The bandwidth value. */
27277 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
27278 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT 0
27279 /* The granularity of the value (bits or bytes). */
27280 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE UINT32_C(0x10000000)
27281 /* Value is in bits. */
27282 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
27283 /* Value is in bytes. */
27284 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
27285 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES
27286 /* bw_value_unit is 3 b */
27287 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
27288 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT 29
27289 /* Value is in Mb or MB (base 10). */
27290 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
27291 /* Value is in Kb or KB (base 10). */
27292 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
27293 /* Value is in bits or bytes. */
27294 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
27295 /* Value is in Gb or GB (base 10). */
27296 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
27297 /* Value is in 1/100th of a percentage of total bandwidth. */
27298 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
27299 /* Invalid unit */
27300 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
27301 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID
27302 /*
27303 * Maximum BW allocated to CoS queue.
27304 * The HWRM will translate this value into byte counter and
27305 * time interval used for this COS inside the device.
27306 */
27307 uint32_t queue_id4_max_bw;
27308 /* The bandwidth value. */
27309 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
27310 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT 0
27311 /* The granularity of the value (bits or bytes). */
27312 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE UINT32_C(0x10000000)
27313 /* Value is in bits. */
27314 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
27315 /* Value is in bytes. */
27316 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
27317 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES
27318 /* bw_value_unit is 3 b */
27319 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
27320 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT 29
27321 /* Value is in Mb or MB (base 10). */
27322 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
27323 /* Value is in Kb or KB (base 10). */
27324 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
27325 /* Value is in bits or bytes. */
27326 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
27327 /* Value is in Gb or GB (base 10). */
27328 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
27329 /* Value is in 1/100th of a percentage of total bandwidth. */
27330 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
27331 /* Invalid unit */
27332 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
27333 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID
27334 /* Transmission Selection Algorithm (TSA) for CoS Queue. */
27335 uint8_t queue_id4_tsa_assign;
27336 /* Strict Priority */
27337 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_SP UINT32_C(0x0)
27338 /* Enhanced Transmission Selection */
27339 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_ETS UINT32_C(0x1)
27340 /* reserved. */
27341 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
27342 /* reserved. */
27343 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
27344 /*
27345 * Priority level for strict priority. Valid only when the
27346 * tsa_assign is 0 - Strict Priority (SP)
27347 * 0..7 - Valid values.
27348 * 8..255 - Reserved.
27349 */
27350 uint8_t queue_id4_pri_lvl;
27351 /*
27352 * Weight used to allocate remaining BW for this COS after
27353 * servicing guaranteed bandwidths for all COS.
27354 */
27355 uint8_t queue_id4_bw_weight;
27356 /* ID of CoS Queue 5. */
27357 uint8_t queue_id5;
27358 /*
27359 * Minimum BW allocated to CoS Queue.
27360 * The HWRM will translate this value into byte counter and
27361 * time interval used for this COS inside the device.
27362 */
27363 uint32_t queue_id5_min_bw;
27364 /* The bandwidth value. */
27365 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
27366 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT 0
27367 /* The granularity of the value (bits or bytes). */
27368 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE UINT32_C(0x10000000)
27369 /* Value is in bits. */
27370 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
27371 /* Value is in bytes. */
27372 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
27373 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES
27374 /* bw_value_unit is 3 b */
27375 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
27376 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT 29
27377 /* Value is in Mb or MB (base 10). */
27378 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
27379 /* Value is in Kb or KB (base 10). */
27380 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
27381 /* Value is in bits or bytes. */
27382 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
27383 /* Value is in Gb or GB (base 10). */
27384 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
27385 /* Value is in 1/100th of a percentage of total bandwidth. */
27386 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
27387 /* Invalid unit */
27388 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
27389 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID
27390 /*
27391 * Maximum BW allocated to CoS queue.
27392 * The HWRM will translate this value into byte counter and
27393 * time interval used for this COS inside the device.
27394 */
27395 uint32_t queue_id5_max_bw;
27396 /* The bandwidth value. */
27397 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
27398 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT 0
27399 /* The granularity of the value (bits or bytes). */
27400 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE UINT32_C(0x10000000)
27401 /* Value is in bits. */
27402 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
27403 /* Value is in bytes. */
27404 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
27405 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES
27406 /* bw_value_unit is 3 b */
27407 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
27408 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT 29
27409 /* Value is in Mb or MB (base 10). */
27410 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
27411 /* Value is in Kb or KB (base 10). */
27412 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
27413 /* Value is in bits or bytes. */
27414 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
27415 /* Value is in Gb or GB (base 10). */
27416 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
27417 /* Value is in 1/100th of a percentage of total bandwidth. */
27418 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
27419 /* Invalid unit */
27420 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
27421 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID
27422 /* Transmission Selection Algorithm (TSA) for CoS Queue. */
27423 uint8_t queue_id5_tsa_assign;
27424 /* Strict Priority */
27425 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_SP UINT32_C(0x0)
27426 /* Enhanced Transmission Selection */
27427 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_ETS UINT32_C(0x1)
27428 /* reserved. */
27429 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
27430 /* reserved. */
27431 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
27432 /*
27433 * Priority level for strict priority. Valid only when the
27434 * tsa_assign is 0 - Strict Priority (SP)
27435 * 0..7 - Valid values.
27436 * 8..255 - Reserved.
27437 */
27438 uint8_t queue_id5_pri_lvl;
27439 /*
27440 * Weight used to allocate remaining BW for this COS after
27441 * servicing guaranteed bandwidths for all COS.
27442 */
27443 uint8_t queue_id5_bw_weight;
27444 /* ID of CoS Queue 6. */
27445 uint8_t queue_id6;
27446 /*
27447 * Minimum BW allocated to CoS Queue.
27448 * The HWRM will translate this value into byte counter and
27449 * time interval used for this COS inside the device.
27450 */
27451 uint32_t queue_id6_min_bw;
27452 /* The bandwidth value. */
27453 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
27454 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT 0
27455 /* The granularity of the value (bits or bytes). */
27456 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE UINT32_C(0x10000000)
27457 /* Value is in bits. */
27458 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
27459 /* Value is in bytes. */
27460 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
27461 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES
27462 /* bw_value_unit is 3 b */
27463 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
27464 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT 29
27465 /* Value is in Mb or MB (base 10). */
27466 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
27467 /* Value is in Kb or KB (base 10). */
27468 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
27469 /* Value is in bits or bytes. */
27470 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
27471 /* Value is in Gb or GB (base 10). */
27472 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
27473 /* Value is in 1/100th of a percentage of total bandwidth. */
27474 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
27475 /* Invalid unit */
27476 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
27477 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID
27478 /*
27479 * Maximum BW allocated to CoS queue.
27480 * The HWRM will translate this value into byte counter and
27481 * time interval used for this COS inside the device.
27482 */
27483 uint32_t queue_id6_max_bw;
27484 /* The bandwidth value. */
27485 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
27486 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT 0
27487 /* The granularity of the value (bits or bytes). */
27488 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE UINT32_C(0x10000000)
27489 /* Value is in bits. */
27490 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
27491 /* Value is in bytes. */
27492 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
27493 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES
27494 /* bw_value_unit is 3 b */
27495 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
27496 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT 29
27497 /* Value is in Mb or MB (base 10). */
27498 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
27499 /* Value is in Kb or KB (base 10). */
27500 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
27501 /* Value is in bits or bytes. */
27502 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
27503 /* Value is in Gb or GB (base 10). */
27504 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
27505 /* Value is in 1/100th of a percentage of total bandwidth. */
27506 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
27507 /* Invalid unit */
27508 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
27509 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID
27510 /* Transmission Selection Algorithm (TSA) for CoS Queue. */
27511 uint8_t queue_id6_tsa_assign;
27512 /* Strict Priority */
27513 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_SP UINT32_C(0x0)
27514 /* Enhanced Transmission Selection */
27515 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_ETS UINT32_C(0x1)
27516 /* reserved. */
27517 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
27518 /* reserved. */
27519 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
27520 /*
27521 * Priority level for strict priority. Valid only when the
27522 * tsa_assign is 0 - Strict Priority (SP)
27523 * 0..7 - Valid values.
27524 * 8..255 - Reserved.
27525 */
27526 uint8_t queue_id6_pri_lvl;
27527 /*
27528 * Weight used to allocate remaining BW for this COS after
27529 * servicing guaranteed bandwidths for all COS.
27530 */
27531 uint8_t queue_id6_bw_weight;
27532 /* ID of CoS Queue 7. */
27533 uint8_t queue_id7;
27534 /*
27535 * Minimum BW allocated to CoS Queue.
27536 * The HWRM will translate this value into byte counter and
27537 * time interval used for this COS inside the device.
27538 */
27539 uint32_t queue_id7_min_bw;
27540 /* The bandwidth value. */
27541 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
27542 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT 0
27543 /* The granularity of the value (bits or bytes). */
27544 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE UINT32_C(0x10000000)
27545 /* Value is in bits. */
27546 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
27547 /* Value is in bytes. */
27548 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
27549 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES
27550 /* bw_value_unit is 3 b */
27551 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
27552 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT 29
27553 /* Value is in Mb or MB (base 10). */
27554 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
27555 /* Value is in Kb or KB (base 10). */
27556 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
27557 /* Value is in bits or bytes. */
27558 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
27559 /* Value is in Gb or GB (base 10). */
27560 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
27561 /* Value is in 1/100th of a percentage of total bandwidth. */
27562 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
27563 /* Invalid unit */
27564 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
27565 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID
27566 /*
27567 * Maximum BW allocated to CoS queue.
27568 * The HWRM will translate this value into byte counter and
27569 * time interval used for this COS inside the device.
27570 */
27571 uint32_t queue_id7_max_bw;
27572 /* The bandwidth value. */
27573 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
27574 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT 0
27575 /* The granularity of the value (bits or bytes). */
27576 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE UINT32_C(0x10000000)
27577 /* Value is in bits. */
27578 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
27579 /* Value is in bytes. */
27580 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
27581 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES
27582 /* bw_value_unit is 3 b */
27583 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
27584 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT 29
27585 /* Value is in Mb or MB (base 10). */
27586 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
27587 /* Value is in Kb or KB (base 10). */
27588 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
27589 /* Value is in bits or bytes. */
27590 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
27591 /* Value is in Gb or GB (base 10). */
27592 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
27593 /* Value is in 1/100th of a percentage of total bandwidth. */
27594 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
27595 /* Invalid unit */
27596 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
27597 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_LAST HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID
27598 /* Transmission Selection Algorithm (TSA) for CoS Queue. */
27599 uint8_t queue_id7_tsa_assign;
27600 /* Strict Priority */
27601 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_SP UINT32_C(0x0)
27602 /* Enhanced Transmission Selection */
27603 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_ETS UINT32_C(0x1)
27604 /* reserved. */
27605 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
27606 /* reserved. */
27607 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
27608 /*
27609 * Priority level for strict priority. Valid only when the
27610 * tsa_assign is 0 - Strict Priority (SP)
27611 * 0..7 - Valid values.
27612 * 8..255 - Reserved.
27613 */
27614 uint8_t queue_id7_pri_lvl;
27615 /*
27616 * Weight used to allocate remaining BW for this COS after
27617 * servicing guaranteed bandwidths for all COS.
27618 */
27619 uint8_t queue_id7_bw_weight;
27620 uint8_t unused_1[5];
27621 } hwrm_queue_cos2bw_cfg_input_t, *phwrm_queue_cos2bw_cfg_input_t;
27622
27623 /* hwrm_queue_cos2bw_cfg_output (size:128b/16B) */
27624
27625 typedef struct hwrm_queue_cos2bw_cfg_output {
27626 /* The specific error status for the command. */
27627 uint16_t error_code;
27628 /* The HWRM command request type. */
27629 uint16_t req_type;
27630 /* The sequence ID from the original command. */
27631 uint16_t seq_id;
27632 /* The length of the response data in number of bytes. */
27633 uint16_t resp_len;
27634 uint8_t unused_0[7];
27635 /*
27636 * This field is used in Output records to indicate that the output
27637 * is completely written to RAM. This field should be read as '1'
27638 * to indicate that the output has been completely written.
27639 * When writing a command completion or response to an internal processor,
27640 * the order of writes has to be such that this field is written last.
27641 */
27642 uint8_t valid;
27643 } hwrm_queue_cos2bw_cfg_output_t, *phwrm_queue_cos2bw_cfg_output_t;
27644
27645 /*************************
27646 * hwrm_queue_dscp_qcaps *
27647 *************************/
27648
27649
27650 /* hwrm_queue_dscp_qcaps_input (size:192b/24B) */
27651
27652 typedef struct hwrm_queue_dscp_qcaps_input {
27653 /* The HWRM command request type. */
27654 uint16_t req_type;
27655 /*
27656 * The completion ring to send the completion event on. This should
27657 * be the NQ ID returned from the `nq_alloc` HWRM command.
27658 */
27659 uint16_t cmpl_ring;
27660 /*
27661 * The sequence ID is used by the driver for tracking multiple
27662 * commands. This ID is treated as opaque data by the firmware and
27663 * the value is returned in the `hwrm_resp_hdr` upon completion.
27664 */
27665 uint16_t seq_id;
27666 /*
27667 * The target ID of the command:
27668 * * 0x0-0xFFF8 - The function ID
27669 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27670 * * 0xFFFD - Reserved for user-space HWRM interface
27671 * * 0xFFFF - HWRM
27672 */
27673 uint16_t target_id;
27674 /*
27675 * A physical address pointer pointing to a host buffer that the
27676 * command's response data will be written. This can be either a host
27677 * physical address (HPA) or a guest physical address (GPA) and must
27678 * point to a physically contiguous block of memory.
27679 */
27680 uint64_t resp_addr;
27681 /*
27682 * Port ID of port for which the table is being configured.
27683 * The HWRM needs to check whether this function is allowed
27684 * to configure pri2cos mapping on this port.
27685 */
27686 uint8_t port_id;
27687 uint8_t unused_0[7];
27688 } hwrm_queue_dscp_qcaps_input_t, *phwrm_queue_dscp_qcaps_input_t;
27689
27690 /* hwrm_queue_dscp_qcaps_output (size:128b/16B) */
27691
27692 typedef struct hwrm_queue_dscp_qcaps_output {
27693 /* The specific error status for the command. */
27694 uint16_t error_code;
27695 /* The HWRM command request type. */
27696 uint16_t req_type;
27697 /* The sequence ID from the original command. */
27698 uint16_t seq_id;
27699 /* The length of the response data in number of bytes. */
27700 uint16_t resp_len;
27701 /* The number of bits provided by the hardware for the DSCP value. */
27702 uint8_t num_dscp_bits;
27703 uint8_t unused_0;
27704 /* Max number of DSCP-MASK-PRI entries supported. */
27705 uint16_t max_entries;
27706 uint8_t unused_1[3];
27707 /*
27708 * This field is used in Output records to indicate that the output
27709 * is completely written to RAM. This field should be read as '1'
27710 * to indicate that the output has been completely written.
27711 * When writing a command completion or response to an internal processor,
27712 * the order of writes has to be such that this field is written last.
27713 */
27714 uint8_t valid;
27715 } hwrm_queue_dscp_qcaps_output_t, *phwrm_queue_dscp_qcaps_output_t;
27716
27717 /****************************
27718 * hwrm_queue_dscp2pri_qcfg *
27719 ****************************/
27720
27721
27722 /* hwrm_queue_dscp2pri_qcfg_input (size:256b/32B) */
27723
27724 typedef struct hwrm_queue_dscp2pri_qcfg_input {
27725 /* The HWRM command request type. */
27726 uint16_t req_type;
27727 /*
27728 * The completion ring to send the completion event on. This should
27729 * be the NQ ID returned from the `nq_alloc` HWRM command.
27730 */
27731 uint16_t cmpl_ring;
27732 /*
27733 * The sequence ID is used by the driver for tracking multiple
27734 * commands. This ID is treated as opaque data by the firmware and
27735 * the value is returned in the `hwrm_resp_hdr` upon completion.
27736 */
27737 uint16_t seq_id;
27738 /*
27739 * The target ID of the command:
27740 * * 0x0-0xFFF8 - The function ID
27741 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27742 * * 0xFFFD - Reserved for user-space HWRM interface
27743 * * 0xFFFF - HWRM
27744 */
27745 uint16_t target_id;
27746 /*
27747 * A physical address pointer pointing to a host buffer that the
27748 * command's response data will be written. This can be either a host
27749 * physical address (HPA) or a guest physical address (GPA) and must
27750 * point to a physically contiguous block of memory.
27751 */
27752 uint64_t resp_addr;
27753 /*
27754 * This is the host address where the 24-bits DSCP-MASK-PRI
27755 * tuple(s) will be copied to.
27756 */
27757 uint64_t dest_data_addr;
27758 /*
27759 * Port ID of port for which the table is being configured.
27760 * The HWRM needs to check whether this function is allowed
27761 * to configure pri2cos mapping on this port.
27762 */
27763 uint8_t port_id;
27764 uint8_t unused_0;
27765 /* Size of the buffer pointed to by dest_data_addr. */
27766 uint16_t dest_data_buffer_size;
27767 uint8_t unused_1[4];
27768 } hwrm_queue_dscp2pri_qcfg_input_t, *phwrm_queue_dscp2pri_qcfg_input_t;
27769
27770 /* hwrm_queue_dscp2pri_qcfg_output (size:128b/16B) */
27771
27772 typedef struct hwrm_queue_dscp2pri_qcfg_output {
27773 /* The specific error status for the command. */
27774 uint16_t error_code;
27775 /* The HWRM command request type. */
27776 uint16_t req_type;
27777 /* The sequence ID from the original command. */
27778 uint16_t seq_id;
27779 /* The length of the response data in number of bytes. */
27780 uint16_t resp_len;
27781 /*
27782 * A count of the number of DSCP-MASK-PRI tuple(s) pointed to
27783 * by the dest_data_addr.
27784 */
27785 uint16_t entry_cnt;
27786 /*
27787 * This is the default PRI which un-initialized DSCP values are
27788 * mapped to.
27789 */
27790 uint8_t default_pri;
27791 uint8_t unused_0[4];
27792 /*
27793 * This field is used in Output records to indicate that the output
27794 * is completely written to RAM. This field should be read as '1'
27795 * to indicate that the output has been completely written.
27796 * When writing a command completion or response to an internal processor,
27797 * the order of writes has to be such that this field is written last.
27798 */
27799 uint8_t valid;
27800 } hwrm_queue_dscp2pri_qcfg_output_t, *phwrm_queue_dscp2pri_qcfg_output_t;
27801
27802 /***************************
27803 * hwrm_queue_dscp2pri_cfg *
27804 ***************************/
27805
27806
27807 /* hwrm_queue_dscp2pri_cfg_input (size:320b/40B) */
27808
27809 typedef struct hwrm_queue_dscp2pri_cfg_input {
27810 /* The HWRM command request type. */
27811 uint16_t req_type;
27812 /*
27813 * The completion ring to send the completion event on. This should
27814 * be the NQ ID returned from the `nq_alloc` HWRM command.
27815 */
27816 uint16_t cmpl_ring;
27817 /*
27818 * The sequence ID is used by the driver for tracking multiple
27819 * commands. This ID is treated as opaque data by the firmware and
27820 * the value is returned in the `hwrm_resp_hdr` upon completion.
27821 */
27822 uint16_t seq_id;
27823 /*
27824 * The target ID of the command:
27825 * * 0x0-0xFFF8 - The function ID
27826 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27827 * * 0xFFFD - Reserved for user-space HWRM interface
27828 * * 0xFFFF - HWRM
27829 */
27830 uint16_t target_id;
27831 /*
27832 * A physical address pointer pointing to a host buffer that the
27833 * command's response data will be written. This can be either a host
27834 * physical address (HPA) or a guest physical address (GPA) and must
27835 * point to a physically contiguous block of memory.
27836 */
27837 uint64_t resp_addr;
27838 /*
27839 * This is the host address where the 24-bits DSCP-MASK-PRI tuple
27840 * will be copied from.
27841 */
27842 uint64_t src_data_addr;
27843 uint32_t flags;
27844 /* use_hw_default_pri is 1 b */
27845 #define HWRM_QUEUE_DSCP2PRI_CFG_INPUT_FLAGS_USE_HW_DEFAULT_PRI UINT32_C(0x1)
27846 uint32_t enables;
27847 /*
27848 * This bit must be '1' for the default_pri field to be
27849 * configured.
27850 */
27851 #define HWRM_QUEUE_DSCP2PRI_CFG_INPUT_ENABLES_DEFAULT_PRI UINT32_C(0x1)
27852 /*
27853 * Port ID of port for which the table is being configured.
27854 * The HWRM needs to check whether this function is allowed
27855 * to configure pri2cos mapping on this port.
27856 */
27857 uint8_t port_id;
27858 /*
27859 * This is the default PRI which un-initialized DSCP values will be
27860 * mapped to.
27861 */
27862 uint8_t default_pri;
27863 /*
27864 * A count of the number of DSCP-MASK-PRI tuple(s) in the data pointed
27865 * to by src_data_addr.
27866 */
27867 uint16_t entry_cnt;
27868 uint8_t unused_0[4];
27869 } hwrm_queue_dscp2pri_cfg_input_t, *phwrm_queue_dscp2pri_cfg_input_t;
27870
27871 /* hwrm_queue_dscp2pri_cfg_output (size:128b/16B) */
27872
27873 typedef struct hwrm_queue_dscp2pri_cfg_output {
27874 /* The specific error status for the command. */
27875 uint16_t error_code;
27876 /* The HWRM command request type. */
27877 uint16_t req_type;
27878 /* The sequence ID from the original command. */
27879 uint16_t seq_id;
27880 /* The length of the response data in number of bytes. */
27881 uint16_t resp_len;
27882 uint8_t unused_0[7];
27883 /*
27884 * This field is used in Output records to indicate that the output
27885 * is completely written to RAM. This field should be read as '1'
27886 * to indicate that the output has been completely written.
27887 * When writing a command completion or response to an internal processor,
27888 * the order of writes has to be such that this field is written last.
27889 */
27890 uint8_t valid;
27891 } hwrm_queue_dscp2pri_cfg_output_t, *phwrm_queue_dscp2pri_cfg_output_t;
27892
27893 /*************************
27894 * hwrm_queue_mpls_qcaps *
27895 *************************/
27896
27897
27898 /* hwrm_queue_mpls_qcaps_input (size:192b/24B) */
27899
27900 typedef struct hwrm_queue_mpls_qcaps_input {
27901 /* The HWRM command request type. */
27902 uint16_t req_type;
27903 /*
27904 * The completion ring to send the completion event on. This should
27905 * be the NQ ID returned from the `nq_alloc` HWRM command.
27906 */
27907 uint16_t cmpl_ring;
27908 /*
27909 * The sequence ID is used by the driver for tracking multiple
27910 * commands. This ID is treated as opaque data by the firmware and
27911 * the value is returned in the `hwrm_resp_hdr` upon completion.
27912 */
27913 uint16_t seq_id;
27914 /*
27915 * The target ID of the command:
27916 * * 0x0-0xFFF8 - The function ID
27917 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27918 * * 0xFFFD - Reserved for user-space HWRM interface
27919 * * 0xFFFF - HWRM
27920 */
27921 uint16_t target_id;
27922 /*
27923 * A physical address pointer pointing to a host buffer that the
27924 * command's response data will be written. This can be either a host
27925 * physical address (HPA) or a guest physical address (GPA) and must
27926 * point to a physically contiguous block of memory.
27927 */
27928 uint64_t resp_addr;
27929 /*
27930 * Port ID of port for which the table is being configured.
27931 * The HWRM needs to check whether this function is allowed
27932 * to configure MPLS TC(EXP) to pri mapping on this port.
27933 */
27934 uint8_t port_id;
27935 uint8_t unused_0[7];
27936 } hwrm_queue_mpls_qcaps_input_t, *phwrm_queue_mpls_qcaps_input_t;
27937
27938 /* hwrm_queue_mpls_qcaps_output (size:128b/16B) */
27939
27940 typedef struct hwrm_queue_mpls_qcaps_output {
27941 /* The specific error status for the command. */
27942 uint16_t error_code;
27943 /* The HWRM command request type. */
27944 uint16_t req_type;
27945 /* The sequence ID from the original command. */
27946 uint16_t seq_id;
27947 /* The length of the response data in number of bytes. */
27948 uint16_t resp_len;
27949 /*
27950 * Bitmask indicating which queues can be configured by the
27951 * hwrm_queue_mplstc2pri_cfg command.
27952 *
27953 * Each bit represents a specific pri where bit 0 represents
27954 * pri 0 and bit 7 represents pri 7.
27955 * # A value of 0 indicates that the pri is not configurable
27956 * by the hwrm_queue_mplstc2pri_cfg command.
27957 * # A value of 1 indicates that the pri is configurable.
27958 * # A hwrm_queue_mplstc2pri_cfg command shall return error when
27959 * trying to configure a pri that is not configurable.
27960 */
27961 uint8_t queue_mplstc2pri_cfg_allowed;
27962 /*
27963 * This is the default PRI which un-initialized MPLS values will be
27964 * mapped to.
27965 */
27966 uint8_t hw_default_pri;
27967 uint8_t unused_0[5];
27968 /*
27969 * This field is used in Output records to indicate that the output
27970 * is completely written to RAM. This field should be read as '1'
27971 * to indicate that the output has been completely written.
27972 * When writing a command completion or response to an internal processor,
27973 * the order of writes has to be such that this field is written last.
27974 */
27975 uint8_t valid;
27976 } hwrm_queue_mpls_qcaps_output_t, *phwrm_queue_mpls_qcaps_output_t;
27977
27978 /******************************
27979 * hwrm_queue_mplstc2pri_qcfg *
27980 ******************************/
27981
27982
27983 /* hwrm_queue_mplstc2pri_qcfg_input (size:192b/24B) */
27984
27985 typedef struct hwrm_queue_mplstc2pri_qcfg_input {
27986 /* The HWRM command request type. */
27987 uint16_t req_type;
27988 /*
27989 * The completion ring to send the completion event on. This should
27990 * be the NQ ID returned from the `nq_alloc` HWRM command.
27991 */
27992 uint16_t cmpl_ring;
27993 /*
27994 * The sequence ID is used by the driver for tracking multiple
27995 * commands. This ID is treated as opaque data by the firmware and
27996 * the value is returned in the `hwrm_resp_hdr` upon completion.
27997 */
27998 uint16_t seq_id;
27999 /*
28000 * The target ID of the command:
28001 * * 0x0-0xFFF8 - The function ID
28002 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28003 * * 0xFFFD - Reserved for user-space HWRM interface
28004 * * 0xFFFF - HWRM
28005 */
28006 uint16_t target_id;
28007 /*
28008 * A physical address pointer pointing to a host buffer that the
28009 * command's response data will be written. This can be either a host
28010 * physical address (HPA) or a guest physical address (GPA) and must
28011 * point to a physically contiguous block of memory.
28012 */
28013 uint64_t resp_addr;
28014 /*
28015 * Port ID of port for which the table is being configured.
28016 * The HWRM needs to check whether this function is allowed
28017 * to configure MPLS TC(EXP) to pri mapping on this port.
28018 */
28019 uint8_t port_id;
28020 uint8_t unused_0[7];
28021 } hwrm_queue_mplstc2pri_qcfg_input_t, *phwrm_queue_mplstc2pri_qcfg_input_t;
28022
28023 /* hwrm_queue_mplstc2pri_qcfg_output (size:192b/24B) */
28024
28025 typedef struct hwrm_queue_mplstc2pri_qcfg_output {
28026 /* The specific error status for the command. */
28027 uint16_t error_code;
28028 /* The HWRM command request type. */
28029 uint16_t req_type;
28030 /* The sequence ID from the original command. */
28031 uint16_t seq_id;
28032 /* The length of the response data in number of bytes. */
28033 uint16_t resp_len;
28034 /*
28035 * pri assigned to MPLS TC(EXP) 0. This value can only be changed
28036 * before traffic has started.
28037 * A value of 0xff indicates that no pri is assigned to the
28038 * MPLS TC(EXP) 0.
28039 */
28040 uint8_t tc0_pri_queue_id;
28041 /*
28042 * pri assigned to MPLS TC(EXP) 1. This value can only be changed
28043 * before traffic has started.
28044 * A value of 0xff indicates that no pri is assigned to the
28045 * MPLS TC(EXP) 1.
28046 */
28047 uint8_t tc1_pri_queue_id;
28048 /*
28049 * pri assigned to MPLS TC(EXP) 2. This value can only be changed
28050 * before traffic has started.
28051 * A value of 0xff indicates that no pri is assigned to the
28052 * MPLS TC(EXP) 2.
28053 */
28054 uint8_t tc2_pri_queue_id;
28055 /*
28056 * pri assigned to MPLS TC(EXP) 3. This value can only be changed
28057 * before traffic has started.
28058 * A value of 0xff indicates that no pri is assigned to the
28059 * MPLS TC(EXP) 3.
28060 */
28061 uint8_t tc3_pri_queue_id;
28062 /*
28063 * pri assigned to MPLS TC(EXP) 4. This value can only be changed
28064 * before traffic has started.
28065 * A value of 0xff indicates that no pri is assigned to the
28066 * MPLS TC(EXP) 4.
28067 */
28068 uint8_t tc4_pri_queue_id;
28069 /*
28070 * pri assigned to MPLS TC(EXP) 5. This value can only be changed
28071 * before traffic has started.
28072 * A value of 0xff indicates that no pri is assigned to the
28073 * MPLS TC(EXP) 5.
28074 */
28075 uint8_t tc5_pri_queue_id;
28076 /*
28077 * pri assigned to MPLS TC(EXP) 6. This value can only
28078 * be changed before traffic has started.
28079 * A value of 0xff indicates that no pri is assigned to the
28080 * MPLS TC(EXP) 6.
28081 */
28082 uint8_t tc6_pri_queue_id;
28083 /*
28084 * pri assigned to MPLS TC(EXP) 7. This value can only
28085 * be changed before traffic has started.
28086 * A value of 0xff indicates that no pri is assigned to the
28087 * MPLS TC(EXP) 7.
28088 */
28089 uint8_t tc7_pri_queue_id;
28090 uint8_t unused_0[7];
28091 /*
28092 * This field is used in Output records to indicate that the output
28093 * is completely written to RAM. This field should be read as '1'
28094 * to indicate that the output has been completely written.
28095 * When writing a command completion or response to an internal processor,
28096 * the order of writes has to be such that this field is written last.
28097 */
28098 uint8_t valid;
28099 } hwrm_queue_mplstc2pri_qcfg_output_t, *phwrm_queue_mplstc2pri_qcfg_output_t;
28100
28101 /*****************************
28102 * hwrm_queue_mplstc2pri_cfg *
28103 *****************************/
28104
28105
28106 /* hwrm_queue_mplstc2pri_cfg_input (size:256b/32B) */
28107
28108 typedef struct hwrm_queue_mplstc2pri_cfg_input {
28109 /* The HWRM command request type. */
28110 uint16_t req_type;
28111 /*
28112 * The completion ring to send the completion event on. This should
28113 * be the NQ ID returned from the `nq_alloc` HWRM command.
28114 */
28115 uint16_t cmpl_ring;
28116 /*
28117 * The sequence ID is used by the driver for tracking multiple
28118 * commands. This ID is treated as opaque data by the firmware and
28119 * the value is returned in the `hwrm_resp_hdr` upon completion.
28120 */
28121 uint16_t seq_id;
28122 /*
28123 * The target ID of the command:
28124 * * 0x0-0xFFF8 - The function ID
28125 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28126 * * 0xFFFD - Reserved for user-space HWRM interface
28127 * * 0xFFFF - HWRM
28128 */
28129 uint16_t target_id;
28130 /*
28131 * A physical address pointer pointing to a host buffer that the
28132 * command's response data will be written. This can be either a host
28133 * physical address (HPA) or a guest physical address (GPA) and must
28134 * point to a physically contiguous block of memory.
28135 */
28136 uint64_t resp_addr;
28137 uint32_t enables;
28138 /*
28139 * This bit must be '1' for the mplstc0_pri_queue_id field to be
28140 * configured.
28141 */
28142 #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC0_PRI_QUEUE_ID UINT32_C(0x1)
28143 /*
28144 * This bit must be '1' for the mplstc1_pri_queue_id field to be
28145 * configured.
28146 */
28147 #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC1_PRI_QUEUE_ID UINT32_C(0x2)
28148 /*
28149 * This bit must be '1' for the mplstc2_pri_queue_id field to be
28150 * configured.
28151 */
28152 #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC2_PRI_QUEUE_ID UINT32_C(0x4)
28153 /*
28154 * This bit must be '1' for the mplstc3_pri_queue_id field to be
28155 * configured.
28156 */
28157 #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC3_PRI_QUEUE_ID UINT32_C(0x8)
28158 /*
28159 * This bit must be '1' for the mplstc4_pri_queue_id field to be
28160 * configured.
28161 */
28162 #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC4_PRI_QUEUE_ID UINT32_C(0x10)
28163 /*
28164 * This bit must be '1' for the mplstc5_pri_queue_id field to be
28165 * configured.
28166 */
28167 #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC5_PRI_QUEUE_ID UINT32_C(0x20)
28168 /*
28169 * This bit must be '1' for the mplstc6_pri_queue_id field to be
28170 * configured.
28171 */
28172 #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC6_PRI_QUEUE_ID UINT32_C(0x40)
28173 /*
28174 * This bit must be '1' for the mplstc7_pri_queue_id field to be
28175 * configured.
28176 */
28177 #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC7_PRI_QUEUE_ID UINT32_C(0x80)
28178 /*
28179 * Port ID of port for which the table is being configured.
28180 * The HWRM needs to check whether this function is allowed
28181 * to configure MPLS TC(EXP)to pri mapping on this port.
28182 */
28183 uint8_t port_id;
28184 uint8_t unused_0[3];
28185 /*
28186 * pri assigned to MPLS TC(EXP) 0. This value can only
28187 * be changed before traffic has started.
28188 */
28189 uint8_t tc0_pri_queue_id;
28190 /*
28191 * pri assigned to MPLS TC(EXP) 1. This value can only
28192 * be changed before traffic has started.
28193 */
28194 uint8_t tc1_pri_queue_id;
28195 /*
28196 * pri assigned to MPLS TC(EXP) 2 This value can only
28197 * be changed before traffic has started.
28198 */
28199 uint8_t tc2_pri_queue_id;
28200 /*
28201 * pri assigned to MPLS TC(EXP) 3. This value can only
28202 * be changed before traffic has started.
28203 */
28204 uint8_t tc3_pri_queue_id;
28205 /*
28206 * pri assigned to MPLS TC(EXP) 4. This value can only
28207 * be changed before traffic has started.
28208 */
28209 uint8_t tc4_pri_queue_id;
28210 /*
28211 * pri assigned to MPLS TC(EXP) 5. This value can only
28212 * be changed before traffic has started.
28213 */
28214 uint8_t tc5_pri_queue_id;
28215 /*
28216 * pri assigned to MPLS TC(EXP) 6. This value can only
28217 * be changed before traffic has started.
28218 */
28219 uint8_t tc6_pri_queue_id;
28220 /*
28221 * pri assigned to MPLS TC(EXP) 7. This value can only
28222 * be changed before traffic has started.
28223 */
28224 uint8_t tc7_pri_queue_id;
28225 } hwrm_queue_mplstc2pri_cfg_input_t, *phwrm_queue_mplstc2pri_cfg_input_t;
28226
28227 /* hwrm_queue_mplstc2pri_cfg_output (size:128b/16B) */
28228
28229 typedef struct hwrm_queue_mplstc2pri_cfg_output {
28230 /* The specific error status for the command. */
28231 uint16_t error_code;
28232 /* The HWRM command request type. */
28233 uint16_t req_type;
28234 /* The sequence ID from the original command. */
28235 uint16_t seq_id;
28236 /* The length of the response data in number of bytes. */
28237 uint16_t resp_len;
28238 uint8_t unused_0[7];
28239 /*
28240 * This field is used in Output records to indicate that the output
28241 * is completely written to RAM. This field should be read as '1'
28242 * to indicate that the output has been completely written.
28243 * When writing a command completion or response to an internal processor,
28244 * the order of writes has to be such that this field is written last.
28245 */
28246 uint8_t valid;
28247 } hwrm_queue_mplstc2pri_cfg_output_t, *phwrm_queue_mplstc2pri_cfg_output_t;
28248
28249 /****************************
28250 * hwrm_queue_vlanpri_qcaps *
28251 ****************************/
28252
28253
28254 /* hwrm_queue_vlanpri_qcaps_input (size:192b/24B) */
28255
28256 typedef struct hwrm_queue_vlanpri_qcaps_input {
28257 /* The HWRM command request type. */
28258 uint16_t req_type;
28259 /*
28260 * The completion ring to send the completion event on. This should
28261 * be the NQ ID returned from the `nq_alloc` HWRM command.
28262 */
28263 uint16_t cmpl_ring;
28264 /*
28265 * The sequence ID is used by the driver for tracking multiple
28266 * commands. This ID is treated as opaque data by the firmware and
28267 * the value is returned in the `hwrm_resp_hdr` upon completion.
28268 */
28269 uint16_t seq_id;
28270 /*
28271 * The target ID of the command:
28272 * * 0x0-0xFFF8 - The function ID
28273 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28274 * * 0xFFFD - Reserved for user-space HWRM interface
28275 * * 0xFFFF - HWRM
28276 */
28277 uint16_t target_id;
28278 /*
28279 * A physical address pointer pointing to a host buffer that the
28280 * command's response data will be written. This can be either a host
28281 * physical address (HPA) or a guest physical address (GPA) and must
28282 * point to a physically contiguous block of memory.
28283 */
28284 uint64_t resp_addr;
28285 /*
28286 * Port ID of port for which the table is being configured.
28287 * The HWRM needs to check whether this function is allowed
28288 * to configure VLAN priority to user priority mapping on this port.
28289 */
28290 uint8_t port_id;
28291 uint8_t unused_0[7];
28292 } hwrm_queue_vlanpri_qcaps_input_t, *phwrm_queue_vlanpri_qcaps_input_t;
28293
28294 /* hwrm_queue_vlanpri_qcaps_output (size:128b/16B) */
28295
28296 typedef struct hwrm_queue_vlanpri_qcaps_output {
28297 /* The specific error status for the command. */
28298 uint16_t error_code;
28299 /* The HWRM command request type. */
28300 uint16_t req_type;
28301 /* The sequence ID from the original command. */
28302 uint16_t seq_id;
28303 /* The length of the response data in number of bytes. */
28304 uint16_t resp_len;
28305 /*
28306 * This is the default user priority which all VLAN priority values
28307 * are mapped to if there is no VLAN priority to user priority mapping.
28308 */
28309 uint8_t hw_default_pri;
28310 uint8_t unused_0[6];
28311 /*
28312 * This field is used in Output records to indicate that the output
28313 * is completely written to RAM. This field should be read as '1'
28314 * to indicate that the output has been completely written.
28315 * When writing a command completion or response to an internal processor,
28316 * the order of writes has to be such that this field is written last.
28317 */
28318 uint8_t valid;
28319 } hwrm_queue_vlanpri_qcaps_output_t, *phwrm_queue_vlanpri_qcaps_output_t;
28320
28321 /*******************************
28322 * hwrm_queue_vlanpri2pri_qcfg *
28323 *******************************/
28324
28325
28326 /* hwrm_queue_vlanpri2pri_qcfg_input (size:192b/24B) */
28327
28328 typedef struct hwrm_queue_vlanpri2pri_qcfg_input {
28329 /* The HWRM command request type. */
28330 uint16_t req_type;
28331 /*
28332 * The completion ring to send the completion event on. This should
28333 * be the NQ ID returned from the `nq_alloc` HWRM command.
28334 */
28335 uint16_t cmpl_ring;
28336 /*
28337 * The sequence ID is used by the driver for tracking multiple
28338 * commands. This ID is treated as opaque data by the firmware and
28339 * the value is returned in the `hwrm_resp_hdr` upon completion.
28340 */
28341 uint16_t seq_id;
28342 /*
28343 * The target ID of the command:
28344 * * 0x0-0xFFF8 - The function ID
28345 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28346 * * 0xFFFD - Reserved for user-space HWRM interface
28347 * * 0xFFFF - HWRM
28348 */
28349 uint16_t target_id;
28350 /*
28351 * A physical address pointer pointing to a host buffer that the
28352 * command's response data will be written. This can be either a host
28353 * physical address (HPA) or a guest physical address (GPA) and must
28354 * point to a physically contiguous block of memory.
28355 */
28356 uint64_t resp_addr;
28357 /*
28358 * Port ID of port for which the table is being configured.
28359 * The HWRM needs to check whether this function is allowed
28360 * to configure VLAN priority to user priority mapping on this port.
28361 */
28362 uint8_t port_id;
28363 uint8_t unused_0[7];
28364 } hwrm_queue_vlanpri2pri_qcfg_input_t, *phwrm_queue_vlanpri2pri_qcfg_input_t;
28365
28366 /* hwrm_queue_vlanpri2pri_qcfg_output (size:192b/24B) */
28367
28368 typedef struct hwrm_queue_vlanpri2pri_qcfg_output {
28369 /* The specific error status for the command. */
28370 uint16_t error_code;
28371 /* The HWRM command request type. */
28372 uint16_t req_type;
28373 /* The sequence ID from the original command. */
28374 uint16_t seq_id;
28375 /* The length of the response data in number of bytes. */
28376 uint16_t resp_len;
28377 /*
28378 * User priority assigned to VLAN priority 0. A value of 0xff
28379 * indicates that no user priority is assigned. The default user
28380 * priority will be used.
28381 */
28382 uint8_t vlanpri0_user_pri_id;
28383 /*
28384 * User priority assigned to VLAN priority 1. A value of 0xff
28385 * indicates that no user priority is assigned. The default user
28386 * priority will be used.
28387 */
28388 uint8_t vlanpri1_user_pri_id;
28389 /*
28390 * User priority assigned to VLAN priority 2. A value of 0xff
28391 * indicates that no user priority is assigned. The default user
28392 * priority will be used.
28393 */
28394 uint8_t vlanpri2_user_pri_id;
28395 /*
28396 * User priority assigned to VLAN priority 3. A value of 0xff
28397 * indicates that no user priority is assigned. The default user
28398 * priority will be used.
28399 */
28400 uint8_t vlanpri3_user_pri_id;
28401 /*
28402 * User priority assigned to VLAN priority 4. A value of 0xff
28403 * indicates that no user priority is assigned. The default user
28404 * priority will be used.
28405 */
28406 uint8_t vlanpri4_user_pri_id;
28407 /*
28408 * User priority assigned to VLAN priority 5. A value of 0xff
28409 * indicates that no user priority is assigned. The default user
28410 * priority will be used.
28411 */
28412 uint8_t vlanpri5_user_pri_id;
28413 /*
28414 * User priority assigned to VLAN priority 6. A value of 0xff
28415 * indicates that no user priority is assigned. The default user
28416 * priority will be used.
28417 */
28418 uint8_t vlanpri6_user_pri_id;
28419 /*
28420 * User priority assigned to VLAN priority 7. A value of 0xff
28421 * indicates that no user priority is assigned. The default user
28422 * priority will be used.
28423 */
28424 uint8_t vlanpri7_user_pri_id;
28425 uint8_t unused_0[7];
28426 /*
28427 * This field is used in Output records to indicate that the output
28428 * is completely written to RAM. This field should be read as '1'
28429 * to indicate that the output has been completely written.
28430 * When writing a command completion or response to an internal processor,
28431 * the order of writes has to be such that this field is written last.
28432 */
28433 uint8_t valid;
28434 } hwrm_queue_vlanpri2pri_qcfg_output_t, *phwrm_queue_vlanpri2pri_qcfg_output_t;
28435
28436 /******************************
28437 * hwrm_queue_vlanpri2pri_cfg *
28438 ******************************/
28439
28440
28441 /* hwrm_queue_vlanpri2pri_cfg_input (size:256b/32B) */
28442
28443 typedef struct hwrm_queue_vlanpri2pri_cfg_input {
28444 /* The HWRM command request type. */
28445 uint16_t req_type;
28446 /*
28447 * The completion ring to send the completion event on. This should
28448 * be the NQ ID returned from the `nq_alloc` HWRM command.
28449 */
28450 uint16_t cmpl_ring;
28451 /*
28452 * The sequence ID is used by the driver for tracking multiple
28453 * commands. This ID is treated as opaque data by the firmware and
28454 * the value is returned in the `hwrm_resp_hdr` upon completion.
28455 */
28456 uint16_t seq_id;
28457 /*
28458 * The target ID of the command:
28459 * * 0x0-0xFFF8 - The function ID
28460 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28461 * * 0xFFFD - Reserved for user-space HWRM interface
28462 * * 0xFFFF - HWRM
28463 */
28464 uint16_t target_id;
28465 /*
28466 * A physical address pointer pointing to a host buffer that the
28467 * command's response data will be written. This can be either a host
28468 * physical address (HPA) or a guest physical address (GPA) and must
28469 * point to a physically contiguous block of memory.
28470 */
28471 uint64_t resp_addr;
28472 uint32_t enables;
28473 /*
28474 * This bit must be '1' for the vlanpri0_user_pri_id field to be
28475 * configured.
28476 */
28477 #define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI0_USER_PRI_ID UINT32_C(0x1)
28478 /*
28479 * This bit must be '1' for the vlanpri1_user_pri_id field to be
28480 * configured.
28481 */
28482 #define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI1_USER_PRI_ID UINT32_C(0x2)
28483 /*
28484 * This bit must be '1' for the vlanpri2_user_pri_id field to be
28485 * configured.
28486 */
28487 #define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI2_USER_PRI_ID UINT32_C(0x4)
28488 /*
28489 * This bit must be '1' for the vlanpri3_user_pri_id field to be
28490 * configured.
28491 */
28492 #define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI3_USER_PRI_ID UINT32_C(0x8)
28493 /*
28494 * This bit must be '1' for the vlanpri4_user_pri_id field to be
28495 * configured.
28496 */
28497 #define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI4_USER_PRI_ID UINT32_C(0x10)
28498 /*
28499 * This bit must be '1' for the vlanpri5_user_pri_id field to be
28500 * configured.
28501 */
28502 #define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI5_USER_PRI_ID UINT32_C(0x20)
28503 /*
28504 * This bit must be '1' for the vlanpri6_user_pri_id field to be
28505 * configured.
28506 */
28507 #define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI6_USER_PRI_ID UINT32_C(0x40)
28508 /*
28509 * This bit must be '1' for the vlanpri7_user_pri_id field to be
28510 * configured.
28511 */
28512 #define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI7_USER_PRI_ID UINT32_C(0x80)
28513 /*
28514 * Port ID of port for which the table is being configured.
28515 * The HWRM needs to check whether this function is allowed
28516 * to configure VLAN priority to user priority mapping on this port.
28517 */
28518 uint8_t port_id;
28519 uint8_t unused_0[3];
28520 /*
28521 * User priority assigned to VLAN priority 0. This value can only
28522 * be changed before traffic has started.
28523 */
28524 uint8_t vlanpri0_user_pri_id;
28525 /*
28526 * User priority assigned to VLAN priority 1. This value can only
28527 * be changed before traffic has started.
28528 */
28529 uint8_t vlanpri1_user_pri_id;
28530 /*
28531 * User priority assigned to VLAN priority 2. This value can only
28532 * be changed before traffic has started.
28533 */
28534 uint8_t vlanpri2_user_pri_id;
28535 /*
28536 * User priority assigned to VLAN priority 3. This value can only
28537 * be changed before traffic has started.
28538 */
28539 uint8_t vlanpri3_user_pri_id;
28540 /*
28541 * User priority assigned to VLAN priority 4. This value can only
28542 * be changed before traffic has started.
28543 */
28544 uint8_t vlanpri4_user_pri_id;
28545 /*
28546 * User priority assigned to VLAN priority 5. This value can only
28547 * be changed before traffic has started.
28548 */
28549 uint8_t vlanpri5_user_pri_id;
28550 /*
28551 * User priority assigned to VLAN priority 6. This value can only
28552 * be changed before traffic has started.
28553 */
28554 uint8_t vlanpri6_user_pri_id;
28555 /*
28556 * User priority assigned to VLAN priority 7. This value can only
28557 * be changed before traffic has started.
28558 */
28559 uint8_t vlanpri7_user_pri_id;
28560 } hwrm_queue_vlanpri2pri_cfg_input_t, *phwrm_queue_vlanpri2pri_cfg_input_t;
28561
28562 /* hwrm_queue_vlanpri2pri_cfg_output (size:128b/16B) */
28563
28564 typedef struct hwrm_queue_vlanpri2pri_cfg_output {
28565 /* The specific error status for the command. */
28566 uint16_t error_code;
28567 /* The HWRM command request type. */
28568 uint16_t req_type;
28569 /* The sequence ID from the original command. */
28570 uint16_t seq_id;
28571 /* The length of the response data in number of bytes. */
28572 uint16_t resp_len;
28573 uint8_t unused_0[7];
28574 /*
28575 * This field is used in Output records to indicate that the output
28576 * is completely written to RAM. This field should be read as '1'
28577 * to indicate that the output has been completely written.
28578 * When writing a command completion or response to an internal processor,
28579 * the order of writes has to be such that this field is written last.
28580 */
28581 uint8_t valid;
28582 } hwrm_queue_vlanpri2pri_cfg_output_t, *phwrm_queue_vlanpri2pri_cfg_output_t;
28583
28584 /*************************
28585 * hwrm_queue_global_cfg *
28586 *************************/
28587
28588
28589 /* hwrm_queue_global_cfg_input (size:192b/24B) */
28590
28591 typedef struct hwrm_queue_global_cfg_input {
28592 /* The HWRM command request type. */
28593 uint16_t req_type;
28594 /*
28595 * The completion ring to send the completion event on. This should
28596 * be the NQ ID returned from the `nq_alloc` HWRM command.
28597 */
28598 uint16_t cmpl_ring;
28599 /*
28600 * The sequence ID is used by the driver for tracking multiple
28601 * commands. This ID is treated as opaque data by the firmware and
28602 * the value is returned in the `hwrm_resp_hdr` upon completion.
28603 */
28604 uint16_t seq_id;
28605 /*
28606 * The target ID of the command:
28607 * * 0x0-0xFFF8 - The function ID
28608 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28609 * * 0xFFFD - Reserved for user-space HWRM interface
28610 * * 0xFFFF - HWRM
28611 */
28612 uint16_t target_id;
28613 /*
28614 * A physical address pointer pointing to a host buffer that the
28615 * command's response data will be written. This can be either a host
28616 * physical address (HPA) or a guest physical address (GPA) and must
28617 * point to a physically contiguous block of memory.
28618 */
28619 uint64_t resp_addr;
28620 /*
28621 * Configuration mode for rx cos queues, configuring whether they
28622 * use one shared buffer pool (across ports or PCIe endpoints) or
28623 * independent per port or per endpoint buffer pools.
28624 */
28625 uint8_t mode;
28626 /* One shared buffer pool to be used by all RX CoS queues */
28627 #define HWRM_QUEUE_GLOBAL_CFG_INPUT_MODE_SHARED UINT32_C(0x0)
28628 /*
28629 * Each port or PCIe endpoint to use an independent buffer pool
28630 * for its RX CoS queues
28631 */
28632 #define HWRM_QUEUE_GLOBAL_CFG_INPUT_MODE_INDEPENDENT UINT32_C(0x1)
28633 #define HWRM_QUEUE_GLOBAL_CFG_INPUT_MODE_LAST HWRM_QUEUE_GLOBAL_CFG_INPUT_MODE_INDEPENDENT
28634 uint8_t unused_0[7];
28635 } hwrm_queue_global_cfg_input_t, *phwrm_queue_global_cfg_input_t;
28636
28637 /* hwrm_queue_global_cfg_output (size:128b/16B) */
28638
28639 typedef struct hwrm_queue_global_cfg_output {
28640 /* The specific error status for the command. */
28641 uint16_t error_code;
28642 /* The HWRM command request type. */
28643 uint16_t req_type;
28644 /* The sequence ID from the original command. */
28645 uint16_t seq_id;
28646 /* The length of the response data in number of bytes. */
28647 uint16_t resp_len;
28648 uint8_t unused_0[7];
28649 /*
28650 * This field is used in Output records to indicate that the output
28651 * is completely written to RAM. This field should be read as '1'
28652 * to indicate that the output has been completely written.
28653 * When writing a command completion or response to an internal processor,
28654 * the order of writes has to be such that this field is written last.
28655 */
28656 uint8_t valid;
28657 } hwrm_queue_global_cfg_output_t, *phwrm_queue_global_cfg_output_t;
28658
28659 /**************************
28660 * hwrm_queue_global_qcfg *
28661 **************************/
28662
28663
28664 /* hwrm_queue_global_qcfg_input (size:128b/16B) */
28665
28666 typedef struct hwrm_queue_global_qcfg_input {
28667 /* The HWRM command request type. */
28668 uint16_t req_type;
28669 /*
28670 * The completion ring to send the completion event on. This should
28671 * be the NQ ID returned from the `nq_alloc` HWRM command.
28672 */
28673 uint16_t cmpl_ring;
28674 /*
28675 * The sequence ID is used by the driver for tracking multiple
28676 * commands. This ID is treated as opaque data by the firmware and
28677 * the value is returned in the `hwrm_resp_hdr` upon completion.
28678 */
28679 uint16_t seq_id;
28680 /*
28681 * The target ID of the command:
28682 * * 0x0-0xFFF8 - The function ID
28683 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28684 * * 0xFFFD - Reserved for user-space HWRM interface
28685 * * 0xFFFF - HWRM
28686 */
28687 uint16_t target_id;
28688 /*
28689 * A physical address pointer pointing to a host buffer that the
28690 * command's response data will be written. This can be either a host
28691 * physical address (HPA) or a guest physical address (GPA) and must
28692 * point to a physically contiguous block of memory.
28693 */
28694 uint64_t resp_addr;
28695 } hwrm_queue_global_qcfg_input_t, *phwrm_queue_global_qcfg_input_t;
28696
28697 /* hwrm_queue_global_qcfg_output (size:256b/32B) */
28698
28699 typedef struct hwrm_queue_global_qcfg_output {
28700 /* The specific error status for the command. */
28701 uint16_t error_code;
28702 /* The HWRM command request type. */
28703 uint16_t req_type;
28704 /* The sequence ID from the original command. */
28705 uint16_t seq_id;
28706 /* The length of the response data in number of bytes. */
28707 uint16_t resp_len;
28708 /* Port or PCIe endpoint id to be mapped for buffer pool 0. */
28709 uint8_t buffer_pool_id0_map;
28710 /* Port or PCIe endpoint id to be mapped for buffer pool 1. */
28711 uint8_t buffer_pool_id1_map;
28712 /* Port or PCIe endpoint id to be mapped for buffer pool 2. */
28713 uint8_t buffer_pool_id2_map;
28714 /* Port or PCIe endpoint id to be mapped for buffer pool 3. */
28715 uint8_t buffer_pool_id3_map;
28716 /* Size of buffer pool 0 (KBytes). */
28717 uint32_t buffer_pool_id0_size;
28718 /* Size of buffer pool 1 (KBytes). */
28719 uint32_t buffer_pool_id1_size;
28720 /* Size of buffer pool 2 (KBytes). */
28721 uint32_t buffer_pool_id2_size;
28722 /* Size of buffer pool 3 (KBytes). */
28723 uint32_t buffer_pool_id3_size;
28724 uint16_t flags;
28725 /*
28726 * Enumeration denoting whether the rx buffer pool mapping is
28727 * per port or per PCIe endpoint
28728 */
28729 #define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_FLAGS_MAPPING UINT32_C(0x1)
28730 /*
28731 * The buffer_pool_id[0-3]_map field represents mapping of rx
28732 * buffer pools to a port.
28733 */
28734 #define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_FLAGS_MAPPING_MAPPING_PER_PORT UINT32_C(0x0)
28735 /*
28736 * The buffer_pool_id[0-3]_map field represents mapping of rx
28737 * buffer pools to a PCIe endpoint.
28738 */
28739 #define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_FLAGS_MAPPING_MAPPING_PER_ENDPOINT UINT32_C(0x1)
28740 #define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_FLAGS_MAPPING_LAST HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_FLAGS_MAPPING_MAPPING_PER_ENDPOINT
28741 /*
28742 * Configuration mode for rx cos queues, configuring whether they
28743 * use one shared buffer pool (across ports or PCIe endpoints) or
28744 * independent per port or per endpoint buffer pools.
28745 */
28746 uint8_t mode;
28747 /* One shared buffer pool to be used by all RX CoS queues */
28748 #define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_MODE_SHARED UINT32_C(0x0)
28749 /*
28750 * Each port or PCIe endpoint to use an independent buffer pool
28751 * for its RX CoS queues
28752 */
28753 #define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_MODE_INDEPENDENT UINT32_C(0x1)
28754 #define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_MODE_LAST HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_MODE_INDEPENDENT
28755 /*
28756 * This field is used in Output records to indicate that the output
28757 * is completely written to RAM. This field should be read as '1'
28758 * to indicate that the output has been completely written.
28759 * When writing a command completion or response to an internal processor,
28760 * the order of writes has to be such that this field is written last.
28761 */
28762 uint8_t valid;
28763 } hwrm_queue_global_qcfg_output_t, *phwrm_queue_global_qcfg_output_t;
28764
28765 /*******************
28766 * hwrm_vnic_alloc *
28767 *******************/
28768
28769
28770 /* hwrm_vnic_alloc_input (size:192b/24B) */
28771
28772 typedef struct hwrm_vnic_alloc_input {
28773 /* The HWRM command request type. */
28774 uint16_t req_type;
28775 /*
28776 * The completion ring to send the completion event on. This should
28777 * be the NQ ID returned from the `nq_alloc` HWRM command.
28778 */
28779 uint16_t cmpl_ring;
28780 /*
28781 * The sequence ID is used by the driver for tracking multiple
28782 * commands. This ID is treated as opaque data by the firmware and
28783 * the value is returned in the `hwrm_resp_hdr` upon completion.
28784 */
28785 uint16_t seq_id;
28786 /*
28787 * The target ID of the command:
28788 * * 0x0-0xFFF8 - The function ID
28789 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28790 * * 0xFFFD - Reserved for user-space HWRM interface
28791 * * 0xFFFF - HWRM
28792 */
28793 uint16_t target_id;
28794 /*
28795 * A physical address pointer pointing to a host buffer that the
28796 * command's response data will be written. This can be either a host
28797 * physical address (HPA) or a guest physical address (GPA) and must
28798 * point to a physically contiguous block of memory.
28799 */
28800 uint64_t resp_addr;
28801 uint32_t flags;
28802 /*
28803 * When this bit is '1', this VNIC is requested to
28804 * be the default VNIC for this function.
28805 */
28806 #define HWRM_VNIC_ALLOC_INPUT_FLAGS_DEFAULT UINT32_C(0x1)
28807 /*
28808 * When this bit is '1', proxy VEE PF is requesting
28809 * allocation of a default VNIC on behalf of virtio-net
28810 * function given in virtio_net_fid field.
28811 */
28812 #define HWRM_VNIC_ALLOC_INPUT_FLAGS_VIRTIO_NET_FID_VALID UINT32_C(0x2)
28813 /*
28814 * Virtio-net function's FID.
28815 * This virtio-net function is requesting allocation of default
28816 * VNIC through proxy VEE PF.
28817 */
28818 uint16_t virtio_net_fid;
28819 uint8_t unused_0[2];
28820 } hwrm_vnic_alloc_input_t, *phwrm_vnic_alloc_input_t;
28821
28822 /* hwrm_vnic_alloc_output (size:128b/16B) */
28823
28824 typedef struct hwrm_vnic_alloc_output {
28825 /* The specific error status for the command. */
28826 uint16_t error_code;
28827 /* The HWRM command request type. */
28828 uint16_t req_type;
28829 /* The sequence ID from the original command. */
28830 uint16_t seq_id;
28831 /* The length of the response data in number of bytes. */
28832 uint16_t resp_len;
28833 /* Logical vnic ID */
28834 uint32_t vnic_id;
28835 uint8_t unused_0[3];
28836 /*
28837 * This field is used in Output records to indicate that the output
28838 * is completely written to RAM. This field should be read as '1'
28839 * to indicate that the output has been completely written.
28840 * When writing a command completion or response to an internal processor,
28841 * the order of writes has to be such that this field is written last.
28842 */
28843 uint8_t valid;
28844 } hwrm_vnic_alloc_output_t, *phwrm_vnic_alloc_output_t;
28845
28846 /********************
28847 * hwrm_vnic_update *
28848 ********************/
28849
28850
28851 /* hwrm_vnic_update_input (size:256b/32B) */
28852
28853 typedef struct hwrm_vnic_update_input {
28854 /* The HWRM command request type. */
28855 uint16_t req_type;
28856 /*
28857 * The completion ring to send the completion event on. This should
28858 * be the NQ ID returned from the `nq_alloc` HWRM command.
28859 */
28860 uint16_t cmpl_ring;
28861 /*
28862 * The sequence ID is used by the driver for tracking multiple
28863 * commands. This ID is treated as opaque data by the firmware and
28864 * the value is returned in the `hwrm_resp_hdr` upon completion.
28865 */
28866 uint16_t seq_id;
28867 /*
28868 * The target ID of the command:
28869 * * 0x0-0xFFF8 - The function ID
28870 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28871 * * 0xFFFD - Reserved for user-space HWRM interface
28872 * * 0xFFFF - HWRM
28873 */
28874 uint16_t target_id;
28875 /*
28876 * A physical address pointer pointing to a host buffer that the
28877 * command's response data will be written. This can be either a host
28878 * physical address (HPA) or a guest physical address (GPA) and must
28879 * point to a physically contiguous block of memory.
28880 */
28881 uint64_t resp_addr;
28882 /* Logical vnic ID */
28883 uint32_t vnic_id;
28884 uint32_t enables;
28885 /*
28886 * This bit must be '1' for the vnic_state field to be
28887 * configured.
28888 */
28889 #define HWRM_VNIC_UPDATE_INPUT_ENABLES_VNIC_STATE_VALID UINT32_C(0x1)
28890 /*
28891 * This bit must be '1' for the mru field to be
28892 * configured.
28893 */
28894 #define HWRM_VNIC_UPDATE_INPUT_ENABLES_MRU_VALID UINT32_C(0x2)
28895 /*
28896 * This bit must be '1' for the metadata_format_type field to be
28897 * configured.
28898 */
28899 #define HWRM_VNIC_UPDATE_INPUT_ENABLES_METADATA_FORMAT_TYPE_VALID UINT32_C(0x4)
28900 /*
28901 * This will update the context variable with the same name if
28902 * the corresponding enable is set.
28903 */
28904 uint8_t vnic_state;
28905 /* Normal operation state for the VNIC. */
28906 #define HWRM_VNIC_UPDATE_INPUT_VNIC_STATE_NORMAL UINT32_C(0x0)
28907 /* All packets are dropped in this state. */
28908 #define HWRM_VNIC_UPDATE_INPUT_VNIC_STATE_DROP UINT32_C(0x1)
28909 #define HWRM_VNIC_UPDATE_INPUT_VNIC_STATE_LAST HWRM_VNIC_UPDATE_INPUT_VNIC_STATE_DROP
28910 /*
28911 * The metadata format type used in all the RX packet completions
28912 * going through this VNIC.
28913 */
28914 uint8_t metadata_format_type;
28915 /* No metadata information. */
28916 #define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_NONE UINT32_C(0x0)
28917 /*
28918 * Action record pointer (table_scope[4:0], act_rec_ptr[25:0],
28919 * vtag[19:0]).
28920 */
28921 #define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_ACT_RECORD_PTR UINT32_C(0x1)
28922 /* Tunnel ID (tunnel_id[31:0], vtag[19:0]) */
28923 #define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_TUNNEL_ID UINT32_C(0x2)
28924 /* Custom header data (updated_chdr_data[31:0], vtag[19:0]) */
28925 #define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_CUSTOM_HDR_DATA UINT32_C(0x3)
28926 /* Header offsets (hdr_offsets[31:0], vtag[19:0]) */
28927 #define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_HDR_OFFSETS UINT32_C(0x4)
28928 #define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_LAST HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_HDR_OFFSETS
28929 /*
28930 * The maximum receive unit of the vnic.
28931 * Each vnic is associated with a function.
28932 * The vnic mru value overwrites the mru setting of the
28933 * associated function.
28934 * The HWRM shall make sure that vnic mru does not exceed
28935 * the mru of the port the function is associated with.
28936 */
28937 uint16_t mru;
28938 uint8_t unused_1[4];
28939 } hwrm_vnic_update_input_t, *phwrm_vnic_update_input_t;
28940
28941 /* hwrm_vnic_update_output (size:128b/16B) */
28942
28943 typedef struct hwrm_vnic_update_output {
28944 /* The specific error status for the command. */
28945 uint16_t error_code;
28946 /* The HWRM command request type. */
28947 uint16_t req_type;
28948 /* The sequence ID from the original command. */
28949 uint16_t seq_id;
28950 /* The length of the response data in number of bytes. */
28951 uint16_t resp_len;
28952 uint8_t unused_0[7];
28953 /*
28954 * This field is used in Output records to indicate that the output
28955 * is completely written to RAM. This field should be read as '1'
28956 * to indicate that the output has been completely written.
28957 * When writing a command completion or response to an internal
28958 * processor, the order of writes has to be such that this field is
28959 * written last.
28960 */
28961 uint8_t valid;
28962 } hwrm_vnic_update_output_t, *phwrm_vnic_update_output_t;
28963
28964 /******************
28965 * hwrm_vnic_free *
28966 ******************/
28967
28968
28969 /* hwrm_vnic_free_input (size:192b/24B) */
28970
28971 typedef struct hwrm_vnic_free_input {
28972 /* The HWRM command request type. */
28973 uint16_t req_type;
28974 /*
28975 * The completion ring to send the completion event on. This should
28976 * be the NQ ID returned from the `nq_alloc` HWRM command.
28977 */
28978 uint16_t cmpl_ring;
28979 /*
28980 * The sequence ID is used by the driver for tracking multiple
28981 * commands. This ID is treated as opaque data by the firmware and
28982 * the value is returned in the `hwrm_resp_hdr` upon completion.
28983 */
28984 uint16_t seq_id;
28985 /*
28986 * The target ID of the command:
28987 * * 0x0-0xFFF8 - The function ID
28988 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28989 * * 0xFFFD - Reserved for user-space HWRM interface
28990 * * 0xFFFF - HWRM
28991 */
28992 uint16_t target_id;
28993 /*
28994 * A physical address pointer pointing to a host buffer that the
28995 * command's response data will be written. This can be either a host
28996 * physical address (HPA) or a guest physical address (GPA) and must
28997 * point to a physically contiguous block of memory.
28998 */
28999 uint64_t resp_addr;
29000 /* Logical vnic ID */
29001 uint32_t vnic_id;
29002 uint8_t unused_0[4];
29003 } hwrm_vnic_free_input_t, *phwrm_vnic_free_input_t;
29004
29005 /* hwrm_vnic_free_output (size:128b/16B) */
29006
29007 typedef struct hwrm_vnic_free_output {
29008 /* The specific error status for the command. */
29009 uint16_t error_code;
29010 /* The HWRM command request type. */
29011 uint16_t req_type;
29012 /* The sequence ID from the original command. */
29013 uint16_t seq_id;
29014 /* The length of the response data in number of bytes. */
29015 uint16_t resp_len;
29016 uint8_t unused_0[7];
29017 /*
29018 * This field is used in Output records to indicate that the output
29019 * is completely written to RAM. This field should be read as '1'
29020 * to indicate that the output has been completely written.
29021 * When writing a command completion or response to an internal processor,
29022 * the order of writes has to be such that this field is written last.
29023 */
29024 uint8_t valid;
29025 } hwrm_vnic_free_output_t, *phwrm_vnic_free_output_t;
29026
29027 /*****************
29028 * hwrm_vnic_cfg *
29029 *****************/
29030
29031
29032 /* hwrm_vnic_cfg_input (size:384b/48B) */
29033
29034 typedef struct hwrm_vnic_cfg_input {
29035 /* The HWRM command request type. */
29036 uint16_t req_type;
29037 /*
29038 * The completion ring to send the completion event on. This should
29039 * be the NQ ID returned from the `nq_alloc` HWRM command.
29040 */
29041 uint16_t cmpl_ring;
29042 /*
29043 * The sequence ID is used by the driver for tracking multiple
29044 * commands. This ID is treated as opaque data by the firmware and
29045 * the value is returned in the `hwrm_resp_hdr` upon completion.
29046 */
29047 uint16_t seq_id;
29048 /*
29049 * The target ID of the command:
29050 * * 0x0-0xFFF8 - The function ID
29051 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29052 * * 0xFFFD - Reserved for user-space HWRM interface
29053 * * 0xFFFF - HWRM
29054 */
29055 uint16_t target_id;
29056 /*
29057 * A physical address pointer pointing to a host buffer that the
29058 * command's response data will be written. This can be either a host
29059 * physical address (HPA) or a guest physical address (GPA) and must
29060 * point to a physically contiguous block of memory.
29061 */
29062 uint64_t resp_addr;
29063 uint32_t flags;
29064 /*
29065 * When this bit is '1', the VNIC is requested to
29066 * be the default VNIC for the function.
29067 */
29068 #define HWRM_VNIC_CFG_INPUT_FLAGS_DEFAULT UINT32_C(0x1)
29069 /*
29070 * When this bit is '1', the VNIC is being configured to
29071 * strip VLAN in the RX path.
29072 * If set to '', then VLAN stripping is disabled on
29073 * this VNIC.
29074 */
29075 #define HWRM_VNIC_CFG_INPUT_FLAGS_VLAN_STRIP_MODE UINT32_C(0x2)
29076 /*
29077 * When this bit is '1', the VNIC is being configured to
29078 * buffer receive packets in the hardware until the host
29079 * posts new receive buffers.
29080 * If set to '', then bd_stall is being configured to be
29081 * disabled on this VNIC.
29082 */
29083 #define HWRM_VNIC_CFG_INPUT_FLAGS_BD_STALL_MODE UINT32_C(0x4)
29084 /*
29085 * When this bit is '1', the VNIC is being configured to
29086 * receive both RoCE and non-RoCE traffic.
29087 * If set to '', then this VNIC is not configured to be
29088 * operating in dual VNIC mode.
29089 */
29090 #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_DUAL_VNIC_MODE UINT32_C(0x8)
29091 /*
29092 * When this flag is set to '1', the VNIC is requested to
29093 * be configured to receive only RoCE traffic.
29094 * If this flag is set to '', then this flag shall be
29095 * ignored by the HWRM.
29096 * If roce_dual_vnic_mode flag is set to '1'
29097 * or roce_mirroring_capable_vnic_mode flag to 1,
29098 * then the HWRM client shall not set this flag to '1'.
29099 */
29100 #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_ONLY_VNIC_MODE UINT32_C(0x10)
29101 /*
29102 * When a VNIC uses one destination ring group for certain
29103 * application (e.g. Receive Flow Steering) where
29104 * exact match is used to direct packets to a VNIC with one
29105 * destination ring group only, there is no need to configure
29106 * RSS indirection table for that VNIC as only one destination
29107 * ring group is used.
29108 *
29109 * This flag is used to enable a mode where
29110 * RSS is enabled in the VNIC using a RSS context
29111 * for computing RSS hash but the RSS indirection table is
29112 * not configured using hwrm_vnic_rss_cfg.
29113 *
29114 * If this mode is enabled, then the driver should not program
29115 * RSS indirection table for the RSS context that is used for
29116 * computing RSS hash only.
29117 */
29118 #define HWRM_VNIC_CFG_INPUT_FLAGS_RSS_DFLT_CR_MODE UINT32_C(0x20)
29119 /*
29120 * When this bit is '1', the VNIC is being configured to
29121 * receive both RoCE and non-RoCE traffic, but forward only the
29122 * RoCE traffic further. Also, RoCE traffic can be mirrored to
29123 * L2 driver.
29124 */
29125 #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE UINT32_C(0x40)
29126 uint32_t enables;
29127 /*
29128 * This bit must be '1' for the dflt_ring_grp field to be
29129 * configured.
29130 */
29131 #define HWRM_VNIC_CFG_INPUT_ENABLES_DFLT_RING_GRP UINT32_C(0x1)
29132 /*
29133 * This bit must be '1' for the rss_rule field to be
29134 * configured.
29135 */
29136 #define HWRM_VNIC_CFG_INPUT_ENABLES_RSS_RULE UINT32_C(0x2)
29137 /*
29138 * This bit must be '1' for the cos_rule field to be
29139 * configured.
29140 */
29141 #define HWRM_VNIC_CFG_INPUT_ENABLES_COS_RULE UINT32_C(0x4)
29142 /*
29143 * This bit must be '1' for the lb_rule field to be
29144 * configured.
29145 */
29146 #define HWRM_VNIC_CFG_INPUT_ENABLES_LB_RULE UINT32_C(0x8)
29147 /*
29148 * This bit must be '1' for the mru field to be
29149 * configured.
29150 */
29151 #define HWRM_VNIC_CFG_INPUT_ENABLES_MRU UINT32_C(0x10)
29152 /*
29153 * This bit must be '1' for the default_rx_ring_id field to be
29154 * configured.
29155 */
29156 #define HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_RX_RING_ID UINT32_C(0x20)
29157 /*
29158 * This bit must be '1' for the default_cmpl_ring_id field to be
29159 * configured.
29160 */
29161 #define HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_CMPL_RING_ID UINT32_C(0x40)
29162 /* This bit must be '1' for the queue_id field to be configured. */
29163 #define HWRM_VNIC_CFG_INPUT_ENABLES_QUEUE_ID UINT32_C(0x80)
29164 /* This bit must be '1' for the rx_csum_v2_mode field to be configured. */
29165 #define HWRM_VNIC_CFG_INPUT_ENABLES_RX_CSUM_V2_MODE UINT32_C(0x100)
29166 /* Logical vnic ID */
29167 uint16_t vnic_id;
29168 /*
29169 * Default Completion ring for the VNIC. This ring will
29170 * be chosen if packet does not match any RSS rules and if
29171 * there is no COS rule.
29172 */
29173 uint16_t dflt_ring_grp;
29174 /*
29175 * RSS ID for RSS rule/table structure. 0xFF... (All Fs) if
29176 * there is no RSS rule.
29177 */
29178 uint16_t rss_rule;
29179 /*
29180 * RSS ID for COS rule/table structure. 0xFF... (All Fs) if
29181 * there is no COS rule.
29182 */
29183 uint16_t cos_rule;
29184 /*
29185 * RSS ID for load balancing rule/table structure.
29186 * 0xFF... (All Fs) if there is no LB rule.
29187 */
29188 uint16_t lb_rule;
29189 /*
29190 * The maximum receive unit of the vnic.
29191 * Each vnic is associated with a function.
29192 * The vnic mru value overwrites the mru setting of the
29193 * associated function.
29194 * The HWRM shall make sure that vnic mru does not exceed
29195 * the mru of the port the function is associated with.
29196 */
29197 uint16_t mru;
29198 /*
29199 * Default Rx ring for the VNIC. This ring will
29200 * be chosen if packet does not match any RSS rules.
29201 * The aggregation ring associated with the Rx ring is
29202 * implied based on the Rx ring specified when the
29203 * aggregation ring was allocated.
29204 */
29205 uint16_t default_rx_ring_id;
29206 /*
29207 * Default completion ring for the VNIC. This ring will
29208 * be chosen if packet does not match any RSS rules.
29209 */
29210 uint16_t default_cmpl_ring_id;
29211 /*
29212 * When specified, only incoming packets classified to the specified CoS
29213 * queue ID will be arriving on this VNIC. Packet priority to CoS mapping
29214 * rules can be specified using HWRM_QUEUE_PRI2COS_CFG. In this mode,
29215 * ntuple filters with VNIC destination specified are invalid since they
29216 * conflict with the the CoS to VNIC steering rules in this mode.
29217 *
29218 * If this field is not specified, packet to VNIC steering will be
29219 * subject to the standard L2 filter rules and any additional ntuple
29220 * filter rules with destination VNIC specified.
29221 */
29222 uint16_t queue_id;
29223 /*
29224 * If the device supports the RX V2 and RX TPA start V2 completion
29225 * records as indicated by the HWRM_VNIC_QCAPS command, this field is
29226 * used to specify the two RX checksum modes supported by these
29227 * completion records.
29228 */
29229 uint8_t rx_csum_v2_mode;
29230 /*
29231 * When configured with this checksum mode, the number of header
29232 * groups in the delivered packet with a valid IP checksum and
29233 * the number of header groups in the delivered packet with a valid
29234 * L4 checksum are reported. Valid checksums are counted from the
29235 * outermost header group to the innermost header group, stopping at
29236 * the first error. This is the default checksum mode supported if
29237 * the driver doesn't explicitly configure the RX checksum mode.
29238 */
29239 #define HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_DEFAULT UINT32_C(0x0)
29240 /*
29241 * When configured with this checksum mode, the checksum status is
29242 * reported using 'all ok' mode. In the RX completion record, one
29243 * bit indicates if the IP checksum is valid for all the parsed
29244 * header groups with an IP checksum. Another bit indicates if the
29245 * L4 checksum is valid for all the parsed header groups with an L4
29246 * checksum. The number of header groups that were parsed by the
29247 * chip and passed in the delivered packet is also reported.
29248 */
29249 #define HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_ALL_OK UINT32_C(0x1)
29250 /*
29251 * Any rx_csum_v2_mode value larger than or equal to this is not
29252 * valid
29253 */
29254 #define HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_MAX UINT32_C(0x2)
29255 #define HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_LAST HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_MAX
29256 uint8_t unused0[5];
29257 } hwrm_vnic_cfg_input_t, *phwrm_vnic_cfg_input_t;
29258
29259 /* hwrm_vnic_cfg_output (size:128b/16B) */
29260
29261 typedef struct hwrm_vnic_cfg_output {
29262 /* The specific error status for the command. */
29263 uint16_t error_code;
29264 /* The HWRM command request type. */
29265 uint16_t req_type;
29266 /* The sequence ID from the original command. */
29267 uint16_t seq_id;
29268 /* The length of the response data in number of bytes. */
29269 uint16_t resp_len;
29270 uint8_t unused_0[7];
29271 /*
29272 * This field is used in Output records to indicate that the output
29273 * is completely written to RAM. This field should be read as '1'
29274 * to indicate that the output has been completely written.
29275 * When writing a command completion or response to an internal processor,
29276 * the order of writes has to be such that this field is written last.
29277 */
29278 uint8_t valid;
29279 } hwrm_vnic_cfg_output_t, *phwrm_vnic_cfg_output_t;
29280
29281 /******************
29282 * hwrm_vnic_qcfg *
29283 ******************/
29284
29285
29286 /* hwrm_vnic_qcfg_input (size:256b/32B) */
29287
29288 typedef struct hwrm_vnic_qcfg_input {
29289 /* The HWRM command request type. */
29290 uint16_t req_type;
29291 /*
29292 * The completion ring to send the completion event on. This should
29293 * be the NQ ID returned from the `nq_alloc` HWRM command.
29294 */
29295 uint16_t cmpl_ring;
29296 /*
29297 * The sequence ID is used by the driver for tracking multiple
29298 * commands. This ID is treated as opaque data by the firmware and
29299 * the value is returned in the `hwrm_resp_hdr` upon completion.
29300 */
29301 uint16_t seq_id;
29302 /*
29303 * The target ID of the command:
29304 * * 0x0-0xFFF8 - The function ID
29305 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29306 * * 0xFFFD - Reserved for user-space HWRM interface
29307 * * 0xFFFF - HWRM
29308 */
29309 uint16_t target_id;
29310 /*
29311 * A physical address pointer pointing to a host buffer that the
29312 * command's response data will be written. This can be either a host
29313 * physical address (HPA) or a guest physical address (GPA) and must
29314 * point to a physically contiguous block of memory.
29315 */
29316 uint64_t resp_addr;
29317 uint32_t enables;
29318 /*
29319 * This bit must be '1' for the vf_id_valid field to be
29320 * configured.
29321 */
29322 #define HWRM_VNIC_QCFG_INPUT_ENABLES_VF_ID_VALID UINT32_C(0x1)
29323 /* Logical vnic ID */
29324 uint32_t vnic_id;
29325 /* ID of Virtual Function whose VNIC resource is being queried. */
29326 uint16_t vf_id;
29327 uint8_t unused_0[6];
29328 } hwrm_vnic_qcfg_input_t, *phwrm_vnic_qcfg_input_t;
29329
29330 /* hwrm_vnic_qcfg_output (size:256b/32B) */
29331
29332 typedef struct hwrm_vnic_qcfg_output {
29333 /* The specific error status for the command. */
29334 uint16_t error_code;
29335 /* The HWRM command request type. */
29336 uint16_t req_type;
29337 /* The sequence ID from the original command. */
29338 uint16_t seq_id;
29339 /* The length of the response data in number of bytes. */
29340 uint16_t resp_len;
29341 /* Default Completion ring for the VNIC. */
29342 uint16_t dflt_ring_grp;
29343 /*
29344 * RSS ID for RSS rule/table structure. 0xFF... (All Fs) if
29345 * there is no RSS rule.
29346 */
29347 uint16_t rss_rule;
29348 /*
29349 * RSS ID for COS rule/table structure. 0xFF... (All Fs) if
29350 * there is no COS rule.
29351 */
29352 uint16_t cos_rule;
29353 /*
29354 * RSS ID for load balancing rule/table structure.
29355 * 0xFF... (All Fs) if there is no LB rule.
29356 */
29357 uint16_t lb_rule;
29358 /* The maximum receive unit of the vnic. */
29359 uint16_t mru;
29360 uint8_t unused_0[2];
29361 uint32_t flags;
29362 /*
29363 * When this bit is '1', the VNIC is the default VNIC for
29364 * the function.
29365 */
29366 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_DEFAULT UINT32_C(0x1)
29367 /*
29368 * When this bit is '1', the VNIC is configured to
29369 * strip VLAN in the RX path.
29370 * If set to '', then VLAN stripping is disabled on
29371 * this VNIC.
29372 */
29373 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_VLAN_STRIP_MODE UINT32_C(0x2)
29374 /*
29375 * When this bit is '1', the VNIC is configured to
29376 * buffer receive packets in the hardware until the host
29377 * posts new receive buffers.
29378 * If set to '', then bd_stall is disabled on
29379 * this VNIC.
29380 */
29381 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_BD_STALL_MODE UINT32_C(0x4)
29382 /*
29383 * When this bit is '1', the VNIC is configured to
29384 * receive both RoCE and non-RoCE traffic.
29385 * If set to '', then this VNIC is not configured to
29386 * operate in dual VNIC mode.
29387 */
29388 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_DUAL_VNIC_MODE UINT32_C(0x8)
29389 /*
29390 * When this flag is set to '1', the VNIC is configured to
29391 * receive only RoCE traffic.
29392 * When this flag is set to '', the VNIC is not configured
29393 * to receive only RoCE traffic.
29394 * If roce_dual_vnic_mode flag and this flag both are set
29395 * to '1', then it is an invalid configuration of the
29396 * VNIC. The HWRM should not allow that type of
29397 * mis-configuration by HWRM clients.
29398 */
29399 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_ONLY_VNIC_MODE UINT32_C(0x10)
29400 /*
29401 * When a VNIC uses one destination ring group for certain
29402 * application (e.g. Receive Flow Steering) where
29403 * exact match is used to direct packets to a VNIC with one
29404 * destination ring group only, there is no need to configure
29405 * RSS indirection table for that VNIC as only one destination
29406 * ring group is used.
29407 *
29408 * When this bit is set to '1', then the VNIC is enabled in a
29409 * mode where RSS is enabled in the VNIC using a RSS context
29410 * for computing RSS hash but the RSS indirection table is
29411 * not configured.
29412 */
29413 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_RSS_DFLT_CR_MODE UINT32_C(0x20)
29414 /*
29415 * When this bit is '1', the VNIC is configured to
29416 * receive both RoCE and non-RoCE traffic, but forward only
29417 * RoCE traffic further. Also RoCE traffic can be mirrored to
29418 * L2 driver.
29419 */
29420 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE UINT32_C(0x40)
29421 /*
29422 * When this bit is '', VNIC is in normal operation state.
29423 * When this bit is '1', VNIC drops all the received packets.
29424 */
29425 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_OPERATION_STATE UINT32_C(0x80)
29426 /*
29427 * When returned with a valid CoS Queue id, the CoS Queue/VNIC association
29428 * is valid. Otherwise it will return 0xFFFF to indicate no VNIC/CoS
29429 * queue association.
29430 */
29431 uint16_t queue_id;
29432 /*
29433 * If the device supports the RX V2 and RX TPA start V2 completion
29434 * records as indicated by the HWRM_VNIC_QCAPS command, this field is
29435 * used to specify the current RX checksum mode configured for all the
29436 * RX rings of a VNIC.
29437 */
29438 uint8_t rx_csum_v2_mode;
29439 /*
29440 * This value indicates that the VNIC is configured to use the
29441 * default RX checksum mode for all the rings associated with this
29442 * VNIC.
29443 */
29444 #define HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_DEFAULT UINT32_C(0x0)
29445 /*
29446 * This value indicates that the VNIC is configured to use the RX
29447 * checksum ‘all_ok’ mode for all the rings associated with this
29448 * VNIC.
29449 */
29450 #define HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_ALL_OK UINT32_C(0x1)
29451 /*
29452 * Any rx_csum_v2_mode value larger than or equal to this is not
29453 * valid
29454 */
29455 #define HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_MAX UINT32_C(0x2)
29456 #define HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_LAST HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_MAX
29457 uint8_t unused_1[4];
29458 /*
29459 * This field is used in Output records to indicate that the output
29460 * is completely written to RAM. This field should be read as '1'
29461 * to indicate that the output has been completely written.
29462 * When writing a command completion or response to an internal processor,
29463 * the order of writes has to be such that this field is written last.
29464 */
29465 uint8_t valid;
29466 } hwrm_vnic_qcfg_output_t, *phwrm_vnic_qcfg_output_t;
29467
29468 /*******************
29469 * hwrm_vnic_qcaps *
29470 *******************/
29471
29472
29473 /* hwrm_vnic_qcaps_input (size:192b/24B) */
29474
29475 typedef struct hwrm_vnic_qcaps_input {
29476 /* The HWRM command request type. */
29477 uint16_t req_type;
29478 /*
29479 * The completion ring to send the completion event on. This should
29480 * be the NQ ID returned from the `nq_alloc` HWRM command.
29481 */
29482 uint16_t cmpl_ring;
29483 /*
29484 * The sequence ID is used by the driver for tracking multiple
29485 * commands. This ID is treated as opaque data by the firmware and
29486 * the value is returned in the `hwrm_resp_hdr` upon completion.
29487 */
29488 uint16_t seq_id;
29489 /*
29490 * The target ID of the command:
29491 * * 0x0-0xFFF8 - The function ID
29492 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29493 * * 0xFFFD - Reserved for user-space HWRM interface
29494 * * 0xFFFF - HWRM
29495 */
29496 uint16_t target_id;
29497 /*
29498 * A physical address pointer pointing to a host buffer that the
29499 * command's response data will be written. This can be either a host
29500 * physical address (HPA) or a guest physical address (GPA) and must
29501 * point to a physically contiguous block of memory.
29502 */
29503 uint64_t resp_addr;
29504 uint32_t enables;
29505 uint8_t unused_0[4];
29506 } hwrm_vnic_qcaps_input_t, *phwrm_vnic_qcaps_input_t;
29507
29508 /* hwrm_vnic_qcaps_output (size:192b/24B) */
29509
29510 typedef struct hwrm_vnic_qcaps_output {
29511 /* The specific error status for the command. */
29512 uint16_t error_code;
29513 /* The HWRM command request type. */
29514 uint16_t req_type;
29515 /* The sequence ID from the original command. */
29516 uint16_t seq_id;
29517 /* The length of the response data in number of bytes. */
29518 uint16_t resp_len;
29519 /* The maximum receive unit that is settable on a vnic. */
29520 uint16_t mru;
29521 uint8_t unused_0[2];
29522 uint32_t flags;
29523 /* Unused. */
29524 #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_UNUSED UINT32_C(0x1)
29525 /*
29526 * When this bit is '1', the capability of stripping VLAN in
29527 * the RX path is supported on VNIC(s).
29528 * If set to '', then VLAN stripping capability is
29529 * not supported on VNIC(s).
29530 */
29531 #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VLAN_STRIP_CAP UINT32_C(0x2)
29532 /*
29533 * When this bit is '1', the capability to buffer receive
29534 * packets in the hardware until the host posts new receive buffers
29535 * is supported on VNIC(s).
29536 * If set to '', then bd_stall capability is not supported
29537 * on VNIC(s).
29538 */
29539 #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_BD_STALL_CAP UINT32_C(0x4)
29540 /*
29541 * When this bit is '1', the capability to
29542 * receive both RoCE and non-RoCE traffic on VNIC(s) is
29543 * supported.
29544 * If set to '', then the capability to receive
29545 * both RoCE and non-RoCE traffic on VNIC(s) is
29546 * not supported.
29547 */
29548 #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_DUAL_VNIC_CAP UINT32_C(0x8)
29549 /*
29550 * When this bit is set to '1', the capability to configure
29551 * a VNIC to receive only RoCE traffic is supported.
29552 * When this flag is set to '', the VNIC capability to
29553 * configure to receive only RoCE traffic is not supported.
29554 */
29555 #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_ONLY_VNIC_CAP UINT32_C(0x10)
29556 /*
29557 * When this bit is set to '1', then the capability to enable
29558 * a VNIC in a mode where RSS context without configuring
29559 * RSS indirection table is supported (for RSS hash computation).
29560 * When this bit is set to '', then a VNIC can not be configured
29561 * with a mode to enable RSS context without configuring RSS
29562 * indirection table.
29563 */
29564 #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_DFLT_CR_CAP UINT32_C(0x20)
29565 /*
29566 * When this bit is '1', the capability to
29567 * mirror the the RoCE traffic is supported.
29568 * If set to '', then the capability to mirror the
29569 * RoCE traffic is not supported.
29570 */
29571 #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_CAP UINT32_C(0x40)
29572 /*
29573 * When this bit is '1', the outermost RSS hashing capability
29574 * is supported. If set to '', then the outermost RSS hashing
29575 * capability is not supported.
29576 */
29577 #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_OUTERMOST_RSS_CAP UINT32_C(0x80)
29578 /*
29579 * When this bit is '1', it indicates that firmware supports the
29580 * ability to steer incoming packets from one CoS queue to one
29581 * VNIC. This optional feature can then be enabled
29582 * using HWRM_VNIC_CFG on any VNIC. This feature is only
29583 * available when NVM option “enable_cos_classfication” is set
29584 * to 1. If set to '', firmware does not support this feature.
29585 */
29586 #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_COS_ASSIGNMENT_CAP UINT32_C(0x100)
29587 /*
29588 * When this bit is '1', it indicates that HW and firmware supports
29589 * the use of RX V2 and RX TPA start V2 completion records for all
29590 * the RX rings of a VNIC. Once set, this feature is mandatory to
29591 * be used for the RX rings of the VNIC. Additionally, two new RX
29592 * checksum features supported by these ompletion records can be
29593 * configured using the HWRM_VNIC_CFG on a VNIC. If set to '', the
29594 * HW and the firmware does not support this feature.
29595 */
29596 #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RX_CMPL_V2_CAP UINT32_C(0x200)
29597 /*
29598 * When this bit is '1', it indicates that HW and firmware support
29599 * vnic state change. Host drivers can change the vnic state using
29600 * HWRM_VNIC_UPDATE. If set to '', the HW and firmware do not
29601 * support this feature.
29602 */
29603 #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VNIC_STATE_CAP UINT32_C(0x400)
29604 /*
29605 * When this bit is '1', it indicates that firmware supports
29606 * virtio-net functions default VNIC allocation using
29607 * HWRM_VNIC_ALLOC.
29608 * This capability is available only on Proxy VEE PF. If set to '',
29609 * firmware does not support this feature.
29610 */
29611 #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VIRTIO_NET_VNIC_ALLOC_CAP UINT32_C(0x800)
29612 /*
29613 * When this bit is set '1', then the capability to configure the
29614 * metadata format in the RX completion is supported for the VNIC.
29615 * When this bit is set to '', then the capability to configure
29616 * the metadata format in the RX completion is not supported for
29617 * the VNIC.
29618 */
29619 #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_METADATA_FORMAT_CAP UINT32_C(0x1000)
29620 /*
29621 * This field advertises the maximum concurrent TPA aggregations
29622 * supported by the VNIC on new devices that support TPA v2.
29623 * '' means that TPA v2 is not supported.
29624 */
29625 uint16_t max_aggs_supported;
29626 uint8_t unused_1[5];
29627 /*
29628 * This field is used in Output records to indicate that the output
29629 * is completely written to RAM. This field should be read as '1'
29630 * to indicate that the output has been completely written.
29631 * When writing a command completion or response to an internal processor,
29632 * the order of writes has to be such that this field is written last.
29633 */
29634 uint8_t valid;
29635 } hwrm_vnic_qcaps_output_t, *phwrm_vnic_qcaps_output_t;
29636
29637 /*********************
29638 * hwrm_vnic_tpa_cfg *
29639 *********************/
29640
29641
29642 /* hwrm_vnic_tpa_cfg_input (size:320b/40B) */
29643
29644 typedef struct hwrm_vnic_tpa_cfg_input {
29645 /* The HWRM command request type. */
29646 uint16_t req_type;
29647 /*
29648 * The completion ring to send the completion event on. This should
29649 * be the NQ ID returned from the `nq_alloc` HWRM command.
29650 */
29651 uint16_t cmpl_ring;
29652 /*
29653 * The sequence ID is used by the driver for tracking multiple
29654 * commands. This ID is treated as opaque data by the firmware and
29655 * the value is returned in the `hwrm_resp_hdr` upon completion.
29656 */
29657 uint16_t seq_id;
29658 /*
29659 * The target ID of the command:
29660 * * 0x0-0xFFF8 - The function ID
29661 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29662 * * 0xFFFD - Reserved for user-space HWRM interface
29663 * * 0xFFFF - HWRM
29664 */
29665 uint16_t target_id;
29666 /*
29667 * A physical address pointer pointing to a host buffer that the
29668 * command's response data will be written. This can be either a host
29669 * physical address (HPA) or a guest physical address (GPA) and must
29670 * point to a physically contiguous block of memory.
29671 */
29672 uint64_t resp_addr;
29673 uint32_t flags;
29674 /*
29675 * When this bit is '1', the VNIC shall be configured to
29676 * perform transparent packet aggregation (TPA) of
29677 * non-tunneled TCP packets.
29678 */
29679 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_TPA UINT32_C(0x1)
29680 /*
29681 * When this bit is '1', the VNIC shall be configured to
29682 * perform transparent packet aggregation (TPA) of
29683 * tunneled TCP packets.
29684 */
29685 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_ENCAP_TPA UINT32_C(0x2)
29686 /*
29687 * When this bit is '1', the VNIC shall be configured to
29688 * perform transparent packet aggregation (TPA) according
29689 * to Windows Receive Segment Coalescing (RSC) rules.
29690 */
29691 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_RSC_WND_UPDATE UINT32_C(0x4)
29692 /*
29693 * When this bit is '1', the VNIC shall be configured to
29694 * perform transparent packet aggregation (TPA) according
29695 * to Linux Generic Receive Offload (GRO) rules.
29696 */
29697 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO UINT32_C(0x8)
29698 /*
29699 * When this bit is '1', the VNIC shall be configured to
29700 * perform transparent packet aggregation (TPA) for TCP
29701 * packets with IP ECN set to non-zero.
29702 */
29703 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_ECN UINT32_C(0x10)
29704 /*
29705 * When this bit is '1', the VNIC shall be configured to
29706 * perform transparent packet aggregation (TPA) for
29707 * GRE tunneled TCP packets only if all packets have the
29708 * same GRE sequence.
29709 */
29710 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_SAME_GRE_SEQ UINT32_C(0x20)
29711 /*
29712 * When this bit is '1' and the GRO mode is enabled,
29713 * the VNIC shall be configured to
29714 * perform transparent packet aggregation (TPA) for
29715 * TCP/IPv4 packets with consecutively increasing IPIDs.
29716 * In other words, the last packet that is being
29717 * aggregated to an already existing aggregation context
29718 * shall have IPID 1 more than the IPID of the last packet
29719 * that was aggregated in that aggregation context.
29720 */
29721 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_IPID_CHECK UINT32_C(0x40)
29722 /*
29723 * When this bit is '1' and the GRO mode is enabled,
29724 * the VNIC shall be configured to
29725 * perform transparent packet aggregation (TPA) for
29726 * TCP packets with the same TTL (IPv4) or Hop limit (IPv6)
29727 * value.
29728 */
29729 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_TTL_CHECK UINT32_C(0x80)
29730 /*
29731 * When this bit is '1' and the GRO mode is enabled,
29732 * the VNIC shall DMA payload data using GRO rules.
29733 * When this bit is '', the VNIC shall DMA payload data
29734 * using the more efficient LRO rules of filling all
29735 * aggregation buffers.
29736 */
29737 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_PACK_AS_GRO UINT32_C(0x100)
29738 uint32_t enables;
29739 /*
29740 * This bit must be '1' for the max_agg_segs field to be
29741 * configured.
29742 */
29743 #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_SEGS UINT32_C(0x1)
29744 /*
29745 * This bit must be '1' for the max_aggs field to be
29746 * configured.
29747 */
29748 #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGGS UINT32_C(0x2)
29749 /*
29750 * This bit must be '1' for the max_agg_timer field to be
29751 * configured.
29752 */
29753 #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_TIMER UINT32_C(0x4)
29754 /* deprecated bit. Do not use!!! */
29755 #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MIN_AGG_LEN UINT32_C(0x8)
29756 /* Logical vnic ID */
29757 uint16_t vnic_id;
29758 /*
29759 * This is the maximum number of TCP segments that can
29760 * be aggregated (unit is Log2). Max value is 31. On new
29761 * devices supporting TPA v2, the unit is multiples of 4 and
29762 * valid values are > 0 and <= 63.
29763 */
29764 uint16_t max_agg_segs;
29765 /* 1 segment */
29766 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_1 UINT32_C(0x0)
29767 /* 2 segments */
29768 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_2 UINT32_C(0x1)
29769 /* 4 segments */
29770 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_4 UINT32_C(0x2)
29771 /* 8 segments */
29772 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_8 UINT32_C(0x3)
29773 /* Any segment size larger than this is not valid */
29774 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX UINT32_C(0x1f)
29775 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_LAST HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX
29776 /*
29777 * This is the maximum number of aggregations this VNIC is
29778 * allowed (unit is Log2). Max value is 7. On new devices
29779 * supporting TPA v2, this is in unit of 1 and must be > 0
29780 * and <= max_aggs_supported in the hwrm_vnic_qcaps response
29781 * to enable TPA v2.
29782 */
29783 uint16_t max_aggs;
29784 /* 1 aggregation */
29785 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_1 UINT32_C(0x0)
29786 /* 2 aggregations */
29787 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_2 UINT32_C(0x1)
29788 /* 4 aggregations */
29789 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_4 UINT32_C(0x2)
29790 /* 8 aggregations */
29791 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_8 UINT32_C(0x3)
29792 /* 16 aggregations */
29793 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_16 UINT32_C(0x4)
29794 /* Any aggregation size larger than this is not valid */
29795 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX UINT32_C(0x7)
29796 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_LAST HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX
29797 uint8_t unused_0[2];
29798 /*
29799 * This is the maximum amount of time allowed for
29800 * an aggregation context to complete after it was initiated.
29801 */
29802 uint32_t max_agg_timer;
29803 /*
29804 * This is the minimum amount of payload length required to
29805 * start an aggregation context. This field is deprecated and
29806 * should be set to 0. The minimum length is set by firmware
29807 * and can be queried using hwrm_vnic_tpa_qcfg.
29808 */
29809 uint32_t min_agg_len;
29810 } hwrm_vnic_tpa_cfg_input_t, *phwrm_vnic_tpa_cfg_input_t;
29811
29812 /* hwrm_vnic_tpa_cfg_output (size:128b/16B) */
29813
29814 typedef struct hwrm_vnic_tpa_cfg_output {
29815 /* The specific error status for the command. */
29816 uint16_t error_code;
29817 /* The HWRM command request type. */
29818 uint16_t req_type;
29819 /* The sequence ID from the original command. */
29820 uint16_t seq_id;
29821 /* The length of the response data in number of bytes. */
29822 uint16_t resp_len;
29823 uint8_t unused_0[7];
29824 /*
29825 * This field is used in Output records to indicate that the output
29826 * is completely written to RAM. This field should be read as '1'
29827 * to indicate that the output has been completely written.
29828 * When writing a command completion or response to an internal processor,
29829 * the order of writes has to be such that this field is written last.
29830 */
29831 uint8_t valid;
29832 } hwrm_vnic_tpa_cfg_output_t, *phwrm_vnic_tpa_cfg_output_t;
29833
29834 /*********************
29835 * hwrm_vnic_rss_cfg *
29836 *********************/
29837
29838
29839 /* hwrm_vnic_rss_cfg_input (size:384b/48B) */
29840
29841 typedef struct hwrm_vnic_rss_cfg_input {
29842 /* The HWRM command request type. */
29843 uint16_t req_type;
29844 /*
29845 * The completion ring to send the completion event on. This should
29846 * be the NQ ID returned from the `nq_alloc` HWRM command.
29847 */
29848 uint16_t cmpl_ring;
29849 /*
29850 * The sequence ID is used by the driver for tracking multiple
29851 * commands. This ID is treated as opaque data by the firmware and
29852 * the value is returned in the `hwrm_resp_hdr` upon completion.
29853 */
29854 uint16_t seq_id;
29855 /*
29856 * The target ID of the command:
29857 * * 0x0-0xFFF8 - The function ID
29858 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29859 * * 0xFFFD - Reserved for user-space HWRM interface
29860 * * 0xFFFF - HWRM
29861 */
29862 uint16_t target_id;
29863 /*
29864 * A physical address pointer pointing to a host buffer that the
29865 * command's response data will be written. This can be either a host
29866 * physical address (HPA) or a guest physical address (GPA) and must
29867 * point to a physically contiguous block of memory.
29868 */
29869 uint64_t resp_addr;
29870 uint32_t hash_type;
29871 /*
29872 * When this bit is '1', the RSS hash shall be computed
29873 * over source and destination IPv4 addresses of IPv4
29874 * packets.
29875 */
29876 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV4 UINT32_C(0x1)
29877 /*
29878 * When this bit is '1', the RSS hash shall be computed
29879 * over source/destination IPv4 addresses and
29880 * source/destination ports of TCP/IPv4 packets.
29881 */
29882 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV4 UINT32_C(0x2)
29883 /*
29884 * When this bit is '1', the RSS hash shall be computed
29885 * over source/destination IPv4 addresses and
29886 * source/destination ports of UDP/IPv4 packets.
29887 */
29888 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV4 UINT32_C(0x4)
29889 /*
29890 * When this bit is '1', the RSS hash shall be computed
29891 * over source and destination IPv4 addresses of IPv6
29892 * packets.
29893 */
29894 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6 UINT32_C(0x8)
29895 /*
29896 * When this bit is '1', the RSS hash shall be computed
29897 * over source/destination IPv6 addresses and
29898 * source/destination ports of TCP/IPv6 packets.
29899 */
29900 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV6 UINT32_C(0x10)
29901 /*
29902 * When this bit is '1', the RSS hash shall be computed
29903 * over source/destination IPv6 addresses and
29904 * source/destination ports of UDP/IPv6 packets.
29905 */
29906 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6 UINT32_C(0x20)
29907 /* VNIC ID of VNIC associated with RSS table being configured. */
29908 uint16_t vnic_id;
29909 /*
29910 * Specifies which VNIC ring table pair to configure.
29911 * Valid values range from 0 to 7.
29912 */
29913 uint8_t ring_table_pair_index;
29914 /* Flags to specify different RSS hash modes. */
29915 uint8_t hash_mode_flags;
29916 /*
29917 * When this bit is '1', it indicates using current RSS
29918 * hash mode setting configured in the device.
29919 */
29920 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_DEFAULT UINT32_C(0x1)
29921 /*
29922 * When this bit is '1', it indicates requesting support of
29923 * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
29924 * l4.src, l4.dest} for tunnel packets. For none-tunnel
29925 * packets, the RSS hash is computed over the normal
29926 * src/dest l3 and src/dest l4 headers.
29927 */
29928 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_4 UINT32_C(0x2)
29929 /*
29930 * When this bit is '1', it indicates requesting support of
29931 * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
29932 * tunnel packets. For none-tunnel packets, the RSS hash is
29933 * computed over the normal src/dest l3 headers.
29934 */
29935 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_2 UINT32_C(0x4)
29936 /*
29937 * When this bit is '1', it indicates requesting support of
29938 * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
29939 * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
29940 * packets, the RSS hash is computed over the normal
29941 * src/dest l3 and src/dest l4 headers.
29942 */
29943 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_4 UINT32_C(0x8)
29944 /*
29945 * When this bit is '1', it indicates requesting support of
29946 * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
29947 * tunnel packets. For none-tunnel packets, the RSS hash is
29948 * computed over the normal src/dest l3 headers.
29949 */
29950 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_2 UINT32_C(0x10)
29951 /* This is the address for rss ring group table */
29952 uint64_t ring_grp_tbl_addr;
29953 /* This is the address for rss hash key table */
29954 uint64_t hash_key_tbl_addr;
29955 /* Index to the rss indirection table. */
29956 uint16_t rss_ctx_idx;
29957 uint8_t unused_1[6];
29958 } hwrm_vnic_rss_cfg_input_t, *phwrm_vnic_rss_cfg_input_t;
29959
29960 /* hwrm_vnic_rss_cfg_output (size:128b/16B) */
29961
29962 typedef struct hwrm_vnic_rss_cfg_output {
29963 /* The specific error status for the command. */
29964 uint16_t error_code;
29965 /* The HWRM command request type. */
29966 uint16_t req_type;
29967 /* The sequence ID from the original command. */
29968 uint16_t seq_id;
29969 /* The length of the response data in number of bytes. */
29970 uint16_t resp_len;
29971 uint8_t unused_0[7];
29972 /*
29973 * This field is used in Output records to indicate that the output
29974 * is completely written to RAM. This field should be read as '1'
29975 * to indicate that the output has been completely written.
29976 * When writing a command completion or response to an internal processor,
29977 * the order of writes has to be such that this field is written last.
29978 */
29979 uint8_t valid;
29980 } hwrm_vnic_rss_cfg_output_t, *phwrm_vnic_rss_cfg_output_t;
29981
29982 /* hwrm_vnic_rss_cfg_cmd_err (size:64b/8B) */
29983
29984 typedef struct hwrm_vnic_rss_cfg_cmd_err {
29985 /*
29986 * command specific error codes that goes to
29987 * the cmd_err field in Common HWRM Error Response.
29988 */
29989 uint8_t code;
29990 /* Unknown error */
29991 #define HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
29992 /*
29993 * Unable to change global RSS mode to outer due to all active
29994 * interfaces are not ready to support outer RSS hashing.
29995 */
29996 #define HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_INTERFACE_NOT_READY UINT32_C(0x1)
29997 #define HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_LAST HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_INTERFACE_NOT_READY
29998 uint8_t unused_0[7];
29999 } hwrm_vnic_rss_cfg_cmd_err_t, *phwrm_vnic_rss_cfg_cmd_err_t;
30000
30001 /**********************
30002 * hwrm_vnic_rss_qcfg *
30003 **********************/
30004
30005
30006 /* hwrm_vnic_rss_qcfg_input (size:192b/24B) */
30007
30008 typedef struct hwrm_vnic_rss_qcfg_input {
30009 /* The HWRM command request type. */
30010 uint16_t req_type;
30011 /*
30012 * The completion ring to send the completion event on. This should
30013 * be the NQ ID returned from the `nq_alloc` HWRM command.
30014 */
30015 uint16_t cmpl_ring;
30016 /*
30017 * The sequence ID is used by the driver for tracking multiple
30018 * commands. This ID is treated as opaque data by the firmware and
30019 * the value is returned in the `hwrm_resp_hdr` upon completion.
30020 */
30021 uint16_t seq_id;
30022 /*
30023 * The target ID of the command:
30024 * * 0x0-0xFFF8 - The function ID
30025 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30026 * * 0xFFFD - Reserved for user-space HWRM interface
30027 * * 0xFFFF - HWRM
30028 */
30029 uint16_t target_id;
30030 /*
30031 * A physical address pointer pointing to a host buffer that the
30032 * command's response data will be written. This can be either a host
30033 * physical address (HPA) or a guest physical address (GPA) and must
30034 * point to a physically contiguous block of memory.
30035 */
30036 uint64_t resp_addr;
30037 /* Index to the rss indirection table. */
30038 uint16_t rss_ctx_idx;
30039 uint8_t unused_0[6];
30040 } hwrm_vnic_rss_qcfg_input_t, *phwrm_vnic_rss_qcfg_input_t;
30041
30042 /* hwrm_vnic_rss_qcfg_output (size:512b/64B) */
30043
30044 typedef struct hwrm_vnic_rss_qcfg_output {
30045 /* The specific error status for the command. */
30046 uint16_t error_code;
30047 /* The HWRM command request type. */
30048 uint16_t req_type;
30049 /* The sequence ID from the original command. */
30050 uint16_t seq_id;
30051 /* The length of the response data in number of bytes. */
30052 uint16_t resp_len;
30053 uint32_t hash_type;
30054 /*
30055 * When this bit is '1', the RSS hash shall be computed
30056 * over source and destination IPv4 addresses of IPv4
30057 * packets.
30058 */
30059 #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV4 UINT32_C(0x1)
30060 /*
30061 * When this bit is '1', the RSS hash shall be computed
30062 * over source/destination IPv4 addresses and
30063 * source/destination ports of TCP/IPv4 packets.
30064 */
30065 #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV4 UINT32_C(0x2)
30066 /*
30067 * When this bit is '1', the RSS hash shall be computed
30068 * over source/destination IPv4 addresses and
30069 * source/destination ports of UDP/IPv4 packets.
30070 */
30071 #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV4 UINT32_C(0x4)
30072 /*
30073 * When this bit is '1', the RSS hash shall be computed
30074 * over source and destination IPv4 addresses of IPv6
30075 * packets.
30076 */
30077 #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV6 UINT32_C(0x8)
30078 /*
30079 * When this bit is '1', the RSS hash shall be computed
30080 * over source/destination IPv6 addresses and
30081 * source/destination ports of TCP/IPv6 packets.
30082 */
30083 #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV6 UINT32_C(0x10)
30084 /*
30085 * When this bit is '1', the RSS hash shall be computed
30086 * over source/destination IPv6 addresses and
30087 * source/destination ports of UDP/IPv6 packets.
30088 */
30089 #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV6 UINT32_C(0x20)
30090 uint8_t unused_0[4];
30091 /* This is the value of rss hash key */
30092 uint32_t hash_key[10];
30093 /* Flags to specify different RSS hash modes. */
30094 uint8_t hash_mode_flags;
30095 /*
30096 * When this bit is '1', it indicates using current RSS
30097 * hash mode setting configured in the device.
30098 */
30099 #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_DEFAULT UINT32_C(0x1)
30100 /*
30101 * When this bit is '1', it indicates requesting support of
30102 * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
30103 * l4.src, l4.dest} for tunnel packets. For none-tunnel
30104 * packets, the RSS hash is computed over the normal
30105 * src/dest l3 and src/dest l4 headers.
30106 */
30107 #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_4 UINT32_C(0x2)
30108 /*
30109 * When this bit is '1', it indicates requesting support of
30110 * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
30111 * tunnel packets. For none-tunnel packets, the RSS hash is
30112 * computed over the normal src/dest l3 headers.
30113 */
30114 #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_2 UINT32_C(0x4)
30115 /*
30116 * When this bit is '1', it indicates requesting support of
30117 * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
30118 * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
30119 * packets, the RSS hash is computed over the normal
30120 * src/dest l3 and src/dest l4 headers.
30121 */
30122 #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_4 UINT32_C(0x8)
30123 /*
30124 * When this bit is '1', it indicates requesting support of
30125 * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
30126 * tunnel packets. For none-tunnel packets, the RSS hash is
30127 * computed over the normal src/dest l3 headers.
30128 */
30129 #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_2 UINT32_C(0x10)
30130 uint8_t unused_1[6];
30131 /*
30132 * This field is used in Output records to indicate that the output
30133 * is completely written to RAM. This field should be read as '1'
30134 * to indicate that the output has been completely written.
30135 * When writing a command completion or response to an internal processor,
30136 * the order of writes has to be such that this field is written last.
30137 */
30138 uint8_t valid;
30139 } hwrm_vnic_rss_qcfg_output_t, *phwrm_vnic_rss_qcfg_output_t;
30140
30141 /**************************
30142 * hwrm_vnic_plcmodes_cfg *
30143 **************************/
30144
30145
30146 /* hwrm_vnic_plcmodes_cfg_input (size:320b/40B) */
30147
30148 typedef struct hwrm_vnic_plcmodes_cfg_input {
30149 /* The HWRM command request type. */
30150 uint16_t req_type;
30151 /*
30152 * The completion ring to send the completion event on. This should
30153 * be the NQ ID returned from the `nq_alloc` HWRM command.
30154 */
30155 uint16_t cmpl_ring;
30156 /*
30157 * The sequence ID is used by the driver for tracking multiple
30158 * commands. This ID is treated as opaque data by the firmware and
30159 * the value is returned in the `hwrm_resp_hdr` upon completion.
30160 */
30161 uint16_t seq_id;
30162 /*
30163 * The target ID of the command:
30164 * * 0x0-0xFFF8 - The function ID
30165 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30166 * * 0xFFFD - Reserved for user-space HWRM interface
30167 * * 0xFFFF - HWRM
30168 */
30169 uint16_t target_id;
30170 /*
30171 * A physical address pointer pointing to a host buffer that the
30172 * command's response data will be written. This can be either a host
30173 * physical address (HPA) or a guest physical address (GPA) and must
30174 * point to a physically contiguous block of memory.
30175 */
30176 uint64_t resp_addr;
30177 uint32_t flags;
30178 /*
30179 * When this bit is '1', the VNIC shall be configured to
30180 * use regular placement algorithm.
30181 * By default, the regular placement algorithm shall be
30182 * enabled on the VNIC.
30183 */
30184 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_REGULAR_PLACEMENT UINT32_C(0x1)
30185 /*
30186 * When this bit is '1', the VNIC shall be configured
30187 * use the jumbo placement algorithm.
30188 */
30189 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_JUMBO_PLACEMENT UINT32_C(0x2)
30190 /*
30191 * When this bit is '1', the VNIC shall be configured
30192 * to enable Header-Data split for IPv4 packets according
30193 * to the following rules:
30194 * # If the packet is identified as TCP/IPv4, then the
30195 * packet is split at the beginning of the TCP payload.
30196 * # If the packet is identified as UDP/IPv4, then the
30197 * packet is split at the beginning of UDP payload.
30198 * # If the packet is identified as non-TCP and non-UDP
30199 * IPv4 packet, then the packet is split at the beginning
30200 * of the upper layer protocol header carried in the IPv4
30201 * packet.
30202 */
30203 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV4 UINT32_C(0x4)
30204 /*
30205 * When this bit is '1', the VNIC shall be configured
30206 * to enable Header-Data split for IPv6 packets according
30207 * to the following rules:
30208 * # If the packet is identified as TCP/IPv6, then the
30209 * packet is split at the beginning of the TCP payload.
30210 * # If the packet is identified as UDP/IPv6, then the
30211 * packet is split at the beginning of UDP payload.
30212 * # If the packet is identified as non-TCP and non-UDP
30213 * IPv6 packet, then the packet is split at the beginning
30214 * of the upper layer protocol header carried in the IPv6
30215 * packet.
30216 */
30217 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV6 UINT32_C(0x8)
30218 /*
30219 * When this bit is '1', the VNIC shall be configured
30220 * to enable Header-Data split for FCoE packets at the
30221 * beginning of FC payload.
30222 */
30223 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_FCOE UINT32_C(0x10)
30224 /*
30225 * When this bit is '1', the VNIC shall be configured
30226 * to enable Header-Data split for RoCE packets at the
30227 * beginning of RoCE payload (after BTH/GRH headers).
30228 */
30229 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_ROCE UINT32_C(0x20)
30230 /*
30231 * When this bit is '1', the VNIC shall be configured use the virtio
30232 * placement algorithm. This feature can only be configured when
30233 * proxy mode is supported on the function.
30234 */
30235 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_VIRTIO_PLACEMENT UINT32_C(0x40)
30236 uint32_t enables;
30237 /*
30238 * This bit must be '1' for the jumbo_thresh_valid field to be
30239 * configured.
30240 */
30241 #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_JUMBO_THRESH_VALID UINT32_C(0x1)
30242 /*
30243 * This bit must be '1' for the hds_offset_valid field to be
30244 * configured.
30245 */
30246 #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_OFFSET_VALID UINT32_C(0x2)
30247 /*
30248 * This bit must be '1' for the hds_threshold_valid field to be
30249 * configured.
30250 */
30251 #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_THRESHOLD_VALID UINT32_C(0x4)
30252 /*
30253 * This bit must be '1' for the max_bds_valid field to be
30254 * configured.
30255 */
30256 #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_MAX_BDS_VALID UINT32_C(0x8)
30257 /* Logical vnic ID */
30258 uint32_t vnic_id;
30259 /*
30260 * When jumbo placement algorithm is enabled, this value
30261 * is used to determine the threshold for jumbo placement.
30262 * Packets with length larger than this value will be
30263 * placed according to the jumbo placement algorithm.
30264 */
30265 uint16_t jumbo_thresh;
30266 /*
30267 * This value is used to determine the offset into
30268 * packet buffer where the split data (payload) will be
30269 * placed according to one of HDS placement algorithm.
30270 *
30271 * The lengths of packet buffers provided for split data
30272 * shall be larger than this value.
30273 */
30274 uint16_t hds_offset;
30275 /*
30276 * When one of the HDS placement algorithm is enabled, this
30277 * value is used to determine the threshold for HDS
30278 * placement.
30279 * Packets with length larger than this value will be
30280 * placed according to the HDS placement algorithm.
30281 * This value shall be in multiple of 4 bytes.
30282 */
30283 uint16_t hds_threshold;
30284 /*
30285 * When virtio placement algorithm is enabled, this
30286 * value is used to determine the the maximum number of BDs
30287 * that can be used to place an Rx Packet.
30288 * If an incoming packet does not fit in the buffers described
30289 * by the max BDs, the packet will be dropped and an error
30290 * will be reported in the completion. Valid values for this
30291 * field are between 1 and 8. If the VNIC uses header-data-
30292 * separation and/or TPA with buffer spanning enabled, valid
30293 * values for this field are between 2 and 8.
30294 * This feature can only be configured when proxy mode is
30295 * supported on the function.
30296 */
30297 uint16_t max_bds;
30298 uint8_t unused_0[4];
30299 } hwrm_vnic_plcmodes_cfg_input_t, *phwrm_vnic_plcmodes_cfg_input_t;
30300
30301 /* hwrm_vnic_plcmodes_cfg_output (size:128b/16B) */
30302
30303 typedef struct hwrm_vnic_plcmodes_cfg_output {
30304 /* The specific error status for the command. */
30305 uint16_t error_code;
30306 /* The HWRM command request type. */
30307 uint16_t req_type;
30308 /* The sequence ID from the original command. */
30309 uint16_t seq_id;
30310 /* The length of the response data in number of bytes. */
30311 uint16_t resp_len;
30312 uint8_t unused_0[7];
30313 /*
30314 * This field is used in Output records to indicate that the output
30315 * is completely written to RAM. This field should be read as '1'
30316 * to indicate that the output has been completely written.
30317 * When writing a command completion or response to an internal
30318 * processor, the order of writes has to be such that this field is
30319 * written last.
30320 */
30321 uint8_t valid;
30322 } hwrm_vnic_plcmodes_cfg_output_t, *phwrm_vnic_plcmodes_cfg_output_t;
30323
30324 /***************************
30325 * hwrm_vnic_plcmodes_qcfg *
30326 ***************************/
30327
30328
30329 /* hwrm_vnic_plcmodes_qcfg_input (size:192b/24B) */
30330
30331 typedef struct hwrm_vnic_plcmodes_qcfg_input {
30332 /* The HWRM command request type. */
30333 uint16_t req_type;
30334 /*
30335 * The completion ring to send the completion event on. This should
30336 * be the NQ ID returned from the `nq_alloc` HWRM command.
30337 */
30338 uint16_t cmpl_ring;
30339 /*
30340 * The sequence ID is used by the driver for tracking multiple
30341 * commands. This ID is treated as opaque data by the firmware and
30342 * the value is returned in the `hwrm_resp_hdr` upon completion.
30343 */
30344 uint16_t seq_id;
30345 /*
30346 * The target ID of the command:
30347 * * 0x0-0xFFF8 - The function ID
30348 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30349 * * 0xFFFD - Reserved for user-space HWRM interface
30350 * * 0xFFFF - HWRM
30351 */
30352 uint16_t target_id;
30353 /*
30354 * A physical address pointer pointing to a host buffer that the
30355 * command's response data will be written. This can be either a host
30356 * physical address (HPA) or a guest physical address (GPA) and must
30357 * point to a physically contiguous block of memory.
30358 */
30359 uint64_t resp_addr;
30360 /* Logical vnic ID */
30361 uint32_t vnic_id;
30362 uint8_t unused_0[4];
30363 } hwrm_vnic_plcmodes_qcfg_input_t, *phwrm_vnic_plcmodes_qcfg_input_t;
30364
30365 /* hwrm_vnic_plcmodes_qcfg_output (size:192b/24B) */
30366
30367 typedef struct hwrm_vnic_plcmodes_qcfg_output {
30368 /* The specific error status for the command. */
30369 uint16_t error_code;
30370 /* The HWRM command request type. */
30371 uint16_t req_type;
30372 /* The sequence ID from the original command. */
30373 uint16_t seq_id;
30374 /* The length of the response data in number of bytes. */
30375 uint16_t resp_len;
30376 uint32_t flags;
30377 /*
30378 * When this bit is '1', the VNIC is configured to
30379 * use regular placement algorithm.
30380 */
30381 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_REGULAR_PLACEMENT UINT32_C(0x1)
30382 /*
30383 * When this bit is '1', the VNIC is configured to
30384 * use the jumbo placement algorithm.
30385 */
30386 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_JUMBO_PLACEMENT UINT32_C(0x2)
30387 /*
30388 * When this bit is '1', the VNIC is configured
30389 * to enable Header-Data split for IPv4 packets.
30390 */
30391 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV4 UINT32_C(0x4)
30392 /*
30393 * When this bit is '1', the VNIC is configured
30394 * to enable Header-Data split for IPv6 packets.
30395 */
30396 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV6 UINT32_C(0x8)
30397 /*
30398 * When this bit is '1', the VNIC is configured
30399 * to enable Header-Data split for FCoE packets.
30400 */
30401 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_FCOE UINT32_C(0x10)
30402 /*
30403 * When this bit is '1', the VNIC is configured
30404 * to enable Header-Data split for RoCE packets.
30405 */
30406 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_ROCE UINT32_C(0x20)
30407 /*
30408 * When this bit is '1', the VNIC is configured
30409 * to be the default VNIC of the requesting function.
30410 */
30411 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_DFLT_VNIC UINT32_C(0x40)
30412 /*
30413 * When this bit is '1', the VNIC is configured to use the virtio
30414 * placement algorithm. This feature can only be configured when
30415 * proxy mode is supported on the function.
30416 */
30417 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_VIRTIO_PLACEMENT UINT32_C(0x80)
30418 /*
30419 * When jumbo placement algorithm is enabled, this value
30420 * is used to determine the threshold for jumbo placement.
30421 * Packets with length larger than this value will be
30422 * placed according to the jumbo placement algorithm.
30423 */
30424 uint16_t jumbo_thresh;
30425 /*
30426 * This value is used to determine the offset into
30427 * packet buffer where the split data (payload) will be
30428 * placed according to one of HDS placement algorithm.
30429 *
30430 * The lengths of packet buffers provided for split data
30431 * shall be larger than this value.
30432 */
30433 uint16_t hds_offset;
30434 /*
30435 * When one of the HDS placement algorithm is enabled, this
30436 * value is used to determine the threshold for HDS
30437 * placement.
30438 * Packets with length larger than this value will be
30439 * placed according to the HDS placement algorithm.
30440 * This value shall be in multiple of 4 bytes.
30441 */
30442 uint16_t hds_threshold;
30443 /*
30444 * When virtio placement algorithm is enabled, this
30445 * value is used to determine the the maximum number of BDs
30446 * that can be used to place an Rx Packet.
30447 * If an incoming packet does not fit in the buffers described
30448 * by the max BDs, the packet will be dropped and an error
30449 * will be reported in the completion. Valid values for this
30450 * field are between 1 and 8. If the VNIC uses header-data-
30451 * separation and/or TPA with buffer spanning enabled, valid
30452 * values for this field are between 2 and 8.
30453 * This feature can only be configured when proxy mode is supported
30454 * on the function
30455 */
30456 uint16_t max_bds;
30457 uint8_t unused_0[3];
30458 /*
30459 * This field is used in Output records to indicate that the output
30460 * is completely written to RAM. This field should be read as '1'
30461 * to indicate that the output has been completely written.
30462 * When writing a command completion or response to an internal
30463 * processor, the order of writes has to be such that this field is
30464 * written last.
30465 */
30466 uint8_t valid;
30467 } hwrm_vnic_plcmodes_qcfg_output_t, *phwrm_vnic_plcmodes_qcfg_output_t;
30468
30469 /**********************************
30470 * hwrm_vnic_rss_cos_lb_ctx_alloc *
30471 **********************************/
30472
30473
30474 /* hwrm_vnic_rss_cos_lb_ctx_alloc_input (size:128b/16B) */
30475
30476 typedef struct hwrm_vnic_rss_cos_lb_ctx_alloc_input {
30477 /* The HWRM command request type. */
30478 uint16_t req_type;
30479 /*
30480 * The completion ring to send the completion event on. This should
30481 * be the NQ ID returned from the `nq_alloc` HWRM command.
30482 */
30483 uint16_t cmpl_ring;
30484 /*
30485 * The sequence ID is used by the driver for tracking multiple
30486 * commands. This ID is treated as opaque data by the firmware and
30487 * the value is returned in the `hwrm_resp_hdr` upon completion.
30488 */
30489 uint16_t seq_id;
30490 /*
30491 * The target ID of the command:
30492 * * 0x0-0xFFF8 - The function ID
30493 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30494 * * 0xFFFD - Reserved for user-space HWRM interface
30495 * * 0xFFFF - HWRM
30496 */
30497 uint16_t target_id;
30498 /*
30499 * A physical address pointer pointing to a host buffer that the
30500 * command's response data will be written. This can be either a host
30501 * physical address (HPA) or a guest physical address (GPA) and must
30502 * point to a physically contiguous block of memory.
30503 */
30504 uint64_t resp_addr;
30505 } hwrm_vnic_rss_cos_lb_ctx_alloc_input_t, *phwrm_vnic_rss_cos_lb_ctx_alloc_input_t;
30506
30507 /* hwrm_vnic_rss_cos_lb_ctx_alloc_output (size:128b/16B) */
30508
30509 typedef struct hwrm_vnic_rss_cos_lb_ctx_alloc_output {
30510 /* The specific error status for the command. */
30511 uint16_t error_code;
30512 /* The HWRM command request type. */
30513 uint16_t req_type;
30514 /* The sequence ID from the original command. */
30515 uint16_t seq_id;
30516 /* The length of the response data in number of bytes. */
30517 uint16_t resp_len;
30518 /* rss_cos_lb_ctx_id is 16 b */
30519 uint16_t rss_cos_lb_ctx_id;
30520 uint8_t unused_0[5];
30521 /*
30522 * This field is used in Output records to indicate that the output
30523 * is completely written to RAM. This field should be read as '1'
30524 * to indicate that the output has been completely written.
30525 * When writing a command completion or response to an internal processor,
30526 * the order of writes has to be such that this field is written last.
30527 */
30528 uint8_t valid;
30529 } hwrm_vnic_rss_cos_lb_ctx_alloc_output_t, *phwrm_vnic_rss_cos_lb_ctx_alloc_output_t;
30530
30531 /*********************************
30532 * hwrm_vnic_rss_cos_lb_ctx_free *
30533 *********************************/
30534
30535
30536 /* hwrm_vnic_rss_cos_lb_ctx_free_input (size:192b/24B) */
30537
30538 typedef struct hwrm_vnic_rss_cos_lb_ctx_free_input {
30539 /* The HWRM command request type. */
30540 uint16_t req_type;
30541 /*
30542 * The completion ring to send the completion event on. This should
30543 * be the NQ ID returned from the `nq_alloc` HWRM command.
30544 */
30545 uint16_t cmpl_ring;
30546 /*
30547 * The sequence ID is used by the driver for tracking multiple
30548 * commands. This ID is treated as opaque data by the firmware and
30549 * the value is returned in the `hwrm_resp_hdr` upon completion.
30550 */
30551 uint16_t seq_id;
30552 /*
30553 * The target ID of the command:
30554 * * 0x0-0xFFF8 - The function ID
30555 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30556 * * 0xFFFD - Reserved for user-space HWRM interface
30557 * * 0xFFFF - HWRM
30558 */
30559 uint16_t target_id;
30560 /*
30561 * A physical address pointer pointing to a host buffer that the
30562 * command's response data will be written. This can be either a host
30563 * physical address (HPA) or a guest physical address (GPA) and must
30564 * point to a physically contiguous block of memory.
30565 */
30566 uint64_t resp_addr;
30567 /* rss_cos_lb_ctx_id is 16 b */
30568 uint16_t rss_cos_lb_ctx_id;
30569 uint8_t unused_0[6];
30570 } hwrm_vnic_rss_cos_lb_ctx_free_input_t, *phwrm_vnic_rss_cos_lb_ctx_free_input_t;
30571
30572 /* hwrm_vnic_rss_cos_lb_ctx_free_output (size:128b/16B) */
30573
30574 typedef struct hwrm_vnic_rss_cos_lb_ctx_free_output {
30575 /* The specific error status for the command. */
30576 uint16_t error_code;
30577 /* The HWRM command request type. */
30578 uint16_t req_type;
30579 /* The sequence ID from the original command. */
30580 uint16_t seq_id;
30581 /* The length of the response data in number of bytes. */
30582 uint16_t resp_len;
30583 uint8_t unused_0[7];
30584 /*
30585 * This field is used in Output records to indicate that the output
30586 * is completely written to RAM. This field should be read as '1'
30587 * to indicate that the output has been completely written.
30588 * When writing a command completion or response to an internal processor,
30589 * the order of writes has to be such that this field is written last.
30590 */
30591 uint8_t valid;
30592 } hwrm_vnic_rss_cos_lb_ctx_free_output_t, *phwrm_vnic_rss_cos_lb_ctx_free_output_t;
30593
30594 /*******************
30595 * hwrm_ring_alloc *
30596 *******************/
30597
30598
30599 /* hwrm_ring_alloc_input (size:704b/88B) */
30600
30601 typedef struct hwrm_ring_alloc_input {
30602 /* The HWRM command request type. */
30603 uint16_t req_type;
30604 /*
30605 * The completion ring to send the completion event on. This should
30606 * be the NQ ID returned from the `nq_alloc` HWRM command.
30607 */
30608 uint16_t cmpl_ring;
30609 /*
30610 * The sequence ID is used by the driver for tracking multiple
30611 * commands. This ID is treated as opaque data by the firmware and
30612 * the value is returned in the `hwrm_resp_hdr` upon completion.
30613 */
30614 uint16_t seq_id;
30615 /*
30616 * The target ID of the command:
30617 * * 0x0-0xFFF8 - The function ID
30618 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30619 * * 0xFFFD - Reserved for user-space HWRM interface
30620 * * 0xFFFF - HWRM
30621 */
30622 uint16_t target_id;
30623 /*
30624 * A physical address pointer pointing to a host buffer that the
30625 * command's response data will be written. This can be either a host
30626 * physical address (HPA) or a guest physical address (GPA) and must
30627 * point to a physically contiguous block of memory.
30628 */
30629 uint64_t resp_addr;
30630 uint32_t enables;
30631 /*
30632 * This bit must be '1' for the ring_arb_cfg field to be
30633 * configured.
30634 */
30635 #define HWRM_RING_ALLOC_INPUT_ENABLES_RING_ARB_CFG UINT32_C(0x2)
30636 /*
30637 * This bit must be '1' for the stat_ctx_id_valid field to be
30638 * configured.
30639 */
30640 #define HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID UINT32_C(0x8)
30641 /*
30642 * This bit must be '1' for the max_bw_valid field to be
30643 * configured.
30644 */
30645 #define HWRM_RING_ALLOC_INPUT_ENABLES_MAX_BW_VALID UINT32_C(0x20)
30646 /*
30647 * This bit must be '1' for the rx_ring_id field to be
30648 * configured.
30649 */
30650 #define HWRM_RING_ALLOC_INPUT_ENABLES_RX_RING_ID_VALID UINT32_C(0x40)
30651 /*
30652 * This bit must be '1' for the nq_ring_id field to be
30653 * configured.
30654 */
30655 #define HWRM_RING_ALLOC_INPUT_ENABLES_NQ_RING_ID_VALID UINT32_C(0x80)
30656 /*
30657 * This bit must be '1' for the rx_buf_size field to be
30658 * configured.
30659 */
30660 #define HWRM_RING_ALLOC_INPUT_ENABLES_RX_BUF_SIZE_VALID UINT32_C(0x100)
30661 /*
30662 * This bit must be '1' for the schq_id field to be
30663 * configured.
30664 */
30665 #define HWRM_RING_ALLOC_INPUT_ENABLES_SCHQ_ID UINT32_C(0x200)
30666 /*
30667 * This bit must be '1' for the mpc_chnls_type field to be
30668 * configured.
30669 */
30670 #define HWRM_RING_ALLOC_INPUT_ENABLES_MPC_CHNLS_TYPE UINT32_C(0x400)
30671 /* Ring Type. */
30672 uint8_t ring_type;
30673 /* L2 Completion Ring (CR) */
30674 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL UINT32_C(0x0)
30675 /* TX Ring (TR) */
30676 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_TX UINT32_C(0x1)
30677 /* RX Ring (RR) */
30678 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX UINT32_C(0x2)
30679 /* RoCE Notification Completion Ring (ROCE_CR) */
30680 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
30681 /* RX Aggregation Ring */
30682 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX_AGG UINT32_C(0x4)
30683 /* Notification Queue */
30684 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ UINT32_C(0x5)
30685 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_LAST HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ
30686 uint8_t unused_0;
30687 /* Ring allocation flags. */
30688 uint16_t flags;
30689 /*
30690 * For Rx rings, the incoming packet data can be placed at either
30691 * a 0B or 2B offset from the start of the Rx packet buffer. When
30692 * '1', the received packet will be padded with 2B of zeros at the
30693 * front of the packet. Note that this flag is only used for
30694 * Rx rings and is ignored for all other rings included Rx
30695 * Aggregation rings.
30696 */
30697 #define HWRM_RING_ALLOC_INPUT_FLAGS_RX_SOP_PAD UINT32_C(0x1)
30698 /*
30699 * This value is a pointer to the page table for the
30700 * Ring.
30701 */
30702 uint64_t page_tbl_addr;
30703 /* First Byte Offset of the first entry in the first page. */
30704 uint32_t fbo;
30705 /*
30706 * Actual page size in 2^page_size. The supported range is increments
30707 * in powers of 2 from 16 bytes to 1GB.
30708 * - 4 = 16 B
30709 * Page size is 16 B.
30710 * - 12 = 4 KB
30711 * Page size is 4 KB.
30712 * - 13 = 8 KB
30713 * Page size is 8 KB.
30714 * - 16 = 64 KB
30715 * Page size is 64 KB.
30716 * - 21 = 2 MB
30717 * Page size is 2 MB.
30718 * - 22 = 4 MB
30719 * Page size is 4 MB.
30720 * - 30 = 1 GB
30721 * Page size is 1 GB.
30722 */
30723 uint8_t page_size;
30724 /*
30725 * This value indicates the depth of page table.
30726 * For this version of the specification, value other than 0 or
30727 * 1 shall be considered as an invalid value.
30728 * When the page_tbl_depth = 0, then it is treated as a
30729 * special case with the following.
30730 * 1. FBO and page size fields are not valid.
30731 * 2. page_tbl_addr is the physical address of the first
30732 * element of the ring.
30733 */
30734 uint8_t page_tbl_depth;
30735 /* Used by a PF driver to associate a SCHQ with one of its TX rings. */
30736 uint16_t schq_id;
30737 /*
30738 * Number of 16B units in the ring. Minimum size for
30739 * a ring is 16 16B entries.
30740 */
30741 uint32_t length;
30742 /*
30743 * Logical ring number for the ring to be allocated.
30744 * This value determines the position in the doorbell
30745 * area where the update to the ring will be made.
30746 *
30747 * For completion rings, this value is also the MSI-X
30748 * vector number for the function the completion ring is
30749 * associated with.
30750 */
30751 uint16_t logical_id;
30752 /*
30753 * This field is used only when ring_type is a TX ring.
30754 * This value indicates what completion ring the TX ring
30755 * is associated with.
30756 */
30757 uint16_t cmpl_ring_id;
30758 /*
30759 * This field is used only when ring_type is a TX ring.
30760 * This value indicates what CoS queue the TX ring
30761 * is associated with.
30762 */
30763 uint16_t queue_id;
30764 /*
30765 * When allocating a Rx ring or Rx aggregation ring, this field
30766 * specifies the size of the buffer descriptors posted to the ring.
30767 */
30768 uint16_t rx_buf_size;
30769 /*
30770 * When allocating an Rx aggregation ring, this field
30771 * specifies the associated Rx ring ID.
30772 */
30773 uint16_t rx_ring_id;
30774 /*
30775 * When allocating a completion ring, this field
30776 * specifies the associated NQ ring ID.
30777 */
30778 uint16_t nq_ring_id;
30779 /*
30780 * This field is used only when ring_type is a TX ring.
30781 * This field is used to configure arbitration related
30782 * parameters for a TX ring.
30783 */
30784 uint16_t ring_arb_cfg;
30785 /* Arbitration policy used for the ring. */
30786 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_MASK UINT32_C(0xf)
30787 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SFT 0
30788 /*
30789 * Use strict priority for the TX ring.
30790 * Priority value is specified in arb_policy_param
30791 */
30792 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SP UINT32_C(0x1)
30793 /*
30794 * Use weighted fair queue arbitration for the TX ring.
30795 * Weight is specified in arb_policy_param
30796 */
30797 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ UINT32_C(0x2)
30798 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_LAST HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ
30799 /* Reserved field. */
30800 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_MASK UINT32_C(0xf0)
30801 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_SFT 4
30802 /*
30803 * Arbitration policy specific parameter.
30804 * # For strict priority arbitration policy, this field
30805 * represents a priority value. If set to 0, then the priority
30806 * is not specified and the HWRM is allowed to select
30807 * any priority for this TX ring.
30808 * # For weighted fair queue arbitration policy, this field
30809 * represents a weight value. If set to 0, then the weight
30810 * is not specified and the HWRM is allowed to select
30811 * any weight for this TX ring.
30812 */
30813 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_MASK UINT32_C(0xff00)
30814 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_SFT 8
30815 uint16_t unused_3;
30816 /*
30817 * This field is reserved for the future use.
30818 * It shall be set to 0.
30819 */
30820 uint32_t reserved3;
30821 /*
30822 * This field is used only when ring_type is a TX ring.
30823 * This input indicates what statistics context this ring
30824 * should be associated with.
30825 */
30826 uint32_t stat_ctx_id;
30827 /*
30828 * This field is reserved for the future use.
30829 * It shall be set to 0.
30830 */
30831 uint32_t reserved4;
30832 /*
30833 * This field is used only when ring_type is a TX ring
30834 * to specify maximum BW allocated to the TX ring.
30835 * The HWRM will translate this value into byte counter and
30836 * time interval used for this ring inside the device.
30837 */
30838 uint32_t max_bw;
30839 /* The bandwidth value. */
30840 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
30841 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_SFT 0
30842 /* The granularity of the value (bits or bytes). */
30843 #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE UINT32_C(0x10000000)
30844 /* Value is in bits. */
30845 #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
30846 /* Value is in bytes. */
30847 #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
30848 #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_LAST HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES
30849 /* bw_value_unit is 3 b */
30850 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
30851 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_SFT 29
30852 /* Value is in Mb or MB (base 10). */
30853 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
30854 /* Value is in Kb or KB (base 10). */
30855 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
30856 /* Value is in bits or bytes. */
30857 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
30858 /* Value is in Gb or GB (base 10). */
30859 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
30860 /* Value is in 1/100th of a percentage of total bandwidth. */
30861 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
30862 /* Invalid unit */
30863 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
30864 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_LAST HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
30865 /*
30866 * This field is used only when ring_type is a Completion ring.
30867 * This value indicates what interrupt mode should be used
30868 * on this completion ring.
30869 * Note: In the legacy interrupt mode, no more than 16
30870 * completion rings are allowed.
30871 */
30872 uint8_t int_mode;
30873 /* Legacy INTA */
30874 #define HWRM_RING_ALLOC_INPUT_INT_MODE_LEGACY UINT32_C(0x0)
30875 /* Reserved */
30876 #define HWRM_RING_ALLOC_INPUT_INT_MODE_RSVD UINT32_C(0x1)
30877 /* MSI-X */
30878 #define HWRM_RING_ALLOC_INPUT_INT_MODE_MSIX UINT32_C(0x2)
30879 /* No Interrupt - Polled mode */
30880 #define HWRM_RING_ALLOC_INPUT_INT_MODE_POLL UINT32_C(0x3)
30881 #define HWRM_RING_ALLOC_INPUT_INT_MODE_LAST HWRM_RING_ALLOC_INPUT_INT_MODE_POLL
30882 /* Midpath channel type */
30883 uint8_t mpc_chnls_type;
30884 /*
30885 * Indicate the TX ring alloc MPC channel type is a MPC channel
30886 * with destination to the TX crypto engine block.
30887 */
30888 #define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_TCE UINT32_C(0x0)
30889 /*
30890 * Indicate the RX ring alloc MPC channel type is a MPC channel
30891 * with destination to the RX crypto engine block.
30892 */
30893 #define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_RCE UINT32_C(0x1)
30894 /*
30895 * Indicate the RX ring alloc MPC channel type is a MPC channel
30896 * with destination to the TX configurable flow processing block.
30897 */
30898 #define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_TE_CFA UINT32_C(0x2)
30899 /*
30900 * Indicate the RX ring alloc MPC channel type is a MPC channel
30901 * with destination to the RX configurable flow processing block.
30902 */
30903 #define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_RE_CFA UINT32_C(0x3)
30904 /*
30905 * Indicate the RX ring alloc MPC channel type is a MPC channel
30906 * with destination to the primate processor block.
30907 */
30908 #define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_PRIMATE UINT32_C(0x4)
30909 #define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_LAST HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_PRIMATE
30910 uint8_t unused_4[2];
30911 /*
30912 * The cq_handle is specified when allocating a completion ring. For
30913 * devices that support NQs, this cq_handle will be included in the
30914 * NQE to specify which CQ should be read to retrieve the completion
30915 * record.
30916 */
30917 uint64_t cq_handle;
30918 } hwrm_ring_alloc_input_t, *phwrm_ring_alloc_input_t;
30919
30920 /* hwrm_ring_alloc_output (size:128b/16B) */
30921
30922 typedef struct hwrm_ring_alloc_output {
30923 /* The specific error status for the command. */
30924 uint16_t error_code;
30925 /* The HWRM command request type. */
30926 uint16_t req_type;
30927 /* The sequence ID from the original command. */
30928 uint16_t seq_id;
30929 /* The length of the response data in number of bytes. */
30930 uint16_t resp_len;
30931 /*
30932 * Physical number of ring allocated.
30933 * This value shall be unique for a ring type.
30934 */
30935 uint16_t ring_id;
30936 /* Logical number of ring allocated. */
30937 uint16_t logical_ring_id;
30938 /*
30939 * This field will tell whether to use ping or pong buffer
30940 * for first push operation.
30941 */
30942 uint8_t push_buffer_index;
30943 /* Start push from ping buffer index */
30944 #define HWRM_RING_ALLOC_OUTPUT_PUSH_BUFFER_INDEX_PING_BUFFER UINT32_C(0x0)
30945 /* Start push from pong buffer index */
30946 #define HWRM_RING_ALLOC_OUTPUT_PUSH_BUFFER_INDEX_PONG_BUFFER UINT32_C(0x1)
30947 #define HWRM_RING_ALLOC_OUTPUT_PUSH_BUFFER_INDEX_LAST HWRM_RING_ALLOC_OUTPUT_PUSH_BUFFER_INDEX_PONG_BUFFER
30948 uint8_t unused_0[2];
30949 /*
30950 * This field is used in Output records to indicate that the output
30951 * is completely written to RAM. This field should be read as '1'
30952 * to indicate that the output has been completely written.
30953 * When writing a command completion or response to an internal processor,
30954 * the order of writes has to be such that this field is written last.
30955 */
30956 uint8_t valid;
30957 } hwrm_ring_alloc_output_t, *phwrm_ring_alloc_output_t;
30958
30959 /******************
30960 * hwrm_ring_free *
30961 ******************/
30962
30963
30964 /* hwrm_ring_free_input (size:256b/32B) */
30965
30966 typedef struct hwrm_ring_free_input {
30967 /* The HWRM command request type. */
30968 uint16_t req_type;
30969 /*
30970 * The completion ring to send the completion event on. This should
30971 * be the NQ ID returned from the `nq_alloc` HWRM command.
30972 */
30973 uint16_t cmpl_ring;
30974 /*
30975 * The sequence ID is used by the driver for tracking multiple
30976 * commands. This ID is treated as opaque data by the firmware and
30977 * the value is returned in the `hwrm_resp_hdr` upon completion.
30978 */
30979 uint16_t seq_id;
30980 /*
30981 * The target ID of the command:
30982 * * 0x0-0xFFF8 - The function ID
30983 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30984 * * 0xFFFD - Reserved for user-space HWRM interface
30985 * * 0xFFFF - HWRM
30986 */
30987 uint16_t target_id;
30988 /*
30989 * A physical address pointer pointing to a host buffer that the
30990 * command's response data will be written. This can be either a host
30991 * physical address (HPA) or a guest physical address (GPA) and must
30992 * point to a physically contiguous block of memory.
30993 */
30994 uint64_t resp_addr;
30995 /* Ring Type. */
30996 uint8_t ring_type;
30997 /* L2 Completion Ring (CR) */
30998 #define HWRM_RING_FREE_INPUT_RING_TYPE_L2_CMPL UINT32_C(0x0)
30999 /* TX Ring (TR) */
31000 #define HWRM_RING_FREE_INPUT_RING_TYPE_TX UINT32_C(0x1)
31001 /* RX Ring (RR) */
31002 #define HWRM_RING_FREE_INPUT_RING_TYPE_RX UINT32_C(0x2)
31003 /* RoCE Notification Completion Ring (ROCE_CR) */
31004 #define HWRM_RING_FREE_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
31005 /* RX Aggregation Ring */
31006 #define HWRM_RING_FREE_INPUT_RING_TYPE_RX_AGG UINT32_C(0x4)
31007 /* Notification Queue */
31008 #define HWRM_RING_FREE_INPUT_RING_TYPE_NQ UINT32_C(0x5)
31009 #define HWRM_RING_FREE_INPUT_RING_TYPE_LAST HWRM_RING_FREE_INPUT_RING_TYPE_NQ
31010 uint8_t flags;
31011 /*
31012 * If this bit is set to '1', ring_id in this command belongs to
31013 * virtio function. prod_idx in this command corresponds to doorbell
31014 * producer index. opaque field in this command needs to be inserted
31015 * by firmware in VEE_FLUSH completion record.
31016 * Firmware will poll the corresponding ring context to reach the
31017 * given producer index before sending successful response. It will
31018 * finish the completion using VEE_FLUSH completion record.
31019 *
31020 * If this bit is '', firmware will not treat ring_id as virtio
31021 * ring and ignore prod_idx, opaque fields.
31022 *
31023 * This feature is not applicable for L2 or RoCE.
31024 */
31025 #define HWRM_RING_FREE_INPUT_FLAGS_VIRTIO_RING_VALID UINT32_C(0x1)
31026 #define HWRM_RING_FREE_INPUT_FLAGS_LAST HWRM_RING_FREE_INPUT_FLAGS_VIRTIO_RING_VALID
31027 /* Physical number of ring allocated. */
31028 uint16_t ring_id;
31029 /*
31030 * Ring BD producer index posted by the virtio block.
31031 * This field is valid if virtio_ring_valid flag is set.
31032 */
31033 uint32_t prod_idx;
31034 /*
31035 * User defined opaque field to be inserted into VEE_FLUSH completion
31036 * record. This field is valid if virtio_ring_valid flag is set.
31037 */
31038 uint32_t opaque;
31039 uint32_t unused_1;
31040 } hwrm_ring_free_input_t, *phwrm_ring_free_input_t;
31041
31042 /* hwrm_ring_free_output (size:128b/16B) */
31043
31044 typedef struct hwrm_ring_free_output {
31045 /* The specific error status for the command. */
31046 uint16_t error_code;
31047 /* The HWRM command request type. */
31048 uint16_t req_type;
31049 /* The sequence ID from the original command. */
31050 uint16_t seq_id;
31051 /* The length of the response data in number of bytes. */
31052 uint16_t resp_len;
31053 uint8_t unused_0[7];
31054 /*
31055 * This field is used in Output records to indicate that the output
31056 * is completely written to RAM. This field should be read as '1'
31057 * to indicate that the output has been completely written.
31058 * When writing a command completion or response to an internal processor,
31059 * the order of writes has to be such that this field is written last.
31060 */
31061 uint8_t valid;
31062 } hwrm_ring_free_output_t, *phwrm_ring_free_output_t;
31063
31064 /*******************
31065 * hwrm_ring_reset *
31066 *******************/
31067
31068
31069 /* hwrm_ring_reset_input (size:192b/24B) */
31070
31071 typedef struct hwrm_ring_reset_input {
31072 /* The HWRM command request type. */
31073 uint16_t req_type;
31074 /*
31075 * The completion ring to send the completion event on. This should
31076 * be the NQ ID returned from the `nq_alloc` HWRM command.
31077 */
31078 uint16_t cmpl_ring;
31079 /*
31080 * The sequence ID is used by the driver for tracking multiple
31081 * commands. This ID is treated as opaque data by the firmware and
31082 * the value is returned in the `hwrm_resp_hdr` upon completion.
31083 */
31084 uint16_t seq_id;
31085 /*
31086 * The target ID of the command:
31087 * * 0x0-0xFFF8 - The function ID
31088 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31089 * * 0xFFFD - Reserved for user-space HWRM interface
31090 * * 0xFFFF - HWRM
31091 */
31092 uint16_t target_id;
31093 /*
31094 * A physical address pointer pointing to a host buffer that the
31095 * command's response data will be written. This can be either a host
31096 * physical address (HPA) or a guest physical address (GPA) and must
31097 * point to a physically contiguous block of memory.
31098 */
31099 uint64_t resp_addr;
31100 /* Ring Type. */
31101 uint8_t ring_type;
31102 /* L2 Completion Ring (CR) */
31103 #define HWRM_RING_RESET_INPUT_RING_TYPE_L2_CMPL UINT32_C(0x0)
31104 /* TX Ring (TR) */
31105 #define HWRM_RING_RESET_INPUT_RING_TYPE_TX UINT32_C(0x1)
31106 /* RX Ring (RR) */
31107 #define HWRM_RING_RESET_INPUT_RING_TYPE_RX UINT32_C(0x2)
31108 /* RoCE Notification Completion Ring (ROCE_CR) */
31109 #define HWRM_RING_RESET_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
31110 /*
31111 * Rx Ring Group. This is to reset rx and aggregation in an atomic
31112 * operation. Completion ring associated with this ring group is
31113 * not reset.
31114 */
31115 #define HWRM_RING_RESET_INPUT_RING_TYPE_RX_RING_GRP UINT32_C(0x6)
31116 #define HWRM_RING_RESET_INPUT_RING_TYPE_LAST HWRM_RING_RESET_INPUT_RING_TYPE_RX_RING_GRP
31117 uint8_t unused_0;
31118 /*
31119 * Physical number of the ring. When ring type is rx_ring_grp, ring id
31120 * actually refers to ring group id.
31121 */
31122 uint16_t ring_id;
31123 uint8_t unused_1[4];
31124 } hwrm_ring_reset_input_t, *phwrm_ring_reset_input_t;
31125
31126 /* hwrm_ring_reset_output (size:128b/16B) */
31127
31128 typedef struct hwrm_ring_reset_output {
31129 /* The specific error status for the command. */
31130 uint16_t error_code;
31131 /* The HWRM command request type. */
31132 uint16_t req_type;
31133 /* The sequence ID from the original command. */
31134 uint16_t seq_id;
31135 /* The length of the response data in number of bytes. */
31136 uint16_t resp_len;
31137 /*
31138 * This field will tell whether to use ping or pong buffer
31139 * for first push operation.
31140 */
31141 uint8_t push_buffer_index;
31142 /* Start push from ping buffer index */
31143 #define HWRM_RING_RESET_OUTPUT_PUSH_BUFFER_INDEX_PING_BUFFER UINT32_C(0x0)
31144 /* Start push from pong buffer index */
31145 #define HWRM_RING_RESET_OUTPUT_PUSH_BUFFER_INDEX_PONG_BUFFER UINT32_C(0x1)
31146 #define HWRM_RING_RESET_OUTPUT_PUSH_BUFFER_INDEX_LAST HWRM_RING_RESET_OUTPUT_PUSH_BUFFER_INDEX_PONG_BUFFER
31147 uint8_t unused_0[3];
31148 /* Position of consumer index after ring reset completes. */
31149 uint8_t consumer_idx[3];
31150 /*
31151 * This field is used in Output records to indicate that the output
31152 * is completely written to RAM. This field should be read as '1'
31153 * to indicate that the output has been completely written.
31154 * When writing a command completion or response to an internal processor,
31155 * the order of writes has to be such that this field is written last.
31156 */
31157 uint8_t valid;
31158 } hwrm_ring_reset_output_t, *phwrm_ring_reset_output_t;
31159
31160 /*****************
31161 * hwrm_ring_cfg *
31162 *****************/
31163
31164
31165 /* hwrm_ring_cfg_input (size:320b/40B) */
31166
31167 typedef struct hwrm_ring_cfg_input {
31168 /* The HWRM command request type. */
31169 uint16_t req_type;
31170 /*
31171 * The completion ring to send the completion event on. This should
31172 * be the NQ ID returned from the `nq_alloc` HWRM command.
31173 */
31174 uint16_t cmpl_ring;
31175 /*
31176 * The sequence ID is used by the driver for tracking multiple
31177 * commands. This ID is treated as opaque data by the firmware and
31178 * the value is returned in the `hwrm_resp_hdr` upon completion.
31179 */
31180 uint16_t seq_id;
31181 /*
31182 * The target ID of the command:
31183 * * 0x0-0xFFF8 - The function ID
31184 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31185 * * 0xFFFD - Reserved for user-space HWRM interface
31186 * * 0xFFFF - HWRM
31187 */
31188 uint16_t target_id;
31189 /*
31190 * A physical address pointer pointing to a host buffer that the
31191 * command's response data will be written. This can be either a host
31192 * physical address (HPA) or a guest physical address (GPA) and must
31193 * point to a physically contiguous block of memory.
31194 */
31195 uint64_t resp_addr;
31196 /* Ring Type. */
31197 uint8_t ring_type;
31198 /* TX Ring (TR) */
31199 #define HWRM_RING_CFG_INPUT_RING_TYPE_TX UINT32_C(0x1)
31200 /* RX Ring (RR) */
31201 #define HWRM_RING_CFG_INPUT_RING_TYPE_RX UINT32_C(0x2)
31202 #define HWRM_RING_CFG_INPUT_RING_TYPE_LAST HWRM_RING_CFG_INPUT_RING_TYPE_RX
31203 uint8_t unused_0;
31204 /* Physical number of the ring. */
31205 uint16_t ring_id;
31206 /* Ring config enable bits. */
31207 uint16_t enables;
31208 /*
31209 * For Rx rings, the incoming packet data can be placed at either
31210 * a 0B, 2B, 10B or 12B offset from the start of the Rx packet
31211 * buffer.
31212 * When '1', the received packet will be padded with 2B, 10B or 12B
31213 * of zeros at the front of the packet. The exact offset is specified
31214 * by rx_sop_pad_bytes parameter.
31215 * When '', the received packet will not be padded.
31216 * Note that this flag is only used for Rx rings and is ignored
31217 * for all other rings included Rx Aggregation rings.
31218 */
31219 #define HWRM_RING_CFG_INPUT_ENABLES_RX_SOP_PAD_ENABLE UINT32_C(0x1)
31220 /*
31221 * Proxy mode enable, for Tx, Rx and Rx aggregation rings only.
31222 * When rings are allocated, the PCI function on which driver issues
31223 * HWRM_RING_CFG command is assumed to own the rings. Hardware takes
31224 * the buffer descriptors (BDs) from those rings is assumed to issue
31225 * packet payload DMA using same PCI function. When proxy mode is
31226 * enabled, hardware can perform payload DMA using another PCI
31227 * function on same or different host.
31228 * When set to '', the PCI function on which driver issues
31229 * HWRM_RING_CFG command is used for host payload DMA operation.
31230 * When set to '1', the host PCI function specified by proxy_fid is
31231 * used for host payload DMA operation.
31232 */
31233 #define HWRM_RING_CFG_INPUT_ENABLES_PROXY_MODE_ENABLE UINT32_C(0x2)
31234 /*
31235 * Tx ring packet source interface override, for Tx rings only.
31236 * When TX rings are allocated, the PCI function on which driver
31237 * issues HWRM_RING_CFG is assumed to be source interface of
31238 * packets sent from TX ring.
31239 * When set to '1', the host PCI function specified by proxy_fid
31240 * is used as source interface of the transmitted packets.
31241 */
31242 #define HWRM_RING_CFG_INPUT_ENABLES_TX_PROXY_SRC_INTF_OVERRIDE UINT32_C(0x4)
31243 /* The schq_id field is valid */
31244 #define HWRM_RING_CFG_INPUT_ENABLES_SCHQ_ID UINT32_C(0x8)
31245 /* Update completion ring ID associated with Tx or Rx ring. */
31246 #define HWRM_RING_CFG_INPUT_ENABLES_CMPL_RING_ID_UPDATE UINT32_C(0x10)
31247 /*
31248 * When set to '1', metadata value provided by tx_metadata
31249 * field in this command is inserted in the lb_header_metadata
31250 * QP context field. When set to '', no change done to metadata.
31251 * Firmware rejects the tx ring metadata programming with
31252 * HWRM_ERR_CODE_UNSUPPORTED error if the per function CFA BD
31253 * metadata feature is not disabled.
31254 */
31255 #define HWRM_RING_CFG_INPUT_ENABLES_TX_METADATA UINT32_C(0x20)
31256 /*
31257 * Proxy function FID value.
31258 * This value is only used when either proxy_mode_enable flag or
31259 * tx_proxy_svif_override is set to '1'.
31260 * When proxy_mode_enable is set to '1', it identifies a host PCI
31261 * function used for host payload DMA operations.
31262 * When tx_proxy_src_intf is set to '1', it identifies a host PCI
31263 * function as source interface for all transmitted packets from
31264 * the TX ring.
31265 */
31266 uint16_t proxy_fid;
31267 /*
31268 * Identifies the new scheduler queue (SCHQ) to associate with the
31269 * ring. Only valid for Tx rings.
31270 * A value of zero indicates that the Tx ring should be associated
31271 * with the default scheduler queue (SCHQ).
31272 */
31273 uint16_t schq_id;
31274 /*
31275 * This field is valid for TX or Rx rings. This value identifies the
31276 * new completion ring ID to associate with the TX or Rx ring.
31277 */
31278 uint16_t cmpl_ring_id;
31279 /*
31280 * Rx SOP padding amount in bytes.
31281 * This value is only used when rx_sop_pad_enable flag is set to '1'.
31282 */
31283 uint8_t rx_sop_pad_bytes;
31284 uint8_t unused_1[3];
31285 /*
31286 * When tx_metadata enable bit is set, value specified in this field
31287 * is copied to lb_header_metadata in the QP context.
31288 */
31289 uint32_t tx_metadata;
31290 uint8_t unused_2[4];
31291 } hwrm_ring_cfg_input_t, *phwrm_ring_cfg_input_t;
31292
31293 /* hwrm_ring_cfg_output (size:128b/16B) */
31294
31295 typedef struct hwrm_ring_cfg_output {
31296 /* The specific error status for the command. */
31297 uint16_t error_code;
31298 /* The HWRM command request type. */
31299 uint16_t req_type;
31300 /* The sequence ID from the original command. */
31301 uint16_t seq_id;
31302 /* The length of the response data in number of bytes. */
31303 uint16_t resp_len;
31304 uint8_t unused_0[7];
31305 /*
31306 * This field is used in Output records to indicate that the output
31307 * is completely written to RAM. This field should be read as '1'
31308 * to indicate that the output has been completely written.
31309 * When writing a command completion or response to an internal
31310 * processor, the order of writes has to be such that this field is
31311 * written last.
31312 */
31313 uint8_t valid;
31314 } hwrm_ring_cfg_output_t, *phwrm_ring_cfg_output_t;
31315
31316 /******************
31317 * hwrm_ring_qcfg *
31318 ******************/
31319
31320
31321 /* hwrm_ring_qcfg_input (size:192b/24B) */
31322
31323 typedef struct hwrm_ring_qcfg_input {
31324 /* The HWRM command request type. */
31325 uint16_t req_type;
31326 /*
31327 * The completion ring to send the completion event on. This should
31328 * be the NQ ID returned from the `nq_alloc` HWRM command.
31329 */
31330 uint16_t cmpl_ring;
31331 /*
31332 * The sequence ID is used by the driver for tracking multiple
31333 * commands. This ID is treated as opaque data by the firmware and
31334 * the value is returned in the `hwrm_resp_hdr` upon completion.
31335 */
31336 uint16_t seq_id;
31337 /*
31338 * The target ID of the command:
31339 * * 0x0-0xFFF8 - The function ID
31340 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31341 * * 0xFFFD - Reserved for user-space HWRM interface
31342 * * 0xFFFF - HWRM
31343 */
31344 uint16_t target_id;
31345 /*
31346 * A physical address pointer pointing to a host buffer that the
31347 * command's response data will be written. This can be either a host
31348 * physical address (HPA) or a guest physical address (GPA) and must
31349 * point to a physically contiguous block of memory.
31350 */
31351 uint64_t resp_addr;
31352 /* Ring Type. */
31353 uint8_t ring_type;
31354 /* TX Ring (TR) */
31355 #define HWRM_RING_QCFG_INPUT_RING_TYPE_TX UINT32_C(0x1)
31356 /* RX Ring (RR) */
31357 #define HWRM_RING_QCFG_INPUT_RING_TYPE_RX UINT32_C(0x2)
31358 #define HWRM_RING_QCFG_INPUT_RING_TYPE_LAST HWRM_RING_QCFG_INPUT_RING_TYPE_RX
31359 uint8_t unused_0[5];
31360 /* Physical number of the ring. */
31361 uint16_t ring_id;
31362 } hwrm_ring_qcfg_input_t, *phwrm_ring_qcfg_input_t;
31363
31364 /* hwrm_ring_qcfg_output (size:256b/32B) */
31365
31366 typedef struct hwrm_ring_qcfg_output {
31367 /* The specific error status for the command. */
31368 uint16_t error_code;
31369 /* The HWRM command request type. */
31370 uint16_t req_type;
31371 /* The sequence ID from the original command. */
31372 uint16_t seq_id;
31373 /* The length of the response data in number of bytes. */
31374 uint16_t resp_len;
31375 /* Ring config enable bits. */
31376 uint16_t enables;
31377 /*
31378 * For Rx rings, the incoming packet data can be placed at either
31379 * a 0B, 2B, 10B or 12B offset from the start of the Rx packet
31380 * buffer.
31381 * When '1', the received packet will be padded with 2B, 10B or 12B
31382 * of zeros at the front of the packet. The exact offset is specified
31383 * by rx_sop_pad_bytes parameter.
31384 * When '', the received packet will not be padded.
31385 * Note that this flag is only used for Rx rings and is ignored
31386 * for all other rings included Rx Aggregation rings.
31387 */
31388 #define HWRM_RING_QCFG_OUTPUT_ENABLES_RX_SOP_PAD_ENABLE UINT32_C(0x1)
31389 /*
31390 * Proxy mode enable, for Tx, Rx and Rx aggregation rings only.
31391 * When rings are allocated, the PCI function on which driver issues
31392 * HWRM_RING_CFG command is assumed to own the rings. Hardware takes
31393 * the buffer descriptors (BDs) from those rings is assumed to issue
31394 * packet payload DMA using same PCI function. When proxy mode is
31395 * enabled, hardware can perform payload DMA using another PCI
31396 * function on same or different host.
31397 * When set to '', the PCI function on which driver issues
31398 * HWRM_RING_CFG command is used for host payload DMA operation.
31399 * When set to '1', the host PCI function specified by proxy_fid is
31400 * used for host payload DMA operation.
31401 */
31402 #define HWRM_RING_QCFG_OUTPUT_ENABLES_PROXY_MODE_ENABLE UINT32_C(0x2)
31403 /*
31404 * Tx ring packet source interface override, for Tx rings only.
31405 * When TX rings are allocated, the PCI function on which driver
31406 * issues HWRM_RING_CFG is assumed to be source interface of
31407 * packets sent from TX ring.
31408 * When set to '1', the host PCI function specified by proxy_fid is
31409 * used as source interface of the transmitted packets.
31410 */
31411 #define HWRM_RING_QCFG_OUTPUT_ENABLES_TX_PROXY_SRC_INTF_OVERRIDE UINT32_C(0x4)
31412 /*
31413 * Proxy function FID value.
31414 * This value is only used when either proxy_mode_enable flag or
31415 * tx_proxy_svif_override is set to '1'.
31416 * When proxy_mode_enable is set to '1', it identifies a host PCI
31417 * function used for host payload DMA operations.
31418 * When tx_proxy_src_intf is set to '1', it identifies a host PCI
31419 * function as source interface for all transmitted packets from the TX
31420 * ring.
31421 */
31422 uint16_t proxy_fid;
31423 /*
31424 * Identifies the new scheduler queue (SCHQ) to associate with the
31425 * ring. Only valid for Tx rings.
31426 * A value of zero indicates that the Tx ring should be associated with
31427 * the default scheduler queue (SCHQ).
31428 */
31429 uint16_t schq_id;
31430 /*
31431 * This field is used when ring_type is a TX or Rx ring.
31432 * This value indicates what completion ring the TX or Rx ring
31433 * is associated with.
31434 */
31435 uint16_t cmpl_ring_id;
31436 /*
31437 * Rx SOP padding amount in bytes.
31438 * This value is only used when rx_sop_pad_enable flag is set to '1'.
31439 */
31440 uint8_t rx_sop_pad_bytes;
31441 uint8_t unused_0[3];
31442 /* lb_header_metadata in the QP context is copied to this field. */
31443 uint32_t tx_metadata;
31444 uint8_t unused_1[7];
31445 /*
31446 * This field is used in Output records to indicate that the output
31447 * is completely written to RAM. This field should be read as '1'
31448 * to indicate that the output has been completely written.
31449 * When writing a command completion or response to an internal
31450 * processor, the order of writes has to be such that this field is
31451 * written last.
31452 */
31453 uint8_t valid;
31454 } hwrm_ring_qcfg_output_t, *phwrm_ring_qcfg_output_t;
31455
31456 /**************************
31457 * hwrm_ring_aggint_qcaps *
31458 **************************/
31459
31460
31461 /* hwrm_ring_aggint_qcaps_input (size:128b/16B) */
31462
31463 typedef struct hwrm_ring_aggint_qcaps_input {
31464 /* The HWRM command request type. */
31465 uint16_t req_type;
31466 /*
31467 * The completion ring to send the completion event on. This should
31468 * be the NQ ID returned from the `nq_alloc` HWRM command.
31469 */
31470 uint16_t cmpl_ring;
31471 /*
31472 * The sequence ID is used by the driver for tracking multiple
31473 * commands. This ID is treated as opaque data by the firmware and
31474 * the value is returned in the `hwrm_resp_hdr` upon completion.
31475 */
31476 uint16_t seq_id;
31477 /*
31478 * The target ID of the command:
31479 * * 0x0-0xFFF8 - The function ID
31480 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31481 * * 0xFFFD - Reserved for user-space HWRM interface
31482 * * 0xFFFF - HWRM
31483 */
31484 uint16_t target_id;
31485 /*
31486 * A physical address pointer pointing to a host buffer that the
31487 * command's response data will be written. This can be either a host
31488 * physical address (HPA) or a guest physical address (GPA) and must
31489 * point to a physically contiguous block of memory.
31490 */
31491 uint64_t resp_addr;
31492 } hwrm_ring_aggint_qcaps_input_t, *phwrm_ring_aggint_qcaps_input_t;
31493
31494 /* hwrm_ring_aggint_qcaps_output (size:384b/48B) */
31495
31496 typedef struct hwrm_ring_aggint_qcaps_output {
31497 /* The specific error status for the command. */
31498 uint16_t error_code;
31499 /* The HWRM command request type. */
31500 uint16_t req_type;
31501 /* The sequence ID from the original command. */
31502 uint16_t seq_id;
31503 /* The length of the response data in number of bytes. */
31504 uint16_t resp_len;
31505 uint32_t cmpl_params;
31506 /*
31507 * When this bit is set to '1', int_lat_tmr_min can be configured
31508 * on completion rings.
31509 */
31510 #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_INT_LAT_TMR_MIN UINT32_C(0x1)
31511 /*
31512 * When this bit is set to '1', int_lat_tmr_max can be configured
31513 * on completion rings.
31514 */
31515 #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_INT_LAT_TMR_MAX UINT32_C(0x2)
31516 /*
31517 * When this bit is set to '1', timer_reset can be enabled
31518 * on completion rings.
31519 */
31520 #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_TIMER_RESET UINT32_C(0x4)
31521 /*
31522 * When this bit is set to '1', ring_idle can be enabled
31523 * on completion rings.
31524 */
31525 #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_RING_IDLE UINT32_C(0x8)
31526 /*
31527 * When this bit is set to '1', num_cmpl_dma_aggr can be configured
31528 * on completion rings.
31529 */
31530 #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_DMA_AGGR UINT32_C(0x10)
31531 /*
31532 * When this bit is set to '1', num_cmpl_dma_aggr_during_int can be configured
31533 * on completion rings.
31534 */
31535 #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_DMA_AGGR_DURING_INT UINT32_C(0x20)
31536 /*
31537 * When this bit is set to '1', cmpl_aggr_dma_tmr can be configured
31538 * on completion rings.
31539 */
31540 #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_CMPL_AGGR_DMA_TMR UINT32_C(0x40)
31541 /*
31542 * When this bit is set to '1', cmpl_aggr_dma_tmr_during_int can be configured
31543 * on completion rings.
31544 */
31545 #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_CMPL_AGGR_DMA_TMR_DURING_INT UINT32_C(0x80)
31546 /*
31547 * When this bit is set to '1', num_cmpl_aggr_int can be configured
31548 * on completion rings.
31549 */
31550 #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_AGGR_INT UINT32_C(0x100)
31551 uint32_t nq_params;
31552 /*
31553 * When this bit is set to '1', int_lat_tmr_min can be configured
31554 * on notification queues.
31555 */
31556 #define HWRM_RING_AGGINT_QCAPS_OUTPUT_NQ_PARAMS_INT_LAT_TMR_MIN UINT32_C(0x1)
31557 /* Minimum value for num_cmpl_dma_aggr */
31558 uint16_t num_cmpl_dma_aggr_min;
31559 /* Maximum value for num_cmpl_dma_aggr */
31560 uint16_t num_cmpl_dma_aggr_max;
31561 /* Minimum value for num_cmpl_dma_aggr_during_int */
31562 uint16_t num_cmpl_dma_aggr_during_int_min;
31563 /* Maximum value for num_cmpl_dma_aggr_during_int */
31564 uint16_t num_cmpl_dma_aggr_during_int_max;
31565 /* Minimum value for cmpl_aggr_dma_tmr */
31566 uint16_t cmpl_aggr_dma_tmr_min;
31567 /* Maximum value for cmpl_aggr_dma_tmr */
31568 uint16_t cmpl_aggr_dma_tmr_max;
31569 /* Minimum value for cmpl_aggr_dma_tmr_during_int */
31570 uint16_t cmpl_aggr_dma_tmr_during_int_min;
31571 /* Maximum value for cmpl_aggr_dma_tmr_during_int */
31572 uint16_t cmpl_aggr_dma_tmr_during_int_max;
31573 /* Minimum value for int_lat_tmr_min */
31574 uint16_t int_lat_tmr_min_min;
31575 /* Maximum value for int_lat_tmr_min */
31576 uint16_t int_lat_tmr_min_max;
31577 /* Minimum value for int_lat_tmr_max */
31578 uint16_t int_lat_tmr_max_min;
31579 /* Maximum value for int_lat_tmr_max */
31580 uint16_t int_lat_tmr_max_max;
31581 /* Minimum value for num_cmpl_aggr_int */
31582 uint16_t num_cmpl_aggr_int_min;
31583 /* Maximum value for num_cmpl_aggr_int */
31584 uint16_t num_cmpl_aggr_int_max;
31585 /* The units for timer parameters, in nanoseconds. */
31586 uint16_t timer_units;
31587 uint8_t unused_0[1];
31588 /*
31589 * This field is used in Output records to indicate that the output
31590 * is completely written to RAM. This field should be read as '1'
31591 * to indicate that the output has been completely written.
31592 * When writing a command completion or response to an internal processor,
31593 * the order of writes has to be such that this field is written last.
31594 */
31595 uint8_t valid;
31596 } hwrm_ring_aggint_qcaps_output_t, *phwrm_ring_aggint_qcaps_output_t;
31597
31598 /**************************************
31599 * hwrm_ring_cmpl_ring_qaggint_params *
31600 **************************************/
31601
31602
31603 /* hwrm_ring_cmpl_ring_qaggint_params_input (size:192b/24B) */
31604
31605 typedef struct hwrm_ring_cmpl_ring_qaggint_params_input {
31606 /* The HWRM command request type. */
31607 uint16_t req_type;
31608 /*
31609 * The completion ring to send the completion event on. This should
31610 * be the NQ ID returned from the `nq_alloc` HWRM command.
31611 */
31612 uint16_t cmpl_ring;
31613 /*
31614 * The sequence ID is used by the driver for tracking multiple
31615 * commands. This ID is treated as opaque data by the firmware and
31616 * the value is returned in the `hwrm_resp_hdr` upon completion.
31617 */
31618 uint16_t seq_id;
31619 /*
31620 * The target ID of the command:
31621 * * 0x0-0xFFF8 - The function ID
31622 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31623 * * 0xFFFD - Reserved for user-space HWRM interface
31624 * * 0xFFFF - HWRM
31625 */
31626 uint16_t target_id;
31627 /*
31628 * A physical address pointer pointing to a host buffer that the
31629 * command's response data will be written. This can be either a host
31630 * physical address (HPA) or a guest physical address (GPA) and must
31631 * point to a physically contiguous block of memory.
31632 */
31633 uint64_t resp_addr;
31634 /* Physical number of completion ring. */
31635 uint16_t ring_id;
31636 uint16_t flags;
31637 #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_INPUT_FLAGS_UNUSED_0_MASK UINT32_C(0x3)
31638 #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_INPUT_FLAGS_UNUSED_0_SFT 0
31639 /*
31640 * Set this flag to 1 when querying parameters on a notification
31641 * queue. Set this flag to 0 when querying parameters on a
31642 * completion queue or completion ring.
31643 */
31644 #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_INPUT_FLAGS_IS_NQ UINT32_C(0x4)
31645 uint8_t unused_0[4];
31646 } hwrm_ring_cmpl_ring_qaggint_params_input_t, *phwrm_ring_cmpl_ring_qaggint_params_input_t;
31647
31648 /* hwrm_ring_cmpl_ring_qaggint_params_output (size:256b/32B) */
31649
31650 typedef struct hwrm_ring_cmpl_ring_qaggint_params_output {
31651 /* The specific error status for the command. */
31652 uint16_t error_code;
31653 /* The HWRM command request type. */
31654 uint16_t req_type;
31655 /* The sequence ID from the original command. */
31656 uint16_t seq_id;
31657 /* The length of the response data in number of bytes. */
31658 uint16_t resp_len;
31659 uint16_t flags;
31660 /*
31661 * When this bit is set to '1', interrupt max
31662 * timer is reset whenever a completion is received.
31663 */
31664 #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_TIMER_RESET UINT32_C(0x1)
31665 /*
31666 * When this bit is set to '1', ring idle mode
31667 * aggregation will be enabled.
31668 */
31669 #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_RING_IDLE UINT32_C(0x2)
31670 /*
31671 * Number of completions to aggregate before DMA
31672 * during the normal mode.
31673 */
31674 uint16_t num_cmpl_dma_aggr;
31675 /*
31676 * Number of completions to aggregate before DMA
31677 * during the interrupt mode.
31678 */
31679 uint16_t num_cmpl_dma_aggr_during_int;
31680 /*
31681 * Timer used to aggregate completions before
31682 * DMA during the normal mode (not in interrupt mode).
31683 */
31684 uint16_t cmpl_aggr_dma_tmr;
31685 /*
31686 * Timer used to aggregate completions before
31687 * DMA when in interrupt mode.
31688 */
31689 uint16_t cmpl_aggr_dma_tmr_during_int;
31690 /* Minimum time between two interrupts. */
31691 uint16_t int_lat_tmr_min;
31692 /*
31693 * Maximum wait time spent aggregating
31694 * completions before signaling the interrupt after the
31695 * interrupt is enabled.
31696 */
31697 uint16_t int_lat_tmr_max;
31698 /*
31699 * Minimum number of completions aggregated before signaling
31700 * an interrupt.
31701 */
31702 uint16_t num_cmpl_aggr_int;
31703 uint8_t unused_0[7];
31704 /*
31705 * This field is used in Output records to indicate that the output
31706 * is completely written to RAM. This field should be read as '1'
31707 * to indicate that the output has been completely written.
31708 * When writing a command completion or response to an internal processor,
31709 * the order of writes has to be such that this field is written last.
31710 */
31711 uint8_t valid;
31712 } hwrm_ring_cmpl_ring_qaggint_params_output_t, *phwrm_ring_cmpl_ring_qaggint_params_output_t;
31713
31714 /*****************************************
31715 * hwrm_ring_cmpl_ring_cfg_aggint_params *
31716 *****************************************/
31717
31718
31719 /* hwrm_ring_cmpl_ring_cfg_aggint_params_input (size:320b/40B) */
31720
31721 typedef struct hwrm_ring_cmpl_ring_cfg_aggint_params_input {
31722 /* The HWRM command request type. */
31723 uint16_t req_type;
31724 /*
31725 * The completion ring to send the completion event on. This should
31726 * be the NQ ID returned from the `nq_alloc` HWRM command.
31727 */
31728 uint16_t cmpl_ring;
31729 /*
31730 * The sequence ID is used by the driver for tracking multiple
31731 * commands. This ID is treated as opaque data by the firmware and
31732 * the value is returned in the `hwrm_resp_hdr` upon completion.
31733 */
31734 uint16_t seq_id;
31735 /*
31736 * The target ID of the command:
31737 * * 0x0-0xFFF8 - The function ID
31738 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31739 * * 0xFFFD - Reserved for user-space HWRM interface
31740 * * 0xFFFF - HWRM
31741 */
31742 uint16_t target_id;
31743 /*
31744 * A physical address pointer pointing to a host buffer that the
31745 * command's response data will be written. This can be either a host
31746 * physical address (HPA) or a guest physical address (GPA) and must
31747 * point to a physically contiguous block of memory.
31748 */
31749 uint64_t resp_addr;
31750 /* Physical number of completion ring. */
31751 uint16_t ring_id;
31752 uint16_t flags;
31753 /*
31754 * When this bit is set to '1', interrupt latency max
31755 * timer is reset whenever a completion is received.
31756 */
31757 #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_TIMER_RESET UINT32_C(0x1)
31758 /*
31759 * When this bit is set to '1', ring idle mode
31760 * aggregation will be enabled.
31761 */
31762 #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_RING_IDLE UINT32_C(0x2)
31763 /*
31764 * Set this flag to 1 when configuring parameters on a
31765 * notification queue. Set this flag to 0 when configuring
31766 * parameters on a completion queue or completion ring.
31767 */
31768 #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_IS_NQ UINT32_C(0x4)
31769 /*
31770 * Number of completions to aggregate before DMA
31771 * during the normal mode.
31772 */
31773 uint16_t num_cmpl_dma_aggr;
31774 /*
31775 * Number of completions to aggregate before DMA
31776 * during the interrupt mode.
31777 */
31778 uint16_t num_cmpl_dma_aggr_during_int;
31779 /*
31780 * Timer used to aggregate completions before
31781 * DMA during the normal mode (not in interrupt mode).
31782 */
31783 uint16_t cmpl_aggr_dma_tmr;
31784 /*
31785 * Timer used to aggregate completions before
31786 * DMA while in interrupt mode.
31787 */
31788 uint16_t cmpl_aggr_dma_tmr_during_int;
31789 /* Minimum time between two interrupts. */
31790 uint16_t int_lat_tmr_min;
31791 /*
31792 * Maximum wait time spent aggregating
31793 * completions before signaling the interrupt after the
31794 * interrupt is enabled.
31795 */
31796 uint16_t int_lat_tmr_max;
31797 /*
31798 * Minimum number of completions aggregated before signaling
31799 * an interrupt.
31800 */
31801 uint16_t num_cmpl_aggr_int;
31802 /*
31803 * Bitfield that indicates which parameters are to be applied. Only
31804 * required when configuring devices with notification queues, and
31805 * used in that case to set certain parameters on completion queues
31806 * and others on notification queues.
31807 */
31808 uint16_t enables;
31809 /*
31810 * This bit must be '1' for the num_cmpl_dma_aggr field to be
31811 * configured.
31812 */
31813 #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR UINT32_C(0x1)
31814 /*
31815 * This bit must be '1' for the num_cmpl_dma_aggr_during_int field to be
31816 * configured.
31817 */
31818 #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR_DURING_INT UINT32_C(0x2)
31819 /*
31820 * This bit must be '1' for the cmpl_aggr_dma_tmr field to be
31821 * configured.
31822 */
31823 #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_CMPL_AGGR_DMA_TMR UINT32_C(0x4)
31824 /*
31825 * This bit must be '1' for the int_lat_tmr_min field to be
31826 * configured.
31827 */
31828 #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_INT_LAT_TMR_MIN UINT32_C(0x8)
31829 /*
31830 * This bit must be '1' for the int_lat_tmr_max field to be
31831 * configured.
31832 */
31833 #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_INT_LAT_TMR_MAX UINT32_C(0x10)
31834 /*
31835 * This bit must be '1' for the num_cmpl_aggr_int field to be
31836 * configured.
31837 */
31838 #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_AGGR_INT UINT32_C(0x20)
31839 uint8_t unused_0[4];
31840 } hwrm_ring_cmpl_ring_cfg_aggint_params_input_t, *phwrm_ring_cmpl_ring_cfg_aggint_params_input_t;
31841
31842 /* hwrm_ring_cmpl_ring_cfg_aggint_params_output (size:128b/16B) */
31843
31844 typedef struct hwrm_ring_cmpl_ring_cfg_aggint_params_output {
31845 /* The specific error status for the command. */
31846 uint16_t error_code;
31847 /* The HWRM command request type. */
31848 uint16_t req_type;
31849 /* The sequence ID from the original command. */
31850 uint16_t seq_id;
31851 /* The length of the response data in number of bytes. */
31852 uint16_t resp_len;
31853 uint8_t unused_0[7];
31854 /*
31855 * This field is used in Output records to indicate that the output
31856 * is completely written to RAM. This field should be read as '1'
31857 * to indicate that the output has been completely written.
31858 * When writing a command completion or response to an internal processor,
31859 * the order of writes has to be such that this field is written last.
31860 */
31861 uint8_t valid;
31862 } hwrm_ring_cmpl_ring_cfg_aggint_params_output_t, *phwrm_ring_cmpl_ring_cfg_aggint_params_output_t;
31863
31864 /***********************
31865 * hwrm_ring_grp_alloc *
31866 ***********************/
31867
31868
31869 /* hwrm_ring_grp_alloc_input (size:192b/24B) */
31870
31871 typedef struct hwrm_ring_grp_alloc_input {
31872 /* The HWRM command request type. */
31873 uint16_t req_type;
31874 /*
31875 * The completion ring to send the completion event on. This should
31876 * be the NQ ID returned from the `nq_alloc` HWRM command.
31877 */
31878 uint16_t cmpl_ring;
31879 /*
31880 * The sequence ID is used by the driver for tracking multiple
31881 * commands. This ID is treated as opaque data by the firmware and
31882 * the value is returned in the `hwrm_resp_hdr` upon completion.
31883 */
31884 uint16_t seq_id;
31885 /*
31886 * The target ID of the command:
31887 * * 0x0-0xFFF8 - The function ID
31888 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31889 * * 0xFFFD - Reserved for user-space HWRM interface
31890 * * 0xFFFF - HWRM
31891 */
31892 uint16_t target_id;
31893 /*
31894 * A physical address pointer pointing to a host buffer that the
31895 * command's response data will be written. This can be either a host
31896 * physical address (HPA) or a guest physical address (GPA) and must
31897 * point to a physically contiguous block of memory.
31898 */
31899 uint64_t resp_addr;
31900 /*
31901 * This value identifies the CR associated with the ring
31902 * group.
31903 */
31904 uint16_t cr;
31905 /*
31906 * This value identifies the main RR associated with the ring
31907 * group.
31908 */
31909 uint16_t rr;
31910 /*
31911 * This value identifies the aggregation RR associated with
31912 * the ring group. If this value is 0xFF... (All Fs), then no
31913 * Aggregation ring will be set.
31914 */
31915 uint16_t ar;
31916 /*
31917 * This value identifies the statistics context associated
31918 * with the ring group.
31919 */
31920 uint16_t sc;
31921 } hwrm_ring_grp_alloc_input_t, *phwrm_ring_grp_alloc_input_t;
31922
31923 /* hwrm_ring_grp_alloc_output (size:128b/16B) */
31924
31925 typedef struct hwrm_ring_grp_alloc_output {
31926 /* The specific error status for the command. */
31927 uint16_t error_code;
31928 /* The HWRM command request type. */
31929 uint16_t req_type;
31930 /* The sequence ID from the original command. */
31931 uint16_t seq_id;
31932 /* The length of the response data in number of bytes. */
31933 uint16_t resp_len;
31934 /*
31935 * This is the ring group ID value. Use this value to program
31936 * the default ring group for the VNIC or as table entries
31937 * in an RSS/COS context.
31938 */
31939 uint32_t ring_group_id;
31940 uint8_t unused_0[3];
31941 /*
31942 * This field is used in Output records to indicate that the output
31943 * is completely written to RAM. This field should be read as '1'
31944 * to indicate that the output has been completely written.
31945 * When writing a command completion or response to an internal processor,
31946 * the order of writes has to be such that this field is written last.
31947 */
31948 uint8_t valid;
31949 } hwrm_ring_grp_alloc_output_t, *phwrm_ring_grp_alloc_output_t;
31950
31951 /**********************
31952 * hwrm_ring_grp_free *
31953 **********************/
31954
31955
31956 /* hwrm_ring_grp_free_input (size:192b/24B) */
31957
31958 typedef struct hwrm_ring_grp_free_input {
31959 /* The HWRM command request type. */
31960 uint16_t req_type;
31961 /*
31962 * The completion ring to send the completion event on. This should
31963 * be the NQ ID returned from the `nq_alloc` HWRM command.
31964 */
31965 uint16_t cmpl_ring;
31966 /*
31967 * The sequence ID is used by the driver for tracking multiple
31968 * commands. This ID is treated as opaque data by the firmware and
31969 * the value is returned in the `hwrm_resp_hdr` upon completion.
31970 */
31971 uint16_t seq_id;
31972 /*
31973 * The target ID of the command:
31974 * * 0x0-0xFFF8 - The function ID
31975 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31976 * * 0xFFFD - Reserved for user-space HWRM interface
31977 * * 0xFFFF - HWRM
31978 */
31979 uint16_t target_id;
31980 /*
31981 * A physical address pointer pointing to a host buffer that the
31982 * command's response data will be written. This can be either a host
31983 * physical address (HPA) or a guest physical address (GPA) and must
31984 * point to a physically contiguous block of memory.
31985 */
31986 uint64_t resp_addr;
31987 /* This is the ring group ID value. */
31988 uint32_t ring_group_id;
31989 uint8_t unused_0[4];
31990 } hwrm_ring_grp_free_input_t, *phwrm_ring_grp_free_input_t;
31991
31992 /* hwrm_ring_grp_free_output (size:128b/16B) */
31993
31994 typedef struct hwrm_ring_grp_free_output {
31995 /* The specific error status for the command. */
31996 uint16_t error_code;
31997 /* The HWRM command request type. */
31998 uint16_t req_type;
31999 /* The sequence ID from the original command. */
32000 uint16_t seq_id;
32001 /* The length of the response data in number of bytes. */
32002 uint16_t resp_len;
32003 uint8_t unused_0[7];
32004 /*
32005 * This field is used in Output records to indicate that the output
32006 * is completely written to RAM. This field should be read as '1'
32007 * to indicate that the output has been completely written.
32008 * When writing a command completion or response to an internal processor,
32009 * the order of writes has to be such that this field is written last.
32010 */
32011 uint8_t valid;
32012 } hwrm_ring_grp_free_output_t, *phwrm_ring_grp_free_output_t;
32013
32014 /************************
32015 * hwrm_ring_schq_alloc *
32016 ************************/
32017
32018
32019 /* hwrm_ring_schq_alloc_input (size:1088b/136B) */
32020
32021 typedef struct hwrm_ring_schq_alloc_input {
32022 /* The HWRM command request type. */
32023 uint16_t req_type;
32024 /*
32025 * The completion ring to send the completion event on. This should
32026 * be the NQ ID returned from the `nq_alloc` HWRM command.
32027 */
32028 uint16_t cmpl_ring;
32029 /*
32030 * The sequence ID is used by the driver for tracking multiple
32031 * commands. This ID is treated as opaque data by the firmware and
32032 * the value is returned in the `hwrm_resp_hdr` upon completion.
32033 */
32034 uint16_t seq_id;
32035 /*
32036 * The target ID of the command:
32037 * * 0x0-0xFFF8 - The function ID
32038 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32039 * * 0xFFFD - Reserved for user-space HWRM interface
32040 * * 0xFFFF - HWRM
32041 */
32042 uint16_t target_id;
32043 /*
32044 * A physical address pointer pointing to a host buffer that the
32045 * command's response data will be written. This can be either a host
32046 * physical address (HPA) or a guest physical address (GPA) and must
32047 * point to a physically contiguous block of memory.
32048 */
32049 uint64_t resp_addr;
32050 uint32_t enables;
32051 /*
32052 * This bit must be '1' for the tqm_ring0 fields to be
32053 * configured.
32054 */
32055 #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING0 UINT32_C(0x1)
32056 /*
32057 * This bit must be '1' for the tqm_ring1 fields to be
32058 * configured.
32059 */
32060 #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING1 UINT32_C(0x2)
32061 /*
32062 * This bit must be '1' for the tqm_ring2 fields to be
32063 * configured.
32064 */
32065 #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING2 UINT32_C(0x4)
32066 /*
32067 * This bit must be '1' for the tqm_ring3 fields to be
32068 * configured.
32069 */
32070 #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING3 UINT32_C(0x8)
32071 /*
32072 * This bit must be '1' for the tqm_ring4 fields to be
32073 * configured.
32074 */
32075 #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING4 UINT32_C(0x10)
32076 /*
32077 * This bit must be '1' for the tqm_ring5 fields to be
32078 * configured.
32079 */
32080 #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING5 UINT32_C(0x20)
32081 /*
32082 * This bit must be '1' for the tqm_ring6 fields to be
32083 * configured.
32084 */
32085 #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING6 UINT32_C(0x40)
32086 /*
32087 * This bit must be '1' for the tqm_ring7 fields to be
32088 * configured.
32089 */
32090 #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING7 UINT32_C(0x80)
32091 /* Reserved for future use. */
32092 uint32_t reserved;
32093 /* TQM ring 0 page size and level. */
32094 uint8_t tqm_ring0_pg_size_tqm_ring0_lvl;
32095 /* TQM ring 0 PBL indirect levels. */
32096 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_MASK UINT32_C(0xf)
32097 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_SFT 0
32098 /* PBL pointer is physical start address. */
32099 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LVL_0 UINT32_C(0x0)
32100 /* PBL pointer points to PTE table. */
32101 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LVL_1 UINT32_C(0x1)
32102 /*
32103 * PBL pointer points to PDE table with each entry pointing to PTE
32104 * tables.
32105 */
32106 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LVL_2 UINT32_C(0x2)
32107 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LAST HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LVL_2
32108 /* TQM ring 0 page size. */
32109 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_MASK UINT32_C(0xf0)
32110 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_SFT 4
32111 /* 4KB. */
32112 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
32113 /* 8KB. */
32114 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
32115 /* 64KB. */
32116 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
32117 /* 2MB. */
32118 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
32119 /* 8MB. */
32120 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
32121 /* 1GB. */
32122 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
32123 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_LAST HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_1G
32124 /* TQM ring 1 page size and level. */
32125 uint8_t tqm_ring1_pg_size_tqm_ring1_lvl;
32126 /* TQM ring 1 PBL indirect levels. */
32127 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_MASK UINT32_C(0xf)
32128 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_SFT 0
32129 /* PBL pointer is physical start address. */
32130 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LVL_0 UINT32_C(0x0)
32131 /* PBL pointer points to PTE table. */
32132 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LVL_1 UINT32_C(0x1)
32133 /*
32134 * PBL pointer points to PDE table with each entry pointing to PTE
32135 * tables.
32136 */
32137 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LVL_2 UINT32_C(0x2)
32138 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LAST HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LVL_2
32139 /* TQM ring 1 page size. */
32140 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_MASK UINT32_C(0xf0)
32141 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_SFT 4
32142 /* 4KB. */
32143 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
32144 /* 8KB. */
32145 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
32146 /* 64KB. */
32147 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
32148 /* 2MB. */
32149 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
32150 /* 8MB. */
32151 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
32152 /* 1GB. */
32153 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
32154 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_LAST HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_1G
32155 /* TQM ring 2 page size and level. */
32156 uint8_t tqm_ring2_pg_size_tqm_ring2_lvl;
32157 /* TQM ring 2 PBL indirect levels. */
32158 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_MASK UINT32_C(0xf)
32159 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_SFT 0
32160 /* PBL pointer is physical start address. */
32161 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LVL_0 UINT32_C(0x0)
32162 /* PBL pointer points to PTE table. */
32163 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LVL_1 UINT32_C(0x1)
32164 /*
32165 * PBL pointer points to PDE table with each entry pointing to PTE
32166 * tables.
32167 */
32168 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LVL_2 UINT32_C(0x2)
32169 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LAST HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LVL_2
32170 /* TQM ring 2 page size. */
32171 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_MASK UINT32_C(0xf0)
32172 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_SFT 4
32173 /* 4KB. */
32174 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
32175 /* 8KB. */
32176 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
32177 /* 64KB. */
32178 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
32179 /* 2MB. */
32180 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
32181 /* 8MB. */
32182 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
32183 /* 1GB. */
32184 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
32185 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_LAST HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_1G
32186 /* TQM ring 3 page size and level. */
32187 uint8_t tqm_ring3_pg_size_tqm_ring3_lvl;
32188 /* TQM ring 3 PBL indirect levels. */
32189 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_MASK UINT32_C(0xf)
32190 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_SFT 0
32191 /* PBL pointer is physical start address. */
32192 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LVL_0 UINT32_C(0x0)
32193 /* PBL pointer points to PTE table. */
32194 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LVL_1 UINT32_C(0x1)
32195 /*
32196 * PBL pointer points to PDE table with each entry pointing to PTE
32197 * tables.
32198 */
32199 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LVL_2 UINT32_C(0x2)
32200 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LAST HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LVL_2
32201 /* TQM ring 3 page size. */
32202 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_MASK UINT32_C(0xf0)
32203 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_SFT 4
32204 /* 4KB. */
32205 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
32206 /* 8KB. */
32207 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
32208 /* 64KB. */
32209 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
32210 /* 2MB. */
32211 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
32212 /* 8MB. */
32213 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
32214 /* 1GB. */
32215 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
32216 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_LAST HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_1G
32217 /* TQM ring 4 page size and level. */
32218 uint8_t tqm_ring4_pg_size_tqm_ring4_lvl;
32219 /* TQM ring 4 PBL indirect levels. */
32220 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_MASK UINT32_C(0xf)
32221 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_SFT 0
32222 /* PBL pointer is physical start address. */
32223 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LVL_0 UINT32_C(0x0)
32224 /* PBL pointer points to PTE table. */
32225 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LVL_1 UINT32_C(0x1)
32226 /*
32227 * PBL pointer points to PDE table with each entry pointing to PTE
32228 * tables.
32229 */
32230 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LVL_2 UINT32_C(0x2)
32231 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LAST HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LVL_2
32232 /* TQM ring 4 page size. */
32233 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_MASK UINT32_C(0xf0)
32234 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_SFT 4
32235 /* 4KB. */
32236 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
32237 /* 8KB. */
32238 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
32239 /* 64KB. */
32240 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
32241 /* 2MB. */
32242 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
32243 /* 8MB. */
32244 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
32245 /* 1GB. */
32246 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
32247 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_LAST HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_1G
32248 /* TQM ring 5 page size and level. */
32249 uint8_t tqm_ring5_pg_size_tqm_ring5_lvl;
32250 /* TQM ring 5 PBL indirect levels. */
32251 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_MASK UINT32_C(0xf)
32252 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_SFT 0
32253 /* PBL pointer is physical start address. */
32254 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LVL_0 UINT32_C(0x0)
32255 /* PBL pointer points to PTE table. */
32256 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LVL_1 UINT32_C(0x1)
32257 /*
32258 * PBL pointer points to PDE table with each entry pointing to PTE
32259 * tables.
32260 */
32261 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LVL_2 UINT32_C(0x2)
32262 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LAST HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LVL_2
32263 /* TQM ring 5 page size. */
32264 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_MASK UINT32_C(0xf0)
32265 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_SFT 4
32266 /* 4KB. */
32267 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
32268 /* 8KB. */
32269 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
32270 /* 64KB. */
32271 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
32272 /* 2MB. */
32273 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
32274 /* 8MB. */
32275 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
32276 /* 1GB. */
32277 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
32278 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_LAST HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_1G
32279 /* TQM ring 6 page size and level. */
32280 uint8_t tqm_ring6_pg_size_tqm_ring6_lvl;
32281 /* TQM ring 6 PBL indirect levels. */
32282 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_MASK UINT32_C(0xf)
32283 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_SFT 0
32284 /* PBL pointer is physical start address. */
32285 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LVL_0 UINT32_C(0x0)
32286 /* PBL pointer points to PTE table. */
32287 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LVL_1 UINT32_C(0x1)
32288 /*
32289 * PBL pointer points to PDE table with each entry pointing to PTE
32290 * tables.
32291 */
32292 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LVL_2 UINT32_C(0x2)
32293 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LAST HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LVL_2
32294 /* TQM ring 6 page size. */
32295 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_MASK UINT32_C(0xf0)
32296 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_SFT 4
32297 /* 4KB. */
32298 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
32299 /* 8KB. */
32300 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
32301 /* 64KB. */
32302 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
32303 /* 2MB. */
32304 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
32305 /* 8MB. */
32306 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
32307 /* 1GB. */
32308 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
32309 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_LAST HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_1G
32310 /* TQM ring 7 page size and level. */
32311 uint8_t tqm_ring7_pg_size_tqm_ring7_lvl;
32312 /* TQM ring 7 PBL indirect levels. */
32313 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_MASK UINT32_C(0xf)
32314 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_SFT 0
32315 /* PBL pointer is physical start address. */
32316 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LVL_0 UINT32_C(0x0)
32317 /* PBL pointer points to PTE table. */
32318 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LVL_1 UINT32_C(0x1)
32319 /*
32320 * PBL pointer points to PDE table with each entry pointing to PTE
32321 * tables.
32322 */
32323 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LVL_2 UINT32_C(0x2)
32324 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LAST HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LVL_2
32325 /* TQM ring 7 page size. */
32326 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_MASK UINT32_C(0xf0)
32327 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_SFT 4
32328 /* 4KB. */
32329 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
32330 /* 8KB. */
32331 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
32332 /* 64KB. */
32333 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
32334 /* 2MB. */
32335 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
32336 /* 8MB. */
32337 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
32338 /* 1GB. */
32339 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
32340 #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_LAST HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_1G
32341 /* TQM ring 0 page directory. */
32342 uint64_t tqm_ring0_page_dir;
32343 /* TQM ring 1 page directory. */
32344 uint64_t tqm_ring1_page_dir;
32345 /* TQM ring 2 page directory. */
32346 uint64_t tqm_ring2_page_dir;
32347 /* TQM ring 3 page directory. */
32348 uint64_t tqm_ring3_page_dir;
32349 /* TQM ring 4 page directory. */
32350 uint64_t tqm_ring4_page_dir;
32351 /* TQM ring 5 page directory. */
32352 uint64_t tqm_ring5_page_dir;
32353 /* TQM ring 6 page directory. */
32354 uint64_t tqm_ring6_page_dir;
32355 /* TQM ring 7 page directory. */
32356 uint64_t tqm_ring7_page_dir;
32357 /*
32358 * Number of TQM ring 0 entries.
32359 *
32360 * TQM fastpath rings should be sized large enough to accommodate the
32361 * maximum number of QPs (either L2 or RoCE, or both if shared)
32362 * that can be enqueued to the TQM ring.
32363 *
32364 * Note that TQM ring sizes cannot be extended while the system is
32365 * operational. If a PF driver needs to extend a TQM ring, it needs
32366 * to delete the SCHQ and then reallocate it.
32367 */
32368 uint32_t tqm_ring0_num_entries;
32369 /*
32370 * Number of TQM ring 1 entries.
32371 *
32372 * TQM fastpath rings should be sized large enough to accommodate the
32373 * maximum number of QPs (either L2 or RoCE, or both if shared)
32374 * that can be enqueued to the TQM ring.
32375 *
32376 * Note that TQM ring sizes cannot be extended while the system is
32377 * operational. If a PF driver needs to extend a TQM ring, it needs
32378 * to delete the SCHQ and then reallocate it.
32379 */
32380 uint32_t tqm_ring1_num_entries;
32381 /*
32382 * Number of TQM ring 2 entries.
32383 *
32384 * TQM fastpath rings should be sized large enough to accommodate the
32385 * maximum number of QPs (either L2 or RoCE, or both if shared)
32386 * that can be enqueued to the TQM ring.
32387 *
32388 * Note that TQM ring sizes cannot be extended while the system is
32389 * operational. If a PF driver needs to extend a TQM ring, it needs
32390 * to delete the SCHQ and then reallocate it.
32391 */
32392 uint32_t tqm_ring2_num_entries;
32393 /*
32394 * Number of TQM ring 3 entries.
32395 *
32396 * TQM fastpath rings should be sized large enough to accommodate the
32397 * maximum number of QPs (either L2 or RoCE, or both if shared)
32398 * that can be enqueued to the TQM ring.
32399 *
32400 * Note that TQM ring sizes cannot be extended while the system is
32401 * operational. If a PF driver needs to extend a TQM ring, it needs
32402 * to delete the SCHQ and then reallocate it.
32403 */
32404 uint32_t tqm_ring3_num_entries;
32405 /*
32406 * Number of TQM ring 4 entries.
32407 *
32408 * TQM fastpath rings should be sized large enough to accommodate the
32409 * maximum number of QPs (either L2 or RoCE, or both if shared)
32410 * that can be enqueued to the TQM ring.
32411 *
32412 * Note that TQM ring sizes cannot be extended while the system is
32413 * operational. If a PF driver needs to extend a TQM ring, it needs
32414 * to delete the SCHQ and then reallocate it.
32415 */
32416 uint32_t tqm_ring4_num_entries;
32417 /*
32418 * Number of TQM ring 5 entries.
32419 *
32420 * TQM fastpath rings should be sized large enough to accommodate the
32421 * maximum number of QPs (either L2 or RoCE, or both if shared)
32422 * that can be enqueued to the TQM ring.
32423 *
32424 * Note that TQM ring sizes cannot be extended while the system is
32425 * operational. If a PF driver needs to extend a TQM ring, it needs
32426 * to delete the SCHQ and then reallocate it.
32427 */
32428 uint32_t tqm_ring5_num_entries;
32429 /*
32430 * Number of TQM ring 6 entries.
32431 *
32432 * TQM fastpath rings should be sized large enough to accommodate the
32433 * maximum number of QPs (either L2 or RoCE, or both if shared)
32434 * that can be enqueued to the TQM ring.
32435 *
32436 * Note that TQM ring sizes cannot be extended while the system is
32437 * operational. If a PF driver needs to extend a TQM ring, it needs
32438 * to delete the SCHQ and then reallocate it.
32439 */
32440 uint32_t tqm_ring6_num_entries;
32441 /*
32442 * Number of TQM ring 7 entries.
32443 *
32444 * TQM fastpath rings should be sized large enough to accommodate the
32445 * maximum number of QPs (either L2 or RoCE, or both if shared)
32446 * that can be enqueued to the TQM ring.
32447 *
32448 * Note that TQM ring sizes cannot be extended while the system is
32449 * operational. If a PF driver needs to extend a TQM ring, it needs
32450 * to delete the SCHQ and then reallocate it.
32451 */
32452 uint32_t tqm_ring7_num_entries;
32453 /* Number of bytes that have been allocated for each context entry. */
32454 uint16_t tqm_entry_size;
32455 uint8_t unused_0[6];
32456 } hwrm_ring_schq_alloc_input_t, *phwrm_ring_schq_alloc_input_t;
32457
32458 /* hwrm_ring_schq_alloc_output (size:128b/16B) */
32459
32460 typedef struct hwrm_ring_schq_alloc_output {
32461 /* The specific error status for the command. */
32462 uint16_t error_code;
32463 /* The HWRM command request type. */
32464 uint16_t req_type;
32465 /* The sequence ID from the original command. */
32466 uint16_t seq_id;
32467 /* The length of the response data in number of bytes. */
32468 uint16_t resp_len;
32469 /*
32470 * This is an identifier for the SCHQ to be used in other HWRM commands
32471 * that need to reference this SCHQ. This value is greater than zero
32472 * (i.e. a schq_id of zero references the default SCHQ).
32473 */
32474 uint16_t schq_id;
32475 uint8_t unused_0[5];
32476 /*
32477 * This field is used in Output records to indicate that the output
32478 * is completely written to RAM. This field should be read as '1'
32479 * to indicate that the output has been completely written.
32480 * When writing a command completion or response to an internal processor,
32481 * the order of writes has to be such that this field is written last.
32482 */
32483 uint8_t valid;
32484 } hwrm_ring_schq_alloc_output_t, *phwrm_ring_schq_alloc_output_t;
32485
32486 /**********************
32487 * hwrm_ring_schq_cfg *
32488 **********************/
32489
32490
32491 /* hwrm_ring_schq_cfg_input (size:768b/96B) */
32492
32493 typedef struct hwrm_ring_schq_cfg_input {
32494 /* The HWRM command request type. */
32495 uint16_t req_type;
32496 /*
32497 * The completion ring to send the completion event on. This should
32498 * be the NQ ID returned from the `nq_alloc` HWRM command.
32499 */
32500 uint16_t cmpl_ring;
32501 /*
32502 * The sequence ID is used by the driver for tracking multiple
32503 * commands. This ID is treated as opaque data by the firmware and
32504 * the value is returned in the `hwrm_resp_hdr` upon completion.
32505 */
32506 uint16_t seq_id;
32507 /*
32508 * The target ID of the command:
32509 * * 0x0-0xFFF8 - The function ID
32510 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32511 * * 0xFFFD - Reserved for user-space HWRM interface
32512 * * 0xFFFF - HWRM
32513 */
32514 uint16_t target_id;
32515 /*
32516 * A physical address pointer pointing to a host buffer that the
32517 * command's response data will be written. This can be either a host
32518 * physical address (HPA) or a guest physical address (GPA) and must
32519 * point to a physically contiguous block of memory.
32520 */
32521 uint64_t resp_addr;
32522 /*
32523 * Identifies the SCHQ being configured. A schq_id of zero refers to
32524 * the default SCHQ.
32525 */
32526 uint16_t schq_id;
32527 /*
32528 * This field is an 8 bit bitmap that indicates which TCs are enabled
32529 * in this SCHQ. Bit 0 represents traffic class 0 and bit 7 represents
32530 * traffic class 7.
32531 */
32532 uint8_t tc_enabled;
32533 uint8_t unused_0;
32534 uint32_t flags;
32535 /* The tc_max_bw array and the max_bw parameters are valid */
32536 #define HWRM_RING_SCHQ_CFG_INPUT_FLAGS_TC_MAX_BW_ENABLED UINT32_C(0x1)
32537 /* The tc_min_bw array is valid */
32538 #define HWRM_RING_SCHQ_CFG_INPUT_FLAGS_TC_MIN_BW_ENABLED UINT32_C(0x2)
32539 /* Maximum bandwidth of the traffic class, specified in Mbps. */
32540 uint32_t max_bw_tc0;
32541 /* Maximum bandwidth of the traffic class, specified in Mbps. */
32542 uint32_t max_bw_tc1;
32543 /* Maximum bandwidth of the traffic class, specified in Mbps. */
32544 uint32_t max_bw_tc2;
32545 /* Maximum bandwidth of the traffic class, specified in Mbps. */
32546 uint32_t max_bw_tc3;
32547 /* Maximum bandwidth of the traffic class, specified in Mbps. */
32548 uint32_t max_bw_tc4;
32549 /* Maximum bandwidth of the traffic class, specified in Mbps. */
32550 uint32_t max_bw_tc5;
32551 /* Maximum bandwidth of the traffic class, specified in Mbps. */
32552 uint32_t max_bw_tc6;
32553 /* Maximum bandwidth of the traffic class, specified in Mbps. */
32554 uint32_t max_bw_tc7;
32555 /*
32556 * Bandwidth reservation for the traffic class, specified in Mbps.
32557 * A value of zero signifies that traffic belonging to this class
32558 * shares the bandwidth reservation for the same traffic class of
32559 * the default SCHQ.
32560 */
32561 uint32_t min_bw_tc0;
32562 /*
32563 * Bandwidth reservation for the traffic class, specified in Mbps.
32564 * A value of zero signifies that traffic belonging to this class
32565 * shares the bandwidth reservation for the same traffic class of
32566 * the default SCHQ.
32567 */
32568 uint32_t min_bw_tc1;
32569 /*
32570 * Bandwidth reservation for the traffic class, specified in Mbps.
32571 * A value of zero signifies that traffic belonging to this class
32572 * shares the bandwidth reservation for the same traffic class of
32573 * the default SCHQ.
32574 */
32575 uint32_t min_bw_tc2;
32576 /*
32577 * Bandwidth reservation for the traffic class, specified in Mbps.
32578 * A value of zero signifies that traffic belonging to this class
32579 * shares the bandwidth reservation for the same traffic class of
32580 * the default SCHQ.
32581 */
32582 uint32_t min_bw_tc3;
32583 /*
32584 * Bandwidth reservation for the traffic class, specified in Mbps.
32585 * A value of zero signifies that traffic belonging to this class
32586 * shares the bandwidth reservation for the same traffic class of
32587 * the default SCHQ.
32588 */
32589 uint32_t min_bw_tc4;
32590 /*
32591 * Bandwidth reservation for the traffic class, specified in Mbps.
32592 * A value of zero signifies that traffic belonging to this class
32593 * shares the bandwidth reservation for the same traffic class of
32594 * the default SCHQ.
32595 */
32596 uint32_t min_bw_tc5;
32597 /*
32598 * Bandwidth reservation for the traffic class, specified in Mbps.
32599 * A value of zero signifies that traffic belonging to this class
32600 * shares the bandwidth reservation for the same traffic class of
32601 * the default SCHQ.
32602 */
32603 uint32_t min_bw_tc6;
32604 /*
32605 * Bandwidth reservation for the traffic class, specified in Mbps.
32606 * A value of zero signifies that traffic belonging to this class
32607 * shares the bandwidth reservation for the same traffic class of
32608 * the default SCHQ.
32609 */
32610 uint32_t min_bw_tc7;
32611 /*
32612 * Indicates the max bandwidth for all enabled traffic classes in
32613 * this SCHQ, specified in Mbps.
32614 */
32615 uint32_t max_bw;
32616 uint8_t unused_1[4];
32617 } hwrm_ring_schq_cfg_input_t, *phwrm_ring_schq_cfg_input_t;
32618
32619 /* hwrm_ring_schq_cfg_output (size:128b/16B) */
32620
32621 typedef struct hwrm_ring_schq_cfg_output {
32622 /* The specific error status for the command. */
32623 uint16_t error_code;
32624 /* The HWRM command request type. */
32625 uint16_t req_type;
32626 /* The sequence ID from the original command. */
32627 uint16_t seq_id;
32628 /* The length of the response data in number of bytes. */
32629 uint16_t resp_len;
32630 uint8_t unused_0[7];
32631 /*
32632 * This field is used in Output records to indicate that the output
32633 * is completely written to RAM. This field should be read as '1'
32634 * to indicate that the output has been completely written.
32635 * When writing a command completion or response to an internal processor,
32636 * the order of writes has to be such that this field is written last.
32637 */
32638 uint8_t valid;
32639 } hwrm_ring_schq_cfg_output_t, *phwrm_ring_schq_cfg_output_t;
32640
32641 /***********************
32642 * hwrm_ring_schq_free *
32643 ***********************/
32644
32645
32646 /* hwrm_ring_schq_free_input (size:192b/24B) */
32647
32648 typedef struct hwrm_ring_schq_free_input {
32649 /* The HWRM command request type. */
32650 uint16_t req_type;
32651 /*
32652 * The completion ring to send the completion event on. This should
32653 * be the NQ ID returned from the `nq_alloc` HWRM command.
32654 */
32655 uint16_t cmpl_ring;
32656 /*
32657 * The sequence ID is used by the driver for tracking multiple
32658 * commands. This ID is treated as opaque data by the firmware and
32659 * the value is returned in the `hwrm_resp_hdr` upon completion.
32660 */
32661 uint16_t seq_id;
32662 /*
32663 * The target ID of the command:
32664 * * 0x0-0xFFF8 - The function ID
32665 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32666 * * 0xFFFD - Reserved for user-space HWRM interface
32667 * * 0xFFFF - HWRM
32668 */
32669 uint16_t target_id;
32670 /*
32671 * A physical address pointer pointing to a host buffer that the
32672 * command's response data will be written. This can be either a host
32673 * physical address (HPA) or a guest physical address (GPA) and must
32674 * point to a physically contiguous block of memory.
32675 */
32676 uint64_t resp_addr;
32677 /* Identifies the SCHQ being freed. */
32678 uint16_t schq_id;
32679 uint8_t unused_0[6];
32680 } hwrm_ring_schq_free_input_t, *phwrm_ring_schq_free_input_t;
32681
32682 /* hwrm_ring_schq_free_output (size:128b/16B) */
32683
32684 typedef struct hwrm_ring_schq_free_output {
32685 /* The specific error status for the command. */
32686 uint16_t error_code;
32687 /* The HWRM command request type. */
32688 uint16_t req_type;
32689 /* The sequence ID from the original command. */
32690 uint16_t seq_id;
32691 /* The length of the response data in number of bytes. */
32692 uint16_t resp_len;
32693 uint8_t unused_0[7];
32694 /*
32695 * This field is used in Output records to indicate that the output
32696 * is completely written to RAM. This field should be read as '1'
32697 * to indicate that the output has been completely written.
32698 * When writing a command completion or response to an internal processor,
32699 * the order of writes has to be such that this field is written last.
32700 */
32701 uint8_t valid;
32702 } hwrm_ring_schq_free_output_t, *phwrm_ring_schq_free_output_t;
32703
32704 /*
32705 * special reserved flow ID to identify per function default
32706 * flows for vSwitch offload
32707 */
32708 #define DEFAULT_FLOW_ID 0xFFFFFFFFUL
32709 /*
32710 * special reserved flow ID to identify per function RoCEv1
32711 * flows
32712 */
32713 #define ROCEV1_FLOW_ID 0xFFFFFFFEUL
32714 /*
32715 * special reserved flow ID to identify per function RoCEv2
32716 * flows
32717 */
32718 #define ROCEV2_FLOW_ID 0xFFFFFFFDUL
32719 /*
32720 * special reserved flow ID to identify per function RoCEv2
32721 * CNP flows
32722 */
32723 #define ROCEV2_CNP_FLOW_ID 0xFFFFFFFCUL
32724
32725 /****************************
32726 * hwrm_cfa_l2_filter_alloc *
32727 ****************************/
32728
32729
32730 /* hwrm_cfa_l2_filter_alloc_input (size:768b/96B) */
32731
32732 typedef struct hwrm_cfa_l2_filter_alloc_input {
32733 /* The HWRM command request type. */
32734 uint16_t req_type;
32735 /*
32736 * The completion ring to send the completion event on. This should
32737 * be the NQ ID returned from the `nq_alloc` HWRM command.
32738 */
32739 uint16_t cmpl_ring;
32740 /*
32741 * The sequence ID is used by the driver for tracking multiple
32742 * commands. This ID is treated as opaque data by the firmware and
32743 * the value is returned in the `hwrm_resp_hdr` upon completion.
32744 */
32745 uint16_t seq_id;
32746 /*
32747 * The target ID of the command:
32748 * * 0x0-0xFFF8 - The function ID
32749 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32750 * * 0xFFFD - Reserved for user-space HWRM interface
32751 * * 0xFFFF - HWRM
32752 */
32753 uint16_t target_id;
32754 /*
32755 * A physical address pointer pointing to a host buffer that the
32756 * command's response data will be written. This can be either a host
32757 * physical address (HPA) or a guest physical address (GPA) and must
32758 * point to a physically contiguous block of memory.
32759 */
32760 uint64_t resp_addr;
32761 uint32_t flags;
32762 /*
32763 * Enumeration denoting the RX, TX type of the resource.
32764 * This enumeration is used for resources that are similar for both
32765 * TX and RX paths of the chip.
32766 */
32767 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH UINT32_C(0x1)
32768 /* tx path */
32769 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_TX UINT32_C(0x0)
32770 /* rx path */
32771 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX UINT32_C(0x1)
32772 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_LAST HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX
32773 /*
32774 * Setting of this flag indicates the applicability to the loopback
32775 * path.
32776 */
32777 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK UINT32_C(0x2)
32778 /*
32779 * Setting of this flag indicates drop action. If this flag is not
32780 * set, then it should be considered accept action.
32781 */
32782 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_DROP UINT32_C(0x4)
32783 /*
32784 * If this flag is set, all t_l2_* fields are invalid
32785 * and they should not be specified.
32786 * If this flag is set, then l2_* fields refer to
32787 * fields of outermost L2 header.
32788 */
32789 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_OUTERMOST UINT32_C(0x8)
32790 /*
32791 * Enumeration denoting NO_ROCE_L2 to support old drivers.
32792 * New driver L2 for only L2 traffic, ROCE for roce and l2 traffic
32793 */
32794 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_MASK UINT32_C(0x30)
32795 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_SFT 4
32796 /* To support old drivers */
32797 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_NO_ROCE_L2 (UINT32_C(0x0) << 4)
32798 /* Only L2 traffic */
32799 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_L2 (UINT32_C(0x1) << 4)
32800 /* Roce & L2 traffic */
32801 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_ROCE (UINT32_C(0x2) << 4)
32802 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_LAST HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_ROCE
32803 /*
32804 * Setting of this flag indicates that no XDP filter is created with
32805 * L2 filter.
32806 * 0 - legacy behavior, XDP filter is created with L2 filter
32807 * 1 - XDP filter won't be created with L2 filter
32808 */
32809 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_XDP_DISABLE UINT32_C(0x40)
32810 /*
32811 * Setting this flag to 1 indicate the L2 fields in this command
32812 * pertain to source fields. Setting this flag to 0 indicate the
32813 * L2 fields in this command pertain to the destination fields
32814 * and this is the default/legacy behavior.
32815 */
32816 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_SOURCE_VALID UINT32_C(0x80)
32817 uint32_t enables;
32818 /*
32819 * This bit must be '1' for the l2_addr field to be
32820 * configured.
32821 */
32822 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR UINT32_C(0x1)
32823 /*
32824 * This bit must be '1' for the l2_addr_mask field to be
32825 * configured.
32826 */
32827 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK UINT32_C(0x2)
32828 /*
32829 * This bit must be '1' for the l2_ovlan field to be
32830 * configured.
32831 */
32832 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN UINT32_C(0x4)
32833 /*
32834 * This bit must be '1' for the l2_ovlan_mask field to be
32835 * configured.
32836 */
32837 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN_MASK UINT32_C(0x8)
32838 /*
32839 * This bit must be '1' for the l2_ivlan field to be
32840 * configured.
32841 */
32842 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN UINT32_C(0x10)
32843 /*
32844 * This bit must be '1' for the l2_ivlan_mask field to be
32845 * configured.
32846 */
32847 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN_MASK UINT32_C(0x20)
32848 /*
32849 * This bit must be '1' for the t_l2_addr field to be
32850 * configured.
32851 */
32852 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR UINT32_C(0x40)
32853 /*
32854 * This bit must be '1' for the t_l2_addr_mask field to be
32855 * configured.
32856 */
32857 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR_MASK UINT32_C(0x80)
32858 /*
32859 * This bit must be '1' for the t_l2_ovlan field to be
32860 * configured.
32861 */
32862 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN UINT32_C(0x100)
32863 /*
32864 * This bit must be '1' for the t_l2_ovlan_mask field to be
32865 * configured.
32866 */
32867 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN_MASK UINT32_C(0x200)
32868 /*
32869 * This bit must be '1' for the t_l2_ivlan field to be
32870 * configured.
32871 */
32872 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN UINT32_C(0x400)
32873 /*
32874 * This bit must be '1' for the t_l2_ivlan_mask field to be
32875 * configured.
32876 */
32877 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN_MASK UINT32_C(0x800)
32878 /*
32879 * This bit must be '1' for the src_type field to be
32880 * configured.
32881 */
32882 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_TYPE UINT32_C(0x1000)
32883 /*
32884 * This bit must be '1' for the src_id field to be
32885 * configured.
32886 */
32887 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_ID UINT32_C(0x2000)
32888 /*
32889 * This bit must be '1' for the tunnel_type field to be
32890 * configured.
32891 */
32892 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE UINT32_C(0x4000)
32893 /*
32894 * This bit must be '1' for the dst_id field to be
32895 * configured.
32896 */
32897 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_DST_ID UINT32_C(0x8000)
32898 /*
32899 * This bit must be '1' for the mirror_vnic_id field to be
32900 * configured.
32901 */
32902 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID UINT32_C(0x10000)
32903 /*
32904 * This bit must be '1' for the num_vlans field to be
32905 * configured.
32906 */
32907 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_NUM_VLANS UINT32_C(0x20000)
32908 /*
32909 * This bit must be '1' for the t_num_vlans field to be
32910 * configured.
32911 */
32912 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_NUM_VLANS UINT32_C(0x40000)
32913 /*
32914 * This value sets the match value for the L2 MAC address.
32915 * Destination MAC address for RX path.
32916 * Source MAC address for TX path.
32917 */
32918 uint8_t l2_addr[6];
32919 /* This value sets the match value for the number of VLANs. */
32920 uint8_t num_vlans;
32921 /*
32922 * This value sets the match value for the number of VLANs
32923 * in the tunnel headers.
32924 */
32925 uint8_t t_num_vlans;
32926 /*
32927 * This value sets the mask value for the L2 address.
32928 * A value of 0 will mask the corresponding bit from
32929 * compare.
32930 */
32931 uint8_t l2_addr_mask[6];
32932 /* This value sets VLAN ID value for outer VLAN. */
32933 uint16_t l2_ovlan;
32934 /*
32935 * This value sets the mask value for the ovlan id.
32936 * A value of 0 will mask the corresponding bit from
32937 * compare.
32938 */
32939 uint16_t l2_ovlan_mask;
32940 /* This value sets VLAN ID value for inner VLAN. */
32941 uint16_t l2_ivlan;
32942 /*
32943 * This value sets the mask value for the ivlan id.
32944 * A value of 0 will mask the corresponding bit from
32945 * compare.
32946 */
32947 uint16_t l2_ivlan_mask;
32948 uint8_t unused_1[2];
32949 /*
32950 * This value sets the match value for the tunnel
32951 * L2 MAC address.
32952 * Destination MAC address for RX path.
32953 * Source MAC address for TX path.
32954 */
32955 uint8_t t_l2_addr[6];
32956 uint8_t unused_2[2];
32957 /*
32958 * This value sets the mask value for the tunnel L2
32959 * address.
32960 * A value of 0 will mask the corresponding bit from
32961 * compare.
32962 */
32963 uint8_t t_l2_addr_mask[6];
32964 /* This value sets VLAN ID value for tunnel outer VLAN. */
32965 uint16_t t_l2_ovlan;
32966 /*
32967 * This value sets the mask value for the tunnel ovlan id.
32968 * A value of 0 will mask the corresponding bit from
32969 * compare.
32970 */
32971 uint16_t t_l2_ovlan_mask;
32972 /* This value sets VLAN ID value for tunnel inner VLAN. */
32973 uint16_t t_l2_ivlan;
32974 /*
32975 * This value sets the mask value for the tunnel ivlan id.
32976 * A value of 0 will mask the corresponding bit from
32977 * compare.
32978 */
32979 uint16_t t_l2_ivlan_mask;
32980 /* This value identifies the type of source of the packet. */
32981 uint8_t src_type;
32982 /* Network port */
32983 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_NPORT UINT32_C(0x0)
32984 /* Physical function */
32985 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_PF UINT32_C(0x1)
32986 /* Virtual function */
32987 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VF UINT32_C(0x2)
32988 /* Virtual NIC of a function */
32989 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VNIC UINT32_C(0x3)
32990 /* Embedded processor for CFA management */
32991 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_KONG UINT32_C(0x4)
32992 /* Embedded processor for OOB management */
32993 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_APE UINT32_C(0x5)
32994 /* Embedded processor for RoCE */
32995 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_BONO UINT32_C(0x6)
32996 /* Embedded processor for network proxy functions */
32997 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG UINT32_C(0x7)
32998 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_LAST HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG
32999 uint8_t unused_3;
33000 /*
33001 * This value is the id of the source.
33002 * For a network port, it represents port_id.
33003 * For a physical function, it represents fid.
33004 * For a virtual function, it represents vf_id.
33005 * For a vnic, it represents vnic_id.
33006 * For embedded processors, this id is not valid.
33007 *
33008 * Notes:
33009 * 1. The function ID is implied if it src_id is
33010 * not provided for a src_type that is either
33011 */
33012 uint32_t src_id;
33013 /* Tunnel Type. */
33014 uint8_t tunnel_type;
33015 /* Non-tunnel */
33016 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL UINT32_C(0x0)
33017 /* Virtual eXtensible Local Area Network (VXLAN) */
33018 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
33019 /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
33020 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE UINT32_C(0x2)
33021 /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
33022 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE UINT32_C(0x3)
33023 /* IP in IP */
33024 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP UINT32_C(0x4)
33025 /* Generic Network Virtualization Encapsulation (Geneve) */
33026 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
33027 /* Multi-Protocol Label Switching (MPLS) */
33028 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS UINT32_C(0x6)
33029 /* Stateless Transport Tunnel (STT) */
33030 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT UINT32_C(0x7)
33031 /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
33032 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE UINT32_C(0x8)
33033 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
33034 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 UINT32_C(0x9)
33035 /*
33036 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
33037 * datagram payload
33038 */
33039 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 UINT32_C(0xa)
33040 /* Use fixed layer 2 ether type of 0xFFFF */
33041 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE UINT32_C(0xb)
33042 /*
33043 * IPV6 over virtual eXtensible Local Area Network with GPE header
33044 * (IPV6oVXLANGPE)
33045 */
33046 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
33047 /* Any tunneled traffic */
33048 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL UINT32_C(0xff)
33049 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
33050 uint8_t unused_4;
33051 /*
33052 * If set, this value shall represent the
33053 * Logical VNIC ID of the destination VNIC for the RX
33054 * path and network port id of the destination port for
33055 * the TX path.
33056 */
33057 uint16_t dst_id;
33058 /*
33059 * Logical VNIC ID of the VNIC where traffic is
33060 * mirrored.
33061 */
33062 uint16_t mirror_vnic_id;
33063 /*
33064 * This hint is provided to help in placing
33065 * the filter in the filter table.
33066 */
33067 uint8_t pri_hint;
33068 /* No preference */
33069 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER UINT32_C(0x0)
33070 /* Above the given filter */
33071 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE_FILTER UINT32_C(0x1)
33072 /* Below the given filter */
33073 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_BELOW_FILTER UINT32_C(0x2)
33074 /* As high as possible */
33075 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MAX UINT32_C(0x3)
33076 /* As low as possible */
33077 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN UINT32_C(0x4)
33078 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_LAST HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN
33079 uint8_t unused_5;
33080 uint32_t unused_6;
33081 /*
33082 * This is the ID of the filter that goes along with
33083 * the pri_hint.
33084 *
33085 * This field is valid only for the following values.
33086 * 1 - Above the given filter
33087 * 2 - Below the given filter
33088 */
33089 uint64_t l2_filter_id_hint;
33090 } hwrm_cfa_l2_filter_alloc_input_t, *phwrm_cfa_l2_filter_alloc_input_t;
33091
33092 /* hwrm_cfa_l2_filter_alloc_output (size:192b/24B) */
33093
33094 typedef struct hwrm_cfa_l2_filter_alloc_output {
33095 /* The specific error status for the command. */
33096 uint16_t error_code;
33097 /* The HWRM command request type. */
33098 uint16_t req_type;
33099 /* The sequence ID from the original command. */
33100 uint16_t seq_id;
33101 /* The length of the response data in number of bytes. */
33102 uint16_t resp_len;
33103 /*
33104 * This value identifies a set of CFA data structures used for an L2
33105 * context.
33106 */
33107 uint64_t l2_filter_id;
33108 /*
33109 * The flow id value in bit 0-29 is the actual ID of the flow
33110 * associated with this filter and it shall be used to match
33111 * and associate the flow identifier returned in completion
33112 * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
33113 * shall indicate no valid flow id.
33114 */
33115 uint32_t flow_id;
33116 /* Indicate the flow id value. */
33117 #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK UINT32_C(0x3fffffff)
33118 #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
33119 /* Indicate type of the flow. */
33120 #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE UINT32_C(0x40000000)
33121 /*
33122 * If this bit set to 0, then it indicates that the flow is
33123 * internal flow.
33124 */
33125 #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT (UINT32_C(0x0) << 30)
33126 /*
33127 * If this bit is set to 1, then it indicates that the flow is
33128 * external flow.
33129 */
33130 #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT (UINT32_C(0x1) << 30)
33131 #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
33132 /* Indicate the flow direction. */
33133 #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR UINT32_C(0x80000000)
33134 /* If this bit set to 0, then it indicates rx flow. */
33135 #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX (UINT32_C(0x0) << 31)
33136 /* If this bit is set to 1, then it indicates that tx flow. */
33137 #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX (UINT32_C(0x1) << 31)
33138 #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
33139 uint8_t unused_0[3];
33140 /*
33141 * This field is used in Output records to indicate that the output
33142 * is completely written to RAM. This field should be read as '1'
33143 * to indicate that the output has been completely written.
33144 * When writing a command completion or response to an internal
33145 * processor, the order of writes has to be such that this field is
33146 * written last.
33147 */
33148 uint8_t valid;
33149 } hwrm_cfa_l2_filter_alloc_output_t, *phwrm_cfa_l2_filter_alloc_output_t;
33150
33151 /***************************
33152 * hwrm_cfa_l2_filter_free *
33153 ***************************/
33154
33155
33156 /* hwrm_cfa_l2_filter_free_input (size:192b/24B) */
33157
33158 typedef struct hwrm_cfa_l2_filter_free_input {
33159 /* The HWRM command request type. */
33160 uint16_t req_type;
33161 /*
33162 * The completion ring to send the completion event on. This should
33163 * be the NQ ID returned from the `nq_alloc` HWRM command.
33164 */
33165 uint16_t cmpl_ring;
33166 /*
33167 * The sequence ID is used by the driver for tracking multiple
33168 * commands. This ID is treated as opaque data by the firmware and
33169 * the value is returned in the `hwrm_resp_hdr` upon completion.
33170 */
33171 uint16_t seq_id;
33172 /*
33173 * The target ID of the command:
33174 * * 0x0-0xFFF8 - The function ID
33175 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33176 * * 0xFFFD - Reserved for user-space HWRM interface
33177 * * 0xFFFF - HWRM
33178 */
33179 uint16_t target_id;
33180 /*
33181 * A physical address pointer pointing to a host buffer that the
33182 * command's response data will be written. This can be either a host
33183 * physical address (HPA) or a guest physical address (GPA) and must
33184 * point to a physically contiguous block of memory.
33185 */
33186 uint64_t resp_addr;
33187 /*
33188 * This value identifies a set of CFA data structures used for an L2
33189 * context.
33190 */
33191 uint64_t l2_filter_id;
33192 } hwrm_cfa_l2_filter_free_input_t, *phwrm_cfa_l2_filter_free_input_t;
33193
33194 /* hwrm_cfa_l2_filter_free_output (size:128b/16B) */
33195
33196 typedef struct hwrm_cfa_l2_filter_free_output {
33197 /* The specific error status for the command. */
33198 uint16_t error_code;
33199 /* The HWRM command request type. */
33200 uint16_t req_type;
33201 /* The sequence ID from the original command. */
33202 uint16_t seq_id;
33203 /* The length of the response data in number of bytes. */
33204 uint16_t resp_len;
33205 uint8_t unused_0[7];
33206 /*
33207 * This field is used in Output records to indicate that the output
33208 * is completely written to RAM. This field should be read as '1'
33209 * to indicate that the output has been completely written.
33210 * When writing a command completion or response to an internal
33211 * processor, the order of writes has to be such that this field is
33212 * written last.
33213 */
33214 uint8_t valid;
33215 } hwrm_cfa_l2_filter_free_output_t, *phwrm_cfa_l2_filter_free_output_t;
33216
33217 /**************************
33218 * hwrm_cfa_l2_filter_cfg *
33219 **************************/
33220
33221
33222 /* hwrm_cfa_l2_filter_cfg_input (size:320b/40B) */
33223
33224 typedef struct hwrm_cfa_l2_filter_cfg_input {
33225 /* The HWRM command request type. */
33226 uint16_t req_type;
33227 /*
33228 * The completion ring to send the completion event on. This should
33229 * be the NQ ID returned from the `nq_alloc` HWRM command.
33230 */
33231 uint16_t cmpl_ring;
33232 /*
33233 * The sequence ID is used by the driver for tracking multiple
33234 * commands. This ID is treated as opaque data by the firmware and
33235 * the value is returned in the `hwrm_resp_hdr` upon completion.
33236 */
33237 uint16_t seq_id;
33238 /*
33239 * The target ID of the command:
33240 * * 0x0-0xFFF8 - The function ID
33241 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33242 * * 0xFFFD - Reserved for user-space HWRM interface
33243 * * 0xFFFF - HWRM
33244 */
33245 uint16_t target_id;
33246 /*
33247 * A physical address pointer pointing to a host buffer that the
33248 * command's response data will be written. This can be either a host
33249 * physical address (HPA) or a guest physical address (GPA) and must
33250 * point to a physically contiguous block of memory.
33251 */
33252 uint64_t resp_addr;
33253 uint32_t flags;
33254 /*
33255 * Enumeration denoting the RX, TX type of the resource.
33256 * This enumeration is used for resources that are similar for both
33257 * TX and RX paths of the chip.
33258 */
33259 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH UINT32_C(0x1)
33260 /* tx path */
33261 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_TX UINT32_C(0x0)
33262 /* rx path */
33263 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX UINT32_C(0x1)
33264 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_LAST HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX
33265 /*
33266 * Setting of this flag indicates drop action. If this flag is not
33267 * set, then it should be considered accept action.
33268 */
33269 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_DROP UINT32_C(0x2)
33270 /*
33271 * Enumeration denoting NO_ROCE_L2 to support old drivers.
33272 * New driver L2 for only L2 traffic, ROCE for roce and l2 traffic
33273 */
33274 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_MASK UINT32_C(0xc)
33275 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_SFT 2
33276 /* To support old drivers */
33277 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_NO_ROCE_L2 (UINT32_C(0x0) << 2)
33278 /* Only L2 traffic */
33279 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_L2 (UINT32_C(0x1) << 2)
33280 /* Roce & L2 traffic */
33281 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_ROCE (UINT32_C(0x2) << 2)
33282 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_LAST HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_ROCE
33283 uint32_t enables;
33284 /*
33285 * This bit must be '1' for the dst_id field to be
33286 * configured.
33287 */
33288 #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_DST_ID UINT32_C(0x1)
33289 /*
33290 * This bit must be '1' for the new_mirror_vnic_id field to be
33291 * configured.
33292 */
33293 #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID UINT32_C(0x2)
33294 /*
33295 * This value identifies a set of CFA data structures used for an L2
33296 * context.
33297 */
33298 uint64_t l2_filter_id;
33299 /*
33300 * If set, this value shall represent the
33301 * Logical VNIC ID of the destination VNIC for the RX
33302 * path and network port id of the destination port for
33303 * the TX path.
33304 */
33305 uint32_t dst_id;
33306 /*
33307 * New Logical VNIC ID of the VNIC where traffic is
33308 * mirrored.
33309 */
33310 uint32_t new_mirror_vnic_id;
33311 } hwrm_cfa_l2_filter_cfg_input_t, *phwrm_cfa_l2_filter_cfg_input_t;
33312
33313 /* hwrm_cfa_l2_filter_cfg_output (size:128b/16B) */
33314
33315 typedef struct hwrm_cfa_l2_filter_cfg_output {
33316 /* The specific error status for the command. */
33317 uint16_t error_code;
33318 /* The HWRM command request type. */
33319 uint16_t req_type;
33320 /* The sequence ID from the original command. */
33321 uint16_t seq_id;
33322 /* The length of the response data in number of bytes. */
33323 uint16_t resp_len;
33324 uint8_t unused_0[7];
33325 /*
33326 * This field is used in Output records to indicate that the output
33327 * is completely written to RAM. This field should be read as '1'
33328 * to indicate that the output has been completely written.
33329 * When writing a command completion or response to an internal
33330 * processor, the order of writes has to be such that this field is
33331 * written last.
33332 */
33333 uint8_t valid;
33334 } hwrm_cfa_l2_filter_cfg_output_t, *phwrm_cfa_l2_filter_cfg_output_t;
33335
33336 /***************************
33337 * hwrm_cfa_l2_set_rx_mask *
33338 ***************************/
33339
33340
33341 /* hwrm_cfa_l2_set_rx_mask_input (size:448b/56B) */
33342
33343 typedef struct hwrm_cfa_l2_set_rx_mask_input {
33344 /* The HWRM command request type. */
33345 uint16_t req_type;
33346 /*
33347 * The completion ring to send the completion event on. This should
33348 * be the NQ ID returned from the `nq_alloc` HWRM command.
33349 */
33350 uint16_t cmpl_ring;
33351 /*
33352 * The sequence ID is used by the driver for tracking multiple
33353 * commands. This ID is treated as opaque data by the firmware and
33354 * the value is returned in the `hwrm_resp_hdr` upon completion.
33355 */
33356 uint16_t seq_id;
33357 /*
33358 * The target ID of the command:
33359 * * 0x0-0xFFF8 - The function ID
33360 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33361 * * 0xFFFD - Reserved for user-space HWRM interface
33362 * * 0xFFFF - HWRM
33363 */
33364 uint16_t target_id;
33365 /*
33366 * A physical address pointer pointing to a host buffer that the
33367 * command's response data will be written. This can be either a host
33368 * physical address (HPA) or a guest physical address (GPA) and must
33369 * point to a physically contiguous block of memory.
33370 */
33371 uint64_t resp_addr;
33372 /* VNIC ID */
33373 uint32_t vnic_id;
33374 uint32_t mask;
33375 /*
33376 * When this bit is '1', the function is requested to accept
33377 * multi-cast packets specified by the multicast addr table.
33378 */
33379 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST UINT32_C(0x2)
33380 /*
33381 * When this bit is '1', the function is requested to accept
33382 * all multi-cast packets.
33383 */
33384 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ALL_MCAST UINT32_C(0x4)
33385 /*
33386 * When this bit is '1', the function is requested to accept
33387 * broadcast packets.
33388 */
33389 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST UINT32_C(0x8)
33390 /*
33391 * When this bit is '1', the function is requested to be
33392 * put in the promiscuous mode.
33393 *
33394 * The HWRM should accept any function to set up
33395 * promiscuous mode.
33396 *
33397 * The HWRM shall follow the semantics below for the
33398 * promiscuous mode support.
33399 * # When partitioning is not enabled on a port
33400 * (i.e. single PF on the port), then the PF shall
33401 * be allowed to be in the promiscuous mode. When the
33402 * PF is in the promiscuous mode, then it shall
33403 * receive all host bound traffic on that port.
33404 * # When partitioning is enabled on a port
33405 * (i.e. multiple PFs per port) and a PF on that
33406 * port is in the promiscuous mode, then the PF
33407 * receives all traffic within that partition as
33408 * identified by a unique identifier for the
33409 * PF (e.g. S-Tag). If a unique outer VLAN
33410 * for the PF is specified, then the setting of
33411 * promiscuous mode on that PF shall result in the
33412 * PF receiving all host bound traffic with matching
33413 * outer VLAN.
33414 * # A VF shall can be set in the promiscuous mode.
33415 * In the promiscuous mode, the VF does not receive any
33416 * traffic unless a unique outer VLAN for the
33417 * VF is specified. If a unique outer VLAN
33418 * for the VF is specified, then the setting of
33419 * promiscuous mode on that VF shall result in the
33420 * VF receiving all host bound traffic with the
33421 * matching outer VLAN.
33422 * # The HWRM shall allow the setting of promiscuous
33423 * mode on a function independently from the
33424 * promiscuous mode settings on other functions.
33425 */
33426 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_PROMISCUOUS UINT32_C(0x10)
33427 /*
33428 * If this flag is set, the corresponding RX
33429 * filters shall be set up to cover multicast/broadcast
33430 * filters for the outermost Layer 2 destination MAC
33431 * address field.
33432 */
33433 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_OUTERMOST UINT32_C(0x20)
33434 /*
33435 * If this flag is set, the corresponding RX
33436 * filters shall be set up to cover multicast/broadcast
33437 * filters for the VLAN-tagged packets that match the
33438 * TPID and VID fields of VLAN tags in the VLAN tag
33439 * table specified in this command.
33440 */
33441 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLANONLY UINT32_C(0x40)
33442 /*
33443 * If this flag is set, the corresponding RX
33444 * filters shall be set up to cover multicast/broadcast
33445 * filters for non-VLAN tagged packets and VLAN-tagged
33446 * packets that match the TPID and VID fields of VLAN
33447 * tags in the VLAN tag table specified in this command.
33448 */
33449 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLAN_NONVLAN UINT32_C(0x80)
33450 /*
33451 * If this flag is set, the corresponding RX
33452 * filters shall be set up to cover multicast/broadcast
33453 * filters for non-VLAN tagged packets and VLAN-tagged
33454 * packets matching any VLAN tag.
33455 *
33456 * If this flag is set, then the HWRM shall ignore
33457 * VLAN tags specified in vlan_tag_tbl.
33458 *
33459 * If none of vlanonly, vlan_nonvlan, and anyvlan_nonvlan
33460 * flags is set, then the HWRM shall ignore
33461 * VLAN tags specified in vlan_tag_tbl.
33462 *
33463 * The HWRM client shall set at most one flag out of
33464 * vlanonly, vlan_nonvlan, and anyvlan_nonvlan.
33465 */
33466 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ANYVLAN_NONVLAN UINT32_C(0x100)
33467 /* This is the address for mcast address tbl. */
33468 uint64_t mc_tbl_addr;
33469 /*
33470 * This value indicates how many entries in mc_tbl are valid.
33471 * Each entry is 6 bytes.
33472 */
33473 uint32_t num_mc_entries;
33474 uint8_t unused_0[4];
33475 /*
33476 * This is the address for VLAN tag table.
33477 * Each VLAN entry in the table is 4 bytes of a VLAN tag
33478 * including TPID, PCP, DEI, and VID fields in network byte
33479 * order.
33480 */
33481 uint64_t vlan_tag_tbl_addr;
33482 /*
33483 * This value indicates how many entries in vlan_tag_tbl are
33484 * valid. Each entry is 4 bytes.
33485 */
33486 uint32_t num_vlan_tags;
33487 uint8_t unused_1[4];
33488 } hwrm_cfa_l2_set_rx_mask_input_t, *phwrm_cfa_l2_set_rx_mask_input_t;
33489
33490 /* hwrm_cfa_l2_set_rx_mask_output (size:128b/16B) */
33491
33492 typedef struct hwrm_cfa_l2_set_rx_mask_output {
33493 /* The specific error status for the command. */
33494 uint16_t error_code;
33495 /* The HWRM command request type. */
33496 uint16_t req_type;
33497 /* The sequence ID from the original command. */
33498 uint16_t seq_id;
33499 /* The length of the response data in number of bytes. */
33500 uint16_t resp_len;
33501 uint8_t unused_0[7];
33502 /*
33503 * This field is used in Output records to indicate that the output
33504 * is completely written to RAM. This field should be read as '1'
33505 * to indicate that the output has been completely written.
33506 * When writing a command completion or response to an internal
33507 * processor, the order of writes has to be such that this field is
33508 * written last.
33509 */
33510 uint8_t valid;
33511 } hwrm_cfa_l2_set_rx_mask_output_t, *phwrm_cfa_l2_set_rx_mask_output_t;
33512
33513 /* hwrm_cfa_l2_set_rx_mask_cmd_err (size:64b/8B) */
33514
33515 typedef struct hwrm_cfa_l2_set_rx_mask_cmd_err {
33516 /*
33517 * command specific error codes that goes to
33518 * the cmd_err field in Common HWRM Error Response.
33519 */
33520 uint8_t code;
33521 /* Unknown error */
33522 #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
33523 /* Unable to complete operation due to conflict with Ntuple Filter */
33524 #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR UINT32_C(0x1)
33525 #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_LAST HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR
33526 uint8_t unused_0[7];
33527 } hwrm_cfa_l2_set_rx_mask_cmd_err_t, *phwrm_cfa_l2_set_rx_mask_cmd_err_t;
33528
33529 /*******************************
33530 * hwrm_cfa_vlan_antispoof_cfg *
33531 *******************************/
33532
33533
33534 /* hwrm_cfa_vlan_antispoof_cfg_input (size:256b/32B) */
33535
33536 typedef struct hwrm_cfa_vlan_antispoof_cfg_input {
33537 /* The HWRM command request type. */
33538 uint16_t req_type;
33539 /*
33540 * The completion ring to send the completion event on. This should
33541 * be the NQ ID returned from the `nq_alloc` HWRM command.
33542 */
33543 uint16_t cmpl_ring;
33544 /*
33545 * The sequence ID is used by the driver for tracking multiple
33546 * commands. This ID is treated as opaque data by the firmware and
33547 * the value is returned in the `hwrm_resp_hdr` upon completion.
33548 */
33549 uint16_t seq_id;
33550 /*
33551 * The target ID of the command:
33552 * * 0x0-0xFFF8 - The function ID
33553 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33554 * * 0xFFFD - Reserved for user-space HWRM interface
33555 * * 0xFFFF - HWRM
33556 */
33557 uint16_t target_id;
33558 /*
33559 * A physical address pointer pointing to a host buffer that the
33560 * command's response data will be written. This can be either a host
33561 * physical address (HPA) or a guest physical address (GPA) and must
33562 * point to a physically contiguous block of memory.
33563 */
33564 uint64_t resp_addr;
33565 /*
33566 * Function ID of the function that is being configured.
33567 * Only valid for a VF FID configured by the PF.
33568 */
33569 uint16_t fid;
33570 uint8_t unused_0[2];
33571 /* Number of VLAN entries in the vlan_tag_mask_tbl. */
33572 uint32_t num_vlan_entries;
33573 /*
33574 * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN
33575 * antispoof table. Each table entry contains the 16-bit TPID
33576 * (0x8100 or 0x88a8 only), 16-bit VLAN ID, and a 16-bit mask,
33577 * all in network order to match hwrm_cfa_l2_set_rx_mask.
33578 * For an individual VLAN entry, the mask value should be 0xfff
33579 * for the 12-bit VLAN ID.
33580 */
33581 uint64_t vlan_tag_mask_tbl_addr;
33582 } hwrm_cfa_vlan_antispoof_cfg_input_t, *phwrm_cfa_vlan_antispoof_cfg_input_t;
33583
33584 /* hwrm_cfa_vlan_antispoof_cfg_output (size:128b/16B) */
33585
33586 typedef struct hwrm_cfa_vlan_antispoof_cfg_output {
33587 /* The specific error status for the command. */
33588 uint16_t error_code;
33589 /* The HWRM command request type. */
33590 uint16_t req_type;
33591 /* The sequence ID from the original command. */
33592 uint16_t seq_id;
33593 /* The length of the response data in number of bytes. */
33594 uint16_t resp_len;
33595 uint8_t unused_0[7];
33596 /*
33597 * This field is used in Output records to indicate that the output
33598 * is completely written to RAM. This field should be read as '1'
33599 * to indicate that the output has been completely written.
33600 * When writing a command completion or response to an internal
33601 * processor, the order of writes has to be such that this field is
33602 * written last.
33603 */
33604 uint8_t valid;
33605 } hwrm_cfa_vlan_antispoof_cfg_output_t, *phwrm_cfa_vlan_antispoof_cfg_output_t;
33606
33607 /********************************
33608 * hwrm_cfa_vlan_antispoof_qcfg *
33609 ********************************/
33610
33611
33612 /* hwrm_cfa_vlan_antispoof_qcfg_input (size:256b/32B) */
33613
33614 typedef struct hwrm_cfa_vlan_antispoof_qcfg_input {
33615 /* The HWRM command request type. */
33616 uint16_t req_type;
33617 /*
33618 * The completion ring to send the completion event on. This should
33619 * be the NQ ID returned from the `nq_alloc` HWRM command.
33620 */
33621 uint16_t cmpl_ring;
33622 /*
33623 * The sequence ID is used by the driver for tracking multiple
33624 * commands. This ID is treated as opaque data by the firmware and
33625 * the value is returned in the `hwrm_resp_hdr` upon completion.
33626 */
33627 uint16_t seq_id;
33628 /*
33629 * The target ID of the command:
33630 * * 0x0-0xFFF8 - The function ID
33631 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33632 * * 0xFFFD - Reserved for user-space HWRM interface
33633 * * 0xFFFF - HWRM
33634 */
33635 uint16_t target_id;
33636 /*
33637 * A physical address pointer pointing to a host buffer that the
33638 * command's response data will be written. This can be either a host
33639 * physical address (HPA) or a guest physical address (GPA) and must
33640 * point to a physically contiguous block of memory.
33641 */
33642 uint64_t resp_addr;
33643 /*
33644 * Function ID of the function that is being queried.
33645 * Only valid for a VF FID queried by the PF.
33646 */
33647 uint16_t fid;
33648 uint8_t unused_0[2];
33649 /*
33650 * Maximum number of VLAN entries the firmware is allowed to DMA
33651 * to vlan_tag_mask_tbl.
33652 */
33653 uint32_t max_vlan_entries;
33654 /*
33655 * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN
33656 * antispoof table to which firmware will DMA to. Each table
33657 * entry will contain the 16-bit TPID (0x8100 or 0x88a8 only),
33658 * 16-bit VLAN ID, and a 16-bit mask, all in network order to
33659 * match hwrm_cfa_l2_set_rx_mask. For an individual VLAN entry,
33660 * the mask value should be 0xfff for the 12-bit VLAN ID.
33661 */
33662 uint64_t vlan_tag_mask_tbl_addr;
33663 } hwrm_cfa_vlan_antispoof_qcfg_input_t, *phwrm_cfa_vlan_antispoof_qcfg_input_t;
33664
33665 /* hwrm_cfa_vlan_antispoof_qcfg_output (size:128b/16B) */
33666
33667 typedef struct hwrm_cfa_vlan_antispoof_qcfg_output {
33668 /* The specific error status for the command. */
33669 uint16_t error_code;
33670 /* The HWRM command request type. */
33671 uint16_t req_type;
33672 /* The sequence ID from the original command. */
33673 uint16_t seq_id;
33674 /* The length of the response data in number of bytes. */
33675 uint16_t resp_len;
33676 /* Number of valid entries DMAd by firmware to vlan_tag_mask_tbl. */
33677 uint32_t num_vlan_entries;
33678 uint8_t unused_0[3];
33679 /*
33680 * This field is used in Output records to indicate that the output
33681 * is completely written to RAM. This field should be read as '1'
33682 * to indicate that the output has been completely written.
33683 * When writing a command completion or response to an internal
33684 * processor, the order of writes has to be such that this field is
33685 * written last.
33686 */
33687 uint8_t valid;
33688 } hwrm_cfa_vlan_antispoof_qcfg_output_t, *phwrm_cfa_vlan_antispoof_qcfg_output_t;
33689
33690 /********************************
33691 * hwrm_cfa_tunnel_filter_alloc *
33692 ********************************/
33693
33694
33695 /* hwrm_cfa_tunnel_filter_alloc_input (size:704b/88B) */
33696
33697 typedef struct hwrm_cfa_tunnel_filter_alloc_input {
33698 /* The HWRM command request type. */
33699 uint16_t req_type;
33700 /*
33701 * The completion ring to send the completion event on. This should
33702 * be the NQ ID returned from the `nq_alloc` HWRM command.
33703 */
33704 uint16_t cmpl_ring;
33705 /*
33706 * The sequence ID is used by the driver for tracking multiple
33707 * commands. This ID is treated as opaque data by the firmware and
33708 * the value is returned in the `hwrm_resp_hdr` upon completion.
33709 */
33710 uint16_t seq_id;
33711 /*
33712 * The target ID of the command:
33713 * * 0x0-0xFFF8 - The function ID
33714 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33715 * * 0xFFFD - Reserved for user-space HWRM interface
33716 * * 0xFFFF - HWRM
33717 */
33718 uint16_t target_id;
33719 /*
33720 * A physical address pointer pointing to a host buffer that the
33721 * command's response data will be written. This can be either a host
33722 * physical address (HPA) or a guest physical address (GPA) and must
33723 * point to a physically contiguous block of memory.
33724 */
33725 uint64_t resp_addr;
33726 uint32_t flags;
33727 /*
33728 * Setting of this flag indicates the applicability to the loopback
33729 * path.
33730 */
33731 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK UINT32_C(0x1)
33732 uint32_t enables;
33733 /*
33734 * This bit must be '1' for the l2_filter_id field to be
33735 * configured.
33736 */
33737 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID UINT32_C(0x1)
33738 /*
33739 * This bit must be '1' for the l2_addr field to be
33740 * configured.
33741 */
33742 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR UINT32_C(0x2)
33743 /*
33744 * This bit must be '1' for the l2_ivlan field to be
33745 * configured.
33746 */
33747 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN UINT32_C(0x4)
33748 /*
33749 * This bit must be '1' for the l3_addr field to be
33750 * configured.
33751 */
33752 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L3_ADDR UINT32_C(0x8)
33753 /*
33754 * This bit must be '1' for the l3_addr_type field to be
33755 * configured.
33756 */
33757 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L3_ADDR_TYPE UINT32_C(0x10)
33758 /*
33759 * This bit must be '1' for the t_l3_addr_type field to be
33760 * configured.
33761 */
33762 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_T_L3_ADDR_TYPE UINT32_C(0x20)
33763 /*
33764 * This bit must be '1' for the t_l3_addr field to be
33765 * configured.
33766 */
33767 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_T_L3_ADDR UINT32_C(0x40)
33768 /*
33769 * This bit must be '1' for the tunnel_type field to be
33770 * configured.
33771 */
33772 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE UINT32_C(0x80)
33773 /*
33774 * This bit must be '1' for the vni field to be
33775 * configured.
33776 */
33777 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_VNI UINT32_C(0x100)
33778 /*
33779 * This bit must be '1' for the dst_vnic_id field to be
33780 * configured.
33781 */
33782 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_DST_VNIC_ID UINT32_C(0x200)
33783 /*
33784 * This bit must be '1' for the mirror_vnic_id field to be
33785 * configured.
33786 */
33787 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID UINT32_C(0x400)
33788 /*
33789 * This value identifies a set of CFA data structures used for an L2
33790 * context.
33791 */
33792 uint64_t l2_filter_id;
33793 /*
33794 * This value sets the match value for the inner L2
33795 * MAC address.
33796 * Destination MAC address for RX path.
33797 * Source MAC address for TX path.
33798 */
33799 uint8_t l2_addr[6];
33800 /*
33801 * This value sets VLAN ID value for inner VLAN.
33802 * Only 12-bits of VLAN ID are used in setting the filter.
33803 */
33804 uint16_t l2_ivlan;
33805 /*
33806 * The value of inner destination IP address to be used in filtering.
33807 * For IPv4, first four bytes represent the IP address.
33808 */
33809 uint32_t l3_addr[4];
33810 /*
33811 * The value of tunnel destination IP address to be used in filtering.
33812 * For IPv4, first four bytes represent the IP address.
33813 */
33814 uint32_t t_l3_addr[4];
33815 /*
33816 * This value indicates the type of inner IP address.
33817 * 4 - IPv4
33818 * 6 - IPv6
33819 * All others are invalid.
33820 */
33821 uint8_t l3_addr_type;
33822 /*
33823 * This value indicates the type of tunnel IP address.
33824 * 4 - IPv4
33825 * 6 - IPv6
33826 * All others are invalid.
33827 */
33828 uint8_t t_l3_addr_type;
33829 /* Tunnel Type. */
33830 uint8_t tunnel_type;
33831 /* Non-tunnel */
33832 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL UINT32_C(0x0)
33833 /* Virtual eXtensible Local Area Network (VXLAN) */
33834 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
33835 /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
33836 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE UINT32_C(0x2)
33837 /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
33838 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE UINT32_C(0x3)
33839 /* IP in IP */
33840 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP UINT32_C(0x4)
33841 /* Generic Network Virtualization Encapsulation (Geneve) */
33842 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
33843 /* Multi-Protocol Label Switching (MPLS) */
33844 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS UINT32_C(0x6)
33845 /* Stateless Transport Tunnel (STT) */
33846 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT UINT32_C(0x7)
33847 /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
33848 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE UINT32_C(0x8)
33849 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
33850 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 UINT32_C(0x9)
33851 /*
33852 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
33853 * datagram payload
33854 */
33855 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 UINT32_C(0xa)
33856 /* Use fixed layer 2 ether type of 0xFFFF */
33857 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE UINT32_C(0xb)
33858 /*
33859 * IPV6 over virtual eXtensible Local Area Network with GPE header
33860 * (IPV6oVXLANGPE)
33861 */
33862 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
33863 /* Any tunneled traffic */
33864 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL UINT32_C(0xff)
33865 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
33866 /*
33867 * tunnel_flags allows the user to indicate the tunnel tag detection
33868 * for the tunnel type specified in tunnel_type.
33869 */
33870 uint8_t tunnel_flags;
33871 /*
33872 * If the tunnel_type is geneve, then this bit indicates if we
33873 * need to match the geneve OAM packet.
33874 * If the tunnel_type is nvgre or gre, then this bit indicates if
33875 * we need to detect checksum present bit in geneve header.
33876 * If the tunnel_type is mpls, then this bit indicates if we need
33877 * to match mpls packet with explicit IPV4/IPV6 null header.
33878 */
33879 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_OAM_CHECKSUM_EXPLHDR UINT32_C(0x1)
33880 /*
33881 * If the tunnel_type is geneve, then this bit indicates if we
33882 * need to detect the critical option bit set in the oam packet.
33883 * If the tunnel_type is nvgre or gre, then this bit indicates
33884 * if we need to match nvgre packets with key present bit set in
33885 * gre header.
33886 * If the tunnel_type is mpls, then this bit indicates if we
33887 * need to match mpls packet with S bit from inner/second label.
33888 */
33889 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_CRITICAL_OPT_S1 UINT32_C(0x2)
33890 /*
33891 * If the tunnel_type is geneve, then this bit indicates if we
33892 * need to match geneve packet with extended header bit set in
33893 * geneve header.
33894 * If the tunnel_type is nvgre or gre, then this bit indicates
33895 * if we need to match nvgre packets with sequence number
33896 * present bit set in gre header.
33897 * If the tunnel_type is mpls, then this bit indicates if we
33898 * need to match mpls packet with S bit from out/first label.
33899 */
33900 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_EXTHDR_SEQNUM_S0 UINT32_C(0x4)
33901 /*
33902 * Virtual Network Identifier (VNI). Only valid with
33903 * tunnel_types VXLAN, NVGRE, and Geneve.
33904 * Only lower 24-bits of VNI field are used
33905 * in setting up the filter.
33906 */
33907 uint32_t vni;
33908 /* Logical VNIC ID of the destination VNIC. */
33909 uint32_t dst_vnic_id;
33910 /*
33911 * Logical VNIC ID of the VNIC where traffic is
33912 * mirrored.
33913 */
33914 uint32_t mirror_vnic_id;
33915 } hwrm_cfa_tunnel_filter_alloc_input_t, *phwrm_cfa_tunnel_filter_alloc_input_t;
33916
33917 /* hwrm_cfa_tunnel_filter_alloc_output (size:192b/24B) */
33918
33919 typedef struct hwrm_cfa_tunnel_filter_alloc_output {
33920 /* The specific error status for the command. */
33921 uint16_t error_code;
33922 /* The HWRM command request type. */
33923 uint16_t req_type;
33924 /* The sequence ID from the original command. */
33925 uint16_t seq_id;
33926 /* The length of the response data in number of bytes. */
33927 uint16_t resp_len;
33928 /* This value is an opaque id into CFA data structures. */
33929 uint64_t tunnel_filter_id;
33930 /*
33931 * The flow id value in bit 0-29 is the actual ID of the flow
33932 * associated with this filter and it shall be used to match
33933 * and associate the flow identifier returned in completion
33934 * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
33935 * shall indicate no valid flow id.
33936 */
33937 uint32_t flow_id;
33938 /* Indicate the flow id value. */
33939 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK UINT32_C(0x3fffffff)
33940 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
33941 /* Indicate type of the flow. */
33942 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE UINT32_C(0x40000000)
33943 /*
33944 * If this bit set to 0, then it indicates that the flow is
33945 * internal flow.
33946 */
33947 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT (UINT32_C(0x0) << 30)
33948 /*
33949 * If this bit is set to 1, then it indicates that the flow is
33950 * external flow.
33951 */
33952 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT (UINT32_C(0x1) << 30)
33953 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
33954 /* Indicate the flow direction. */
33955 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR UINT32_C(0x80000000)
33956 /* If this bit set to 0, then it indicates rx flow. */
33957 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX (UINT32_C(0x0) << 31)
33958 /* If this bit is set to 1, then it indicates that tx flow. */
33959 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX (UINT32_C(0x1) << 31)
33960 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
33961 uint8_t unused_0[3];
33962 /*
33963 * This field is used in Output records to indicate that the output
33964 * is completely written to RAM. This field should be read as '1'
33965 * to indicate that the output has been completely written.
33966 * When writing a command completion or response to an internal
33967 * processor, the order of writes has to be such that this field is
33968 * written last.
33969 */
33970 uint8_t valid;
33971 } hwrm_cfa_tunnel_filter_alloc_output_t, *phwrm_cfa_tunnel_filter_alloc_output_t;
33972
33973 /*******************************
33974 * hwrm_cfa_tunnel_filter_free *
33975 *******************************/
33976
33977
33978 /* hwrm_cfa_tunnel_filter_free_input (size:192b/24B) */
33979
33980 typedef struct hwrm_cfa_tunnel_filter_free_input {
33981 /* The HWRM command request type. */
33982 uint16_t req_type;
33983 /*
33984 * The completion ring to send the completion event on. This should
33985 * be the NQ ID returned from the `nq_alloc` HWRM command.
33986 */
33987 uint16_t cmpl_ring;
33988 /*
33989 * The sequence ID is used by the driver for tracking multiple
33990 * commands. This ID is treated as opaque data by the firmware and
33991 * the value is returned in the `hwrm_resp_hdr` upon completion.
33992 */
33993 uint16_t seq_id;
33994 /*
33995 * The target ID of the command:
33996 * * 0x0-0xFFF8 - The function ID
33997 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33998 * * 0xFFFD - Reserved for user-space HWRM interface
33999 * * 0xFFFF - HWRM
34000 */
34001 uint16_t target_id;
34002 /*
34003 * A physical address pointer pointing to a host buffer that the
34004 * command's response data will be written. This can be either a host
34005 * physical address (HPA) or a guest physical address (GPA) and must
34006 * point to a physically contiguous block of memory.
34007 */
34008 uint64_t resp_addr;
34009 /* This value is an opaque id into CFA data structures. */
34010 uint64_t tunnel_filter_id;
34011 } hwrm_cfa_tunnel_filter_free_input_t, *phwrm_cfa_tunnel_filter_free_input_t;
34012
34013 /* hwrm_cfa_tunnel_filter_free_output (size:128b/16B) */
34014
34015 typedef struct hwrm_cfa_tunnel_filter_free_output {
34016 /* The specific error status for the command. */
34017 uint16_t error_code;
34018 /* The HWRM command request type. */
34019 uint16_t req_type;
34020 /* The sequence ID from the original command. */
34021 uint16_t seq_id;
34022 /* The length of the response data in number of bytes. */
34023 uint16_t resp_len;
34024 uint8_t unused_0[7];
34025 /*
34026 * This field is used in Output records to indicate that the output
34027 * is completely written to RAM. This field should be read as '1'
34028 * to indicate that the output has been completely written.
34029 * When writing a command completion or response to an internal
34030 * processor, the order of writes has to be such that this field is
34031 * written last.
34032 */
34033 uint8_t valid;
34034 } hwrm_cfa_tunnel_filter_free_output_t, *phwrm_cfa_tunnel_filter_free_output_t;
34035
34036 /***************************************
34037 * hwrm_cfa_redirect_tunnel_type_alloc *
34038 ***************************************/
34039
34040
34041 /* hwrm_cfa_redirect_tunnel_type_alloc_input (size:192b/24B) */
34042
34043 typedef struct hwrm_cfa_redirect_tunnel_type_alloc_input {
34044 /* The HWRM command request type. */
34045 uint16_t req_type;
34046 /*
34047 * The completion ring to send the completion event on. This should
34048 * be the NQ ID returned from the `nq_alloc` HWRM command.
34049 */
34050 uint16_t cmpl_ring;
34051 /*
34052 * The sequence ID is used by the driver for tracking multiple
34053 * commands. This ID is treated as opaque data by the firmware and
34054 * the value is returned in the `hwrm_resp_hdr` upon completion.
34055 */
34056 uint16_t seq_id;
34057 /*
34058 * The target ID of the command:
34059 * * 0x0-0xFFF8 - The function ID
34060 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34061 * * 0xFFFD - Reserved for user-space HWRM interface
34062 * * 0xFFFF - HWRM
34063 */
34064 uint16_t target_id;
34065 /*
34066 * A physical address pointer pointing to a host buffer that the
34067 * command's response data will be written. This can be either a host
34068 * physical address (HPA) or a guest physical address (GPA) and must
34069 * point to a physically contiguous block of memory.
34070 */
34071 uint64_t resp_addr;
34072 /* The destination function id, to whom the traffic is redirected. */
34073 uint16_t dest_fid;
34074 /* Tunnel Type. */
34075 uint8_t tunnel_type;
34076 /* Non-tunnel */
34077 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL UINT32_C(0x0)
34078 /* Virtual eXtensible Local Area Network (VXLAN) */
34079 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
34080 /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
34081 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_NVGRE UINT32_C(0x2)
34082 /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
34083 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_L2GRE UINT32_C(0x3)
34084 /* IP in IP */
34085 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPIP UINT32_C(0x4)
34086 /* Generic Network Virtualization Encapsulation (Geneve) */
34087 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
34088 /* Multi-Protocol Label Switching (MPLS) */
34089 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_MPLS UINT32_C(0x6)
34090 /* Stateless Transport Tunnel (STT) */
34091 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_STT UINT32_C(0x7)
34092 /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
34093 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPGRE UINT32_C(0x8)
34094 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
34095 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 UINT32_C(0x9)
34096 /*
34097 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
34098 * datagram payload
34099 */
34100 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 UINT32_C(0xa)
34101 /* Use fixed layer 2 ether type of 0xFFFF */
34102 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE UINT32_C(0xb)
34103 /*
34104 * IPV6 over virtual eXtensible Local Area Network with GPE header
34105 * (IPV6oVXLANGPE)
34106 */
34107 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
34108 /* Any tunneled traffic */
34109 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL UINT32_C(0xff)
34110 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_LAST HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
34111 /* Tunnel alloc flags. */
34112 uint8_t flags;
34113 /*
34114 * Setting of this flag indicates modify existing redirect tunnel
34115 * to new destination function ID.
34116 */
34117 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_FLAGS_MODIFY_DST UINT32_C(0x1)
34118 uint8_t unused_0[4];
34119 } hwrm_cfa_redirect_tunnel_type_alloc_input_t, *phwrm_cfa_redirect_tunnel_type_alloc_input_t;
34120
34121 /* hwrm_cfa_redirect_tunnel_type_alloc_output (size:128b/16B) */
34122
34123 typedef struct hwrm_cfa_redirect_tunnel_type_alloc_output {
34124 /* The specific error status for the command. */
34125 uint16_t error_code;
34126 /* The HWRM command request type. */
34127 uint16_t req_type;
34128 /* The sequence ID from the original command. */
34129 uint16_t seq_id;
34130 /* The length of the response data in number of bytes. */
34131 uint16_t resp_len;
34132 uint8_t unused_0[7];
34133 /*
34134 * This field is used in Output records to indicate that the output
34135 * is completely written to RAM. This field should be read as '1'
34136 * to indicate that the output has been completely written.
34137 * When writing a command completion or response to an internal
34138 * processor, the order of writes has to be such that this field is
34139 * written last.
34140 */
34141 uint8_t valid;
34142 } hwrm_cfa_redirect_tunnel_type_alloc_output_t, *phwrm_cfa_redirect_tunnel_type_alloc_output_t;
34143
34144 /**************************************
34145 * hwrm_cfa_redirect_tunnel_type_free *
34146 **************************************/
34147
34148
34149 /* hwrm_cfa_redirect_tunnel_type_free_input (size:192b/24B) */
34150
34151 typedef struct hwrm_cfa_redirect_tunnel_type_free_input {
34152 /* The HWRM command request type. */
34153 uint16_t req_type;
34154 /*
34155 * The completion ring to send the completion event on. This should
34156 * be the NQ ID returned from the `nq_alloc` HWRM command.
34157 */
34158 uint16_t cmpl_ring;
34159 /*
34160 * The sequence ID is used by the driver for tracking multiple
34161 * commands. This ID is treated as opaque data by the firmware and
34162 * the value is returned in the `hwrm_resp_hdr` upon completion.
34163 */
34164 uint16_t seq_id;
34165 /*
34166 * The target ID of the command:
34167 * * 0x0-0xFFF8 - The function ID
34168 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34169 * * 0xFFFD - Reserved for user-space HWRM interface
34170 * * 0xFFFF - HWRM
34171 */
34172 uint16_t target_id;
34173 /*
34174 * A physical address pointer pointing to a host buffer that the
34175 * command's response data will be written. This can be either a host
34176 * physical address (HPA) or a guest physical address (GPA) and must
34177 * point to a physically contiguous block of memory.
34178 */
34179 uint64_t resp_addr;
34180 /* The destination function id, to whom the traffic is redirected. */
34181 uint16_t dest_fid;
34182 /* Tunnel Type. */
34183 uint8_t tunnel_type;
34184 /* Non-tunnel */
34185 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_NONTUNNEL UINT32_C(0x0)
34186 /* Virtual eXtensible Local Area Network (VXLAN) */
34187 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
34188 /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
34189 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_NVGRE UINT32_C(0x2)
34190 /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
34191 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_L2GRE UINT32_C(0x3)
34192 /* IP in IP */
34193 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPIP UINT32_C(0x4)
34194 /* Generic Network Virtualization Encapsulation (Geneve) */
34195 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
34196 /* Multi-Protocol Label Switching (MPLS) */
34197 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_MPLS UINT32_C(0x6)
34198 /* Stateless Transport Tunnel (STT) */
34199 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_STT UINT32_C(0x7)
34200 /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
34201 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPGRE UINT32_C(0x8)
34202 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
34203 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN_V4 UINT32_C(0x9)
34204 /*
34205 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
34206 * datagram payload
34207 */
34208 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPGRE_V1 UINT32_C(0xa)
34209 /* Use fixed layer 2 ether type of 0xFFFF */
34210 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_L2_ETYPE UINT32_C(0xb)
34211 /*
34212 * IPV6 over virtual eXtensible Local Area Network with GPE header
34213 * (IPV6oVXLANGPE)
34214 */
34215 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
34216 /* Any tunneled traffic */
34217 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_ANYTUNNEL UINT32_C(0xff)
34218 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_LAST HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_ANYTUNNEL
34219 uint8_t unused_0[5];
34220 } hwrm_cfa_redirect_tunnel_type_free_input_t, *phwrm_cfa_redirect_tunnel_type_free_input_t;
34221
34222 /* hwrm_cfa_redirect_tunnel_type_free_output (size:128b/16B) */
34223
34224 typedef struct hwrm_cfa_redirect_tunnel_type_free_output {
34225 /* The specific error status for the command. */
34226 uint16_t error_code;
34227 /* The HWRM command request type. */
34228 uint16_t req_type;
34229 /* The sequence ID from the original command. */
34230 uint16_t seq_id;
34231 /* The length of the response data in number of bytes. */
34232 uint16_t resp_len;
34233 uint8_t unused_0[7];
34234 /*
34235 * This field is used in Output records to indicate that the output
34236 * is completely written to RAM. This field should be read as '1'
34237 * to indicate that the output has been completely written.
34238 * When writing a command completion or response to an internal
34239 * processor, the order of writes has to be such that this field is
34240 * written last.
34241 */
34242 uint8_t valid;
34243 } hwrm_cfa_redirect_tunnel_type_free_output_t, *phwrm_cfa_redirect_tunnel_type_free_output_t;
34244
34245 /**************************************
34246 * hwrm_cfa_redirect_tunnel_type_info *
34247 **************************************/
34248
34249
34250 /* hwrm_cfa_redirect_tunnel_type_info_input (size:192b/24B) */
34251
34252 typedef struct hwrm_cfa_redirect_tunnel_type_info_input {
34253 /* The HWRM command request type. */
34254 uint16_t req_type;
34255 /*
34256 * The completion ring to send the completion event on. This should
34257 * be the NQ ID returned from the `nq_alloc` HWRM command.
34258 */
34259 uint16_t cmpl_ring;
34260 /*
34261 * The sequence ID is used by the driver for tracking multiple
34262 * commands. This ID is treated as opaque data by the firmware and
34263 * the value is returned in the `hwrm_resp_hdr` upon completion.
34264 */
34265 uint16_t seq_id;
34266 /*
34267 * The target ID of the command:
34268 * * 0x0-0xFFF8 - The function ID
34269 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34270 * * 0xFFFD - Reserved for user-space HWRM interface
34271 * * 0xFFFF - HWRM
34272 */
34273 uint16_t target_id;
34274 /*
34275 * A physical address pointer pointing to a host buffer that the
34276 * command's response data will be written. This can be either a host
34277 * physical address (HPA) or a guest physical address (GPA) and must
34278 * point to a physically contiguous block of memory.
34279 */
34280 uint64_t resp_addr;
34281 /* The source function id. */
34282 uint16_t src_fid;
34283 /* Tunnel Type. */
34284 uint8_t tunnel_type;
34285 /* Non-tunnel */
34286 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_NONTUNNEL UINT32_C(0x0)
34287 /* Virtual eXtensible Local Area Network (VXLAN) */
34288 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
34289 /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
34290 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_NVGRE UINT32_C(0x2)
34291 /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
34292 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_L2GRE UINT32_C(0x3)
34293 /* IP in IP */
34294 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPIP UINT32_C(0x4)
34295 /* Generic Network Virtualization Encapsulation (Geneve) */
34296 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
34297 /* Multi-Protocol Label Switching (MPLS) */
34298 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_MPLS UINT32_C(0x6)
34299 /* Stateless Transport Tunnel (STT) */
34300 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_STT UINT32_C(0x7)
34301 /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
34302 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPGRE UINT32_C(0x8)
34303 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
34304 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN_V4 UINT32_C(0x9)
34305 /*
34306 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
34307 * datagram payload
34308 */
34309 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPGRE_V1 UINT32_C(0xa)
34310 /* Use fixed layer 2 ether type of 0xFFFF */
34311 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_L2_ETYPE UINT32_C(0xb)
34312 /*
34313 * IPV6 over virtual eXtensible Local Area Network with GPE header
34314 * (IPV6oVXLANGPE)
34315 */
34316 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
34317 /* Any tunneled traffic */
34318 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_ANYTUNNEL UINT32_C(0xff)
34319 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_LAST HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_ANYTUNNEL
34320 uint8_t unused_0[5];
34321 } hwrm_cfa_redirect_tunnel_type_info_input_t, *phwrm_cfa_redirect_tunnel_type_info_input_t;
34322
34323 /* hwrm_cfa_redirect_tunnel_type_info_output (size:128b/16B) */
34324
34325 typedef struct hwrm_cfa_redirect_tunnel_type_info_output {
34326 /* The specific error status for the command. */
34327 uint16_t error_code;
34328 /* The HWRM command request type. */
34329 uint16_t req_type;
34330 /* The sequence ID from the original command. */
34331 uint16_t seq_id;
34332 /* The length of the response data in number of bytes. */
34333 uint16_t resp_len;
34334 /* The destination function id, to whom the traffic is redirected. */
34335 uint16_t dest_fid;
34336 uint8_t unused_0[5];
34337 /*
34338 * This field is used in Output records to indicate that the output
34339 * is completely written to RAM. This field should be read as '1'
34340 * to indicate that the output has been completely written.
34341 * When writing a command completion or response to an internal
34342 * processor, the order of writes has to be such that this field is
34343 * written last.
34344 */
34345 uint8_t valid;
34346 } hwrm_cfa_redirect_tunnel_type_info_output_t, *phwrm_cfa_redirect_tunnel_type_info_output_t;
34347
34348 /* hwrm_vxlan_ipv4_hdr (size:128b/16B) */
34349
34350 typedef struct hwrm_vxlan_ipv4_hdr {
34351 /* IPv4 version and header length. */
34352 uint8_t ver_hlen;
34353 /* IPv4 header length */
34354 #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_HEADER_LENGTH_MASK UINT32_C(0xf)
34355 #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_HEADER_LENGTH_SFT 0
34356 /* Version */
34357 #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_VERSION_MASK UINT32_C(0xf0)
34358 #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_VERSION_SFT 4
34359 /* IPv4 type of service. */
34360 uint8_t tos;
34361 /* IPv4 identification. */
34362 uint16_t ip_id;
34363 /* IPv4 flags and offset. */
34364 uint16_t flags_frag_offset;
34365 /* IPv4 TTL. */
34366 uint8_t ttl;
34367 /* IPv4 protocol. */
34368 uint8_t protocol;
34369 /* IPv4 source address. */
34370 uint32_t src_ip_addr;
34371 /* IPv4 destination address. */
34372 uint32_t dest_ip_addr;
34373 } hwrm_vxlan_ipv4_hdr_t, *phwrm_vxlan_ipv4_hdr_t;
34374
34375 /* hwrm_vxlan_ipv6_hdr (size:320b/40B) */
34376
34377 typedef struct hwrm_vxlan_ipv6_hdr {
34378 /* IPv6 version, traffic class and flow label. */
34379 uint32_t ver_tc_flow_label;
34380 /* IPv6 version shift */
34381 #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_VER_SFT UINT32_C(0x1c)
34382 /* IPv6 version mask */
34383 #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_VER_MASK UINT32_C(0xf0000000)
34384 /* IPv6 TC shift */
34385 #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_TC_SFT UINT32_C(0x14)
34386 /* IPv6 TC mask */
34387 #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_TC_MASK UINT32_C(0xff00000)
34388 /* IPv6 flow label shift */
34389 #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_SFT UINT32_C(0x0)
34390 /* IPv6 flow label mask */
34391 #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_MASK UINT32_C(0xfffff)
34392 #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_LAST HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_MASK
34393 /* IPv6 payload length. */
34394 uint16_t payload_len;
34395 /* IPv6 next header. */
34396 uint8_t next_hdr;
34397 /* IPv6 TTL. */
34398 uint8_t ttl;
34399 /* IPv6 source address. */
34400 uint32_t src_ip_addr[4];
34401 /* IPv6 destination address. */
34402 uint32_t dest_ip_addr[4];
34403 } hwrm_vxlan_ipv6_hdr_t, *phwrm_vxlan_ipv6_hdr_t;
34404
34405 /* hwrm_cfa_encap_data_vxlan (size:640b/80B) */
34406
34407 typedef struct hwrm_cfa_encap_data_vxlan {
34408 /* Source MAC address. */
34409 uint8_t src_mac_addr[6];
34410 /* reserved. */
34411 uint16_t unused_0;
34412 /* Destination MAC address. */
34413 uint8_t dst_mac_addr[6];
34414 /* Number of VLAN tags. */
34415 uint8_t num_vlan_tags;
34416 /* reserved. */
34417 uint8_t unused_1;
34418 /* Outer VLAN TPID. */
34419 uint16_t ovlan_tpid;
34420 /* Outer VLAN TCI. */
34421 uint16_t ovlan_tci;
34422 /* Inner VLAN TPID. */
34423 uint16_t ivlan_tpid;
34424 /* Inner VLAN TCI. */
34425 uint16_t ivlan_tci;
34426 /* L3 header fields. */
34427 uint32_t l3[10];
34428 /* IP version mask. */
34429 #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_MASK UINT32_C(0xf)
34430 /* IP version 4. */
34431 #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV4 UINT32_C(0x4)
34432 /* IP version 6. */
34433 #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV6 UINT32_C(0x6)
34434 #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_LAST HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV6
34435 /* UDP source port. */
34436 uint16_t src_port;
34437 /* UDP destination port. */
34438 uint16_t dst_port;
34439 /* VXLAN Network Identifier. */
34440 uint32_t vni;
34441 /*
34442 * 3 bytes VXLAN header reserve fields from 1st dword of the VXLAN
34443 * header.
34444 */
34445 uint8_t hdr_rsvd0[3];
34446 /* 1 byte VXLAN header reserve field from 2nd dword of the VXLAN header. */
34447 uint8_t hdr_rsvd1;
34448 /* VXLAN header flags field. */
34449 uint8_t hdr_flags;
34450 uint8_t unused[3];
34451 } hwrm_cfa_encap_data_vxlan_t, *phwrm_cfa_encap_data_vxlan_t;
34452
34453 /*******************************
34454 * hwrm_cfa_encap_record_alloc *
34455 *******************************/
34456
34457
34458 /* hwrm_cfa_encap_record_alloc_input (size:832b/104B) */
34459
34460 typedef struct hwrm_cfa_encap_record_alloc_input {
34461 /* The HWRM command request type. */
34462 uint16_t req_type;
34463 /*
34464 * The completion ring to send the completion event on. This should
34465 * be the NQ ID returned from the `nq_alloc` HWRM command.
34466 */
34467 uint16_t cmpl_ring;
34468 /*
34469 * The sequence ID is used by the driver for tracking multiple
34470 * commands. This ID is treated as opaque data by the firmware and
34471 * the value is returned in the `hwrm_resp_hdr` upon completion.
34472 */
34473 uint16_t seq_id;
34474 /*
34475 * The target ID of the command:
34476 * * 0x0-0xFFF8 - The function ID
34477 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34478 * * 0xFFFD - Reserved for user-space HWRM interface
34479 * * 0xFFFF - HWRM
34480 */
34481 uint16_t target_id;
34482 /*
34483 * A physical address pointer pointing to a host buffer that the
34484 * command's response data will be written. This can be either a host
34485 * physical address (HPA) or a guest physical address (GPA) and must
34486 * point to a physically contiguous block of memory.
34487 */
34488 uint64_t resp_addr;
34489 uint32_t flags;
34490 /*
34491 * Setting of this flag indicates the applicability to the loopback
34492 * path.
34493 */
34494 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_FLAGS_LOOPBACK UINT32_C(0x1)
34495 /*
34496 * Setting of this flag indicates this encap record is external
34497 * encap record. Resetting of this flag indicates this flag is
34498 * internal encap record and this is the default setting.
34499 */
34500 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_FLAGS_EXTERNAL UINT32_C(0x2)
34501 /* Encapsulation Type. */
34502 uint8_t encap_type;
34503 /* Virtual eXtensible Local Area Network (VXLAN) */
34504 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN UINT32_C(0x1)
34505 /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
34506 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_NVGRE UINT32_C(0x2)
34507 /* Generic Routing Encapsulation (GRE) after inside Ethernet payload */
34508 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_L2GRE UINT32_C(0x3)
34509 /* IP in IP */
34510 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPIP UINT32_C(0x4)
34511 /* Generic Network Virtualization Encapsulation (Geneve) */
34512 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_GENEVE UINT32_C(0x5)
34513 /* Multi-Protocol Label Switching (MPLS) */
34514 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_MPLS UINT32_C(0x6)
34515 /* VLAN */
34516 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VLAN UINT32_C(0x7)
34517 /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
34518 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPGRE UINT32_C(0x8)
34519 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
34520 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_V4 UINT32_C(0x9)
34521 /*
34522 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
34523 * datagram payload
34524 */
34525 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPGRE_V1 UINT32_C(0xa)
34526 /* Use fixed layer 2 ether type of 0xFFFF */
34527 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_L2_ETYPE UINT32_C(0xb)
34528 /*
34529 * IPV6 over virtual eXtensible Local Area Network with GPE header
34530 * (IPV6oVXLANGPE)
34531 */
34532 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
34533 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_LAST HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_GPE_V6
34534 uint8_t unused_0[3];
34535 /* This value is encap data used for the given encap type. */
34536 uint32_t encap_data[20];
34537 } hwrm_cfa_encap_record_alloc_input_t, *phwrm_cfa_encap_record_alloc_input_t;
34538
34539 /* hwrm_cfa_encap_record_alloc_output (size:128b/16B) */
34540
34541 typedef struct hwrm_cfa_encap_record_alloc_output {
34542 /* The specific error status for the command. */
34543 uint16_t error_code;
34544 /* The HWRM command request type. */
34545 uint16_t req_type;
34546 /* The sequence ID from the original command. */
34547 uint16_t seq_id;
34548 /* The length of the response data in number of bytes. */
34549 uint16_t resp_len;
34550 /* This value is an opaque id into CFA data structures. */
34551 uint32_t encap_record_id;
34552 uint8_t unused_0[3];
34553 /*
34554 * This field is used in Output records to indicate that the output
34555 * is completely written to RAM. This field should be read as '1'
34556 * to indicate that the output has been completely written.
34557 * When writing a command completion or response to an internal
34558 * processor, the order of writes has to be such that this field is
34559 * written last.
34560 */
34561 uint8_t valid;
34562 } hwrm_cfa_encap_record_alloc_output_t, *phwrm_cfa_encap_record_alloc_output_t;
34563
34564 /******************************
34565 * hwrm_cfa_encap_record_free *
34566 ******************************/
34567
34568
34569 /* hwrm_cfa_encap_record_free_input (size:192b/24B) */
34570
34571 typedef struct hwrm_cfa_encap_record_free_input {
34572 /* The HWRM command request type. */
34573 uint16_t req_type;
34574 /*
34575 * The completion ring to send the completion event on. This should
34576 * be the NQ ID returned from the `nq_alloc` HWRM command.
34577 */
34578 uint16_t cmpl_ring;
34579 /*
34580 * The sequence ID is used by the driver for tracking multiple
34581 * commands. This ID is treated as opaque data by the firmware and
34582 * the value is returned in the `hwrm_resp_hdr` upon completion.
34583 */
34584 uint16_t seq_id;
34585 /*
34586 * The target ID of the command:
34587 * * 0x0-0xFFF8 - The function ID
34588 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34589 * * 0xFFFD - Reserved for user-space HWRM interface
34590 * * 0xFFFF - HWRM
34591 */
34592 uint16_t target_id;
34593 /*
34594 * A physical address pointer pointing to a host buffer that the
34595 * command's response data will be written. This can be either a host
34596 * physical address (HPA) or a guest physical address (GPA) and must
34597 * point to a physically contiguous block of memory.
34598 */
34599 uint64_t resp_addr;
34600 /* This value is an opaque id into CFA data structures. */
34601 uint32_t encap_record_id;
34602 uint8_t unused_0[4];
34603 } hwrm_cfa_encap_record_free_input_t, *phwrm_cfa_encap_record_free_input_t;
34604
34605 /* hwrm_cfa_encap_record_free_output (size:128b/16B) */
34606
34607 typedef struct hwrm_cfa_encap_record_free_output {
34608 /* The specific error status for the command. */
34609 uint16_t error_code;
34610 /* The HWRM command request type. */
34611 uint16_t req_type;
34612 /* The sequence ID from the original command. */
34613 uint16_t seq_id;
34614 /* The length of the response data in number of bytes. */
34615 uint16_t resp_len;
34616 uint8_t unused_0[7];
34617 /*
34618 * This field is used in Output records to indicate that the output
34619 * is completely written to RAM. This field should be read as '1'
34620 * to indicate that the output has been completely written.
34621 * When writing a command completion or response to an internal
34622 * processor, the order of writes has to be such that this field is
34623 * written last.
34624 */
34625 uint8_t valid;
34626 } hwrm_cfa_encap_record_free_output_t, *phwrm_cfa_encap_record_free_output_t;
34627
34628 /********************************
34629 * hwrm_cfa_ntuple_filter_alloc *
34630 ********************************/
34631
34632
34633 /* hwrm_cfa_ntuple_filter_alloc_input (size:1024b/128B) */
34634
34635 typedef struct hwrm_cfa_ntuple_filter_alloc_input {
34636 /* The HWRM command request type. */
34637 uint16_t req_type;
34638 /*
34639 * The completion ring to send the completion event on. This should
34640 * be the NQ ID returned from the `nq_alloc` HWRM command.
34641 */
34642 uint16_t cmpl_ring;
34643 /*
34644 * The sequence ID is used by the driver for tracking multiple
34645 * commands. This ID is treated as opaque data by the firmware and
34646 * the value is returned in the `hwrm_resp_hdr` upon completion.
34647 */
34648 uint16_t seq_id;
34649 /*
34650 * The target ID of the command:
34651 * * 0x0-0xFFF8 - The function ID
34652 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34653 * * 0xFFFD - Reserved for user-space HWRM interface
34654 * * 0xFFFF - HWRM
34655 */
34656 uint16_t target_id;
34657 /*
34658 * A physical address pointer pointing to a host buffer that the
34659 * command's response data will be written. This can be either a host
34660 * physical address (HPA) or a guest physical address (GPA) and must
34661 * point to a physically contiguous block of memory.
34662 */
34663 uint64_t resp_addr;
34664 uint32_t flags;
34665 /*
34666 * Setting of this flag indicates the applicability to the loopback
34667 * path.
34668 */
34669 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK UINT32_C(0x1)
34670 /*
34671 * Setting of this flag indicates drop action. If this flag is not
34672 * set, then it should be considered accept action.
34673 */
34674 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DROP UINT32_C(0x2)
34675 /*
34676 * Setting of this flag indicates that a meter is expected to be
34677 * attached to this flow. This hint can be used when choosing the
34678 * action record format required for the flow.
34679 */
34680 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_METER UINT32_C(0x4)
34681 /*
34682 * Setting of this flag indicates that the dst_id field contains
34683 * function ID. If this is not set it indicates dest_id is VNIC
34684 * or VPORT.
34685 */
34686 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DEST_FID UINT32_C(0x8)
34687 /*
34688 * Setting of this flag indicates match on arp reply when ethertype
34689 * is 0x0806. If this is not set it indicates no specific arp opcode
34690 * matching.
34691 */
34692 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_ARP_REPLY UINT32_C(0x10)
34693 /*
34694 * Setting of this flag indicates that the dst_id field contains RFS
34695 * ring table index. If this is not set it indicates dst_id is VNIC
34696 * or VPORT or function ID. Note dest_fid and dest_rfs_ring_idx
34697 * can’t be set at the same time.
34698 */
34699 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DEST_RFS_RING_IDX UINT32_C(0x20)
34700 uint32_t enables;
34701 /*
34702 * This bit must be '1' for the l2_filter_id field to be
34703 * configured.
34704 */
34705 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID UINT32_C(0x1)
34706 /*
34707 * This bit must be '1' for the ethertype field to be
34708 * configured.
34709 */
34710 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE UINT32_C(0x2)
34711 /*
34712 * This bit must be '1' for the tunnel_type field to be
34713 * configured.
34714 */
34715 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE UINT32_C(0x4)
34716 /*
34717 * This bit must be '1' for the src_macaddr field to be
34718 * configured.
34719 */
34720 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR UINT32_C(0x8)
34721 /*
34722 * This bit must be '1' for the ipaddr_type field to be
34723 * configured.
34724 */
34725 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE UINT32_C(0x10)
34726 /*
34727 * This bit must be '1' for the src_ipaddr field to be
34728 * configured.
34729 */
34730 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR UINT32_C(0x20)
34731 /*
34732 * This bit must be '1' for the src_ipaddr_mask field to be
34733 * configured.
34734 */
34735 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR_MASK UINT32_C(0x40)
34736 /*
34737 * This bit must be '1' for the dst_ipaddr field to be
34738 * configured.
34739 */
34740 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR UINT32_C(0x80)
34741 /*
34742 * This bit must be '1' for the dst_ipaddr_mask field to be
34743 * configured.
34744 */
34745 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR_MASK UINT32_C(0x100)
34746 /*
34747 * This bit must be '1' for the ip_protocol field to be
34748 * configured.
34749 */
34750 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL UINT32_C(0x200)
34751 /*
34752 * This bit must be '1' for the src_port field to be
34753 * configured.
34754 */
34755 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT UINT32_C(0x400)
34756 /*
34757 * This bit must be '1' for the src_port_mask field to be
34758 * configured.
34759 */
34760 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT_MASK UINT32_C(0x800)
34761 /*
34762 * This bit must be '1' for the dst_port field to be
34763 * configured.
34764 */
34765 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT UINT32_C(0x1000)
34766 /*
34767 * This bit must be '1' for the dst_port_mask field to be
34768 * configured.
34769 */
34770 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT_MASK UINT32_C(0x2000)
34771 /*
34772 * This bit must be '1' for the pri_hint field to be
34773 * configured.
34774 */
34775 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_PRI_HINT UINT32_C(0x4000)
34776 /*
34777 * This bit must be '1' for the ntuple_filter_id field to be
34778 * configured.
34779 */
34780 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_NTUPLE_FILTER_ID UINT32_C(0x8000)
34781 /*
34782 * This bit must be '1' for the dst_id field to be
34783 * configured.
34784 */
34785 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_ID UINT32_C(0x10000)
34786 /*
34787 * This bit must be '1' for the mirror_vnic_id field to be
34788 * configured.
34789 */
34790 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID UINT32_C(0x20000)
34791 /*
34792 * This bit must be '1' for the dst_macaddr field to be
34793 * configured.
34794 */
34795 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR UINT32_C(0x40000)
34796 /* This flag is deprecated. */
34797 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_RFS_RING_TBL_IDX UINT32_C(0x80000)
34798 /*
34799 * This value identifies a set of CFA data structures used for an L2
34800 * context.
34801 */
34802 uint64_t l2_filter_id;
34803 /*
34804 * This value indicates the source MAC address in
34805 * the Ethernet header.
34806 */
34807 uint8_t src_macaddr[6];
34808 /* This value indicates the ethertype in the Ethernet header. */
34809 uint16_t ethertype;
34810 /*
34811 * This value indicates the type of IP address.
34812 * 4 - IPv4
34813 * 6 - IPv6
34814 * All others are invalid.
34815 */
34816 uint8_t ip_addr_type;
34817 /* invalid */
34818 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN UINT32_C(0x0)
34819 /* IPv4 */
34820 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 UINT32_C(0x4)
34821 /* IPv6 */
34822 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 UINT32_C(0x6)
34823 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
34824 /*
34825 * The value of protocol filed in IP header.
34826 * Applies to UDP and TCP traffic.
34827 * 6 - TCP
34828 * 17 - UDP
34829 */
34830 uint8_t ip_protocol;
34831 /* invalid */
34832 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN UINT32_C(0x0)
34833 /* TCP */
34834 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP UINT32_C(0x6)
34835 /* UDP */
34836 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP UINT32_C(0x11)
34837 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP
34838 /*
34839 * If set, this value shall represent the
34840 * Logical VNIC ID of the destination VNIC for the RX
34841 * path and network port id of the destination port for
34842 * the TX path.
34843 */
34844 uint16_t dst_id;
34845 /*
34846 * Logical VNIC ID of the VNIC where traffic is
34847 * mirrored.
34848 */
34849 uint16_t mirror_vnic_id;
34850 /*
34851 * This value indicates the tunnel type for this filter.
34852 * If this field is not specified, then the filter shall
34853 * apply to both non-tunneled and tunneled packets.
34854 * If this field conflicts with the tunnel_type specified
34855 * in the l2_filter_id, then the HWRM shall return an
34856 * error for this command.
34857 */
34858 uint8_t tunnel_type;
34859 /* Non-tunnel */
34860 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL UINT32_C(0x0)
34861 /* Virtual eXtensible Local Area Network (VXLAN) */
34862 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
34863 /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
34864 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE UINT32_C(0x2)
34865 /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
34866 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE UINT32_C(0x3)
34867 /* IP in IP */
34868 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP UINT32_C(0x4)
34869 /* Generic Network Virtualization Encapsulation (Geneve) */
34870 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
34871 /* Multi-Protocol Label Switching (MPLS) */
34872 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS UINT32_C(0x6)
34873 /* Stateless Transport Tunnel (STT) */
34874 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT UINT32_C(0x7)
34875 /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
34876 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE UINT32_C(0x8)
34877 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
34878 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 UINT32_C(0x9)
34879 /*
34880 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
34881 * datagram payload
34882 */
34883 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 UINT32_C(0xa)
34884 /* Use fixed layer 2 ether type of 0xFFFF */
34885 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE UINT32_C(0xb)
34886 /*
34887 * IPV6 over virtual eXtensible Local Area Network with GPE header
34888 * (IPV6oVXLANGPE)
34889 */
34890 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
34891 /* Any tunneled traffic */
34892 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL UINT32_C(0xff)
34893 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
34894 /*
34895 * This hint is provided to help in placing
34896 * the filter in the filter table.
34897 */
34898 uint8_t pri_hint;
34899 /* No preference */
34900 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER UINT32_C(0x0)
34901 /* Above the given filter */
34902 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE UINT32_C(0x1)
34903 /* Below the given filter */
34904 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_BELOW UINT32_C(0x2)
34905 /* As high as possible */
34906 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_HIGHEST UINT32_C(0x3)
34907 /* As low as possible */
34908 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST UINT32_C(0x4)
34909 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LAST HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST
34910 /*
34911 * The value of source IP address to be used in filtering.
34912 * For IPv4, first four bytes represent the IP address.
34913 */
34914 uint32_t src_ipaddr[4];
34915 /*
34916 * The value of source IP address mask to be used in
34917 * filtering.
34918 * For IPv4, first four bytes represent the IP address mask.
34919 */
34920 uint32_t src_ipaddr_mask[4];
34921 /*
34922 * The value of destination IP address to be used in filtering.
34923 * For IPv4, first four bytes represent the IP address.
34924 */
34925 uint32_t dst_ipaddr[4];
34926 /*
34927 * The value of destination IP address mask to be used in
34928 * filtering.
34929 * For IPv4, first four bytes represent the IP address mask.
34930 */
34931 uint32_t dst_ipaddr_mask[4];
34932 /*
34933 * The value of source port to be used in filtering.
34934 * Applies to UDP and TCP traffic.
34935 */
34936 uint16_t src_port;
34937 /*
34938 * The value of source port mask to be used in filtering.
34939 * Applies to UDP and TCP traffic.
34940 */
34941 uint16_t src_port_mask;
34942 /*
34943 * The value of destination port to be used in filtering.
34944 * Applies to UDP and TCP traffic.
34945 */
34946 uint16_t dst_port;
34947 /*
34948 * The value of destination port mask to be used in
34949 * filtering.
34950 * Applies to UDP and TCP traffic.
34951 */
34952 uint16_t dst_port_mask;
34953 /*
34954 * This is the ID of the filter that goes along with
34955 * the pri_hint.
34956 */
34957 uint64_t ntuple_filter_id_hint;
34958 } hwrm_cfa_ntuple_filter_alloc_input_t, *phwrm_cfa_ntuple_filter_alloc_input_t;
34959
34960 /* hwrm_cfa_ntuple_filter_alloc_output (size:192b/24B) */
34961
34962 typedef struct hwrm_cfa_ntuple_filter_alloc_output {
34963 /* The specific error status for the command. */
34964 uint16_t error_code;
34965 /* The HWRM command request type. */
34966 uint16_t req_type;
34967 /* The sequence ID from the original command. */
34968 uint16_t seq_id;
34969 /* The length of the response data in number of bytes. */
34970 uint16_t resp_len;
34971 /* This value is an opaque id into CFA data structures. */
34972 uint64_t ntuple_filter_id;
34973 /*
34974 * The flow id value in bit 0-29 is the actual ID of the flow
34975 * associated with this filter and it shall be used to match
34976 * and associate the flow identifier returned in completion
34977 * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
34978 * shall indicate no valid flow id.
34979 */
34980 uint32_t flow_id;
34981 /* Indicate the flow id value. */
34982 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK UINT32_C(0x3fffffff)
34983 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
34984 /* Indicate type of the flow. */
34985 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE UINT32_C(0x40000000)
34986 /*
34987 * If this bit set to 0, then it indicates that the flow is
34988 * internal flow.
34989 */
34990 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT (UINT32_C(0x0) << 30)
34991 /*
34992 * If this bit is set to 1, then it indicates that the flow is
34993 * external flow.
34994 */
34995 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT (UINT32_C(0x1) << 30)
34996 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
34997 /* Indicate the flow direction. */
34998 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR UINT32_C(0x80000000)
34999 /* If this bit set to 0, then it indicates rx flow. */
35000 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX (UINT32_C(0x0) << 31)
35001 /* If this bit is set to 1, then it indicates that tx flow. */
35002 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX (UINT32_C(0x1) << 31)
35003 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
35004 uint8_t unused_0[3];
35005 /*
35006 * This field is used in Output records to indicate that the output
35007 * is completely written to RAM. This field should be read as '1'
35008 * to indicate that the output has been completely written.
35009 * When writing a command completion or response to an internal
35010 * processor, the order of writes has to be such that this field is
35011 * written last.
35012 */
35013 uint8_t valid;
35014 } hwrm_cfa_ntuple_filter_alloc_output_t, *phwrm_cfa_ntuple_filter_alloc_output_t;
35015
35016 /* hwrm_cfa_ntuple_filter_alloc_cmd_err (size:64b/8B) */
35017
35018 typedef struct hwrm_cfa_ntuple_filter_alloc_cmd_err {
35019 /*
35020 * command specific error codes that goes to
35021 * the cmd_err field in Common HWRM Error Response.
35022 */
35023 uint8_t code;
35024 /* Unknown error */
35025 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
35026 /* Unable to complete operation due to conflict with Rx Mask VLAN */
35027 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR UINT32_C(0x1)
35028 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_LAST HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR
35029 uint8_t unused_0[7];
35030 } hwrm_cfa_ntuple_filter_alloc_cmd_err_t, *phwrm_cfa_ntuple_filter_alloc_cmd_err_t;
35031
35032 /*******************************
35033 * hwrm_cfa_ntuple_filter_free *
35034 *******************************/
35035
35036
35037 /* hwrm_cfa_ntuple_filter_free_input (size:192b/24B) */
35038
35039 typedef struct hwrm_cfa_ntuple_filter_free_input {
35040 /* The HWRM command request type. */
35041 uint16_t req_type;
35042 /*
35043 * The completion ring to send the completion event on. This should
35044 * be the NQ ID returned from the `nq_alloc` HWRM command.
35045 */
35046 uint16_t cmpl_ring;
35047 /*
35048 * The sequence ID is used by the driver for tracking multiple
35049 * commands. This ID is treated as opaque data by the firmware and
35050 * the value is returned in the `hwrm_resp_hdr` upon completion.
35051 */
35052 uint16_t seq_id;
35053 /*
35054 * The target ID of the command:
35055 * * 0x0-0xFFF8 - The function ID
35056 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35057 * * 0xFFFD - Reserved for user-space HWRM interface
35058 * * 0xFFFF - HWRM
35059 */
35060 uint16_t target_id;
35061 /*
35062 * A physical address pointer pointing to a host buffer that the
35063 * command's response data will be written. This can be either a host
35064 * physical address (HPA) or a guest physical address (GPA) and must
35065 * point to a physically contiguous block of memory.
35066 */
35067 uint64_t resp_addr;
35068 /* This value is an opaque id into CFA data structures. */
35069 uint64_t ntuple_filter_id;
35070 } hwrm_cfa_ntuple_filter_free_input_t, *phwrm_cfa_ntuple_filter_free_input_t;
35071
35072 /* hwrm_cfa_ntuple_filter_free_output (size:128b/16B) */
35073
35074 typedef struct hwrm_cfa_ntuple_filter_free_output {
35075 /* The specific error status for the command. */
35076 uint16_t error_code;
35077 /* The HWRM command request type. */
35078 uint16_t req_type;
35079 /* The sequence ID from the original command. */
35080 uint16_t seq_id;
35081 /* The length of the response data in number of bytes. */
35082 uint16_t resp_len;
35083 uint8_t unused_0[7];
35084 /*
35085 * This field is used in Output records to indicate that the output
35086 * is completely written to RAM. This field should be read as '1'
35087 * to indicate that the output has been completely written.
35088 * When writing a command completion or response to an internal
35089 * processor, the order of writes has to be such that this field is
35090 * written last.
35091 */
35092 uint8_t valid;
35093 } hwrm_cfa_ntuple_filter_free_output_t, *phwrm_cfa_ntuple_filter_free_output_t;
35094
35095 /******************************
35096 * hwrm_cfa_ntuple_filter_cfg *
35097 ******************************/
35098
35099
35100 /* hwrm_cfa_ntuple_filter_cfg_input (size:384b/48B) */
35101
35102 typedef struct hwrm_cfa_ntuple_filter_cfg_input {
35103 /* The HWRM command request type. */
35104 uint16_t req_type;
35105 /*
35106 * The completion ring to send the completion event on. This should
35107 * be the NQ ID returned from the `nq_alloc` HWRM command.
35108 */
35109 uint16_t cmpl_ring;
35110 /*
35111 * The sequence ID is used by the driver for tracking multiple
35112 * commands. This ID is treated as opaque data by the firmware and
35113 * the value is returned in the `hwrm_resp_hdr` upon completion.
35114 */
35115 uint16_t seq_id;
35116 /*
35117 * The target ID of the command:
35118 * * 0x0-0xFFF8 - The function ID
35119 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35120 * * 0xFFFD - Reserved for user-space HWRM interface
35121 * * 0xFFFF - HWRM
35122 */
35123 uint16_t target_id;
35124 /*
35125 * A physical address pointer pointing to a host buffer that the
35126 * command's response data will be written. This can be either a host
35127 * physical address (HPA) or a guest physical address (GPA) and must
35128 * point to a physically contiguous block of memory.
35129 */
35130 uint64_t resp_addr;
35131 uint32_t enables;
35132 /*
35133 * This bit must be '1' for the new_dst_id field to be
35134 * configured.
35135 */
35136 #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_DST_ID UINT32_C(0x1)
35137 /*
35138 * This bit must be '1' for the new_mirror_vnic_id field to be
35139 * configured.
35140 */
35141 #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID UINT32_C(0x2)
35142 /*
35143 * This bit must be '1' for the new_meter_instance_id field to be
35144 * configured.
35145 */
35146 #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_METER_INSTANCE_ID UINT32_C(0x4)
35147 uint32_t flags;
35148 /*
35149 * Setting this bit to 1 indicates that dest_id field contains FID.
35150 * Setting this to 0 indicates that dest_id field contains VNIC or
35151 * VPORT.
35152 */
35153 #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_FLAGS_DEST_FID UINT32_C(0x1)
35154 /*
35155 * Setting of this flag indicates that the new_dst_id field contains
35156 * RFS ring table index. If this is not set it indicates new_dst_id
35157 * is VNIC or VPORT or function ID. Note dest_fid and
35158 * dest_rfs_ring_idx can’t be set at the same time.
35159 */
35160 #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_FLAGS_DEST_RFS_RING_IDX UINT32_C(0x2)
35161 /* This value is an opaque id into CFA data structures. */
35162 uint64_t ntuple_filter_id;
35163 /*
35164 * If set, this value shall represent the new
35165 * Logical VNIC ID of the destination VNIC for the RX
35166 * path and new network port id of the destination port for
35167 * the TX path.
35168 */
35169 uint32_t new_dst_id;
35170 /*
35171 * New Logical VNIC ID of the VNIC where traffic is
35172 * mirrored.
35173 */
35174 uint32_t new_mirror_vnic_id;
35175 /*
35176 * New meter to attach to the flow. Specifying the
35177 * invalid instance ID is used to remove any existing
35178 * meter from the flow.
35179 */
35180 uint16_t new_meter_instance_id;
35181 /*
35182 * A value of 0xfff is considered invalid and implies the
35183 * instance is not configured.
35184 */
35185 #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID UINT32_C(0xffff)
35186 #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_LAST HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID
35187 uint8_t unused_1[6];
35188 } hwrm_cfa_ntuple_filter_cfg_input_t, *phwrm_cfa_ntuple_filter_cfg_input_t;
35189
35190 /* hwrm_cfa_ntuple_filter_cfg_output (size:128b/16B) */
35191
35192 typedef struct hwrm_cfa_ntuple_filter_cfg_output {
35193 /* The specific error status for the command. */
35194 uint16_t error_code;
35195 /* The HWRM command request type. */
35196 uint16_t req_type;
35197 /* The sequence ID from the original command. */
35198 uint16_t seq_id;
35199 /* The length of the response data in number of bytes. */
35200 uint16_t resp_len;
35201 uint8_t unused_0[7];
35202 /*
35203 * This field is used in Output records to indicate that the output
35204 * is completely written to RAM. This field should be read as '1'
35205 * to indicate that the output has been completely written.
35206 * When writing a command completion or response to an internal
35207 * processor, the order of writes has to be such that this field is
35208 * written last.
35209 */
35210 uint8_t valid;
35211 } hwrm_cfa_ntuple_filter_cfg_output_t, *phwrm_cfa_ntuple_filter_cfg_output_t;
35212
35213 /**************************
35214 * hwrm_cfa_em_flow_alloc *
35215 **************************/
35216
35217
35218 /* hwrm_cfa_em_flow_alloc_input (size:896b/112B) */
35219
35220 typedef struct hwrm_cfa_em_flow_alloc_input {
35221 /* The HWRM command request type. */
35222 uint16_t req_type;
35223 /*
35224 * The completion ring to send the completion event on. This should
35225 * be the NQ ID returned from the `nq_alloc` HWRM command.
35226 */
35227 uint16_t cmpl_ring;
35228 /*
35229 * The sequence ID is used by the driver for tracking multiple
35230 * commands. This ID is treated as opaque data by the firmware and
35231 * the value is returned in the `hwrm_resp_hdr` upon completion.
35232 */
35233 uint16_t seq_id;
35234 /*
35235 * The target ID of the command:
35236 * * 0x0-0xFFF8 - The function ID
35237 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35238 * * 0xFFFD - Reserved for user-space HWRM interface
35239 * * 0xFFFF - HWRM
35240 */
35241 uint16_t target_id;
35242 /*
35243 * A physical address pointer pointing to a host buffer that the
35244 * command's response data will be written. This can be either a host
35245 * physical address (HPA) or a guest physical address (GPA) and must
35246 * point to a physically contiguous block of memory.
35247 */
35248 uint64_t resp_addr;
35249 uint32_t flags;
35250 /*
35251 * Enumeration denoting the RX, TX type of the resource.
35252 * This enumeration is used for resources that are similar for both
35253 * TX and RX paths of the chip.
35254 */
35255 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH UINT32_C(0x1)
35256 /* tx path */
35257 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_TX UINT32_C(0x0)
35258 /* rx path */
35259 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX UINT32_C(0x1)
35260 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_LAST HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX
35261 /*
35262 * Setting of this flag indicates enabling of a byte counter for a
35263 * given flow.
35264 */
35265 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_BYTE_CTR UINT32_C(0x2)
35266 /*
35267 * Setting of this flag indicates enabling of a packet counter for a
35268 * given flow.
35269 */
35270 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PKT_CTR UINT32_C(0x4)
35271 /*
35272 * Setting of this flag indicates de-capsulation action for the
35273 * given flow.
35274 */
35275 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DECAP UINT32_C(0x8)
35276 /*
35277 * Setting of this flag indicates encapsulation action for the
35278 * given flow.
35279 */
35280 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_ENCAP UINT32_C(0x10)
35281 /*
35282 * Setting of this flag indicates drop action. If this flag is not
35283 * set, then it should be considered accept action.
35284 */
35285 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DROP UINT32_C(0x20)
35286 /*
35287 * Setting of this flag indicates that a meter is expected to be
35288 * attached to this flow. This hint can be used when choosing the
35289 * action record format required for the flow.
35290 */
35291 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_METER UINT32_C(0x40)
35292 uint32_t enables;
35293 /*
35294 * This bit must be '1' for the l2_filter_id field to be
35295 * configured.
35296 */
35297 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_L2_FILTER_ID UINT32_C(0x1)
35298 /*
35299 * This bit must be '1' for the tunnel_type field to be
35300 * configured.
35301 */
35302 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_TYPE UINT32_C(0x2)
35303 /*
35304 * This bit must be '1' for the tunnel_id field to be
35305 * configured.
35306 */
35307 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_ID UINT32_C(0x4)
35308 /*
35309 * This bit must be '1' for the src_macaddr field to be
35310 * configured.
35311 */
35312 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_MACADDR UINT32_C(0x8)
35313 /*
35314 * This bit must be '1' for the dst_macaddr field to be
35315 * configured.
35316 */
35317 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_MACADDR UINT32_C(0x10)
35318 /*
35319 * This bit must be '1' for the ovlan_vid field to be
35320 * configured.
35321 */
35322 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_OVLAN_VID UINT32_C(0x20)
35323 /*
35324 * This bit must be '1' for the ivlan_vid field to be
35325 * configured.
35326 */
35327 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IVLAN_VID UINT32_C(0x40)
35328 /*
35329 * This bit must be '1' for the ethertype field to be
35330 * configured.
35331 */
35332 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ETHERTYPE UINT32_C(0x80)
35333 /*
35334 * This bit must be '1' for the src_ipaddr field to be
35335 * configured.
35336 */
35337 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_IPADDR UINT32_C(0x100)
35338 /*
35339 * This bit must be '1' for the dst_ipaddr field to be
35340 * configured.
35341 */
35342 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_IPADDR UINT32_C(0x200)
35343 /*
35344 * This bit must be '1' for the ipaddr_type field to be
35345 * configured.
35346 */
35347 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IPADDR_TYPE UINT32_C(0x400)
35348 /*
35349 * This bit must be '1' for the ip_protocol field to be
35350 * configured.
35351 */
35352 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IP_PROTOCOL UINT32_C(0x800)
35353 /*
35354 * This bit must be '1' for the src_port field to be
35355 * configured.
35356 */
35357 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_PORT UINT32_C(0x1000)
35358 /*
35359 * This bit must be '1' for the dst_port field to be
35360 * configured.
35361 */
35362 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_PORT UINT32_C(0x2000)
35363 /*
35364 * This bit must be '1' for the dst_id field to be
35365 * configured.
35366 */
35367 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_ID UINT32_C(0x4000)
35368 /*
35369 * This bit must be '1' for the mirror_vnic_id field to be
35370 * configured.
35371 */
35372 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID UINT32_C(0x8000)
35373 /*
35374 * This bit must be '1' for the encap_record_id field to be
35375 * configured.
35376 */
35377 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ENCAP_RECORD_ID UINT32_C(0x10000)
35378 /*
35379 * This bit must be '1' for the meter_instance_id field to be
35380 * configured.
35381 */
35382 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_METER_INSTANCE_ID UINT32_C(0x20000)
35383 /*
35384 * This value identifies a set of CFA data structures used for an L2
35385 * context.
35386 */
35387 uint64_t l2_filter_id;
35388 /* Tunnel Type. */
35389 uint8_t tunnel_type;
35390 /* Non-tunnel */
35391 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL UINT32_C(0x0)
35392 /* Virtual eXtensible Local Area Network (VXLAN) */
35393 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
35394 /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
35395 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NVGRE UINT32_C(0x2)
35396 /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
35397 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2GRE UINT32_C(0x3)
35398 /* IP in IP */
35399 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPIP UINT32_C(0x4)
35400 /* Generic Network Virtualization Encapsulation (Geneve) */
35401 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
35402 /* Multi-Protocol Label Switching (MPLS) */
35403 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_MPLS UINT32_C(0x6)
35404 /* Stateless Transport Tunnel (STT) */
35405 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_STT UINT32_C(0x7)
35406 /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
35407 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE UINT32_C(0x8)
35408 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
35409 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 UINT32_C(0x9)
35410 /*
35411 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
35412 * datagram payload
35413 */
35414 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 UINT32_C(0xa)
35415 /* Use fixed layer 2 ether type of 0xFFFF */
35416 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE UINT32_C(0xb)
35417 /*
35418 * IPV6 over virtual eXtensible Local Area Network with GPE header
35419 * (IPV6oVXLANGPE)
35420 */
35421 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
35422 /* Any tunneled traffic */
35423 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL UINT32_C(0xff)
35424 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_LAST HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
35425 uint8_t unused_0[3];
35426 /*
35427 * Tunnel identifier.
35428 * Virtual Network Identifier (VNI). Only valid with
35429 * tunnel_types VXLAN, NVGRE, and Geneve.
35430 * Only lower 24-bits of VNI field are used
35431 * in setting up the filter.
35432 */
35433 uint32_t tunnel_id;
35434 /*
35435 * This value indicates the source MAC address in
35436 * the Ethernet header.
35437 */
35438 uint8_t src_macaddr[6];
35439 /* The meter instance to attach to the flow. */
35440 uint16_t meter_instance_id;
35441 /*
35442 * A value of 0xfff is considered invalid and implies the
35443 * instance is not configured.
35444 */
35445 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID UINT32_C(0xffff)
35446 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_LAST HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID
35447 /*
35448 * This value indicates the destination MAC address in
35449 * the Ethernet header.
35450 */
35451 uint8_t dst_macaddr[6];
35452 /*
35453 * This value indicates the VLAN ID of the outer VLAN tag
35454 * in the Ethernet header.
35455 */
35456 uint16_t ovlan_vid;
35457 /*
35458 * This value indicates the VLAN ID of the inner VLAN tag
35459 * in the Ethernet header.
35460 */
35461 uint16_t ivlan_vid;
35462 /* This value indicates the ethertype in the Ethernet header. */
35463 uint16_t ethertype;
35464 /*
35465 * This value indicates the type of IP address.
35466 * 4 - IPv4
35467 * 6 - IPv6
35468 * All others are invalid.
35469 */
35470 uint8_t ip_addr_type;
35471 /* invalid */
35472 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN UINT32_C(0x0)
35473 /* IPv4 */
35474 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 UINT32_C(0x4)
35475 /* IPv6 */
35476 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 UINT32_C(0x6)
35477 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_LAST HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
35478 /*
35479 * The value of protocol filed in IP header.
35480 * Applies to UDP and TCP traffic.
35481 * 6 - TCP
35482 * 17 - UDP
35483 */
35484 uint8_t ip_protocol;
35485 /* invalid */
35486 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN UINT32_C(0x0)
35487 /* TCP */
35488 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_TCP UINT32_C(0x6)
35489 /* UDP */
35490 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP UINT32_C(0x11)
35491 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_LAST HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP
35492 uint8_t unused_1[2];
35493 /*
35494 * The value of source IP address to be used in filtering.
35495 * For IPv4, first four bytes represent the IP address.
35496 */
35497 uint32_t src_ipaddr[4];
35498 /*
35499 * big_endian = True
35500 * The value of destination IP address to be used in filtering.
35501 * For IPv4, first four bytes represent the IP address.
35502 */
35503 uint32_t dst_ipaddr[4];
35504 /*
35505 * The value of source port to be used in filtering.
35506 * Applies to UDP and TCP traffic.
35507 */
35508 uint16_t src_port;
35509 /*
35510 * The value of destination port to be used in filtering.
35511 * Applies to UDP and TCP traffic.
35512 */
35513 uint16_t dst_port;
35514 /*
35515 * If set, this value shall represent the
35516 * Logical VNIC ID of the destination VNIC for the RX
35517 * path and network port id of the destination port for
35518 * the TX path.
35519 */
35520 uint16_t dst_id;
35521 /*
35522 * Logical VNIC ID of the VNIC where traffic is
35523 * mirrored.
35524 */
35525 uint16_t mirror_vnic_id;
35526 /* Logical ID of the encapsulation record. */
35527 uint32_t encap_record_id;
35528 uint8_t unused_2[4];
35529 } hwrm_cfa_em_flow_alloc_input_t, *phwrm_cfa_em_flow_alloc_input_t;
35530
35531 /* hwrm_cfa_em_flow_alloc_output (size:192b/24B) */
35532
35533 typedef struct hwrm_cfa_em_flow_alloc_output {
35534 /* The specific error status for the command. */
35535 uint16_t error_code;
35536 /* The HWRM command request type. */
35537 uint16_t req_type;
35538 /* The sequence ID from the original command. */
35539 uint16_t seq_id;
35540 /* The length of the response data in number of bytes. */
35541 uint16_t resp_len;
35542 /* This value is an opaque id into CFA data structures. */
35543 uint64_t em_filter_id;
35544 /*
35545 * The flow id value in bit 0-29 is the actual ID of the flow
35546 * associated with this filter and it shall be used to match
35547 * and associate the flow identifier returned in completion
35548 * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
35549 * shall indicate no valid flow id.
35550 */
35551 uint32_t flow_id;
35552 /* Indicate the flow id value. */
35553 #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK UINT32_C(0x3fffffff)
35554 #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
35555 /* Indicate type of the flow. */
35556 #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE UINT32_C(0x40000000)
35557 /*
35558 * If this bit set to 0, then it indicates that the flow is
35559 * internal flow.
35560 */
35561 #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_INT (UINT32_C(0x0) << 30)
35562 /*
35563 * If this bit is set to 1, then it indicates that the flow is
35564 * external flow.
35565 */
35566 #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT (UINT32_C(0x1) << 30)
35567 #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
35568 /* Indicate the flow direction. */
35569 #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR UINT32_C(0x80000000)
35570 /* If this bit set to 0, then it indicates rx flow. */
35571 #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_RX (UINT32_C(0x0) << 31)
35572 /* If this bit is set to 1, then it indicates that tx flow. */
35573 #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX (UINT32_C(0x1) << 31)
35574 #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_LAST HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX
35575 uint8_t unused_0[3];
35576 /*
35577 * This field is used in Output records to indicate that the output
35578 * is completely written to RAM. This field should be read as '1'
35579 * to indicate that the output has been completely written.
35580 * When writing a command completion or response to an internal
35581 * processor, the order of writes has to be such that this field is
35582 * written last.
35583 */
35584 uint8_t valid;
35585 } hwrm_cfa_em_flow_alloc_output_t, *phwrm_cfa_em_flow_alloc_output_t;
35586
35587 /*************************
35588 * hwrm_cfa_em_flow_free *
35589 *************************/
35590
35591
35592 /* hwrm_cfa_em_flow_free_input (size:192b/24B) */
35593
35594 typedef struct hwrm_cfa_em_flow_free_input {
35595 /* The HWRM command request type. */
35596 uint16_t req_type;
35597 /*
35598 * The completion ring to send the completion event on. This should
35599 * be the NQ ID returned from the `nq_alloc` HWRM command.
35600 */
35601 uint16_t cmpl_ring;
35602 /*
35603 * The sequence ID is used by the driver for tracking multiple
35604 * commands. This ID is treated as opaque data by the firmware and
35605 * the value is returned in the `hwrm_resp_hdr` upon completion.
35606 */
35607 uint16_t seq_id;
35608 /*
35609 * The target ID of the command:
35610 * * 0x0-0xFFF8 - The function ID
35611 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35612 * * 0xFFFD - Reserved for user-space HWRM interface
35613 * * 0xFFFF - HWRM
35614 */
35615 uint16_t target_id;
35616 /*
35617 * A physical address pointer pointing to a host buffer that the
35618 * command's response data will be written. This can be either a host
35619 * physical address (HPA) or a guest physical address (GPA) and must
35620 * point to a physically contiguous block of memory.
35621 */
35622 uint64_t resp_addr;
35623 /* This value is an opaque id into CFA data structures. */
35624 uint64_t em_filter_id;
35625 } hwrm_cfa_em_flow_free_input_t, *phwrm_cfa_em_flow_free_input_t;
35626
35627 /* hwrm_cfa_em_flow_free_output (size:128b/16B) */
35628
35629 typedef struct hwrm_cfa_em_flow_free_output {
35630 /* The specific error status for the command. */
35631 uint16_t error_code;
35632 /* The HWRM command request type. */
35633 uint16_t req_type;
35634 /* The sequence ID from the original command. */
35635 uint16_t seq_id;
35636 /* The length of the response data in number of bytes. */
35637 uint16_t resp_len;
35638 uint8_t unused_0[7];
35639 /*
35640 * This field is used in Output records to indicate that the output
35641 * is completely written to RAM. This field should be read as '1'
35642 * to indicate that the output has been completely written.
35643 * When writing a command completion or response to an internal
35644 * processor, the order of writes has to be such that this field is
35645 * written last.
35646 */
35647 uint8_t valid;
35648 } hwrm_cfa_em_flow_free_output_t, *phwrm_cfa_em_flow_free_output_t;
35649
35650 /************************
35651 * hwrm_cfa_meter_qcaps *
35652 ************************/
35653
35654
35655 /* hwrm_cfa_meter_qcaps_input (size:128b/16B) */
35656
35657 typedef struct hwrm_cfa_meter_qcaps_input {
35658 /* The HWRM command request type. */
35659 uint16_t req_type;
35660 /*
35661 * The completion ring to send the completion event on. This should
35662 * be the NQ ID returned from the `nq_alloc` HWRM command.
35663 */
35664 uint16_t cmpl_ring;
35665 /*
35666 * The sequence ID is used by the driver for tracking multiple
35667 * commands. This ID is treated as opaque data by the firmware and
35668 * the value is returned in the `hwrm_resp_hdr` upon completion.
35669 */
35670 uint16_t seq_id;
35671 /*
35672 * The target ID of the command:
35673 * * 0x0-0xFFF8 - The function ID
35674 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35675 * * 0xFFFD - Reserved for user-space HWRM interface
35676 * * 0xFFFF - HWRM
35677 */
35678 uint16_t target_id;
35679 /*
35680 * A physical address pointer pointing to a host buffer that the
35681 * command's response data will be written. This can be either a host
35682 * physical address (HPA) or a guest physical address (GPA) and must
35683 * point to a physically contiguous block of memory.
35684 */
35685 uint64_t resp_addr;
35686 } hwrm_cfa_meter_qcaps_input_t, *phwrm_cfa_meter_qcaps_input_t;
35687
35688 /* hwrm_cfa_meter_qcaps_output (size:320b/40B) */
35689
35690 typedef struct hwrm_cfa_meter_qcaps_output {
35691 /* The specific error status for the command. */
35692 uint16_t error_code;
35693 /* The HWRM command request type. */
35694 uint16_t req_type;
35695 /* The sequence ID from the original command. */
35696 uint16_t seq_id;
35697 /* The length of the response data in number of bytes. */
35698 uint16_t resp_len;
35699 uint32_t flags;
35700 /*
35701 * Enumeration denoting the clock at which the Meter is running
35702 * with. This enumeration is used for resources that are similar
35703 * for both TX and RX paths of the chip.
35704 */
35705 #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_MASK UINT32_C(0xf)
35706 #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_SFT 0
35707 /* 375 MHz */
35708 #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_375MHZ UINT32_C(0x0)
35709 /* 625 MHz */
35710 #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_625MHZ UINT32_C(0x1)
35711 #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_LAST HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_625MHZ
35712 uint8_t unused_0[4];
35713 /*
35714 * The minimum guaranteed number of tx meter profiles supported
35715 * for this function.
35716 */
35717 uint16_t min_tx_profile;
35718 /*
35719 * The maximum non-guaranteed number of tx meter profiles supported
35720 * for this function.
35721 */
35722 uint16_t max_tx_profile;
35723 /*
35724 * The minimum guaranteed number of rx meter profiles supported
35725 * for this function.
35726 */
35727 uint16_t min_rx_profile;
35728 /*
35729 * The maximum non-guaranteed number of rx meter profiles supported
35730 * for this function.
35731 */
35732 uint16_t max_rx_profile;
35733 /*
35734 * The minimum guaranteed number of tx meter instances supported
35735 * for this function.
35736 */
35737 uint16_t min_tx_instance;
35738 /*
35739 * The maximum non-guaranteed number of tx meter instances supported
35740 * for this function.
35741 */
35742 uint16_t max_tx_instance;
35743 /*
35744 * The minimum guaranteed number of rx meter instances supported
35745 * for this function.
35746 */
35747 uint16_t min_rx_instance;
35748 /*
35749 * The maximum non-guaranteed number of rx meter instances supported
35750 * for this function.
35751 */
35752 uint16_t max_rx_instance;
35753 uint8_t unused_1[7];
35754 /*
35755 * This field is used in Output records to indicate that the output
35756 * is completely written to RAM. This field should be read as '1'
35757 * to indicate that the output has been completely written.
35758 * When writing a command completion or response to an internal
35759 * processor, the order of writes has to be such that this field is
35760 * written last.
35761 */
35762 uint8_t valid;
35763 } hwrm_cfa_meter_qcaps_output_t, *phwrm_cfa_meter_qcaps_output_t;
35764
35765 /********************************
35766 * hwrm_cfa_meter_profile_alloc *
35767 ********************************/
35768
35769
35770 /* hwrm_cfa_meter_profile_alloc_input (size:320b/40B) */
35771
35772 typedef struct hwrm_cfa_meter_profile_alloc_input {
35773 /* The HWRM command request type. */
35774 uint16_t req_type;
35775 /*
35776 * The completion ring to send the completion event on. This should
35777 * be the NQ ID returned from the `nq_alloc` HWRM command.
35778 */
35779 uint16_t cmpl_ring;
35780 /*
35781 * The sequence ID is used by the driver for tracking multiple
35782 * commands. This ID is treated as opaque data by the firmware and
35783 * the value is returned in the `hwrm_resp_hdr` upon completion.
35784 */
35785 uint16_t seq_id;
35786 /*
35787 * The target ID of the command:
35788 * * 0x0-0xFFF8 - The function ID
35789 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35790 * * 0xFFFD - Reserved for user-space HWRM interface
35791 * * 0xFFFF - HWRM
35792 */
35793 uint16_t target_id;
35794 /*
35795 * A physical address pointer pointing to a host buffer that the
35796 * command's response data will be written. This can be either a host
35797 * physical address (HPA) or a guest physical address (GPA) and must
35798 * point to a physically contiguous block of memory.
35799 */
35800 uint64_t resp_addr;
35801 uint8_t flags;
35802 /*
35803 * Enumeration denoting the RX, TX type of the resource.
35804 * This enumeration is used for resources that are similar for both
35805 * TX and RX paths of the chip.
35806 */
35807 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH UINT32_C(0x1)
35808 /* tx path */
35809 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_TX UINT32_C(0x0)
35810 /* rx path */
35811 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_RX UINT32_C(0x1)
35812 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_LAST HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_RX
35813 /* The meter algorithm type. */
35814 uint8_t meter_type;
35815 /* RFC 2697 (srTCM) */
35816 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC2697 UINT32_C(0x0)
35817 /* RFC 2698 (trTCM) */
35818 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC2698 UINT32_C(0x1)
35819 /* RFC 4115 (trTCM) */
35820 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC4115 UINT32_C(0x2)
35821 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_LAST HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC4115
35822 /*
35823 * This field is reserved for the future use.
35824 * It shall be set to 0.
35825 */
35826 uint16_t reserved1;
35827 /*
35828 * This field is reserved for the future use.
35829 * It shall be set to 0.
35830 */
35831 uint32_t reserved2;
35832 /* A meter rate specified in bytes-per-second. */
35833 uint32_t commit_rate;
35834 /* The bandwidth value. */
35835 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_MASK UINT32_C(0xfffffff)
35836 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_SFT 0
35837 /* The granularity of the value (bits or bytes). */
35838 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE UINT32_C(0x10000000)
35839 /* Value is in bits. */
35840 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BITS (UINT32_C(0x0) << 28)
35841 /* Value is in bytes. */
35842 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BYTES (UINT32_C(0x1) << 28)
35843 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_LAST HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BYTES
35844 /* bw_value_unit is 3 b */
35845 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
35846 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_SFT 29
35847 /* Value is in Mb or MB (base 10). */
35848 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
35849 /* Value is in Kb or KB (base 10). */
35850 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
35851 /* Value is in bits or bytes. */
35852 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
35853 /* Value is in Gb or GB (base 10). */
35854 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
35855 /* Value is in 1/100th of a percentage of total bandwidth. */
35856 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
35857 /* Raw value */
35858 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW (UINT32_C(0x7) << 29)
35859 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_LAST HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW
35860 /* A meter burst size specified in bytes. */
35861 uint32_t commit_burst;
35862 /* The bandwidth value. */
35863 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_MASK UINT32_C(0xfffffff)
35864 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_SFT 0
35865 /* The granularity of the value (bits or bytes). */
35866 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE UINT32_C(0x10000000)
35867 /* Value is in bits. */
35868 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BITS (UINT32_C(0x0) << 28)
35869 /* Value is in bytes. */
35870 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BYTES (UINT32_C(0x1) << 28)
35871 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_LAST HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BYTES
35872 /* bw_value_unit is 3 b */
35873 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
35874 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_SFT 29
35875 /* Value is in Mb or MB (base 10). */
35876 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
35877 /* Value is in Kb or KB (base 10). */
35878 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
35879 /* Value is in bits or bytes. */
35880 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
35881 /* Value is in Gb or GB (base 10). */
35882 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
35883 /* Value is in 1/100th of a percentage of total bandwidth. */
35884 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
35885 /* Invalid value */
35886 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
35887 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_LAST HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID
35888 /* A meter rate specified in bytes-per-second. */
35889 uint32_t excess_peak_rate;
35890 /* The bandwidth value. */
35891 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_MASK UINT32_C(0xfffffff)
35892 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_SFT 0
35893 /* The granularity of the value (bits or bytes). */
35894 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE UINT32_C(0x10000000)
35895 /* Value is in bits. */
35896 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BITS (UINT32_C(0x0) << 28)
35897 /* Value is in bytes. */
35898 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES (UINT32_C(0x1) << 28)
35899 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_LAST HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES
35900 /* bw_value_unit is 3 b */
35901 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
35902 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_SFT 29
35903 /* Value is in Mb or MB (base 10). */
35904 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
35905 /* Value is in Kb or KB (base 10). */
35906 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
35907 /* Value is in bits or bytes. */
35908 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
35909 /* Value is in Gb or GB (base 10). */
35910 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
35911 /* Value is in 1/100th of a percentage of total bandwidth. */
35912 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
35913 /* Raw unit */
35914 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW (UINT32_C(0x7) << 29)
35915 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_LAST HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW
35916 /* A meter burst size specified in bytes. */
35917 uint32_t excess_peak_burst;
35918 /* The bandwidth value. */
35919 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_MASK UINT32_C(0xfffffff)
35920 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_SFT 0
35921 /* The granularity of the value (bits or bytes). */
35922 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE UINT32_C(0x10000000)
35923 /* Value is in bits. */
35924 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BITS (UINT32_C(0x0) << 28)
35925 /* Value is in bytes. */
35926 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES (UINT32_C(0x1) << 28)
35927 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_LAST HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES
35928 /* bw_value_unit is 3 b */
35929 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
35930 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_SFT 29
35931 /* Value is in Mb or MB (base 10). */
35932 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
35933 /* Value is in Kb or KB (base 10). */
35934 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
35935 /* Value is in bits or bytes. */
35936 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
35937 /* Value is in Gb or GB (base 10). */
35938 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
35939 /* Value is in 1/100th of a percentage of total bandwidth. */
35940 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
35941 /* Invalid unit */
35942 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
35943 #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_LAST HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID
35944 } hwrm_cfa_meter_profile_alloc_input_t, *phwrm_cfa_meter_profile_alloc_input_t;
35945
35946 /* hwrm_cfa_meter_profile_alloc_output (size:128b/16B) */
35947
35948 typedef struct hwrm_cfa_meter_profile_alloc_output {
35949 /* The specific error status for the command. */
35950 uint16_t error_code;
35951 /* The HWRM command request type. */
35952 uint16_t req_type;
35953 /* The sequence ID from the original command. */
35954 uint16_t seq_id;
35955 /* The length of the response data in number of bytes. */
35956 uint16_t resp_len;
35957 /* This value identifies a meter profile in CFA. */
35958 uint16_t meter_profile_id;
35959 /*
35960 * A value of 0xfff is considered invalid and implies the
35961 * profile is not configured.
35962 */
35963 #define HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_INVALID UINT32_C(0xffff)
35964 #define HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_LAST HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_INVALID
35965 uint8_t unused_0[5];
35966 /*
35967 * This field is used in Output records to indicate that the output
35968 * is completely written to RAM. This field should be read as '1'
35969 * to indicate that the output has been completely written.
35970 * When writing a command completion or response to an internal
35971 * processor, the order of writes has to be such that this field is
35972 * written last.
35973 */
35974 uint8_t valid;
35975 } hwrm_cfa_meter_profile_alloc_output_t, *phwrm_cfa_meter_profile_alloc_output_t;
35976
35977 /*******************************
35978 * hwrm_cfa_meter_profile_free *
35979 *******************************/
35980
35981
35982 /* hwrm_cfa_meter_profile_free_input (size:192b/24B) */
35983
35984 typedef struct hwrm_cfa_meter_profile_free_input {
35985 /* The HWRM command request type. */
35986 uint16_t req_type;
35987 /*
35988 * The completion ring to send the completion event on. This should
35989 * be the NQ ID returned from the `nq_alloc` HWRM command.
35990 */
35991 uint16_t cmpl_ring;
35992 /*
35993 * The sequence ID is used by the driver for tracking multiple
35994 * commands. This ID is treated as opaque data by the firmware and
35995 * the value is returned in the `hwrm_resp_hdr` upon completion.
35996 */
35997 uint16_t seq_id;
35998 /*
35999 * The target ID of the command:
36000 * * 0x0-0xFFF8 - The function ID
36001 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36002 * * 0xFFFD - Reserved for user-space HWRM interface
36003 * * 0xFFFF - HWRM
36004 */
36005 uint16_t target_id;
36006 /*
36007 * A physical address pointer pointing to a host buffer that the
36008 * command's response data will be written. This can be either a host
36009 * physical address (HPA) or a guest physical address (GPA) and must
36010 * point to a physically contiguous block of memory.
36011 */
36012 uint64_t resp_addr;
36013 uint8_t flags;
36014 /*
36015 * Enumeration denoting the RX, TX type of the resource.
36016 * This enumeration is used for resources that are similar for both
36017 * TX and RX paths of the chip.
36018 */
36019 #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH UINT32_C(0x1)
36020 /* tx path */
36021 #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_TX UINT32_C(0x0)
36022 /* rx path */
36023 #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_RX UINT32_C(0x1)
36024 #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_LAST HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_RX
36025 uint8_t unused_0;
36026 /* This value identifies a meter profile in CFA. */
36027 uint16_t meter_profile_id;
36028 /*
36029 * A value of 0xfff is considered invalid and implies the
36030 * profile is not configured.
36031 */
36032 #define HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_INVALID UINT32_C(0xffff)
36033 #define HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_LAST HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_INVALID
36034 uint8_t unused_1[4];
36035 } hwrm_cfa_meter_profile_free_input_t, *phwrm_cfa_meter_profile_free_input_t;
36036
36037 /* hwrm_cfa_meter_profile_free_output (size:128b/16B) */
36038
36039 typedef struct hwrm_cfa_meter_profile_free_output {
36040 /* The specific error status for the command. */
36041 uint16_t error_code;
36042 /* The HWRM command request type. */
36043 uint16_t req_type;
36044 /* The sequence ID from the original command. */
36045 uint16_t seq_id;
36046 /* The length of the response data in number of bytes. */
36047 uint16_t resp_len;
36048 uint8_t unused_0[7];
36049 /*
36050 * This field is used in Output records to indicate that the output
36051 * is completely written to RAM. This field should be read as '1'
36052 * to indicate that the output has been completely written.
36053 * When writing a command completion or response to an internal
36054 * processor, the order of writes has to be such that this field is
36055 * written last.
36056 */
36057 uint8_t valid;
36058 } hwrm_cfa_meter_profile_free_output_t, *phwrm_cfa_meter_profile_free_output_t;
36059
36060 /******************************
36061 * hwrm_cfa_meter_profile_cfg *
36062 ******************************/
36063
36064
36065 /* hwrm_cfa_meter_profile_cfg_input (size:320b/40B) */
36066
36067 typedef struct hwrm_cfa_meter_profile_cfg_input {
36068 /* The HWRM command request type. */
36069 uint16_t req_type;
36070 /*
36071 * The completion ring to send the completion event on. This should
36072 * be the NQ ID returned from the `nq_alloc` HWRM command.
36073 */
36074 uint16_t cmpl_ring;
36075 /*
36076 * The sequence ID is used by the driver for tracking multiple
36077 * commands. This ID is treated as opaque data by the firmware and
36078 * the value is returned in the `hwrm_resp_hdr` upon completion.
36079 */
36080 uint16_t seq_id;
36081 /*
36082 * The target ID of the command:
36083 * * 0x0-0xFFF8 - The function ID
36084 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36085 * * 0xFFFD - Reserved for user-space HWRM interface
36086 * * 0xFFFF - HWRM
36087 */
36088 uint16_t target_id;
36089 /*
36090 * A physical address pointer pointing to a host buffer that the
36091 * command's response data will be written. This can be either a host
36092 * physical address (HPA) or a guest physical address (GPA) and must
36093 * point to a physically contiguous block of memory.
36094 */
36095 uint64_t resp_addr;
36096 uint8_t flags;
36097 /*
36098 * Enumeration denoting the RX, TX type of the resource.
36099 * This enumeration is used for resources that are similar for both
36100 * TX and RX paths of the chip.
36101 */
36102 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH UINT32_C(0x1)
36103 /* tx path */
36104 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_TX UINT32_C(0x0)
36105 /* rx path */
36106 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_RX UINT32_C(0x1)
36107 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_LAST HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_RX
36108 /* The meter algorithm type. */
36109 uint8_t meter_type;
36110 /* RFC 2697 (srTCM) */
36111 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC2697 UINT32_C(0x0)
36112 /* RFC 2698 (trTCM) */
36113 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC2698 UINT32_C(0x1)
36114 /* RFC 4115 (trTCM) */
36115 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC4115 UINT32_C(0x2)
36116 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_LAST HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC4115
36117 /* This value identifies a meter profile in CFA. */
36118 uint16_t meter_profile_id;
36119 /*
36120 * A value of 0xfff is considered invalid and implies the
36121 * profile is not configured.
36122 */
36123 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_INVALID UINT32_C(0xffff)
36124 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_LAST HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_INVALID
36125 /*
36126 * This field is reserved for the future use.
36127 * It shall be set to 0.
36128 */
36129 uint32_t reserved;
36130 /* A meter rate specified in bytes-per-second. */
36131 uint32_t commit_rate;
36132 /* The bandwidth value. */
36133 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_MASK UINT32_C(0xfffffff)
36134 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_SFT 0
36135 /* The granularity of the value (bits or bytes). */
36136 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE UINT32_C(0x10000000)
36137 /* Value is in bits. */
36138 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BITS (UINT32_C(0x0) << 28)
36139 /* Value is in bytes. */
36140 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BYTES (UINT32_C(0x1) << 28)
36141 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_LAST HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BYTES
36142 /* bw_value_unit is 3 b */
36143 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
36144 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_SFT 29
36145 /* Value is in Mb or MB (base 10). */
36146 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
36147 /* Value is in Kb or KB (base 10). */
36148 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
36149 /* Value is in bits or bytes. */
36150 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
36151 /* Value is in Gb or GB (base 10). */
36152 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
36153 /* Value is in 1/100th of a percentage of total bandwidth. */
36154 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
36155 /* Raw value */
36156 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW (UINT32_C(0x7) << 29)
36157 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_LAST HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW
36158 /* A meter burst size specified in bytes. */
36159 uint32_t commit_burst;
36160 /* The bandwidth value. */
36161 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_MASK UINT32_C(0xfffffff)
36162 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_SFT 0
36163 /* The granularity of the value (bits or bytes). */
36164 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE UINT32_C(0x10000000)
36165 /* Value is in bits. */
36166 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BITS (UINT32_C(0x0) << 28)
36167 /* Value is in bytes. */
36168 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BYTES (UINT32_C(0x1) << 28)
36169 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_LAST HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BYTES
36170 /* bw_value_unit is 3 b */
36171 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
36172 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_SFT 29
36173 /* Value is in Mb or MB (base 10). */
36174 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
36175 /* Value is in Kb or KB (base 10). */
36176 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
36177 /* Value is in bits or bytes. */
36178 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
36179 /* Value is in Gb or GB (base 10). */
36180 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
36181 /* Value is in 1/100th of a percentage of total bandwidth. */
36182 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
36183 /* Invalid value */
36184 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
36185 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_LAST HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID
36186 /* A meter rate specified in bytes-per-second. */
36187 uint32_t excess_peak_rate;
36188 /* The bandwidth value. */
36189 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_MASK UINT32_C(0xfffffff)
36190 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_SFT 0
36191 /* The granularity of the value (bits or bytes). */
36192 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE UINT32_C(0x10000000)
36193 /* Value is in bits. */
36194 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BITS (UINT32_C(0x0) << 28)
36195 /* Value is in bytes. */
36196 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES (UINT32_C(0x1) << 28)
36197 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_LAST HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES
36198 /* bw_value_unit is 3 b */
36199 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
36200 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_SFT 29
36201 /* Value is in Mb or MB (base 10). */
36202 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
36203 /* Value is in Kb or KB (base 10). */
36204 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
36205 /* Value is in bits or bytes. */
36206 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
36207 /* Value is in Gb or GB (base 10). */
36208 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
36209 /* Value is in 1/100th of a percentage of total bandwidth. */
36210 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
36211 /* Raw unit */
36212 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW (UINT32_C(0x7) << 29)
36213 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_LAST HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW
36214 /* A meter burst size specified in bytes. */
36215 uint32_t excess_peak_burst;
36216 /* The bandwidth value. */
36217 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_MASK UINT32_C(0xfffffff)
36218 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_SFT 0
36219 /* The granularity of the value (bits or bytes). */
36220 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE UINT32_C(0x10000000)
36221 /* Value is in bits. */
36222 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BITS (UINT32_C(0x0) << 28)
36223 /* Value is in bytes. */
36224 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES (UINT32_C(0x1) << 28)
36225 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_LAST HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES
36226 /* bw_value_unit is 3 b */
36227 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
36228 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_SFT 29
36229 /* Value is in Mb or MB (base 10). */
36230 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
36231 /* Value is in Kb or KB (base 10). */
36232 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
36233 /* Value is in bits or bytes. */
36234 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
36235 /* Value is in Gb or GB (base 10). */
36236 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
36237 /* Value is in 1/100th of a percentage of total bandwidth. */
36238 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
36239 /* Invalid unit */
36240 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
36241 #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_LAST HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID
36242 } hwrm_cfa_meter_profile_cfg_input_t, *phwrm_cfa_meter_profile_cfg_input_t;
36243
36244 /* hwrm_cfa_meter_profile_cfg_output (size:128b/16B) */
36245
36246 typedef struct hwrm_cfa_meter_profile_cfg_output {
36247 /* The specific error status for the command. */
36248 uint16_t error_code;
36249 /* The HWRM command request type. */
36250 uint16_t req_type;
36251 /* The sequence ID from the original command. */
36252 uint16_t seq_id;
36253 /* The length of the response data in number of bytes. */
36254 uint16_t resp_len;
36255 uint8_t unused_0[7];
36256 /*
36257 * This field is used in Output records to indicate that the output
36258 * is completely written to RAM. This field should be read as '1'
36259 * to indicate that the output has been completely written.
36260 * When writing a command completion or response to an internal
36261 * processor, the order of writes has to be such that this field is
36262 * written last.
36263 */
36264 uint8_t valid;
36265 } hwrm_cfa_meter_profile_cfg_output_t, *phwrm_cfa_meter_profile_cfg_output_t;
36266
36267 /*********************************
36268 * hwrm_cfa_meter_instance_alloc *
36269 *********************************/
36270
36271
36272 /* hwrm_cfa_meter_instance_alloc_input (size:192b/24B) */
36273
36274 typedef struct hwrm_cfa_meter_instance_alloc_input {
36275 /* The HWRM command request type. */
36276 uint16_t req_type;
36277 /*
36278 * The completion ring to send the completion event on. This should
36279 * be the NQ ID returned from the `nq_alloc` HWRM command.
36280 */
36281 uint16_t cmpl_ring;
36282 /*
36283 * The sequence ID is used by the driver for tracking multiple
36284 * commands. This ID is treated as opaque data by the firmware and
36285 * the value is returned in the `hwrm_resp_hdr` upon completion.
36286 */
36287 uint16_t seq_id;
36288 /*
36289 * The target ID of the command:
36290 * * 0x0-0xFFF8 - The function ID
36291 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36292 * * 0xFFFD - Reserved for user-space HWRM interface
36293 * * 0xFFFF - HWRM
36294 */
36295 uint16_t target_id;
36296 /*
36297 * A physical address pointer pointing to a host buffer that the
36298 * command's response data will be written. This can be either a host
36299 * physical address (HPA) or a guest physical address (GPA) and must
36300 * point to a physically contiguous block of memory.
36301 */
36302 uint64_t resp_addr;
36303 uint8_t flags;
36304 /*
36305 * Enumeration denoting the RX, TX type of the resource.
36306 * This enumeration is used for resources that are similar for both
36307 * TX and RX paths of the chip.
36308 */
36309 #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH UINT32_C(0x1)
36310 /* tx path */
36311 #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_TX UINT32_C(0x0)
36312 /* rx path */
36313 #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_RX UINT32_C(0x1)
36314 #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_LAST HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_RX
36315 uint8_t unused_0;
36316 /* This value identifies a meter profile in CFA. */
36317 uint16_t meter_profile_id;
36318 /*
36319 * A value of 0xffff is considered invalid and implies the
36320 * profile is not configured.
36321 */
36322 #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_INVALID UINT32_C(0xffff)
36323 #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_LAST HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_INVALID
36324 uint8_t unused_1[4];
36325 } hwrm_cfa_meter_instance_alloc_input_t, *phwrm_cfa_meter_instance_alloc_input_t;
36326
36327 /* hwrm_cfa_meter_instance_alloc_output (size:128b/16B) */
36328
36329 typedef struct hwrm_cfa_meter_instance_alloc_output {
36330 /* The specific error status for the command. */
36331 uint16_t error_code;
36332 /* The HWRM command request type. */
36333 uint16_t req_type;
36334 /* The sequence ID from the original command. */
36335 uint16_t seq_id;
36336 /* The length of the response data in number of bytes. */
36337 uint16_t resp_len;
36338 /* This value identifies a meter instance in CFA. */
36339 uint16_t meter_instance_id;
36340 /*
36341 * A value of 0xffff is considered invalid and implies the
36342 * instance is not configured.
36343 */
36344 #define HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_INVALID UINT32_C(0xffff)
36345 #define HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_LAST HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_INVALID
36346 uint8_t unused_0[5];
36347 /*
36348 * This field is used in Output records to indicate that the output
36349 * is completely written to RAM. This field should be read as '1'
36350 * to indicate that the output has been completely written.
36351 * When writing a command completion or response to an internal
36352 * processor, the order of writes has to be such that this field is
36353 * written last.
36354 */
36355 uint8_t valid;
36356 } hwrm_cfa_meter_instance_alloc_output_t, *phwrm_cfa_meter_instance_alloc_output_t;
36357
36358 /*******************************
36359 * hwrm_cfa_meter_instance_cfg *
36360 *******************************/
36361
36362
36363 /* hwrm_cfa_meter_instance_cfg_input (size:192b/24B) */
36364
36365 typedef struct hwrm_cfa_meter_instance_cfg_input {
36366 /* The HWRM command request type. */
36367 uint16_t req_type;
36368 /*
36369 * The completion ring to send the completion event on. This should
36370 * be the NQ ID returned from the `nq_alloc` HWRM command.
36371 */
36372 uint16_t cmpl_ring;
36373 /*
36374 * The sequence ID is used by the driver for tracking multiple
36375 * commands. This ID is treated as opaque data by the firmware and
36376 * the value is returned in the `hwrm_resp_hdr` upon completion.
36377 */
36378 uint16_t seq_id;
36379 /*
36380 * The target ID of the command:
36381 * * 0x0-0xFFF8 - The function ID
36382 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36383 * * 0xFFFD - Reserved for user-space HWRM interface
36384 * * 0xFFFF - HWRM
36385 */
36386 uint16_t target_id;
36387 /*
36388 * A physical address pointer pointing to a host buffer that the
36389 * command's response data will be written. This can be either a host
36390 * physical address (HPA) or a guest physical address (GPA) and must
36391 * point to a physically contiguous block of memory.
36392 */
36393 uint64_t resp_addr;
36394 uint8_t flags;
36395 /*
36396 * Enumeration denoting the RX, TX type of the resource.
36397 * This enumeration is used for resources that are similar for both
36398 * TX and RX paths of the chip.
36399 */
36400 #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH UINT32_C(0x1)
36401 /* tx path */
36402 #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_TX UINT32_C(0x0)
36403 /* rx path */
36404 #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_RX UINT32_C(0x1)
36405 #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_LAST HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_RX
36406 uint8_t unused_0;
36407 /*
36408 * This value identifies a new meter profile to be associated with
36409 * the meter instance specified in this command.
36410 */
36411 uint16_t meter_profile_id;
36412 /*
36413 * A value of 0xffff is considered invalid and implies the
36414 * profile is not configured.
36415 */
36416 #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_INVALID UINT32_C(0xffff)
36417 #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_LAST HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_INVALID
36418 /*
36419 * This value identifies the ID of a meter instance that needs to be
36420 * updated with a new meter profile specified in this command.
36421 */
36422 uint16_t meter_instance_id;
36423 uint8_t unused_1[2];
36424 } hwrm_cfa_meter_instance_cfg_input_t, *phwrm_cfa_meter_instance_cfg_input_t;
36425
36426 /* hwrm_cfa_meter_instance_cfg_output (size:128b/16B) */
36427
36428 typedef struct hwrm_cfa_meter_instance_cfg_output {
36429 /* The specific error status for the command. */
36430 uint16_t error_code;
36431 /* The HWRM command request type. */
36432 uint16_t req_type;
36433 /* The sequence ID from the original command. */
36434 uint16_t seq_id;
36435 /* The length of the response data in number of bytes. */
36436 uint16_t resp_len;
36437 uint8_t unused_0[7];
36438 /*
36439 * This field is used in Output records to indicate that the output
36440 * is completely written to RAM. This field should be read as '1'
36441 * to indicate that the output has been completely written.
36442 * When writing a command completion or response to an internal
36443 * processor, the order of writes has to be such that this field is
36444 * written last.
36445 */
36446 uint8_t valid;
36447 } hwrm_cfa_meter_instance_cfg_output_t, *phwrm_cfa_meter_instance_cfg_output_t;
36448
36449 /********************************
36450 * hwrm_cfa_meter_instance_free *
36451 ********************************/
36452
36453
36454 /* hwrm_cfa_meter_instance_free_input (size:192b/24B) */
36455
36456 typedef struct hwrm_cfa_meter_instance_free_input {
36457 /* The HWRM command request type. */
36458 uint16_t req_type;
36459 /*
36460 * The completion ring to send the completion event on. This should
36461 * be the NQ ID returned from the `nq_alloc` HWRM command.
36462 */
36463 uint16_t cmpl_ring;
36464 /*
36465 * The sequence ID is used by the driver for tracking multiple
36466 * commands. This ID is treated as opaque data by the firmware and
36467 * the value is returned in the `hwrm_resp_hdr` upon completion.
36468 */
36469 uint16_t seq_id;
36470 /*
36471 * The target ID of the command:
36472 * * 0x0-0xFFF8 - The function ID
36473 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36474 * * 0xFFFD - Reserved for user-space HWRM interface
36475 * * 0xFFFF - HWRM
36476 */
36477 uint16_t target_id;
36478 /*
36479 * A physical address pointer pointing to a host buffer that the
36480 * command's response data will be written. This can be either a host
36481 * physical address (HPA) or a guest physical address (GPA) and must
36482 * point to a physically contiguous block of memory.
36483 */
36484 uint64_t resp_addr;
36485 uint8_t flags;
36486 /*
36487 * Enumeration denoting the RX, TX type of the resource.
36488 * This enumeration is used for resources that are similar for both
36489 * TX and RX paths of the chip.
36490 */
36491 #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH UINT32_C(0x1)
36492 /* tx path */
36493 #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_TX UINT32_C(0x0)
36494 /* rx path */
36495 #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_RX UINT32_C(0x1)
36496 #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_LAST HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_RX
36497 uint8_t unused_0;
36498 /* This value identifies a meter instance in CFA. */
36499 uint16_t meter_instance_id;
36500 /*
36501 * A value of 0xfff is considered invalid and implies the
36502 * instance is not configured.
36503 */
36504 #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_INVALID UINT32_C(0xffff)
36505 #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_LAST HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_INVALID
36506 uint8_t unused_1[4];
36507 } hwrm_cfa_meter_instance_free_input_t, *phwrm_cfa_meter_instance_free_input_t;
36508
36509 /* hwrm_cfa_meter_instance_free_output (size:128b/16B) */
36510
36511 typedef struct hwrm_cfa_meter_instance_free_output {
36512 /* The specific error status for the command. */
36513 uint16_t error_code;
36514 /* The HWRM command request type. */
36515 uint16_t req_type;
36516 /* The sequence ID from the original command. */
36517 uint16_t seq_id;
36518 /* The length of the response data in number of bytes. */
36519 uint16_t resp_len;
36520 uint8_t unused_0[7];
36521 /*
36522 * This field is used in Output records to indicate that the output
36523 * is completely written to RAM. This field should be read as '1'
36524 * to indicate that the output has been completely written.
36525 * When writing a command completion or response to an internal
36526 * processor, the order of writes has to be such that this field is
36527 * written last.
36528 */
36529 uint8_t valid;
36530 } hwrm_cfa_meter_instance_free_output_t, *phwrm_cfa_meter_instance_free_output_t;
36531
36532 /*******************************
36533 * hwrm_cfa_decap_filter_alloc *
36534 *******************************/
36535
36536
36537 /* hwrm_cfa_decap_filter_alloc_input (size:832b/104B) */
36538
36539 typedef struct hwrm_cfa_decap_filter_alloc_input {
36540 /* The HWRM command request type. */
36541 uint16_t req_type;
36542 /*
36543 * The completion ring to send the completion event on. This should
36544 * be the NQ ID returned from the `nq_alloc` HWRM command.
36545 */
36546 uint16_t cmpl_ring;
36547 /*
36548 * The sequence ID is used by the driver for tracking multiple
36549 * commands. This ID is treated as opaque data by the firmware and
36550 * the value is returned in the `hwrm_resp_hdr` upon completion.
36551 */
36552 uint16_t seq_id;
36553 /*
36554 * The target ID of the command:
36555 * * 0x0-0xFFF8 - The function ID
36556 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36557 * * 0xFFFD - Reserved for user-space HWRM interface
36558 * * 0xFFFF - HWRM
36559 */
36560 uint16_t target_id;
36561 /*
36562 * A physical address pointer pointing to a host buffer that the
36563 * command's response data will be written. This can be either a host
36564 * physical address (HPA) or a guest physical address (GPA) and must
36565 * point to a physically contiguous block of memory.
36566 */
36567 uint64_t resp_addr;
36568 uint32_t flags;
36569 /* ovs_tunnel is 1 b */
36570 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_FLAGS_OVS_TUNNEL UINT32_C(0x1)
36571 uint32_t enables;
36572 /*
36573 * This bit must be '1' for the tunnel_type field to be
36574 * configured.
36575 */
36576 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE UINT32_C(0x1)
36577 /*
36578 * This bit must be '1' for the tunnel_id field to be
36579 * configured.
36580 */
36581 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_ID UINT32_C(0x2)
36582 /*
36583 * This bit must be '1' for the src_macaddr field to be
36584 * configured.
36585 */
36586 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR UINT32_C(0x4)
36587 /*
36588 * This bit must be '1' for the dst_macaddr field to be
36589 * configured.
36590 */
36591 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR UINT32_C(0x8)
36592 /*
36593 * This bit must be '1' for the ovlan_vid field to be
36594 * configured.
36595 */
36596 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_OVLAN_VID UINT32_C(0x10)
36597 /*
36598 * This bit must be '1' for the ivlan_vid field to be
36599 * configured.
36600 */
36601 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IVLAN_VID UINT32_C(0x20)
36602 /*
36603 * This bit must be '1' for the t_ovlan_vid field to be
36604 * configured.
36605 */
36606 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_T_OVLAN_VID UINT32_C(0x40)
36607 /*
36608 * This bit must be '1' for the t_ivlan_vid field to be
36609 * configured.
36610 */
36611 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_T_IVLAN_VID UINT32_C(0x80)
36612 /*
36613 * This bit must be '1' for the ethertype field to be
36614 * configured.
36615 */
36616 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE UINT32_C(0x100)
36617 /*
36618 * This bit must be '1' for the src_ipaddr field to be
36619 * configured.
36620 */
36621 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR UINT32_C(0x200)
36622 /*
36623 * This bit must be '1' for the dst_ipaddr field to be
36624 * configured.
36625 */
36626 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR UINT32_C(0x400)
36627 /*
36628 * This bit must be '1' for the ipaddr_type field to be
36629 * configured.
36630 */
36631 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE UINT32_C(0x800)
36632 /*
36633 * This bit must be '1' for the ip_protocol field to be
36634 * configured.
36635 */
36636 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL UINT32_C(0x1000)
36637 /*
36638 * This bit must be '1' for the src_port field to be
36639 * configured.
36640 */
36641 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT UINT32_C(0x2000)
36642 /*
36643 * This bit must be '1' for the dst_port field to be
36644 * configured.
36645 */
36646 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_PORT UINT32_C(0x4000)
36647 /*
36648 * This bit must be '1' for the dst_id field to be
36649 * configured.
36650 */
36651 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_ID UINT32_C(0x8000)
36652 /*
36653 * This bit must be '1' for the mirror_vnic_id field to be
36654 * configured.
36655 */
36656 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID UINT32_C(0x10000)
36657 /*
36658 * Tunnel identifier.
36659 * Virtual Network Identifier (VNI). Only valid with
36660 * tunnel_types VXLAN, NVGRE, and Geneve.
36661 * Only lower 24-bits of VNI field are used
36662 * in setting up the filter.
36663 */
36664 uint32_t tunnel_id;
36665 /* Tunnel Type. */
36666 uint8_t tunnel_type;
36667 /* Non-tunnel */
36668 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL UINT32_C(0x0)
36669 /* Virtual eXtensible Local Area Network (VXLAN) */
36670 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
36671 /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
36672 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE UINT32_C(0x2)
36673 /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
36674 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE UINT32_C(0x3)
36675 /* IP in IP */
36676 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP UINT32_C(0x4)
36677 /* Generic Network Virtualization Encapsulation (Geneve) */
36678 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
36679 /* Multi-Protocol Label Switching (MPLS) */
36680 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS UINT32_C(0x6)
36681 /* Stateless Transport Tunnel (STT) */
36682 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT UINT32_C(0x7)
36683 /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
36684 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE UINT32_C(0x8)
36685 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
36686 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 UINT32_C(0x9)
36687 /*
36688 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
36689 * datagram payload
36690 */
36691 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 UINT32_C(0xa)
36692 /* Use fixed layer 2 ether type of 0xFFFF */
36693 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE UINT32_C(0xb)
36694 /*
36695 * IPV6 over virtual eXtensible Local Area Network with GPE header
36696 * (IPV6oVXLANGPE)
36697 */
36698 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
36699 /* Any tunneled traffic */
36700 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL UINT32_C(0xff)
36701 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
36702 uint8_t unused_0;
36703 uint16_t unused_1;
36704 /*
36705 * This value indicates the source MAC address in
36706 * the Ethernet header.
36707 */
36708 uint8_t src_macaddr[6];
36709 uint8_t unused_2[2];
36710 /*
36711 * This value indicates the destination MAC address in
36712 * the Ethernet header.
36713 */
36714 uint8_t dst_macaddr[6];
36715 /*
36716 * This value indicates the VLAN ID of the outer VLAN tag
36717 * in the Ethernet header.
36718 */
36719 uint16_t ovlan_vid;
36720 /*
36721 * This value indicates the VLAN ID of the inner VLAN tag
36722 * in the Ethernet header.
36723 */
36724 uint16_t ivlan_vid;
36725 /*
36726 * This value indicates the VLAN ID of the outer VLAN tag
36727 * in the tunnel Ethernet header.
36728 */
36729 uint16_t t_ovlan_vid;
36730 /*
36731 * This value indicates the VLAN ID of the inner VLAN tag
36732 * in the tunnel Ethernet header.
36733 */
36734 uint16_t t_ivlan_vid;
36735 /* This value indicates the ethertype in the Ethernet header. */
36736 uint16_t ethertype;
36737 /*
36738 * This value indicates the type of IP address.
36739 * 4 - IPv4
36740 * 6 - IPv6
36741 * All others are invalid.
36742 */
36743 uint8_t ip_addr_type;
36744 /* invalid */
36745 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN UINT32_C(0x0)
36746 /* IPv4 */
36747 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 UINT32_C(0x4)
36748 /* IPv6 */
36749 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 UINT32_C(0x6)
36750 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
36751 /*
36752 * The value of protocol filed in IP header.
36753 * Applies to UDP and TCP traffic.
36754 * 6 - TCP
36755 * 17 - UDP
36756 */
36757 uint8_t ip_protocol;
36758 /* invalid */
36759 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN UINT32_C(0x0)
36760 /* TCP */
36761 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP UINT32_C(0x6)
36762 /* UDP */
36763 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP UINT32_C(0x11)
36764 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP
36765 uint16_t unused_3;
36766 uint32_t unused_4;
36767 /*
36768 * The value of source IP address to be used in filtering.
36769 * For IPv4, first four bytes represent the IP address.
36770 */
36771 uint32_t src_ipaddr[4];
36772 /*
36773 * The value of destination IP address to be used in filtering.
36774 * For IPv4, first four bytes represent the IP address.
36775 */
36776 uint32_t dst_ipaddr[4];
36777 /*
36778 * The value of source port to be used in filtering.
36779 * Applies to UDP and TCP traffic.
36780 */
36781 uint16_t src_port;
36782 /*
36783 * The value of destination port to be used in filtering.
36784 * Applies to UDP and TCP traffic.
36785 */
36786 uint16_t dst_port;
36787 /*
36788 * If set, this value shall represent the
36789 * Logical VNIC ID of the destination VNIC for the RX
36790 * path.
36791 */
36792 uint16_t dst_id;
36793 /*
36794 * If set, this value shall represent the L2 context that matches the
36795 * L2 information of the decap filter.
36796 */
36797 uint16_t l2_ctxt_ref_id;
36798 } hwrm_cfa_decap_filter_alloc_input_t, *phwrm_cfa_decap_filter_alloc_input_t;
36799
36800 /* hwrm_cfa_decap_filter_alloc_output (size:128b/16B) */
36801
36802 typedef struct hwrm_cfa_decap_filter_alloc_output {
36803 /* The specific error status for the command. */
36804 uint16_t error_code;
36805 /* The HWRM command request type. */
36806 uint16_t req_type;
36807 /* The sequence ID from the original command. */
36808 uint16_t seq_id;
36809 /* The length of the response data in number of bytes. */
36810 uint16_t resp_len;
36811 /* This value is an opaque id into CFA data structures. */
36812 uint32_t decap_filter_id;
36813 uint8_t unused_0[3];
36814 /*
36815 * This field is used in Output records to indicate that the output
36816 * is completely written to RAM. This field should be read as '1'
36817 * to indicate that the output has been completely written.
36818 * When writing a command completion or response to an internal
36819 * processor, the order of writes has to be such that this field is
36820 * written last.
36821 */
36822 uint8_t valid;
36823 } hwrm_cfa_decap_filter_alloc_output_t, *phwrm_cfa_decap_filter_alloc_output_t;
36824
36825 /******************************
36826 * hwrm_cfa_decap_filter_free *
36827 ******************************/
36828
36829
36830 /* hwrm_cfa_decap_filter_free_input (size:192b/24B) */
36831
36832 typedef struct hwrm_cfa_decap_filter_free_input {
36833 /* The HWRM command request type. */
36834 uint16_t req_type;
36835 /*
36836 * The completion ring to send the completion event on. This should
36837 * be the NQ ID returned from the `nq_alloc` HWRM command.
36838 */
36839 uint16_t cmpl_ring;
36840 /*
36841 * The sequence ID is used by the driver for tracking multiple
36842 * commands. This ID is treated as opaque data by the firmware and
36843 * the value is returned in the `hwrm_resp_hdr` upon completion.
36844 */
36845 uint16_t seq_id;
36846 /*
36847 * The target ID of the command:
36848 * * 0x0-0xFFF8 - The function ID
36849 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36850 * * 0xFFFD - Reserved for user-space HWRM interface
36851 * * 0xFFFF - HWRM
36852 */
36853 uint16_t target_id;
36854 /*
36855 * A physical address pointer pointing to a host buffer that the
36856 * command's response data will be written. This can be either a host
36857 * physical address (HPA) or a guest physical address (GPA) and must
36858 * point to a physically contiguous block of memory.
36859 */
36860 uint64_t resp_addr;
36861 /* This value is an opaque id into CFA data structures. */
36862 uint32_t decap_filter_id;
36863 uint8_t unused_0[4];
36864 } hwrm_cfa_decap_filter_free_input_t, *phwrm_cfa_decap_filter_free_input_t;
36865
36866 /* hwrm_cfa_decap_filter_free_output (size:128b/16B) */
36867
36868 typedef struct hwrm_cfa_decap_filter_free_output {
36869 /* The specific error status for the command. */
36870 uint16_t error_code;
36871 /* The HWRM command request type. */
36872 uint16_t req_type;
36873 /* The sequence ID from the original command. */
36874 uint16_t seq_id;
36875 /* The length of the response data in number of bytes. */
36876 uint16_t resp_len;
36877 uint8_t unused_0[7];
36878 /*
36879 * This field is used in Output records to indicate that the output
36880 * is completely written to RAM. This field should be read as '1'
36881 * to indicate that the output has been completely written.
36882 * When writing a command completion or response to an internal
36883 * processor, the order of writes has to be such that this field is
36884 * written last.
36885 */
36886 uint8_t valid;
36887 } hwrm_cfa_decap_filter_free_output_t, *phwrm_cfa_decap_filter_free_output_t;
36888
36889 /***********************
36890 * hwrm_cfa_flow_alloc *
36891 ***********************/
36892
36893
36894 /* hwrm_cfa_flow_alloc_input (size:1024b/128B) */
36895
36896 typedef struct hwrm_cfa_flow_alloc_input {
36897 /* The HWRM command request type. */
36898 uint16_t req_type;
36899 /*
36900 * The completion ring to send the completion event on. This should
36901 * be the NQ ID returned from the `nq_alloc` HWRM command.
36902 */
36903 uint16_t cmpl_ring;
36904 /*
36905 * The sequence ID is used by the driver for tracking multiple
36906 * commands. This ID is treated as opaque data by the firmware and
36907 * the value is returned in the `hwrm_resp_hdr` upon completion.
36908 */
36909 uint16_t seq_id;
36910 /*
36911 * The target ID of the command:
36912 * * 0x0-0xFFF8 - The function ID
36913 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36914 * * 0xFFFD - Reserved for user-space HWRM interface
36915 * * 0xFFFF - HWRM
36916 */
36917 uint16_t target_id;
36918 /*
36919 * A physical address pointer pointing to a host buffer that the
36920 * command's response data will be written. This can be either a host
36921 * physical address (HPA) or a guest physical address (GPA) and must
36922 * point to a physically contiguous block of memory.
36923 */
36924 uint64_t resp_addr;
36925 uint16_t flags;
36926 /* tunnel is 1 b */
36927 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_TUNNEL UINT32_C(0x1)
36928 /* num_vlan is 2 b */
36929 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_MASK UINT32_C(0x6)
36930 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_SFT 1
36931 /* no tags */
36932 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_NONE (UINT32_C(0x0) << 1)
36933 /* 1 tag */
36934 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_ONE (UINT32_C(0x1) << 1)
36935 /* 2 tags */
36936 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_TWO (UINT32_C(0x2) << 1)
36937 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_LAST HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_TWO
36938 /* Enumeration denoting the Flow Type. */
36939 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_MASK UINT32_C(0x38)
36940 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_SFT 3
36941 /* L2 flow */
36942 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_L2 (UINT32_C(0x0) << 3)
36943 /* IPV4 flow */
36944 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV4 (UINT32_C(0x1) << 3)
36945 /* IPV6 flow */
36946 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV6 (UINT32_C(0x2) << 3)
36947 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_LAST HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV6
36948 /*
36949 * when set to 1, indicates TX flow offload for function specified
36950 * in src_fid and the dst_fid should be set to invalid value. To
36951 * indicate a VM to VM flow, both of the path_tx and path_rx flags
36952 * need to be set. For virtio vSwitch offload case, the src_fid and
36953 * dst_fid is set to the same fid value. For the SRIOV vSwitch
36954 * offload case, the src_fid and dst_fid must be set to the same VF
36955 * FID belong to the children VFs of the same PF to indicate VM to
36956 * VM flow.
36957 */
36958 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_PATH_TX UINT32_C(0x40)
36959 /*
36960 * when set to 1, indicates RX flow offload for function specified
36961 * in dst_fid and the src_fid should be set to invalid value.
36962 */
36963 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_PATH_RX UINT32_C(0x80)
36964 /*
36965 * Set to 1 to indicate matching of VXLAN VNI from the custom vxlan
36966 * header is required and the VXLAN VNI value is stored in the first
36967 * 24 bits of the dmac field. This flag is only valid when the flow
36968 * direction is RX.
36969 */
36970 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_MATCH_VXLAN_IP_VNI UINT32_C(0x100)
36971 /*
36972 * Set to 1 to indicate vhost_id is specified in the outer_vlan_tci
36973 * field.
36974 */
36975 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_VHOST_ID_USE_VLAN UINT32_C(0x200)
36976 /*
36977 * Tx Flow: vf fid.
36978 * Rx Flow: pf fid.
36979 */
36980 uint16_t src_fid;
36981 /* Tunnel handle valid when tunnel flag is set. */
36982 uint32_t tunnel_handle;
36983 uint16_t action_flags;
36984 /*
36985 * Setting of this flag indicates drop action. If this flag is not
36986 * set, then it should be considered accept action.
36987 */
36988 #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_FWD UINT32_C(0x1)
36989 /* recycle is 1 b */
36990 #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_RECYCLE UINT32_C(0x2)
36991 /*
36992 * Setting of this flag indicates drop action. If this flag is not
36993 * set, then it should be considered accept action.
36994 */
36995 #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_DROP UINT32_C(0x4)
36996 /* meter is 1 b */
36997 #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_METER UINT32_C(0x8)
36998 /* tunnel is 1 b */
36999 #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TUNNEL UINT32_C(0x10)
37000 /* nat_src is 1 b */
37001 #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_SRC UINT32_C(0x20)
37002 /* nat_dest is 1 b */
37003 #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_DEST UINT32_C(0x40)
37004 /* nat_ipv4_address is 1 b */
37005 #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_IPV4_ADDRESS UINT32_C(0x80)
37006 /* l2_header_rewrite is 1 b */
37007 #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_L2_HEADER_REWRITE UINT32_C(0x100)
37008 /* ttl_decrement is 1 b */
37009 #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TTL_DECREMENT UINT32_C(0x200)
37010 /*
37011 * If set to 1 and flow direction is TX, it indicates decap of L2
37012 * header and encap of tunnel header. If set to 1 and flow direction
37013 * is RX, it indicates decap of tunnel header and encap L2 header.
37014 * The type of tunnel is specified in the tunnel_type field.
37015 */
37016 #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TUNNEL_IP UINT32_C(0x400)
37017 /* If set to 1, flow aging is enabled for this flow. */
37018 #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_FLOW_AGING_ENABLED UINT32_C(0x800)
37019 /*
37020 * If set to 1 an attempt will be made to try to offload this flow
37021 * to the most optimal flow table resource. If set to 0, the flow
37022 * will be placed to the default flow table resource.
37023 */
37024 #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_PRI_HINT UINT32_C(0x1000)
37025 /*
37026 * If set to 1 there will be no attempt to allocate an on-chip try
37027 * to offload this flow. If set to 0, which will keep compatibility
37028 * with the older drivers, will cause the FW to attempt to allocate
37029 * an on-chip flow counter for the newly created flow. This will
37030 * keep the existing behavior with EM flows which always had an
37031 * associated flow counter.
37032 */
37033 #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NO_FLOW_COUNTER_ALLOC UINT32_C(0x2000)
37034 /*
37035 * Tx Flow: pf or vf fid.
37036 * Rx Flow: vf fid.
37037 */
37038 uint16_t dst_fid;
37039 /* VLAN tpid, valid when push_vlan flag is set. */
37040 uint16_t l2_rewrite_vlan_tpid;
37041 /* VLAN tci, valid when push_vlan flag is set. */
37042 uint16_t l2_rewrite_vlan_tci;
37043 /* Meter id, valid when meter flag is set. */
37044 uint16_t act_meter_id;
37045 /* Flow with the same l2 context tcam key. */
37046 uint16_t ref_flow_handle;
37047 /* This value sets the match value for the ethertype. */
37048 uint16_t ethertype;
37049 /* valid when num tags is 1 or 2. */
37050 uint16_t outer_vlan_tci;
37051 /* This value sets the match value for the Destination MAC address. */
37052 uint16_t dmac[3];
37053 /* valid when num tags is 2. */
37054 uint16_t inner_vlan_tci;
37055 /* This value sets the match value for the Source MAC address. */
37056 uint16_t smac[3];
37057 /* The bit length of destination IP address mask. */
37058 uint8_t ip_dst_mask_len;
37059 /* The bit length of source IP address mask. */
37060 uint8_t ip_src_mask_len;
37061 /* The value of destination IPv4/IPv6 address. */
37062 uint32_t ip_dst[4];
37063 /* The source IPv4/IPv6 address. */
37064 uint32_t ip_src[4];
37065 /*
37066 * The value of source port.
37067 * Applies to UDP and TCP traffic.
37068 */
37069 uint16_t l4_src_port;
37070 /*
37071 * The value of source port mask.
37072 * Applies to UDP and TCP traffic.
37073 */
37074 uint16_t l4_src_port_mask;
37075 /*
37076 * The value of destination port.
37077 * Applies to UDP and TCP traffic.
37078 */
37079 uint16_t l4_dst_port;
37080 /*
37081 * The value of destination port mask.
37082 * Applies to UDP and TCP traffic.
37083 */
37084 uint16_t l4_dst_port_mask;
37085 /*
37086 * NAT IPv4/6 address based on address type flag.
37087 * 0 values are ignored.
37088 */
37089 uint32_t nat_ip_address[4];
37090 /* L2 header re-write Destination MAC address. */
37091 uint16_t l2_rewrite_dmac[3];
37092 /*
37093 * The NAT source/destination port based on direction flag.
37094 * Applies to UDP and TCP traffic.
37095 * 0 values are ignored.
37096 */
37097 uint16_t nat_port;
37098 /* L2 header re-write Source MAC address. */
37099 uint16_t l2_rewrite_smac[3];
37100 /* The value of ip protocol. */
37101 uint8_t ip_proto;
37102 /* Tunnel Type. */
37103 uint8_t tunnel_type;
37104 /* Non-tunnel */
37105 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL UINT32_C(0x0)
37106 /* Virtual eXtensible Local Area Network (VXLAN) */
37107 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
37108 /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
37109 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NVGRE UINT32_C(0x2)
37110 /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
37111 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2GRE UINT32_C(0x3)
37112 /* IP in IP */
37113 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPIP UINT32_C(0x4)
37114 /* Generic Network Virtualization Encapsulation (Geneve) */
37115 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
37116 /* Multi-Protocol Label Switching (MPLS) */
37117 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_MPLS UINT32_C(0x6)
37118 /* Stateless Transport Tunnel (STT) */
37119 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_STT UINT32_C(0x7)
37120 /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
37121 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE UINT32_C(0x8)
37122 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
37123 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 UINT32_C(0x9)
37124 /*
37125 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
37126 * datagram payload
37127 */
37128 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 UINT32_C(0xa)
37129 /* Use fixed layer 2 ether type of 0xFFFF */
37130 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE UINT32_C(0xb)
37131 /*
37132 * IPV6 over virtual eXtensible Local Area Network with GPE header
37133 * (IPV6oVXLANGPE)
37134 */
37135 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
37136 /* Any tunneled traffic */
37137 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL UINT32_C(0xff)
37138 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_LAST HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
37139 } hwrm_cfa_flow_alloc_input_t, *phwrm_cfa_flow_alloc_input_t;
37140
37141 /* hwrm_cfa_flow_alloc_output (size:256b/32B) */
37142
37143 typedef struct hwrm_cfa_flow_alloc_output {
37144 /* The specific error status for the command. */
37145 uint16_t error_code;
37146 /* The HWRM command request type. */
37147 uint16_t req_type;
37148 /* The sequence ID from the original command. */
37149 uint16_t seq_id;
37150 /* The length of the response data in number of bytes. */
37151 uint16_t resp_len;
37152 /* Flow record index. */
37153 uint16_t flow_handle;
37154 uint8_t unused_0[2];
37155 /*
37156 * The flow id value in bit 0-29 is the actual ID of the flow
37157 * associated with this filter and it shall be used to match
37158 * and associate the flow identifier returned in completion
37159 * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
37160 * shall indicate no valid flow id.
37161 */
37162 uint32_t flow_id;
37163 /* Indicate the flow id value. */
37164 #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK UINT32_C(0x3fffffff)
37165 #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
37166 /* Indicate type of the flow. */
37167 #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE UINT32_C(0x40000000)
37168 /*
37169 * If this bit set to 0, then it indicates that the flow is
37170 * internal flow.
37171 */
37172 #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_INT (UINT32_C(0x0) << 30)
37173 /*
37174 * If this bit is set to 1, then it indicates that the flow is
37175 * external flow.
37176 */
37177 #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT (UINT32_C(0x1) << 30)
37178 #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
37179 /* Indicate the flow direction. */
37180 #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR UINT32_C(0x80000000)
37181 /* If this bit set to 0, then it indicates rx flow. */
37182 #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_RX (UINT32_C(0x0) << 31)
37183 /* If this bit is set to 1, then it indicates that tx flow. */
37184 #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX (UINT32_C(0x1) << 31)
37185 #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_LAST HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX
37186 /* This value identifies a set of CFA data structures used for a flow. */
37187 uint64_t ext_flow_handle;
37188 uint32_t flow_counter_id;
37189 uint8_t unused_1[3];
37190 /*
37191 * This field is used in Output records to indicate that the output
37192 * is completely written to RAM. This field should be read as '1'
37193 * to indicate that the output has been completely written.
37194 * When writing a command completion or response to an internal
37195 * processor, the order of writes has to be such that this field is
37196 * written last.
37197 */
37198 uint8_t valid;
37199 } hwrm_cfa_flow_alloc_output_t, *phwrm_cfa_flow_alloc_output_t;
37200
37201 /* hwrm_cfa_flow_alloc_cmd_err (size:64b/8B) */
37202
37203 typedef struct hwrm_cfa_flow_alloc_cmd_err {
37204 /*
37205 * command specific error codes that goes to
37206 * the cmd_err field in Common HWRM Error Response.
37207 */
37208 uint8_t code;
37209 /* Unknown error */
37210 #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
37211 /* No more L2 Context TCAM */
37212 #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_L2_CONTEXT_TCAM UINT32_C(0x1)
37213 /* No more action records */
37214 #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_ACTION_RECORD UINT32_C(0x2)
37215 /* No more flow counters */
37216 #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_COUNTER UINT32_C(0x3)
37217 /* No more wild-card TCAM */
37218 #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_WILD_CARD_TCAM UINT32_C(0x4)
37219 /* Hash collsion in exact match tables */
37220 #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_HASH_COLLISION UINT32_C(0x5)
37221 /* Key is already installed */
37222 #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_KEY_EXISTS UINT32_C(0x6)
37223 /* Flow Context DB is out of resource */
37224 #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_CTXT_DB UINT32_C(0x7)
37225 #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_LAST HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_CTXT_DB
37226 uint8_t unused_0[7];
37227 } hwrm_cfa_flow_alloc_cmd_err_t, *phwrm_cfa_flow_alloc_cmd_err_t;
37228
37229 /**********************
37230 * hwrm_cfa_flow_free *
37231 **********************/
37232
37233
37234 /* hwrm_cfa_flow_free_input (size:256b/32B) */
37235
37236 typedef struct hwrm_cfa_flow_free_input {
37237 /* The HWRM command request type. */
37238 uint16_t req_type;
37239 /*
37240 * The completion ring to send the completion event on. This should
37241 * be the NQ ID returned from the `nq_alloc` HWRM command.
37242 */
37243 uint16_t cmpl_ring;
37244 /*
37245 * The sequence ID is used by the driver for tracking multiple
37246 * commands. This ID is treated as opaque data by the firmware and
37247 * the value is returned in the `hwrm_resp_hdr` upon completion.
37248 */
37249 uint16_t seq_id;
37250 /*
37251 * The target ID of the command:
37252 * * 0x0-0xFFF8 - The function ID
37253 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37254 * * 0xFFFD - Reserved for user-space HWRM interface
37255 * * 0xFFFF - HWRM
37256 */
37257 uint16_t target_id;
37258 /*
37259 * A physical address pointer pointing to a host buffer that the
37260 * command's response data will be written. This can be either a host
37261 * physical address (HPA) or a guest physical address (GPA) and must
37262 * point to a physically contiguous block of memory.
37263 */
37264 uint64_t resp_addr;
37265 /* Flow record index. */
37266 uint16_t flow_handle;
37267 uint16_t unused_0;
37268 /* Flow counter id to be freed. */
37269 uint32_t flow_counter_id;
37270 /* This value identifies a set of CFA data structures used for a flow. */
37271 uint64_t ext_flow_handle;
37272 } hwrm_cfa_flow_free_input_t, *phwrm_cfa_flow_free_input_t;
37273
37274 /* hwrm_cfa_flow_free_output (size:256b/32B) */
37275
37276 typedef struct hwrm_cfa_flow_free_output {
37277 /* The specific error status for the command. */
37278 uint16_t error_code;
37279 /* The HWRM command request type. */
37280 uint16_t req_type;
37281 /* The sequence ID from the original command. */
37282 uint16_t seq_id;
37283 /* The length of the response data in number of bytes. */
37284 uint16_t resp_len;
37285 /* packet is 64 b */
37286 uint64_t packet;
37287 /* byte is 64 b */
37288 uint64_t byte;
37289 uint8_t unused_0[7];
37290 /*
37291 * This field is used in Output records to indicate that the output
37292 * is completely written to RAM. This field should be read as '1'
37293 * to indicate that the output has been completely written.
37294 * When writing a command completion or response to an internal
37295 * processor, the order of writes has to be such that this field is
37296 * written last.
37297 */
37298 uint8_t valid;
37299 } hwrm_cfa_flow_free_output_t, *phwrm_cfa_flow_free_output_t;
37300
37301 /* hwrm_cfa_flow_action_data (size:960b/120B) */
37302
37303 typedef struct hwrm_cfa_flow_action_data {
37304 uint16_t action_flags;
37305 /* Setting of this flag indicates accept action. */
37306 #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_FWD UINT32_C(0x1)
37307 /* Setting of this flag indicates recycle action. */
37308 #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_RECYCLE UINT32_C(0x2)
37309 /* Setting of this flag indicates drop action. */
37310 #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_DROP UINT32_C(0x4)
37311 /* Setting of this flag indicates meter action. */
37312 #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_METER UINT32_C(0x8)
37313 /* Setting of this flag indicates tunnel action. */
37314 #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TUNNEL UINT32_C(0x10)
37315 /*
37316 * If set to 1 and flow direction is TX, it indicates decap of L2
37317 * header and encap of tunnel header. If set to 1 and flow direction
37318 * is RX, it indicates decap of tunnel header and encap L2 header.
37319 */
37320 #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TUNNEL_IP UINT32_C(0x20)
37321 /* Setting of this flag indicates ttl decrement action. */
37322 #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TTL_DECREMENT UINT32_C(0x40)
37323 /* If set to 1, flow aging is enabled for this flow. */
37324 #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_FLOW_AGING_ENABLED UINT32_C(0x80)
37325 /* Setting of this flag indicates encap action. */
37326 #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_ENCAP UINT32_C(0x100)
37327 /* Setting of this flag indicates decap action. */
37328 #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_DECAP UINT32_C(0x200)
37329 /* Meter id. */
37330 uint16_t act_meter_id;
37331 /* VNIC id. */
37332 uint16_t vnic_id;
37333 /* vport number. */
37334 uint16_t vport_id;
37335 /* The NAT source/destination. */
37336 uint16_t nat_port;
37337 uint16_t unused_0[3];
37338 /* NAT IPv4/IPv6 address. */
37339 uint32_t nat_ip_address[4];
37340 /* Encapsulation Type. */
37341 uint8_t encap_type;
37342 /* Virtual eXtensible Local Area Network (VXLAN) */
37343 #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN UINT32_C(0x1)
37344 /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
37345 #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_NVGRE UINT32_C(0x2)
37346 /* Generic Routing Encapsulation (GRE) after inside Ethernet payload */
37347 #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_L2GRE UINT32_C(0x3)
37348 /* IP in IP */
37349 #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPIP UINT32_C(0x4)
37350 /* Generic Network Virtualization Encapsulation (Geneve) */
37351 #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_GENEVE UINT32_C(0x5)
37352 /* Multi-Protocol Label Switching (MPLS) */
37353 #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_MPLS UINT32_C(0x6)
37354 /* VLAN */
37355 #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VLAN UINT32_C(0x7)
37356 /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
37357 #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPGRE UINT32_C(0x8)
37358 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
37359 #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_V4 UINT32_C(0x9)
37360 /*
37361 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
37362 * datagram payload
37363 */
37364 #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPGRE_V1 UINT32_C(0xa)
37365 /* Use fixed layer 2 ether type of 0xFFFF */
37366 #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_L2_ETYPE UINT32_C(0xb)
37367 /*
37368 * IPV6 over virtual eXtensible Local Area Network with GPE header
37369 * (IPV6oVXLANGPE)
37370 */
37371 #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
37372 #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_LAST HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_GPE_V6
37373 uint8_t unused[7];
37374 /* This value is encap data for the associated encap type. */
37375 uint32_t encap_data[20];
37376 } hwrm_cfa_flow_action_data_t, *phwrm_cfa_flow_action_data_t;
37377
37378 /* hwrm_cfa_flow_tunnel_hdr_data (size:64b/8B) */
37379
37380 typedef struct hwrm_cfa_flow_tunnel_hdr_data {
37381 /* Tunnel Type. */
37382 uint8_t tunnel_type;
37383 /* Non-tunnel */
37384 #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_NONTUNNEL UINT32_C(0x0)
37385 /* Virtual eXtensible Local Area Network (VXLAN) */
37386 #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
37387 /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
37388 #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_NVGRE UINT32_C(0x2)
37389 /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
37390 #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_L2GRE UINT32_C(0x3)
37391 /* IP in IP */
37392 #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPIP UINT32_C(0x4)
37393 /* Generic Network Virtualization Encapsulation (Geneve) */
37394 #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
37395 /* Multi-Protocol Label Switching (MPLS) */
37396 #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_MPLS UINT32_C(0x6)
37397 /* Stateless Transport Tunnel (STT) */
37398 #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_STT UINT32_C(0x7)
37399 /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
37400 #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPGRE UINT32_C(0x8)
37401 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
37402 #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN_V4 UINT32_C(0x9)
37403 /*
37404 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
37405 * datagram payload
37406 */
37407 #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPGRE_V1 UINT32_C(0xa)
37408 /* Use fixed layer 2 ether type of 0xFFFF */
37409 #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_L2_ETYPE UINT32_C(0xb)
37410 /*
37411 * IPV6 over virtual eXtensible Local Area Network with GPE header
37412 * (IPV6oVXLANGPE)
37413 */
37414 #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
37415 /* Any tunneled traffic */
37416 #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_ANYTUNNEL UINT32_C(0xff)
37417 #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_LAST HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_ANYTUNNEL
37418 uint8_t unused[3];
37419 /*
37420 * Tunnel identifier.
37421 * Virtual Network Identifier (VNI).
37422 */
37423 uint32_t tunnel_id;
37424 } hwrm_cfa_flow_tunnel_hdr_data_t, *phwrm_cfa_flow_tunnel_hdr_data_t;
37425
37426 /* hwrm_cfa_flow_l4_key_data (size:64b/8B) */
37427
37428 typedef struct hwrm_cfa_flow_l4_key_data {
37429 /* The value of source port. */
37430 uint16_t l4_src_port;
37431 /* The value of destination port. */
37432 uint16_t l4_dst_port;
37433 uint32_t unused;
37434 } hwrm_cfa_flow_l4_key_data_t, *phwrm_cfa_flow_l4_key_data_t;
37435
37436 /* hwrm_cfa_flow_l3_key_data (size:512b/64B) */
37437
37438 typedef struct hwrm_cfa_flow_l3_key_data {
37439 /* The value of ip protocol. */
37440 uint8_t ip_protocol;
37441 uint8_t unused_0[7];
37442 /* The value of destination IPv4/IPv6 address. */
37443 uint32_t ip_dst[4];
37444 /* The source IPv4/IPv6 address. */
37445 uint32_t ip_src[4];
37446 /* NAT IPv4/IPv6 address. */
37447 uint32_t nat_ip_address[4];
37448 uint64_t unused;
37449 } hwrm_cfa_flow_l3_key_data_t, *phwrm_cfa_flow_l3_key_data_t;
37450
37451 /* hwrm_cfa_flow_l2_key_data (size:448b/56B) */
37452
37453 typedef struct hwrm_cfa_flow_l2_key_data {
37454 /* Destination MAC address. */
37455 uint16_t dmac[3];
37456 uint16_t unused_0;
37457 /* Source MAC address. */
37458 uint16_t smac[3];
37459 uint16_t unused_1;
37460 /* L2 header re-write Destination MAC address. */
37461 uint16_t l2_rewrite_dmac[3];
37462 uint16_t unused_2;
37463 /* L2 header re-write Source MAC address. */
37464 uint16_t l2_rewrite_smac[3];
37465 /* Ethertype. */
37466 uint16_t ethertype;
37467 /* Number of VLAN tags. */
37468 uint16_t num_vlan_tags;
37469 /* VLAN tpid. */
37470 uint16_t l2_rewrite_vlan_tpid;
37471 /* VLAN tci. */
37472 uint16_t l2_rewrite_vlan_tci;
37473 uint8_t unused_3[2];
37474 /* Outer VLAN TPID. */
37475 uint16_t ovlan_tpid;
37476 /* Outer VLAN TCI. */
37477 uint16_t ovlan_tci;
37478 /* Inner VLAN TPID. */
37479 uint16_t ivlan_tpid;
37480 /* Inner VLAN TCI. */
37481 uint16_t ivlan_tci;
37482 uint8_t unused[8];
37483 } hwrm_cfa_flow_l2_key_data_t, *phwrm_cfa_flow_l2_key_data_t;
37484
37485 /* hwrm_cfa_flow_key_data (size:4160b/520B) */
37486
37487 typedef struct hwrm_cfa_flow_key_data {
37488 /* Flow associated tunnel L2 header key info. */
37489 uint32_t t_l2_key_data[14];
37490 /* Flow associated tunnel L2 header mask info. */
37491 uint32_t t_l2_key_mask[14];
37492 /* Flow associated tunnel L3 header key info. */
37493 uint32_t t_l3_key_data[16];
37494 /* Flow associated tunnel L3 header mask info. */
37495 uint32_t t_l3_key_mask[16];
37496 /* Flow associated tunnel L4 header key info. */
37497 uint64_t t_l4_key_data;
37498 /* Flow associated tunnel L4 header mask info. */
37499 uint64_t t_l4_key_mask;
37500 /* Flow associated tunnel header info. */
37501 uint64_t tunnel_hdr;
37502 /* Flow associated L2 header key info. */
37503 uint32_t l2_key_data[14];
37504 /* Flow associated L2 header mask info. */
37505 uint32_t l2_key_mask[14];
37506 /* Flow associated L3 header key info. */
37507 uint32_t l3_key_data[16];
37508 /* Flow associated L3 header mask info. */
37509 uint32_t l3_key_mask[16];
37510 /* Flow associated L4 header key info. */
37511 uint64_t l4_key_data;
37512 /* Flow associated L4 header mask info. */
37513 uint64_t l4_key_mask;
37514 } hwrm_cfa_flow_key_data_t, *phwrm_cfa_flow_key_data_t;
37515
37516 /**********************
37517 * hwrm_cfa_flow_info *
37518 **********************/
37519
37520
37521 /* hwrm_cfa_flow_info_input (size:256b/32B) */
37522
37523 typedef struct hwrm_cfa_flow_info_input {
37524 /* The HWRM command request type. */
37525 uint16_t req_type;
37526 /*
37527 * The completion ring to send the completion event on. This should
37528 * be the NQ ID returned from the `nq_alloc` HWRM command.
37529 */
37530 uint16_t cmpl_ring;
37531 /*
37532 * The sequence ID is used by the driver for tracking multiple
37533 * commands. This ID is treated as opaque data by the firmware and
37534 * the value is returned in the `hwrm_resp_hdr` upon completion.
37535 */
37536 uint16_t seq_id;
37537 /*
37538 * The target ID of the command:
37539 * * 0x0-0xFFF8 - The function ID
37540 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37541 * * 0xFFFD - Reserved for user-space HWRM interface
37542 * * 0xFFFF - HWRM
37543 */
37544 uint16_t target_id;
37545 /*
37546 * A physical address pointer pointing to a host buffer that the
37547 * command's response data will be written. This can be either a host
37548 * physical address (HPA) or a guest physical address (GPA) and must
37549 * point to a physically contiguous block of memory.
37550 */
37551 uint64_t resp_addr;
37552 /* Flow record index. */
37553 uint16_t flow_handle;
37554 /* Max flow handle */
37555 #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_MAX_MASK UINT32_C(0xfff)
37556 #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_MAX_SFT 0
37557 /* CNP flow handle */
37558 #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_CNP_CNT UINT32_C(0x1000)
37559 /* RoCEv1 flow handle */
37560 #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV1_CNT UINT32_C(0x2000)
37561 /* RoCEv2 flow handle */
37562 #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV2_CNT UINT32_C(0x4000)
37563 /* Direction rx = 1 */
37564 #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_DIR_RX UINT32_C(0x8000)
37565 uint8_t unused_0[6];
37566 /* This value identifies a set of CFA data structures used for a flow. */
37567 uint64_t ext_flow_handle;
37568 } hwrm_cfa_flow_info_input_t, *phwrm_cfa_flow_info_input_t;
37569
37570 /* hwrm_cfa_flow_info_output (size:5632b/704B) */
37571
37572 typedef struct hwrm_cfa_flow_info_output {
37573 /* The specific error status for the command. */
37574 uint16_t error_code;
37575 /* The HWRM command request type. */
37576 uint16_t req_type;
37577 /* The sequence ID from the original command. */
37578 uint16_t seq_id;
37579 /* The length of the response data in number of bytes. */
37580 uint16_t resp_len;
37581 uint8_t flags;
37582 /* When set to 1, indicates the configuration is the TX flow. */
37583 #define HWRM_CFA_FLOW_INFO_OUTPUT_FLAGS_PATH_TX UINT32_C(0x1)
37584 /* When set to 1, indicates the configuration is the RX flow. */
37585 #define HWRM_CFA_FLOW_INFO_OUTPUT_FLAGS_PATH_RX UINT32_C(0x2)
37586 /* profile is 8 b */
37587 uint8_t profile;
37588 /* src_fid is 16 b */
37589 uint16_t src_fid;
37590 /* dst_fid is 16 b */
37591 uint16_t dst_fid;
37592 /* l2_ctxt_id is 16 b */
37593 uint16_t l2_ctxt_id;
37594 /* em_info is 64 b */
37595 uint64_t em_info;
37596 /* tcam_info is 64 b */
37597 uint64_t tcam_info;
37598 /* vfp_tcam_info is 64 b */
37599 uint64_t vfp_tcam_info;
37600 /* ar_id is 16 b */
37601 uint16_t ar_id;
37602 /* flow_handle is 16 b */
37603 uint16_t flow_handle;
37604 /* tunnel_handle is 32 b */
37605 uint32_t tunnel_handle;
37606 /* The flow aging timer for the flow, the unit is 100 milliseconds */
37607 uint16_t flow_timer;
37608 uint8_t unused_0[6];
37609 /* Flow associated L2, L3 and L4 headers info. */
37610 uint32_t flow_key_data[130];
37611 /* Flow associated action record info. */
37612 uint32_t flow_action_info[30];
37613 uint8_t unused_1[7];
37614 /*
37615 * This field is used in Output records to indicate that the output
37616 * is completely written to RAM. This field should be read as '1'
37617 * to indicate that the output has been completely written.
37618 * When writing a command completion or response to an internal
37619 * processor, the order of writes has to be such that this field is
37620 * written last.
37621 */
37622 uint8_t valid;
37623 } hwrm_cfa_flow_info_output_t, *phwrm_cfa_flow_info_output_t;
37624
37625 /***********************
37626 * hwrm_cfa_flow_flush *
37627 ***********************/
37628
37629
37630 /* hwrm_cfa_flow_flush_input (size:256b/32B) */
37631
37632 typedef struct hwrm_cfa_flow_flush_input {
37633 /* The HWRM command request type. */
37634 uint16_t req_type;
37635 /*
37636 * The completion ring to send the completion event on. This should
37637 * be the NQ ID returned from the `nq_alloc` HWRM command.
37638 */
37639 uint16_t cmpl_ring;
37640 /*
37641 * The sequence ID is used by the driver for tracking multiple
37642 * commands. This ID is treated as opaque data by the firmware and
37643 * the value is returned in the `hwrm_resp_hdr` upon completion.
37644 */
37645 uint16_t seq_id;
37646 /*
37647 * The target ID of the command:
37648 * * 0x0-0xFFF8 - The function ID
37649 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37650 * * 0xFFFD - Reserved for user-space HWRM interface
37651 * * 0xFFFF - HWRM
37652 */
37653 uint16_t target_id;
37654 /*
37655 * A physical address pointer pointing to a host buffer that the
37656 * command's response data will be written. This can be either a host
37657 * physical address (HPA) or a guest physical address (GPA) and must
37658 * point to a physically contiguous block of memory.
37659 */
37660 uint64_t resp_addr;
37661 /* flags is 32 b */
37662 uint32_t flags;
37663 /*
37664 * Set to 1 to indicate the page size, page layers, and
37665 * flow_handle_table_dma_addr fields are valid. The flow flush
37666 * operation should only flush the flows from the flow table
37667 * specified. This flag is set to 0 by older driver. For older
37668 * firmware, setting this flag has no effect.
37669 */
37670 #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_TABLE_VALID UINT32_C(0x1)
37671 /*
37672 * Set to 1 to indicate flow flush operation to cleanup all the
37673 * flows, meters, CFA context memory tables etc. This flag is set to
37674 * 0 by older driver. For older firmware, setting this flag has no
37675 * effect.
37676 */
37677 #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_RESET_ALL UINT32_C(0x2)
37678 /*
37679 * Set to 1 to indicate flow flush operation to cleanup all the
37680 * flows by the caller. This flag is set to 0 by older driver. For
37681 * older firmware, setting this flag has no effect.
37682 */
37683 #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_RESET_PORT UINT32_C(0x4)
37684 /*
37685 * Set to 1 to indicate the flow counter IDs are included in the
37686 * flow table.
37687 */
37688 #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_INCL_FC UINT32_C(0x8000000)
37689 /*
37690 * This specifies the size of flow handle entries provided by the
37691 * driver in the flow table specified below. Only two flow handle
37692 * size enums are defined.
37693 */
37694 #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_MASK UINT32_C(0xc0000000)
37695 #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_SFT 30
37696 /* The flow handle is 16bit */
37697 #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_16BIT (UINT32_C(0x0) << 30)
37698 /* The flow handle is 64bit */
37699 #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_64BIT (UINT32_C(0x1) << 30)
37700 #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_LAST HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_64BIT
37701 /* Specify page size of the flow table memory. */
37702 uint8_t page_size;
37703 /* The page size is 4K */
37704 #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_4K UINT32_C(0x0)
37705 /* The page size is 8K */
37706 #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_8K UINT32_C(0x1)
37707 /* The page size is 64K */
37708 #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_64K UINT32_C(0x4)
37709 /* The page size is 256K */
37710 #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
37711 /* The page size is 1M */
37712 #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1M UINT32_C(0x8)
37713 /* The page size is 2M */
37714 #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_2M UINT32_C(0x9)
37715 /* The page size is 4M */
37716 #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_4M UINT32_C(0xa)
37717 /* The page size is 1G */
37718 #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1G UINT32_C(0x12)
37719 #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_LAST HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1G
37720 /* FLow table memory indirect levels. */
37721 uint8_t page_level;
37722 /* PBL pointer is physical start address. */
37723 #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
37724 /* PBL pointer points to PTE table. */
37725 #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
37726 /*
37727 * PBL pointer points to PDE table with each entry pointing to PTE
37728 * tables.
37729 */
37730 #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
37731 #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LAST HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_2
37732 /* number of flows in the flow table */
37733 uint16_t num_flows;
37734 /* Pointer to the PBL, or PDL depending on number of levels */
37735 uint64_t page_dir;
37736 } hwrm_cfa_flow_flush_input_t, *phwrm_cfa_flow_flush_input_t;
37737
37738 /* hwrm_cfa_flow_flush_output (size:128b/16B) */
37739
37740 typedef struct hwrm_cfa_flow_flush_output {
37741 /* The specific error status for the command. */
37742 uint16_t error_code;
37743 /* The HWRM command request type. */
37744 uint16_t req_type;
37745 /* The sequence ID from the original command. */
37746 uint16_t seq_id;
37747 /* The length of the response data in number of bytes. */
37748 uint16_t resp_len;
37749 uint8_t unused_0[7];
37750 /*
37751 * This field is used in Output records to indicate that the output
37752 * is completely written to RAM. This field should be read as '1'
37753 * to indicate that the output has been completely written.
37754 * When writing a command completion or response to an internal
37755 * processor, the order of writes has to be such that this field is
37756 * written last.
37757 */
37758 uint8_t valid;
37759 } hwrm_cfa_flow_flush_output_t, *phwrm_cfa_flow_flush_output_t;
37760
37761 /***********************
37762 * hwrm_cfa_flow_stats *
37763 ***********************/
37764
37765
37766 /* hwrm_cfa_flow_stats_input (size:640b/80B) */
37767
37768 typedef struct hwrm_cfa_flow_stats_input {
37769 /* The HWRM command request type. */
37770 uint16_t req_type;
37771 /*
37772 * The completion ring to send the completion event on. This should
37773 * be the NQ ID returned from the `nq_alloc` HWRM command.
37774 */
37775 uint16_t cmpl_ring;
37776 /*
37777 * The sequence ID is used by the driver for tracking multiple
37778 * commands. This ID is treated as opaque data by the firmware and
37779 * the value is returned in the `hwrm_resp_hdr` upon completion.
37780 */
37781 uint16_t seq_id;
37782 /*
37783 * The target ID of the command:
37784 * * 0x0-0xFFF8 - The function ID
37785 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37786 * * 0xFFFD - Reserved for user-space HWRM interface
37787 * * 0xFFFF - HWRM
37788 */
37789 uint16_t target_id;
37790 /*
37791 * A physical address pointer pointing to a host buffer that the
37792 * command's response data will be written. This can be either a host
37793 * physical address (HPA) or a guest physical address (GPA) and must
37794 * point to a physically contiguous block of memory.
37795 */
37796 uint64_t resp_addr;
37797 /* Flow handle. */
37798 uint16_t num_flows;
37799 /* Flow handle. */
37800 uint16_t flow_handle_0;
37801 /* Flow handle. */
37802 uint16_t flow_handle_1;
37803 /* Flow handle. */
37804 uint16_t flow_handle_2;
37805 /* Flow handle. */
37806 uint16_t flow_handle_3;
37807 /* Flow handle. */
37808 uint16_t flow_handle_4;
37809 /* Flow handle. */
37810 uint16_t flow_handle_5;
37811 /* Flow handle. */
37812 uint16_t flow_handle_6;
37813 /* Flow handle. */
37814 uint16_t flow_handle_7;
37815 /* Flow handle. */
37816 uint16_t flow_handle_8;
37817 /* Flow handle. */
37818 uint16_t flow_handle_9;
37819 uint8_t unused_0[2];
37820 /* Flow ID of a flow. */
37821 uint32_t flow_id_0;
37822 /* Flow ID of a flow. */
37823 uint32_t flow_id_1;
37824 /* Flow ID of a flow. */
37825 uint32_t flow_id_2;
37826 /* Flow ID of a flow. */
37827 uint32_t flow_id_3;
37828 /* Flow ID of a flow. */
37829 uint32_t flow_id_4;
37830 /* Flow ID of a flow. */
37831 uint32_t flow_id_5;
37832 /* Flow ID of a flow. */
37833 uint32_t flow_id_6;
37834 /* Flow ID of a flow. */
37835 uint32_t flow_id_7;
37836 /* Flow ID of a flow. */
37837 uint32_t flow_id_8;
37838 /* Flow ID of a flow. */
37839 uint32_t flow_id_9;
37840 } hwrm_cfa_flow_stats_input_t, *phwrm_cfa_flow_stats_input_t;
37841
37842 /* hwrm_cfa_flow_stats_output (size:1408b/176B) */
37843
37844 typedef struct hwrm_cfa_flow_stats_output {
37845 /* The specific error status for the command. */
37846 uint16_t error_code;
37847 /* The HWRM command request type. */
37848 uint16_t req_type;
37849 /* The sequence ID from the original command. */
37850 uint16_t seq_id;
37851 /* The length of the response data in number of bytes. */
37852 uint16_t resp_len;
37853 /* packet_0 is 64 b */
37854 uint64_t packet_0;
37855 /* packet_1 is 64 b */
37856 uint64_t packet_1;
37857 /* packet_2 is 64 b */
37858 uint64_t packet_2;
37859 /* packet_3 is 64 b */
37860 uint64_t packet_3;
37861 /* packet_4 is 64 b */
37862 uint64_t packet_4;
37863 /* packet_5 is 64 b */
37864 uint64_t packet_5;
37865 /* packet_6 is 64 b */
37866 uint64_t packet_6;
37867 /* packet_7 is 64 b */
37868 uint64_t packet_7;
37869 /* packet_8 is 64 b */
37870 uint64_t packet_8;
37871 /* packet_9 is 64 b */
37872 uint64_t packet_9;
37873 /* byte_0 is 64 b */
37874 uint64_t byte_0;
37875 /* byte_1 is 64 b */
37876 uint64_t byte_1;
37877 /* byte_2 is 64 b */
37878 uint64_t byte_2;
37879 /* byte_3 is 64 b */
37880 uint64_t byte_3;
37881 /* byte_4 is 64 b */
37882 uint64_t byte_4;
37883 /* byte_5 is 64 b */
37884 uint64_t byte_5;
37885 /* byte_6 is 64 b */
37886 uint64_t byte_6;
37887 /* byte_7 is 64 b */
37888 uint64_t byte_7;
37889 /* byte_8 is 64 b */
37890 uint64_t byte_8;
37891 /* byte_9 is 64 b */
37892 uint64_t byte_9;
37893 uint8_t unused_0[7];
37894 /*
37895 * This field is used in Output records to indicate that the output
37896 * is completely written to RAM. This field should be read as '1'
37897 * to indicate that the output has been completely written.
37898 * When writing a command completion or response to an internal
37899 * processor, the order of writes has to be such that this field is
37900 * written last.
37901 */
37902 uint8_t valid;
37903 } hwrm_cfa_flow_stats_output_t, *phwrm_cfa_flow_stats_output_t;
37904
37905 /***********************************
37906 * hwrm_cfa_flow_aging_timer_reset *
37907 ***********************************/
37908
37909
37910 /* hwrm_cfa_flow_aging_timer_reset_input (size:256b/32B) */
37911
37912 typedef struct hwrm_cfa_flow_aging_timer_reset_input {
37913 /* The HWRM command request type. */
37914 uint16_t req_type;
37915 /*
37916 * The completion ring to send the completion event on. This should
37917 * be the NQ ID returned from the `nq_alloc` HWRM command.
37918 */
37919 uint16_t cmpl_ring;
37920 /*
37921 * The sequence ID is used by the driver for tracking multiple
37922 * commands. This ID is treated as opaque data by the firmware and
37923 * the value is returned in the `hwrm_resp_hdr` upon completion.
37924 */
37925 uint16_t seq_id;
37926 /*
37927 * The target ID of the command:
37928 * * 0x0-0xFFF8 - The function ID
37929 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37930 * * 0xFFFD - Reserved for user-space HWRM interface
37931 * * 0xFFFF - HWRM
37932 */
37933 uint16_t target_id;
37934 /*
37935 * A physical address pointer pointing to a host buffer that the
37936 * command's response data will be written. This can be either a host
37937 * physical address (HPA) or a guest physical address (GPA) and must
37938 * point to a physically contiguous block of memory.
37939 */
37940 uint64_t resp_addr;
37941 /* Flow record index. */
37942 uint16_t flow_handle;
37943 uint8_t unused_0[2];
37944 /*
37945 * New flow timer value for the flow specified in the ext_flow_handle.
37946 * The flow timer unit is 100ms.
37947 */
37948 uint32_t flow_timer;
37949 /* This value identifies a set of CFA data structures used for a flow. */
37950 uint64_t ext_flow_handle;
37951 } hwrm_cfa_flow_aging_timer_reset_input_t, *phwrm_cfa_flow_aging_timer_reset_input_t;
37952
37953 /* hwrm_cfa_flow_aging_timer_reset_output (size:128b/16B) */
37954
37955 typedef struct hwrm_cfa_flow_aging_timer_reset_output {
37956 /* The specific error status for the command. */
37957 uint16_t error_code;
37958 /* The HWRM command request type. */
37959 uint16_t req_type;
37960 /* The sequence ID from the original command. */
37961 uint16_t seq_id;
37962 /* The length of the response data in number of bytes. */
37963 uint16_t resp_len;
37964 uint8_t unused_0[7];
37965 /*
37966 * This field is used in Output records to indicate that the output
37967 * is completely written to RAM. This field should be read as '1'
37968 * to indicate that the output has been completely written.
37969 * When writing a command completion or response to an internal
37970 * processor, the order of writes has to be such that this field is
37971 * written last.
37972 */
37973 uint8_t valid;
37974 } hwrm_cfa_flow_aging_timer_reset_output_t, *phwrm_cfa_flow_aging_timer_reset_output_t;
37975
37976 /***************************
37977 * hwrm_cfa_flow_aging_cfg *
37978 ***************************/
37979
37980
37981 /* hwrm_cfa_flow_aging_cfg_input (size:384b/48B) */
37982
37983 typedef struct hwrm_cfa_flow_aging_cfg_input {
37984 /* The HWRM command request type. */
37985 uint16_t req_type;
37986 /*
37987 * The completion ring to send the completion event on. This should
37988 * be the NQ ID returned from the `nq_alloc` HWRM command.
37989 */
37990 uint16_t cmpl_ring;
37991 /*
37992 * The sequence ID is used by the driver for tracking multiple
37993 * commands. This ID is treated as opaque data by the firmware and
37994 * the value is returned in the `hwrm_resp_hdr` upon completion.
37995 */
37996 uint16_t seq_id;
37997 /*
37998 * The target ID of the command:
37999 * * 0x0-0xFFF8 - The function ID
38000 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38001 * * 0xFFFD - Reserved for user-space HWRM interface
38002 * * 0xFFFF - HWRM
38003 */
38004 uint16_t target_id;
38005 /*
38006 * A physical address pointer pointing to a host buffer that the
38007 * command's response data will be written. This can be either a host
38008 * physical address (HPA) or a guest physical address (GPA) and must
38009 * point to a physically contiguous block of memory.
38010 */
38011 uint64_t resp_addr;
38012 /* The bit field to enable per flow aging configuration. */
38013 uint16_t enables;
38014 /*
38015 * This bit must be '1' for the tcp flow timer field to be
38016 * configured
38017 */
38018 #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_TCP_FLOW_TIMER UINT32_C(0x1)
38019 /*
38020 * This bit must be '1' for the tcp finish timer field to be
38021 * configured
38022 */
38023 #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_TCP_FIN_TIMER UINT32_C(0x2)
38024 /*
38025 * This bit must be '1' for the udp flow timer field to be
38026 * configured
38027 */
38028 #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_UDP_FLOW_TIMER UINT32_C(0x4)
38029 /*
38030 * This bit must be '1' for the eem dma interval field to be
38031 * configured
38032 */
38033 #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_DMA_INTERVAL UINT32_C(0x8)
38034 /*
38035 * This bit must be '1' for the eem notice interval field to be
38036 * configured
38037 */
38038 #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_NOTICE_INTERVAL UINT32_C(0x10)
38039 /*
38040 * This bit must be '1' for the eem context memory maximum entries
38041 * field to be configured
38042 */
38043 #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_MAX_ENTRIES UINT32_C(0x20)
38044 /*
38045 * This bit must be '1' for the eem context memory ID field to be
38046 * configured
38047 */
38048 #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_ID UINT32_C(0x40)
38049 /*
38050 * This bit must be '1' for the eem context memory type field to be
38051 * configured
38052 */
38053 #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_MEM_TYPE UINT32_C(0x80)
38054 uint8_t flags;
38055 /* Enumeration denoting the RX, TX type of the resource. */
38056 #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH UINT32_C(0x1)
38057 /* tx path */
38058 #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_TX UINT32_C(0x0)
38059 /* rx path */
38060 #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_RX UINT32_C(0x1)
38061 #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_LAST HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_RX
38062 /*
38063 * Enumeration denoting the enable, disable eem flow aging
38064 * configuration.
38065 */
38066 #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM UINT32_C(0x2)
38067 /* tx path */
38068 #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_DISABLE (UINT32_C(0x0) << 1)
38069 /* rx path */
38070 #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_ENABLE (UINT32_C(0x1) << 1)
38071 #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_LAST HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_ENABLE
38072 uint8_t unused_0;
38073 /*
38074 * The flow aging timer for all TCP flows, the unit is 100
38075 * milliseconds.
38076 */
38077 uint32_t tcp_flow_timer;
38078 /*
38079 * The TCP finished timer for all TCP flows, the unit is 100
38080 * milliseconds.
38081 */
38082 uint32_t tcp_fin_timer;
38083 /*
38084 * The flow aging timer for all UDP flows, the unit is 100
38085 * milliseconds.
38086 */
38087 uint32_t udp_flow_timer;
38088 /*
38089 * The interval to dma eem ejection data to host memory, the unit is
38090 * milliseconds.
38091 */
38092 uint16_t eem_dma_interval;
38093 /*
38094 * The interval to notify driver to read the eem ejection data, the
38095 * unit is milliseconds.
38096 */
38097 uint16_t eem_notice_interval;
38098 /* The maximum entries number in the eem context memory. */
38099 uint32_t eem_ctx_max_entries;
38100 /* The context memory ID for eem flow aging. */
38101 uint16_t eem_ctx_id;
38102 uint16_t eem_ctx_mem_type;
38103 /*
38104 * The content of context memory is eem ejection data, the size of
38105 * each entry is 4 bytes.
38106 */
38107 #define HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_EJECTION_DATA UINT32_C(0x0)
38108 #define HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_LAST HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_EJECTION_DATA
38109 uint8_t unused_1[4];
38110 } hwrm_cfa_flow_aging_cfg_input_t, *phwrm_cfa_flow_aging_cfg_input_t;
38111
38112 /* hwrm_cfa_flow_aging_cfg_output (size:128b/16B) */
38113
38114 typedef struct hwrm_cfa_flow_aging_cfg_output {
38115 /* The specific error status for the command. */
38116 uint16_t error_code;
38117 /* The HWRM command request type. */
38118 uint16_t req_type;
38119 /* The sequence ID from the original command. */
38120 uint16_t seq_id;
38121 /* The length of the response data in number of bytes. */
38122 uint16_t resp_len;
38123 uint8_t unused_0[7];
38124 /*
38125 * This field is used in Output records to indicate that the output
38126 * is completely written to RAM. This field should be read as '1'
38127 * to indicate that the output has been completely written.
38128 * When writing a command completion or response to an internal
38129 * processor, the order of writes has to be such that this field is
38130 * written last.
38131 */
38132 uint8_t valid;
38133 } hwrm_cfa_flow_aging_cfg_output_t, *phwrm_cfa_flow_aging_cfg_output_t;
38134
38135 /****************************
38136 * hwrm_cfa_flow_aging_qcfg *
38137 ****************************/
38138
38139
38140 /* hwrm_cfa_flow_aging_qcfg_input (size:192b/24B) */
38141
38142 typedef struct hwrm_cfa_flow_aging_qcfg_input {
38143 /* The HWRM command request type. */
38144 uint16_t req_type;
38145 /*
38146 * The completion ring to send the completion event on. This should
38147 * be the NQ ID returned from the `nq_alloc` HWRM command.
38148 */
38149 uint16_t cmpl_ring;
38150 /*
38151 * The sequence ID is used by the driver for tracking multiple
38152 * commands. This ID is treated as opaque data by the firmware and
38153 * the value is returned in the `hwrm_resp_hdr` upon completion.
38154 */
38155 uint16_t seq_id;
38156 /*
38157 * The target ID of the command:
38158 * * 0x0-0xFFF8 - The function ID
38159 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38160 * * 0xFFFD - Reserved for user-space HWRM interface
38161 * * 0xFFFF - HWRM
38162 */
38163 uint16_t target_id;
38164 /*
38165 * A physical address pointer pointing to a host buffer that the
38166 * command's response data will be written. This can be either a host
38167 * physical address (HPA) or a guest physical address (GPA) and must
38168 * point to a physically contiguous block of memory.
38169 */
38170 uint64_t resp_addr;
38171 /*
38172 * The direction for the flow aging configuration, 1 is rx path, 2 is
38173 * tx path.
38174 */
38175 uint8_t flags;
38176 /* Enumeration denoting the RX, TX type of the resource. */
38177 #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH UINT32_C(0x1)
38178 /* tx path */
38179 #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_TX UINT32_C(0x0)
38180 /* rx path */
38181 #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_RX UINT32_C(0x1)
38182 #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_LAST HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_RX
38183 uint8_t unused_0[7];
38184 } hwrm_cfa_flow_aging_qcfg_input_t, *phwrm_cfa_flow_aging_qcfg_input_t;
38185
38186 /* hwrm_cfa_flow_aging_qcfg_output (size:320b/40B) */
38187
38188 typedef struct hwrm_cfa_flow_aging_qcfg_output {
38189 /* The specific error status for the command. */
38190 uint16_t error_code;
38191 /* The HWRM command request type. */
38192 uint16_t req_type;
38193 /* The sequence ID from the original command. */
38194 uint16_t seq_id;
38195 /* The length of the response data in number of bytes. */
38196 uint16_t resp_len;
38197 /*
38198 * The current flow aging timer for all TCP flows, the unit is 100
38199 * millisecond.
38200 */
38201 uint32_t tcp_flow_timer;
38202 /*
38203 * The current TCP finished timer for all TCP flows, the unit is 100
38204 * millisecond.
38205 */
38206 uint32_t tcp_fin_timer;
38207 /*
38208 * The current flow aging timer for all UDP flows, the unit is 100
38209 * millisecond.
38210 */
38211 uint32_t udp_flow_timer;
38212 /*
38213 * The interval to dma eem ejection data to host memory, the unit is
38214 * milliseconds.
38215 */
38216 uint16_t eem_dma_interval;
38217 /*
38218 * The interval to notify driver to read the eem ejection data, the
38219 * unit is milliseconds.
38220 */
38221 uint16_t eem_notice_interval;
38222 /* The maximum entries number in the eem context memory. */
38223 uint32_t eem_ctx_max_entries;
38224 /* The context memory ID for eem flow aging. */
38225 uint16_t eem_ctx_id;
38226 /* The context memory type for eem flow aging. */
38227 uint16_t eem_ctx_mem_type;
38228 uint8_t unused_0[7];
38229 /*
38230 * This field is used in Output records to indicate that the output
38231 * is completely written to RAM. This field should be read as '1'
38232 * to indicate that the output has been completely written.
38233 * When writing a command completion or response to an internal
38234 * processor, the order of writes has to be such that this field is
38235 * written last.
38236 */
38237 uint8_t valid;
38238 } hwrm_cfa_flow_aging_qcfg_output_t, *phwrm_cfa_flow_aging_qcfg_output_t;
38239
38240 /*****************************
38241 * hwrm_cfa_flow_aging_qcaps *
38242 *****************************/
38243
38244
38245 /* hwrm_cfa_flow_aging_qcaps_input (size:192b/24B) */
38246
38247 typedef struct hwrm_cfa_flow_aging_qcaps_input {
38248 /* The HWRM command request type. */
38249 uint16_t req_type;
38250 /*
38251 * The completion ring to send the completion event on. This should
38252 * be the NQ ID returned from the `nq_alloc` HWRM command.
38253 */
38254 uint16_t cmpl_ring;
38255 /*
38256 * The sequence ID is used by the driver for tracking multiple
38257 * commands. This ID is treated as opaque data by the firmware and
38258 * the value is returned in the `hwrm_resp_hdr` upon completion.
38259 */
38260 uint16_t seq_id;
38261 /*
38262 * The target ID of the command:
38263 * * 0x0-0xFFF8 - The function ID
38264 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38265 * * 0xFFFD - Reserved for user-space HWRM interface
38266 * * 0xFFFF - HWRM
38267 */
38268 uint16_t target_id;
38269 /*
38270 * A physical address pointer pointing to a host buffer that the
38271 * command's response data will be written. This can be either a host
38272 * physical address (HPA) or a guest physical address (GPA) and must
38273 * point to a physically contiguous block of memory.
38274 */
38275 uint64_t resp_addr;
38276 /*
38277 * The direction for the flow aging configuration, 1 is rx path, 2 is
38278 * tx path.
38279 */
38280 uint8_t flags;
38281 /* Enumeration denoting the RX, TX type of the resource. */
38282 #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH UINT32_C(0x1)
38283 /* tx path */
38284 #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_TX UINT32_C(0x0)
38285 /* rx path */
38286 #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_RX UINT32_C(0x1)
38287 #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_LAST HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_RX
38288 uint8_t unused_0[7];
38289 } hwrm_cfa_flow_aging_qcaps_input_t, *phwrm_cfa_flow_aging_qcaps_input_t;
38290
38291 /* hwrm_cfa_flow_aging_qcaps_output (size:256b/32B) */
38292
38293 typedef struct hwrm_cfa_flow_aging_qcaps_output {
38294 /* The specific error status for the command. */
38295 uint16_t error_code;
38296 /* The HWRM command request type. */
38297 uint16_t req_type;
38298 /* The sequence ID from the original command. */
38299 uint16_t seq_id;
38300 /* The length of the response data in number of bytes. */
38301 uint16_t resp_len;
38302 /*
38303 * The maximum flow aging timer for all TCP flows, the unit is 100
38304 * millisecond.
38305 */
38306 uint32_t max_tcp_flow_timer;
38307 /*
38308 * The maximum TCP finished timer for all TCP flows, the unit is 100
38309 * millisecond.
38310 */
38311 uint32_t max_tcp_fin_timer;
38312 /*
38313 * The maximum flow aging timer for all UDP flows, the unit is 100
38314 * millisecond.
38315 */
38316 uint32_t max_udp_flow_timer;
38317 /* The maximum aging flows that HW can support. */
38318 uint32_t max_aging_flows;
38319 uint8_t unused_0[7];
38320 /*
38321 * This field is used in Output records to indicate that the output
38322 * is completely written to RAM. This field should be read as '1'
38323 * to indicate that the output has been completely written.
38324 * When writing a command completion or response to an internal
38325 * processor, the order of writes has to be such that this field is
38326 * written last.
38327 */
38328 uint8_t valid;
38329 } hwrm_cfa_flow_aging_qcaps_output_t, *phwrm_cfa_flow_aging_qcaps_output_t;
38330
38331 /**********************************
38332 * hwrm_cfa_tcp_flag_process_qcfg *
38333 **********************************/
38334
38335
38336 /* hwrm_cfa_tcp_flag_process_qcfg_input (size:128b/16B) */
38337
38338 typedef struct hwrm_cfa_tcp_flag_process_qcfg_input {
38339 /* The HWRM command request type. */
38340 uint16_t req_type;
38341 /*
38342 * The completion ring to send the completion event on. This should
38343 * be the NQ ID returned from the `nq_alloc` HWRM command.
38344 */
38345 uint16_t cmpl_ring;
38346 /*
38347 * The sequence ID is used by the driver for tracking multiple
38348 * commands. This ID is treated as opaque data by the firmware and
38349 * the value is returned in the `hwrm_resp_hdr` upon completion.
38350 */
38351 uint16_t seq_id;
38352 /*
38353 * The target ID of the command:
38354 * * 0x0-0xFFF8 - The function ID
38355 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38356 * * 0xFFFD - Reserved for user-space HWRM interface
38357 * * 0xFFFF - HWRM
38358 */
38359 uint16_t target_id;
38360 /*
38361 * A physical address pointer pointing to a host buffer that the
38362 * command's response data will be written. This can be either a host
38363 * physical address (HPA) or a guest physical address (GPA) and must
38364 * point to a physically contiguous block of memory.
38365 */
38366 uint64_t resp_addr;
38367 } hwrm_cfa_tcp_flag_process_qcfg_input_t, *phwrm_cfa_tcp_flag_process_qcfg_input_t;
38368
38369 /* hwrm_cfa_tcp_flag_process_qcfg_output (size:192b/24B) */
38370
38371 typedef struct hwrm_cfa_tcp_flag_process_qcfg_output {
38372 /* The specific error status for the command. */
38373 uint16_t error_code;
38374 /* The HWRM command request type. */
38375 uint16_t req_type;
38376 /* The sequence ID from the original command. */
38377 uint16_t seq_id;
38378 /* The length of the response data in number of bytes. */
38379 uint16_t resp_len;
38380 /* The port 0 RX mirror action record ID. */
38381 uint16_t rx_ar_id_port0;
38382 /* The port 1 RX mirror action record ID. */
38383 uint16_t rx_ar_id_port1;
38384 /*
38385 * The port 0 RX action record ID for TX TCP flag packets from
38386 * loopback path.
38387 */
38388 uint16_t tx_ar_id_port0;
38389 /*
38390 * The port 1 RX action record ID for TX TCP flag packets from
38391 * loopback path.
38392 */
38393 uint16_t tx_ar_id_port1;
38394 uint8_t unused_0[7];
38395 /*
38396 * This field is used in Output records to indicate that the output
38397 * is completely written to RAM. This field should be read as '1'
38398 * to indicate that the output has been completely written.
38399 * When writing a command completion or response to an internal
38400 * processor, the order of writes has to be such that this field is
38401 * written last.
38402 */
38403 uint8_t valid;
38404 } hwrm_cfa_tcp_flag_process_qcfg_output_t, *phwrm_cfa_tcp_flag_process_qcfg_output_t;
38405
38406 /**************************
38407 * hwrm_cfa_vf_pair_alloc *
38408 **************************/
38409
38410
38411 /* hwrm_cfa_vf_pair_alloc_input (size:448b/56B) */
38412
38413 typedef struct hwrm_cfa_vf_pair_alloc_input {
38414 /* The HWRM command request type. */
38415 uint16_t req_type;
38416 /*
38417 * The completion ring to send the completion event on. This should
38418 * be the NQ ID returned from the `nq_alloc` HWRM command.
38419 */
38420 uint16_t cmpl_ring;
38421 /*
38422 * The sequence ID is used by the driver for tracking multiple
38423 * commands. This ID is treated as opaque data by the firmware and
38424 * the value is returned in the `hwrm_resp_hdr` upon completion.
38425 */
38426 uint16_t seq_id;
38427 /*
38428 * The target ID of the command:
38429 * * 0x0-0xFFF8 - The function ID
38430 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38431 * * 0xFFFD - Reserved for user-space HWRM interface
38432 * * 0xFFFF - HWRM
38433 */
38434 uint16_t target_id;
38435 /*
38436 * A physical address pointer pointing to a host buffer that the
38437 * command's response data will be written. This can be either a host
38438 * physical address (HPA) or a guest physical address (GPA) and must
38439 * point to a physically contiguous block of memory.
38440 */
38441 uint64_t resp_addr;
38442 /* Logical VF number (range: 0 -> MAX_VFS -1). */
38443 uint16_t vf_a_id;
38444 /* Logical VF number (range: 0 -> MAX_VFS -1). */
38445 uint16_t vf_b_id;
38446 uint8_t unused_0[4];
38447 /* VF Pair name (32 byte string). */
38448 char pair_name[32];
38449 } hwrm_cfa_vf_pair_alloc_input_t, *phwrm_cfa_vf_pair_alloc_input_t;
38450
38451 /* hwrm_cfa_vf_pair_alloc_output (size:128b/16B) */
38452
38453 typedef struct hwrm_cfa_vf_pair_alloc_output {
38454 /* The specific error status for the command. */
38455 uint16_t error_code;
38456 /* The HWRM command request type. */
38457 uint16_t req_type;
38458 /* The sequence ID from the original command. */
38459 uint16_t seq_id;
38460 /* The length of the response data in number of bytes. */
38461 uint16_t resp_len;
38462 uint8_t unused_0[7];
38463 /*
38464 * This field is used in Output records to indicate that the output
38465 * is completely written to RAM. This field should be read as '1'
38466 * to indicate that the output has been completely written.
38467 * When writing a command completion or response to an internal
38468 * processor, the order of writes has to be such that this field is
38469 * written last.
38470 */
38471 uint8_t valid;
38472 } hwrm_cfa_vf_pair_alloc_output_t, *phwrm_cfa_vf_pair_alloc_output_t;
38473
38474 /*************************
38475 * hwrm_cfa_vf_pair_free *
38476 *************************/
38477
38478
38479 /* hwrm_cfa_vf_pair_free_input (size:384b/48B) */
38480
38481 typedef struct hwrm_cfa_vf_pair_free_input {
38482 /* The HWRM command request type. */
38483 uint16_t req_type;
38484 /*
38485 * The completion ring to send the completion event on. This should
38486 * be the NQ ID returned from the `nq_alloc` HWRM command.
38487 */
38488 uint16_t cmpl_ring;
38489 /*
38490 * The sequence ID is used by the driver for tracking multiple
38491 * commands. This ID is treated as opaque data by the firmware and
38492 * the value is returned in the `hwrm_resp_hdr` upon completion.
38493 */
38494 uint16_t seq_id;
38495 /*
38496 * The target ID of the command:
38497 * * 0x0-0xFFF8 - The function ID
38498 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38499 * * 0xFFFD - Reserved for user-space HWRM interface
38500 * * 0xFFFF - HWRM
38501 */
38502 uint16_t target_id;
38503 /*
38504 * A physical address pointer pointing to a host buffer that the
38505 * command's response data will be written. This can be either a host
38506 * physical address (HPA) or a guest physical address (GPA) and must
38507 * point to a physically contiguous block of memory.
38508 */
38509 uint64_t resp_addr;
38510 /* VF Pair name (32 byte string). */
38511 char pair_name[32];
38512 } hwrm_cfa_vf_pair_free_input_t, *phwrm_cfa_vf_pair_free_input_t;
38513
38514 /* hwrm_cfa_vf_pair_free_output (size:128b/16B) */
38515
38516 typedef struct hwrm_cfa_vf_pair_free_output {
38517 /* The specific error status for the command. */
38518 uint16_t error_code;
38519 /* The HWRM command request type. */
38520 uint16_t req_type;
38521 /* The sequence ID from the original command. */
38522 uint16_t seq_id;
38523 /* The length of the response data in number of bytes. */
38524 uint16_t resp_len;
38525 uint8_t unused_0[7];
38526 /*
38527 * This field is used in Output records to indicate that the output
38528 * is completely written to RAM. This field should be read as '1'
38529 * to indicate that the output has been completely written.
38530 * When writing a command completion or response to an internal
38531 * processor, the order of writes has to be such that this field is
38532 * written last.
38533 */
38534 uint8_t valid;
38535 } hwrm_cfa_vf_pair_free_output_t, *phwrm_cfa_vf_pair_free_output_t;
38536
38537 /*************************
38538 * hwrm_cfa_vf_pair_info *
38539 *************************/
38540
38541
38542 /* hwrm_cfa_vf_pair_info_input (size:448b/56B) */
38543
38544 typedef struct hwrm_cfa_vf_pair_info_input {
38545 /* The HWRM command request type. */
38546 uint16_t req_type;
38547 /*
38548 * The completion ring to send the completion event on. This should
38549 * be the NQ ID returned from the `nq_alloc` HWRM command.
38550 */
38551 uint16_t cmpl_ring;
38552 /*
38553 * The sequence ID is used by the driver for tracking multiple
38554 * commands. This ID is treated as opaque data by the firmware and
38555 * the value is returned in the `hwrm_resp_hdr` upon completion.
38556 */
38557 uint16_t seq_id;
38558 /*
38559 * The target ID of the command:
38560 * * 0x0-0xFFF8 - The function ID
38561 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38562 * * 0xFFFD - Reserved for user-space HWRM interface
38563 * * 0xFFFF - HWRM
38564 */
38565 uint16_t target_id;
38566 /*
38567 * A physical address pointer pointing to a host buffer that the
38568 * command's response data will be written. This can be either a host
38569 * physical address (HPA) or a guest physical address (GPA) and must
38570 * point to a physically contiguous block of memory.
38571 */
38572 uint64_t resp_addr;
38573 uint32_t flags;
38574 /* If this flag is set, lookup by name else lookup by index. */
38575 #define HWRM_CFA_VF_PAIR_INFO_INPUT_FLAGS_LOOKUP_TYPE UINT32_C(0x1)
38576 /* vf pair table index. */
38577 uint16_t vf_pair_index;
38578 uint8_t unused_0[2];
38579 /* VF Pair name (32 byte string). */
38580 char vf_pair_name[32];
38581 } hwrm_cfa_vf_pair_info_input_t, *phwrm_cfa_vf_pair_info_input_t;
38582
38583 /* hwrm_cfa_vf_pair_info_output (size:512b/64B) */
38584
38585 typedef struct hwrm_cfa_vf_pair_info_output {
38586 /* The specific error status for the command. */
38587 uint16_t error_code;
38588 /* The HWRM command request type. */
38589 uint16_t req_type;
38590 /* The sequence ID from the original command. */
38591 uint16_t seq_id;
38592 /* The length of the response data in number of bytes. */
38593 uint16_t resp_len;
38594 /* vf pair table index. */
38595 uint16_t next_vf_pair_index;
38596 /* vf pair member a's vf_fid. */
38597 uint16_t vf_a_fid;
38598 /* vf pair member a's Linux logical VF number. */
38599 uint16_t vf_a_index;
38600 /* vf pair member b's vf_fid. */
38601 uint16_t vf_b_fid;
38602 /* vf pair member a's Linux logical VF number. */
38603 uint16_t vf_b_index;
38604 /* vf pair state. */
38605 uint8_t pair_state;
38606 /* Pair has been allocated */
38607 #define HWRM_CFA_VF_PAIR_INFO_OUTPUT_PAIR_STATE_ALLOCATED UINT32_C(0x1)
38608 /* Both pair members are active */
38609 #define HWRM_CFA_VF_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE UINT32_C(0x2)
38610 #define HWRM_CFA_VF_PAIR_INFO_OUTPUT_PAIR_STATE_LAST HWRM_CFA_VF_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE
38611 uint8_t unused_0[5];
38612 /* VF Pair name (32 byte string). */
38613 char pair_name[32];
38614 uint8_t unused_1[7];
38615 /*
38616 * This field is used in Output records to indicate that the output
38617 * is completely written to RAM. This field should be read as '1'
38618 * to indicate that the output has been completely written.
38619 * When writing a command completion or response to an internal
38620 * processor, the order of writes has to be such that this field is
38621 * written last.
38622 */
38623 uint8_t valid;
38624 } hwrm_cfa_vf_pair_info_output_t, *phwrm_cfa_vf_pair_info_output_t;
38625
38626 /***********************
38627 * hwrm_cfa_pair_alloc *
38628 ***********************/
38629
38630
38631 /* hwrm_cfa_pair_alloc_input (size:576b/72B) */
38632
38633 typedef struct hwrm_cfa_pair_alloc_input {
38634 /* The HWRM command request type. */
38635 uint16_t req_type;
38636 /*
38637 * The completion ring to send the completion event on. This should
38638 * be the NQ ID returned from the `nq_alloc` HWRM command.
38639 */
38640 uint16_t cmpl_ring;
38641 /*
38642 * The sequence ID is used by the driver for tracking multiple
38643 * commands. This ID is treated as opaque data by the firmware and
38644 * the value is returned in the `hwrm_resp_hdr` upon completion.
38645 */
38646 uint16_t seq_id;
38647 /*
38648 * The target ID of the command:
38649 * * 0x0-0xFFF8 - The function ID
38650 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38651 * * 0xFFFD - Reserved for user-space HWRM interface
38652 * * 0xFFFF - HWRM
38653 */
38654 uint16_t target_id;
38655 /*
38656 * A physical address pointer pointing to a host buffer that the
38657 * command's response data will be written. This can be either a host
38658 * physical address (HPA) or a guest physical address (GPA) and must
38659 * point to a physically contiguous block of memory.
38660 */
38661 uint64_t resp_addr;
38662 /*
38663 * Pair mode (0-vf2fn, 1-rep2fn, 2-rep2rep, 3-proxy, 4-pfpair,
38664 * 5-rep2fn_mod, 6-rep2fn_modall, 7-rep2fn_truflow).
38665 */
38666 uint16_t pair_mode;
38667 /* Pair between VF on local host with PF or VF on specified host. */
38668 #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_VF2FN UINT32_C(0x0)
38669 /* Pair between REP on local host with PF or VF on specified host. */
38670 #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2FN UINT32_C(0x1)
38671 /* Pair between REP on local host with REP on specified host. */
38672 #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2REP UINT32_C(0x2)
38673 /* Pair for the proxy interface. */
38674 #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_PROXY UINT32_C(0x3)
38675 /* Pair for the PF interface. */
38676 #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_PFPAIR UINT32_C(0x4)
38677 /* Modify existing rep2fn pair and move pair to new PF. */
38678 #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2FN_MOD UINT32_C(0x5)
38679 /*
38680 * Modify existing rep2fn pairs paired with same PF and move pairs
38681 * to new PF.
38682 */
38683 #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2FN_MODALL UINT32_C(0x6)
38684 /*
38685 * Truflow pair between REP on local host with PF or VF on specified
38686 * host.
38687 */
38688 #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2FN_TRUFLOW UINT32_C(0x7)
38689 #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_LAST HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2FN_TRUFLOW
38690 /* Logical VF number (range: 0 -> MAX_VFS -1). */
38691 uint16_t vf_a_id;
38692 /* Logical Host (0xff-local host). */
38693 uint8_t host_b_id;
38694 /* Logical PF (0xff-PF for command channel). */
38695 uint8_t pf_b_id;
38696 /* Logical VF number (range: 0 -> MAX_VFS -1). */
38697 uint16_t vf_b_id;
38698 /* Loopback port (0xff-internal loopback), valid for mode-3. */
38699 uint8_t port_id;
38700 /* Priority used for encap of loopback packets valid for mode-3. */
38701 uint8_t pri;
38702 /* New PF for rep2fn modify, valid for mode 5. */
38703 uint16_t new_pf_fid;
38704 uint32_t enables;
38705 /*
38706 * This bit must be '1' for the q_ab field to be
38707 * configured.
38708 */
38709 #define HWRM_CFA_PAIR_ALLOC_INPUT_ENABLES_Q_AB_VALID UINT32_C(0x1)
38710 /*
38711 * This bit must be '1' for the q_ba field to be
38712 * configured.
38713 */
38714 #define HWRM_CFA_PAIR_ALLOC_INPUT_ENABLES_Q_BA_VALID UINT32_C(0x2)
38715 /*
38716 * This bit must be '1' for the fc_ab field to be
38717 * configured.
38718 */
38719 #define HWRM_CFA_PAIR_ALLOC_INPUT_ENABLES_FC_AB_VALID UINT32_C(0x4)
38720 /*
38721 * This bit must be '1' for the fc_ba field to be
38722 * configured.
38723 */
38724 #define HWRM_CFA_PAIR_ALLOC_INPUT_ENABLES_FC_BA_VALID UINT32_C(0x8)
38725 /* VF Pair name (32 byte string). */
38726 char pair_name[32];
38727 /*
38728 * The q_ab value specifies the logical index of the TX/RX CoS
38729 * queue to be assigned for traffic in the A to B direction of
38730 * the interface pair. The default value is 0.
38731 */
38732 uint8_t q_ab;
38733 /*
38734 * The q_ba value specifies the logical index of the TX/RX CoS
38735 * queue to be assigned for traffic in the B to A direction of
38736 * the interface pair. The default value is 1.
38737 */
38738 uint8_t q_ba;
38739 /*
38740 * Specifies whether RX ring flow control is disabled (0) or enabled
38741 * (1) in the A to B direction. The default value is 0, meaning that
38742 * packets will be dropped when the B-side RX rings are full.
38743 */
38744 uint8_t fc_ab;
38745 /*
38746 * Specifies whether RX ring flow control is disabled (0) or enabled
38747 * (1) in the B to A direction. The default value is 1, meaning that
38748 * the RX CoS queue will be flow controlled when the A-side RX rings
38749 * are full.
38750 */
38751 uint8_t fc_ba;
38752 uint8_t unused_1[4];
38753 } hwrm_cfa_pair_alloc_input_t, *phwrm_cfa_pair_alloc_input_t;
38754
38755 /* hwrm_cfa_pair_alloc_output (size:192b/24B) */
38756
38757 typedef struct hwrm_cfa_pair_alloc_output {
38758 /* The specific error status for the command. */
38759 uint16_t error_code;
38760 /* The HWRM command request type. */
38761 uint16_t req_type;
38762 /* The sequence ID from the original command. */
38763 uint16_t seq_id;
38764 /* The length of the response data in number of bytes. */
38765 uint16_t resp_len;
38766 /* Only valid for modes 1 and 2. */
38767 uint16_t rx_cfa_code_a;
38768 /* Only valid for modes 1 and 2. */
38769 uint16_t tx_cfa_action_a;
38770 /* Only valid for mode 2. */
38771 uint16_t rx_cfa_code_b;
38772 /* Only valid for mode 2. */
38773 uint16_t tx_cfa_action_b;
38774 uint8_t unused_0[7];
38775 /*
38776 * This field is used in Output records to indicate that the output
38777 * is completely written to RAM. This field should be read as '1'
38778 * to indicate that the output has been completely written.
38779 * When writing a command completion or response to an internal
38780 * processor, the order of writes has to be such that this field is
38781 * written last.
38782 */
38783 uint8_t valid;
38784 } hwrm_cfa_pair_alloc_output_t, *phwrm_cfa_pair_alloc_output_t;
38785
38786 /**********************
38787 * hwrm_cfa_pair_free *
38788 **********************/
38789
38790
38791 /* hwrm_cfa_pair_free_input (size:448b/56B) */
38792
38793 typedef struct hwrm_cfa_pair_free_input {
38794 /* The HWRM command request type. */
38795 uint16_t req_type;
38796 /*
38797 * The completion ring to send the completion event on. This should
38798 * be the NQ ID returned from the `nq_alloc` HWRM command.
38799 */
38800 uint16_t cmpl_ring;
38801 /*
38802 * The sequence ID is used by the driver for tracking multiple
38803 * commands. This ID is treated as opaque data by the firmware and
38804 * the value is returned in the `hwrm_resp_hdr` upon completion.
38805 */
38806 uint16_t seq_id;
38807 /*
38808 * The target ID of the command:
38809 * * 0x0-0xFFF8 - The function ID
38810 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38811 * * 0xFFFD - Reserved for user-space HWRM interface
38812 * * 0xFFFF - HWRM
38813 */
38814 uint16_t target_id;
38815 /*
38816 * A physical address pointer pointing to a host buffer that the
38817 * command's response data will be written. This can be either a host
38818 * physical address (HPA) or a guest physical address (GPA) and must
38819 * point to a physically contiguous block of memory.
38820 */
38821 uint64_t resp_addr;
38822 /* VF Pair name (32 byte string). */
38823 char pair_name[32];
38824 /* Logical PF (0xff-PF for command channel). */
38825 uint8_t pf_b_id;
38826 uint8_t unused_0[3];
38827 /* Logical VF number (range: 0 -> MAX_VFS -1). */
38828 uint16_t vf_id;
38829 /*
38830 * Pair mode (0-vf2fn, 1-rep2fn, 2-rep2rep, 3-proxy, 4-pfpair,
38831 * 5-rep2fn_mod, 6-rep2fn_modall, 7-rep2fn_truflow).
38832 */
38833 uint16_t pair_mode;
38834 /* Pair between VF on local host with PF or VF on specified host. */
38835 #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_VF2FN UINT32_C(0x0)
38836 /* Pair between REP on local host with PF or VF on specified host. */
38837 #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2FN UINT32_C(0x1)
38838 /* Pair between REP on local host with REP on specified host. */
38839 #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2REP UINT32_C(0x2)
38840 /* Pair for the proxy interface. */
38841 #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_PROXY UINT32_C(0x3)
38842 /* Pair for the PF interface. */
38843 #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_PFPAIR UINT32_C(0x4)
38844 /* Modify existing rep2fn pair and move pair to new PF. */
38845 #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2FN_MOD UINT32_C(0x5)
38846 /*
38847 * Modify existing rep2fn pairs paired with same PF and move pairs
38848 * to new PF.
38849 */
38850 #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2FN_MODALL UINT32_C(0x6)
38851 /*
38852 * Truflow pair between REP on local host with PF or VF on
38853 * specified host.
38854 */
38855 #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2FN_TRUFLOW UINT32_C(0x7)
38856 #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_LAST HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2FN_TRUFLOW
38857 } hwrm_cfa_pair_free_input_t, *phwrm_cfa_pair_free_input_t;
38858
38859 /* hwrm_cfa_pair_free_output (size:128b/16B) */
38860
38861 typedef struct hwrm_cfa_pair_free_output {
38862 /* The specific error status for the command. */
38863 uint16_t error_code;
38864 /* The HWRM command request type. */
38865 uint16_t req_type;
38866 /* The sequence ID from the original command. */
38867 uint16_t seq_id;
38868 /* The length of the response data in number of bytes. */
38869 uint16_t resp_len;
38870 uint8_t unused_0[7];
38871 /*
38872 * This field is used in Output records to indicate that the output
38873 * is completely written to RAM. This field should be read as '1'
38874 * to indicate that the output has been completely written.
38875 * When writing a command completion or response to an internal
38876 * processor, the order of writes has to be such that this field is
38877 * written last.
38878 */
38879 uint8_t valid;
38880 } hwrm_cfa_pair_free_output_t, *phwrm_cfa_pair_free_output_t;
38881
38882 /**********************
38883 * hwrm_cfa_pair_info *
38884 **********************/
38885
38886
38887 /* hwrm_cfa_pair_info_input (size:448b/56B) */
38888
38889 typedef struct hwrm_cfa_pair_info_input {
38890 /* The HWRM command request type. */
38891 uint16_t req_type;
38892 /*
38893 * The completion ring to send the completion event on. This should
38894 * be the NQ ID returned from the `nq_alloc` HWRM command.
38895 */
38896 uint16_t cmpl_ring;
38897 /*
38898 * The sequence ID is used by the driver for tracking multiple
38899 * commands. This ID is treated as opaque data by the firmware and
38900 * the value is returned in the `hwrm_resp_hdr` upon completion.
38901 */
38902 uint16_t seq_id;
38903 /*
38904 * The target ID of the command:
38905 * * 0x0-0xFFF8 - The function ID
38906 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38907 * * 0xFFFD - Reserved for user-space HWRM interface
38908 * * 0xFFFF - HWRM
38909 */
38910 uint16_t target_id;
38911 /*
38912 * A physical address pointer pointing to a host buffer that the
38913 * command's response data will be written. This can be either a host
38914 * physical address (HPA) or a guest physical address (GPA) and must
38915 * point to a physically contiguous block of memory.
38916 */
38917 uint64_t resp_addr;
38918 uint32_t flags;
38919 /* If this flag is set, lookup by name else lookup by index. */
38920 #define HWRM_CFA_PAIR_INFO_INPUT_FLAGS_LOOKUP_TYPE UINT32_C(0x1)
38921 /* If this flag is set, lookup by PF id and VF id. */
38922 #define HWRM_CFA_PAIR_INFO_INPUT_FLAGS_LOOKUP_REPRE UINT32_C(0x2)
38923 /* Pair table index. */
38924 uint16_t pair_index;
38925 /* Pair pf index. */
38926 uint8_t pair_pfid;
38927 /* Pair vf index. */
38928 uint8_t pair_vfid;
38929 /* Pair name (32 byte string). */
38930 char pair_name[32];
38931 } hwrm_cfa_pair_info_input_t, *phwrm_cfa_pair_info_input_t;
38932
38933 /* hwrm_cfa_pair_info_output (size:576b/72B) */
38934
38935 typedef struct hwrm_cfa_pair_info_output {
38936 /* The specific error status for the command. */
38937 uint16_t error_code;
38938 /* The HWRM command request type. */
38939 uint16_t req_type;
38940 /* The sequence ID from the original command. */
38941 uint16_t seq_id;
38942 /* The length of the response data in number of bytes. */
38943 uint16_t resp_len;
38944 /* Pair table index. */
38945 uint16_t next_pair_index;
38946 /* Pair member a's fid. */
38947 uint16_t a_fid;
38948 /* Logical host number. */
38949 uint8_t host_a_index;
38950 /* Logical PF number. */
38951 uint8_t pf_a_index;
38952 /* Pair member a's Linux logical VF number. */
38953 uint16_t vf_a_index;
38954 /* Rx CFA code. */
38955 uint16_t rx_cfa_code_a;
38956 /* Tx CFA action. */
38957 uint16_t tx_cfa_action_a;
38958 /* Pair member b's fid. */
38959 uint16_t b_fid;
38960 /* Logical host number. */
38961 uint8_t host_b_index;
38962 /* Logical PF number. */
38963 uint8_t pf_b_index;
38964 /* Pair member a's Linux logical VF number. */
38965 uint16_t vf_b_index;
38966 /* Rx CFA code. */
38967 uint16_t rx_cfa_code_b;
38968 /* Tx CFA action. */
38969 uint16_t tx_cfa_action_b;
38970 /* Pair mode (0-vf2fn, 1-rep2fn, 2-rep2rep, 3-proxy, 4-pfpair). */
38971 uint8_t pair_mode;
38972 /* Pair between VF on local host with PF or VF on specified host. */
38973 #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_VF2FN UINT32_C(0x0)
38974 /* Pair between REP on local host with PF or VF on specified host. */
38975 #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_REP2FN UINT32_C(0x1)
38976 /* Pair between REP on local host with REP on specified host. */
38977 #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_REP2REP UINT32_C(0x2)
38978 /* Pair for the proxy interface. */
38979 #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PROXY UINT32_C(0x3)
38980 /* Pair for the PF interface. */
38981 #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PFPAIR UINT32_C(0x4)
38982 #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_LAST HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PFPAIR
38983 /* Pair state. */
38984 uint8_t pair_state;
38985 /* Pair has been allocated */
38986 #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ALLOCATED UINT32_C(0x1)
38987 /* Both pair members are active */
38988 #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE UINT32_C(0x2)
38989 #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_LAST HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE
38990 /* Pair name (32 byte string). */
38991 char pair_name[32];
38992 uint8_t unused_0[7];
38993 /*
38994 * This field is used in Output records to indicate that the output
38995 * is completely written to RAM. This field should be read as '1'
38996 * to indicate that the output has been completely written.
38997 * When writing a command completion or response to an internal
38998 * processor, the order of writes has to be such that this field is
38999 * written last.
39000 */
39001 uint8_t valid;
39002 } hwrm_cfa_pair_info_output_t, *phwrm_cfa_pair_info_output_t;
39003
39004 /**********************
39005 * hwrm_cfa_vfr_alloc *
39006 **********************/
39007
39008
39009 /* hwrm_cfa_vfr_alloc_input (size:448b/56B) */
39010
39011 typedef struct hwrm_cfa_vfr_alloc_input {
39012 /* The HWRM command request type. */
39013 uint16_t req_type;
39014 /*
39015 * The completion ring to send the completion event on. This should
39016 * be the NQ ID returned from the `nq_alloc` HWRM command.
39017 */
39018 uint16_t cmpl_ring;
39019 /*
39020 * The sequence ID is used by the driver for tracking multiple
39021 * commands. This ID is treated as opaque data by the firmware and
39022 * the value is returned in the `hwrm_resp_hdr` upon completion.
39023 */
39024 uint16_t seq_id;
39025 /*
39026 * The target ID of the command:
39027 * * 0x0-0xFFF8 - The function ID
39028 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39029 * * 0xFFFD - Reserved for user-space HWRM interface
39030 * * 0xFFFF - HWRM
39031 */
39032 uint16_t target_id;
39033 /*
39034 * A physical address pointer pointing to a host buffer that the
39035 * command's response data will be written. This can be either a host
39036 * physical address (HPA) or a guest physical address (GPA) and must
39037 * point to a physically contiguous block of memory.
39038 */
39039 uint64_t resp_addr;
39040 /* Logical VF number (range: 0 -> MAX_VFS -1). */
39041 uint16_t vf_id;
39042 /*
39043 * This field is reserved for the future use.
39044 * It shall be set to 0.
39045 */
39046 uint16_t reserved;
39047 uint8_t unused_0[4];
39048 /* VF Representor name (32 byte string). */
39049 char vfr_name[32];
39050 } hwrm_cfa_vfr_alloc_input_t, *phwrm_cfa_vfr_alloc_input_t;
39051
39052 /* hwrm_cfa_vfr_alloc_output (size:128b/16B) */
39053
39054 typedef struct hwrm_cfa_vfr_alloc_output {
39055 /* The specific error status for the command. */
39056 uint16_t error_code;
39057 /* The HWRM command request type. */
39058 uint16_t req_type;
39059 /* The sequence ID from the original command. */
39060 uint16_t seq_id;
39061 /* The length of the response data in number of bytes. */
39062 uint16_t resp_len;
39063 /* Rx CFA code. */
39064 uint16_t rx_cfa_code;
39065 /* Tx CFA action. */
39066 uint16_t tx_cfa_action;
39067 uint8_t unused_0[3];
39068 /*
39069 * This field is used in Output records to indicate that the output
39070 * is completely written to RAM. This field should be read as '1'
39071 * to indicate that the output has been completely written.
39072 * When writing a command completion or response to an internal
39073 * processor, the order of writes has to be such that this field is
39074 * written last.
39075 */
39076 uint8_t valid;
39077 } hwrm_cfa_vfr_alloc_output_t, *phwrm_cfa_vfr_alloc_output_t;
39078
39079 /*********************
39080 * hwrm_cfa_vfr_free *
39081 *********************/
39082
39083
39084 /* hwrm_cfa_vfr_free_input (size:448b/56B) */
39085
39086 typedef struct hwrm_cfa_vfr_free_input {
39087 /* The HWRM command request type. */
39088 uint16_t req_type;
39089 /*
39090 * The completion ring to send the completion event on. This should
39091 * be the NQ ID returned from the `nq_alloc` HWRM command.
39092 */
39093 uint16_t cmpl_ring;
39094 /*
39095 * The sequence ID is used by the driver for tracking multiple
39096 * commands. This ID is treated as opaque data by the firmware and
39097 * the value is returned in the `hwrm_resp_hdr` upon completion.
39098 */
39099 uint16_t seq_id;
39100 /*
39101 * The target ID of the command:
39102 * * 0x0-0xFFF8 - The function ID
39103 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39104 * * 0xFFFD - Reserved for user-space HWRM interface
39105 * * 0xFFFF - HWRM
39106 */
39107 uint16_t target_id;
39108 /*
39109 * A physical address pointer pointing to a host buffer that the
39110 * command's response data will be written. This can be either a host
39111 * physical address (HPA) or a guest physical address (GPA) and must
39112 * point to a physically contiguous block of memory.
39113 */
39114 uint64_t resp_addr;
39115 /* VF Representor name (32 byte string). */
39116 char vfr_name[32];
39117 /* Logical VF number (range: 0 -> MAX_VFS -1). */
39118 uint16_t vf_id;
39119 /*
39120 * This field is reserved for the future use.
39121 * It shall be set to 0.
39122 */
39123 uint16_t reserved;
39124 uint8_t unused_0[4];
39125 } hwrm_cfa_vfr_free_input_t, *phwrm_cfa_vfr_free_input_t;
39126
39127 /* hwrm_cfa_vfr_free_output (size:128b/16B) */
39128
39129 typedef struct hwrm_cfa_vfr_free_output {
39130 /* The specific error status for the command. */
39131 uint16_t error_code;
39132 /* The HWRM command request type. */
39133 uint16_t req_type;
39134 /* The sequence ID from the original command. */
39135 uint16_t seq_id;
39136 /* The length of the response data in number of bytes. */
39137 uint16_t resp_len;
39138 uint8_t unused_0[7];
39139 /*
39140 * This field is used in Output records to indicate that the output
39141 * is completely written to RAM. This field should be read as '1'
39142 * to indicate that the output has been completely written.
39143 * When writing a command completion or response to an internal
39144 * processor, the order of writes has to be such that this field is
39145 * written last.
39146 */
39147 uint8_t valid;
39148 } hwrm_cfa_vfr_free_output_t, *phwrm_cfa_vfr_free_output_t;
39149
39150 /***************************************
39151 * hwrm_cfa_redirect_query_tunnel_type *
39152 ***************************************/
39153
39154
39155 /* hwrm_cfa_redirect_query_tunnel_type_input (size:192b/24B) */
39156
39157 typedef struct hwrm_cfa_redirect_query_tunnel_type_input {
39158 /* The HWRM command request type. */
39159 uint16_t req_type;
39160 /*
39161 * The completion ring to send the completion event on. This should
39162 * be the NQ ID returned from the `nq_alloc` HWRM command.
39163 */
39164 uint16_t cmpl_ring;
39165 /*
39166 * The sequence ID is used by the driver for tracking multiple
39167 * commands. This ID is treated as opaque data by the firmware and
39168 * the value is returned in the `hwrm_resp_hdr` upon completion.
39169 */
39170 uint16_t seq_id;
39171 /*
39172 * The target ID of the command:
39173 * * 0x0-0xFFF8 - The function ID
39174 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39175 * * 0xFFFD - Reserved for user-space HWRM interface
39176 * * 0xFFFF - HWRM
39177 */
39178 uint16_t target_id;
39179 /*
39180 * A physical address pointer pointing to a host buffer that the
39181 * command's response data will be written. This can be either a host
39182 * physical address (HPA) or a guest physical address (GPA) and must
39183 * point to a physically contiguous block of memory.
39184 */
39185 uint64_t resp_addr;
39186 /* The source function id. */
39187 uint16_t src_fid;
39188 uint8_t unused_0[6];
39189 } hwrm_cfa_redirect_query_tunnel_type_input_t, *phwrm_cfa_redirect_query_tunnel_type_input_t;
39190
39191 /* hwrm_cfa_redirect_query_tunnel_type_output (size:128b/16B) */
39192
39193 typedef struct hwrm_cfa_redirect_query_tunnel_type_output {
39194 /* The specific error status for the command. */
39195 uint16_t error_code;
39196 /* The HWRM command request type. */
39197 uint16_t req_type;
39198 /* The sequence ID from the original command. */
39199 uint16_t seq_id;
39200 /* The length of the response data in number of bytes. */
39201 uint16_t resp_len;
39202 /* Tunnel Mask. */
39203 uint32_t tunnel_mask;
39204 /* Non-tunnel */
39205 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_NONTUNNEL UINT32_C(0x1)
39206 /* Virtual eXtensible Local Area Network (VXLAN) */
39207 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN UINT32_C(0x2)
39208 /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
39209 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_NVGRE UINT32_C(0x4)
39210 /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
39211 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_L2GRE UINT32_C(0x8)
39212 /* IP in IP */
39213 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPIP UINT32_C(0x10)
39214 /* Generic Network Virtualization Encapsulation (Geneve) */
39215 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_GENEVE UINT32_C(0x20)
39216 /* Multi-Protocol Label Switching (MPLS) */
39217 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_MPLS UINT32_C(0x40)
39218 /* Stateless Transport Tunnel (STT) */
39219 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_STT UINT32_C(0x80)
39220 /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
39221 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPGRE UINT32_C(0x100)
39222 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
39223 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN_V4 UINT32_C(0x200)
39224 /*
39225 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
39226 * datagram payload
39227 */
39228 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPGRE_V1 UINT32_C(0x400)
39229 /* Any tunneled traffic */
39230 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_ANYTUNNEL UINT32_C(0x800)
39231 /* Use fixed layer 2 ether type of 0xFFFF */
39232 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_L2_ETYPE UINT32_C(0x1000)
39233 /*
39234 * IPV6 over virtual eXtensible Local Area Network with GPE header
39235 * (IPV6oVXLANGPE)
39236 */
39237 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN_GPE_V6 UINT32_C(0x2000)
39238 uint8_t unused_0[3];
39239 /*
39240 * This field is used in Output records to indicate that the output
39241 * is completely written to RAM. This field should be read as '1'
39242 * to indicate that the output has been completely written.
39243 * When writing a command completion or response to an internal
39244 * processor, the order of writes has to be such that this field is
39245 * written last.
39246 */
39247 uint8_t valid;
39248 } hwrm_cfa_redirect_query_tunnel_type_output_t, *phwrm_cfa_redirect_query_tunnel_type_output_t;
39249
39250 /*************************
39251 * hwrm_cfa_ctx_mem_rgtr *
39252 *************************/
39253
39254
39255 /* hwrm_cfa_ctx_mem_rgtr_input (size:256b/32B) */
39256
39257 typedef struct hwrm_cfa_ctx_mem_rgtr_input {
39258 /* The HWRM command request type. */
39259 uint16_t req_type;
39260 /*
39261 * The completion ring to send the completion event on. This should
39262 * be the NQ ID returned from the `nq_alloc` HWRM command.
39263 */
39264 uint16_t cmpl_ring;
39265 /*
39266 * The sequence ID is used by the driver for tracking multiple
39267 * commands. This ID is treated as opaque data by the firmware and
39268 * the value is returned in the `hwrm_resp_hdr` upon completion.
39269 */
39270 uint16_t seq_id;
39271 /*
39272 * The target ID of the command:
39273 * * 0x0-0xFFF8 - The function ID
39274 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39275 * * 0xFFFD - Reserved for user-space HWRM interface
39276 * * 0xFFFF - HWRM
39277 */
39278 uint16_t target_id;
39279 /*
39280 * A physical address pointer pointing to a host buffer that the
39281 * command's response data will be written. This can be either a host
39282 * physical address (HPA) or a guest physical address (GPA) and must
39283 * point to a physically contiguous block of memory.
39284 */
39285 uint64_t resp_addr;
39286 uint16_t flags;
39287 /* Counter PBL indirect levels. */
39288 uint8_t page_level;
39289 /* PBL pointer is physical start address. */
39290 #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
39291 /* PBL pointer points to PTE table. */
39292 #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
39293 /*
39294 * PBL pointer points to PDE table with each entry pointing to PTE
39295 * tables.
39296 */
39297 #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
39298 #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LAST HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2
39299 /* Page size. */
39300 uint8_t page_size;
39301 /* 4KB page size. */
39302 #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_4K UINT32_C(0x0)
39303 /* 8KB page size. */
39304 #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_8K UINT32_C(0x1)
39305 /* 64KB page size. */
39306 #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_64K UINT32_C(0x4)
39307 /* 256KB page size. */
39308 #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
39309 /* 1MB page size. */
39310 #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1M UINT32_C(0x8)
39311 /* 2MB page size. */
39312 #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_2M UINT32_C(0x9)
39313 /* 4MB page size. */
39314 #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_4M UINT32_C(0xa)
39315 /* 1GB page size. */
39316 #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1G UINT32_C(0x12)
39317 #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_LAST HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1G
39318 uint32_t unused_0;
39319 /* Pointer to the PBL, or PDL depending on number of levels */
39320 uint64_t page_dir;
39321 } hwrm_cfa_ctx_mem_rgtr_input_t, *phwrm_cfa_ctx_mem_rgtr_input_t;
39322
39323 /* hwrm_cfa_ctx_mem_rgtr_output (size:128b/16B) */
39324
39325 typedef struct hwrm_cfa_ctx_mem_rgtr_output {
39326 /* The specific error status for the command. */
39327 uint16_t error_code;
39328 /* The HWRM command request type. */
39329 uint16_t req_type;
39330 /* The sequence ID from the original command. */
39331 uint16_t seq_id;
39332 /* The length of the response data in number of bytes. */
39333 uint16_t resp_len;
39334 /*
39335 * Id/Handle to the recently register context memory. This handle is
39336 * passed to the CFA feature.
39337 */
39338 uint16_t ctx_id;
39339 uint8_t unused_0[5];
39340 /*
39341 * This field is used in Output records to indicate that the output
39342 * is completely written to RAM. This field should be read as '1'
39343 * to indicate that the output has been completely written.
39344 * When writing a command completion or response to an internal
39345 * processor, the order of writes has to be such that this field is
39346 * written last.
39347 */
39348 uint8_t valid;
39349 } hwrm_cfa_ctx_mem_rgtr_output_t, *phwrm_cfa_ctx_mem_rgtr_output_t;
39350
39351 /***************************
39352 * hwrm_cfa_ctx_mem_unrgtr *
39353 ***************************/
39354
39355
39356 /* hwrm_cfa_ctx_mem_unrgtr_input (size:192b/24B) */
39357
39358 typedef struct hwrm_cfa_ctx_mem_unrgtr_input {
39359 /* The HWRM command request type. */
39360 uint16_t req_type;
39361 /*
39362 * The completion ring to send the completion event on. This should
39363 * be the NQ ID returned from the `nq_alloc` HWRM command.
39364 */
39365 uint16_t cmpl_ring;
39366 /*
39367 * The sequence ID is used by the driver for tracking multiple
39368 * commands. This ID is treated as opaque data by the firmware and
39369 * the value is returned in the `hwrm_resp_hdr` upon completion.
39370 */
39371 uint16_t seq_id;
39372 /*
39373 * The target ID of the command:
39374 * * 0x0-0xFFF8 - The function ID
39375 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39376 * * 0xFFFD - Reserved for user-space HWRM interface
39377 * * 0xFFFF - HWRM
39378 */
39379 uint16_t target_id;
39380 /*
39381 * A physical address pointer pointing to a host buffer that the
39382 * command's response data will be written. This can be either a host
39383 * physical address (HPA) or a guest physical address (GPA) and must
39384 * point to a physically contiguous block of memory.
39385 */
39386 uint64_t resp_addr;
39387 /*
39388 * Id/Handle to the recently register context memory. This handle is
39389 * passed to the CFA feature.
39390 */
39391 uint16_t ctx_id;
39392 uint8_t unused_0[6];
39393 } hwrm_cfa_ctx_mem_unrgtr_input_t, *phwrm_cfa_ctx_mem_unrgtr_input_t;
39394
39395 /* hwrm_cfa_ctx_mem_unrgtr_output (size:128b/16B) */
39396
39397 typedef struct hwrm_cfa_ctx_mem_unrgtr_output {
39398 /* The specific error status for the command. */
39399 uint16_t error_code;
39400 /* The HWRM command request type. */
39401 uint16_t req_type;
39402 /* The sequence ID from the original command. */
39403 uint16_t seq_id;
39404 /* The length of the response data in number of bytes. */
39405 uint16_t resp_len;
39406 uint8_t unused_0[7];
39407 /*
39408 * This field is used in Output records to indicate that the output
39409 * is completely written to RAM. This field should be read as '1'
39410 * to indicate that the output has been completely written.
39411 * When writing a command completion or response to an internal
39412 * processor, the order of writes has to be such that this field is
39413 * written last.
39414 */
39415 uint8_t valid;
39416 } hwrm_cfa_ctx_mem_unrgtr_output_t, *phwrm_cfa_ctx_mem_unrgtr_output_t;
39417
39418 /*************************
39419 * hwrm_cfa_ctx_mem_qctx *
39420 *************************/
39421
39422
39423 /* hwrm_cfa_ctx_mem_qctx_input (size:192b/24B) */
39424
39425 typedef struct hwrm_cfa_ctx_mem_qctx_input {
39426 /* The HWRM command request type. */
39427 uint16_t req_type;
39428 /*
39429 * The completion ring to send the completion event on. This should
39430 * be the NQ ID returned from the `nq_alloc` HWRM command.
39431 */
39432 uint16_t cmpl_ring;
39433 /*
39434 * The sequence ID is used by the driver for tracking multiple
39435 * commands. This ID is treated as opaque data by the firmware and
39436 * the value is returned in the `hwrm_resp_hdr` upon completion.
39437 */
39438 uint16_t seq_id;
39439 /*
39440 * The target ID of the command:
39441 * * 0x0-0xFFF8 - The function ID
39442 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39443 * * 0xFFFD - Reserved for user-space HWRM interface
39444 * * 0xFFFF - HWRM
39445 */
39446 uint16_t target_id;
39447 /*
39448 * A physical address pointer pointing to a host buffer that the
39449 * command's response data will be written. This can be either a host
39450 * physical address (HPA) or a guest physical address (GPA) and must
39451 * point to a physically contiguous block of memory.
39452 */
39453 uint64_t resp_addr;
39454 /*
39455 * Id/Handle to the recently register context memory. This handle is
39456 * passed to the CFA feature.
39457 */
39458 uint16_t ctx_id;
39459 uint8_t unused_0[6];
39460 } hwrm_cfa_ctx_mem_qctx_input_t, *phwrm_cfa_ctx_mem_qctx_input_t;
39461
39462 /* hwrm_cfa_ctx_mem_qctx_output (size:256b/32B) */
39463
39464 typedef struct hwrm_cfa_ctx_mem_qctx_output {
39465 /* The specific error status for the command. */
39466 uint16_t error_code;
39467 /* The HWRM command request type. */
39468 uint16_t req_type;
39469 /* The sequence ID from the original command. */
39470 uint16_t seq_id;
39471 /* The length of the response data in number of bytes. */
39472 uint16_t resp_len;
39473 uint16_t flags;
39474 /* Counter PBL indirect levels. */
39475 uint8_t page_level;
39476 /* PBL pointer is physical start address. */
39477 #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
39478 /* PBL pointer points to PTE table. */
39479 #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
39480 /*
39481 * PBL pointer points to PDE table with each entry pointing to PTE
39482 * tables.
39483 */
39484 #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
39485 #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LAST HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_2
39486 /* Page size. */
39487 uint8_t page_size;
39488 /* 4KB page size. */
39489 #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_4K UINT32_C(0x0)
39490 /* 8KB page size. */
39491 #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_8K UINT32_C(0x1)
39492 /* 64KB page size. */
39493 #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_64K UINT32_C(0x4)
39494 /* 256KB page size. */
39495 #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_256K UINT32_C(0x6)
39496 /* 1MB page size. */
39497 #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1M UINT32_C(0x8)
39498 /* 2MB page size. */
39499 #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_2M UINT32_C(0x9)
39500 /* 4MB page size. */
39501 #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_4M UINT32_C(0xa)
39502 /* 1GB page size. */
39503 #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1G UINT32_C(0x12)
39504 #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_LAST HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1G
39505 uint8_t unused_0[4];
39506 /* Pointer to the PBL, or PDL depending on number of levels */
39507 uint64_t page_dir;
39508 uint8_t unused_1[7];
39509 /*
39510 * This field is used in Output records to indicate that the output
39511 * is completely written to RAM. This field should be read as '1'
39512 * to indicate that the output has been completely written.
39513 * When writing a command completion or response to an internal
39514 * processor, the order of writes has to be such that this field is
39515 * written last.
39516 */
39517 uint8_t valid;
39518 } hwrm_cfa_ctx_mem_qctx_output_t, *phwrm_cfa_ctx_mem_qctx_output_t;
39519
39520 /**************************
39521 * hwrm_cfa_ctx_mem_qcaps *
39522 **************************/
39523
39524
39525 /* hwrm_cfa_ctx_mem_qcaps_input (size:128b/16B) */
39526
39527 typedef struct hwrm_cfa_ctx_mem_qcaps_input {
39528 /* The HWRM command request type. */
39529 uint16_t req_type;
39530 /*
39531 * The completion ring to send the completion event on. This should
39532 * be the NQ ID returned from the `nq_alloc` HWRM command.
39533 */
39534 uint16_t cmpl_ring;
39535 /*
39536 * The sequence ID is used by the driver for tracking multiple
39537 * commands. This ID is treated as opaque data by the firmware and
39538 * the value is returned in the `hwrm_resp_hdr` upon completion.
39539 */
39540 uint16_t seq_id;
39541 /*
39542 * The target ID of the command:
39543 * * 0x0-0xFFF8 - The function ID
39544 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39545 * * 0xFFFD - Reserved for user-space HWRM interface
39546 * * 0xFFFF - HWRM
39547 */
39548 uint16_t target_id;
39549 /*
39550 * A physical address pointer pointing to a host buffer that the
39551 * command's response data will be written. This can be either a host
39552 * physical address (HPA) or a guest physical address (GPA) and must
39553 * point to a physically contiguous block of memory.
39554 */
39555 uint64_t resp_addr;
39556 } hwrm_cfa_ctx_mem_qcaps_input_t, *phwrm_cfa_ctx_mem_qcaps_input_t;
39557
39558 /* hwrm_cfa_ctx_mem_qcaps_output (size:128b/16B) */
39559
39560 typedef struct hwrm_cfa_ctx_mem_qcaps_output {
39561 /* The specific error status for the command. */
39562 uint16_t error_code;
39563 /* The HWRM command request type. */
39564 uint16_t req_type;
39565 /* The sequence ID from the original command. */
39566 uint16_t seq_id;
39567 /* The length of the response data in number of bytes. */
39568 uint16_t resp_len;
39569 /*
39570 * Indicates the maximum number of context memory which can be
39571 * registered.
39572 */
39573 uint16_t max_entries;
39574 uint8_t unused_0[5];
39575 /*
39576 * This field is used in Output records to indicate that the output
39577 * is completely written to RAM. This field should be read as '1'
39578 * to indicate that the output has been completely written.
39579 * When writing a command completion or response to an internal
39580 * processor, the order of writes has to be such that this field is
39581 * written last.
39582 */
39583 uint8_t valid;
39584 } hwrm_cfa_ctx_mem_qcaps_output_t, *phwrm_cfa_ctx_mem_qcaps_output_t;
39585
39586 /**************************
39587 * hwrm_cfa_counter_qcaps *
39588 **************************/
39589
39590
39591 /* hwrm_cfa_counter_qcaps_input (size:128b/16B) */
39592
39593 typedef struct hwrm_cfa_counter_qcaps_input {
39594 /* The HWRM command request type. */
39595 uint16_t req_type;
39596 /*
39597 * The completion ring to send the completion event on. This should
39598 * be the NQ ID returned from the `nq_alloc` HWRM command.
39599 */
39600 uint16_t cmpl_ring;
39601 /*
39602 * The sequence ID is used by the driver for tracking multiple
39603 * commands. This ID is treated as opaque data by the firmware and
39604 * the value is returned in the `hwrm_resp_hdr` upon completion.
39605 */
39606 uint16_t seq_id;
39607 /*
39608 * The target ID of the command:
39609 * * 0x0-0xFFF8 - The function ID
39610 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39611 * * 0xFFFD - Reserved for user-space HWRM interface
39612 * * 0xFFFF - HWRM
39613 */
39614 uint16_t target_id;
39615 /*
39616 * A physical address pointer pointing to a host buffer that the
39617 * command's response data will be written. This can be either a host
39618 * physical address (HPA) or a guest physical address (GPA) and must
39619 * point to a physically contiguous block of memory.
39620 */
39621 uint64_t resp_addr;
39622 } hwrm_cfa_counter_qcaps_input_t, *phwrm_cfa_counter_qcaps_input_t;
39623
39624 /* hwrm_cfa_counter_qcaps_output (size:576b/72B) */
39625
39626 typedef struct hwrm_cfa_counter_qcaps_output {
39627 /* The specific error status for the command. */
39628 uint16_t error_code;
39629 /* The HWRM command request type. */
39630 uint16_t req_type;
39631 /* The sequence ID from the original command. */
39632 uint16_t seq_id;
39633 /* The length of the response data in number of bytes. */
39634 uint16_t resp_len;
39635 uint32_t flags;
39636 /* Enumeration denoting the supported CFA counter format. */
39637 #define HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT UINT32_C(0x1)
39638 /* CFA counter types are not supported. */
39639 #define HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT_NONE UINT32_C(0x0)
39640 /* 64-bit packet counters followed by 64-bit byte counters format. */
39641 #define HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT_64_BIT UINT32_C(0x1)
39642 #define HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT_LAST HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT_64_BIT
39643 uint32_t unused_0;
39644 /*
39645 * Minimum guaranteed number of flow counters supported for this
39646 * function, in RX direction.
39647 */
39648 uint32_t min_rx_fc;
39649 /*
39650 * Maximum non-guaranteed number of flow counters supported for this
39651 * function, in RX direction.
39652 */
39653 uint32_t max_rx_fc;
39654 /*
39655 * Minimum guaranteed number of flow counters supported for this
39656 * function, in TX direction.
39657 */
39658 uint32_t min_tx_fc;
39659 /*
39660 * Maximum non-guaranteed number of flow counters supported for this
39661 * function, in TX direction.
39662 */
39663 uint32_t max_tx_fc;
39664 /*
39665 * Minimum guaranteed number of extension flow counters supported for
39666 * this function, in RX direction.
39667 */
39668 uint32_t min_rx_efc;
39669 /*
39670 * Maximum non-guaranteed number of extension flow counters supported
39671 * for this function, in RX direction.
39672 */
39673 uint32_t max_rx_efc;
39674 /*
39675 * Minimum guaranteed number of extension flow counters supported for
39676 * this function, in TX direction.
39677 */
39678 uint32_t min_tx_efc;
39679 /*
39680 * Maximum non-guaranteed number of extension flow counters supported
39681 * for this function, in TX direction.
39682 */
39683 uint32_t max_tx_efc;
39684 /*
39685 * Minimum guaranteed number of meter drop counters supported for
39686 * this function, in RX direction.
39687 */
39688 uint32_t min_rx_mdc;
39689 /*
39690 * Maximum non-guaranteed number of meter drop counters supported for
39691 * this function, in RX direction.
39692 */
39693 uint32_t max_rx_mdc;
39694 /*
39695 * Minimum guaranteed number of meter drop counters supported for this
39696 * function, in TX direction.
39697 */
39698 uint32_t min_tx_mdc;
39699 /*
39700 * Maximum non-guaranteed number of meter drop counters supported for
39701 * this function, in TX direction.
39702 */
39703 uint32_t max_tx_mdc;
39704 /*
39705 * Maximum guaranteed number of flow counters which can be used during
39706 * flow alloc.
39707 */
39708 uint32_t max_flow_alloc_fc;
39709 uint8_t unused_1[3];
39710 /*
39711 * This field is used in Output records to indicate that the output
39712 * is completely written to RAM. This field should be read as '1'
39713 * to indicate that the output has been completely written.
39714 * When writing a command completion or response to an internal
39715 * processor, the order of writes has to be such that this field is
39716 * written last.
39717 */
39718 uint8_t valid;
39719 } hwrm_cfa_counter_qcaps_output_t, *phwrm_cfa_counter_qcaps_output_t;
39720
39721 /************************
39722 * hwrm_cfa_counter_cfg *
39723 ************************/
39724
39725
39726 /* hwrm_cfa_counter_cfg_input (size:256b/32B) */
39727
39728 typedef struct hwrm_cfa_counter_cfg_input {
39729 /* The HWRM command request type. */
39730 uint16_t req_type;
39731 /*
39732 * The completion ring to send the completion event on. This should
39733 * be the NQ ID returned from the `nq_alloc` HWRM command.
39734 */
39735 uint16_t cmpl_ring;
39736 /*
39737 * The sequence ID is used by the driver for tracking multiple
39738 * commands. This ID is treated as opaque data by the firmware and
39739 * the value is returned in the `hwrm_resp_hdr` upon completion.
39740 */
39741 uint16_t seq_id;
39742 /*
39743 * The target ID of the command:
39744 * * 0x0-0xFFF8 - The function ID
39745 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39746 * * 0xFFFD - Reserved for user-space HWRM interface
39747 * * 0xFFFF - HWRM
39748 */
39749 uint16_t target_id;
39750 /*
39751 * A physical address pointer pointing to a host buffer that the
39752 * command's response data will be written. This can be either a host
39753 * physical address (HPA) or a guest physical address (GPA) and must
39754 * point to a physically contiguous block of memory.
39755 */
39756 uint64_t resp_addr;
39757 uint16_t flags;
39758 /* Enumeration denoting the configuration mode. */
39759 #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE UINT32_C(0x1)
39760 /* Disable the configuration mode. */
39761 #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE_DISABLE UINT32_C(0x0)
39762 /* Enable the configuration mode. */
39763 #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE_ENABLE UINT32_C(0x1)
39764 #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE_LAST HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE_ENABLE
39765 /* Enumeration denoting the RX, TX type of the resource. */
39766 #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH UINT32_C(0x2)
39767 /* Tx path. */
39768 #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH_TX (UINT32_C(0x0) << 1)
39769 /* Rx path. */
39770 #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH_RX (UINT32_C(0x1) << 1)
39771 #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH_LAST HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH_RX
39772 /* Enumeration denoting the data transfer mode. */
39773 #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_MASK UINT32_C(0xc)
39774 #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_SFT 2
39775 /* Push mode. */
39776 #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PUSH (UINT32_C(0x0) << 2)
39777 /* Pull mode. */
39778 #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PULL (UINT32_C(0x1) << 2)
39779 /* Pull on async update. */
39780 #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PULL_ASYNC (UINT32_C(0x2) << 2)
39781 #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_LAST HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PULL_ASYNC
39782 uint16_t counter_type;
39783 /* Flow counters. */
39784 #define HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_FC UINT32_C(0x0)
39785 /* Extended flow counters. */
39786 #define HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_EFC UINT32_C(0x1)
39787 /* Meter drop counters. */
39788 #define HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_MDC UINT32_C(0x2)
39789 #define HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_LAST HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_MDC
39790 /* Ctx memory handle to be used for the counter. */
39791 uint16_t ctx_id;
39792 /* Counter update cadence hint (only in Push mode). */
39793 uint16_t update_tmr_ms;
39794 /* Total number of entries. */
39795 uint32_t num_entries;
39796 uint32_t unused_0;
39797 } hwrm_cfa_counter_cfg_input_t, *phwrm_cfa_counter_cfg_input_t;
39798
39799 /* hwrm_cfa_counter_cfg_output (size:128b/16B) */
39800
39801 typedef struct hwrm_cfa_counter_cfg_output {
39802 /* The specific error status for the command. */
39803 uint16_t error_code;
39804 /* The HWRM command request type. */
39805 uint16_t req_type;
39806 /* The sequence ID from the original command. */
39807 uint16_t seq_id;
39808 /* The length of the response data in number of bytes. */
39809 uint16_t resp_len;
39810 uint8_t unused_0[7];
39811 /*
39812 * This field is used in Output records to indicate that the output
39813 * is completely written to RAM. This field should be read as '1'
39814 * to indicate that the output has been completely written.
39815 * When writing a command completion or response to an internal
39816 * processor, the order of writes has to be such that this field is
39817 * written last.
39818 */
39819 uint8_t valid;
39820 } hwrm_cfa_counter_cfg_output_t, *phwrm_cfa_counter_cfg_output_t;
39821
39822 /***************************
39823 * hwrm_cfa_counter_qstats *
39824 ***************************/
39825
39826
39827 /* hwrm_cfa_counter_qstats_input (size:320b/40B) */
39828
39829 typedef struct hwrm_cfa_counter_qstats_input {
39830 /* The HWRM command request type. */
39831 uint16_t req_type;
39832 /*
39833 * The completion ring to send the completion event on. This should
39834 * be the NQ ID returned from the `nq_alloc` HWRM command.
39835 */
39836 uint16_t cmpl_ring;
39837 /*
39838 * The sequence ID is used by the driver for tracking multiple
39839 * commands. This ID is treated as opaque data by the firmware and
39840 * the value is returned in the `hwrm_resp_hdr` upon completion.
39841 */
39842 uint16_t seq_id;
39843 /*
39844 * The target ID of the command:
39845 * * 0x0-0xFFF8 - The function ID
39846 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39847 * * 0xFFFD - Reserved for user-space HWRM interface
39848 * * 0xFFFF - HWRM
39849 */
39850 uint16_t target_id;
39851 /*
39852 * A physical address pointer pointing to a host buffer that the
39853 * command's response data will be written. This can be either a host
39854 * physical address (HPA) or a guest physical address (GPA) and must
39855 * point to a physically contiguous block of memory.
39856 */
39857 uint64_t resp_addr;
39858 uint16_t flags;
39859 /* Enumeration denoting the RX, TX type of the resource. */
39860 #define HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH UINT32_C(0x1)
39861 /* Tx path. */
39862 #define HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH_TX UINT32_C(0x0)
39863 /* Rx path. */
39864 #define HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH_RX UINT32_C(0x1)
39865 #define HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH_LAST HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH_RX
39866 uint16_t counter_type;
39867 uint16_t input_flow_ctx_id;
39868 uint16_t num_entries;
39869 uint16_t delta_time_ms;
39870 uint16_t meter_instance_id;
39871 uint16_t mdc_ctx_id;
39872 uint8_t unused_0[2];
39873 uint64_t expected_count;
39874 } hwrm_cfa_counter_qstats_input_t, *phwrm_cfa_counter_qstats_input_t;
39875
39876 /* hwrm_cfa_counter_qstats_output (size:128b/16B) */
39877
39878 typedef struct hwrm_cfa_counter_qstats_output {
39879 /* The specific error status for the command. */
39880 uint16_t error_code;
39881 /* The HWRM command request type. */
39882 uint16_t req_type;
39883 /* The sequence ID from the original command. */
39884 uint16_t seq_id;
39885 /* The length of the response data in number of bytes. */
39886 uint16_t resp_len;
39887 uint8_t unused_0[7];
39888 /*
39889 * This field is used in Output records to indicate that the output
39890 * is completely written to RAM. This field should be read as '1'
39891 * to indicate that the output has been completely written.
39892 * When writing a command completion or response to an internal
39893 * processor, the order of writes has to be such that this field is
39894 * written last.
39895 */
39896 uint8_t valid;
39897 } hwrm_cfa_counter_qstats_output_t, *phwrm_cfa_counter_qstats_output_t;
39898
39899 /**********************
39900 * hwrm_cfa_eem_qcaps *
39901 **********************/
39902
39903
39904 /* hwrm_cfa_eem_qcaps_input (size:192b/24B) */
39905
39906 typedef struct hwrm_cfa_eem_qcaps_input {
39907 /* The HWRM command request type. */
39908 uint16_t req_type;
39909 /*
39910 * The completion ring to send the completion event on. This should
39911 * be the NQ ID returned from the `nq_alloc` HWRM command.
39912 */
39913 uint16_t cmpl_ring;
39914 /*
39915 * The sequence ID is used by the driver for tracking multiple
39916 * commands. This ID is treated as opaque data by the firmware and
39917 * the value is returned in the `hwrm_resp_hdr` upon completion.
39918 */
39919 uint16_t seq_id;
39920 /*
39921 * The target ID of the command:
39922 * * 0x0-0xFFF8 - The function ID
39923 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39924 * * 0xFFFD - Reserved for user-space HWRM interface
39925 * * 0xFFFF - HWRM
39926 */
39927 uint16_t target_id;
39928 /*
39929 * A physical address pointer pointing to a host buffer that the
39930 * command's response data will be written. This can be either a host
39931 * physical address (HPA) or a guest physical address (GPA) and must
39932 * point to a physically contiguous block of memory.
39933 */
39934 uint64_t resp_addr;
39935 uint32_t flags;
39936 /*
39937 * When set to 1, indicates the configuration will apply to TX flows
39938 * which are to be offloaded.
39939 * Note if this bit is set then the path_rx bit can't be set.
39940 */
39941 #define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PATH_TX UINT32_C(0x1)
39942 /*
39943 * When set to 1, indicates the configuration will apply to RX flows
39944 * which are to be offloaded.
39945 * Note if this bit is set then the path_tx bit can't be set.
39946 */
39947 #define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PATH_RX UINT32_C(0x2)
39948 /* When set to 1, all offloaded flows will be sent to EEM. */
39949 #define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PREFERRED_OFFLOAD UINT32_C(0x4)
39950 uint32_t unused_0;
39951 } hwrm_cfa_eem_qcaps_input_t, *phwrm_cfa_eem_qcaps_input_t;
39952
39953 /* hwrm_cfa_eem_qcaps_output (size:320b/40B) */
39954
39955 typedef struct hwrm_cfa_eem_qcaps_output {
39956 /* The specific error status for the command. */
39957 uint16_t error_code;
39958 /* The HWRM command request type. */
39959 uint16_t req_type;
39960 /* The sequence ID from the original command. */
39961 uint16_t seq_id;
39962 /* The length of the response data in number of bytes. */
39963 uint16_t resp_len;
39964 uint32_t flags;
39965 /*
39966 * When set to 1, indicates the configuration will apply to TX flows
39967 * which are to be offloaded.
39968 * Note if this bit is set then the path_rx bit can't be set.
39969 */
39970 #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_PATH_TX UINT32_C(0x1)
39971 /*
39972 * When set to 1, indicates the configuration will apply to RX flows
39973 * which are to be offloaded.
39974 * Note if this bit is set then the path_tx bit can't be set.
39975 */
39976 #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_PATH_RX UINT32_C(0x2)
39977 /*
39978 * When set to 1, indicates the the FW supports the Centralized
39979 * Memory Model. The concept designates one entity for the
39980 * memory allocation while all others ‘subscribe’ to it.
39981 */
39982 #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_CENTRALIZED_MEMORY_MODEL_SUPPORTED UINT32_C(0x4)
39983 /*
39984 * When set to 1, indicates the the FW supports the Detached
39985 * Centralized Memory Model. The memory is allocated and managed
39986 * as a separate entity. All PFs and VFs will be granted direct
39987 * or semi-direct access to the allocated memory while none of
39988 * which can interfere with the management of the memory.
39989 */
39990 #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_DETACHED_CENTRALIZED_MEMORY_MODEL_SUPPORTED UINT32_C(0x8)
39991 uint32_t unused_0;
39992 uint32_t supported;
39993 /*
39994 * If set to 1, then EEM KEY0 table is supported using crc32 hash.
39995 * If set to 0, EEM KEY0 table is not supported.
39996 */
39997 #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_KEY0_TABLE UINT32_C(0x1)
39998 /*
39999 * If set to 1, then EEM KEY1 table is supported using lookup3 hash.
40000 * If set to 0, EEM KEY1 table is not supported.
40001 */
40002 #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_KEY1_TABLE UINT32_C(0x2)
40003 /*
40004 * If set to 1, then EEM External Record table is supported.
40005 * If set to 0, EEM External Record table is not supported.
40006 * (This table includes action record, EFC pointers, encap pointers)
40007 */
40008 #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_RECORD_TABLE UINT32_C(0x4)
40009 /*
40010 * If set to 1, then EEM External Flow Counters table is supported.
40011 * If set to 0, EEM External Flow Counters table is not supported.
40012 */
40013 #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_FLOW_COUNTERS_TABLE UINT32_C(0x8)
40014 /*
40015 * If set to 1, then FID table used for implicit flow flush is
40016 * supported.
40017 * If set to 0, then FID table used for implicit flow flush is
40018 * not supported.
40019 */
40020 #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_FID_TABLE UINT32_C(0x10)
40021 /*
40022 * The maximum number of entries supported by EEM. When configuring
40023 * the host memory, the number of numbers of entries that can
40024 * supported are:
40025 * 32k, 64k 128k, 256k, 512k, 1M, 2M, 4M, 8M, 32M, 64M, 128M
40026 * entries.
40027 * Any value that are not these values, the FW will round down to the
40028 * closest support number of entries.
40029 */
40030 uint32_t max_entries_supported;
40031 /* The entry size in bytes of each entry in the EEM KEY0/KEY1 tables. */
40032 uint16_t key_entry_size;
40033 /* The entry size in bytes of each entry in the EEM RECORD tables. */
40034 uint16_t record_entry_size;
40035 /* The entry size in bytes of each entry in the EEM EFC tables. */
40036 uint16_t efc_entry_size;
40037 /* The FID size in bytes of each entry in the EEM FID tables. */
40038 uint16_t fid_entry_size;
40039 uint8_t unused_1[7];
40040 /*
40041 * This field is used in Output records to indicate that the output
40042 * is completely written to RAM. This field should be read as '1'
40043 * to indicate that the output has been completely written.
40044 * When writing a command completion or response to an internal
40045 * processor, the order of writes has to be such that this field is
40046 * written last.
40047 */
40048 uint8_t valid;
40049 } hwrm_cfa_eem_qcaps_output_t, *phwrm_cfa_eem_qcaps_output_t;
40050
40051 /********************
40052 * hwrm_cfa_eem_cfg *
40053 ********************/
40054
40055
40056 /* hwrm_cfa_eem_cfg_input (size:384b/48B) */
40057
40058 typedef struct hwrm_cfa_eem_cfg_input {
40059 /* The HWRM command request type. */
40060 uint16_t req_type;
40061 /*
40062 * The completion ring to send the completion event on. This should
40063 * be the NQ ID returned from the `nq_alloc` HWRM command.
40064 */
40065 uint16_t cmpl_ring;
40066 /*
40067 * The sequence ID is used by the driver for tracking multiple
40068 * commands. This ID is treated as opaque data by the firmware and
40069 * the value is returned in the `hwrm_resp_hdr` upon completion.
40070 */
40071 uint16_t seq_id;
40072 /*
40073 * The target ID of the command:
40074 * * 0x0-0xFFF8 - The function ID
40075 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40076 * * 0xFFFD - Reserved for user-space HWRM interface
40077 * * 0xFFFF - HWRM
40078 */
40079 uint16_t target_id;
40080 /*
40081 * A physical address pointer pointing to a host buffer that the
40082 * command's response data will be written. This can be either a host
40083 * physical address (HPA) or a guest physical address (GPA) and must
40084 * point to a physically contiguous block of memory.
40085 */
40086 uint64_t resp_addr;
40087 uint32_t flags;
40088 /*
40089 * When set to 1, indicates the configuration will apply to TX flows
40090 * which are to be offloaded.
40091 * Note if this bit is set then the path_rx bit can't be set.
40092 */
40093 #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PATH_TX UINT32_C(0x1)
40094 /*
40095 * When set to 1, indicates the configuration will apply to RX flows
40096 * which are to be offloaded.
40097 * Note if this bit is set then the path_tx bit can't be set.
40098 */
40099 #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PATH_RX UINT32_C(0x2)
40100 /* When set to 1, all offloaded flows will be sent to EEM. */
40101 #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PREFERRED_OFFLOAD UINT32_C(0x4)
40102 /* When set to 1, secondary, 0 means primary. */
40103 #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_SECONDARY_PF UINT32_C(0x8)
40104 /*
40105 * Group_id which used by Firmware to identify memory pools belonging
40106 * to certain group.
40107 */
40108 uint16_t group_id;
40109 uint16_t unused_0;
40110 /*
40111 * Configured EEM with the given number of entries. All the EEM tables
40112 * KEY0, KEY1, RECORD, EFC all have the same number of entries and all
40113 * tables will be configured using this value. Current minimum value
40114 * is 32k. Current maximum value is 128M.
40115 */
40116 uint32_t num_entries;
40117 uint32_t unused_1;
40118 /* Configured EEM with the given context if for KEY0 table. */
40119 uint16_t key0_ctx_id;
40120 /* Configured EEM with the given context if for KEY1 table. */
40121 uint16_t key1_ctx_id;
40122 /* Configured EEM with the given context if for RECORD table. */
40123 uint16_t record_ctx_id;
40124 /* Configured EEM with the given context if for EFC table. */
40125 uint16_t efc_ctx_id;
40126 /* Configured EEM with the given context if for EFC table. */
40127 uint16_t fid_ctx_id;
40128 uint16_t unused_2;
40129 uint32_t unused_3;
40130 } hwrm_cfa_eem_cfg_input_t, *phwrm_cfa_eem_cfg_input_t;
40131
40132 /* hwrm_cfa_eem_cfg_output (size:128b/16B) */
40133
40134 typedef struct hwrm_cfa_eem_cfg_output {
40135 /* The specific error status for the command. */
40136 uint16_t error_code;
40137 /* The HWRM command request type. */
40138 uint16_t req_type;
40139 /* The sequence ID from the original command. */
40140 uint16_t seq_id;
40141 /* The length of the response data in number of bytes. */
40142 uint16_t resp_len;
40143 uint8_t unused_0[7];
40144 /*
40145 * This field is used in Output records to indicate that the output
40146 * is completely written to RAM. This field should be read as '1'
40147 * to indicate that the output has been completely written.
40148 * When writing a command completion or response to an internal
40149 * processor, the order of writes has to be such that this field is
40150 * written last.
40151 */
40152 uint8_t valid;
40153 } hwrm_cfa_eem_cfg_output_t, *phwrm_cfa_eem_cfg_output_t;
40154
40155 /*********************
40156 * hwrm_cfa_eem_qcfg *
40157 *********************/
40158
40159
40160 /* hwrm_cfa_eem_qcfg_input (size:192b/24B) */
40161
40162 typedef struct hwrm_cfa_eem_qcfg_input {
40163 /* The HWRM command request type. */
40164 uint16_t req_type;
40165 /*
40166 * The completion ring to send the completion event on. This should
40167 * be the NQ ID returned from the `nq_alloc` HWRM command.
40168 */
40169 uint16_t cmpl_ring;
40170 /*
40171 * The sequence ID is used by the driver for tracking multiple
40172 * commands. This ID is treated as opaque data by the firmware and
40173 * the value is returned in the `hwrm_resp_hdr` upon completion.
40174 */
40175 uint16_t seq_id;
40176 /*
40177 * The target ID of the command:
40178 * * 0x0-0xFFF8 - The function ID
40179 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40180 * * 0xFFFD - Reserved for user-space HWRM interface
40181 * * 0xFFFF - HWRM
40182 */
40183 uint16_t target_id;
40184 /*
40185 * A physical address pointer pointing to a host buffer that the
40186 * command's response data will be written. This can be either a host
40187 * physical address (HPA) or a guest physical address (GPA) and must
40188 * point to a physically contiguous block of memory.
40189 */
40190 uint64_t resp_addr;
40191 uint32_t flags;
40192 /* When set to 1, indicates the configuration is the TX flow. */
40193 #define HWRM_CFA_EEM_QCFG_INPUT_FLAGS_PATH_TX UINT32_C(0x1)
40194 /* When set to 1, indicates the configuration is the RX flow. */
40195 #define HWRM_CFA_EEM_QCFG_INPUT_FLAGS_PATH_RX UINT32_C(0x2)
40196 uint32_t unused_0;
40197 } hwrm_cfa_eem_qcfg_input_t, *phwrm_cfa_eem_qcfg_input_t;
40198
40199 /* hwrm_cfa_eem_qcfg_output (size:256b/32B) */
40200
40201 typedef struct hwrm_cfa_eem_qcfg_output {
40202 /* The specific error status for the command. */
40203 uint16_t error_code;
40204 /* The HWRM command request type. */
40205 uint16_t req_type;
40206 /* The sequence ID from the original command. */
40207 uint16_t seq_id;
40208 /* The length of the response data in number of bytes. */
40209 uint16_t resp_len;
40210 uint32_t flags;
40211 /* When set to 1, indicates the configuration is the TX flow. */
40212 #define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PATH_TX UINT32_C(0x1)
40213 /* When set to 1, indicates the configuration is the RX flow. */
40214 #define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PATH_RX UINT32_C(0x2)
40215 /* When set to 1, all offloaded flows will be sent to EEM. */
40216 #define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PREFERRED_OFFLOAD UINT32_C(0x4)
40217 /* The number of entries the FW has configured for EEM. */
40218 uint32_t num_entries;
40219 /* Configured EEM with the given context if for KEY0 table. */
40220 uint16_t key0_ctx_id;
40221 /* Configured EEM with the given context if for KEY1 table. */
40222 uint16_t key1_ctx_id;
40223 /* Configured EEM with the given context if for RECORD table. */
40224 uint16_t record_ctx_id;
40225 /* Configured EEM with the given context if for EFC table. */
40226 uint16_t efc_ctx_id;
40227 /* Configured EEM with the given context if for EFC table. */
40228 uint16_t fid_ctx_id;
40229 uint8_t unused_2[5];
40230 /*
40231 * This field is used in Output records to indicate that the output
40232 * is completely written to RAM. This field should be read as '1'
40233 * to indicate that the output has been completely written.
40234 * When writing a command completion or response to an internal
40235 * processor, the order of writes has to be such that this field is
40236 * written last.
40237 */
40238 uint8_t valid;
40239 } hwrm_cfa_eem_qcfg_output_t, *phwrm_cfa_eem_qcfg_output_t;
40240
40241 /*******************
40242 * hwrm_cfa_eem_op *
40243 *******************/
40244
40245
40246 /* hwrm_cfa_eem_op_input (size:192b/24B) */
40247
40248 typedef struct hwrm_cfa_eem_op_input {
40249 /* The HWRM command request type. */
40250 uint16_t req_type;
40251 /*
40252 * The completion ring to send the completion event on. This should
40253 * be the NQ ID returned from the `nq_alloc` HWRM command.
40254 */
40255 uint16_t cmpl_ring;
40256 /*
40257 * The sequence ID is used by the driver for tracking multiple
40258 * commands. This ID is treated as opaque data by the firmware and
40259 * the value is returned in the `hwrm_resp_hdr` upon completion.
40260 */
40261 uint16_t seq_id;
40262 /*
40263 * The target ID of the command:
40264 * * 0x0-0xFFF8 - The function ID
40265 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40266 * * 0xFFFD - Reserved for user-space HWRM interface
40267 * * 0xFFFF - HWRM
40268 */
40269 uint16_t target_id;
40270 /*
40271 * A physical address pointer pointing to a host buffer that the
40272 * command's response data will be written. This can be either a host
40273 * physical address (HPA) or a guest physical address (GPA) and must
40274 * point to a physically contiguous block of memory.
40275 */
40276 uint64_t resp_addr;
40277 uint32_t flags;
40278 /*
40279 * When set to 1, indicates the host memory which is passed will be
40280 * used for the TX flow offload function specified in fid.
40281 * Note if this bit is set then the path_rx bit can't be set.
40282 */
40283 #define HWRM_CFA_EEM_OP_INPUT_FLAGS_PATH_TX UINT32_C(0x1)
40284 /*
40285 * When set to 1, indicates the host memory which is passed will be
40286 * used for the RX flow offload function specified in fid.
40287 * Note if this bit is set then the path_tx bit can't be set.
40288 */
40289 #define HWRM_CFA_EEM_OP_INPUT_FLAGS_PATH_RX UINT32_C(0x2)
40290 uint16_t unused_0;
40291 /* The number of EEM key table entries to be configured. */
40292 uint16_t op;
40293 /* This value is reserved and should not be used. */
40294 #define HWRM_CFA_EEM_OP_INPUT_OP_RESERVED UINT32_C(0x0)
40295 /*
40296 * To properly stop EEM and ensure there are no DMA's, the caller
40297 * must disable EEM for the given PF, using this call. This will
40298 * safely disable EEM and ensure that all DMA'ed to the
40299 * keys/records/efc have been completed.
40300 */
40301 #define HWRM_CFA_EEM_OP_INPUT_OP_EEM_DISABLE UINT32_C(0x1)
40302 /*
40303 * Once the EEM host memory has been configured, EEM options have
40304 * been configured. Then the caller should enable EEM for the given
40305 * PF. Note once this call has been made, then the EEM mechanism
40306 * will be active and DMA's will occur as packets are processed.
40307 */
40308 #define HWRM_CFA_EEM_OP_INPUT_OP_EEM_ENABLE UINT32_C(0x2)
40309 /*
40310 * Clear EEM settings for the given PF so that the register values
40311 * are reset back to there initial state.
40312 */
40313 #define HWRM_CFA_EEM_OP_INPUT_OP_EEM_CLEANUP UINT32_C(0x3)
40314 #define HWRM_CFA_EEM_OP_INPUT_OP_LAST HWRM_CFA_EEM_OP_INPUT_OP_EEM_CLEANUP
40315 } hwrm_cfa_eem_op_input_t, *phwrm_cfa_eem_op_input_t;
40316
40317 /* hwrm_cfa_eem_op_output (size:128b/16B) */
40318
40319 typedef struct hwrm_cfa_eem_op_output {
40320 /* The specific error status for the command. */
40321 uint16_t error_code;
40322 /* The HWRM command request type. */
40323 uint16_t req_type;
40324 /* The sequence ID from the original command. */
40325 uint16_t seq_id;
40326 /* The length of the response data in number of bytes. */
40327 uint16_t resp_len;
40328 uint8_t unused_0[7];
40329 /*
40330 * This field is used in Output records to indicate that the output
40331 * is completely written to RAM. This field should be read as '1'
40332 * to indicate that the output has been completely written.
40333 * When writing a command completion or response to an internal
40334 * processor, the order of writes has to be such that this field is
40335 * written last.
40336 */
40337 uint8_t valid;
40338 } hwrm_cfa_eem_op_output_t, *phwrm_cfa_eem_op_output_t;
40339
40340 /********************************
40341 * hwrm_cfa_adv_flow_mgnt_qcaps *
40342 ********************************/
40343
40344
40345 /* hwrm_cfa_adv_flow_mgnt_qcaps_input (size:256b/32B) */
40346
40347 typedef struct hwrm_cfa_adv_flow_mgnt_qcaps_input {
40348 /* The HWRM command request type. */
40349 uint16_t req_type;
40350 /*
40351 * The completion ring to send the completion event on. This should
40352 * be the NQ ID returned from the `nq_alloc` HWRM command.
40353 */
40354 uint16_t cmpl_ring;
40355 /*
40356 * The sequence ID is used by the driver for tracking multiple
40357 * commands. This ID is treated as opaque data by the firmware and
40358 * the value is returned in the `hwrm_resp_hdr` upon completion.
40359 */
40360 uint16_t seq_id;
40361 /*
40362 * The target ID of the command:
40363 * * 0x0-0xFFF8 - The function ID
40364 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40365 * * 0xFFFD - Reserved for user-space HWRM interface
40366 * * 0xFFFF - HWRM
40367 */
40368 uint16_t target_id;
40369 /*
40370 * A physical address pointer pointing to a host buffer that the
40371 * command's response data will be written. This can be either a host
40372 * physical address (HPA) or a guest physical address (GPA) and must
40373 * point to a physically contiguous block of memory.
40374 */
40375 uint64_t resp_addr;
40376 uint32_t unused_0[4];
40377 } hwrm_cfa_adv_flow_mgnt_qcaps_input_t, *phwrm_cfa_adv_flow_mgnt_qcaps_input_t;
40378
40379 /* hwrm_cfa_adv_flow_mgnt_qcaps_output (size:128b/16B) */
40380
40381 typedef struct hwrm_cfa_adv_flow_mgnt_qcaps_output {
40382 /* The specific error status for the command. */
40383 uint16_t error_code;
40384 /* The HWRM command request type. */
40385 uint16_t req_type;
40386 /* The sequence ID from the original command. */
40387 uint16_t seq_id;
40388 /* The length of the response data in number of bytes. */
40389 uint16_t resp_len;
40390 uint32_t flags;
40391 /*
40392 * Value of 1 to indicate firmware support 16-bit flow handle.
40393 * Value of 0 to indicate firmware not support 16-bit flow handle.
40394 */
40395 #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_HND_16BIT_SUPPORTED UINT32_C(0x1)
40396 /*
40397 * Value of 1 to indicate firmware support 64-bit flow handle.
40398 * Value of 0 to indicate firmware not support 64-bit flow handle.
40399 */
40400 #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_HND_64BIT_SUPPORTED UINT32_C(0x2)
40401 /*
40402 * Value of 1 to indicate firmware support flow batch delete
40403 * operation through HWRM_CFA_FLOW_FLUSH command.
40404 * Value of 0 to indicate that the firmware does not support flow
40405 * batch delete operation.
40406 */
40407 #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_BATCH_DELETE_SUPPORTED UINT32_C(0x4)
40408 /*
40409 * Value of 1 to indicate that the firmware support flow reset all
40410 * operation through HWRM_CFA_FLOW_FLUSH command.
40411 * Value of 0 indicates firmware does not support flow reset all
40412 * operation.
40413 */
40414 #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_RESET_ALL_SUPPORTED UINT32_C(0x8)
40415 /*
40416 * Value of 1 to indicate that firmware supports use of FID as
40417 * dest_id in HWRM_CFA_NTUPLE_ALLOC/CFG commands.
40418 * Value of 0 indicates firmware does not support use of FID as
40419 * dest_id.
40420 */
40421 #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_DEST_FUNC_SUPPORTED UINT32_C(0x10)
40422 /*
40423 * Value of 1 to indicate that firmware supports TX EEM flows.
40424 * Value of 0 indicates firmware does not support TX EEM flows.
40425 */
40426 #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_TX_EEM_FLOW_SUPPORTED UINT32_C(0x20)
40427 /*
40428 * Value of 1 to indicate that firmware supports RX EEM flows.
40429 * Value of 0 indicates firmware does not support RX EEM flows.
40430 */
40431 #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_RX_EEM_FLOW_SUPPORTED UINT32_C(0x40)
40432 /*
40433 * Value of 1 to indicate that firmware supports the dynamic
40434 * allocation of an on-chip flow counter which can be used for EEM
40435 * flows. Value of 0 indicates firmware does not support the dynamic
40436 * allocation of an on-chip flow counter.
40437 */
40438 #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_COUNTER_ALLOC_SUPPORTED UINT32_C(0x80)
40439 /*
40440 * Value of 1 to indicate that firmware supports setting of
40441 * rfs_ring_tbl_idx in HWRM_CFA_NTUPLE_ALLOC command.
40442 * Value of 0 indicates firmware does not support rfs_ring_tbl_idx.
40443 */
40444 #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_RFS_RING_TBL_IDX_SUPPORTED UINT32_C(0x100)
40445 /*
40446 * Value of 1 to indicate that firmware supports untagged matching
40447 * criteria on HWRM_CFA_L2_FILTER_ALLOC command. Value of 0
40448 * indicates firmware does not support untagged matching.
40449 */
40450 #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_UNTAGGED_VLAN_SUPPORTED UINT32_C(0x200)
40451 /*
40452 * Value of 1 to indicate that firmware supports XDP filter. Value
40453 * of 0 indicates firmware does not support XDP filter.
40454 */
40455 #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_XDP_SUPPORTED UINT32_C(0x400)
40456 /*
40457 * Value of 1 to indicate that the firmware support L2 header source
40458 * fields matching criteria on HWRM_CFA_L2_FILTER_ALLOC command.
40459 * Value of 0 indicates firmware does not support L2 header source
40460 * fields matching.
40461 */
40462 #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_L2_HEADER_SOURCE_FIELDS_SUPPORTED UINT32_C(0x800)
40463 /*
40464 * If set to 1, firmware is capable of supporting ARP ethertype as
40465 * matching criteria for HWRM_CFA_NTUPLE_FILTER_ALLOC command on the
40466 * RX direction. By default, this flag should be 0 for older version
40467 * of firmware.
40468 */
40469 #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_RX_ARP_SUPPORTED UINT32_C(0x1000)
40470 /*
40471 * Value of 1 to indicate that firmware supports setting of
40472 * rfs_ring_tbl_idx in dst_id field of the HWRM_CFA_NTUPLE_ALLOC
40473 * command. Value of 0 indicates firmware does not support
40474 * rfs_ring_tbl_idx in dst_id field.
40475 */
40476 #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_RFS_RING_TBL_IDX_V2_SUPPORTED UINT32_C(0x2000)
40477 /*
40478 * If set to 1, firmware is capable of supporting IPv4/IPv6 as
40479 * ethertype in HWRM_CFA_NTUPLE_FILTER_ALLOC command on the RX
40480 * direction. By default, this flag should be 0 for older version
40481 * of firmware.
40482 */
40483 #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_RX_ETHERTYPE_IP_SUPPORTED UINT32_C(0x4000)
40484 /*
40485 * When this bit is '1', it indicates that core firmware is
40486 * capable of TruFlow. Driver can restrict sending HWRM CFA_FLOW_XXX
40487 * and CFA_ENCAP_XXX, CFA_DECAP_XXX commands.
40488 */
40489 #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_TRUFLOW_CAPABLE UINT32_C(0x8000)
40490 /*
40491 * If set to 1, firmware is capable of supporting L2/ROCE as
40492 * traffic type in flags field of HWRM_CFA_L2_FILTER_ALLOC command.
40493 * By default, this flag should be 0 for older version of firmware.
40494 */
40495 #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_L2_FILTER_TRAFFIC_TYPE_L2_ROCE_SUPPORTED UINT32_C(0x10000)
40496 /*
40497 * If set to 1, firmware is capable of HW LAG. This bit is only
40498 * advertised if the calling function is a PAXC function.
40499 */
40500 #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_LAG_SUPPORTED UINT32_C(0x20000)
40501 uint8_t unused_0[3];
40502 /*
40503 * This field is used in Output records to indicate that the output
40504 * is completely written to RAM. This field should be read as '1'
40505 * to indicate that the output has been completely written.
40506 * When writing a command completion or response to an internal
40507 * processor, the order of writes has to be such that this field is
40508 * written last.
40509 */
40510 uint8_t valid;
40511 } hwrm_cfa_adv_flow_mgnt_qcaps_output_t, *phwrm_cfa_adv_flow_mgnt_qcaps_output_t;
40512
40513 /******************
40514 * hwrm_cfa_tflib *
40515 ******************/
40516
40517
40518 /* hwrm_cfa_tflib_input (size:1024b/128B) */
40519
40520 typedef struct hwrm_cfa_tflib_input {
40521 /* The HWRM command request type. */
40522 uint16_t req_type;
40523 /*
40524 * The completion ring to send the completion event on. This should
40525 * be the NQ ID returned from the `nq_alloc` HWRM command.
40526 */
40527 uint16_t cmpl_ring;
40528 /*
40529 * The sequence ID is used by the driver for tracking multiple
40530 * commands. This ID is treated as opaque data by the firmware and
40531 * the value is returned in the `hwrm_resp_hdr` upon completion.
40532 */
40533 uint16_t seq_id;
40534 /*
40535 * The target ID of the command:
40536 * * 0x0-0xFFF8 - The function ID
40537 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40538 * * 0xFFFD - Reserved for user-space HWRM interface
40539 * * 0xFFFF - HWRM
40540 */
40541 uint16_t target_id;
40542 /*
40543 * A physical address pointer pointing to a host buffer that the
40544 * command's response data will be written. This can be either a host
40545 * physical address (HPA) or a guest physical address (GPA) and must
40546 * point to a physically contiguous block of memory.
40547 */
40548 uint64_t resp_addr;
40549 /* TFLIB message type. */
40550 uint16_t tf_type;
40551 /* TFLIB message subtype. */
40552 uint16_t tf_subtype;
40553 /* unused. */
40554 uint8_t unused0[4];
40555 /* TFLIB request data. */
40556 uint32_t tf_req[26];
40557 } hwrm_cfa_tflib_input_t, *phwrm_cfa_tflib_input_t;
40558
40559 /* hwrm_cfa_tflib_output (size:5632b/704B) */
40560
40561 typedef struct hwrm_cfa_tflib_output {
40562 /* The specific error status for the command. */
40563 uint16_t error_code;
40564 /* The HWRM command request type. */
40565 uint16_t req_type;
40566 /* The sequence ID from the original command. */
40567 uint16_t seq_id;
40568 /* The length of the response data in number of bytes. */
40569 uint16_t resp_len;
40570 /* TFLIB message type. */
40571 uint16_t tf_type;
40572 /* TFLIB message subtype. */
40573 uint16_t tf_subtype;
40574 /* TFLIB response code */
40575 uint32_t tf_resp_code;
40576 /* TFLIB response data. */
40577 uint32_t tf_resp[170];
40578 /* unused. */
40579 uint8_t unused1[7];
40580 /*
40581 * This field is used in Output records to indicate that the output
40582 * is completely written to RAM. This field should be read as '1'
40583 * to indicate that the output has been completely written.
40584 * When writing a command completion or response to an internal
40585 * processor, the order of writes has to be such that this field is
40586 * written last.
40587 */
40588 uint8_t valid;
40589 } hwrm_cfa_tflib_output_t, *phwrm_cfa_tflib_output_t;
40590
40591 /**********************************
40592 * hwrm_cfa_lag_group_member_rgtr *
40593 **********************************/
40594
40595
40596 /* hwrm_cfa_lag_group_member_rgtr_input (size:192b/24B) */
40597
40598 typedef struct hwrm_cfa_lag_group_member_rgtr_input {
40599 /* The HWRM command request type. */
40600 uint16_t req_type;
40601 /*
40602 * The completion ring to send the completion event on. This should
40603 * be the NQ ID returned from the `nq_alloc` HWRM command.
40604 */
40605 uint16_t cmpl_ring;
40606 /*
40607 * The sequence ID is used by the driver for tracking multiple
40608 * commands. This ID is treated as opaque data by the firmware and
40609 * the value is returned in the `hwrm_resp_hdr` upon completion.
40610 */
40611 uint16_t seq_id;
40612 /*
40613 * The target ID of the command:
40614 * * 0x0-0xFFF8 - The function ID
40615 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40616 * * 0xFFFD - Reserved for user-space HWRM interface
40617 * * 0xFFFF - HWRM
40618 */
40619 uint16_t target_id;
40620 /*
40621 * A physical address pointer pointing to a host buffer that the
40622 * command's response data will be written. This can be either a host
40623 * physical address (HPA) or a guest physical address (GPA) and must
40624 * point to a physically contiguous block of memory.
40625 */
40626 uint64_t resp_addr;
40627 uint8_t mode;
40628 /*
40629 * Transmit only on the active port. Automatically failover
40630 * to backup port.
40631 */
40632 #define HWRM_CFA_LAG_GROUP_MEMBER_RGTR_INPUT_MODE_ACTIVE_BACKUP UINT32_C(0x1)
40633 /*
40634 * Transmit based on packet header ntuple hash. Packet with only
40635 * layer 2 headers will hash using the destination MAC, source MAC
40636 * and Ethertype fields. Packets with layer 3 (IP) headers will
40637 * hash using the destination MAC, source MAC, IP protocol/next
40638 * header, source IP address and destination IP address. Packets
40639 * with layer 4 (TCP/UDP) headers will hash using the destination
40640 * MAC, source MAC, IP protocol/next header, source IP address,
40641 * destination IP address, source port and destination port fields.
40642 */
40643 #define HWRM_CFA_LAG_GROUP_MEMBER_RGTR_INPUT_MODE_BALANCE_XOR UINT32_C(0x2)
40644 /* Transmit packets on all specified ports. */
40645 #define HWRM_CFA_LAG_GROUP_MEMBER_RGTR_INPUT_MODE_BROADCAST UINT32_C(0x3)
40646 #define HWRM_CFA_LAG_GROUP_MEMBER_RGTR_INPUT_MODE_LAST HWRM_CFA_LAG_GROUP_MEMBER_RGTR_INPUT_MODE_BROADCAST
40647 /*
40648 * Supports up to 5 ports. bit0 = port 0, bit1 = port 1,
40649 * bit2 = port 2, bit3 = port 4, bit4 = loopback port
40650 */
40651 uint8_t port_bitmap;
40652 /* Specify the active port when active-backup mode is specified */
40653 uint8_t active_port;
40654 uint8_t unused_0[5];
40655 } hwrm_cfa_lag_group_member_rgtr_input_t, *phwrm_cfa_lag_group_member_rgtr_input_t;
40656
40657 /* hwrm_cfa_lag_group_member_rgtr_output (size:128b/16B) */
40658
40659 typedef struct hwrm_cfa_lag_group_member_rgtr_output {
40660 /* The specific error status for the command. */
40661 uint16_t error_code;
40662 /* The HWRM command request type. */
40663 uint16_t req_type;
40664 /* The sequence ID from the original command. */
40665 uint16_t seq_id;
40666 /* The length of the response data in number of bytes. */
40667 uint16_t resp_len;
40668 /* lag group ID configured for the function */
40669 uint16_t lag_id;
40670 uint8_t unused_0[5];
40671 /*
40672 * This field is used in Output records to indicate that the output
40673 * is completely written to RAM. This field should be read as '1'
40674 * to indicate that the output has been completely written.
40675 * When writing a command completion or response to an internal
40676 * processor, the order of writes has to be such that this field is
40677 * written last.
40678 */
40679 uint8_t valid;
40680 } hwrm_cfa_lag_group_member_rgtr_output_t, *phwrm_cfa_lag_group_member_rgtr_output_t;
40681
40682 /************************************
40683 * hwrm_cfa_lag_group_member_unrgtr *
40684 ************************************/
40685
40686
40687 /* hwrm_cfa_lag_group_member_unrgtr_input (size:192b/24B) */
40688
40689 typedef struct hwrm_cfa_lag_group_member_unrgtr_input {
40690 /* The HWRM command request type. */
40691 uint16_t req_type;
40692 /*
40693 * The completion ring to send the completion event on. This should
40694 * be the NQ ID returned from the `nq_alloc` HWRM command.
40695 */
40696 uint16_t cmpl_ring;
40697 /*
40698 * The sequence ID is used by the driver for tracking multiple
40699 * commands. This ID is treated as opaque data by the firmware and
40700 * the value is returned in the `hwrm_resp_hdr` upon completion.
40701 */
40702 uint16_t seq_id;
40703 /*
40704 * The target ID of the command:
40705 * * 0x0-0xFFF8 - The function ID
40706 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40707 * * 0xFFFD - Reserved for user-space HWRM interface
40708 * * 0xFFFF - HWRM
40709 */
40710 uint16_t target_id;
40711 /*
40712 * A physical address pointer pointing to a host buffer that the
40713 * command's response data will be written. This can be either a host
40714 * physical address (HPA) or a guest physical address (GPA) and must
40715 * point to a physically contiguous block of memory.
40716 */
40717 uint64_t resp_addr;
40718 /* lag group ID configured for the function */
40719 uint16_t lag_id;
40720 uint8_t unused_0[6];
40721 } hwrm_cfa_lag_group_member_unrgtr_input_t, *phwrm_cfa_lag_group_member_unrgtr_input_t;
40722
40723 /* hwrm_cfa_lag_group_member_unrgtr_output (size:128b/16B) */
40724
40725 typedef struct hwrm_cfa_lag_group_member_unrgtr_output {
40726 /* The specific error status for the command. */
40727 uint16_t error_code;
40728 /* The HWRM command request type. */
40729 uint16_t req_type;
40730 /* The sequence ID from the original command. */
40731 uint16_t seq_id;
40732 /* The length of the response data in number of bytes. */
40733 uint16_t resp_len;
40734 uint8_t unused_0[7];
40735 /*
40736 * This field is used in Output records to indicate that the output
40737 * is completely written to RAM. This field should be read as '1'
40738 * to indicate that the output has been completely written.
40739 * When writing a command completion or response to an internal
40740 * processor, the order of writes has to be such that this field is
40741 * written last.
40742 */
40743 uint8_t valid;
40744 } hwrm_cfa_lag_group_member_unrgtr_output_t, *phwrm_cfa_lag_group_member_unrgtr_output_t;
40745
40746 /***********
40747 * hwrm_tf *
40748 ***********/
40749
40750
40751 /* hwrm_tf_input (size:1024b/128B) */
40752
40753 typedef struct hwrm_tf_input {
40754 /* The HWRM command request type. */
40755 uint16_t req_type;
40756 /*
40757 * The completion ring to send the completion event on. This should
40758 * be the NQ ID returned from the `nq_alloc` HWRM command.
40759 */
40760 uint16_t cmpl_ring;
40761 /*
40762 * The sequence ID is used by the driver for tracking multiple
40763 * commands. This ID is treated as opaque data by the firmware and
40764 * the value is returned in the `hwrm_resp_hdr` upon completion.
40765 */
40766 uint16_t seq_id;
40767 /*
40768 * The target ID of the command:
40769 * * 0x0-0xFFF8 - The function ID
40770 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40771 * * 0xFFFD - Reserved for user-space HWRM interface
40772 * * 0xFFFF - HWRM
40773 */
40774 uint16_t target_id;
40775 /*
40776 * A physical address pointer pointing to a host buffer that the
40777 * command's response data will be written. This can be either a host
40778 * physical address (HPA) or a guest physical address (GPA) and must
40779 * point to a physically contiguous block of memory.
40780 */
40781 uint64_t resp_addr;
40782 /* TF message type. */
40783 uint16_t type;
40784 /* TF message subtype. */
40785 uint16_t subtype;
40786 /* unused. */
40787 uint8_t unused0[4];
40788 /* TF request data. */
40789 uint32_t req[26];
40790 } hwrm_tf_input_t, *phwrm_tf_input_t;
40791
40792 /* hwrm_tf_output (size:5632b/704B) */
40793
40794 typedef struct hwrm_tf_output {
40795 /* The specific error status for the command. */
40796 uint16_t error_code;
40797 /* The HWRM command request type. */
40798 uint16_t req_type;
40799 /* The sequence ID from the original command. */
40800 uint16_t seq_id;
40801 /* The length of the response data in number of bytes. */
40802 uint16_t resp_len;
40803 /* TF message type. */
40804 uint16_t type;
40805 /* TF message subtype. */
40806 uint16_t subtype;
40807 /* TF response code */
40808 uint32_t resp_code;
40809 /* TF response data. */
40810 uint32_t resp[170];
40811 /* unused. */
40812 uint8_t unused1[7];
40813 /*
40814 * This field is used in Output records to indicate that the
40815 * output is completely written to RAM. This field should be
40816 * read as '1' to indicate that the output has been
40817 * completely written. When writing a command completion or
40818 * response to an internal processor, the order of writes has
40819 * to be such that this field is written last.
40820 */
40821 uint8_t valid;
40822 } hwrm_tf_output_t, *phwrm_tf_output_t;
40823
40824 /***********************
40825 * hwrm_tf_version_get *
40826 ***********************/
40827
40828
40829 /* hwrm_tf_version_get_input (size:128b/16B) */
40830
40831 typedef struct hwrm_tf_version_get_input {
40832 /* The HWRM command request type. */
40833 uint16_t req_type;
40834 /*
40835 * The completion ring to send the completion event on. This should
40836 * be the NQ ID returned from the `nq_alloc` HWRM command.
40837 */
40838 uint16_t cmpl_ring;
40839 /*
40840 * The sequence ID is used by the driver for tracking multiple
40841 * commands. This ID is treated as opaque data by the firmware and
40842 * the value is returned in the `hwrm_resp_hdr` upon completion.
40843 */
40844 uint16_t seq_id;
40845 /*
40846 * The target ID of the command:
40847 * * 0x0-0xFFF8 - The function ID
40848 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40849 * * 0xFFFD - Reserved for user-space HWRM interface
40850 * * 0xFFFF - HWRM
40851 */
40852 uint16_t target_id;
40853 /*
40854 * A physical address pointer pointing to a host buffer that the
40855 * command's response data will be written. This can be either a host
40856 * physical address (HPA) or a guest physical address (GPA) and must
40857 * point to a physically contiguous block of memory.
40858 */
40859 uint64_t resp_addr;
40860 } hwrm_tf_version_get_input_t, *phwrm_tf_version_get_input_t;
40861
40862 /* hwrm_tf_version_get_output (size:128b/16B) */
40863
40864 typedef struct hwrm_tf_version_get_output {
40865 /* The specific error status for the command. */
40866 uint16_t error_code;
40867 /* The HWRM command request type. */
40868 uint16_t req_type;
40869 /* The sequence ID from the original command. */
40870 uint16_t seq_id;
40871 /* The length of the response data in number of bytes. */
40872 uint16_t resp_len;
40873 /* Version Major number. */
40874 uint8_t major;
40875 /* Version Minor number. */
40876 uint8_t minor;
40877 /* Version Update number. */
40878 uint8_t update;
40879 /* unused. */
40880 uint8_t unused0[4];
40881 /*
40882 * This field is used in Output records to indicate that the output
40883 * is completely written to RAM. This field should be read as '1'
40884 * to indicate that the output has been completely written.
40885 * When writing a command completion or response to an internal
40886 * processor, the order of writes has to be such that this field is
40887 * written last.
40888 */
40889 uint8_t valid;
40890 } hwrm_tf_version_get_output_t, *phwrm_tf_version_get_output_t;
40891
40892 /************************
40893 * hwrm_tf_session_open *
40894 ************************/
40895
40896
40897 /* hwrm_tf_session_open_input (size:640b/80B) */
40898
40899 typedef struct hwrm_tf_session_open_input {
40900 /* The HWRM command request type. */
40901 uint16_t req_type;
40902 /*
40903 * The completion ring to send the completion event on. This should
40904 * be the NQ ID returned from the `nq_alloc` HWRM command.
40905 */
40906 uint16_t cmpl_ring;
40907 /*
40908 * The sequence ID is used by the driver for tracking multiple
40909 * commands. This ID is treated as opaque data by the firmware and
40910 * the value is returned in the `hwrm_resp_hdr` upon completion.
40911 */
40912 uint16_t seq_id;
40913 /*
40914 * The target ID of the command:
40915 * * 0x0-0xFFF8 - The function ID
40916 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40917 * * 0xFFFD - Reserved for user-space HWRM interface
40918 * * 0xFFFF - HWRM
40919 */
40920 uint16_t target_id;
40921 /*
40922 * A physical address pointer pointing to a host buffer that the
40923 * command's response data will be written. This can be either a host
40924 * physical address (HPA) or a guest physical address (GPA) and must
40925 * point to a physically contiguous block of memory.
40926 */
40927 uint64_t resp_addr;
40928 /* Name of the session. */
40929 uint8_t session_name[64];
40930 } hwrm_tf_session_open_input_t, *phwrm_tf_session_open_input_t;
40931
40932 /* hwrm_tf_session_open_output (size:192b/24B) */
40933
40934 typedef struct hwrm_tf_session_open_output {
40935 /* The specific error status for the command. */
40936 uint16_t error_code;
40937 /* The HWRM command request type. */
40938 uint16_t req_type;
40939 /* The sequence ID from the original command. */
40940 uint16_t seq_id;
40941 /* The length of the response data in number of bytes. */
40942 uint16_t resp_len;
40943 /*
40944 * Unique session identifier for the session created by the
40945 * firmware.
40946 */
40947 uint32_t fw_session_id;
40948 /*
40949 * Unique session client identifier for the first client on
40950 * the newly created session.
40951 */
40952 uint32_t fw_session_client_id;
40953 /* This field is used to return the status of fw session to host. */
40954 uint32_t flags;
40955 /*
40956 * Indicates if the shared session has been created. Shared seesion
40957 * should be the first session created ever. Its fw_rm_client_id
40958 * should be 1. The AFM session's fw_rm_client_id is 0.
40959 */
40960 #define HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION UINT32_C(0x1)
40961 /*
40962 * If this bit set to 0, then it indicates the shared session
40963 * has been created by another session.
40964 */
40965 #define HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION_NOT_CREATOR UINT32_C(0x0)
40966 /*
40967 * If this bit is set to 1, then it indicates the shared session
40968 * is created by this session.
40969 */
40970 #define HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION_CREATOR UINT32_C(0x1)
40971 #define HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION_LAST HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION_CREATOR
40972 /* unused. */
40973 uint8_t unused1[3];
40974 /*
40975 * This field is used in Output records to indicate that the output
40976 * is completely written to RAM. This field should be read as '1'
40977 * to indicate that the output has been completely written.
40978 * When writing a command completion or response to an internal
40979 * processor, the order of writes has to be such that this field is
40980 * written last.
40981 */
40982 uint8_t valid;
40983 } hwrm_tf_session_open_output_t, *phwrm_tf_session_open_output_t;
40984
40985 /**************************
40986 * hwrm_tf_session_attach *
40987 **************************/
40988
40989
40990 /* hwrm_tf_session_attach_input (size:704b/88B) */
40991
40992 typedef struct hwrm_tf_session_attach_input {
40993 /* The HWRM command request type. */
40994 uint16_t req_type;
40995 /*
40996 * The completion ring to send the completion event on. This should
40997 * be the NQ ID returned from the `nq_alloc` HWRM command.
40998 */
40999 uint16_t cmpl_ring;
41000 /*
41001 * The sequence ID is used by the driver for tracking multiple
41002 * commands. This ID is treated as opaque data by the firmware and
41003 * the value is returned in the `hwrm_resp_hdr` upon completion.
41004 */
41005 uint16_t seq_id;
41006 /*
41007 * The target ID of the command:
41008 * * 0x0-0xFFF8 - The function ID
41009 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41010 * * 0xFFFD - Reserved for user-space HWRM interface
41011 * * 0xFFFF - HWRM
41012 */
41013 uint16_t target_id;
41014 /*
41015 * A physical address pointer pointing to a host buffer that the
41016 * command's response data will be written. This can be either a host
41017 * physical address (HPA) or a guest physical address (GPA) and must
41018 * point to a physically contiguous block of memory.
41019 */
41020 uint64_t resp_addr;
41021 /*
41022 * Unique session identifier for the session that the attach
41023 * request want to attach to. This value originates from the
41024 * shared session memory that the attach request opened by
41025 * way of the 'attach name' that was passed in to the core
41026 * attach API.
41027 * The fw_session_id of the attach session includes PCIe bus
41028 * info to distinguish the PF and session info to identify
41029 * the associated TruFlow session.
41030 */
41031 uint32_t attach_fw_session_id;
41032 /* unused. */
41033 uint32_t unused0;
41034 /* Name of the session it self. */
41035 uint8_t session_name[64];
41036 } hwrm_tf_session_attach_input_t, *phwrm_tf_session_attach_input_t;
41037
41038 /* hwrm_tf_session_attach_output (size:128b/16B) */
41039
41040 typedef struct hwrm_tf_session_attach_output {
41041 /* The specific error status for the command. */
41042 uint16_t error_code;
41043 /* The HWRM command request type. */
41044 uint16_t req_type;
41045 /* The sequence ID from the original command. */
41046 uint16_t seq_id;
41047 /* The length of the response data in number of bytes. */
41048 uint16_t resp_len;
41049 /*
41050 * Unique session identifier for the session created by the
41051 * firmware. It includes PCIe bus info to distinguish the PF
41052 * and session info to identify the associated TruFlow
41053 * session. This fw_session_id is unique to the attach
41054 * request.
41055 */
41056 uint32_t fw_session_id;
41057 /* unused. */
41058 uint8_t unused0[3];
41059 /*
41060 * This field is used in Output records to indicate that the output
41061 * is completely written to RAM. This field should be read as '1'
41062 * to indicate that the output has been completely written.
41063 * When writing a command completion or response to an internal
41064 * processor, the order of writes has to be such that this field is
41065 * written last.
41066 */
41067 uint8_t valid;
41068 } hwrm_tf_session_attach_output_t, *phwrm_tf_session_attach_output_t;
41069
41070 /****************************
41071 * hwrm_tf_session_register *
41072 ****************************/
41073
41074
41075 /* hwrm_tf_session_register_input (size:704b/88B) */
41076
41077 typedef struct hwrm_tf_session_register_input {
41078 /* The HWRM command request type. */
41079 uint16_t req_type;
41080 /*
41081 * The completion ring to send the completion event on. This should
41082 * be the NQ ID returned from the `nq_alloc` HWRM command.
41083 */
41084 uint16_t cmpl_ring;
41085 /*
41086 * The sequence ID is used by the driver for tracking multiple
41087 * commands. This ID is treated as opaque data by the firmware and
41088 * the value is returned in the `hwrm_resp_hdr` upon completion.
41089 */
41090 uint16_t seq_id;
41091 /*
41092 * The target ID of the command:
41093 * * 0x0-0xFFF8 - The function ID
41094 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41095 * * 0xFFFD - Reserved for user-space HWRM interface
41096 * * 0xFFFF - HWRM
41097 */
41098 uint16_t target_id;
41099 /*
41100 * A physical address pointer pointing to a host buffer that the
41101 * command's response data will be written. This can be either a host
41102 * physical address (HPA) or a guest physical address (GPA) and must
41103 * point to a physically contiguous block of memory.
41104 */
41105 uint64_t resp_addr;
41106 /*
41107 * Unique session identifier for the session that the
41108 * register request want to create a new client on. This
41109 * value originates from the first open request.
41110 * The fw_session_id of the attach session includes PCIe bus
41111 * info to distinguish the PF and session info to identify
41112 * the associated TruFlow session.
41113 */
41114 uint32_t fw_session_id;
41115 /* unused. */
41116 uint32_t unused0;
41117 /* Name of the session client. */
41118 uint8_t session_client_name[64];
41119 } hwrm_tf_session_register_input_t, *phwrm_tf_session_register_input_t;
41120
41121 /* hwrm_tf_session_register_output (size:128b/16B) */
41122
41123 typedef struct hwrm_tf_session_register_output {
41124 /* The specific error status for the command. */
41125 uint16_t error_code;
41126 /* The HWRM command request type. */
41127 uint16_t req_type;
41128 /* The sequence ID from the original command. */
41129 uint16_t seq_id;
41130 /* The length of the response data in number of bytes. */
41131 uint16_t resp_len;
41132 /*
41133 * Unique session client identifier for the session created
41134 * by the firmware. It includes the session the client it
41135 * attached to and session client info.
41136 */
41137 uint32_t fw_session_client_id;
41138 /* unused. */
41139 uint8_t unused0[3];
41140 /*
41141 * This field is used in Output records to indicate that the output
41142 * is completely written to RAM. This field should be read as '1'
41143 * to indicate that the output has been completely written.
41144 * When writing a command completion or response to an internal
41145 * processor, the order of writes has to be such that this field is
41146 * written last.
41147 */
41148 uint8_t valid;
41149 } hwrm_tf_session_register_output_t, *phwrm_tf_session_register_output_t;
41150
41151 /******************************
41152 * hwrm_tf_session_unregister *
41153 ******************************/
41154
41155
41156 /* hwrm_tf_session_unregister_input (size:192b/24B) */
41157
41158 typedef struct hwrm_tf_session_unregister_input {
41159 /* The HWRM command request type. */
41160 uint16_t req_type;
41161 /*
41162 * The completion ring to send the completion event on. This should
41163 * be the NQ ID returned from the `nq_alloc` HWRM command.
41164 */
41165 uint16_t cmpl_ring;
41166 /*
41167 * The sequence ID is used by the driver for tracking multiple
41168 * commands. This ID is treated as opaque data by the firmware and
41169 * the value is returned in the `hwrm_resp_hdr` upon completion.
41170 */
41171 uint16_t seq_id;
41172 /*
41173 * The target ID of the command:
41174 * * 0x0-0xFFF8 - The function ID
41175 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41176 * * 0xFFFD - Reserved for user-space HWRM interface
41177 * * 0xFFFF - HWRM
41178 */
41179 uint16_t target_id;
41180 /*
41181 * A physical address pointer pointing to a host buffer that the
41182 * command's response data will be written. This can be either a host
41183 * physical address (HPA) or a guest physical address (GPA) and must
41184 * point to a physically contiguous block of memory.
41185 */
41186 uint64_t resp_addr;
41187 /*
41188 * Unique session identifier for the session that the
41189 * unregister request want to close a session client on.
41190 */
41191 uint32_t fw_session_id;
41192 /*
41193 * Unique session client identifier for the session that the
41194 * unregister request want to close.
41195 */
41196 uint32_t fw_session_client_id;
41197 } hwrm_tf_session_unregister_input_t, *phwrm_tf_session_unregister_input_t;
41198
41199 /* hwrm_tf_session_unregister_output (size:128b/16B) */
41200
41201 typedef struct hwrm_tf_session_unregister_output {
41202 /* The specific error status for the command. */
41203 uint16_t error_code;
41204 /* The HWRM command request type. */
41205 uint16_t req_type;
41206 /* The sequence ID from the original command. */
41207 uint16_t seq_id;
41208 /* The length of the response data in number of bytes. */
41209 uint16_t resp_len;
41210 /* unused. */
41211 uint8_t unused0[7];
41212 /*
41213 * This field is used in Output records to indicate that the output
41214 * is completely written to RAM. This field should be read as '1'
41215 * to indicate that the output has been completely written.
41216 * When writing a command completion or response to an internal
41217 * processor, the order of writes has to be such that this field is
41218 * written last.
41219 */
41220 uint8_t valid;
41221 } hwrm_tf_session_unregister_output_t, *phwrm_tf_session_unregister_output_t;
41222
41223 /*************************
41224 * hwrm_tf_session_close *
41225 *************************/
41226
41227
41228 /* hwrm_tf_session_close_input (size:192b/24B) */
41229
41230 typedef struct hwrm_tf_session_close_input {
41231 /* The HWRM command request type. */
41232 uint16_t req_type;
41233 /*
41234 * The completion ring to send the completion event on. This should
41235 * be the NQ ID returned from the `nq_alloc` HWRM command.
41236 */
41237 uint16_t cmpl_ring;
41238 /*
41239 * The sequence ID is used by the driver for tracking multiple
41240 * commands. This ID is treated as opaque data by the firmware and
41241 * the value is returned in the `hwrm_resp_hdr` upon completion.
41242 */
41243 uint16_t seq_id;
41244 /*
41245 * The target ID of the command:
41246 * * 0x0-0xFFF8 - The function ID
41247 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41248 * * 0xFFFD - Reserved for user-space HWRM interface
41249 * * 0xFFFF - HWRM
41250 */
41251 uint16_t target_id;
41252 /*
41253 * A physical address pointer pointing to a host buffer that the
41254 * command's response data will be written. This can be either a host
41255 * physical address (HPA) or a guest physical address (GPA) and must
41256 * point to a physically contiguous block of memory.
41257 */
41258 uint64_t resp_addr;
41259 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
41260 uint32_t fw_session_id;
41261 /* unused. */
41262 uint8_t unused0[4];
41263 } hwrm_tf_session_close_input_t, *phwrm_tf_session_close_input_t;
41264
41265 /* hwrm_tf_session_close_output (size:128b/16B) */
41266
41267 typedef struct hwrm_tf_session_close_output {
41268 /* The specific error status for the command. */
41269 uint16_t error_code;
41270 /* The HWRM command request type. */
41271 uint16_t req_type;
41272 /* The sequence ID from the original command. */
41273 uint16_t seq_id;
41274 /* The length of the response data in number of bytes. */
41275 uint16_t resp_len;
41276 /* unused. */
41277 uint8_t unused0[7];
41278 /*
41279 * This field is used in Output records to indicate that the output
41280 * is completely written to RAM. This field should be read as '1'
41281 * to indicate that the output has been completely written.
41282 * When writing a command completion or response to an internal
41283 * processor, the order of writes has to be such that this field
41284 * is written last.
41285 */
41286 uint8_t valid;
41287 } hwrm_tf_session_close_output_t, *phwrm_tf_session_close_output_t;
41288
41289 /************************
41290 * hwrm_tf_session_qcfg *
41291 ************************/
41292
41293
41294 /* hwrm_tf_session_qcfg_input (size:192b/24B) */
41295
41296 typedef struct hwrm_tf_session_qcfg_input {
41297 /* The HWRM command request type. */
41298 uint16_t req_type;
41299 /*
41300 * The completion ring to send the completion event on. This should
41301 * be the NQ ID returned from the `nq_alloc` HWRM command.
41302 */
41303 uint16_t cmpl_ring;
41304 /*
41305 * The sequence ID is used by the driver for tracking multiple
41306 * commands. This ID is treated as opaque data by the firmware and
41307 * the value is returned in the `hwrm_resp_hdr` upon completion.
41308 */
41309 uint16_t seq_id;
41310 /*
41311 * The target ID of the command:
41312 * * 0x0-0xFFF8 - The function ID
41313 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41314 * * 0xFFFD - Reserved for user-space HWRM interface
41315 * * 0xFFFF - HWRM
41316 */
41317 uint16_t target_id;
41318 /*
41319 * A physical address pointer pointing to a host buffer that the
41320 * command's response data will be written. This can be either a host
41321 * physical address (HPA) or a guest physical address (GPA) and must
41322 * point to a physically contiguous block of memory.
41323 */
41324 uint64_t resp_addr;
41325 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
41326 uint32_t fw_session_id;
41327 /* unused. */
41328 uint8_t unused0[4];
41329 } hwrm_tf_session_qcfg_input_t, *phwrm_tf_session_qcfg_input_t;
41330
41331 /* hwrm_tf_session_qcfg_output (size:128b/16B) */
41332
41333 typedef struct hwrm_tf_session_qcfg_output {
41334 /* The specific error status for the command. */
41335 uint16_t error_code;
41336 /* The HWRM command request type. */
41337 uint16_t req_type;
41338 /* The sequence ID from the original command. */
41339 uint16_t seq_id;
41340 /* The length of the response data in number of bytes. */
41341 uint16_t resp_len;
41342 /* RX action control settings flags. */
41343 uint8_t rx_act_flags;
41344 /*
41345 * A value of 1 in this field indicates that Global Flow ID
41346 * reporting into cfa_code and cfa_metadata is enabled.
41347 */
41348 #define HWRM_TF_SESSION_QCFG_OUTPUT_RX_ACT_FLAGS_ABCR_GFID_EN UINT32_C(0x1)
41349 /*
41350 * A value of 1 in this field indicates that both inner and outer
41351 * are stripped and inner tag is passed.
41352 * Enabled.
41353 */
41354 #define HWRM_TF_SESSION_QCFG_OUTPUT_RX_ACT_FLAGS_ABCR_VTAG_DLT_BOTH UINT32_C(0x2)
41355 /*
41356 * A value of 1 in this field indicates that the re-use of
41357 * existing tunnel L2 header SMAC is enabled for
41358 * Non-tunnel L2, L2-L3 and IP-IP tunnel.
41359 */
41360 #define HWRM_TF_SESSION_QCFG_OUTPUT_RX_ACT_FLAGS_TECT_SMAC_OVR_RUTNSL2 UINT32_C(0x4)
41361 /* TX Action control settings flags. */
41362 uint8_t tx_act_flags;
41363 /* Disabled. */
41364 #define HWRM_TF_SESSION_QCFG_OUTPUT_TX_ACT_FLAGS_ABCR_VEB_EN UINT32_C(0x1)
41365 /*
41366 * When set to 1 any GRE tunnels will include the
41367 * optional Key field.
41368 */
41369 #define HWRM_TF_SESSION_QCFG_OUTPUT_TX_ACT_FLAGS_TECT_GRE_SET_K UINT32_C(0x2)
41370 /*
41371 * When set to 1, for GRE tunnels, the IPV6 Traffic Class (TC)
41372 * field of the outer header is inherited from the inner header
41373 * (if present) or the fixed value as taken from the encap
41374 * record.
41375 */
41376 #define HWRM_TF_SESSION_QCFG_OUTPUT_TX_ACT_FLAGS_TECT_IPV6_TC_IH UINT32_C(0x4)
41377 /*
41378 * When set to 1, for GRE tunnels, the IPV4 Type Of Service (TOS)
41379 * field of the outer header is inherited from the inner header
41380 * (if present) or the fixed value as taken from the encap record.
41381 */
41382 #define HWRM_TF_SESSION_QCFG_OUTPUT_TX_ACT_FLAGS_TECT_IPV4_TOS_IH UINT32_C(0x8)
41383 /* unused. */
41384 uint8_t unused0[5];
41385 /*
41386 * This field is used in Output records to indicate that the output
41387 * is completely written to RAM. This field should be read as '1'
41388 * to indicate that the output has been completely written.
41389 * When writing a command completion or response to an internal
41390 * processor, the order of writes has to be such that this field
41391 * is written last.
41392 */
41393 uint8_t valid;
41394 } hwrm_tf_session_qcfg_output_t, *phwrm_tf_session_qcfg_output_t;
41395
41396 /******************************
41397 * hwrm_tf_session_resc_qcaps *
41398 ******************************/
41399
41400
41401 /* hwrm_tf_session_resc_qcaps_input (size:256b/32B) */
41402
41403 typedef struct hwrm_tf_session_resc_qcaps_input {
41404 /* The HWRM command request type. */
41405 uint16_t req_type;
41406 /*
41407 * The completion ring to send the completion event on. This should
41408 * be the NQ ID returned from the `nq_alloc` HWRM command.
41409 */
41410 uint16_t cmpl_ring;
41411 /*
41412 * The sequence ID is used by the driver for tracking multiple
41413 * commands. This ID is treated as opaque data by the firmware and
41414 * the value is returned in the `hwrm_resp_hdr` upon completion.
41415 */
41416 uint16_t seq_id;
41417 /*
41418 * The target ID of the command:
41419 * * 0x0-0xFFF8 - The function ID
41420 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41421 * * 0xFFFD - Reserved for user-space HWRM interface
41422 * * 0xFFFF - HWRM
41423 */
41424 uint16_t target_id;
41425 /*
41426 * A physical address pointer pointing to a host buffer that the
41427 * command's response data will be written. This can be either a host
41428 * physical address (HPA) or a guest physical address (GPA) and must
41429 * point to a physically contiguous block of memory.
41430 */
41431 uint64_t resp_addr;
41432 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
41433 uint32_t fw_session_id;
41434 /* Control flags. */
41435 uint16_t flags;
41436 /* Indicates the flow direction. */
41437 #define HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR UINT32_C(0x1)
41438 /* If this bit set to 0, then it indicates rx flow. */
41439 #define HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_RX UINT32_C(0x0)
41440 /* If this bit is set to 1, then it indicates tx flow. */
41441 #define HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_TX UINT32_C(0x1)
41442 #define HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_LAST HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_TX
41443 /*
41444 * Defines the size of the provided qcaps_addr array
41445 * buffer. The size should be set to the Resource Manager
41446 * provided max number of qcaps entries which is device
41447 * specific. Resource Manager gets the max size from HCAPI
41448 * RM.
41449 */
41450 uint16_t qcaps_size;
41451 /*
41452 * This is the DMA address for the qcaps output data array
41453 * buffer. Array is of tf_rm_resc_req_entry type and is
41454 * device specific.
41455 */
41456 uint64_t qcaps_addr;
41457 } hwrm_tf_session_resc_qcaps_input_t, *phwrm_tf_session_resc_qcaps_input_t;
41458
41459 /* hwrm_tf_session_resc_qcaps_output (size:192b/24B) */
41460
41461 typedef struct hwrm_tf_session_resc_qcaps_output {
41462 /* The specific error status for the command. */
41463 uint16_t error_code;
41464 /* The HWRM command request type. */
41465 uint16_t req_type;
41466 /* The sequence ID from the original command. */
41467 uint16_t seq_id;
41468 /* The length of the response data in number of bytes. */
41469 uint16_t resp_len;
41470 /* Control flags. */
41471 uint32_t flags;
41472 /* Session reservation strategy. */
41473 #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_MASK UINT32_C(0x3)
41474 #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_SFT 0
41475 /* Static partitioning. */
41476 #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_STATIC UINT32_C(0x0)
41477 /* Strategy 1. */
41478 #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_1 UINT32_C(0x1)
41479 /* Strategy 2. */
41480 #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_2 UINT32_C(0x2)
41481 /* Strategy 3. */
41482 #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_3 UINT32_C(0x3)
41483 #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_LAST HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_3
41484 /*
41485 * Size of the returned qcaps_addr data array buffer. The
41486 * value cannot exceed the size defined by the input msg,
41487 * qcaps_size.
41488 */
41489 uint16_t size;
41490 /* unused. */
41491 uint16_t unused0;
41492 /* unused. */
41493 uint8_t unused1[7];
41494 /*
41495 * This field is used in Output records to indicate that the output
41496 * is completely written to RAM. This field should be read as '1'
41497 * to indicate that the output has been completely written.
41498 * When writing a command completion or response to an internal
41499 * processor, the order of writes has to be such that this field is
41500 * written last.
41501 */
41502 uint8_t valid;
41503 } hwrm_tf_session_resc_qcaps_output_t, *phwrm_tf_session_resc_qcaps_output_t;
41504
41505 /******************************
41506 * hwrm_tf_session_resc_alloc *
41507 ******************************/
41508
41509
41510 /* hwrm_tf_session_resc_alloc_input (size:320b/40B) */
41511
41512 typedef struct hwrm_tf_session_resc_alloc_input {
41513 /* The HWRM command request type. */
41514 uint16_t req_type;
41515 /*
41516 * The completion ring to send the completion event on. This should
41517 * be the NQ ID returned from the `nq_alloc` HWRM command.
41518 */
41519 uint16_t cmpl_ring;
41520 /*
41521 * The sequence ID is used by the driver for tracking multiple
41522 * commands. This ID is treated as opaque data by the firmware and
41523 * the value is returned in the `hwrm_resp_hdr` upon completion.
41524 */
41525 uint16_t seq_id;
41526 /*
41527 * The target ID of the command:
41528 * * 0x0-0xFFF8 - The function ID
41529 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41530 * * 0xFFFD - Reserved for user-space HWRM interface
41531 * * 0xFFFF - HWRM
41532 */
41533 uint16_t target_id;
41534 /*
41535 * A physical address pointer pointing to a host buffer that the
41536 * command's response data will be written. This can be either a host
41537 * physical address (HPA) or a guest physical address (GPA) and must
41538 * point to a physically contiguous block of memory.
41539 */
41540 uint64_t resp_addr;
41541 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
41542 uint32_t fw_session_id;
41543 /* Control flags. */
41544 uint16_t flags;
41545 /* Indicates the flow direction. */
41546 #define HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR UINT32_C(0x1)
41547 /* If this bit set to 0, then it indicates rx flow. */
41548 #define HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_RX UINT32_C(0x0)
41549 /* If this bit is set to 1, then it indicates tx flow. */
41550 #define HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_TX UINT32_C(0x1)
41551 #define HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_LAST HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_TX
41552 /*
41553 * Defines the array size of the provided req_addr and
41554 * resv_addr array buffers. Should be set to the number of
41555 * request entries.
41556 */
41557 uint16_t req_size;
41558 /*
41559 * This is the DMA address for the request input data array
41560 * buffer. Array is of tf_rm_resc_req_entry type. Size of the
41561 * array buffer is provided by the 'req_size' field in this
41562 * message.
41563 */
41564 uint64_t req_addr;
41565 /*
41566 * This is the DMA address for the resc output data array
41567 * buffer. Array is of tf_rm_resc_entry type. Size of the array
41568 * buffer is provided by the 'req_size' field in this
41569 * message.
41570 */
41571 uint64_t resc_addr;
41572 } hwrm_tf_session_resc_alloc_input_t, *phwrm_tf_session_resc_alloc_input_t;
41573
41574 /* hwrm_tf_session_resc_alloc_output (size:128b/16B) */
41575
41576 typedef struct hwrm_tf_session_resc_alloc_output {
41577 /* The specific error status for the command. */
41578 uint16_t error_code;
41579 /* The HWRM command request type. */
41580 uint16_t req_type;
41581 /* The sequence ID from the original command. */
41582 uint16_t seq_id;
41583 /* The length of the response data in number of bytes. */
41584 uint16_t resp_len;
41585 /*
41586 * Size of the returned tf_rm_resc_entry data array. The value
41587 * cannot exceed the req_size defined by the input msg. The data
41588 * array is returned using the resv_addr specified DMA
41589 * address also provided by the input msg.
41590 */
41591 uint16_t size;
41592 /* unused. */
41593 uint8_t unused0[5];
41594 /*
41595 * This field is used in Output records to indicate that the output
41596 * is completely written to RAM. This field should be read as '1'
41597 * to indicate that the output has been completely written.
41598 * When writing a command completion or response to an internal
41599 * processor, the order of writes has to be such that this field is
41600 * written last.
41601 */
41602 uint8_t valid;
41603 } hwrm_tf_session_resc_alloc_output_t, *phwrm_tf_session_resc_alloc_output_t;
41604
41605 /*****************************
41606 * hwrm_tf_session_resc_free *
41607 *****************************/
41608
41609
41610 /* hwrm_tf_session_resc_free_input (size:256b/32B) */
41611
41612 typedef struct hwrm_tf_session_resc_free_input {
41613 /* The HWRM command request type. */
41614 uint16_t req_type;
41615 /*
41616 * The completion ring to send the completion event on. This should
41617 * be the NQ ID returned from the `nq_alloc` HWRM command.
41618 */
41619 uint16_t cmpl_ring;
41620 /*
41621 * The sequence ID is used by the driver for tracking multiple
41622 * commands. This ID is treated as opaque data by the firmware and
41623 * the value is returned in the `hwrm_resp_hdr` upon completion.
41624 */
41625 uint16_t seq_id;
41626 /*
41627 * The target ID of the command:
41628 * * 0x0-0xFFF8 - The function ID
41629 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41630 * * 0xFFFD - Reserved for user-space HWRM interface
41631 * * 0xFFFF - HWRM
41632 */
41633 uint16_t target_id;
41634 /*
41635 * A physical address pointer pointing to a host buffer that the
41636 * command's response data will be written. This can be either a host
41637 * physical address (HPA) or a guest physical address (GPA) and must
41638 * point to a physically contiguous block of memory.
41639 */
41640 uint64_t resp_addr;
41641 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
41642 uint32_t fw_session_id;
41643 /* Control flags. */
41644 uint16_t flags;
41645 /* Indicates the flow direction. */
41646 #define HWRM_TF_SESSION_RESC_FREE_INPUT_FLAGS_DIR UINT32_C(0x1)
41647 /* If this bit set to 0, then it indicates rx flow. */
41648 #define HWRM_TF_SESSION_RESC_FREE_INPUT_FLAGS_DIR_RX UINT32_C(0x0)
41649 /* If this bit is set to 1, then it indicates tx flow. */
41650 #define HWRM_TF_SESSION_RESC_FREE_INPUT_FLAGS_DIR_TX UINT32_C(0x1)
41651 #define HWRM_TF_SESSION_RESC_FREE_INPUT_FLAGS_DIR_LAST HWRM_TF_SESSION_RESC_FREE_INPUT_FLAGS_DIR_TX
41652 /*
41653 * Defines the size, in bytes, of the provided free_addr
41654 * buffer.
41655 */
41656 uint16_t free_size;
41657 /*
41658 * This is the DMA address for the free input data array
41659 * buffer. Array is of tf_rm_resc_entry type. Size of the
41660 * buffer is provided by the 'free_size' field of this
41661 * message.
41662 */
41663 uint64_t free_addr;
41664 } hwrm_tf_session_resc_free_input_t, *phwrm_tf_session_resc_free_input_t;
41665
41666 /* hwrm_tf_session_resc_free_output (size:128b/16B) */
41667
41668 typedef struct hwrm_tf_session_resc_free_output {
41669 /* The specific error status for the command. */
41670 uint16_t error_code;
41671 /* The HWRM command request type. */
41672 uint16_t req_type;
41673 /* The sequence ID from the original command. */
41674 uint16_t seq_id;
41675 /* The length of the response data in number of bytes. */
41676 uint16_t resp_len;
41677 /* unused. */
41678 uint8_t unused0[7];
41679 /*
41680 * This field is used in Output records to indicate that the output
41681 * is completely written to RAM. This field should be read as '1'
41682 * to indicate that the output has been completely written.
41683 * When writing a command completion or response to an internal
41684 * processor, the order of writes has to be such that this field is
41685 * written last.
41686 */
41687 uint8_t valid;
41688 } hwrm_tf_session_resc_free_output_t, *phwrm_tf_session_resc_free_output_t;
41689
41690 /******************************
41691 * hwrm_tf_session_resc_flush *
41692 ******************************/
41693
41694
41695 /* hwrm_tf_session_resc_flush_input (size:256b/32B) */
41696
41697 typedef struct hwrm_tf_session_resc_flush_input {
41698 /* The HWRM command request type. */
41699 uint16_t req_type;
41700 /*
41701 * The completion ring to send the completion event on. This should
41702 * be the NQ ID returned from the `nq_alloc` HWRM command.
41703 */
41704 uint16_t cmpl_ring;
41705 /*
41706 * The sequence ID is used by the driver for tracking multiple
41707 * commands. This ID is treated as opaque data by the firmware and
41708 * the value is returned in the `hwrm_resp_hdr` upon completion.
41709 */
41710 uint16_t seq_id;
41711 /*
41712 * The target ID of the command:
41713 * * 0x0-0xFFF8 - The function ID
41714 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41715 * * 0xFFFD - Reserved for user-space HWRM interface
41716 * * 0xFFFF - HWRM
41717 */
41718 uint16_t target_id;
41719 /*
41720 * A physical address pointer pointing to a host buffer that the
41721 * command's response data will be written. This can be either a host
41722 * physical address (HPA) or a guest physical address (GPA) and must
41723 * point to a physically contiguous block of memory.
41724 */
41725 uint64_t resp_addr;
41726 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
41727 uint32_t fw_session_id;
41728 /* Control flags. */
41729 uint16_t flags;
41730 /* Indicates the flow direction. */
41731 #define HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR UINT32_C(0x1)
41732 /* If this bit set to 0, then it indicates rx flow. */
41733 #define HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR_RX UINT32_C(0x0)
41734 /* If this bit is set to 1, then it indicates tx flow. */
41735 #define HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR_TX UINT32_C(0x1)
41736 #define HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR_LAST HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR_TX
41737 /*
41738 * Defines the size, in bytes, of the provided flush_addr
41739 * buffer.
41740 */
41741 uint16_t flush_size;
41742 /*
41743 * This is the DMA address for the flush input data array
41744 * buffer. Array of tf_rm_resc_entry type. Size of the
41745 * buffer is provided by the 'flush_size' field in this
41746 * message.
41747 */
41748 uint64_t flush_addr;
41749 } hwrm_tf_session_resc_flush_input_t, *phwrm_tf_session_resc_flush_input_t;
41750
41751 /* hwrm_tf_session_resc_flush_output (size:128b/16B) */
41752
41753 typedef struct hwrm_tf_session_resc_flush_output {
41754 /* The specific error status for the command. */
41755 uint16_t error_code;
41756 /* The HWRM command request type. */
41757 uint16_t req_type;
41758 /* The sequence ID from the original command. */
41759 uint16_t seq_id;
41760 /* The length of the response data in number of bytes. */
41761 uint16_t resp_len;
41762 /* unused. */
41763 uint8_t unused0[7];
41764 /*
41765 * This field is used in Output records to indicate that the output
41766 * is completely written to RAM. This field should be read as '1'
41767 * to indicate that the output has been completely written.
41768 * When writing a command completion or response to an internal
41769 * processor, the order of writes has to be such that this field is
41770 * written last.
41771 */
41772 uint8_t valid;
41773 } hwrm_tf_session_resc_flush_output_t, *phwrm_tf_session_resc_flush_output_t;
41774
41775 /*****************************
41776 * hwrm_tf_session_resc_info *
41777 *****************************/
41778
41779
41780 /* hwrm_tf_session_resc_info_input (size:320b/40B) */
41781
41782 typedef struct hwrm_tf_session_resc_info_input {
41783 /* The HWRM command request type. */
41784 uint16_t req_type;
41785 /*
41786 * The completion ring to send the completion event on. This should
41787 * be the NQ ID returned from the `nq_alloc` HWRM command.
41788 */
41789 uint16_t cmpl_ring;
41790 /*
41791 * The sequence ID is used by the driver for tracking multiple
41792 * commands. This ID is treated as opaque data by the firmware and
41793 * the value is returned in the `hwrm_resp_hdr` upon completion.
41794 */
41795 uint16_t seq_id;
41796 /*
41797 * The target ID of the command:
41798 * * 0x0-0xFFF8 - The function ID
41799 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41800 * * 0xFFFD - Reserved for user-space HWRM interface
41801 * * 0xFFFF - HWRM
41802 */
41803 uint16_t target_id;
41804 /*
41805 * A physical address pointer pointing to a host buffer that the
41806 * command's response data will be written. This can be either a host
41807 * physical address (HPA) or a guest physical address (GPA) and must
41808 * point to a physically contiguous block of memory.
41809 */
41810 uint64_t resp_addr;
41811 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
41812 uint32_t fw_session_id;
41813 /* Control flags. */
41814 uint16_t flags;
41815 /* Indicates the flow direction. */
41816 #define HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR UINT32_C(0x1)
41817 /* If this bit set to 0, then it indicates rx flow. */
41818 #define HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR_RX UINT32_C(0x0)
41819 /* If this bit is set to 1, then it indicates tx flow. */
41820 #define HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR_TX UINT32_C(0x1)
41821 #define HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR_LAST HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR_TX
41822 /*
41823 * Defines the array size of the provided req_addr and
41824 * resv_addr array buffers. Should be set to the number of
41825 * request entries.
41826 */
41827 uint16_t req_size;
41828 /*
41829 * This is the DMA address for the request input data array
41830 * buffer. Array is of tf_rm_resc_req_entry type. Size of the
41831 * array buffer is provided by the 'req_size' field in this
41832 * message.
41833 */
41834 uint64_t req_addr;
41835 /*
41836 * This is the DMA address for the resc output data array
41837 * buffer. Array is of tf_rm_resc_entry type. Size of the array
41838 * buffer is provided by the 'req_size' field in this
41839 * message.
41840 */
41841 uint64_t resc_addr;
41842 } hwrm_tf_session_resc_info_input_t, *phwrm_tf_session_resc_info_input_t;
41843
41844 /* hwrm_tf_session_resc_info_output (size:128b/16B) */
41845
41846 typedef struct hwrm_tf_session_resc_info_output {
41847 /* The specific error status for the command. */
41848 uint16_t error_code;
41849 /* The HWRM command request type. */
41850 uint16_t req_type;
41851 /* The sequence ID from the original command. */
41852 uint16_t seq_id;
41853 /* The length of the response data in number of bytes. */
41854 uint16_t resp_len;
41855 /*
41856 * Size of the returned tf_rm_resc_entry data array. The value
41857 * cannot exceed the req_size defined by the input msg. The data
41858 * array is returned using the resv_addr specified DMA
41859 * address also provided by the input msg.
41860 */
41861 uint16_t size;
41862 /* unused. */
41863 uint8_t unused0[5];
41864 /*
41865 * This field is used in Output records to indicate that the output
41866 * is completely written to RAM. This field should be read as '1'
41867 * to indicate that the output has been completely written.
41868 * When writing a command completion or response to an internal
41869 * processor, the order of writes has to be such that this field is
41870 * written last.
41871 */
41872 uint8_t valid;
41873 } hwrm_tf_session_resc_info_output_t, *phwrm_tf_session_resc_info_output_t;
41874
41875 /* TruFlow RM capability of a resource. */
41876 /* tf_rm_resc_req_entry (size:64b/8B) */
41877
41878 typedef struct tf_rm_resc_req_entry {
41879 /* Type of the resource, defined globally in HCAPI RM. */
41880 uint32_t type;
41881 /* Minimum value. */
41882 uint16_t min;
41883 /* Maximum value. */
41884 uint16_t max;
41885 } tf_rm_resc_req_entry_t, *ptf_rm_resc_req_entry_t;
41886
41887 /* TruFlow RM reservation information. */
41888 /* tf_rm_resc_entry (size:64b/8B) */
41889
41890 typedef struct tf_rm_resc_entry {
41891 /* Type of the resource, defined globally in HCAPI RM. */
41892 uint32_t type;
41893 /* Start offset. */
41894 uint16_t start;
41895 /* Number of resources. */
41896 uint16_t stride;
41897 } tf_rm_resc_entry_t, *ptf_rm_resc_entry_t;
41898
41899 /************************
41900 * hwrm_tf_tbl_type_get *
41901 ************************/
41902
41903
41904 /* hwrm_tf_tbl_type_get_input (size:256b/32B) */
41905
41906 typedef struct hwrm_tf_tbl_type_get_input {
41907 /* The HWRM command request type. */
41908 uint16_t req_type;
41909 /*
41910 * The completion ring to send the completion event on. This should
41911 * be the NQ ID returned from the `nq_alloc` HWRM command.
41912 */
41913 uint16_t cmpl_ring;
41914 /*
41915 * The sequence ID is used by the driver for tracking multiple
41916 * commands. This ID is treated as opaque data by the firmware and
41917 * the value is returned in the `hwrm_resp_hdr` upon completion.
41918 */
41919 uint16_t seq_id;
41920 /*
41921 * The target ID of the command:
41922 * * 0x0-0xFFF8 - The function ID
41923 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41924 * * 0xFFFD - Reserved for user-space HWRM interface
41925 * * 0xFFFF - HWRM
41926 */
41927 uint16_t target_id;
41928 /*
41929 * A physical address pointer pointing to a host buffer that the
41930 * command's response data will be written. This can be either a host
41931 * physical address (HPA) or a guest physical address (GPA) and must
41932 * point to a physically contiguous block of memory.
41933 */
41934 uint64_t resp_addr;
41935 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
41936 uint32_t fw_session_id;
41937 /* Control flags. */
41938 uint16_t flags;
41939 /* Indicates the flow direction. */
41940 #define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR UINT32_C(0x1)
41941 /* If this bit set to 0, then it indicates rx flow. */
41942 #define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_RX UINT32_C(0x0)
41943 /* If this bit is set to 1, then it indicates tx flow. */
41944 #define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_TX UINT32_C(0x1)
41945 #define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_LAST HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_TX
41946 /* unused. */
41947 uint8_t unused0[2];
41948 /*
41949 * Type of the resource, defined globally in the
41950 * hwrm_tf_resc_type enum.
41951 */
41952 uint32_t type;
41953 /* Index of the type to retrieve. */
41954 uint32_t index;
41955 } hwrm_tf_tbl_type_get_input_t, *phwrm_tf_tbl_type_get_input_t;
41956
41957 /* hwrm_tf_tbl_type_get_output (size:1216b/152B) */
41958
41959 typedef struct hwrm_tf_tbl_type_get_output {
41960 /* The specific error status for the command. */
41961 uint16_t error_code;
41962 /* The HWRM command request type. */
41963 uint16_t req_type;
41964 /* The sequence ID from the original command. */
41965 uint16_t seq_id;
41966 /* The length of the response data in number of bytes. */
41967 uint16_t resp_len;
41968 /* Response code. */
41969 uint32_t resp_code;
41970 /* Response size. */
41971 uint16_t size;
41972 /* unused */
41973 uint16_t unused0;
41974 /* Response data. */
41975 uint8_t data[128];
41976 /* unused */
41977 uint8_t unused1[7];
41978 /*
41979 * This field is used in Output records to indicate that the output
41980 * is completely written to RAM. This field should be read as '1'
41981 * to indicate that the output has been completely written.
41982 * When writing a command completion or response to an internal
41983 * processor, the order of writes has to be such that this field
41984 * is written last.
41985 */
41986 uint8_t valid;
41987 } hwrm_tf_tbl_type_get_output_t, *phwrm_tf_tbl_type_get_output_t;
41988
41989 /************************
41990 * hwrm_tf_tbl_type_set *
41991 ************************/
41992
41993
41994 /* hwrm_tf_tbl_type_set_input (size:1024b/128B) */
41995
41996 typedef struct hwrm_tf_tbl_type_set_input {
41997 /* The HWRM command request type. */
41998 uint16_t req_type;
41999 /*
42000 * The completion ring to send the completion event on. This should
42001 * be the NQ ID returned from the `nq_alloc` HWRM command.
42002 */
42003 uint16_t cmpl_ring;
42004 /*
42005 * The sequence ID is used by the driver for tracking multiple
42006 * commands. This ID is treated as opaque data by the firmware and
42007 * the value is returned in the `hwrm_resp_hdr` upon completion.
42008 */
42009 uint16_t seq_id;
42010 /*
42011 * The target ID of the command:
42012 * * 0x0-0xFFF8 - The function ID
42013 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42014 * * 0xFFFD - Reserved for user-space HWRM interface
42015 * * 0xFFFF - HWRM
42016 */
42017 uint16_t target_id;
42018 /*
42019 * A physical address pointer pointing to a host buffer that the
42020 * command's response data will be written. This can be either a host
42021 * physical address (HPA) or a guest physical address (GPA) and must
42022 * point to a physically contiguous block of memory.
42023 */
42024 uint64_t resp_addr;
42025 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
42026 uint32_t fw_session_id;
42027 /* Control flags. */
42028 uint16_t flags;
42029 /* Indicates the flow direction. */
42030 #define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR UINT32_C(0x1)
42031 /* If this bit set to 0, then it indicates rx flow. */
42032 #define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_RX UINT32_C(0x0)
42033 /* If this bit is set to 1, then it indicates tx flow. */
42034 #define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_TX UINT32_C(0x1)
42035 #define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_LAST HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_TX
42036 /* unused. */
42037 uint8_t unused0[2];
42038 /*
42039 * Type of the resource, defined globally in the
42040 * hwrm_tf_resc_type enum.
42041 */
42042 uint32_t type;
42043 /* Index of the type to retrieve. */
42044 uint32_t index;
42045 /* Size of the data to set. */
42046 uint16_t size;
42047 /* unused */
42048 uint8_t unused1[6];
42049 /* Data to be set. */
42050 uint8_t data[88];
42051 } hwrm_tf_tbl_type_set_input_t, *phwrm_tf_tbl_type_set_input_t;
42052
42053 /* hwrm_tf_tbl_type_set_output (size:128b/16B) */
42054
42055 typedef struct hwrm_tf_tbl_type_set_output {
42056 /* The specific error status for the command. */
42057 uint16_t error_code;
42058 /* The HWRM command request type. */
42059 uint16_t req_type;
42060 /* The sequence ID from the original command. */
42061 uint16_t seq_id;
42062 /* The length of the response data in number of bytes. */
42063 uint16_t resp_len;
42064 /* unused. */
42065 uint8_t unused0[7];
42066 /*
42067 * This field is used in Output records to indicate that the output
42068 * is completely written to RAM. This field should be read as '1'
42069 * to indicate that the output has been completely written.
42070 * When writing a command completion or response to an internal
42071 * processor, the order of writes has to be such that this field
42072 * is written last.
42073 */
42074 uint8_t valid;
42075 } hwrm_tf_tbl_type_set_output_t, *phwrm_tf_tbl_type_set_output_t;
42076
42077 /**************************
42078 * hwrm_tf_ctxt_mem_alloc *
42079 **************************/
42080
42081
42082 /* hwrm_tf_ctxt_mem_alloc_input (size:192b/24B) */
42083
42084 typedef struct hwrm_tf_ctxt_mem_alloc_input {
42085 /* The HWRM command request type. */
42086 uint16_t req_type;
42087 /*
42088 * The completion ring to send the completion event on. This should
42089 * be the NQ ID returned from the `nq_alloc` HWRM command.
42090 */
42091 uint16_t cmpl_ring;
42092 /*
42093 * The sequence ID is used by the driver for tracking multiple
42094 * commands. This ID is treated as opaque data by the firmware and
42095 * the value is returned in the `hwrm_resp_hdr` upon completion.
42096 */
42097 uint16_t seq_id;
42098 /*
42099 * The target ID of the command:
42100 * * 0x0-0xFFF8 - The function ID
42101 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42102 * * 0xFFFD - Reserved for user-space HWRM interface
42103 * * 0xFFFF - HWRM
42104 */
42105 uint16_t target_id;
42106 /*
42107 * A physical address pointer pointing to a host buffer that the
42108 * command's response data will be written. This can be either a host
42109 * physical address (HPA) or a guest physical address (GPA) and must
42110 * point to a physically contiguous block of memory.
42111 */
42112 uint64_t resp_addr;
42113 /* Size in KB of memory to be allocated. */
42114 uint32_t mem_size;
42115 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
42116 uint32_t fw_session_id;
42117 } hwrm_tf_ctxt_mem_alloc_input_t, *phwrm_tf_ctxt_mem_alloc_input_t;
42118
42119 /* hwrm_tf_ctxt_mem_alloc_output (size:192b/24B) */
42120
42121 typedef struct hwrm_tf_ctxt_mem_alloc_output {
42122 /* The specific error status for the command. */
42123 uint16_t error_code;
42124 /* The HWRM command request type. */
42125 uint16_t req_type;
42126 /* The sequence ID from the original command. */
42127 uint16_t seq_id;
42128 /* The length of the response data in number of bytes. */
42129 uint16_t resp_len;
42130 /* Pointer to the PBL, or PDL depending on number of levels */
42131 uint64_t page_dir;
42132 /* Size of memory allocated. */
42133 uint32_t mem_size;
42134 /* Counter PBL indirect levels. */
42135 uint8_t page_level;
42136 /* PBL pointer is physical start address. */
42137 #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
42138 /* PBL pointer points to PTE table. */
42139 #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
42140 /*
42141 * PBL pointer points to PDE table with each entry pointing
42142 * to PTE tables.
42143 */
42144 #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
42145 #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_LEVEL_LAST HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_LEVEL_LVL_2
42146 /* Page size. */
42147 uint8_t page_size;
42148 /* 4KB page size. */
42149 #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_4K UINT32_C(0x0)
42150 /* 8KB page size. */
42151 #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_8K UINT32_C(0x1)
42152 /* 64KB page size. */
42153 #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_64K UINT32_C(0x4)
42154 /* 128KB page size. */
42155 #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_128K UINT32_C(0x5)
42156 /* 256KB page size. */
42157 #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_256K UINT32_C(0x6)
42158 /* 512KB page size. */
42159 #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_512K UINT32_C(0x7)
42160 /* 1MB page size. */
42161 #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_1M UINT32_C(0x8)
42162 /* 2MB page size. */
42163 #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_2M UINT32_C(0x9)
42164 /* 4MB page size. */
42165 #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_4M UINT32_C(0xa)
42166 /* 8MB page size. */
42167 #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_8M UINT32_C(0xb)
42168 /* 1GB page size. */
42169 #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_1G UINT32_C(0x12)
42170 #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_LAST HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_1G
42171 /* unused. */
42172 uint8_t unused0;
42173 /*
42174 * This field is used in Output records to indicate that the
42175 * output is completely written to RAM. This field should be
42176 * read as '1' to indicate that the output has been
42177 * completely written. When writing a command completion or
42178 * response to an internal processor, the order of writes has
42179 * to be such that this field is written last.
42180 */
42181 uint8_t valid;
42182 } hwrm_tf_ctxt_mem_alloc_output_t, *phwrm_tf_ctxt_mem_alloc_output_t;
42183
42184 /*************************
42185 * hwrm_tf_ctxt_mem_free *
42186 *************************/
42187
42188
42189 /* hwrm_tf_ctxt_mem_free_input (size:320b/40B) */
42190
42191 typedef struct hwrm_tf_ctxt_mem_free_input {
42192 /* The HWRM command request type. */
42193 uint16_t req_type;
42194 /*
42195 * The completion ring to send the completion event on. This should
42196 * be the NQ ID returned from the `nq_alloc` HWRM command.
42197 */
42198 uint16_t cmpl_ring;
42199 /*
42200 * The sequence ID is used by the driver for tracking multiple
42201 * commands. This ID is treated as opaque data by the firmware and
42202 * the value is returned in the `hwrm_resp_hdr` upon completion.
42203 */
42204 uint16_t seq_id;
42205 /*
42206 * The target ID of the command:
42207 * * 0x0-0xFFF8 - The function ID
42208 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42209 * * 0xFFFD - Reserved for user-space HWRM interface
42210 * * 0xFFFF - HWRM
42211 */
42212 uint16_t target_id;
42213 /*
42214 * A physical address pointer pointing to a host buffer that the
42215 * command's response data will be written. This can be either a host
42216 * physical address (HPA) or a guest physical address (GPA) and must
42217 * point to a physically contiguous block of memory.
42218 */
42219 uint64_t resp_addr;
42220 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
42221 uint32_t fw_session_id;
42222 /* Counter PBL indirect levels. */
42223 uint8_t page_level;
42224 /* PBL pointer is physical start address. */
42225 #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
42226 /* PBL pointer points to PTE table. */
42227 #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
42228 /*
42229 * PBL pointer points to PDE table with each entry pointing
42230 * to PTE tables.
42231 */
42232 #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
42233 #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_LEVEL_LAST HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_LEVEL_LVL_2
42234 /* Page size. */
42235 uint8_t page_size;
42236 /* 4KB page size. */
42237 #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_4K UINT32_C(0x0)
42238 /* 8KB page size. */
42239 #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_8K UINT32_C(0x1)
42240 /* 64KB page size. */
42241 #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_64K UINT32_C(0x4)
42242 /* 128KB page size. */
42243 #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_128K UINT32_C(0x5)
42244 /* 256KB page size. */
42245 #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
42246 /* 512KB page size. */
42247 #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_512K UINT32_C(0x7)
42248 /* 1MB page size. */
42249 #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_1M UINT32_C(0x8)
42250 /* 2MB page size. */
42251 #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_2M UINT32_C(0x9)
42252 /* 4MB page size. */
42253 #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_4M UINT32_C(0xa)
42254 /* 8MB page size. */
42255 #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_8M UINT32_C(0xb)
42256 /* 1GB page size. */
42257 #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_1G UINT32_C(0x12)
42258 #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_LAST HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_1G
42259 /* unused. */
42260 uint8_t unused0[2];
42261 /* Pointer to the PBL, or PDL depending on number of levels */
42262 uint64_t page_dir;
42263 /* Size of memory allocated. */
42264 uint32_t mem_size;
42265 /* unused. */
42266 uint8_t unused1[4];
42267 } hwrm_tf_ctxt_mem_free_input_t, *phwrm_tf_ctxt_mem_free_input_t;
42268
42269 /* hwrm_tf_ctxt_mem_free_output (size:128b/16B) */
42270
42271 typedef struct hwrm_tf_ctxt_mem_free_output {
42272 /* The specific error status for the command. */
42273 uint16_t error_code;
42274 /* The HWRM command request type. */
42275 uint16_t req_type;
42276 /* The sequence ID from the original command. */
42277 uint16_t seq_id;
42278 /* The length of the response data in number of bytes. */
42279 uint16_t resp_len;
42280 /* unused. */
42281 uint8_t unused0[7];
42282 /*
42283 * This field is used in Output records to indicate that the
42284 * output is completely written to RAM. This field should be
42285 * read as '1' to indicate that the output has been
42286 * completely written. When writing a command completion or
42287 * response to an internal processor, the order of writes has
42288 * to be such that this field is written last.
42289 */
42290 uint8_t valid;
42291 } hwrm_tf_ctxt_mem_free_output_t, *phwrm_tf_ctxt_mem_free_output_t;
42292
42293 /*************************
42294 * hwrm_tf_ctxt_mem_rgtr *
42295 *************************/
42296
42297
42298 /* hwrm_tf_ctxt_mem_rgtr_input (size:256b/32B) */
42299
42300 typedef struct hwrm_tf_ctxt_mem_rgtr_input {
42301 /* The HWRM command request type. */
42302 uint16_t req_type;
42303 /*
42304 * The completion ring to send the completion event on. This should
42305 * be the NQ ID returned from the `nq_alloc` HWRM command.
42306 */
42307 uint16_t cmpl_ring;
42308 /*
42309 * The sequence ID is used by the driver for tracking multiple
42310 * commands. This ID is treated as opaque data by the firmware and
42311 * the value is returned in the `hwrm_resp_hdr` upon completion.
42312 */
42313 uint16_t seq_id;
42314 /*
42315 * The target ID of the command:
42316 * * 0x0-0xFFF8 - The function ID
42317 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42318 * * 0xFFFD - Reserved for user-space HWRM interface
42319 * * 0xFFFF - HWRM
42320 */
42321 uint16_t target_id;
42322 /*
42323 * A physical address pointer pointing to a host buffer that the
42324 * command's response data will be written. This can be either a host
42325 * physical address (HPA) or a guest physical address (GPA) and must
42326 * point to a physically contiguous block of memory.
42327 */
42328 uint64_t resp_addr;
42329 /* Control flags. */
42330 uint16_t flags;
42331 /* Counter PBL indirect levels. */
42332 uint8_t page_level;
42333 /* PBL pointer is physical start address. */
42334 #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
42335 /* PBL pointer points to PTE table. */
42336 #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
42337 /*
42338 * PBL pointer points to PDE table with each entry pointing
42339 * to PTE tables.
42340 */
42341 #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
42342 #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_LEVEL_LAST HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2
42343 /* Page size. */
42344 uint8_t page_size;
42345 /* 4KB page size. */
42346 #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_4K UINT32_C(0x0)
42347 /* 8KB page size. */
42348 #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_8K UINT32_C(0x1)
42349 /* 64KB page size. */
42350 #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_64K UINT32_C(0x4)
42351 /* 128KB page size. */
42352 #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_128K UINT32_C(0x5)
42353 /* 256KB page size. */
42354 #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
42355 /* 512KB page size. */
42356 #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_512K UINT32_C(0x7)
42357 /* 1MB page size. */
42358 #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_1M UINT32_C(0x8)
42359 /* 2MB page size. */
42360 #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_2M UINT32_C(0x9)
42361 /* 4MB page size. */
42362 #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_4M UINT32_C(0xa)
42363 /* 8MB page size. */
42364 #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_8M UINT32_C(0xb)
42365 /* 1GB page size. */
42366 #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_1G UINT32_C(0x12)
42367 #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_LAST HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_1G
42368 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
42369 uint32_t fw_session_id;
42370 /* Pointer to the PBL, or PDL depending on number of levels */
42371 uint64_t page_dir;
42372 } hwrm_tf_ctxt_mem_rgtr_input_t, *phwrm_tf_ctxt_mem_rgtr_input_t;
42373
42374 /* hwrm_tf_ctxt_mem_rgtr_output (size:128b/16B) */
42375
42376 typedef struct hwrm_tf_ctxt_mem_rgtr_output {
42377 /* The specific error status for the command. */
42378 uint16_t error_code;
42379 /* The HWRM command request type. */
42380 uint16_t req_type;
42381 /* The sequence ID from the original command. */
42382 uint16_t seq_id;
42383 /* The length of the response data in number of bytes. */
42384 uint16_t resp_len;
42385 /*
42386 * Id/Handle to the recently register context memory. This
42387 * handle is passed to the TF session.
42388 */
42389 uint16_t ctx_id;
42390 /* unused. */
42391 uint8_t unused0[5];
42392 /*
42393 * This field is used in Output records to indicate that the
42394 * output is completely written to RAM. This field should be
42395 * read as '1' to indicate that the output has been
42396 * completely written. When writing a command completion or
42397 * response to an internal processor, the order of writes has
42398 * to be such that this field is written last.
42399 */
42400 uint8_t valid;
42401 } hwrm_tf_ctxt_mem_rgtr_output_t, *phwrm_tf_ctxt_mem_rgtr_output_t;
42402
42403 /***************************
42404 * hwrm_tf_ctxt_mem_unrgtr *
42405 ***************************/
42406
42407
42408 /* hwrm_tf_ctxt_mem_unrgtr_input (size:192b/24B) */
42409
42410 typedef struct hwrm_tf_ctxt_mem_unrgtr_input {
42411 /* The HWRM command request type. */
42412 uint16_t req_type;
42413 /*
42414 * The completion ring to send the completion event on. This should
42415 * be the NQ ID returned from the `nq_alloc` HWRM command.
42416 */
42417 uint16_t cmpl_ring;
42418 /*
42419 * The sequence ID is used by the driver for tracking multiple
42420 * commands. This ID is treated as opaque data by the firmware and
42421 * the value is returned in the `hwrm_resp_hdr` upon completion.
42422 */
42423 uint16_t seq_id;
42424 /*
42425 * The target ID of the command:
42426 * * 0x0-0xFFF8 - The function ID
42427 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42428 * * 0xFFFD - Reserved for user-space HWRM interface
42429 * * 0xFFFF - HWRM
42430 */
42431 uint16_t target_id;
42432 /*
42433 * A physical address pointer pointing to a host buffer that the
42434 * command's response data will be written. This can be either a host
42435 * physical address (HPA) or a guest physical address (GPA) and must
42436 * point to a physically contiguous block of memory.
42437 */
42438 uint64_t resp_addr;
42439 /*
42440 * Id/Handle to the recently register context memory. This
42441 * handle is passed to the TF session.
42442 */
42443 uint16_t ctx_id;
42444 /* unused. */
42445 uint8_t unused0[2];
42446 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
42447 uint32_t fw_session_id;
42448 } hwrm_tf_ctxt_mem_unrgtr_input_t, *phwrm_tf_ctxt_mem_unrgtr_input_t;
42449
42450 /* hwrm_tf_ctxt_mem_unrgtr_output (size:128b/16B) */
42451
42452 typedef struct hwrm_tf_ctxt_mem_unrgtr_output {
42453 /* The specific error status for the command. */
42454 uint16_t error_code;
42455 /* The HWRM command request type. */
42456 uint16_t req_type;
42457 /* The sequence ID from the original command. */
42458 uint16_t seq_id;
42459 /* The length of the response data in number of bytes. */
42460 uint16_t resp_len;
42461 /* unused. */
42462 uint8_t unused0[7];
42463 /*
42464 * This field is used in Output records to indicate that the
42465 * output is completely written to RAM. This field should be
42466 * read as '1' to indicate that the output has been
42467 * completely written. When writing a command completion or
42468 * response to an internal processor, the order of writes has
42469 * to be such that this field is written last.
42470 */
42471 uint8_t valid;
42472 } hwrm_tf_ctxt_mem_unrgtr_output_t, *phwrm_tf_ctxt_mem_unrgtr_output_t;
42473
42474 /************************
42475 * hwrm_tf_ext_em_qcaps *
42476 ************************/
42477
42478
42479 /* hwrm_tf_ext_em_qcaps_input (size:192b/24B) */
42480
42481 typedef struct hwrm_tf_ext_em_qcaps_input {
42482 /* The HWRM command request type. */
42483 uint16_t req_type;
42484 /*
42485 * The completion ring to send the completion event on. This should
42486 * be the NQ ID returned from the `nq_alloc` HWRM command.
42487 */
42488 uint16_t cmpl_ring;
42489 /*
42490 * The sequence ID is used by the driver for tracking multiple
42491 * commands. This ID is treated as opaque data by the firmware and
42492 * the value is returned in the `hwrm_resp_hdr` upon completion.
42493 */
42494 uint16_t seq_id;
42495 /*
42496 * The target ID of the command:
42497 * * 0x0-0xFFF8 - The function ID
42498 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42499 * * 0xFFFD - Reserved for user-space HWRM interface
42500 * * 0xFFFF - HWRM
42501 */
42502 uint16_t target_id;
42503 /*
42504 * A physical address pointer pointing to a host buffer that the
42505 * command's response data will be written. This can be either a host
42506 * physical address (HPA) or a guest physical address (GPA) and must
42507 * point to a physically contiguous block of memory.
42508 */
42509 uint64_t resp_addr;
42510 /* Control flags. */
42511 uint32_t flags;
42512 /* Indicates the flow direction. */
42513 #define HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_DIR UINT32_C(0x1)
42514 /* If this bit set to 0, then it indicates rx flow. */
42515 #define HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_DIR_RX UINT32_C(0x0)
42516 /* If this bit is set to 1, then it indicates tx flow. */
42517 #define HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_DIR_TX UINT32_C(0x1)
42518 #define HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_DIR_LAST HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_DIR_TX
42519 /* When set to 1, all offloaded flows will be sent to EXT EM. */
42520 #define HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_PREFERRED_OFFLOAD UINT32_C(0x2)
42521 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
42522 uint32_t fw_session_id;
42523 } hwrm_tf_ext_em_qcaps_input_t, *phwrm_tf_ext_em_qcaps_input_t;
42524
42525 /* hwrm_tf_ext_em_qcaps_output (size:384b/48B) */
42526
42527 typedef struct hwrm_tf_ext_em_qcaps_output {
42528 /* The specific error status for the command. */
42529 uint16_t error_code;
42530 /* The HWRM command request type. */
42531 uint16_t req_type;
42532 /* The sequence ID from the original command. */
42533 uint16_t seq_id;
42534 /* The length of the response data in number of bytes. */
42535 uint16_t resp_len;
42536 uint32_t flags;
42537 /*
42538 * When set to 1, indicates the the FW supports the Centralized
42539 * Memory Model. The concept designates one entity for the
42540 * memory allocation while all others ‘subscribe’ to it.
42541 */
42542 #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_FLAGS_CENTRALIZED_MEMORY_MODEL_SUPPORTED UINT32_C(0x1)
42543 /*
42544 * When set to 1, indicates the the FW supports the Detached
42545 * Centralized Memory Model. The memory is allocated and managed
42546 * as a separate entity. All PFs and VFs will be granted direct
42547 * or semi-direct access to the allocated memory while none of
42548 * which can interfere with the management of the memory.
42549 */
42550 #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_FLAGS_DETACHED_CENTRALIZED_MEMORY_MODEL_SUPPORTED UINT32_C(0x2)
42551 /* When set to 1, indicates FW support for host based EEM memory. */
42552 #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_FLAGS_HOST_MEMORY_SUPPORTED UINT32_C(0x4)
42553 /* When set to 1, indicates FW support for on-chip based EEM memory. */
42554 #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_FLAGS_FW_MEMORY_SUPPORTED UINT32_C(0x8)
42555 /* unused. */
42556 uint32_t unused0;
42557 /* Support flags. */
42558 uint32_t supported;
42559 /*
42560 * If set to 1, then EXT EM KEY0 table is supported using
42561 * crc32 hash.
42562 * If set to 0, EXT EM KEY0 table is not supported.
42563 */
42564 #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_KEY0_TABLE UINT32_C(0x1)
42565 /*
42566 * If set to 1, then EXT EM KEY1 table is supported using
42567 * lookup3 hash.
42568 * If set to 0, EXT EM KEY1 table is not supported.
42569 */
42570 #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_KEY1_TABLE UINT32_C(0x2)
42571 /*
42572 * If set to 1, then EXT EM External Record table is supported.
42573 * If set to 0, EXT EM External Record table is not
42574 * supported. (This table includes action record, EFC
42575 * pointers, encap pointers)
42576 */
42577 #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_RECORD_TABLE UINT32_C(0x4)
42578 /*
42579 * If set to 1, then EXT EM External Flow Counters table is
42580 * supported.
42581 * If set to 0, EXT EM External Flow Counters table is not
42582 * supported.
42583 */
42584 #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_FLOW_COUNTERS_TABLE UINT32_C(0x8)
42585 /*
42586 * If set to 1, then FID table used for implicit flow flush
42587 * is supported.
42588 * If set to 0, then FID table used for implicit flow flush
42589 * is not supported.
42590 */
42591 #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_FID_TABLE UINT32_C(0x10)
42592 /*
42593 * If set to 1, then table scopes are supported.
42594 * If set to 0, then table scopes are not supported.
42595 */
42596 #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_TBL_SCOPES UINT32_C(0x20)
42597 /*
42598 * The maximum number of entries supported by EXT EM. When
42599 * configuring the host memory the number of numbers of
42600 * entries that can supported are -
42601 * 32k, 64k 128k, 256k, 512k, 1M, 2M, 4M, 8M, 32M, 64M,
42602 * 128M entries.
42603 * Any value that are not these values, the FW will round
42604 * down to the closest support number of entries.
42605 */
42606 uint32_t max_entries_supported;
42607 /*
42608 * The entry size in bytes of each entry in the EXT EM
42609 * KEY0/KEY1 tables.
42610 */
42611 uint16_t key_entry_size;
42612 /*
42613 * The entry size in bytes of each entry in the EXT EM RECORD
42614 * tables.
42615 */
42616 uint16_t record_entry_size;
42617 /* The entry size in bytes of each entry in the EXT EM EFC tables. */
42618 uint16_t efc_entry_size;
42619 /* The FID size in bytes of each entry in the EXT EM FID tables. */
42620 uint16_t fid_entry_size;
42621 /* Maximum number of ctxt mem allocations allowed. */
42622 uint32_t max_ctxt_mem_allocs;
42623 /*
42624 * Maximum number of static buckets that can be assigned to lookup
42625 * table scopes.
42626 */
42627 uint32_t max_static_buckets;
42628 /* unused. */
42629 uint8_t unused1[7];
42630 /*
42631 * This field is used in Output records to indicate that the
42632 * output is completely written to RAM. This field should be
42633 * read as '1' to indicate that the output has been
42634 * completely written. When writing a command completion or
42635 * response to an internal processor, the order of writes has
42636 * to be such that this field is written last.
42637 */
42638 uint8_t valid;
42639 } hwrm_tf_ext_em_qcaps_output_t, *phwrm_tf_ext_em_qcaps_output_t;
42640
42641 /*********************
42642 * hwrm_tf_ext_em_op *
42643 *********************/
42644
42645
42646 /* hwrm_tf_ext_em_op_input (size:256b/32B) */
42647
42648 typedef struct hwrm_tf_ext_em_op_input {
42649 /* The HWRM command request type. */
42650 uint16_t req_type;
42651 /*
42652 * The completion ring to send the completion event on. This should
42653 * be the NQ ID returned from the `nq_alloc` HWRM command.
42654 */
42655 uint16_t cmpl_ring;
42656 /*
42657 * The sequence ID is used by the driver for tracking multiple
42658 * commands. This ID is treated as opaque data by the firmware and
42659 * the value is returned in the `hwrm_resp_hdr` upon completion.
42660 */
42661 uint16_t seq_id;
42662 /*
42663 * The target ID of the command:
42664 * * 0x0-0xFFF8 - The function ID
42665 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42666 * * 0xFFFD - Reserved for user-space HWRM interface
42667 * * 0xFFFF - HWRM
42668 */
42669 uint16_t target_id;
42670 /*
42671 * A physical address pointer pointing to a host buffer that the
42672 * command's response data will be written. This can be either a host
42673 * physical address (HPA) or a guest physical address (GPA) and must
42674 * point to a physically contiguous block of memory.
42675 */
42676 uint64_t resp_addr;
42677 /* Control flags. */
42678 uint16_t flags;
42679 /* Indicates the flow direction. */
42680 #define HWRM_TF_EXT_EM_OP_INPUT_FLAGS_DIR UINT32_C(0x1)
42681 /* If this bit set to 0, then it indicates rx flow. */
42682 #define HWRM_TF_EXT_EM_OP_INPUT_FLAGS_DIR_RX UINT32_C(0x0)
42683 /* If this bit is set to 1, then it indicates tx flow. */
42684 #define HWRM_TF_EXT_EM_OP_INPUT_FLAGS_DIR_TX UINT32_C(0x1)
42685 #define HWRM_TF_EXT_EM_OP_INPUT_FLAGS_DIR_LAST HWRM_TF_EXT_EM_OP_INPUT_FLAGS_DIR_TX
42686 /* unused. */
42687 uint16_t unused0;
42688 /* The number of EXT EM key table entries to be configured. */
42689 uint16_t op;
42690 /* This value is reserved and should not be used. */
42691 #define HWRM_TF_EXT_EM_OP_INPUT_OP_RESERVED UINT32_C(0x0)
42692 /*
42693 * To properly stop EXT EM and ensure there are no DMA's,
42694 * the caller must disable EXT EM for the given PF, using
42695 * this call. This will safely disable EXT EM and ensure
42696 * that all DMA'ed to the keys/records/efc have been
42697 * completed.
42698 */
42699 #define HWRM_TF_EXT_EM_OP_INPUT_OP_EXT_EM_DISABLE UINT32_C(0x1)
42700 /*
42701 * Once the EXT EM host memory has been configured, EXT EM
42702 * options have been configured. Then the caller should
42703 * enable EXT EM for the given PF. Note once this call has
42704 * been made, then the EXT EM mechanism will be active and
42705 * DMA's will occur as packets are processed.
42706 */
42707 #define HWRM_TF_EXT_EM_OP_INPUT_OP_EXT_EM_ENABLE UINT32_C(0x2)
42708 /*
42709 * Clear EXT EM settings for the given PF so that the
42710 * register values are reset back to their initial state.
42711 */
42712 #define HWRM_TF_EXT_EM_OP_INPUT_OP_EXT_EM_CLEANUP UINT32_C(0x3)
42713 #define HWRM_TF_EXT_EM_OP_INPUT_OP_LAST HWRM_TF_EXT_EM_OP_INPUT_OP_EXT_EM_CLEANUP
42714 /* unused. */
42715 uint16_t unused1;
42716 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
42717 uint32_t fw_session_id;
42718 /* unused. */
42719 uint32_t unused2;
42720 } hwrm_tf_ext_em_op_input_t, *phwrm_tf_ext_em_op_input_t;
42721
42722 /* hwrm_tf_ext_em_op_output (size:128b/16B) */
42723
42724 typedef struct hwrm_tf_ext_em_op_output {
42725 /* The specific error status for the command. */
42726 uint16_t error_code;
42727 /* The HWRM command request type. */
42728 uint16_t req_type;
42729 /* The sequence ID from the original command. */
42730 uint16_t seq_id;
42731 /* The length of the response data in number of bytes. */
42732 uint16_t resp_len;
42733 /* unused. */
42734 uint8_t unused0[7];
42735 /*
42736 * This field is used in Output records to indicate that the
42737 * output is completely written to RAM. This field should be
42738 * read as '1' to indicate that the output has been
42739 * completely written. When writing a command completion or
42740 * response to an internal processor, the order of writes has
42741 * to be such that this field is written last.
42742 */
42743 uint8_t valid;
42744 } hwrm_tf_ext_em_op_output_t, *phwrm_tf_ext_em_op_output_t;
42745
42746 /**********************
42747 * hwrm_tf_ext_em_cfg *
42748 **********************/
42749
42750
42751 /* hwrm_tf_ext_em_cfg_input (size:512b/64B) */
42752
42753 typedef struct hwrm_tf_ext_em_cfg_input {
42754 /* The HWRM command request type. */
42755 uint16_t req_type;
42756 /*
42757 * The completion ring to send the completion event on. This should
42758 * be the NQ ID returned from the `nq_alloc` HWRM command.
42759 */
42760 uint16_t cmpl_ring;
42761 /*
42762 * The sequence ID is used by the driver for tracking multiple
42763 * commands. This ID is treated as opaque data by the firmware and
42764 * the value is returned in the `hwrm_resp_hdr` upon completion.
42765 */
42766 uint16_t seq_id;
42767 /*
42768 * The target ID of the command:
42769 * * 0x0-0xFFF8 - The function ID
42770 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42771 * * 0xFFFD - Reserved for user-space HWRM interface
42772 * * 0xFFFF - HWRM
42773 */
42774 uint16_t target_id;
42775 /*
42776 * A physical address pointer pointing to a host buffer that the
42777 * command's response data will be written. This can be either a host
42778 * physical address (HPA) or a guest physical address (GPA) and must
42779 * point to a physically contiguous block of memory.
42780 */
42781 uint64_t resp_addr;
42782 /* Control flags. */
42783 uint32_t flags;
42784 /* Indicates the flow direction. */
42785 #define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_DIR UINT32_C(0x1)
42786 /* If this bit set to 0, then it indicates rx flow. */
42787 #define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_DIR_RX UINT32_C(0x0)
42788 /* If this bit is set to 1, then it indicates tx flow. */
42789 #define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_DIR_TX UINT32_C(0x1)
42790 #define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_DIR_LAST HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_DIR_TX
42791 /* When set to 1, all offloaded flows will be sent to EXT EM. */
42792 #define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_PREFERRED_OFFLOAD UINT32_C(0x2)
42793 /* When set to 1, secondary, 0 means primary. */
42794 #define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_SECONDARY_PF UINT32_C(0x4)
42795 /*
42796 * Group_id which used by Firmware to identify memory pools belonging
42797 * to certain group.
42798 */
42799 uint16_t group_id;
42800 /*
42801 * Dynamically reconfigure EEM pending cache every 1/10th of second.
42802 * If set to 0 it will disable the EEM HW flush of the pending cache.
42803 */
42804 uint8_t flush_interval;
42805 /* unused. */
42806 uint8_t unused0;
42807 /*
42808 * Configured EXT EM with the given number of entries. All
42809 * the EXT EM tables KEY0, KEY1, RECORD, EFC all have the
42810 * same number of entries and all tables will be configured
42811 * using this value. Current minimum value is 32k. Current
42812 * maximum value is 128M.
42813 */
42814 uint32_t num_entries;
42815 uint32_t enables;
42816 /*
42817 * This bit must be '1' for the group_id field to be
42818 * configured.
42819 */
42820 #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_GROUP_ID UINT32_C(0x1)
42821 /*
42822 * This bit must be '1' for the flush_interval field to be
42823 * configured.
42824 */
42825 #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_FLUSH_INTERVAL UINT32_C(0x2)
42826 /*
42827 * This bit must be '1' for the num_entries field to be
42828 * configured.
42829 */
42830 #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_NUM_ENTRIES UINT32_C(0x4)
42831 /*
42832 * This bit must be '1' for the key0_ctx_id field to be
42833 * configured.
42834 */
42835 #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_KEY0_CTX_ID UINT32_C(0x8)
42836 /*
42837 * This bit must be '1' for the key1_ctx_id field to be
42838 * configured.
42839 */
42840 #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_KEY1_CTX_ID UINT32_C(0x10)
42841 /*
42842 * This bit must be '1' for the record_ctx_id field to be
42843 * configured.
42844 */
42845 #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_RECORD_CTX_ID UINT32_C(0x20)
42846 /*
42847 * This bit must be '1' for the efc_ctx_id field to be
42848 * configured.
42849 */
42850 #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_EFC_CTX_ID UINT32_C(0x40)
42851 /*
42852 * This bit must be '1' for the fid_ctx_id field to be
42853 * configured.
42854 */
42855 #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_FID_CTX_ID UINT32_C(0x80)
42856 /*
42857 * This bit must be '1' for the action_ctx_id field to be
42858 * configured.
42859 */
42860 #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_ACTION_CTX_ID UINT32_C(0x100)
42861 /*
42862 * This bit must be '1' for the action_tbl_scope field to be
42863 * configured.
42864 */
42865 #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_ACTION_TBL_SCOPE UINT32_C(0x200)
42866 /*
42867 * This bit must be '1' for the lkup_ctx_id field to be
42868 * configured.
42869 */
42870 #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_LKUP_CTX_ID UINT32_C(0x400)
42871 /*
42872 * This bit must be '1' for the lkup_tbl_scope field to be
42873 * configured.
42874 */
42875 #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_LKUP_TBL_SCOPE UINT32_C(0x800)
42876 /*
42877 * This bit must be '1' for the lkup_static_buckets field to be
42878 * configured.
42879 */
42880 #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_LKUP_STATIC_BUCKETS UINT32_C(0x1000)
42881 /* Configured EXT EM with the given context if for KEY0 table. */
42882 uint16_t key0_ctx_id;
42883 /* Configured EXT EM with the given context if for KEY1 table. */
42884 uint16_t key1_ctx_id;
42885 /* Configured EXT EM with the given context if for RECORD table. */
42886 uint16_t record_ctx_id;
42887 /* Configured EXT EM with the given context if for EFC table. */
42888 uint16_t efc_ctx_id;
42889 /* Configured EXT EM with the given context if for EFC table. */
42890 uint16_t fid_ctx_id;
42891 /* Context id of action table scope. */
42892 uint16_t action_ctx_id;
42893 /* Table scope id used for action record entries. */
42894 uint16_t action_tbl_scope;
42895 /* Context id of lookup table scope. */
42896 uint16_t lkup_ctx_id;
42897 /* Table scope id used for EM lookup entries. */
42898 uint16_t lkup_tbl_scope;
42899 /* unused. */
42900 uint16_t unused1;
42901 /*
42902 * Number of 32B static buckets to be allocated at the beginning
42903 * of table scope.
42904 */
42905 uint32_t lkup_static_buckets;
42906 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
42907 uint32_t fw_session_id;
42908 /* unused. */
42909 uint32_t unused2;
42910 } hwrm_tf_ext_em_cfg_input_t, *phwrm_tf_ext_em_cfg_input_t;
42911
42912 /* hwrm_tf_ext_em_cfg_output (size:128b/16B) */
42913
42914 typedef struct hwrm_tf_ext_em_cfg_output {
42915 /* The specific error status for the command. */
42916 uint16_t error_code;
42917 /* The HWRM command request type. */
42918 uint16_t req_type;
42919 /* The sequence ID from the original command. */
42920 uint16_t seq_id;
42921 /* The length of the response data in number of bytes. */
42922 uint16_t resp_len;
42923 /* unused. */
42924 uint8_t unused0[7];
42925 /*
42926 * This field is used in Output records to indicate that the
42927 * output is completely written to RAM. This field should be
42928 * read as '1' to indicate that the output has been
42929 * completely written. When writing a command completion or
42930 * response to an internal processor, the order of writes has
42931 * to be such that this field is written last.
42932 */
42933 uint8_t valid;
42934 } hwrm_tf_ext_em_cfg_output_t, *phwrm_tf_ext_em_cfg_output_t;
42935
42936 /***********************
42937 * hwrm_tf_ext_em_qcfg *
42938 ***********************/
42939
42940
42941 /* hwrm_tf_ext_em_qcfg_input (size:192b/24B) */
42942
42943 typedef struct hwrm_tf_ext_em_qcfg_input {
42944 /* The HWRM command request type. */
42945 uint16_t req_type;
42946 /*
42947 * The completion ring to send the completion event on. This should
42948 * be the NQ ID returned from the `nq_alloc` HWRM command.
42949 */
42950 uint16_t cmpl_ring;
42951 /*
42952 * The sequence ID is used by the driver for tracking multiple
42953 * commands. This ID is treated as opaque data by the firmware and
42954 * the value is returned in the `hwrm_resp_hdr` upon completion.
42955 */
42956 uint16_t seq_id;
42957 /*
42958 * The target ID of the command:
42959 * * 0x0-0xFFF8 - The function ID
42960 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42961 * * 0xFFFD - Reserved for user-space HWRM interface
42962 * * 0xFFFF - HWRM
42963 */
42964 uint16_t target_id;
42965 /*
42966 * A physical address pointer pointing to a host buffer that the
42967 * command's response data will be written. This can be either a host
42968 * physical address (HPA) or a guest physical address (GPA) and must
42969 * point to a physically contiguous block of memory.
42970 */
42971 uint64_t resp_addr;
42972 /* Control flags. */
42973 uint32_t flags;
42974 /* Indicates the flow direction. */
42975 #define HWRM_TF_EXT_EM_QCFG_INPUT_FLAGS_DIR UINT32_C(0x1)
42976 /* If this bit set to 0, then it indicates rx flow. */
42977 #define HWRM_TF_EXT_EM_QCFG_INPUT_FLAGS_DIR_RX UINT32_C(0x0)
42978 /* If this bit is set to 1, then it indicates tx flow. */
42979 #define HWRM_TF_EXT_EM_QCFG_INPUT_FLAGS_DIR_TX UINT32_C(0x1)
42980 #define HWRM_TF_EXT_EM_QCFG_INPUT_FLAGS_DIR_LAST HWRM_TF_EXT_EM_QCFG_INPUT_FLAGS_DIR_TX
42981 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
42982 uint32_t fw_session_id;
42983 } hwrm_tf_ext_em_qcfg_input_t, *phwrm_tf_ext_em_qcfg_input_t;
42984
42985 /* hwrm_tf_ext_em_qcfg_output (size:448b/56B) */
42986
42987 typedef struct hwrm_tf_ext_em_qcfg_output {
42988 /* The specific error status for the command. */
42989 uint16_t error_code;
42990 /* The HWRM command request type. */
42991 uint16_t req_type;
42992 /* The sequence ID from the original command. */
42993 uint16_t seq_id;
42994 /* The length of the response data in number of bytes. */
42995 uint16_t resp_len;
42996 /* Control flags. */
42997 uint32_t flags;
42998 /* Indicates the flow direction. */
42999 #define HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_DIR UINT32_C(0x1)
43000 /* If this bit set to 0, then it indicates rx flow. */
43001 #define HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_DIR_RX UINT32_C(0x0)
43002 /* If this bit is set to 1, then it indicates tx flow. */
43003 #define HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_DIR_TX UINT32_C(0x1)
43004 #define HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_DIR_LAST HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_DIR_TX
43005 /* When set to 1, all offloaded flows will be sent to EXT EM. */
43006 #define HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_PREFERRED_OFFLOAD UINT32_C(0x2)
43007 /* The number of entries the FW has configured for EXT EM. */
43008 uint32_t num_entries;
43009 /* Configured EXT EM with the given context if for KEY0 table. */
43010 uint16_t key0_ctx_id;
43011 /* Configured EXT EM with the given context if for KEY1 table. */
43012 uint16_t key1_ctx_id;
43013 /* Configured EXT EM with the given context if for RECORD table. */
43014 uint16_t record_ctx_id;
43015 /* Configured EXT EM with the given context if for EFC table. */
43016 uint16_t efc_ctx_id;
43017 /* Configured EXT EM with the given context if for EFC table. */
43018 uint16_t fid_ctx_id;
43019 /* unused. */
43020 uint16_t unused0;
43021 uint32_t supported;
43022 /* This bit must be '1' for the group_id field is set. */
43023 #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_GROUP_ID UINT32_C(0x1)
43024 /* This bit must be '1' for the flush_interval field is set. */
43025 #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_FLUSH_INTERVAL UINT32_C(0x2)
43026 /* This bit must be '1' for the num_entries field is set. */
43027 #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_NUM_ENTRIES UINT32_C(0x4)
43028 /* This bit must be '1' for the key0_ctx_id field is set. */
43029 #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_KEY0_CTX_ID UINT32_C(0x8)
43030 /* This bit must be '1' for the key1_ctx_id field is set. */
43031 #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_KEY1_CTX_ID UINT32_C(0x10)
43032 /* This bit must be '1' for the record_ctx_id field is set. */
43033 #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_RECORD_CTX_ID UINT32_C(0x20)
43034 /* This bit must be '1' for the efc_ctx_id field is set. */
43035 #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_EFC_CTX_ID UINT32_C(0x40)
43036 /* This bit must be '1' for the fid_ctx_id field is set. */
43037 #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_FID_CTX_ID UINT32_C(0x80)
43038 /* This bit must be '1' for the action_ctx_id field is set. */
43039 #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_ACTION_CTX_ID UINT32_C(0x100)
43040 /* This bit must be '1' for the action_tbl_scope field is set. */
43041 #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_ACTION_TBL_SCOPE UINT32_C(0x200)
43042 /* This bit must be '1' for the lkup_ctx_id field is set. */
43043 #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_LKUP_CTX_ID UINT32_C(0x400)
43044 /* This bit must be '1' for the lkup_tbl_scope field is set. */
43045 #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_LKUP_TBL_SCOPE UINT32_C(0x800)
43046 /* This bit must be '1' for the lkup_static_buckets field is set. */
43047 #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_LKUP_STATIC_BUCKETS UINT32_C(0x1000)
43048 /*
43049 * Group id is used by firmware to identify memory pools belonging
43050 * to certain group.
43051 */
43052 uint16_t group_id;
43053 /* EEM pending cache flush interval in 1/10th of second. */
43054 uint8_t flush_interval;
43055 /* unused. */
43056 uint8_t unused1;
43057 /* Context id of action table scope. */
43058 uint16_t action_ctx_id;
43059 /* Table scope id used for action record entries. */
43060 uint16_t action_tbl_scope;
43061 /* Context id of lookup table scope. */
43062 uint16_t lkup_ctx_id;
43063 /* Table scope id used for EM lookup entries. */
43064 uint16_t lkup_tbl_scope;
43065 /*
43066 * Number of 32B static buckets to be allocated at the beginning
43067 * of table scope.
43068 */
43069 uint32_t lkup_static_buckets;
43070 /* unused. */
43071 uint8_t unused2[7];
43072 /*
43073 * This field is used in Output records to indicate that the
43074 * output is completely written to RAM. This field should be
43075 * read as '1' to indicate that the output has been
43076 * completely written. When writing a command completion or
43077 * response to an internal processor, the order of writes has
43078 * to be such that this field is written last.
43079 */
43080 uint8_t valid;
43081 } hwrm_tf_ext_em_qcfg_output_t, *phwrm_tf_ext_em_qcfg_output_t;
43082
43083 /*********************
43084 * hwrm_tf_em_insert *
43085 *********************/
43086
43087
43088 /* hwrm_tf_em_insert_input (size:832b/104B) */
43089
43090 typedef struct hwrm_tf_em_insert_input {
43091 /* The HWRM command request type. */
43092 uint16_t req_type;
43093 /*
43094 * The completion ring to send the completion event on. This should
43095 * be the NQ ID returned from the `nq_alloc` HWRM command.
43096 */
43097 uint16_t cmpl_ring;
43098 /*
43099 * The sequence ID is used by the driver for tracking multiple
43100 * commands. This ID is treated as opaque data by the firmware and
43101 * the value is returned in the `hwrm_resp_hdr` upon completion.
43102 */
43103 uint16_t seq_id;
43104 /*
43105 * The target ID of the command:
43106 * * 0x0-0xFFF8 - The function ID
43107 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43108 * * 0xFFFD - Reserved for user-space HWRM interface
43109 * * 0xFFFF - HWRM
43110 */
43111 uint16_t target_id;
43112 /*
43113 * A physical address pointer pointing to a host buffer that the
43114 * command's response data will be written. This can be either a host
43115 * physical address (HPA) or a guest physical address (GPA) and must
43116 * point to a physically contiguous block of memory.
43117 */
43118 uint64_t resp_addr;
43119 /* Firmware Session Id. */
43120 uint32_t fw_session_id;
43121 /* Control Flags. */
43122 uint16_t flags;
43123 /* Indicates the flow direction. */
43124 #define HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR UINT32_C(0x1)
43125 /* If this bit set to 0, then it indicates rx flow. */
43126 #define HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_RX UINT32_C(0x0)
43127 /* If this bit is set to 1, then it indicates tx flow. */
43128 #define HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_TX UINT32_C(0x1)
43129 #define HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_LAST HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_TX
43130 /* Reported match strength. */
43131 uint16_t strength;
43132 /* Index to action. */
43133 uint32_t action_ptr;
43134 /* Index of EM record. */
43135 uint32_t em_record_idx;
43136 /* EM Key value. */
43137 uint64_t em_key[8];
43138 /* Number of bits in em_key. */
43139 uint16_t em_key_bitlen;
43140 /* unused. */
43141 uint16_t unused0[3];
43142 } hwrm_tf_em_insert_input_t, *phwrm_tf_em_insert_input_t;
43143
43144 /* hwrm_tf_em_insert_output (size:128b/16B) */
43145
43146 typedef struct hwrm_tf_em_insert_output {
43147 /* The specific error status for the command. */
43148 uint16_t error_code;
43149 /* The HWRM command request type. */
43150 uint16_t req_type;
43151 /* The sequence ID from the original command. */
43152 uint16_t seq_id;
43153 /* The length of the response data in number of bytes. */
43154 uint16_t resp_len;
43155 /* EM record pointer index. */
43156 uint16_t rptr_index;
43157 /* EM record offset 0~3. */
43158 uint8_t rptr_entry;
43159 /* Number of word entries consumed by the key. */
43160 uint8_t num_of_entries;
43161 /* unused. */
43162 uint32_t unused0;
43163 } hwrm_tf_em_insert_output_t, *phwrm_tf_em_insert_output_t;
43164
43165 /**************************
43166 * hwrm_tf_em_hash_insert *
43167 **************************/
43168
43169
43170 /* hwrm_tf_em_hash_insert_input (size:1024b/128B) */
43171
43172 typedef struct hwrm_tf_em_hash_insert_input {
43173 /* The HWRM command request type. */
43174 uint16_t req_type;
43175 /*
43176 * The completion ring to send the completion event on. This should
43177 * be the NQ ID returned from the `nq_alloc` HWRM command.
43178 */
43179 uint16_t cmpl_ring;
43180 /*
43181 * The sequence ID is used by the driver for tracking multiple
43182 * commands. This ID is treated as opaque data by the firmware and
43183 * the value is returned in the `hwrm_resp_hdr` upon completion.
43184 */
43185 uint16_t seq_id;
43186 /*
43187 * The target ID of the command:
43188 * * 0x0-0xFFF8 - The function ID
43189 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43190 * * 0xFFFD - Reserved for user-space HWRM interface
43191 * * 0xFFFF - HWRM
43192 */
43193 uint16_t target_id;
43194 /*
43195 * A physical address pointer pointing to a host buffer that the
43196 * command's response data will be written. This can be either a host
43197 * physical address (HPA) or a guest physical address (GPA) and must
43198 * point to a physically contiguous block of memory.
43199 */
43200 uint64_t resp_addr;
43201 /* Firmware Session Id. */
43202 uint32_t fw_session_id;
43203 /* Control Flags. */
43204 uint16_t flags;
43205 /* Indicates the flow direction. */
43206 #define HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DIR UINT32_C(0x1)
43207 /* If this bit set to 0, then it indicates rx flow. */
43208 #define HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DIR_RX UINT32_C(0x0)
43209 /* If this bit is set to 1, then it indicates tx flow. */
43210 #define HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DIR_TX UINT32_C(0x1)
43211 #define HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DIR_LAST HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DIR_TX
43212 /* Number of bits in the EM record. */
43213 uint16_t em_record_size_bits;
43214 /* CRC32 hash of key. */
43215 uint32_t key0_hash;
43216 /* Lookup3 hash of key. */
43217 uint32_t key1_hash;
43218 /* Index of EM record. */
43219 uint32_t em_record_idx;
43220 /* Unused. */
43221 uint32_t unused0;
43222 /* EM record. */
43223 uint64_t em_record[11];
43224 } hwrm_tf_em_hash_insert_input_t, *phwrm_tf_em_hash_insert_input_t;
43225
43226 /* hwrm_tf_em_hash_insert_output (size:128b/16B) */
43227
43228 typedef struct hwrm_tf_em_hash_insert_output {
43229 /* The specific error status for the command. */
43230 uint16_t error_code;
43231 /* The HWRM command request type. */
43232 uint16_t req_type;
43233 /* The sequence ID from the original command. */
43234 uint16_t seq_id;
43235 /* The length of the response data in number of bytes. */
43236 uint16_t resp_len;
43237 /* EM record pointer index. */
43238 uint16_t rptr_index;
43239 /* EM record offset 0~3. */
43240 uint8_t rptr_entry;
43241 /* Number of word entries consumed by the key. */
43242 uint8_t num_of_entries;
43243 /* unused. */
43244 uint32_t unused0;
43245 } hwrm_tf_em_hash_insert_output_t, *phwrm_tf_em_hash_insert_output_t;
43246
43247 /*********************
43248 * hwrm_tf_em_delete *
43249 *********************/
43250
43251
43252 /* hwrm_tf_em_delete_input (size:832b/104B) */
43253
43254 typedef struct hwrm_tf_em_delete_input {
43255 /* The HWRM command request type. */
43256 uint16_t req_type;
43257 /*
43258 * The completion ring to send the completion event on. This should
43259 * be the NQ ID returned from the `nq_alloc` HWRM command.
43260 */
43261 uint16_t cmpl_ring;
43262 /*
43263 * The sequence ID is used by the driver for tracking multiple
43264 * commands. This ID is treated as opaque data by the firmware and
43265 * the value is returned in the `hwrm_resp_hdr` upon completion.
43266 */
43267 uint16_t seq_id;
43268 /*
43269 * The target ID of the command:
43270 * * 0x0-0xFFF8 - The function ID
43271 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43272 * * 0xFFFD - Reserved for user-space HWRM interface
43273 * * 0xFFFF - HWRM
43274 */
43275 uint16_t target_id;
43276 /*
43277 * A physical address pointer pointing to a host buffer that the
43278 * command's response data will be written. This can be either a host
43279 * physical address (HPA) or a guest physical address (GPA) and must
43280 * point to a physically contiguous block of memory.
43281 */
43282 uint64_t resp_addr;
43283 /* Session Id. */
43284 uint32_t fw_session_id;
43285 /* Control flags. */
43286 uint16_t flags;
43287 /* Indicates the flow direction. */
43288 #define HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR UINT32_C(0x1)
43289 /* If this bit set to 0, then it indicates rx flow. */
43290 #define HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR_RX UINT32_C(0x0)
43291 /* If this bit is set to 1, then it indicates tx flow. */
43292 #define HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR_TX UINT32_C(0x1)
43293 #define HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR_LAST HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR_TX
43294 /* Unused0 */
43295 uint16_t unused0;
43296 /* EM internal flow handle. */
43297 uint64_t flow_handle;
43298 /* EM Key value */
43299 uint64_t em_key[8];
43300 /* Number of bits in em_key. */
43301 uint16_t em_key_bitlen;
43302 /* unused. */
43303 uint16_t unused1[3];
43304 } hwrm_tf_em_delete_input_t, *phwrm_tf_em_delete_input_t;
43305
43306 /* hwrm_tf_em_delete_output (size:128b/16B) */
43307
43308 typedef struct hwrm_tf_em_delete_output {
43309 /* The specific error status for the command. */
43310 uint16_t error_code;
43311 /* The HWRM command request type. */
43312 uint16_t req_type;
43313 /* The sequence ID from the original command. */
43314 uint16_t seq_id;
43315 /* The length of the response data in number of bytes. */
43316 uint16_t resp_len;
43317 /* Original stack allocation index. */
43318 uint16_t em_index;
43319 /* unused. */
43320 uint16_t unused0[3];
43321 } hwrm_tf_em_delete_output_t, *phwrm_tf_em_delete_output_t;
43322
43323 /*******************
43324 * hwrm_tf_em_move *
43325 *******************/
43326
43327
43328 /* hwrm_tf_em_move_input (size:320b/40B) */
43329
43330 typedef struct hwrm_tf_em_move_input {
43331 /* The HWRM command request type. */
43332 uint16_t req_type;
43333 /*
43334 * The completion ring to send the completion event on. This should
43335 * be the NQ ID returned from the `nq_alloc` HWRM command.
43336 */
43337 uint16_t cmpl_ring;
43338 /*
43339 * The sequence ID is used by the driver for tracking multiple
43340 * commands. This ID is treated as opaque data by the firmware and
43341 * the value is returned in the `hwrm_resp_hdr` upon completion.
43342 */
43343 uint16_t seq_id;
43344 /*
43345 * The target ID of the command:
43346 * * 0x0-0xFFF8 - The function ID
43347 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43348 * * 0xFFFD - Reserved for user-space HWRM interface
43349 * * 0xFFFF - HWRM
43350 */
43351 uint16_t target_id;
43352 /*
43353 * A physical address pointer pointing to a host buffer that the
43354 * command's response data will be written. This can be either a host
43355 * physical address (HPA) or a guest physical address (GPA) and must
43356 * point to a physically contiguous block of memory.
43357 */
43358 uint64_t resp_addr;
43359 /* Session Id. */
43360 uint32_t fw_session_id;
43361 /* Control flags. */
43362 uint16_t flags;
43363 /* Indicates the flow direction. */
43364 #define HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR UINT32_C(0x1)
43365 /* If this bit set to 0, then it indicates rx flow. */
43366 #define HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR_RX UINT32_C(0x0)
43367 /* If this bit is set to 1, then it indicates tx flow. */
43368 #define HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR_TX UINT32_C(0x1)
43369 #define HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR_LAST HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR_TX
43370 /* Number of EM entry blocks */
43371 uint16_t num_blocks;
43372 /* New index for entry */
43373 uint32_t new_index;
43374 /* Unused */
43375 uint32_t unused0;
43376 /* EM internal flow handle. */
43377 uint64_t flow_handle;
43378 } hwrm_tf_em_move_input_t, *phwrm_tf_em_move_input_t;
43379
43380 /* hwrm_tf_em_move_output (size:128b/16B) */
43381
43382 typedef struct hwrm_tf_em_move_output {
43383 /* The specific error status for the command. */
43384 uint16_t error_code;
43385 /* The HWRM command request type. */
43386 uint16_t req_type;
43387 /* The sequence ID from the original command. */
43388 uint16_t seq_id;
43389 /* The length of the response data in number of bytes. */
43390 uint16_t resp_len;
43391 /* Index of old entry. */
43392 uint16_t em_index;
43393 /* unused. */
43394 uint16_t unused0[3];
43395 } hwrm_tf_em_move_output_t, *phwrm_tf_em_move_output_t;
43396
43397 /********************
43398 * hwrm_tf_tcam_set *
43399 ********************/
43400
43401
43402 /* hwrm_tf_tcam_set_input (size:1024b/128B) */
43403
43404 typedef struct hwrm_tf_tcam_set_input {
43405 /* The HWRM command request type. */
43406 uint16_t req_type;
43407 /*
43408 * The completion ring to send the completion event on. This should
43409 * be the NQ ID returned from the `nq_alloc` HWRM command.
43410 */
43411 uint16_t cmpl_ring;
43412 /*
43413 * The sequence ID is used by the driver for tracking multiple
43414 * commands. This ID is treated as opaque data by the firmware and
43415 * the value is returned in the `hwrm_resp_hdr` upon completion.
43416 */
43417 uint16_t seq_id;
43418 /*
43419 * The target ID of the command:
43420 * * 0x0-0xFFF8 - The function ID
43421 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43422 * * 0xFFFD - Reserved for user-space HWRM interface
43423 * * 0xFFFF - HWRM
43424 */
43425 uint16_t target_id;
43426 /*
43427 * A physical address pointer pointing to a host buffer that the
43428 * command's response data will be written. This can be either a host
43429 * physical address (HPA) or a guest physical address (GPA) and must
43430 * point to a physically contiguous block of memory.
43431 */
43432 uint64_t resp_addr;
43433 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
43434 uint32_t fw_session_id;
43435 /* Control flags. */
43436 uint32_t flags;
43437 /* Indicates the flow direction. */
43438 #define HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR UINT32_C(0x1)
43439 /* If this bit set to 0, then it indicates rx flow. */
43440 #define HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR_RX UINT32_C(0x0)
43441 /* If this bit is set to 1, then it indicates tx flow. */
43442 #define HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR_TX UINT32_C(0x1)
43443 #define HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR_LAST HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR_TX
43444 /*
43445 * Indicate device data is being sent via DMA, the device
43446 * data is packing does not change.
43447 */
43448 #define HWRM_TF_TCAM_SET_INPUT_FLAGS_DMA UINT32_C(0x2)
43449 /*
43450 * TCAM type of the resource, defined globally in the
43451 * hwrm_tf_resc_type enum.
43452 */
43453 uint32_t type;
43454 /* Index of TCAM entry. */
43455 uint16_t idx;
43456 /* Number of bytes in the TCAM key. */
43457 uint8_t key_size;
43458 /* Number of bytes in the TCAM result. */
43459 uint8_t result_size;
43460 /*
43461 * Offset from which the mask bytes start in the device data
43462 * array, key offset is always 0.
43463 */
43464 uint8_t mask_offset;
43465 /* Offset from which the result bytes start in the device data array. */
43466 uint8_t result_offset;
43467 /* unused. */
43468 uint8_t unused0[6];
43469 /*
43470 * TCAM key located at offset 0, mask located at mask_offsec
43471 * and result at result_offsec for the device.
43472 */
43473 uint8_t dev_data[88];
43474 } hwrm_tf_tcam_set_input_t, *phwrm_tf_tcam_set_input_t;
43475
43476 /* hwrm_tf_tcam_set_output (size:128b/16B) */
43477
43478 typedef struct hwrm_tf_tcam_set_output {
43479 /* The specific error status for the command. */
43480 uint16_t error_code;
43481 /* The HWRM command request type. */
43482 uint16_t req_type;
43483 /* The sequence ID from the original command. */
43484 uint16_t seq_id;
43485 /* The length of the response data in number of bytes. */
43486 uint16_t resp_len;
43487 /* unused. */
43488 uint8_t unused0[7];
43489 /*
43490 * This field is used in Output records to indicate that the
43491 * output is completely written to RAM. This field should be
43492 * read as '1' to indicate that the output has been
43493 * completely written. When writing a command completion or
43494 * response to an internal processor, the order of writes has
43495 * to be such that this field is written last.
43496 */
43497 uint8_t valid;
43498 } hwrm_tf_tcam_set_output_t, *phwrm_tf_tcam_set_output_t;
43499
43500 /********************
43501 * hwrm_tf_tcam_get *
43502 ********************/
43503
43504
43505 /* hwrm_tf_tcam_get_input (size:256b/32B) */
43506
43507 typedef struct hwrm_tf_tcam_get_input {
43508 /* The HWRM command request type. */
43509 uint16_t req_type;
43510 /*
43511 * The completion ring to send the completion event on. This should
43512 * be the NQ ID returned from the `nq_alloc` HWRM command.
43513 */
43514 uint16_t cmpl_ring;
43515 /*
43516 * The sequence ID is used by the driver for tracking multiple
43517 * commands. This ID is treated as opaque data by the firmware and
43518 * the value is returned in the `hwrm_resp_hdr` upon completion.
43519 */
43520 uint16_t seq_id;
43521 /*
43522 * The target ID of the command:
43523 * * 0x0-0xFFF8 - The function ID
43524 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43525 * * 0xFFFD - Reserved for user-space HWRM interface
43526 * * 0xFFFF - HWRM
43527 */
43528 uint16_t target_id;
43529 /*
43530 * A physical address pointer pointing to a host buffer that the
43531 * command's response data will be written. This can be either a host
43532 * physical address (HPA) or a guest physical address (GPA) and must
43533 * point to a physically contiguous block of memory.
43534 */
43535 uint64_t resp_addr;
43536 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
43537 uint32_t fw_session_id;
43538 /* Control flags. */
43539 uint32_t flags;
43540 /* Indicates the flow direction. */
43541 #define HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR UINT32_C(0x1)
43542 /* If this bit set to 0, then it indicates rx flow. */
43543 #define HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR_RX UINT32_C(0x0)
43544 /* If this bit is set to 1, then it indicates tx flow. */
43545 #define HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR_TX UINT32_C(0x1)
43546 #define HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR_LAST HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR_TX
43547 /*
43548 * TCAM type of the resource, defined globally in the
43549 * hwrm_tf_resc_type enum.
43550 */
43551 uint32_t type;
43552 /* Index of a TCAM entry. */
43553 uint16_t idx;
43554 /* unused. */
43555 uint16_t unused0;
43556 } hwrm_tf_tcam_get_input_t, *phwrm_tf_tcam_get_input_t;
43557
43558 /* hwrm_tf_tcam_get_output (size:2368b/296B) */
43559
43560 typedef struct hwrm_tf_tcam_get_output {
43561 /* The specific error status for the command. */
43562 uint16_t error_code;
43563 /* The HWRM command request type. */
43564 uint16_t req_type;
43565 /* The sequence ID from the original command. */
43566 uint16_t seq_id;
43567 /* The length of the response data in number of bytes. */
43568 uint16_t resp_len;
43569 /* Number of bytes in the TCAM key. */
43570 uint8_t key_size;
43571 /* Number of bytes in the TCAM entry. */
43572 uint8_t result_size;
43573 /* Offset from which the mask bytes start in the device data array. */
43574 uint8_t mask_offset;
43575 /* Offset from which the result bytes start in the device data array. */
43576 uint8_t result_offset;
43577 /* unused. */
43578 uint8_t unused0[4];
43579 /*
43580 * TCAM key located at offset 0, mask located at mask_offsec
43581 * and result at result_offsec for the device.
43582 */
43583 uint8_t dev_data[272];
43584 /* unused. */
43585 uint8_t unused1[7];
43586 /*
43587 * This field is used in Output records to indicate that the
43588 * output is completely written to RAM. This field should be
43589 * read as '1' to indicate that the output has been
43590 * completely written. When writing a command completion or
43591 * response to an internal processor, the order of writes has
43592 * to be such that this field is written last.
43593 */
43594 uint8_t valid;
43595 } hwrm_tf_tcam_get_output_t, *phwrm_tf_tcam_get_output_t;
43596
43597 /*********************
43598 * hwrm_tf_tcam_move *
43599 *********************/
43600
43601
43602 /* hwrm_tf_tcam_move_input (size:1024b/128B) */
43603
43604 typedef struct hwrm_tf_tcam_move_input {
43605 /* The HWRM command request type. */
43606 uint16_t req_type;
43607 /*
43608 * The completion ring to send the completion event on. This should
43609 * be the NQ ID returned from the `nq_alloc` HWRM command.
43610 */
43611 uint16_t cmpl_ring;
43612 /*
43613 * The sequence ID is used by the driver for tracking multiple
43614 * commands. This ID is treated as opaque data by the firmware and
43615 * the value is returned in the `hwrm_resp_hdr` upon completion.
43616 */
43617 uint16_t seq_id;
43618 /*
43619 * The target ID of the command:
43620 * * 0x0-0xFFF8 - The function ID
43621 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43622 * * 0xFFFD - Reserved for user-space HWRM interface
43623 * * 0xFFFF - HWRM
43624 */
43625 uint16_t target_id;
43626 /*
43627 * A physical address pointer pointing to a host buffer that the
43628 * command's response data will be written. This can be either a host
43629 * physical address (HPA) or a guest physical address (GPA) and must
43630 * point to a physically contiguous block of memory.
43631 */
43632 uint64_t resp_addr;
43633 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
43634 uint32_t fw_session_id;
43635 /* Control flags. */
43636 uint32_t flags;
43637 /* Indicates the flow direction. */
43638 #define HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR UINT32_C(0x1)
43639 /* If this bit set to 0, then it indicates rx flow. */
43640 #define HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR_RX UINT32_C(0x0)
43641 /* If this bit is set to 1, then it indicates tx flow. */
43642 #define HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR_TX UINT32_C(0x1)
43643 #define HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR_LAST HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR_TX
43644 /*
43645 * TCAM type of the resource, defined globally in the
43646 * hwrm_tf_resc_type enum.
43647 */
43648 uint32_t type;
43649 /* Number of TCAM index pairs to be swapped for the device. */
43650 uint16_t count;
43651 /* unused. */
43652 uint16_t unused0;
43653 /* TCAM index pairs to be swapped for the device. */
43654 uint16_t idx_pairs[48];
43655 } hwrm_tf_tcam_move_input_t, *phwrm_tf_tcam_move_input_t;
43656
43657 /* hwrm_tf_tcam_move_output (size:128b/16B) */
43658
43659 typedef struct hwrm_tf_tcam_move_output {
43660 /* The specific error status for the command. */
43661 uint16_t error_code;
43662 /* The HWRM command request type. */
43663 uint16_t req_type;
43664 /* The sequence ID from the original command. */
43665 uint16_t seq_id;
43666 /* The length of the response data in number of bytes. */
43667 uint16_t resp_len;
43668 /* unused. */
43669 uint8_t unused0[7];
43670 /*
43671 * This field is used in Output records to indicate that the
43672 * output is completely written to RAM. This field should be
43673 * read as '1' to indicate that the output has been
43674 * completely written. When writing a command completion or
43675 * response to an internal processor, the order of writes has
43676 * to be such that this field is written last.
43677 */
43678 uint8_t valid;
43679 } hwrm_tf_tcam_move_output_t, *phwrm_tf_tcam_move_output_t;
43680
43681 /*********************
43682 * hwrm_tf_tcam_free *
43683 *********************/
43684
43685
43686 /* hwrm_tf_tcam_free_input (size:1024b/128B) */
43687
43688 typedef struct hwrm_tf_tcam_free_input {
43689 /* The HWRM command request type. */
43690 uint16_t req_type;
43691 /*
43692 * The completion ring to send the completion event on. This should
43693 * be the NQ ID returned from the `nq_alloc` HWRM command.
43694 */
43695 uint16_t cmpl_ring;
43696 /*
43697 * The sequence ID is used by the driver for tracking multiple
43698 * commands. This ID is treated as opaque data by the firmware and
43699 * the value is returned in the `hwrm_resp_hdr` upon completion.
43700 */
43701 uint16_t seq_id;
43702 /*
43703 * The target ID of the command:
43704 * * 0x0-0xFFF8 - The function ID
43705 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43706 * * 0xFFFD - Reserved for user-space HWRM interface
43707 * * 0xFFFF - HWRM
43708 */
43709 uint16_t target_id;
43710 /*
43711 * A physical address pointer pointing to a host buffer that the
43712 * command's response data will be written. This can be either a host
43713 * physical address (HPA) or a guest physical address (GPA) and must
43714 * point to a physically contiguous block of memory.
43715 */
43716 uint64_t resp_addr;
43717 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
43718 uint32_t fw_session_id;
43719 /* Control flags. */
43720 uint32_t flags;
43721 /* Indicates the flow direction. */
43722 #define HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR UINT32_C(0x1)
43723 /* If this bit set to 0, then it indicates rx flow. */
43724 #define HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR_RX UINT32_C(0x0)
43725 /* If this bit is set to 1, then it indicates tx flow. */
43726 #define HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR_TX UINT32_C(0x1)
43727 #define HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR_LAST HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR_TX
43728 /*
43729 * TCAM type of the resource, defined globally in the
43730 * hwrm_tf_resc_type enum.
43731 */
43732 uint32_t type;
43733 /* Number of TCAM index to be deleted for the device. */
43734 uint16_t count;
43735 /* unused. */
43736 uint16_t unused0;
43737 /* TCAM index list to be deleted for the device. */
43738 uint16_t idx_list[48];
43739 } hwrm_tf_tcam_free_input_t, *phwrm_tf_tcam_free_input_t;
43740
43741 /* hwrm_tf_tcam_free_output (size:128b/16B) */
43742
43743 typedef struct hwrm_tf_tcam_free_output {
43744 /* The specific error status for the command. */
43745 uint16_t error_code;
43746 /* The HWRM command request type. */
43747 uint16_t req_type;
43748 /* The sequence ID from the original command. */
43749 uint16_t seq_id;
43750 /* The length of the response data in number of bytes. */
43751 uint16_t resp_len;
43752 /* unused. */
43753 uint8_t unused0[7];
43754 /*
43755 * This field is used in Output records to indicate that the
43756 * output is completely written to RAM. This field should be
43757 * read as '1' to indicate that the output has been
43758 * completely written. When writing a command completion or
43759 * response to an internal processor, the order of writes has
43760 * to be such that this field is written last.
43761 */
43762 uint8_t valid;
43763 } hwrm_tf_tcam_free_output_t, *phwrm_tf_tcam_free_output_t;
43764
43765 /**************************
43766 * hwrm_tf_global_cfg_set *
43767 **************************/
43768
43769
43770 /* hwrm_tf_global_cfg_set_input (size:448b/56B) */
43771
43772 typedef struct hwrm_tf_global_cfg_set_input {
43773 /* The HWRM command request type. */
43774 uint16_t req_type;
43775 /*
43776 * The completion ring to send the completion event on. This should
43777 * be the NQ ID returned from the `nq_alloc` HWRM command.
43778 */
43779 uint16_t cmpl_ring;
43780 /*
43781 * The sequence ID is used by the driver for tracking multiple
43782 * commands. This ID is treated as opaque data by the firmware and
43783 * the value is returned in the `hwrm_resp_hdr` upon completion.
43784 */
43785 uint16_t seq_id;
43786 /*
43787 * The target ID of the command:
43788 * * 0x0-0xFFF8 - The function ID
43789 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43790 * * 0xFFFD - Reserved for user-space HWRM interface
43791 * * 0xFFFF - HWRM
43792 */
43793 uint16_t target_id;
43794 /*
43795 * A physical address pointer pointing to a host buffer that the
43796 * command's response data will be written. This can be either a host
43797 * physical address (HPA) or a guest physical address (GPA) and must
43798 * point to a physically contiguous block of memory.
43799 */
43800 uint64_t resp_addr;
43801 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
43802 uint32_t fw_session_id;
43803 /* Control flags. */
43804 uint32_t flags;
43805 /* Indicates the flow direction. */
43806 #define HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR UINT32_C(0x1)
43807 /* If this bit set to 0, then it indicates rx flow. */
43808 #define HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR_RX UINT32_C(0x0)
43809 /* If this bit is set to 1, then it indicates tx flow. */
43810 #define HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR_TX UINT32_C(0x1)
43811 #define HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR_LAST HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR_TX
43812 /* Global Cfg type */
43813 uint32_t type;
43814 /* Offset of the type */
43815 uint32_t offset;
43816 /* Size of the data to set in bytes */
43817 uint16_t size;
43818 /* unused. */
43819 uint8_t unused0[6];
43820 /* Data to set */
43821 uint8_t data[8];
43822 /* Mask of data to set, 0 indicates no mask */
43823 uint8_t mask[8];
43824 } hwrm_tf_global_cfg_set_input_t, *phwrm_tf_global_cfg_set_input_t;
43825
43826 /* hwrm_tf_global_cfg_set_output (size:128b/16B) */
43827
43828 typedef struct hwrm_tf_global_cfg_set_output {
43829 /* The specific error status for the command. */
43830 uint16_t error_code;
43831 /* The HWRM command request type. */
43832 uint16_t req_type;
43833 /* The sequence ID from the original command. */
43834 uint16_t seq_id;
43835 /* The length of the response data in number of bytes. */
43836 uint16_t resp_len;
43837 /* unused. */
43838 uint8_t unused0[7];
43839 /*
43840 * This field is used in Output records to indicate that the
43841 * output is completely written to RAM. This field should be
43842 * read as '1' to indicate that the output has been
43843 * completely written. When writing a command completion or
43844 * response to an internal processor, the order of writes has
43845 * to be such that this field is written last.
43846 */
43847 uint8_t valid;
43848 } hwrm_tf_global_cfg_set_output_t, *phwrm_tf_global_cfg_set_output_t;
43849
43850 /**************************
43851 * hwrm_tf_global_cfg_get *
43852 **************************/
43853
43854
43855 /* hwrm_tf_global_cfg_get_input (size:320b/40B) */
43856
43857 typedef struct hwrm_tf_global_cfg_get_input {
43858 /* The HWRM command request type. */
43859 uint16_t req_type;
43860 /*
43861 * The completion ring to send the completion event on. This should
43862 * be the NQ ID returned from the `nq_alloc` HWRM command.
43863 */
43864 uint16_t cmpl_ring;
43865 /*
43866 * The sequence ID is used by the driver for tracking multiple
43867 * commands. This ID is treated as opaque data by the firmware and
43868 * the value is returned in the `hwrm_resp_hdr` upon completion.
43869 */
43870 uint16_t seq_id;
43871 /*
43872 * The target ID of the command:
43873 * * 0x0-0xFFF8 - The function ID
43874 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43875 * * 0xFFFD - Reserved for user-space HWRM interface
43876 * * 0xFFFF - HWRM
43877 */
43878 uint16_t target_id;
43879 /*
43880 * A physical address pointer pointing to a host buffer that the
43881 * command's response data will be written. This can be either a host
43882 * physical address (HPA) or a guest physical address (GPA) and must
43883 * point to a physically contiguous block of memory.
43884 */
43885 uint64_t resp_addr;
43886 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
43887 uint32_t fw_session_id;
43888 /* Control flags. */
43889 uint32_t flags;
43890 /* Indicates the flow direction. */
43891 #define HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR UINT32_C(0x1)
43892 /* If this bit set to 0, then it indicates rx flow. */
43893 #define HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR_RX UINT32_C(0x0)
43894 /* If this bit is set to 1, then it indicates tx flow. */
43895 #define HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR_TX UINT32_C(0x1)
43896 #define HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR_LAST HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR_TX
43897 /* Global Cfg type */
43898 uint32_t type;
43899 /* Offset of the type */
43900 uint32_t offset;
43901 /* Size of the data to set in bytes */
43902 uint16_t size;
43903 /* unused. */
43904 uint8_t unused0[6];
43905 } hwrm_tf_global_cfg_get_input_t, *phwrm_tf_global_cfg_get_input_t;
43906
43907 /* hwrm_tf_global_cfg_get_output (size:256b/32B) */
43908
43909 typedef struct hwrm_tf_global_cfg_get_output {
43910 /* The specific error status for the command. */
43911 uint16_t error_code;
43912 /* The HWRM command request type. */
43913 uint16_t req_type;
43914 /* The sequence ID from the original command. */
43915 uint16_t seq_id;
43916 /* The length of the response data in number of bytes. */
43917 uint16_t resp_len;
43918 /* Size of the data read in bytes */
43919 uint16_t size;
43920 /* unused. */
43921 uint8_t unused0[6];
43922 /* Data to set */
43923 uint8_t data[16];
43924 } hwrm_tf_global_cfg_get_output_t, *phwrm_tf_global_cfg_get_output_t;
43925
43926 /**********************
43927 * hwrm_tf_if_tbl_get *
43928 **********************/
43929
43930
43931 /* hwrm_tf_if_tbl_get_input (size:256b/32B) */
43932
43933 typedef struct hwrm_tf_if_tbl_get_input {
43934 /* The HWRM command request type. */
43935 uint16_t req_type;
43936 /*
43937 * The completion ring to send the completion event on. This should
43938 * be the NQ ID returned from the `nq_alloc` HWRM command.
43939 */
43940 uint16_t cmpl_ring;
43941 /*
43942 * The sequence ID is used by the driver for tracking multiple
43943 * commands. This ID is treated as opaque data by the firmware and
43944 * the value is returned in the `hwrm_resp_hdr` upon completion.
43945 */
43946 uint16_t seq_id;
43947 /*
43948 * The target ID of the command:
43949 * * 0x0-0xFFF8 - The function ID
43950 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43951 * * 0xFFFD - Reserved for user-space HWRM interface
43952 * * 0xFFFF - HWRM
43953 */
43954 uint16_t target_id;
43955 /*
43956 * A physical address pointer pointing to a host buffer that the
43957 * command's response data will be written. This can be either a host
43958 * physical address (HPA) or a guest physical address (GPA) and must
43959 * point to a physically contiguous block of memory.
43960 */
43961 uint64_t resp_addr;
43962 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
43963 uint32_t fw_session_id;
43964 /* Control flags. */
43965 uint16_t flags;
43966 /* Indicates the flow direction. */
43967 #define HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR UINT32_C(0x1)
43968 /* If this bit set to 0, then it indicates rx flow. */
43969 #define HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_RX UINT32_C(0x0)
43970 /* If this bit is set to 1, then it indicates tx flow. */
43971 #define HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_TX UINT32_C(0x1)
43972 #define HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_LAST HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_TX
43973 /* Size of the data to set. */
43974 uint16_t size;
43975 /*
43976 * Type of the resource, defined globally in the
43977 * hwrm_tf_resc_type enum.
43978 */
43979 uint32_t type;
43980 /* Index of the type to retrieve. */
43981 uint32_t index;
43982 } hwrm_tf_if_tbl_get_input_t, *phwrm_tf_if_tbl_get_input_t;
43983
43984 /* hwrm_tf_if_tbl_get_output (size:256b/32B) */
43985
43986 typedef struct hwrm_tf_if_tbl_get_output {
43987 /* The specific error status for the command. */
43988 uint16_t error_code;
43989 /* The HWRM command request type. */
43990 uint16_t req_type;
43991 /* The sequence ID from the original command. */
43992 uint16_t seq_id;
43993 /* The length of the response data in number of bytes. */
43994 uint16_t resp_len;
43995 /* Response code. */
43996 uint32_t resp_code;
43997 /* Response size. */
43998 uint16_t size;
43999 /* unused */
44000 uint16_t unused0;
44001 /* Response data. */
44002 uint8_t data[8];
44003 /* unused */
44004 uint8_t unused1[7];
44005 /*
44006 * This field is used in Output records to indicate that the output
44007 * is completely written to RAM. This field should be read as '1'
44008 * to indicate that the output has been completely written.
44009 * When writing a command completion or response to an internal
44010 * processor, the order of writes has to be such that this field
44011 * is written last.
44012 */
44013 uint8_t valid;
44014 } hwrm_tf_if_tbl_get_output_t, *phwrm_tf_if_tbl_get_output_t;
44015
44016 /***************************
44017 * hwrm_tf_if_tbl_type_set *
44018 ***************************/
44019
44020
44021 /* hwrm_tf_if_tbl_set_input (size:384b/48B) */
44022
44023 typedef struct hwrm_tf_if_tbl_set_input {
44024 /* The HWRM command request type. */
44025 uint16_t req_type;
44026 /*
44027 * The completion ring to send the completion event on. This should
44028 * be the NQ ID returned from the `nq_alloc` HWRM command.
44029 */
44030 uint16_t cmpl_ring;
44031 /*
44032 * The sequence ID is used by the driver for tracking multiple
44033 * commands. This ID is treated as opaque data by the firmware and
44034 * the value is returned in the `hwrm_resp_hdr` upon completion.
44035 */
44036 uint16_t seq_id;
44037 /*
44038 * The target ID of the command:
44039 * * 0x0-0xFFF8 - The function ID
44040 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44041 * * 0xFFFD - Reserved for user-space HWRM interface
44042 * * 0xFFFF - HWRM
44043 */
44044 uint16_t target_id;
44045 /*
44046 * A physical address pointer pointing to a host buffer that the
44047 * command's response data will be written. This can be either a host
44048 * physical address (HPA) or a guest physical address (GPA) and must
44049 * point to a physically contiguous block of memory.
44050 */
44051 uint64_t resp_addr;
44052 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
44053 uint32_t fw_session_id;
44054 /* Control flags. */
44055 uint16_t flags;
44056 /* Indicates the flow direction. */
44057 #define HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR UINT32_C(0x1)
44058 /* If this bit set to 0, then it indicates rx flow. */
44059 #define HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_RX UINT32_C(0x0)
44060 /* If this bit is set to 1, then it indicates tx flow. */
44061 #define HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_TX UINT32_C(0x1)
44062 #define HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_LAST HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_TX
44063 /* unused. */
44064 uint8_t unused0[2];
44065 /*
44066 * Type of the resource, defined globally in the
44067 * hwrm_tf_resc_type enum.
44068 */
44069 uint32_t type;
44070 /* Index of the type to set. */
44071 uint32_t index;
44072 /* Size of the data to set. */
44073 uint16_t size;
44074 /* unused */
44075 uint8_t unused1[6];
44076 /* Data to be set. */
44077 uint8_t data[8];
44078 } hwrm_tf_if_tbl_set_input_t, *phwrm_tf_if_tbl_set_input_t;
44079
44080 /* hwrm_tf_if_tbl_set_output (size:128b/16B) */
44081
44082 typedef struct hwrm_tf_if_tbl_set_output {
44083 /* The specific error status for the command. */
44084 uint16_t error_code;
44085 /* The HWRM command request type. */
44086 uint16_t req_type;
44087 /* The sequence ID from the original command. */
44088 uint16_t seq_id;
44089 /* The length of the response data in number of bytes. */
44090 uint16_t resp_len;
44091 /* unused. */
44092 uint8_t unused0[7];
44093 /*
44094 * This field is used in Output records to indicate that the output
44095 * is completely written to RAM. This field should be read as '1'
44096 * to indicate that the output has been completely written.
44097 * When writing a command completion or response to an internal
44098 * processor, the order of writes has to be such that this field
44099 * is written last.
44100 */
44101 uint8_t valid;
44102 } hwrm_tf_if_tbl_set_output_t, *phwrm_tf_if_tbl_set_output_t;
44103
44104 /*****************************
44105 * hwrm_tf_tbl_type_bulk_get *
44106 *****************************/
44107
44108
44109 /* hwrm_tf_tbl_type_bulk_get_input (size:384b/48B) */
44110
44111 typedef struct hwrm_tf_tbl_type_bulk_get_input {
44112 /* The HWRM command request type. */
44113 uint16_t req_type;
44114 /*
44115 * The completion ring to send the completion event on. This should
44116 * be the NQ ID returned from the `nq_alloc` HWRM command.
44117 */
44118 uint16_t cmpl_ring;
44119 /*
44120 * The sequence ID is used by the driver for tracking multiple
44121 * commands. This ID is treated as opaque data by the firmware and
44122 * the value is returned in the `hwrm_resp_hdr` upon completion.
44123 */
44124 uint16_t seq_id;
44125 /*
44126 * The target ID of the command:
44127 * * 0x0-0xFFF8 - The function ID
44128 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44129 * * 0xFFFD - Reserved for user-space HWRM interface
44130 * * 0xFFFF - HWRM
44131 */
44132 uint16_t target_id;
44133 /*
44134 * A physical address pointer pointing to a host buffer that the
44135 * command's response data will be written. This can be either a host
44136 * physical address (HPA) or a guest physical address (GPA) and must
44137 * point to a physically contiguous block of memory.
44138 */
44139 uint64_t resp_addr;
44140 /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
44141 uint32_t fw_session_id;
44142 /* Control flags. */
44143 uint16_t flags;
44144 /* Indicates the flow direction. */
44145 #define HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR UINT32_C(0x1)
44146 /* If this bit set to 0, then it indicates rx flow. */
44147 #define HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_RX UINT32_C(0x0)
44148 /* If this bit is set to 1, then it indicates tx flow. */
44149 #define HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_TX UINT32_C(0x1)
44150 #define HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_LAST HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_TX
44151 /* unused. */
44152 uint8_t unused0[2];
44153 /*
44154 * Type of the resource, defined globally in the
44155 * hwrm_tf_resc_type enum.
44156 */
44157 uint32_t type;
44158 /* Starting index of the type to retrieve. */
44159 uint32_t start_index;
44160 /* Number of entries to retrieve. */
44161 uint32_t num_entries;
44162 /* Number of entries to retrieve. */
44163 uint32_t unused1;
44164 /* Host memory where data will be stored. */
44165 uint64_t host_addr;
44166 } hwrm_tf_tbl_type_bulk_get_input_t, *phwrm_tf_tbl_type_bulk_get_input_t;
44167
44168 /* hwrm_tf_tbl_type_bulk_get_output (size:128b/16B) */
44169
44170 typedef struct hwrm_tf_tbl_type_bulk_get_output {
44171 /* The specific error status for the command. */
44172 uint16_t error_code;
44173 /* The HWRM command request type. */
44174 uint16_t req_type;
44175 /* The sequence ID from the original command. */
44176 uint16_t seq_id;
44177 /* The length of the response data in number of bytes. */
44178 uint16_t resp_len;
44179 /* Response code. */
44180 uint32_t resp_code;
44181 /* Response size. */
44182 uint16_t size;
44183 /* unused */
44184 uint8_t unused0;
44185 /*
44186 * This field is used in Output records to indicate that the output
44187 * is completely written to RAM. This field should be read as '1'
44188 * to indicate that the output has been completely written.
44189 * When writing a command completion or response to an internal
44190 * processor, the order of writes has to be such that this field
44191 * is written last.
44192 */
44193 uint8_t valid;
44194 } hwrm_tf_tbl_type_bulk_get_output_t, *phwrm_tf_tbl_type_bulk_get_output_t;
44195
44196 /******************************
44197 * hwrm_tunnel_dst_port_query *
44198 ******************************/
44199
44200
44201 /* hwrm_tunnel_dst_port_query_input (size:192b/24B) */
44202
44203 typedef struct hwrm_tunnel_dst_port_query_input {
44204 /* The HWRM command request type. */
44205 uint16_t req_type;
44206 /*
44207 * The completion ring to send the completion event on. This should
44208 * be the NQ ID returned from the `nq_alloc` HWRM command.
44209 */
44210 uint16_t cmpl_ring;
44211 /*
44212 * The sequence ID is used by the driver for tracking multiple
44213 * commands. This ID is treated as opaque data by the firmware and
44214 * the value is returned in the `hwrm_resp_hdr` upon completion.
44215 */
44216 uint16_t seq_id;
44217 /*
44218 * The target ID of the command:
44219 * * 0x0-0xFFF8 - The function ID
44220 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44221 * * 0xFFFD - Reserved for user-space HWRM interface
44222 * * 0xFFFF - HWRM
44223 */
44224 uint16_t target_id;
44225 /*
44226 * A physical address pointer pointing to a host buffer that the
44227 * command's response data will be written. This can be either a host
44228 * physical address (HPA) or a guest physical address (GPA) and must
44229 * point to a physically contiguous block of memory.
44230 */
44231 uint64_t resp_addr;
44232 /* Tunnel Type. */
44233 uint8_t tunnel_type;
44234 /* Virtual eXtensible Local Area Network (VXLAN) */
44235 #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
44236 /* Generic Network Virtualization Encapsulation (Geneve) */
44237 #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
44238 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
44239 #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_V4 UINT32_C(0x9)
44240 /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
44241 #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_IPGRE_V1 UINT32_C(0xa)
44242 /* Use fixed layer 2 ether type of 0xFFFF */
44243 #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_L2_ETYPE UINT32_C(0xb)
44244 /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
44245 #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
44246 #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_LAST HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6
44247 uint8_t unused_0[7];
44248 } hwrm_tunnel_dst_port_query_input_t, *phwrm_tunnel_dst_port_query_input_t;
44249
44250 /* hwrm_tunnel_dst_port_query_output (size:128b/16B) */
44251
44252 typedef struct hwrm_tunnel_dst_port_query_output {
44253 /* The specific error status for the command. */
44254 uint16_t error_code;
44255 /* The HWRM command request type. */
44256 uint16_t req_type;
44257 /* The sequence ID from the original command. */
44258 uint16_t seq_id;
44259 /* The length of the response data in number of bytes. */
44260 uint16_t resp_len;
44261 /*
44262 * This field represents the identifier of L4 destination port
44263 * used for the given tunnel type. This field is valid for
44264 * specific tunnel types that use layer 4 (e.g. UDP)
44265 * transports for tunneling.
44266 */
44267 uint16_t tunnel_dst_port_id;
44268 /*
44269 * This field represents the value of L4 destination port
44270 * identified by tunnel_dst_port_id. This field is valid for
44271 * specific tunnel types that use layer 4 (e.g. UDP)
44272 * transports for tunneling.
44273 * This field is in network byte order.
44274 *
44275 * A value of 0 means that the destination port is not
44276 * configured.
44277 */
44278 uint16_t tunnel_dst_port_val;
44279 uint8_t unused_0[3];
44280 /*
44281 * This field is used in Output records to indicate that the output
44282 * is completely written to RAM. This field should be read as '1'
44283 * to indicate that the output has been completely written.
44284 * When writing a command completion or response to an internal processor,
44285 * the order of writes has to be such that this field is written last.
44286 */
44287 uint8_t valid;
44288 } hwrm_tunnel_dst_port_query_output_t, *phwrm_tunnel_dst_port_query_output_t;
44289
44290 /******************************
44291 * hwrm_tunnel_dst_port_alloc *
44292 ******************************/
44293
44294
44295 /* hwrm_tunnel_dst_port_alloc_input (size:192b/24B) */
44296
44297 typedef struct hwrm_tunnel_dst_port_alloc_input {
44298 /* The HWRM command request type. */
44299 uint16_t req_type;
44300 /*
44301 * The completion ring to send the completion event on. This should
44302 * be the NQ ID returned from the `nq_alloc` HWRM command.
44303 */
44304 uint16_t cmpl_ring;
44305 /*
44306 * The sequence ID is used by the driver for tracking multiple
44307 * commands. This ID is treated as opaque data by the firmware and
44308 * the value is returned in the `hwrm_resp_hdr` upon completion.
44309 */
44310 uint16_t seq_id;
44311 /*
44312 * The target ID of the command:
44313 * * 0x0-0xFFF8 - The function ID
44314 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44315 * * 0xFFFD - Reserved for user-space HWRM interface
44316 * * 0xFFFF - HWRM
44317 */
44318 uint16_t target_id;
44319 /*
44320 * A physical address pointer pointing to a host buffer that the
44321 * command's response data will be written. This can be either a host
44322 * physical address (HPA) or a guest physical address (GPA) and must
44323 * point to a physically contiguous block of memory.
44324 */
44325 uint64_t resp_addr;
44326 /* Tunnel Type. */
44327 uint8_t tunnel_type;
44328 /* Virtual eXtensible Local Area Network (VXLAN) */
44329 #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
44330 /* Generic Network Virtualization Encapsulation (Geneve) */
44331 #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
44332 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
44333 #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 UINT32_C(0x9)
44334 /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
44335 #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 UINT32_C(0xa)
44336 /* Use fixed layer 2 ether type of 0xFFFF */
44337 #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE UINT32_C(0xb)
44338 /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
44339 #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
44340 #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_LAST HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6
44341 uint8_t unused_0;
44342 /*
44343 * This field represents the value of L4 destination port used
44344 * for the given tunnel type. This field is valid for
44345 * specific tunnel types that use layer 4 (e.g. UDP)
44346 * transports for tunneling.
44347 *
44348 * This field is in network byte order.
44349 *
44350 * A value of 0 shall fail the command.
44351 */
44352 uint16_t tunnel_dst_port_val;
44353 uint8_t unused_1[4];
44354 } hwrm_tunnel_dst_port_alloc_input_t, *phwrm_tunnel_dst_port_alloc_input_t;
44355
44356 /* hwrm_tunnel_dst_port_alloc_output (size:128b/16B) */
44357
44358 typedef struct hwrm_tunnel_dst_port_alloc_output {
44359 /* The specific error status for the command. */
44360 uint16_t error_code;
44361 /* The HWRM command request type. */
44362 uint16_t req_type;
44363 /* The sequence ID from the original command. */
44364 uint16_t seq_id;
44365 /* The length of the response data in number of bytes. */
44366 uint16_t resp_len;
44367 /*
44368 * Identifier of a tunnel L4 destination port value. Only applies to tunnel
44369 * types that has l4 destination port parameters.
44370 */
44371 uint16_t tunnel_dst_port_id;
44372 uint8_t unused_0[5];
44373 /*
44374 * This field is used in Output records to indicate that the output
44375 * is completely written to RAM. This field should be read as '1'
44376 * to indicate that the output has been completely written.
44377 * When writing a command completion or response to an internal processor,
44378 * the order of writes has to be such that this field is written last.
44379 */
44380 uint8_t valid;
44381 } hwrm_tunnel_dst_port_alloc_output_t, *phwrm_tunnel_dst_port_alloc_output_t;
44382
44383 /*****************************
44384 * hwrm_tunnel_dst_port_free *
44385 *****************************/
44386
44387
44388 /* hwrm_tunnel_dst_port_free_input (size:192b/24B) */
44389
44390 typedef struct hwrm_tunnel_dst_port_free_input {
44391 /* The HWRM command request type. */
44392 uint16_t req_type;
44393 /*
44394 * The completion ring to send the completion event on. This should
44395 * be the NQ ID returned from the `nq_alloc` HWRM command.
44396 */
44397 uint16_t cmpl_ring;
44398 /*
44399 * The sequence ID is used by the driver for tracking multiple
44400 * commands. This ID is treated as opaque data by the firmware and
44401 * the value is returned in the `hwrm_resp_hdr` upon completion.
44402 */
44403 uint16_t seq_id;
44404 /*
44405 * The target ID of the command:
44406 * * 0x0-0xFFF8 - The function ID
44407 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44408 * * 0xFFFD - Reserved for user-space HWRM interface
44409 * * 0xFFFF - HWRM
44410 */
44411 uint16_t target_id;
44412 /*
44413 * A physical address pointer pointing to a host buffer that the
44414 * command's response data will be written. This can be either a host
44415 * physical address (HPA) or a guest physical address (GPA) and must
44416 * point to a physically contiguous block of memory.
44417 */
44418 uint64_t resp_addr;
44419 /* Tunnel Type. */
44420 uint8_t tunnel_type;
44421 /* Virtual eXtensible Local Area Network (VXLAN) */
44422 #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
44423 /* Generic Network Virtualization Encapsulation (Geneve) */
44424 #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
44425 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
44426 #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_V4 UINT32_C(0x9)
44427 /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
44428 #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_IPGRE_V1 UINT32_C(0xa)
44429 /* Use fixed layer 2 ether type of 0xFFFF */
44430 #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_L2_ETYPE UINT32_C(0xb)
44431 /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
44432 #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
44433 #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_LAST HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6
44434 uint8_t unused_0;
44435 /*
44436 * Identifier of a tunnel L4 destination port value. Only applies to tunnel
44437 * types that has l4 destination port parameters.
44438 */
44439 uint16_t tunnel_dst_port_id;
44440 uint8_t unused_1[4];
44441 } hwrm_tunnel_dst_port_free_input_t, *phwrm_tunnel_dst_port_free_input_t;
44442
44443 /* hwrm_tunnel_dst_port_free_output (size:128b/16B) */
44444
44445 typedef struct hwrm_tunnel_dst_port_free_output {
44446 /* The specific error status for the command. */
44447 uint16_t error_code;
44448 /* The HWRM command request type. */
44449 uint16_t req_type;
44450 /* The sequence ID from the original command. */
44451 uint16_t seq_id;
44452 /* The length of the response data in number of bytes. */
44453 uint16_t resp_len;
44454 uint8_t unused_1[7];
44455 /*
44456 * This field is used in Output records to indicate that the output
44457 * is completely written to RAM. This field should be read as '1'
44458 * to indicate that the output has been completely written.
44459 * When writing a command completion or response to an internal processor,
44460 * the order of writes has to be such that this field is written last.
44461 */
44462 uint8_t valid;
44463 } hwrm_tunnel_dst_port_free_output_t, *phwrm_tunnel_dst_port_free_output_t;
44464
44465 /* Periodic statistics context DMA to host. */
44466 /* ctx_hw_stats (size:1280b/160B) */
44467
44468 typedef struct ctx_hw_stats {
44469 /* Number of received unicast packets */
44470 uint64_t rx_ucast_pkts;
44471 /* Number of received multicast packets */
44472 uint64_t rx_mcast_pkts;
44473 /* Number of received broadcast packets */
44474 uint64_t rx_bcast_pkts;
44475 /* Number of discarded packets on receive path */
44476 uint64_t rx_discard_pkts;
44477 /* Number of packets on receive path with error */
44478 uint64_t rx_error_pkts;
44479 /* Number of received bytes for unicast traffic */
44480 uint64_t rx_ucast_bytes;
44481 /* Number of received bytes for multicast traffic */
44482 uint64_t rx_mcast_bytes;
44483 /* Number of received bytes for broadcast traffic */
44484 uint64_t rx_bcast_bytes;
44485 /* Number of transmitted unicast packets */
44486 uint64_t tx_ucast_pkts;
44487 /* Number of transmitted multicast packets */
44488 uint64_t tx_mcast_pkts;
44489 /* Number of transmitted broadcast packets */
44490 uint64_t tx_bcast_pkts;
44491 /* Number of packets on transmit path with error */
44492 uint64_t tx_error_pkts;
44493 /* Number of discarded packets on transmit path */
44494 uint64_t tx_discard_pkts;
44495 /* Number of transmitted bytes for unicast traffic */
44496 uint64_t tx_ucast_bytes;
44497 /* Number of transmitted bytes for multicast traffic */
44498 uint64_t tx_mcast_bytes;
44499 /* Number of transmitted bytes for broadcast traffic */
44500 uint64_t tx_bcast_bytes;
44501 /* Number of TPA packets */
44502 uint64_t tpa_pkts;
44503 /* Number of TPA bytes */
44504 uint64_t tpa_bytes;
44505 /* Number of TPA events */
44506 uint64_t tpa_events;
44507 /* Number of TPA aborts */
44508 uint64_t tpa_aborts;
44509 } ctx_hw_stats_t, *pctx_hw_stats_t;
44510
44511 /*
44512 * Extended periodic statistics context DMA to host. On cards that
44513 * support TPA v2, additional TPA related stats exist and can be retrieved
44514 * by DMA of ctx_hw_stats_ext, rather than legacy ctx_hw_stats structure.
44515 */
44516 /* ctx_hw_stats_ext (size:1408b/176B) */
44517
44518 typedef struct ctx_hw_stats_ext {
44519 /* Number of received unicast packets */
44520 uint64_t rx_ucast_pkts;
44521 /* Number of received multicast packets */
44522 uint64_t rx_mcast_pkts;
44523 /* Number of received broadcast packets */
44524 uint64_t rx_bcast_pkts;
44525 /* Number of discarded packets on receive path */
44526 uint64_t rx_discard_pkts;
44527 /* Number of packets on receive path with error */
44528 uint64_t rx_error_pkts;
44529 /* Number of received bytes for unicast traffic */
44530 uint64_t rx_ucast_bytes;
44531 /* Number of received bytes for multicast traffic */
44532 uint64_t rx_mcast_bytes;
44533 /* Number of received bytes for broadcast traffic */
44534 uint64_t rx_bcast_bytes;
44535 /* Number of transmitted unicast packets */
44536 uint64_t tx_ucast_pkts;
44537 /* Number of transmitted multicast packets */
44538 uint64_t tx_mcast_pkts;
44539 /* Number of transmitted broadcast packets */
44540 uint64_t tx_bcast_pkts;
44541 /* Number of packets on transmit path with error */
44542 uint64_t tx_error_pkts;
44543 /* Number of discarded packets on transmit path */
44544 uint64_t tx_discard_pkts;
44545 /* Number of transmitted bytes for unicast traffic */
44546 uint64_t tx_ucast_bytes;
44547 /* Number of transmitted bytes for multicast traffic */
44548 uint64_t tx_mcast_bytes;
44549 /* Number of transmitted bytes for broadcast traffic */
44550 uint64_t tx_bcast_bytes;
44551 /* Number of TPA eligible packets */
44552 uint64_t rx_tpa_eligible_pkt;
44553 /* Number of TPA eligible bytes */
44554 uint64_t rx_tpa_eligible_bytes;
44555 /* Number of TPA packets */
44556 uint64_t rx_tpa_pkt;
44557 /* Number of TPA bytes */
44558 uint64_t rx_tpa_bytes;
44559 /* Number of TPA errors */
44560 uint64_t rx_tpa_errors;
44561 /* Number of TPA events */
44562 uint64_t rx_tpa_events;
44563 } ctx_hw_stats_ext_t, *pctx_hw_stats_ext_t;
44564
44565 /* Periodic Engine statistics context DMA to host. */
44566 /* ctx_eng_stats (size:512b/64B) */
44567
44568 typedef struct ctx_eng_stats {
44569 /*
44570 * Count of data bytes into the Engine.
44571 * This includes any user supplied prefix,
44572 * but does not include any predefined
44573 * prefix data.
44574 */
44575 uint64_t eng_bytes_in;
44576 /* Count of data bytes out of the Engine. */
44577 uint64_t eng_bytes_out;
44578 /*
44579 * Count, in 4-byte (dword) units, of bytes
44580 * that are input as auxiliary data.
44581 * This includes the aux_cmd data.
44582 */
44583 uint64_t aux_bytes_in;
44584 /*
44585 * Count, in 4-byte (dword) units, of bytes
44586 * that are output as auxiliary data.
44587 * This count is the buffer space for aux_data
44588 * output provided in the RQE, not the actual
44589 * aux_data written
44590 */
44591 uint64_t aux_bytes_out;
44592 /* Count of number of commands executed. */
44593 uint64_t commands;
44594 /*
44595 * Count of number of error commands.
44596 * These are the commands with a
44597 * non-zero status value.
44598 */
44599 uint64_t error_commands;
44600 /*
44601 * Compression/Encryption Engine usage,
44602 * the unit is count of clock cycles
44603 */
44604 uint64_t cce_engine_usage;
44605 /*
44606 * De-Compression/De-cryption Engine usage,
44607 * the unit is count of clock cycles
44608 */
44609 uint64_t cdd_engine_usage;
44610 } ctx_eng_stats_t, *pctx_eng_stats_t;
44611
44612 /***********************
44613 * hwrm_stat_ctx_alloc *
44614 ***********************/
44615
44616
44617 /* hwrm_stat_ctx_alloc_input (size:256b/32B) */
44618
44619 typedef struct hwrm_stat_ctx_alloc_input {
44620 /* The HWRM command request type. */
44621 uint16_t req_type;
44622 /*
44623 * The completion ring to send the completion event on. This should
44624 * be the NQ ID returned from the `nq_alloc` HWRM command.
44625 */
44626 uint16_t cmpl_ring;
44627 /*
44628 * The sequence ID is used by the driver for tracking multiple
44629 * commands. This ID is treated as opaque data by the firmware and
44630 * the value is returned in the `hwrm_resp_hdr` upon completion.
44631 */
44632 uint16_t seq_id;
44633 /*
44634 * The target ID of the command:
44635 * * 0x0-0xFFF8 - The function ID
44636 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44637 * * 0xFFFD - Reserved for user-space HWRM interface
44638 * * 0xFFFF - HWRM
44639 */
44640 uint16_t target_id;
44641 /*
44642 * A physical address pointer pointing to a host buffer that the
44643 * command's response data will be written. This can be either a host
44644 * physical address (HPA) or a guest physical address (GPA) and must
44645 * point to a physically contiguous block of memory.
44646 */
44647 uint64_t resp_addr;
44648 /*
44649 * This is the address for statistic block.
44650 * > For new versions of the chip, this address should be 128B
44651 * > aligned.
44652 */
44653 uint64_t stats_dma_addr;
44654 /*
44655 * The statistic block update period in ms.
44656 * e.g. 250ms, 500ms, 750ms, 1000ms.
44657 * If update_period_ms is 0, then the stats update
44658 * shall be never done and the DMA address shall not be used.
44659 * In this case, the stat block can only be read by
44660 * hwrm_stat_ctx_query command.
44661 * On Ethernet/L2 based devices:
44662 * if tpa v2 supported (hwrm_vnic_qcaps[max_aggs_supported]>0),
44663 * ctx_hw_stats_ext is used for DMA,
44664 * else
44665 * ctx_hw_stats is used for DMA.
44666 */
44667 uint32_t update_period_ms;
44668 /*
44669 * This field is used to specify statistics context specific
44670 * configuration flags.
44671 */
44672 uint8_t stat_ctx_flags;
44673 /*
44674 * When this bit is set to '1', the statistics context shall be
44675 * allocated for RoCE traffic only. In this case, traffic other
44676 * than offloaded RoCE traffic shall not be included in this
44677 * statistic context.
44678 * When this bit is set to '', the statistics context shall be
44679 * used for network traffic or engine traffic.
44680 */
44681 #define HWRM_STAT_CTX_ALLOC_INPUT_STAT_CTX_FLAGS_ROCE UINT32_C(0x1)
44682 uint8_t unused_0;
44683 /*
44684 * This is the size of the structure (ctx_hw_stats or
44685 * ctx_hw_stats_ext) that the driver has allocated to be used
44686 * for the periodic DMA updates.
44687 */
44688 uint16_t stats_dma_length;
44689 } hwrm_stat_ctx_alloc_input_t, *phwrm_stat_ctx_alloc_input_t;
44690
44691 /* hwrm_stat_ctx_alloc_output (size:128b/16B) */
44692
44693 typedef struct hwrm_stat_ctx_alloc_output {
44694 /* The specific error status for the command. */
44695 uint16_t error_code;
44696 /* The HWRM command request type. */
44697 uint16_t req_type;
44698 /* The sequence ID from the original command. */
44699 uint16_t seq_id;
44700 /* The length of the response data in number of bytes. */
44701 uint16_t resp_len;
44702 /* This is the statistics context ID value. */
44703 uint32_t stat_ctx_id;
44704 uint8_t unused_0[3];
44705 /*
44706 * This field is used in Output records to indicate that the output
44707 * is completely written to RAM. This field should be read as '1'
44708 * to indicate that the output has been completely written.
44709 * When writing a command completion or response to an internal processor,
44710 * the order of writes has to be such that this field is written last.
44711 */
44712 uint8_t valid;
44713 } hwrm_stat_ctx_alloc_output_t, *phwrm_stat_ctx_alloc_output_t;
44714
44715 /**********************
44716 * hwrm_stat_ctx_free *
44717 **********************/
44718
44719
44720 /* hwrm_stat_ctx_free_input (size:192b/24B) */
44721
44722 typedef struct hwrm_stat_ctx_free_input {
44723 /* The HWRM command request type. */
44724 uint16_t req_type;
44725 /*
44726 * The completion ring to send the completion event on. This should
44727 * be the NQ ID returned from the `nq_alloc` HWRM command.
44728 */
44729 uint16_t cmpl_ring;
44730 /*
44731 * The sequence ID is used by the driver for tracking multiple
44732 * commands. This ID is treated as opaque data by the firmware and
44733 * the value is returned in the `hwrm_resp_hdr` upon completion.
44734 */
44735 uint16_t seq_id;
44736 /*
44737 * The target ID of the command:
44738 * * 0x0-0xFFF8 - The function ID
44739 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44740 * * 0xFFFD - Reserved for user-space HWRM interface
44741 * * 0xFFFF - HWRM
44742 */
44743 uint16_t target_id;
44744 /*
44745 * A physical address pointer pointing to a host buffer that the
44746 * command's response data will be written. This can be either a host
44747 * physical address (HPA) or a guest physical address (GPA) and must
44748 * point to a physically contiguous block of memory.
44749 */
44750 uint64_t resp_addr;
44751 /* ID of the statistics context that is being queried. */
44752 uint32_t stat_ctx_id;
44753 uint8_t unused_0[4];
44754 } hwrm_stat_ctx_free_input_t, *phwrm_stat_ctx_free_input_t;
44755
44756 /* hwrm_stat_ctx_free_output (size:128b/16B) */
44757
44758 typedef struct hwrm_stat_ctx_free_output {
44759 /* The specific error status for the command. */
44760 uint16_t error_code;
44761 /* The HWRM command request type. */
44762 uint16_t req_type;
44763 /* The sequence ID from the original command. */
44764 uint16_t seq_id;
44765 /* The length of the response data in number of bytes. */
44766 uint16_t resp_len;
44767 /* This is the statistics context ID value. */
44768 uint32_t stat_ctx_id;
44769 uint8_t unused_0[3];
44770 /*
44771 * This field is used in Output records to indicate that the output
44772 * is completely written to RAM. This field should be read as '1'
44773 * to indicate that the output has been completely written.
44774 * When writing a command completion or response to an internal processor,
44775 * the order of writes has to be such that this field is written last.
44776 */
44777 uint8_t valid;
44778 } hwrm_stat_ctx_free_output_t, *phwrm_stat_ctx_free_output_t;
44779
44780 /***********************
44781 * hwrm_stat_ctx_query *
44782 ***********************/
44783
44784
44785 /* hwrm_stat_ctx_query_input (size:192b/24B) */
44786
44787 typedef struct hwrm_stat_ctx_query_input {
44788 /* The HWRM command request type. */
44789 uint16_t req_type;
44790 /*
44791 * The completion ring to send the completion event on. This should
44792 * be the NQ ID returned from the `nq_alloc` HWRM command.
44793 */
44794 uint16_t cmpl_ring;
44795 /*
44796 * The sequence ID is used by the driver for tracking multiple
44797 * commands. This ID is treated as opaque data by the firmware and
44798 * the value is returned in the `hwrm_resp_hdr` upon completion.
44799 */
44800 uint16_t seq_id;
44801 /*
44802 * The target ID of the command:
44803 * * 0x0-0xFFF8 - The function ID
44804 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44805 * * 0xFFFD - Reserved for user-space HWRM interface
44806 * * 0xFFFF - HWRM
44807 */
44808 uint16_t target_id;
44809 /*
44810 * A physical address pointer pointing to a host buffer that the
44811 * command's response data will be written. This can be either a host
44812 * physical address (HPA) or a guest physical address (GPA) and must
44813 * point to a physically contiguous block of memory.
44814 */
44815 uint64_t resp_addr;
44816 /* ID of the statistics context that is being queried. */
44817 uint32_t stat_ctx_id;
44818 uint8_t flags;
44819 /*
44820 * This bit is set to 1 when request is for a counter mask,
44821 * representing the width of each of the stats counters, rather
44822 * than counters themselves.
44823 */
44824 #define HWRM_STAT_CTX_QUERY_INPUT_FLAGS_COUNTER_MASK UINT32_C(0x1)
44825 uint8_t unused_0[3];
44826 } hwrm_stat_ctx_query_input_t, *phwrm_stat_ctx_query_input_t;
44827
44828 /* hwrm_stat_ctx_query_output (size:1408b/176B) */
44829
44830 typedef struct hwrm_stat_ctx_query_output {
44831 /* The specific error status for the command. */
44832 uint16_t error_code;
44833 /* The HWRM command request type. */
44834 uint16_t req_type;
44835 /* The sequence ID from the original command. */
44836 uint16_t seq_id;
44837 /* The length of the response data in number of bytes. */
44838 uint16_t resp_len;
44839 /* Number of transmitted unicast packets */
44840 uint64_t tx_ucast_pkts;
44841 /* Number of transmitted multicast packets */
44842 uint64_t tx_mcast_pkts;
44843 /* Number of transmitted broadcast packets */
44844 uint64_t tx_bcast_pkts;
44845 /* Number of packets discarded in transmit path */
44846 uint64_t tx_discard_pkts;
44847 /* Number of packets in transmit path with error */
44848 uint64_t tx_error_pkts;
44849 /* Number of transmitted bytes for unicast traffic */
44850 uint64_t tx_ucast_bytes;
44851 /* Number of transmitted bytes for multicast traffic */
44852 uint64_t tx_mcast_bytes;
44853 /* Number of transmitted bytes for broadcast traffic */
44854 uint64_t tx_bcast_bytes;
44855 /* Number of received unicast packets */
44856 uint64_t rx_ucast_pkts;
44857 /* Number of received multicast packets */
44858 uint64_t rx_mcast_pkts;
44859 /* Number of received broadcast packets */
44860 uint64_t rx_bcast_pkts;
44861 /* Number of packets discarded in receive path */
44862 uint64_t rx_discard_pkts;
44863 /* Number of packets in receive path with errors */
44864 uint64_t rx_error_pkts;
44865 /* Number of received bytes for unicast traffic */
44866 uint64_t rx_ucast_bytes;
44867 /* Number of received bytes for multicast traffic */
44868 uint64_t rx_mcast_bytes;
44869 /* Number of received bytes for broadcast traffic */
44870 uint64_t rx_bcast_bytes;
44871 /* Number of aggregated unicast packets */
44872 uint64_t rx_agg_pkts;
44873 /* Number of aggregated unicast bytes */
44874 uint64_t rx_agg_bytes;
44875 /* Number of aggregation events */
44876 uint64_t rx_agg_events;
44877 /* Number of aborted aggregations */
44878 uint64_t rx_agg_aborts;
44879 uint8_t unused_0[7];
44880 /*
44881 * This field is used in Output records to indicate that the output
44882 * is completely written to RAM. This field should be read as '1'
44883 * to indicate that the output has been completely written.
44884 * When writing a command completion or response to an internal processor,
44885 * the order of writes has to be such that this field is written last.
44886 */
44887 uint8_t valid;
44888 } hwrm_stat_ctx_query_output_t, *phwrm_stat_ctx_query_output_t;
44889
44890 /***************************
44891 * hwrm_stat_ext_ctx_query *
44892 ***************************/
44893
44894
44895 /* hwrm_stat_ext_ctx_query_input (size:192b/24B) */
44896
44897 typedef struct hwrm_stat_ext_ctx_query_input {
44898 /* The HWRM command request type. */
44899 uint16_t req_type;
44900 /*
44901 * The completion ring to send the completion event on. This should
44902 * be the NQ ID returned from the `nq_alloc` HWRM command.
44903 */
44904 uint16_t cmpl_ring;
44905 /*
44906 * The sequence ID is used by the driver for tracking multiple
44907 * commands. This ID is treated as opaque data by the firmware and
44908 * the value is returned in the `hwrm_resp_hdr` upon completion.
44909 */
44910 uint16_t seq_id;
44911 /*
44912 * The target ID of the command:
44913 * * 0x0-0xFFF8 - The function ID
44914 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44915 * * 0xFFFD - Reserved for user-space HWRM interface
44916 * * 0xFFFF - HWRM
44917 */
44918 uint16_t target_id;
44919 /*
44920 * A physical address pointer pointing to a host buffer that the
44921 * command's response data will be written. This can be either a host
44922 * physical address (HPA) or a guest physical address (GPA) and must
44923 * point to a physically contiguous block of memory.
44924 */
44925 uint64_t resp_addr;
44926 /* ID of the extended statistics context that is being queried. */
44927 uint32_t stat_ctx_id;
44928 uint8_t flags;
44929 /*
44930 * This bit is set to 1 when request is for a counter mask,
44931 * representing the width of each of the stats counters, rather
44932 * than counters themselves.
44933 */
44934 #define HWRM_STAT_EXT_CTX_QUERY_INPUT_FLAGS_COUNTER_MASK UINT32_C(0x1)
44935 uint8_t unused_0[3];
44936 } hwrm_stat_ext_ctx_query_input_t, *phwrm_stat_ext_ctx_query_input_t;
44937
44938 /* hwrm_stat_ext_ctx_query_output (size:1536b/192B) */
44939
44940 typedef struct hwrm_stat_ext_ctx_query_output {
44941 /* The specific error status for the command. */
44942 uint16_t error_code;
44943 /* The HWRM command request type. */
44944 uint16_t req_type;
44945 /* The sequence ID from the original command. */
44946 uint16_t seq_id;
44947 /* The length of the response data in number of bytes. */
44948 uint16_t resp_len;
44949 /* Number of received unicast packets */
44950 uint64_t rx_ucast_pkts;
44951 /* Number of received multicast packets */
44952 uint64_t rx_mcast_pkts;
44953 /* Number of received broadcast packets */
44954 uint64_t rx_bcast_pkts;
44955 /* Number of discarded packets on receive path */
44956 uint64_t rx_discard_pkts;
44957 /* Number of packets on receive path with error */
44958 uint64_t rx_error_pkts;
44959 /* Number of received bytes for unicast traffic */
44960 uint64_t rx_ucast_bytes;
44961 /* Number of received bytes for multicast traffic */
44962 uint64_t rx_mcast_bytes;
44963 /* Number of received bytes for broadcast traffic */
44964 uint64_t rx_bcast_bytes;
44965 /* Number of transmitted unicast packets */
44966 uint64_t tx_ucast_pkts;
44967 /* Number of transmitted multicast packets */
44968 uint64_t tx_mcast_pkts;
44969 /* Number of transmitted broadcast packets */
44970 uint64_t tx_bcast_pkts;
44971 /* Number of packets on transmit path with error */
44972 uint64_t tx_error_pkts;
44973 /* Number of discarded packets on transmit path */
44974 uint64_t tx_discard_pkts;
44975 /* Number of transmitted bytes for unicast traffic */
44976 uint64_t tx_ucast_bytes;
44977 /* Number of transmitted bytes for multicast traffic */
44978 uint64_t tx_mcast_bytes;
44979 /* Number of transmitted bytes for broadcast traffic */
44980 uint64_t tx_bcast_bytes;
44981 /* Number of TPA eligible packets */
44982 uint64_t rx_tpa_eligible_pkt;
44983 /* Number of TPA eligible bytes */
44984 uint64_t rx_tpa_eligible_bytes;
44985 /* Number of TPA packets */
44986 uint64_t rx_tpa_pkt;
44987 /* Number of TPA bytes */
44988 uint64_t rx_tpa_bytes;
44989 /* Number of TPA errors */
44990 uint64_t rx_tpa_errors;
44991 /* Number of TPA events */
44992 uint64_t rx_tpa_events;
44993 uint8_t unused_0[7];
44994 /*
44995 * This field is used in Output records to indicate that the output
44996 * is completely written to RAM. This field should be read as '1'
44997 * to indicate that the output has been completely written.
44998 * When writing a command completion or response to an internal processor,
44999 * the order of writes has to be such that this field is written last.
45000 */
45001 uint8_t valid;
45002 } hwrm_stat_ext_ctx_query_output_t, *phwrm_stat_ext_ctx_query_output_t;
45003
45004 /***************************
45005 * hwrm_stat_ctx_eng_query *
45006 ***************************/
45007
45008
45009 /* hwrm_stat_ctx_eng_query_input (size:192b/24B) */
45010
45011 typedef struct hwrm_stat_ctx_eng_query_input {
45012 /* The HWRM command request type. */
45013 uint16_t req_type;
45014 /*
45015 * The completion ring to send the completion event on. This should
45016 * be the NQ ID returned from the `nq_alloc` HWRM command.
45017 */
45018 uint16_t cmpl_ring;
45019 /*
45020 * The sequence ID is used by the driver for tracking multiple
45021 * commands. This ID is treated as opaque data by the firmware and
45022 * the value is returned in the `hwrm_resp_hdr` upon completion.
45023 */
45024 uint16_t seq_id;
45025 /*
45026 * The target ID of the command:
45027 * * 0x0-0xFFF8 - The function ID
45028 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45029 * * 0xFFFD - Reserved for user-space HWRM interface
45030 * * 0xFFFF - HWRM
45031 */
45032 uint16_t target_id;
45033 /*
45034 * A physical address pointer pointing to a host buffer that the
45035 * command's response data will be written. This can be either a host
45036 * physical address (HPA) or a guest physical address (GPA) and must
45037 * point to a physically contiguous block of memory.
45038 */
45039 uint64_t resp_addr;
45040 /* ID of the statistics context that is being queried. */
45041 uint32_t stat_ctx_id;
45042 uint8_t unused_0[4];
45043 } hwrm_stat_ctx_eng_query_input_t, *phwrm_stat_ctx_eng_query_input_t;
45044
45045 /* hwrm_stat_ctx_eng_query_output (size:640b/80B) */
45046
45047 typedef struct hwrm_stat_ctx_eng_query_output {
45048 /* The specific error status for the command. */
45049 uint16_t error_code;
45050 /* The HWRM command request type. */
45051 uint16_t req_type;
45052 /* The sequence ID from the original command. */
45053 uint16_t seq_id;
45054 /* The length of the response data in number of bytes. */
45055 uint16_t resp_len;
45056 /*
45057 * Count of data bytes into the Engine.
45058 * This includes any user supplied prefix,
45059 * but does not include any predefined
45060 * prefix data.
45061 */
45062 uint64_t eng_bytes_in;
45063 /* Count of data bytes out of the Engine. */
45064 uint64_t eng_bytes_out;
45065 /*
45066 * Count, in 4-byte (dword) units, of bytes
45067 * that are input as auxiliary data.
45068 * This includes the aux_cmd data.
45069 */
45070 uint64_t aux_bytes_in;
45071 /*
45072 * Count, in 4-byte (dword) units, of bytes
45073 * that are output as auxiliary data.
45074 * This count is the buffer space for aux_data
45075 * output provided in the RQE, not the actual
45076 * aux_data written
45077 */
45078 uint64_t aux_bytes_out;
45079 /* Count of number of commands executed. */
45080 uint64_t commands;
45081 /*
45082 * Count of number of error commands.
45083 * These are the commands with a
45084 * non-zero status value.
45085 */
45086 uint64_t error_commands;
45087 /*
45088 * Compression/Encryption Engine usage,
45089 * the unit is count of clock cycles
45090 */
45091 uint64_t cce_engine_usage;
45092 /*
45093 * De-Compression/De-cryption Engine usage,
45094 * the unit is count of clock cycles
45095 */
45096 uint64_t cdd_engine_usage;
45097 uint8_t unused_0[7];
45098 /*
45099 * This field is used in Output records to indicate that the output
45100 * is completely written to RAM. This field should be read as '1'
45101 * to indicate that the output has been completely written.
45102 * When writing a command completion or response to an internal processor,
45103 * the order of writes has to be such that this field is written last.
45104 */
45105 uint8_t valid;
45106 } hwrm_stat_ctx_eng_query_output_t, *phwrm_stat_ctx_eng_query_output_t;
45107
45108 /***************************
45109 * hwrm_stat_ctx_clr_stats *
45110 ***************************/
45111
45112
45113 /* hwrm_stat_ctx_clr_stats_input (size:192b/24B) */
45114
45115 typedef struct hwrm_stat_ctx_clr_stats_input {
45116 /* The HWRM command request type. */
45117 uint16_t req_type;
45118 /*
45119 * The completion ring to send the completion event on. This should
45120 * be the NQ ID returned from the `nq_alloc` HWRM command.
45121 */
45122 uint16_t cmpl_ring;
45123 /*
45124 * The sequence ID is used by the driver for tracking multiple
45125 * commands. This ID is treated as opaque data by the firmware and
45126 * the value is returned in the `hwrm_resp_hdr` upon completion.
45127 */
45128 uint16_t seq_id;
45129 /*
45130 * The target ID of the command:
45131 * * 0x0-0xFFF8 - The function ID
45132 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45133 * * 0xFFFD - Reserved for user-space HWRM interface
45134 * * 0xFFFF - HWRM
45135 */
45136 uint16_t target_id;
45137 /*
45138 * A physical address pointer pointing to a host buffer that the
45139 * command's response data will be written. This can be either a host
45140 * physical address (HPA) or a guest physical address (GPA) and must
45141 * point to a physically contiguous block of memory.
45142 */
45143 uint64_t resp_addr;
45144 /* ID of the statistics context that is being queried. */
45145 uint32_t stat_ctx_id;
45146 uint8_t unused_0[4];
45147 } hwrm_stat_ctx_clr_stats_input_t, *phwrm_stat_ctx_clr_stats_input_t;
45148
45149 /* hwrm_stat_ctx_clr_stats_output (size:128b/16B) */
45150
45151 typedef struct hwrm_stat_ctx_clr_stats_output {
45152 /* The specific error status for the command. */
45153 uint16_t error_code;
45154 /* The HWRM command request type. */
45155 uint16_t req_type;
45156 /* The sequence ID from the original command. */
45157 uint16_t seq_id;
45158 /* The length of the response data in number of bytes. */
45159 uint16_t resp_len;
45160 uint8_t unused_0[7];
45161 /*
45162 * This field is used in Output records to indicate that the output
45163 * is completely written to RAM. This field should be read as '1'
45164 * to indicate that the output has been completely written.
45165 * When writing a command completion or response to an internal processor,
45166 * the order of writes has to be such that this field is written last.
45167 */
45168 uint8_t valid;
45169 } hwrm_stat_ctx_clr_stats_output_t, *phwrm_stat_ctx_clr_stats_output_t;
45170
45171 /********************
45172 * hwrm_pcie_qstats *
45173 ********************/
45174
45175
45176 /* hwrm_pcie_qstats_input (size:256b/32B) */
45177
45178 typedef struct hwrm_pcie_qstats_input {
45179 /* The HWRM command request type. */
45180 uint16_t req_type;
45181 /*
45182 * The completion ring to send the completion event on. This should
45183 * be the NQ ID returned from the `nq_alloc` HWRM command.
45184 */
45185 uint16_t cmpl_ring;
45186 /*
45187 * The sequence ID is used by the driver for tracking multiple
45188 * commands. This ID is treated as opaque data by the firmware and
45189 * the value is returned in the `hwrm_resp_hdr` upon completion.
45190 */
45191 uint16_t seq_id;
45192 /*
45193 * The target ID of the command:
45194 * * 0x0-0xFFF8 - The function ID
45195 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45196 * * 0xFFFD - Reserved for user-space HWRM interface
45197 * * 0xFFFF - HWRM
45198 */
45199 uint16_t target_id;
45200 /*
45201 * A physical address pointer pointing to a host buffer that the
45202 * command's response data will be written. This can be either a host
45203 * physical address (HPA) or a guest physical address (GPA) and must
45204 * point to a physically contiguous block of memory.
45205 */
45206 uint64_t resp_addr;
45207 /*
45208 * The size of PCIe statistics block in bytes.
45209 * Firmware will DMA the PCIe statistics to
45210 * the host with this field size in the response.
45211 */
45212 uint16_t pcie_stat_size;
45213 uint8_t unused_0[6];
45214 /*
45215 * This is the host address where
45216 * PCIe statistics will be stored
45217 */
45218 uint64_t pcie_stat_host_addr;
45219 } hwrm_pcie_qstats_input_t, *phwrm_pcie_qstats_input_t;
45220
45221 /* hwrm_pcie_qstats_output (size:128b/16B) */
45222
45223 typedef struct hwrm_pcie_qstats_output {
45224 /* The specific error status for the command. */
45225 uint16_t error_code;
45226 /* The HWRM command request type. */
45227 uint16_t req_type;
45228 /* The sequence ID from the original command. */
45229 uint16_t seq_id;
45230 /* The length of the response data in number of bytes. */
45231 uint16_t resp_len;
45232 /* The size of PCIe statistics block in bytes. */
45233 uint16_t pcie_stat_size;
45234 uint8_t unused_0[5];
45235 /*
45236 * This field is used in Output records to indicate that the output
45237 * is completely written to RAM. This field should be read as '1'
45238 * to indicate that the output has been completely written.
45239 * When writing a command completion or response to an internal processor,
45240 * the order of writes has to be such that this field is written last.
45241 */
45242 uint8_t valid;
45243 } hwrm_pcie_qstats_output_t, *phwrm_pcie_qstats_output_t;
45244
45245 /* PCIe Statistics Formats */
45246 /* pcie_ctx_hw_stats (size:768b/96B) */
45247
45248 typedef struct pcie_ctx_hw_stats {
45249 /* Number of physical layer receiver errors */
45250 uint64_t pcie_pl_signal_integrity;
45251 /* Number of DLLP CRC errors detected by Data Link Layer */
45252 uint64_t pcie_dl_signal_integrity;
45253 /*
45254 * Number of TLP LCRC and sequence number errors detected
45255 * by Data Link Layer
45256 */
45257 uint64_t pcie_tl_signal_integrity;
45258 /* Number of times LTSSM entered Recovery state */
45259 uint64_t pcie_link_integrity;
45260 /* Report number of TLP bits that have been transmitted in Mbps */
45261 uint64_t pcie_tx_traffic_rate;
45262 /* Report number of TLP bits that have been received in Mbps */
45263 uint64_t pcie_rx_traffic_rate;
45264 /* Number of DLLP bytes that have been transmitted */
45265 uint64_t pcie_tx_dllp_statistics;
45266 /* Number of DLLP bytes that have been received */
45267 uint64_t pcie_rx_dllp_statistics;
45268 /*
45269 * Number of times spent in each phase of gen3
45270 * equalization
45271 */
45272 uint64_t pcie_equalization_time;
45273 /* Records the last 16 transitions of the LTSSM */
45274 uint32_t pcie_ltssm_histogram[4];
45275 /*
45276 * Record the last 8 reasons on why LTSSM transitioned
45277 * to Recovery
45278 */
45279 uint64_t pcie_recovery_histogram;
45280 } pcie_ctx_hw_stats_t, *ppcie_ctx_hw_stats_t;
45281
45282 /*****************
45283 * hwrm_fw_reset *
45284 *****************/
45285
45286
45287 /* hwrm_fw_reset_input (size:192b/24B) */
45288
45289 typedef struct hwrm_fw_reset_input {
45290 /* The HWRM command request type. */
45291 uint16_t req_type;
45292 /*
45293 * The completion ring to send the completion event on. This should
45294 * be the NQ ID returned from the `nq_alloc` HWRM command.
45295 */
45296 uint16_t cmpl_ring;
45297 /*
45298 * The sequence ID is used by the driver for tracking multiple
45299 * commands. This ID is treated as opaque data by the firmware and
45300 * the value is returned in the `hwrm_resp_hdr` upon completion.
45301 */
45302 uint16_t seq_id;
45303 /*
45304 * The target ID of the command:
45305 * * 0x0-0xFFF8 - The function ID
45306 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45307 * * 0xFFFD - Reserved for user-space HWRM interface
45308 * * 0xFFFF - HWRM
45309 */
45310 uint16_t target_id;
45311 /*
45312 * A physical address pointer pointing to a host buffer that the
45313 * command's response data will be written. This can be either a host
45314 * physical address (HPA) or a guest physical address (GPA) and must
45315 * point to a physically contiguous block of memory.
45316 */
45317 uint64_t resp_addr;
45318 /* Type of embedded processor. */
45319 uint8_t embedded_proc_type;
45320 /* Boot Processor */
45321 #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_BOOT UINT32_C(0x0)
45322 /* Management Processor */
45323 #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_MGMT UINT32_C(0x1)
45324 /* Network control processor */
45325 #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_NETCTRL UINT32_C(0x2)
45326 /* RoCE control processor */
45327 #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_ROCE UINT32_C(0x3)
45328 /*
45329 * Host (in multi-host environment): This is only valid if requester is IPC.
45330 * Reinit host hardware resources and PCIe.
45331 */
45332 #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST UINT32_C(0x4)
45333 /* AP processor complex (in multi-host environment). Use host_idx to control which core is reset */
45334 #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_AP UINT32_C(0x5)
45335 /* Reset all blocks of the chip (including all processors) */
45336 #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_CHIP UINT32_C(0x6)
45337 /*
45338 * Host (in multi-host environment): This is only valid if requester is IPC.
45339 * Reinit host hardware resources.
45340 */
45341 #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST_RESOURCE_REINIT UINT32_C(0x7)
45342 /*
45343 * Activate firmware that has been programmed to NVM. The
45344 * activation is done in an impactless manner as part of the scheme
45345 * where hwrm_fw_state_backup precedes the call, and
45346 * hwrm_fw_state_restore follows it. Before this call returns, FW
45347 * status is set to a non-0x8000 value to disambiguate reset pending
45348 * from reset complete. The reset process begins after this call
45349 * returns to ensure this HWRM has completed before reset begins.
45350 */
45351 #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_IMPACTLESS_ACTIVATION UINT32_C(0x8)
45352 #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_LAST HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_IMPACTLESS_ACTIVATION
45353 /* Type of self reset. */
45354 uint8_t selfrst_status;
45355 /* No Self Reset */
45356 #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTNONE UINT32_C(0x0)
45357 /* Self Reset as soon as possible to do so safely */
45358 #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTASAP UINT32_C(0x1)
45359 /* Self Reset on PCIe Reset */
45360 #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTPCIERST UINT32_C(0x2)
45361 /* Self Reset immediately after notification to all clients. */
45362 #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTIMMEDIATE UINT32_C(0x3)
45363 #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_LAST HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTIMMEDIATE
45364 /*
45365 * Indicate which host is being reset. 0 means first host.
45366 * Only valid when embedded_proc_type is host in multihost
45367 * environment
45368 */
45369 uint8_t host_idx;
45370 uint8_t flags;
45371 /*
45372 * When this bit is '1', then the core firmware initiates
45373 * the reset only after graceful shut down of all registered instances.
45374 * If not, the device will continue with the existing firmware.
45375 */
45376 #define HWRM_FW_RESET_INPUT_FLAGS_RESET_GRACEFUL UINT32_C(0x1)
45377 uint8_t unused_0[4];
45378 } hwrm_fw_reset_input_t, *phwrm_fw_reset_input_t;
45379
45380 /* hwrm_fw_reset_output (size:128b/16B) */
45381
45382 typedef struct hwrm_fw_reset_output {
45383 /* The specific error status for the command. */
45384 uint16_t error_code;
45385 /* The HWRM command request type. */
45386 uint16_t req_type;
45387 /* The sequence ID from the original command. */
45388 uint16_t seq_id;
45389 /* The length of the response data in number of bytes. */
45390 uint16_t resp_len;
45391 /* Type of self reset. */
45392 uint8_t selfrst_status;
45393 /* No Self Reset */
45394 #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTNONE UINT32_C(0x0)
45395 /* Self Reset as soon as possible to do so safely */
45396 #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTASAP UINT32_C(0x1)
45397 /* Self Reset on PCIe Reset */
45398 #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTPCIERST UINT32_C(0x2)
45399 /* Self Reset immediately after notification to all clients. */
45400 #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTIMMEDIATE UINT32_C(0x3)
45401 #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_LAST HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTIMMEDIATE
45402 uint8_t unused_0[6];
45403 /*
45404 * This field is used in Output records to indicate that the output
45405 * is completely written to RAM. This field should be read as '1'
45406 * to indicate that the output has been completely written.
45407 * When writing a command completion or response to an internal processor,
45408 * the order of writes has to be such that this field is written last.
45409 */
45410 uint8_t valid;
45411 } hwrm_fw_reset_output_t, *phwrm_fw_reset_output_t;
45412
45413 /*******************
45414 * hwrm_fw_qstatus *
45415 *******************/
45416
45417
45418 /* hwrm_fw_qstatus_input (size:192b/24B) */
45419
45420 typedef struct hwrm_fw_qstatus_input {
45421 /* The HWRM command request type. */
45422 uint16_t req_type;
45423 /*
45424 * The completion ring to send the completion event on. This should
45425 * be the NQ ID returned from the `nq_alloc` HWRM command.
45426 */
45427 uint16_t cmpl_ring;
45428 /*
45429 * The sequence ID is used by the driver for tracking multiple
45430 * commands. This ID is treated as opaque data by the firmware and
45431 * the value is returned in the `hwrm_resp_hdr` upon completion.
45432 */
45433 uint16_t seq_id;
45434 /*
45435 * The target ID of the command:
45436 * * 0x0-0xFFF8 - The function ID
45437 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45438 * * 0xFFFD - Reserved for user-space HWRM interface
45439 * * 0xFFFF - HWRM
45440 */
45441 uint16_t target_id;
45442 /*
45443 * A physical address pointer pointing to a host buffer that the
45444 * command's response data will be written. This can be either a host
45445 * physical address (HPA) or a guest physical address (GPA) and must
45446 * point to a physically contiguous block of memory.
45447 */
45448 uint64_t resp_addr;
45449 /* Type of embedded processor. */
45450 uint8_t embedded_proc_type;
45451 /* Boot Processor */
45452 #define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_BOOT UINT32_C(0x0)
45453 /* Management Processor */
45454 #define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_MGMT UINT32_C(0x1)
45455 /* Network control processor */
45456 #define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_NETCTRL UINT32_C(0x2)
45457 /* RoCE control processor */
45458 #define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_ROCE UINT32_C(0x3)
45459 /* Host (in multi-host environment): This is only valid if requester is IPC */
45460 #define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_HOST UINT32_C(0x4)
45461 /* AP processor complex (in multi-host environment). Use host_idx to control which core is reset */
45462 #define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_AP UINT32_C(0x5)
45463 /* Reset all blocks of the chip (including all processors) */
45464 #define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_CHIP UINT32_C(0x6)
45465 #define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_LAST HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_CHIP
45466 uint8_t unused_0[7];
45467 } hwrm_fw_qstatus_input_t, *phwrm_fw_qstatus_input_t;
45468
45469 /* hwrm_fw_qstatus_output (size:128b/16B) */
45470
45471 typedef struct hwrm_fw_qstatus_output {
45472 /* The specific error status for the command. */
45473 uint16_t error_code;
45474 /* The HWRM command request type. */
45475 uint16_t req_type;
45476 /* The sequence ID from the original command. */
45477 uint16_t seq_id;
45478 /* The length of the response data in number of bytes. */
45479 uint16_t resp_len;
45480 /* Type of self reset. */
45481 uint8_t selfrst_status;
45482 /* No Self Reset */
45483 #define HWRM_FW_QSTATUS_OUTPUT_SELFRST_STATUS_SELFRSTNONE UINT32_C(0x0)
45484 /* Self Reset as soon as possible to do so safely */
45485 #define HWRM_FW_QSTATUS_OUTPUT_SELFRST_STATUS_SELFRSTASAP UINT32_C(0x1)
45486 /* Self Reset on PCIe Reset */
45487 #define HWRM_FW_QSTATUS_OUTPUT_SELFRST_STATUS_SELFRSTPCIERST UINT32_C(0x2)
45488 /* NIC power cycle (system cold boot) required */
45489 #define HWRM_FW_QSTATUS_OUTPUT_SELFRST_STATUS_SELFRSTPOWER UINT32_C(0x3)
45490 #define HWRM_FW_QSTATUS_OUTPUT_SELFRST_STATUS_LAST HWRM_FW_QSTATUS_OUTPUT_SELFRST_STATUS_SELFRSTPOWER
45491 /*
45492 * The action needed to apply any pend nvm option changes.
45493 * If multiple options have been set the highest level
45494 * action is reported.
45495 */
45496 uint8_t nvm_option_action_status;
45497 /* No Action needed */
45498 #define HWRM_FW_QSTATUS_OUTPUT_NVM_OPTION_ACTION_STATUS_NVMOPT_ACTION_NONE UINT32_C(0x0)
45499 /* Hot reset needed to apply nvm options */
45500 #define HWRM_FW_QSTATUS_OUTPUT_NVM_OPTION_ACTION_STATUS_NVMOPT_ACTION_HOTRESET UINT32_C(0x1)
45501 /* Warm boot needed to apply nvm options */
45502 #define HWRM_FW_QSTATUS_OUTPUT_NVM_OPTION_ACTION_STATUS_NVMOPT_ACTION_WARMBOOT UINT32_C(0x2)
45503 /* Cold boot needed to apply nvm options */
45504 #define HWRM_FW_QSTATUS_OUTPUT_NVM_OPTION_ACTION_STATUS_NVMOPT_ACTION_COLDBOOT UINT32_C(0x3)
45505 #define HWRM_FW_QSTATUS_OUTPUT_NVM_OPTION_ACTION_STATUS_LAST HWRM_FW_QSTATUS_OUTPUT_NVM_OPTION_ACTION_STATUS_NVMOPT_ACTION_COLDBOOT
45506 uint8_t unused_0[5];
45507 /*
45508 * This field is used in Output records to indicate that the output
45509 * is completely written to RAM. This field should be read as '1'
45510 * to indicate that the output has been completely written.
45511 * When writing a command completion or response to an internal processor,
45512 * the order of writes has to be such that this field is written last.
45513 */
45514 uint8_t valid;
45515 } hwrm_fw_qstatus_output_t, *phwrm_fw_qstatus_output_t;
45516
45517 /********************
45518 * hwrm_fw_set_time *
45519 ********************/
45520
45521
45522 /* hwrm_fw_set_time_input (size:256b/32B) */
45523
45524 typedef struct hwrm_fw_set_time_input {
45525 /* The HWRM command request type. */
45526 uint16_t req_type;
45527 /*
45528 * The completion ring to send the completion event on. This should
45529 * be the NQ ID returned from the `nq_alloc` HWRM command.
45530 */
45531 uint16_t cmpl_ring;
45532 /*
45533 * The sequence ID is used by the driver for tracking multiple
45534 * commands. This ID is treated as opaque data by the firmware and
45535 * the value is returned in the `hwrm_resp_hdr` upon completion.
45536 */
45537 uint16_t seq_id;
45538 /*
45539 * The target ID of the command:
45540 * * 0x0-0xFFF8 - The function ID
45541 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45542 * * 0xFFFD - Reserved for user-space HWRM interface
45543 * * 0xFFFF - HWRM
45544 */
45545 uint16_t target_id;
45546 /*
45547 * A physical address pointer pointing to a host buffer that the
45548 * command's response data will be written. This can be either a host
45549 * physical address (HPA) or a guest physical address (GPA) and must
45550 * point to a physically contiguous block of memory.
45551 */
45552 uint64_t resp_addr;
45553 /* Current year */
45554 uint16_t year;
45555 /* Date/time is not known */
45556 #define HWRM_FW_SET_TIME_INPUT_YEAR_UNKNOWN UINT32_C(0x0)
45557 #define HWRM_FW_SET_TIME_INPUT_YEAR_LAST HWRM_FW_SET_TIME_INPUT_YEAR_UNKNOWN
45558 /* Current month of year (1-12) */
45559 uint8_t month;
45560 /* Current day of month (1-31) */
45561 uint8_t day;
45562 /* Current hour (0-23) */
45563 uint8_t hour;
45564 /* Current minute (0-59) */
45565 uint8_t minute;
45566 /* Current second (0-59) */
45567 uint8_t second;
45568 uint8_t unused_0;
45569 /* Current millisecond (0-999) */
45570 uint16_t millisecond;
45571 /* Minutes east of UTC, 0xffff if TZ is not known */
45572 int16_t zone;
45573 /* Time zone is Coordinated Universal Time (UTC) */
45574 #define HWRM_FW_SET_TIME_INPUT_ZONE_UTC 0
45575 /* Time zone is not known */
45576 #define HWRM_FW_SET_TIME_INPUT_ZONE_UNKNOWN 65535
45577 #define HWRM_FW_SET_TIME_INPUT_ZONE_LAST HWRM_FW_SET_TIME_INPUT_ZONE_UNKNOWN
45578 uint8_t unused_1[4];
45579 } hwrm_fw_set_time_input_t, *phwrm_fw_set_time_input_t;
45580
45581 /* hwrm_fw_set_time_output (size:128b/16B) */
45582
45583 typedef struct hwrm_fw_set_time_output {
45584 /* The specific error status for the command. */
45585 uint16_t error_code;
45586 /* The HWRM command request type. */
45587 uint16_t req_type;
45588 /* The sequence ID from the original command. */
45589 uint16_t seq_id;
45590 /* The length of the response data in number of bytes. */
45591 uint16_t resp_len;
45592 uint8_t unused_0[7];
45593 /*
45594 * This field is used in Output records to indicate that the output
45595 * is completely written to RAM. This field should be read as '1'
45596 * to indicate that the output has been completely written.
45597 * When writing a command completion or response to an internal processor,
45598 * the order of writes has to be such that this field is written last.
45599 */
45600 uint8_t valid;
45601 } hwrm_fw_set_time_output_t, *phwrm_fw_set_time_output_t;
45602
45603 /********************
45604 * hwrm_fw_get_time *
45605 ********************/
45606
45607
45608 /* hwrm_fw_get_time_input (size:128b/16B) */
45609
45610 typedef struct hwrm_fw_get_time_input {
45611 /* The HWRM command request type. */
45612 uint16_t req_type;
45613 /*
45614 * The completion ring to send the completion event on. This should
45615 * be the NQ ID returned from the `nq_alloc` HWRM command.
45616 */
45617 uint16_t cmpl_ring;
45618 /*
45619 * The sequence ID is used by the driver for tracking multiple
45620 * commands. This ID is treated as opaque data by the firmware and
45621 * the value is returned in the `hwrm_resp_hdr` upon completion.
45622 */
45623 uint16_t seq_id;
45624 /*
45625 * The target ID of the command:
45626 * * 0x0-0xFFF8 - The function ID
45627 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45628 * * 0xFFFD - Reserved for user-space HWRM interface
45629 * * 0xFFFF - HWRM
45630 */
45631 uint16_t target_id;
45632 /*
45633 * A physical address pointer pointing to a host buffer that the
45634 * command's response data will be written. This can be either a host
45635 * physical address (HPA) or a guest physical address (GPA) and must
45636 * point to a physically contiguous block of memory.
45637 */
45638 uint64_t resp_addr;
45639 } hwrm_fw_get_time_input_t, *phwrm_fw_get_time_input_t;
45640
45641 /* hwrm_fw_get_time_output (size:192b/24B) */
45642
45643 typedef struct hwrm_fw_get_time_output {
45644 /* The specific error status for the command. */
45645 uint16_t error_code;
45646 /* The HWRM command request type. */
45647 uint16_t req_type;
45648 /* The sequence ID from the original command. */
45649 uint16_t seq_id;
45650 /* The length of the response data in number of bytes. */
45651 uint16_t resp_len;
45652 /* Current year */
45653 uint16_t year;
45654 /* Date/time is not known */
45655 #define HWRM_FW_GET_TIME_OUTPUT_YEAR_UNKNOWN UINT32_C(0x0)
45656 #define HWRM_FW_GET_TIME_OUTPUT_YEAR_LAST HWRM_FW_GET_TIME_OUTPUT_YEAR_UNKNOWN
45657 /* Current month of year (1-12) */
45658 uint8_t month;
45659 /* Current day of month (1-31) */
45660 uint8_t day;
45661 /* Current hour (0-23) */
45662 uint8_t hour;
45663 /* Current minute (0-59) */
45664 uint8_t minute;
45665 /* Current second (0-59) */
45666 uint8_t second;
45667 uint8_t unused_0;
45668 /* Current millisecond (0-999) */
45669 uint16_t millisecond;
45670 /* Minutes east of UTC, 0xffff if TZ is not known */
45671 int16_t zone;
45672 /* Time zone is Coordinated Universal Time (UTC) */
45673 #define HWRM_FW_GET_TIME_OUTPUT_ZONE_UTC 0
45674 /* Time zone is not known */
45675 #define HWRM_FW_GET_TIME_OUTPUT_ZONE_UNKNOWN 65535
45676 #define HWRM_FW_GET_TIME_OUTPUT_ZONE_LAST HWRM_FW_GET_TIME_OUTPUT_ZONE_UNKNOWN
45677 uint8_t unused_1[3];
45678 /*
45679 * This field is used in Output records to indicate that the output
45680 * is completely written to RAM. This field should be read as '1'
45681 * to indicate that the output has been completely written.
45682 * When writing a command completion or response to an internal processor,
45683 * the order of writes has to be such that this field is written last.
45684 */
45685 uint8_t valid;
45686 } hwrm_fw_get_time_output_t, *phwrm_fw_get_time_output_t;
45687
45688 /* hwrm_struct_hdr (size:128b/16B) */
45689
45690 typedef struct hwrm_struct_hdr {
45691 /* This value indicates the structured data ID. */
45692 uint16_t struct_id;
45693 /* LLDP configuration structured data ID. */
45694 #define HWRM_STRUCT_HDR_STRUCT_ID_LLDP_CFG UINT32_C(0x41b)
45695 /* DCBX ETS configuration structured data ID. */
45696 #define HWRM_STRUCT_HDR_STRUCT_ID_DCBX_ETS UINT32_C(0x41d)
45697 /* DCBX PFC configuration structured data ID. */
45698 #define HWRM_STRUCT_HDR_STRUCT_ID_DCBX_PFC UINT32_C(0x41f)
45699 /* DCBX APP configuration structured data ID. */
45700 #define HWRM_STRUCT_HDR_STRUCT_ID_DCBX_APP UINT32_C(0x421)
45701 /* DCBX state configuration structured data ID for all DCBX features. */
45702 #define HWRM_STRUCT_HDR_STRUCT_ID_DCBX_FEATURE_STATE UINT32_C(0x422)
45703 /* LLDP generic structured data ID. This is used with GET_STRUCTURED_DATA only. */
45704 #define HWRM_STRUCT_HDR_STRUCT_ID_LLDP_GENERIC UINT32_C(0x424)
45705 /* LLDP device structured data ID. This is used with GET_STRUCTURED_DATA only. */
45706 #define HWRM_STRUCT_HDR_STRUCT_ID_LLDP_DEVICE UINT32_C(0x426)
45707 /* Power Backup info */
45708 #define HWRM_STRUCT_HDR_STRUCT_ID_POWER_BKUP UINT32_C(0x427)
45709 /* reserved for AFM usage. */
45710 #define HWRM_STRUCT_HDR_STRUCT_ID_AFM_OPAQUE UINT32_C(0x1)
45711 /* Port description. */
45712 #define HWRM_STRUCT_HDR_STRUCT_ID_PORT_DESCRIPTION UINT32_C(0xa)
45713 /* RSSv2 Configuration. */
45714 #define HWRM_STRUCT_HDR_STRUCT_ID_RSS_V2 UINT32_C(0x64)
45715 /* MSI-X vectors per VF table. */
45716 #define HWRM_STRUCT_HDR_STRUCT_ID_MSIX_PER_VF UINT32_C(0xc8)
45717 #define HWRM_STRUCT_HDR_STRUCT_ID_LAST HWRM_STRUCT_HDR_STRUCT_ID_MSIX_PER_VF
45718 /* This value indicates the length of structured data. */
45719 uint16_t len;
45720 /* This value indicates the version of structured data. */
45721 uint8_t version;
45722 /* This value indicates the number of structured data elements. */
45723 uint8_t count;
45724 /* This value indicates the subtype. */
45725 uint16_t subtype;
45726 /*
45727 * This value indicates the count of 64-bit values that point to the next header.
45728 * A value of 0 means that this is the last element. The value is a count of 64-bit
45729 * words from the beginning of the current header.
45730 */
45731 uint16_t next_offset;
45732 /* This value indicates this is the last element */
45733 #define HWRM_STRUCT_HDR_NEXT_OFFSET_LAST UINT32_C(0x0)
45734 uint8_t unused_0[6];
45735 } hwrm_struct_hdr_t, *phwrm_struct_hdr_t;
45736
45737 /* hwrm_struct_data_dcbx_ets (size:256b/32B) */
45738
45739 typedef struct hwrm_struct_data_dcbx_ets {
45740 /*
45741 * This field indicates if this configuration is ETS recommendation or ETS configuration.
45742 * A value 1 means it is ETS configuration, A value of 2 means it is a ETS recommendation.
45743 */
45744 uint8_t destination;
45745 /* ETS configuration */
45746 #define HWRM_STRUCT_DATA_DCBX_ETS_DESTINATION_CONFIGURATION UINT32_C(0x1)
45747 /* ETS recommendation */
45748 #define HWRM_STRUCT_DATA_DCBX_ETS_DESTINATION_RECOMMMENDATION UINT32_C(0x2)
45749 #define HWRM_STRUCT_DATA_DCBX_ETS_DESTINATION_LAST HWRM_STRUCT_DATA_DCBX_ETS_DESTINATION_RECOMMMENDATION
45750 /* This value indicates maximum ETS TCs supported. */
45751 uint8_t max_tcs;
45752 /* unused. */
45753 uint16_t unused1;
45754 /* ETS priority 0 to TC map. */
45755 uint8_t pri0_to_tc_map;
45756 /* ETS priority 1 to TC map. */
45757 uint8_t pri1_to_tc_map;
45758 /* ETS priority 2 to TC map. */
45759 uint8_t pri2_to_tc_map;
45760 /* ETS priority 3 to TC map. */
45761 uint8_t pri3_to_tc_map;
45762 /* ETS priority 4 to TC map. */
45763 uint8_t pri4_to_tc_map;
45764 /* ETS priority 5 to TC map. */
45765 uint8_t pri5_to_tc_map;
45766 /* ETS priority 6 to TC map. */
45767 uint8_t pri6_to_tc_map;
45768 /* ETS priority 7 to TC map. */
45769 uint8_t pri7_to_tc_map;
45770 /* ETS TC 0 to bandwidth map. */
45771 uint8_t tc0_to_bw_map;
45772 /* ETS TC 1 to bandwidth map. */
45773 uint8_t tc1_to_bw_map;
45774 /* ETS TC 2 to bandwidth map. */
45775 uint8_t tc2_to_bw_map;
45776 /* ETS TC 3 to bandwidth map. */
45777 uint8_t tc3_to_bw_map;
45778 /* ETS TC 4 to bandwidth map. */
45779 uint8_t tc4_to_bw_map;
45780 /* ETS TC 5 to bandwidth map. */
45781 uint8_t tc5_to_bw_map;
45782 /* ETS TC 6 to bandwidth map. */
45783 uint8_t tc6_to_bw_map;
45784 /* ETS TC 7 to bandwidth map. */
45785 uint8_t tc7_to_bw_map;
45786 /* ETS TC 0 to TSA map. */
45787 uint8_t tc0_to_tsa_map;
45788 /* strict priority */
45789 #define HWRM_STRUCT_DATA_DCBX_ETS_TC0_TO_TSA_MAP_TSA_TYPE_SP UINT32_C(0x0)
45790 /* credit based shaper */
45791 #define HWRM_STRUCT_DATA_DCBX_ETS_TC0_TO_TSA_MAP_TSA_TYPE_CBS UINT32_C(0x1)
45792 /* ETS */
45793 #define HWRM_STRUCT_DATA_DCBX_ETS_TC0_TO_TSA_MAP_TSA_TYPE_ETS UINT32_C(0x2)
45794 /* vendor specific */
45795 #define HWRM_STRUCT_DATA_DCBX_ETS_TC0_TO_TSA_MAP_TSA_TYPE_VENDOR_SPECIFIC UINT32_C(0xff)
45796 #define HWRM_STRUCT_DATA_DCBX_ETS_TC0_TO_TSA_MAP_LAST HWRM_STRUCT_DATA_DCBX_ETS_TC0_TO_TSA_MAP_TSA_TYPE_VENDOR_SPECIFIC
45797 /* ETS TC 1 to TSA map. */
45798 uint8_t tc1_to_tsa_map;
45799 /* ETS TC 2 to TSA map. */
45800 uint8_t tc2_to_tsa_map;
45801 /* ETS TC 3 to TSA map. */
45802 uint8_t tc3_to_tsa_map;
45803 /* ETS TC 4 to TSA map. */
45804 uint8_t tc4_to_tsa_map;
45805 /* ETS TC 5 to TSA map. */
45806 uint8_t tc5_to_tsa_map;
45807 /* ETS TC 6 to TSA map. */
45808 uint8_t tc6_to_tsa_map;
45809 /* ETS TC 7 to TSA map. */
45810 uint8_t tc7_to_tsa_map;
45811 uint8_t unused_0[4];
45812 } hwrm_struct_data_dcbx_ets_t, *phwrm_struct_data_dcbx_ets_t;
45813
45814 /* hwrm_struct_data_dcbx_pfc (size:64b/8B) */
45815
45816 typedef struct hwrm_struct_data_dcbx_pfc {
45817 /*
45818 * This field indicates PFC priority bit map. A value of '' indicates PFC
45819 * is disabled. A value of '1' indicates PFC is enabled on that priority.
45820 */
45821 uint8_t pfc_priority_bitmap;
45822 /*
45823 * This field indicates max PFC TCs supported. Each PFC TC will map to
45824 * a lossless CoS queue.
45825 */
45826 uint8_t max_pfc_tcs;
45827 /*
45828 * This field indicates if MACSec bypass capability is enabled. A value
45829 * of '1' indicates MBC is enabled. A value of '' indicates MBC is disabled.
45830 */
45831 uint8_t mbc;
45832 uint8_t unused_0[5];
45833 } hwrm_struct_data_dcbx_pfc_t, *phwrm_struct_data_dcbx_pfc_t;
45834
45835 /* hwrm_struct_data_dcbx_app (size:64b/8B) */
45836
45837 typedef struct hwrm_struct_data_dcbx_app {
45838 /*
45839 * This field indicates the protocol identifier. This should be specified
45840 * in big endian format.
45841 */
45842 uint16_t protocol_id;
45843 /*
45844 * This field indicates the protocol selector. The valid values are
45845 * mentioned below.
45846 */
45847 uint8_t protocol_selector;
45848 /* ether type */
45849 #define HWRM_STRUCT_DATA_DCBX_APP_PROTOCOL_SELECTOR_ETHER_TYPE UINT32_C(0x1)
45850 /* TCP port */
45851 #define HWRM_STRUCT_DATA_DCBX_APP_PROTOCOL_SELECTOR_TCP_PORT UINT32_C(0x2)
45852 /* UDP port */
45853 #define HWRM_STRUCT_DATA_DCBX_APP_PROTOCOL_SELECTOR_UDP_PORT UINT32_C(0x3)
45854 /* TCP & UDP port */
45855 #define HWRM_STRUCT_DATA_DCBX_APP_PROTOCOL_SELECTOR_TCP_UDP_PORT UINT32_C(0x4)
45856 #define HWRM_STRUCT_DATA_DCBX_APP_PROTOCOL_SELECTOR_LAST HWRM_STRUCT_DATA_DCBX_APP_PROTOCOL_SELECTOR_TCP_UDP_PORT
45857 /* This field indicates application priority. */
45858 uint8_t priority;
45859 /* This field indicates this entry is valid. */
45860 uint8_t valid;
45861 uint8_t unused_0[3];
45862 } hwrm_struct_data_dcbx_app_t, *phwrm_struct_data_dcbx_app_t;
45863
45864 /* hwrm_struct_data_dcbx_feature_state (size:64b/8B) */
45865
45866 typedef struct hwrm_struct_data_dcbx_feature_state {
45867 /* DCBX mode - IEEE or CEE. This is read only field. */
45868 uint8_t dcbx_mode;
45869 /* DCBX disabled mode. */
45870 #define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_DCBX_MODE_DCBX_DISABLED UINT32_C(0x0)
45871 /* DCBX IEEE mode. */
45872 #define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_DCBX_MODE_DCBX_IEEE UINT32_C(0x1)
45873 /* DCBX CEE mode. */
45874 #define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_DCBX_MODE_DCBX_CEE UINT32_C(0x2)
45875 #define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_DCBX_MODE_LAST HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_DCBX_MODE_DCBX_CEE
45876 /* ETS TLV state. */
45877 uint8_t ets_state;
45878 /* PFC TLV state. */
45879 uint8_t pfc_state;
45880 /* App TLV state. */
45881 uint8_t app_state;
45882 /* Feature enable bit position. */
45883 #define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_APP_STATE_ENABLE_BIT_POS UINT32_C(0x7)
45884 /* Feature willing bit position. */
45885 #define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_APP_STATE_WILLING_BIT_POS UINT32_C(0x6)
45886 /* Feature advertise bit position. */
45887 #define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_APP_STATE_ADVERTISE_BIT_POS UINT32_C(0x5)
45888 #define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_APP_STATE_LAST HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_APP_STATE_ADVERTISE_BIT_POS
45889 /* unused. */
45890 uint8_t unused[3];
45891 /* This field is used to reset the DCBX configuration to factory defaults. */
45892 uint8_t resets;
45893 /* reset ETS configuration. */
45894 #define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_RESETS_RESET_ETS UINT32_C(0x1)
45895 /* reset PFC configuration. */
45896 #define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_RESETS_RESET_PFC UINT32_C(0x2)
45897 /* reset application configuration. */
45898 #define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_RESETS_RESET_APP UINT32_C(0x4)
45899 /* reset DCBX state configuration. */
45900 #define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_RESETS_RESET_STATE UINT32_C(0x8)
45901 #define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_RESETS_LAST HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_RESETS_RESET_STATE
45902 } hwrm_struct_data_dcbx_feature_state_t, *phwrm_struct_data_dcbx_feature_state_t;
45903
45904 /* hwrm_struct_data_lldp (size:64b/8B) */
45905
45906 typedef struct hwrm_struct_data_lldp {
45907 /* Port admin state */
45908 uint8_t admin_state;
45909 /* Disable both Tx and Rx */
45910 #define HWRM_STRUCT_DATA_LLDP_ADMIN_STATE_DISABLE UINT32_C(0x0)
45911 /* Enable Tx only */
45912 #define HWRM_STRUCT_DATA_LLDP_ADMIN_STATE_TX UINT32_C(0x1)
45913 /* Enable Rx only */
45914 #define HWRM_STRUCT_DATA_LLDP_ADMIN_STATE_RX UINT32_C(0x2)
45915 /* Enable both Tx and Rx */
45916 #define HWRM_STRUCT_DATA_LLDP_ADMIN_STATE_ENABLE UINT32_C(0x3)
45917 #define HWRM_STRUCT_DATA_LLDP_ADMIN_STATE_LAST HWRM_STRUCT_DATA_LLDP_ADMIN_STATE_ENABLE
45918 /* Port description TLV transmit state (enable(1)/disable(0)). */
45919 uint8_t port_description_state;
45920 /* Disable */
45921 #define HWRM_STRUCT_DATA_LLDP_PORT_DESCRIPTION_STATE_DISABLE UINT32_C(0x0)
45922 /* Enable. */
45923 #define HWRM_STRUCT_DATA_LLDP_PORT_DESCRIPTION_STATE_ENABLE UINT32_C(0x1)
45924 #define HWRM_STRUCT_DATA_LLDP_PORT_DESCRIPTION_STATE_LAST HWRM_STRUCT_DATA_LLDP_PORT_DESCRIPTION_STATE_ENABLE
45925 /* System name TLV transmit state (enable(1)/disable(0)). */
45926 uint8_t system_name_state;
45927 /* Disable */
45928 #define HWRM_STRUCT_DATA_LLDP_SYSTEM_NAME_STATE_DISABLE UINT32_C(0x0)
45929 /* Enable. */
45930 #define HWRM_STRUCT_DATA_LLDP_SYSTEM_NAME_STATE_ENABLE UINT32_C(0x1)
45931 #define HWRM_STRUCT_DATA_LLDP_SYSTEM_NAME_STATE_LAST HWRM_STRUCT_DATA_LLDP_SYSTEM_NAME_STATE_ENABLE
45932 /* System description TLV transmit state (enable(1)/disable(0)). */
45933 uint8_t system_desc_state;
45934 /* Disable */
45935 #define HWRM_STRUCT_DATA_LLDP_SYSTEM_DESC_STATE_DISABLE UINT32_C(0x0)
45936 /* Enable. */
45937 #define HWRM_STRUCT_DATA_LLDP_SYSTEM_DESC_STATE_ENABLE UINT32_C(0x1)
45938 #define HWRM_STRUCT_DATA_LLDP_SYSTEM_DESC_STATE_LAST HWRM_STRUCT_DATA_LLDP_SYSTEM_DESC_STATE_ENABLE
45939 /* System capabilities TLV transmit state (enable(1)/disable(0)). */
45940 uint8_t system_cap_state;
45941 /* Disable */
45942 #define HWRM_STRUCT_DATA_LLDP_SYSTEM_CAP_STATE_DISABLE UINT32_C(0x0)
45943 /* Enable. */
45944 #define HWRM_STRUCT_DATA_LLDP_SYSTEM_CAP_STATE_ENABLE UINT32_C(0x1)
45945 #define HWRM_STRUCT_DATA_LLDP_SYSTEM_CAP_STATE_LAST HWRM_STRUCT_DATA_LLDP_SYSTEM_CAP_STATE_ENABLE
45946 /* Management address TLV transmit state (enable(1)/disable(0)). */
45947 uint8_t mgmt_addr_state;
45948 /* Disable */
45949 #define HWRM_STRUCT_DATA_LLDP_MGMT_ADDR_STATE_DISABLE UINT32_C(0x0)
45950 /* Enable. */
45951 #define HWRM_STRUCT_DATA_LLDP_MGMT_ADDR_STATE_ENABLE UINT32_C(0x1)
45952 #define HWRM_STRUCT_DATA_LLDP_MGMT_ADDR_STATE_LAST HWRM_STRUCT_DATA_LLDP_MGMT_ADDR_STATE_ENABLE
45953 /* Async event notification state (enable(1)/disable(0)). */
45954 uint8_t async_event_notification_state;
45955 /* Disable */
45956 #define HWRM_STRUCT_DATA_LLDP_ASYNC_EVENT_NOTIFICATION_STATE_DISABLE UINT32_C(0x0)
45957 /* Enable. */
45958 #define HWRM_STRUCT_DATA_LLDP_ASYNC_EVENT_NOTIFICATION_STATE_ENABLE UINT32_C(0x1)
45959 #define HWRM_STRUCT_DATA_LLDP_ASYNC_EVENT_NOTIFICATION_STATE_LAST HWRM_STRUCT_DATA_LLDP_ASYNC_EVENT_NOTIFICATION_STATE_ENABLE
45960 uint8_t unused_0;
45961 } hwrm_struct_data_lldp_t, *phwrm_struct_data_lldp_t;
45962
45963 /* hwrm_struct_data_lldp_generic (size:2112b/264B) */
45964
45965 typedef struct hwrm_struct_data_lldp_generic {
45966 /* TLV type. */
45967 uint8_t tlv_type;
45968 /* Chassis ID TLV */
45969 #define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_CHASSIS UINT32_C(0x1)
45970 /* Port ID TLV */
45971 #define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_PORT UINT32_C(0x2)
45972 /* System name TLV */
45973 #define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_SYSTEM_NAME UINT32_C(0x3)
45974 /* System description TLV */
45975 #define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_SYSTEM_DESCRIPTION UINT32_C(0x4)
45976 /* Port name TLV */
45977 #define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_PORT_NAME UINT32_C(0x5)
45978 /* Port description TLV */
45979 #define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_PORT_DESCRIPTION UINT32_C(0x6)
45980 #define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_LAST HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_PORT_DESCRIPTION
45981 /* TLV sub-type. */
45982 uint8_t subtype;
45983 /* Length. */
45984 uint8_t length;
45985 /* unused. */
45986 uint8_t unused1[5];
45987 /* TLV value. */
45988 uint32_t tlv_value[64];
45989 } hwrm_struct_data_lldp_generic_t, *phwrm_struct_data_lldp_generic_t;
45990
45991 /* hwrm_struct_data_lldp_device (size:1472b/184B) */
45992
45993 typedef struct hwrm_struct_data_lldp_device {
45994 /* Time to Live. */
45995 uint16_t ttl;
45996 /* Management address length. */
45997 uint8_t mgmt_addr_len;
45998 /* Management address type. */
45999 uint8_t mgmt_addr_type;
46000 uint8_t unused_3[4];
46001 /* Management address. */
46002 uint32_t mgmt_addr[8];
46003 /* System capabilities. */
46004 uint32_t system_caps;
46005 /* Interface number type. */
46006 uint8_t intf_num_type;
46007 /* Management address OID length. */
46008 uint8_t mgmt_addr_oid_length;
46009 uint8_t unused_4[2];
46010 /* Interface number. */
46011 uint32_t intf_num;
46012 uint8_t unused_5[4];
46013 /* Management address OID. */
46014 uint32_t mgmt_addr_oid[32];
46015 } hwrm_struct_data_lldp_device_t, *phwrm_struct_data_lldp_device_t;
46016
46017 /* hwrm_struct_data_port_description (size:64b/8B) */
46018
46019 typedef struct hwrm_struct_data_port_description {
46020 /*
46021 * Port #. Port number starts at 0 and anything greater than number of ports
46022 * minus 1 is an error.
46023 */
46024 uint8_t port_id;
46025 uint8_t unused_0[7];
46026 } hwrm_struct_data_port_description_t, *phwrm_struct_data_port_description_t;
46027
46028 /* hwrm_struct_data_rss_v2 (size:128b/16B) */
46029
46030 typedef struct hwrm_struct_data_rss_v2 {
46031 uint16_t flags;
46032 /* When this bit is '1', the hash type and hash key are included. */
46033 #define HWRM_STRUCT_DATA_RSS_V2_FLAGS_HASH_VALID UINT32_C(0x1)
46034 /* RSS Context index. */
46035 uint16_t rss_ctx_id;
46036 /* Number ring group IDs. */
46037 uint16_t num_ring_groups;
46038 uint16_t hash_type;
46039 /*
46040 * When this bit is '1', the RSS hash shall be computed
46041 * over source and destination IPv4 addresses of IPv4
46042 * packets.
46043 */
46044 #define HWRM_STRUCT_DATA_RSS_V2_HASH_TYPE_IPV4 UINT32_C(0x1)
46045 /*
46046 * When this bit is '1', the RSS hash shall be computed
46047 * over source/destination IPv4 addresses and
46048 * source/destination ports of TCP/IPv4 packets.
46049 */
46050 #define HWRM_STRUCT_DATA_RSS_V2_HASH_TYPE_TCP_IPV4 UINT32_C(0x2)
46051 /*
46052 * When this bit is '1', the RSS hash shall be computed
46053 * over source/destination IPv4 addresses and
46054 * source/destination ports of UDP/IPv4 packets.
46055 */
46056 #define HWRM_STRUCT_DATA_RSS_V2_HASH_TYPE_UDP_IPV4 UINT32_C(0x4)
46057 /*
46058 * When this bit is '1', the RSS hash shall be computed
46059 * over source and destination IPv4 addresses of IPv6
46060 * packets.
46061 */
46062 #define HWRM_STRUCT_DATA_RSS_V2_HASH_TYPE_IPV6 UINT32_C(0x8)
46063 /*
46064 * When this bit is '1', the RSS hash shall be computed
46065 * over source/destination IPv6 addresses and
46066 * source/destination ports of TCP/IPv6 packets.
46067 */
46068 #define HWRM_STRUCT_DATA_RSS_V2_HASH_TYPE_TCP_IPV6 UINT32_C(0x10)
46069 /*
46070 * When this bit is '1', the RSS hash shall be computed
46071 * over source/destination IPv6 addresses and
46072 * source/destination ports of UDP/IPv6 packets.
46073 */
46074 #define HWRM_STRUCT_DATA_RSS_V2_HASH_TYPE_UDP_IPV6 UINT32_C(0x20)
46075 /* Hash key. This field is optional. */
46076 uint64_t hash_key_ring_group_ids;
46077 } hwrm_struct_data_rss_v2_t, *phwrm_struct_data_rss_v2_t;
46078
46079 /* hwrm_struct_data_power_information (size:192b/24B) */
46080
46081 typedef struct hwrm_struct_data_power_information {
46082 /* Backup power information version */
46083 uint32_t bkup_power_info_ver;
46084 /* Platform backup power count */
46085 uint32_t platform_bkup_power_count;
46086 /* Load in milli Watt */
46087 uint32_t load_milli_watt;
46088 /* Backup time in milli seconds */
46089 uint32_t bkup_time_milli_seconds;
46090 /* Backup power status */
46091 uint32_t bkup_power_status;
46092 /* Backup power charge time */
46093 uint32_t bkup_power_charge_time;
46094 } hwrm_struct_data_power_information_t, *phwrm_struct_data_power_information_t;
46095
46096 /* hwrm_struct_data_msix_per_vf (size:320b/40B) */
46097
46098 typedef struct hwrm_struct_data_msix_per_vf {
46099 /* PF ID */
46100 uint16_t pf_id;
46101 /* Number of rows in table. */
46102 uint16_t count;
46103 uint32_t unused_0;
46104 /* Starting VF for row 0 */
46105 uint16_t start_vf_0;
46106 /* MSI-X vectors per VF for row 0 */
46107 uint16_t msix_0;
46108 /* Starting VF for row 1 */
46109 uint16_t start_vf_1;
46110 /* MSI-X vectors per VF for row 1 */
46111 uint16_t msix_1;
46112 /* Starting VF for row 2 */
46113 uint16_t start_vf_2;
46114 /* MSI-X vectors per VF for row 2 */
46115 uint16_t msix_2;
46116 /* Starting VF for row 3 */
46117 uint16_t start_vf_3;
46118 /* MSI-X vectors per VF for row 3 */
46119 uint16_t msix_3;
46120 /* Starting VF for row 4 */
46121 uint16_t start_vf_4;
46122 /* MSI-X vectors per VF for row 4 */
46123 uint16_t msix_4;
46124 /* Starting VF for row 5 */
46125 uint16_t start_vf_5;
46126 /* MSI-X vectors per VF for row 5 */
46127 uint16_t msix_5;
46128 /* Starting VF for row 6 */
46129 uint16_t start_vf_6;
46130 /* MSI-X vectors per VF for row 6 */
46131 uint16_t msix_6;
46132 /* Starting VF for row 7 */
46133 uint16_t start_vf_7;
46134 /* MSI-X vectors per VF for row 7 */
46135 uint16_t msix_7;
46136 } hwrm_struct_data_msix_per_vf_t, *phwrm_struct_data_msix_per_vf_t;
46137
46138 /*******************
46139 * hwrm_fw_ecn_cfg *
46140 *******************/
46141
46142
46143 /* hwrm_fw_ecn_cfg_input (size:192b/24B) */
46144
46145 typedef struct hwrm_fw_ecn_cfg_input {
46146 /* The HWRM command request type. */
46147 uint16_t req_type;
46148 /*
46149 * The completion ring to send the completion event on. This should
46150 * be the NQ ID returned from the `nq_alloc` HWRM command.
46151 */
46152 uint16_t cmpl_ring;
46153 /*
46154 * The sequence ID is used by the driver for tracking multiple
46155 * commands. This ID is treated as opaque data by the firmware and
46156 * the value is returned in the `hwrm_resp_hdr` upon completion.
46157 */
46158 uint16_t seq_id;
46159 /*
46160 * The target ID of the command:
46161 * * 0x0-0xFFF8 - The function ID
46162 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46163 * * 0xFFFD - Reserved for user-space HWRM interface
46164 * * 0xFFFF - HWRM
46165 */
46166 uint16_t target_id;
46167 /*
46168 * A physical address pointer pointing to a host buffer that the
46169 * command's response data will be written. This can be either a host
46170 * physical address (HPA) or a guest physical address (GPA) and must
46171 * point to a physically contiguous block of memory.
46172 */
46173 uint64_t resp_addr;
46174 uint16_t flags;
46175 /*
46176 * When this bit is '1', Explicit Congestion Notification (ECN) is
46177 * enabled device-wide. When ECN is enabled on a multi-host system,
46178 * it is enabled for all hosts. This setting takes effect
46179 * immediately. When ECN is enabled, the firmware activates
46180 * additional receive Class of Service (CoS) queues that are enabled
46181 * for ECN marking and steers ECN-capable packets to those queues.
46182 * This setting is not saved persistently. To enable ECN
46183 * persistently, set NVM option 173, ENABLE_ECN.
46184 * Setting this bit to '' disables ECN immediately.
46185 */
46186 #define HWRM_FW_ECN_CFG_INPUT_FLAGS_ENABLE_ECN UINT32_C(0x1)
46187 uint8_t unused_0[6];
46188 } hwrm_fw_ecn_cfg_input_t, *phwrm_fw_ecn_cfg_input_t;
46189
46190 /* hwrm_fw_ecn_cfg_output (size:128b/16B) */
46191
46192 typedef struct hwrm_fw_ecn_cfg_output {
46193 /* The specific error status for the command. */
46194 uint16_t error_code;
46195 /* The HWRM command request type. */
46196 uint16_t req_type;
46197 /* The sequence ID from the original command. */
46198 uint16_t seq_id;
46199 /* The length of the response data in number of bytes. */
46200 uint16_t resp_len;
46201 uint8_t unused_0[7];
46202 /*
46203 * This field is used in Output records to indicate that the output
46204 * is completely written to RAM. This field should be read as '1'
46205 * to indicate that the output has been completely written.
46206 * When writing a command completion or response to an internal processor,
46207 * the order of writes has to be such that this field is written last.
46208 */
46209 uint8_t valid;
46210 } hwrm_fw_ecn_cfg_output_t, *phwrm_fw_ecn_cfg_output_t;
46211
46212 /********************
46213 * hwrm_fw_ecn_qcfg *
46214 ********************/
46215
46216
46217 /* hwrm_fw_ecn_qcfg_input (size:128b/16B) */
46218
46219 typedef struct hwrm_fw_ecn_qcfg_input {
46220 /* The HWRM command request type. */
46221 uint16_t req_type;
46222 /*
46223 * The completion ring to send the completion event on. This should
46224 * be the NQ ID returned from the `nq_alloc` HWRM command.
46225 */
46226 uint16_t cmpl_ring;
46227 /*
46228 * The sequence ID is used by the driver for tracking multiple
46229 * commands. This ID is treated as opaque data by the firmware and
46230 * the value is returned in the `hwrm_resp_hdr` upon completion.
46231 */
46232 uint16_t seq_id;
46233 /*
46234 * The target ID of the command:
46235 * * 0x0-0xFFF8 - The function ID
46236 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46237 * * 0xFFFD - Reserved for user-space HWRM interface
46238 * * 0xFFFF - HWRM
46239 */
46240 uint16_t target_id;
46241 /*
46242 * A physical address pointer pointing to a host buffer that the
46243 * command's response data will be written. This can be either a host
46244 * physical address (HPA) or a guest physical address (GPA) and must
46245 * point to a physically contiguous block of memory.
46246 */
46247 uint64_t resp_addr;
46248 } hwrm_fw_ecn_qcfg_input_t, *phwrm_fw_ecn_qcfg_input_t;
46249
46250 /* hwrm_fw_ecn_qcfg_output (size:128b/16B) */
46251
46252 typedef struct hwrm_fw_ecn_qcfg_output {
46253 /* The specific error status for the command. */
46254 uint16_t error_code;
46255 /* The HWRM command request type. */
46256 uint16_t req_type;
46257 /* The sequence ID from the original command. */
46258 uint16_t seq_id;
46259 /* The length of the response data in number of bytes. */
46260 uint16_t resp_len;
46261 uint16_t flags;
46262 /* When this bit is '1', ECN is enabled device-wide. */
46263 #define HWRM_FW_ECN_QCFG_OUTPUT_FLAGS_ENABLE_ECN UINT32_C(0x1)
46264 uint8_t unused_0[5];
46265 /*
46266 * This field is used in Output records to indicate that the output
46267 * is completely written to RAM. This field should be read as '1'
46268 * to indicate that the output has been completely written.
46269 * When writing a command completion or response to an internal processor,
46270 * the order of writes has to be such that this field is written last.
46271 */
46272 uint8_t valid;
46273 } hwrm_fw_ecn_qcfg_output_t, *phwrm_fw_ecn_qcfg_output_t;
46274
46275 /************************
46276 * hwrm_fw_health_check *
46277 ************************/
46278
46279
46280 /* hwrm_fw_health_check_input (size:128b/16B) */
46281
46282 typedef struct hwrm_fw_health_check_input {
46283 /* The HWRM command request type. */
46284 uint16_t req_type;
46285 /*
46286 * The completion ring to send the completion event on. This should
46287 * be the NQ ID returned from the `nq_alloc` HWRM command.
46288 */
46289 uint16_t cmpl_ring;
46290 /*
46291 * The sequence ID is used by the driver for tracking multiple
46292 * commands. This ID is treated as opaque data by the firmware and
46293 * the value is returned in the `hwrm_resp_hdr` upon completion.
46294 */
46295 uint16_t seq_id;
46296 /*
46297 * The target ID of the command:
46298 * * 0x0-0xFFF8 - The function ID
46299 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46300 * * 0xFFFD - Reserved for user-space HWRM interface
46301 * * 0xFFFF - HWRM
46302 */
46303 uint16_t target_id;
46304 /*
46305 * A physical address pointer pointing to a host buffer that the
46306 * command's response data will be written. This can be either a host
46307 * physical address (HPA) or a guest physical address (GPA) and must
46308 * point to a physically contiguous block of memory.
46309 */
46310 uint64_t resp_addr;
46311 } hwrm_fw_health_check_input_t, *phwrm_fw_health_check_input_t;
46312
46313 /* hwrm_fw_health_check_output (size:128b/16B) */
46314
46315 typedef struct hwrm_fw_health_check_output {
46316 /* The specific error status for the command. */
46317 uint16_t error_code;
46318 /* The HWRM command request type. */
46319 uint16_t req_type;
46320 /* The sequence ID from the original command. */
46321 uint16_t seq_id;
46322 /* The length of the response data in number of bytes. */
46323 uint16_t resp_len;
46324 uint32_t fw_status;
46325 /*
46326 * This bit is '' if the primary SBI was used this boot,
46327 * or '1' if the secondary SBI was used.
46328 */
46329 #define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_SBI_BOOTED UINT32_C(0x1)
46330 /*
46331 * This bit is '' if the primary and secondary SBI images
46332 * match, or '1' if they do not match.
46333 */
46334 #define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_SBI_MISMATCH UINT32_C(0x2)
46335 /*
46336 * This bit is '' if the primary SRT was used this boot,
46337 * or '1' if the secondary SRT was used.
46338 */
46339 #define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_SRT_BOOTED UINT32_C(0x4)
46340 /*
46341 * This bit is '' if the primary and secondary SRT images
46342 * match, or '1' if they do not match.
46343 */
46344 #define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_SRT_MISMATCH UINT32_C(0x8)
46345 /*
46346 * This bit is '' if the primary CRT (or second stage SRT)
46347 * was used this boot, or '1' if the secondary CRT (or
46348 * second stage SRT) was used.
46349 */
46350 #define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_CRT_BOOTED UINT32_C(0x10)
46351 /*
46352 * This bit is '' if the primary and secondary CRT images
46353 * (or second stage SRT images) match, or '1' if they do not
46354 * match.
46355 */
46356 #define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_CRT_MISMATCH UINT32_C(0x20)
46357 /*
46358 * This bit is '' if the the second stage RT image is a CRT,
46359 * or '1' if the second stage RT image is an SRT.
46360 */
46361 #define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_SECOND_RT UINT32_C(0x40)
46362 /*
46363 * This bit is '' if the the image was loaded from flash,
46364 * or '1' if the image was fastbooted.
46365 */
46366 #define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_FASTBOOTED UINT32_C(0x80)
46367 /*
46368 * This bit is '' if the primary dir_hdr was used to locate
46369 * the firmware, or '1' if the secondary dir_hdr was used.
46370 */
46371 #define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_DIR_HDR_BOOTED UINT32_C(0x100)
46372 /*
46373 * This bit is '' if the primary and secondary dir_hdr match,
46374 * or '1' if they do not match.
46375 */
46376 #define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_DIR_HDR_MISMATCH UINT32_C(0x200)
46377 /*
46378 * This bit is '' if the Master Boot Record is in good condition,
46379 * or '1' if it is corrupted.
46380 */
46381 #define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_MBR_CORRUPT UINT32_C(0x400)
46382 uint8_t unused_0[3];
46383 /*
46384 * This field is used in Output records to indicate that the output
46385 * is completely written to RAM. This field should be read as '1'
46386 * to indicate that the output has been completely written.
46387 * When writing a command completion or response to an internal processor,
46388 * the order of writes has to be such that this field is written last.
46389 */
46390 uint8_t valid;
46391 } hwrm_fw_health_check_output_t, *phwrm_fw_health_check_output_t;
46392
46393 /***************************
46394 * hwrm_fw_livepatch_query *
46395 ***************************/
46396
46397
46398 /* hwrm_fw_livepatch_query_input (size:192b/24B) */
46399
46400 typedef struct hwrm_fw_livepatch_query_input {
46401 /* The HWRM command request type. */
46402 uint16_t req_type;
46403 /*
46404 * The completion ring to send the completion event on. This should
46405 * be the NQ ID returned from the `nq_alloc` HWRM command.
46406 */
46407 uint16_t cmpl_ring;
46408 /*
46409 * The sequence ID is used by the driver for tracking multiple
46410 * commands. This ID is treated as opaque data by the firmware and
46411 * the value is returned in the `hwrm_resp_hdr` upon completion.
46412 */
46413 uint16_t seq_id;
46414 /*
46415 * The target ID of the command:
46416 * * 0x0-0xFFF8 - The function ID
46417 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46418 * * 0xFFFD - Reserved for user-space HWRM interface
46419 * * 0xFFFF - HWRM
46420 */
46421 uint16_t target_id;
46422 /*
46423 * A physical address pointer pointing to a host buffer that the
46424 * command's response data will be written. This can be either a host
46425 * physical address (HPA) or a guest physical address (GPA) and must
46426 * point to a physically contiguous block of memory.
46427 */
46428 uint64_t resp_addr;
46429 /* Firmware target to which to apply the livepatch query */
46430 uint8_t fw_target;
46431 /* Common firmware livepatch query. */
46432 #define HWRM_FW_LIVEPATCH_QUERY_INPUT_FW_TARGET_COMMON_FW UINT32_C(0x1)
46433 /* Secure firmware livepatch query. */
46434 #define HWRM_FW_LIVEPATCH_QUERY_INPUT_FW_TARGET_SECURE_FW UINT32_C(0x2)
46435 #define HWRM_FW_LIVEPATCH_QUERY_INPUT_FW_TARGET_LAST HWRM_FW_LIVEPATCH_QUERY_INPUT_FW_TARGET_SECURE_FW
46436 uint8_t unused_0[7];
46437 } hwrm_fw_livepatch_query_input_t, *phwrm_fw_livepatch_query_input_t;
46438
46439 /* hwrm_fw_livepatch_query_output (size:640b/80B) */
46440
46441 typedef struct hwrm_fw_livepatch_query_output {
46442 /* The specific error status for the command. */
46443 uint16_t error_code;
46444 /* The HWRM command request type. */
46445 uint16_t req_type;
46446 /* The sequence ID from the original command. */
46447 uint16_t seq_id;
46448 /* The length of the response data in number of bytes. */
46449 uint16_t resp_len;
46450 /*
46451 * This field represents the patch version string of the NVM installed
46452 * livepatch. (ASCII chars with NULL at the end).
46453 */
46454 char install_ver[32];
46455 /*
46456 * This field represents the patch version string of the active
46457 * livepatch. (ASCII chars with NULL at the end).
46458 */
46459 char active_ver[32];
46460 uint16_t status_flags;
46461 /* This bit is '1' if a livepatch image is installed to NVM. */
46462 #define HWRM_FW_LIVEPATCH_QUERY_OUTPUT_STATUS_FLAGS_INSTALL UINT32_C(0x1)
46463 /* This bit is '1' if firmware livepatch is active. */
46464 #define HWRM_FW_LIVEPATCH_QUERY_OUTPUT_STATUS_FLAGS_ACTIVE UINT32_C(0x2)
46465 uint8_t unused_0[5];
46466 /*
46467 * This field is used in Output records to indicate that the output
46468 * is completely written to RAM. This field should be read as '1'
46469 * to indicate that the output has been completely written.
46470 * When writing a command completion or response to an internal processor,
46471 * the order of writes has to be such that this field is written last.
46472 */
46473 uint8_t valid;
46474 } hwrm_fw_livepatch_query_output_t, *phwrm_fw_livepatch_query_output_t;
46475
46476 /*********************
46477 * hwrm_fw_livepatch *
46478 *********************/
46479
46480
46481 /* hwrm_fw_livepatch_input (size:256b/32B) */
46482
46483 typedef struct hwrm_fw_livepatch_input {
46484 /* The HWRM command request type. */
46485 uint16_t req_type;
46486 /*
46487 * The completion ring to send the completion event on. This should
46488 * be the NQ ID returned from the `nq_alloc` HWRM command.
46489 */
46490 uint16_t cmpl_ring;
46491 /*
46492 * The sequence ID is used by the driver for tracking multiple
46493 * commands. This ID is treated as opaque data by the firmware and
46494 * the value is returned in the `hwrm_resp_hdr` upon completion.
46495 */
46496 uint16_t seq_id;
46497 /*
46498 * The target ID of the command:
46499 * * 0x0-0xFFF8 - The function ID
46500 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46501 * * 0xFFFD - Reserved for user-space HWRM interface
46502 * * 0xFFFF - HWRM
46503 */
46504 uint16_t target_id;
46505 /*
46506 * A physical address pointer pointing to a host buffer that the
46507 * command's response data will be written. This can be either a host
46508 * physical address (HPA) or a guest physical address (GPA) and must
46509 * point to a physically contiguous block of memory.
46510 */
46511 uint64_t resp_addr;
46512 /* Livepatch operation */
46513 uint8_t opcode;
46514 /*
46515 * Activate a livepatch that is NVM installed or via direct load
46516 * from host memory. Activate will authenticate a signed patch,
46517 * verify the patch version for compatibility and apply the
46518 * livepatch to existing firmware at run-time.
46519 */
46520 #define HWRM_FW_LIVEPATCH_INPUT_OPCODE_ACTIVATE UINT32_C(0x1)
46521 /*
46522 * Deactivate a livepatch and restore to the original firmware
46523 * operation state.
46524 */
46525 #define HWRM_FW_LIVEPATCH_INPUT_OPCODE_DEACTIVATE UINT32_C(0x2)
46526 #define HWRM_FW_LIVEPATCH_INPUT_OPCODE_LAST HWRM_FW_LIVEPATCH_INPUT_OPCODE_DEACTIVATE
46527 /* Firmware target to which to apply the livepatch operation. */
46528 uint8_t fw_target;
46529 /* Common firmware livepatch. */
46530 #define HWRM_FW_LIVEPATCH_INPUT_FW_TARGET_COMMON_FW UINT32_C(0x1)
46531 /* Secure firmware livepatch. */
46532 #define HWRM_FW_LIVEPATCH_INPUT_FW_TARGET_SECURE_FW UINT32_C(0x2)
46533 #define HWRM_FW_LIVEPATCH_INPUT_FW_TARGET_LAST HWRM_FW_LIVEPATCH_INPUT_FW_TARGET_SECURE_FW
46534 /* Load method for livepatch. */
46535 uint8_t loadtype;
46536 /* Load a livepatch currently installed on NVM. */
46537 #define HWRM_FW_LIVEPATCH_INPUT_LOADTYPE_NVM_INSTALL UINT32_C(0x1)
46538 /*
46539 * Load a livepatch directly from host memory. The livepatch image
46540 * is available at host_addr.
46541 */
46542 #define HWRM_FW_LIVEPATCH_INPUT_LOADTYPE_MEMORY_DIRECT UINT32_C(0x2)
46543 #define HWRM_FW_LIVEPATCH_INPUT_LOADTYPE_LAST HWRM_FW_LIVEPATCH_INPUT_LOADTYPE_MEMORY_DIRECT
46544 /* Reserved for future use. */
46545 uint8_t flags;
46546 /* Length of livepatch image for memory direct loading, in bytes. */
46547 uint32_t patch_len;
46548 /* 64-bit Host address of livepatch image for memory direct loading. */
46549 uint64_t host_addr;
46550 } hwrm_fw_livepatch_input_t, *phwrm_fw_livepatch_input_t;
46551
46552 /* hwrm_fw_livepatch_output (size:128b/16B) */
46553
46554 typedef struct hwrm_fw_livepatch_output {
46555 /* The specific error status for the command. */
46556 uint16_t error_code;
46557 /* The HWRM command request type. */
46558 uint16_t req_type;
46559 /* The sequence ID from the original command. */
46560 uint16_t seq_id;
46561 /* The length of the response data in number of bytes. */
46562 uint16_t resp_len;
46563 uint8_t unused_0[7];
46564 /*
46565 * This field is used in Output records to indicate that the output
46566 * is completely written to RAM. This field should be read as '1'
46567 * to indicate that the output has been completely written.
46568 * When writing a command completion or response to an internal processor,
46569 * the order of writes has to be such that this field is written last.
46570 */
46571 uint8_t valid;
46572 } hwrm_fw_livepatch_output_t, *phwrm_fw_livepatch_output_t;
46573
46574 /* hwrm_fw_livepatch_cmd_err (size:64b/8B) */
46575
46576 typedef struct hwrm_fw_livepatch_cmd_err {
46577 /*
46578 * command specific error codes that goes to
46579 * the cmd_err field in Common HWRM Error Response.
46580 */
46581 uint8_t code;
46582 /* Unknown error. */
46583 #define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
46584 /* Opcode invalid. */
46585 #define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_INVALID_OPCODE UINT32_C(0x1)
46586 /* Firmware target invalid. */
46587 #define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_INVALID_TARGET UINT32_C(0x2)
46588 /* Livepatch operation not supported. */
46589 #define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_NOT_SUPPORTED UINT32_C(0x3)
46590 /* Livepatch image is not installed in NVRAM. */
46591 #define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_NOT_INSTALLED UINT32_C(0x4)
46592 /* Deactivate failed. Firmware is not currently patched. */
46593 #define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_NOT_PATCHED UINT32_C(0x5)
46594 /* Authentication of a signed livepatch failed. */
46595 #define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_AUTH_FAIL UINT32_C(0x6)
46596 /* Livepatch header check failed. Patch incompatible. */
46597 #define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_INVALID_HEADER UINT32_C(0x7)
46598 /* Livepatch size incompatible. */
46599 #define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_INVALID_SIZE UINT32_C(0x8)
46600 /*
46601 * Activate failed. Firmware has already been patched. Deactivate
46602 * existing livepatch before proceeding.
46603 */
46604 #define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_ALREADY_PATCHED UINT32_C(0x9)
46605 #define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_LAST HWRM_FW_LIVEPATCH_CMD_ERR_CODE_ALREADY_PATCHED
46606 uint8_t unused_0[7];
46607 } hwrm_fw_livepatch_cmd_err_t, *phwrm_fw_livepatch_cmd_err_t;
46608
46609 /****************
46610 * hwrm_fw_sync *
46611 ****************/
46612
46613
46614 /* hwrm_fw_sync_input (size:192b/24B) */
46615
46616 typedef struct hwrm_fw_sync_input {
46617 /* The HWRM command request type. */
46618 uint16_t req_type;
46619 /*
46620 * The completion ring to send the completion event on. This should
46621 * be the NQ ID returned from the `nq_alloc` HWRM command.
46622 */
46623 uint16_t cmpl_ring;
46624 /*
46625 * The sequence ID is used by the driver for tracking multiple
46626 * commands. This ID is treated as opaque data by the firmware and
46627 * the value is returned in the `hwrm_resp_hdr` upon completion.
46628 */
46629 uint16_t seq_id;
46630 /*
46631 * The target ID of the command:
46632 * * 0x0-0xFFF8 - The function ID
46633 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46634 * * 0xFFFD - Reserved for user-space HWRM interface
46635 * * 0xFFFF - HWRM
46636 */
46637 uint16_t target_id;
46638 /*
46639 * A physical address pointer pointing to a host buffer that the
46640 * command's response data will be written. This can be either a host
46641 * physical address (HPA) or a guest physical address (GPA) and must
46642 * point to a physically contiguous block of memory.
46643 */
46644 uint64_t resp_addr;
46645 uint32_t sync_action;
46646 /*
46647 * If action is '1' (sync) and this bit is set, the SBI
46648 * images will be synchronized, copying from the instance
46649 * used for boot to the other instance, if they currently
46650 * do not match.
46651 */
46652 #define HWRM_FW_SYNC_INPUT_SYNC_ACTION_SYNC_SBI UINT32_C(0x1)
46653 /*
46654 * If action is '1' (sync) and this bit is set, the SRT
46655 * images will be synchronized, copying from the instance
46656 * used for boot to the other instance, if they currently
46657 * do not match.
46658 */
46659 #define HWRM_FW_SYNC_INPUT_SYNC_ACTION_SYNC_SRT UINT32_C(0x2)
46660 /*
46661 * If action is '1' (sync) and this bit is set, the CRT
46662 * images will be synchronized (or second stage SRT if that
46663 * is used in place of CRT), copying from the instance
46664 * used for boot to the other instance, if they currently
46665 * do not match.
46666 */
46667 #define HWRM_FW_SYNC_INPUT_SYNC_ACTION_SYNC_CRT UINT32_C(0x4)
46668 /*
46669 * If action is '1' (sync) and this bit is set, the dir_hdr
46670 * partition will be synchronized, copying from the instance
46671 * used for boot to the other instance, if they currently
46672 * do not match.
46673 */
46674 #define HWRM_FW_SYNC_INPUT_SYNC_ACTION_SYNC_DIR_HDR UINT32_C(0x8)
46675 /*
46676 * If action is '1' (sync) and this bit is set, the MBR
46677 * will be erased and reprogrammed with valid content.
46678 */
46679 #define HWRM_FW_SYNC_INPUT_SYNC_ACTION_WRITE_MBR UINT32_C(0x10)
46680 /*
46681 * A value of '1' instructs the firmware to perform an image
46682 * synchronization of the firmware types denoted by the
46683 * sync_sbi, sync_srt, sync_crt bits. A value of '' just
46684 * requests the status for the previously requested sync
46685 * operation.
46686 */
46687 #define HWRM_FW_SYNC_INPUT_SYNC_ACTION_ACTION UINT32_C(0x80000000)
46688 uint8_t unused_0[4];
46689 } hwrm_fw_sync_input_t, *phwrm_fw_sync_input_t;
46690
46691 /* hwrm_fw_sync_output (size:128b/16B) */
46692
46693 typedef struct hwrm_fw_sync_output {
46694 /* The specific error status for the command. */
46695 uint16_t error_code;
46696 /* The HWRM command request type. */
46697 uint16_t req_type;
46698 /* The sequence ID from the original command. */
46699 uint16_t seq_id;
46700 /* The length of the response data in number of bytes. */
46701 uint16_t resp_len;
46702 uint32_t sync_status;
46703 /* This bit field indicates the error if 'sync_err' bit is set. */
46704 #define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_ERR_CODE_MASK UINT32_C(0xff)
46705 #define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_ERR_CODE_SFT 0
46706 /* Success, no error */
46707 #define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_ERR_CODE_SUCCESS UINT32_C(0x0)
46708 /*
46709 * A previously requested synchronization command is still
46710 * in progress.
46711 */
46712 #define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_ERR_CODE_IN_PROGRESS UINT32_C(0x1)
46713 /* An NVRAM operation has timed out. */
46714 #define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_ERR_CODE_TIMEOUT UINT32_C(0x2)
46715 /* General NVRAM error code. */
46716 #define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_ERR_CODE_GENERAL UINT32_C(0x3)
46717 #define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_ERR_CODE_LAST HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_ERR_CODE_GENERAL
46718 /*
46719 * This bit is '1' if the syncronization request has completed
46720 * with an error; the 'err_code' field can be used to obtain
46721 * information about error type.
46722 */
46723 #define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_SYNC_ERR UINT32_C(0x40000000)
46724 /*
46725 * This bit is '' if the previously requested synchronization
46726 * command is still in progress, or '1' if the previously
46727 * requested sync command has completed. If '1', the 'sync_err'
46728 * field will indicate if it completed successfully or with
46729 * an error.
46730 */
46731 #define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_SYNC_COMPLETE UINT32_C(0x80000000)
46732 uint8_t unused_0[3];
46733 /*
46734 * This field is used in Output records to indicate that the output
46735 * is completely written to RAM. This field should be read as '1'
46736 * to indicate that the output has been completely written.
46737 * When writing a command completion or response to an internal processor,
46738 * the order of writes has to be such that this field is written last.
46739 */
46740 uint8_t valid;
46741 } hwrm_fw_sync_output_t, *phwrm_fw_sync_output_t;
46742
46743 /***********************
46744 * hwrm_fw_state_qcaps *
46745 ***********************/
46746
46747
46748 /* hwrm_fw_state_qcaps_input (size:128b/16B) */
46749
46750 typedef struct hwrm_fw_state_qcaps_input {
46751 /* The HWRM command request type. */
46752 uint16_t req_type;
46753 /*
46754 * The completion ring to send the completion event on. This should
46755 * be the NQ ID returned from the `nq_alloc` HWRM command.
46756 */
46757 uint16_t cmpl_ring;
46758 /*
46759 * The sequence ID is used by the driver for tracking multiple
46760 * commands. This ID is treated as opaque data by the firmware and
46761 * the value is returned in the `hwrm_resp_hdr` upon completion.
46762 */
46763 uint16_t seq_id;
46764 /*
46765 * The target ID of the command:
46766 * * 0x0-0xFFF8 - The function ID
46767 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46768 * * 0xFFFD - Reserved for user-space HWRM interface
46769 * * 0xFFFF - HWRM
46770 */
46771 uint16_t target_id;
46772 /*
46773 * A physical address pointer pointing to a host buffer that the
46774 * command's response data will be written. This can be either a host
46775 * physical address (HPA) or a guest physical address (GPA) and must
46776 * point to a physically contiguous block of memory.
46777 */
46778 uint64_t resp_addr;
46779 } hwrm_fw_state_qcaps_input_t, *phwrm_fw_state_qcaps_input_t;
46780
46781 /* hwrm_fw_state_qcaps_output (size:256b/32B) */
46782
46783 typedef struct hwrm_fw_state_qcaps_output {
46784 /* The specific error status for the command. */
46785 uint16_t error_code;
46786 /* The HWRM command request type. */
46787 uint16_t req_type;
46788 /* The sequence ID from the original command. */
46789 uint16_t seq_id;
46790 /* The length of the response data in number of bytes. */
46791 uint16_t resp_len;
46792 /*
46793 * This field indicates the size in bytes required by host backup
46794 * memory. Host software should allocate memory according to this
46795 * size requirement and pass the allocated memory to the
46796 * HWRM_FW_STATE_BACKUP and HWRM_FW_STATE_RESTORE commands in the form
46797 * of PBL data as specified in those commands.
46798 */
46799 uint32_t backup_memory;
46800 /*
46801 * This field indicates the max time in milliseconds that firmware
46802 * waits for quiesce to complete. Firmware indicates successful
46803 * quiesce completion if the quiesce operation completes within this
46804 * timeout. If firmware is still waiting for the quiesce operation
46805 * to complete when this timeout is reached, firmware stops waiting
46806 * (without cancelling any quiesce action such as pausing or
46807 * clearing meter profiles) and indicates a timeout status result
46808 * via NQE completion notification. This timeout value may also be
46809 * used by the driver to know the max time to wait for any NQE
46810 * notification response to the HWRM_FW_STATE_QUIESCE command. After
46811 * a timeout, the driver may elect to invoke HWRM_FW_STATE_QUIESCE
46812 * again to keep trying or to invoke HWRM_FW_STATE_UNQUIESCE to
46813 * revert the operation. Since there is no identifier correlating
46814 * each HWRM_FW_STATE_QUIESCE command with its NQE response, it is
46815 * important for the driver to wait for the NQE response before
46816 * issuing a subsequent HWRM_FW_STATE_QUIESCE command.
46817 */
46818 uint32_t quiesce_timeout;
46819 /*
46820 * This field indicates time in milliseconds that the driver should
46821 * wait after return from HWRM_FW_RESET to begin polling the device
46822 * for status 0x8000.
46823 */
46824 uint32_t fw_status_blackout;
46825 /*
46826 * This field indicates a max time for firmware to poll for status
46827 * 0x8000 before assuming a reset failure occurred. This time does
46828 * not include fw_status_blackout time which would immediately precede
46829 * this wait.
46830 */
46831 uint32_t fw_status_max_wait;
46832 uint8_t unused_0[4];
46833 uint8_t unused_1[3];
46834 /*
46835 * This field is used in Output records to indicate that the output
46836 * is completely written to RAM. This field should be read as '1'
46837 * to indicate that the output has been completely written.
46838 * When writing a command completion or response to an internal processor,
46839 * the order of writes has to be such that this field is written last.
46840 */
46841 uint8_t valid;
46842 } hwrm_fw_state_qcaps_output_t, *phwrm_fw_state_qcaps_output_t;
46843
46844 /*************************
46845 * hwrm_fw_state_quiesce *
46846 *************************/
46847
46848
46849 /* hwrm_fw_state_quiesce_input (size:192b/24B) */
46850
46851 typedef struct hwrm_fw_state_quiesce_input {
46852 /* The HWRM command request type. */
46853 uint16_t req_type;
46854 /*
46855 * The completion ring to send the completion event on. This should
46856 * be the NQ ID returned from the `nq_alloc` HWRM command.
46857 */
46858 uint16_t cmpl_ring;
46859 /*
46860 * The sequence ID is used by the driver for tracking multiple
46861 * commands. This ID is treated as opaque data by the firmware and
46862 * the value is returned in the `hwrm_resp_hdr` upon completion.
46863 */
46864 uint16_t seq_id;
46865 /*
46866 * The target ID of the command:
46867 * * 0x0-0xFFF8 - The function ID
46868 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46869 * * 0xFFFD - Reserved for user-space HWRM interface
46870 * * 0xFFFF - HWRM
46871 */
46872 uint16_t target_id;
46873 /*
46874 * A physical address pointer pointing to a host buffer that the
46875 * command's response data will be written. This can be either a host
46876 * physical address (HPA) or a guest physical address (GPA) and must
46877 * point to a physically contiguous block of memory.
46878 */
46879 uint64_t resp_addr;
46880 uint8_t flags;
46881 /*
46882 * Setting this bit to '1', indicates impactless firmware update
46883 * is in a recovery mode where hardware is in an error state and
46884 * where recovery is desired with reasonably minimial impact to
46885 * connected clients. The quiesce operation may require separate
46886 * steps to handle quiescing when hardware is in a hung or locked
46887 * state. For example, quiesce via draining may not be possible
46888 * depending on the type of error. This flag's state would be kept
46889 * in firmware if recovery-specific steps are also needed for the
46890 * HWRM_FW_STATE_BACKUP. Note this option is available only for
46891 * specific recovery scenarios and may not be operational across
46892 * all controllers.
46893 */
46894 #define HWRM_FW_STATE_QUIESCE_INPUT_FLAGS_ERROR_RECOVERY UINT32_C(0x1)
46895 uint8_t unused_0[7];
46896 } hwrm_fw_state_quiesce_input_t, *phwrm_fw_state_quiesce_input_t;
46897
46898 /* hwrm_fw_state_quiesce_output (size:192b/24B) */
46899
46900 typedef struct hwrm_fw_state_quiesce_output {
46901 /* The specific error status for the command. */
46902 uint16_t error_code;
46903 /* The HWRM command request type. */
46904 uint16_t req_type;
46905 /* The sequence ID from the original command. */
46906 uint16_t seq_id;
46907 /* The length of the response data in number of bytes. */
46908 uint16_t resp_len;
46909 uint32_t quiesce_status;
46910 /*
46911 * This bit is '1' if the quiesce request has been successfully
46912 * initiated.
46913 */
46914 #define HWRM_FW_STATE_QUIESCE_OUTPUT_QUIESCE_STATUS_INITIATED UINT32_C(0x80000000)
46915 uint8_t unused_0[4];
46916 uint8_t unused_1[7];
46917 /*
46918 * This field is used in Output records to indicate that the output
46919 * is completely written to RAM. This field should be read as '1' to
46920 * indicate that the output has been completely written. When
46921 * writing a command completion or response to an internal
46922 * processor, the order of writes has to be such that this field is
46923 * written last.
46924 */
46925 uint8_t valid;
46926 } hwrm_fw_state_quiesce_output_t, *phwrm_fw_state_quiesce_output_t;
46927
46928 /***************************
46929 * hwrm_fw_state_unquiesce *
46930 ***************************/
46931
46932
46933 /* hwrm_fw_state_unquiesce_input (size:128b/16B) */
46934
46935 typedef struct hwrm_fw_state_unquiesce_input {
46936 /* The HWRM command request type. */
46937 uint16_t req_type;
46938 /*
46939 * The completion ring to send the completion event on. This should
46940 * be the NQ ID returned from the `nq_alloc` HWRM command.
46941 */
46942 uint16_t cmpl_ring;
46943 /*
46944 * The sequence ID is used by the driver for tracking multiple
46945 * commands. This ID is treated as opaque data by the firmware and
46946 * the value is returned in the `hwrm_resp_hdr` upon completion.
46947 */
46948 uint16_t seq_id;
46949 /*
46950 * The target ID of the command:
46951 * * 0x0-0xFFF8 - The function ID
46952 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46953 * * 0xFFFD - Reserved for user-space HWRM interface
46954 * * 0xFFFF - HWRM
46955 */
46956 uint16_t target_id;
46957 /*
46958 * A physical address pointer pointing to a host buffer that the
46959 * command's response data will be written. This can be either a host
46960 * physical address (HPA) or a guest physical address (GPA) and must
46961 * point to a physically contiguous block of memory.
46962 */
46963 uint64_t resp_addr;
46964 } hwrm_fw_state_unquiesce_input_t, *phwrm_fw_state_unquiesce_input_t;
46965
46966 /* hwrm_fw_state_unquiesce_output (size:192b/24B) */
46967
46968 typedef struct hwrm_fw_state_unquiesce_output {
46969 /* The specific error status for the command. */
46970 uint16_t error_code;
46971 /* The HWRM command request type. */
46972 uint16_t req_type;
46973 /* The sequence ID from the original command. */
46974 uint16_t seq_id;
46975 /* The length of the response data in number of bytes. */
46976 uint16_t resp_len;
46977 uint32_t unquiesce_status;
46978 /* This bit is '1' if the unquiesce request has fully completed. */
46979 #define HWRM_FW_STATE_UNQUIESCE_OUTPUT_UNQUIESCE_STATUS_COMPLETE UINT32_C(0x80000000)
46980 uint8_t unused_0[4];
46981 uint8_t unused_1[7];
46982 /*
46983 * This field is used in Output records to indicate that the output
46984 * is completely written to RAM. This field should be read as '1'
46985 * to indicate that the output has been completely written.
46986 * When writing a command completion or response to an internal processor,
46987 * the order of writes has to be such that this field is written last.
46988 */
46989 uint8_t valid;
46990 } hwrm_fw_state_unquiesce_output_t, *phwrm_fw_state_unquiesce_output_t;
46991
46992 /************************
46993 * hwrm_fw_state_backup *
46994 ************************/
46995
46996
46997 /* hwrm_fw_state_backup_input (size:256b/32B) */
46998
46999 typedef struct hwrm_fw_state_backup_input {
47000 /* The HWRM command request type. */
47001 uint16_t req_type;
47002 /*
47003 * The completion ring to send the completion event on. This should
47004 * be the NQ ID returned from the `nq_alloc` HWRM command.
47005 */
47006 uint16_t cmpl_ring;
47007 /*
47008 * The sequence ID is used by the driver for tracking multiple
47009 * commands. This ID is treated as opaque data by the firmware and
47010 * the value is returned in the `hwrm_resp_hdr` upon completion.
47011 */
47012 uint16_t seq_id;
47013 /*
47014 * The target ID of the command:
47015 * * 0x0-0xFFF8 - The function ID
47016 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47017 * * 0xFFFD - Reserved for user-space HWRM interface
47018 * * 0xFFFF - HWRM
47019 */
47020 uint16_t target_id;
47021 /*
47022 * A physical address pointer pointing to a host buffer that the
47023 * command's response data will be written. This can be either a host
47024 * physical address (HPA) or a guest physical address (GPA) and must
47025 * point to a physically contiguous block of memory.
47026 */
47027 uint64_t resp_addr;
47028 /* State backup page size and level. */
47029 uint8_t backup_pg_size_backup_lvl;
47030 /* State backup PBL indirect levels. */
47031 #define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_LVL_MASK UINT32_C(0xf)
47032 #define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_LVL_SFT 0
47033 /* PBL pointer is physical start address. */
47034 #define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_LVL_LVL_0 UINT32_C(0x0)
47035 /* PBL pointer points to PTE table. */
47036 #define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_LVL_LVL_1 UINT32_C(0x1)
47037 /*
47038 * PBL pointer points to PDE table with each entry pointing to PTE
47039 * tables.
47040 */
47041 #define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_LVL_LVL_2 UINT32_C(0x2)
47042 #define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_LVL_LAST HWRM_FW_STATE_BACKUP_INPUT_BACKUP_LVL_LVL_2
47043 /* State backup page size. */
47044 #define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_MASK UINT32_C(0xf0)
47045 #define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_SFT 4
47046 /* 4KB. */
47047 #define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
47048 /* 8KB. */
47049 #define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
47050 /* 64KB. */
47051 #define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
47052 /* 2MB. */
47053 #define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
47054 /* 8MB. */
47055 #define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
47056 /* 1GB. */
47057 #define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
47058 #define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_LAST HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_PG_1G
47059 uint8_t unused_0[7];
47060 /* State backup page directory. */
47061 uint64_t backup_page_dir;
47062 } hwrm_fw_state_backup_input_t, *phwrm_fw_state_backup_input_t;
47063
47064 /* hwrm_fw_state_backup_output (size:192b/24B) */
47065
47066 typedef struct hwrm_fw_state_backup_output {
47067 /* The specific error status for the command. */
47068 uint16_t error_code;
47069 /* The HWRM command request type. */
47070 uint16_t req_type;
47071 /* The sequence ID from the original command. */
47072 uint16_t seq_id;
47073 /* The length of the response data in number of bytes. */
47074 uint16_t resp_len;
47075 uint32_t backup_status;
47076 /*
47077 * This bit field provides additional information if the error if
47078 * error_code in the common HWRM header is set.
47079 */
47080 #define HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_ERR_CODE_MASK UINT32_C(0xff)
47081 #define HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_ERR_CODE_SFT 0
47082 /* Success, no error */
47083 #define HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_ERR_CODE_SUCCESS UINT32_C(0x0)
47084 /* Data or control plane detected as non-quiesced */
47085 #define HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_ERR_CODE_QUIESCE_ERROR UINT32_C(0x1)
47086 /* General backup error */
47087 #define HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_ERR_CODE_GENERAL UINT32_C(0x3)
47088 #define HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_ERR_CODE_LAST HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_ERR_CODE_GENERAL
47089 /*
47090 * This bit is '' if the backout was done in a way that firmware
47091 * may continue running normally after the backup, for example if
47092 * the host elects to skip the subsequent reset and restore for any
47093 * reason. A value of '1' indicates the act of backing up has left
47094 * the firmware/device in a state where subsequent reset is
47095 * required, for example of probing state of a queue leaves changes
47096 * state in a way that is detectable by users.
47097 */
47098 #define HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_RESET_REQUIRED UINT32_C(0x40000000)
47099 /* This bit is '1' if the backup request has fully completed. */
47100 #define HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_COMPLETE UINT32_C(0x80000000)
47101 uint8_t unused_0[4];
47102 uint8_t unused_1[7];
47103 /*
47104 * This field is used in Output records to indicate that the output
47105 * is completely written to RAM. This field should be read as '1'
47106 * to indicate that the output has been completely written.
47107 * When writing a command completion or response to an internal processor,
47108 * the order of writes has to be such that this field is written last.
47109 */
47110 uint8_t valid;
47111 } hwrm_fw_state_backup_output_t, *phwrm_fw_state_backup_output_t;
47112
47113 /*************************
47114 * hwrm_fw_state_restore *
47115 *************************/
47116
47117
47118 /* hwrm_fw_state_restore_input (size:256b/32B) */
47119
47120 typedef struct hwrm_fw_state_restore_input {
47121 /* The HWRM command request type. */
47122 uint16_t req_type;
47123 /*
47124 * The completion ring to send the completion event on. This should
47125 * be the NQ ID returned from the `nq_alloc` HWRM command.
47126 */
47127 uint16_t cmpl_ring;
47128 /*
47129 * The sequence ID is used by the driver for tracking multiple
47130 * commands. This ID is treated as opaque data by the firmware and
47131 * the value is returned in the `hwrm_resp_hdr` upon completion.
47132 */
47133 uint16_t seq_id;
47134 /*
47135 * The target ID of the command:
47136 * * 0x0-0xFFF8 - The function ID
47137 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47138 * * 0xFFFD - Reserved for user-space HWRM interface
47139 * * 0xFFFF - HWRM
47140 */
47141 uint16_t target_id;
47142 /*
47143 * A physical address pointer pointing to a host buffer that the
47144 * command's response data will be written. This can be either a host
47145 * physical address (HPA) or a guest physical address (GPA) and must
47146 * point to a physically contiguous block of memory.
47147 */
47148 uint64_t resp_addr;
47149 /* State restore page size and level. */
47150 uint8_t restore_pg_size_restore_lvl;
47151 /* State restore PBL indirect levels. */
47152 #define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_LVL_MASK UINT32_C(0xf)
47153 #define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_LVL_SFT 0
47154 /* PBL pointer is physical start address. */
47155 #define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_LVL_LVL_0 UINT32_C(0x0)
47156 /* PBL pointer points to PTE table. */
47157 #define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_LVL_LVL_1 UINT32_C(0x1)
47158 /*
47159 * PBL pointer points to PDE table with each entry pointing to PTE
47160 * tables.
47161 */
47162 #define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_LVL_LVL_2 UINT32_C(0x2)
47163 #define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_LVL_LAST HWRM_FW_STATE_RESTORE_INPUT_RESTORE_LVL_LVL_2
47164 /* State restore page size. */
47165 #define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_MASK UINT32_C(0xf0)
47166 #define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_SFT 4
47167 /* 4KB. */
47168 #define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
47169 /* 8KB. */
47170 #define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
47171 /* 64KB. */
47172 #define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
47173 /* 2MB. */
47174 #define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
47175 /* 8MB. */
47176 #define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
47177 /* 1GB. */
47178 #define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
47179 #define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_LAST HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_PG_1G
47180 uint8_t unused_0[7];
47181 /* State restore page directory. */
47182 uint64_t restore_page_dir;
47183 } hwrm_fw_state_restore_input_t, *phwrm_fw_state_restore_input_t;
47184
47185 /* hwrm_fw_state_restore_output (size:128b/16B) */
47186
47187 typedef struct hwrm_fw_state_restore_output {
47188 /* The specific error status for the command. */
47189 uint16_t error_code;
47190 /* The HWRM command request type. */
47191 uint16_t req_type;
47192 /* The sequence ID from the original command. */
47193 uint16_t seq_id;
47194 /* The length of the response data in number of bytes. */
47195 uint16_t resp_len;
47196 uint32_t restore_status;
47197 /*
47198 * This bit field provides additional information if the error if
47199 * error_code in the common HWRM header is set.
47200 */
47201 #define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_ERR_CODE_MASK UINT32_C(0xff)
47202 #define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_ERR_CODE_SFT 0
47203 /* Success, no error */
47204 #define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_ERR_CODE_SUCCESS UINT32_C(0x0)
47205 /* General restore error */
47206 #define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_ERR_CODE_GENERAL UINT32_C(0x1)
47207 /* Format parse error */
47208 #define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_ERR_CODE_FORMAT_PARSE UINT32_C(0x2)
47209 /* Integrity check error */
47210 #define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_ERR_CODE_INTEGRITY_CHECK UINT32_C(0x3)
47211 #define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_ERR_CODE_LAST HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_ERR_CODE_INTEGRITY_CHECK
47212 /*
47213 * If a failure occurs (complete is 0), restore attempts to
47214 * completely roll back any state applied so that the failure
47215 * results in no state change. This flag indidicates whether that
47216 * rollback completed successfully and thoroughly.
47217 */
47218 #define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_FAILURE_ROLLBACK_COMPLETED UINT32_C(0x40000000)
47219 /* This bit is '1' if the restore request has fully completed. */
47220 #define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_COMPLETE UINT32_C(0x80000000)
47221 uint8_t unused_0[3];
47222 /*
47223 * This field is used in Output records to indicate that the output
47224 * is completely written to RAM. This field should be read as '1'
47225 * to indicate that the output has been completely written.
47226 * When writing a command completion or response to an internal processor,
47227 * the order of writes has to be such that this field is written last.
47228 */
47229 uint8_t valid;
47230 } hwrm_fw_state_restore_output_t, *phwrm_fw_state_restore_output_t;
47231
47232 /**********************
47233 * hwrm_exec_fwd_resp *
47234 **********************/
47235
47236
47237 /* hwrm_exec_fwd_resp_input (size:1024b/128B) */
47238
47239 typedef struct hwrm_exec_fwd_resp_input {
47240 /* The HWRM command request type. */
47241 uint16_t req_type;
47242 /*
47243 * The completion ring to send the completion event on. This should
47244 * be the NQ ID returned from the `nq_alloc` HWRM command.
47245 */
47246 uint16_t cmpl_ring;
47247 /*
47248 * The sequence ID is used by the driver for tracking multiple
47249 * commands. This ID is treated as opaque data by the firmware and
47250 * the value is returned in the `hwrm_resp_hdr` upon completion.
47251 */
47252 uint16_t seq_id;
47253 /*
47254 * The target ID of the command:
47255 * * 0x0-0xFFF8 - The function ID
47256 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47257 * * 0xFFFD - Reserved for user-space HWRM interface
47258 * * 0xFFFF - HWRM
47259 */
47260 uint16_t target_id;
47261 /*
47262 * A physical address pointer pointing to a host buffer that the
47263 * command's response data will be written. This can be either a host
47264 * physical address (HPA) or a guest physical address (GPA) and must
47265 * point to a physically contiguous block of memory.
47266 */
47267 uint64_t resp_addr;
47268 /*
47269 * This is an encapsulated request. This request should
47270 * be executed by the HWRM and the response should be
47271 * provided in the response buffer inside the encapsulated
47272 * request.
47273 */
47274 uint32_t encap_request[26];
47275 /*
47276 * This value indicates the target id of the response to
47277 * the encapsulated request.
47278 * 0x0 - 0xFFF8 - Used for function ids
47279 * 0xFFF8 - 0xFFFE - Reserved for internal processors
47280 * 0xFFFF - HWRM
47281 */
47282 uint16_t encap_resp_target_id;
47283 uint8_t unused_0[6];
47284 } hwrm_exec_fwd_resp_input_t, *phwrm_exec_fwd_resp_input_t;
47285
47286 /* hwrm_exec_fwd_resp_output (size:128b/16B) */
47287
47288 typedef struct hwrm_exec_fwd_resp_output {
47289 /* The specific error status for the command. */
47290 uint16_t error_code;
47291 /* The HWRM command request type. */
47292 uint16_t req_type;
47293 /* The sequence ID from the original command. */
47294 uint16_t seq_id;
47295 /* The length of the response data in number of bytes. */
47296 uint16_t resp_len;
47297 uint8_t unused_0[7];
47298 /*
47299 * This field is used in Output records to indicate that the output
47300 * is completely written to RAM. This field should be read as '1'
47301 * to indicate that the output has been completely written.
47302 * When writing a command completion or response to an internal processor,
47303 * the order of writes has to be such that this field is written last.
47304 */
47305 uint8_t valid;
47306 } hwrm_exec_fwd_resp_output_t, *phwrm_exec_fwd_resp_output_t;
47307
47308 /************************
47309 * hwrm_reject_fwd_resp *
47310 ************************/
47311
47312
47313 /* hwrm_reject_fwd_resp_input (size:1024b/128B) */
47314
47315 typedef struct hwrm_reject_fwd_resp_input {
47316 /* The HWRM command request type. */
47317 uint16_t req_type;
47318 /*
47319 * The completion ring to send the completion event on. This should
47320 * be the NQ ID returned from the `nq_alloc` HWRM command.
47321 */
47322 uint16_t cmpl_ring;
47323 /*
47324 * The sequence ID is used by the driver for tracking multiple
47325 * commands. This ID is treated as opaque data by the firmware and
47326 * the value is returned in the `hwrm_resp_hdr` upon completion.
47327 */
47328 uint16_t seq_id;
47329 /*
47330 * The target ID of the command:
47331 * * 0x0-0xFFF8 - The function ID
47332 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47333 * * 0xFFFD - Reserved for user-space HWRM interface
47334 * * 0xFFFF - HWRM
47335 */
47336 uint16_t target_id;
47337 /*
47338 * A physical address pointer pointing to a host buffer that the
47339 * command's response data will be written. This can be either a host
47340 * physical address (HPA) or a guest physical address (GPA) and must
47341 * point to a physically contiguous block of memory.
47342 */
47343 uint64_t resp_addr;
47344 /*
47345 * This is an encapsulated request. This request should
47346 * be rejected by the HWRM and the error response should be
47347 * provided in the response buffer inside the encapsulated
47348 * request.
47349 */
47350 uint32_t encap_request[26];
47351 /*
47352 * This value indicates the target id of the response to
47353 * the encapsulated request.
47354 * 0x0 - 0xFFF8 - Used for function ids
47355 * 0xFFF8 - 0xFFFE - Reserved for internal processors
47356 * 0xFFFF - HWRM
47357 */
47358 uint16_t encap_resp_target_id;
47359 uint8_t unused_0[6];
47360 } hwrm_reject_fwd_resp_input_t, *phwrm_reject_fwd_resp_input_t;
47361
47362 /* hwrm_reject_fwd_resp_output (size:128b/16B) */
47363
47364 typedef struct hwrm_reject_fwd_resp_output {
47365 /* The specific error status for the command. */
47366 uint16_t error_code;
47367 /* The HWRM command request type. */
47368 uint16_t req_type;
47369 /* The sequence ID from the original command. */
47370 uint16_t seq_id;
47371 /* The length of the response data in number of bytes. */
47372 uint16_t resp_len;
47373 uint8_t unused_0[7];
47374 /*
47375 * This field is used in Output records to indicate that the output
47376 * is completely written to RAM. This field should be read as '1'
47377 * to indicate that the output has been completely written.
47378 * When writing a command completion or response to an internal processor,
47379 * the order of writes has to be such that this field is written last.
47380 */
47381 uint8_t valid;
47382 } hwrm_reject_fwd_resp_output_t, *phwrm_reject_fwd_resp_output_t;
47383
47384 /*****************
47385 * hwrm_fwd_resp *
47386 *****************/
47387
47388
47389 /* hwrm_fwd_resp_input (size:1024b/128B) */
47390
47391 typedef struct hwrm_fwd_resp_input {
47392 /* The HWRM command request type. */
47393 uint16_t req_type;
47394 /*
47395 * The completion ring to send the completion event on. This should
47396 * be the NQ ID returned from the `nq_alloc` HWRM command.
47397 */
47398 uint16_t cmpl_ring;
47399 /*
47400 * The sequence ID is used by the driver for tracking multiple
47401 * commands. This ID is treated as opaque data by the firmware and
47402 * the value is returned in the `hwrm_resp_hdr` upon completion.
47403 */
47404 uint16_t seq_id;
47405 /*
47406 * The target ID of the command:
47407 * * 0x0-0xFFF8 - The function ID
47408 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47409 * * 0xFFFD - Reserved for user-space HWRM interface
47410 * * 0xFFFF - HWRM
47411 */
47412 uint16_t target_id;
47413 /*
47414 * A physical address pointer pointing to a host buffer that the
47415 * command's response data will be written. This can be either a host
47416 * physical address (HPA) or a guest physical address (GPA) and must
47417 * point to a physically contiguous block of memory.
47418 */
47419 uint64_t resp_addr;
47420 /*
47421 * This value indicates the target id of the encapsulated
47422 * response.
47423 * 0x0 - 0xFFF8 - Used for function ids
47424 * 0xFFF8 - 0xFFFE - Reserved for internal processors
47425 * 0xFFFF - HWRM
47426 */
47427 uint16_t encap_resp_target_id;
47428 /*
47429 * This value indicates the completion ring the encapsulated
47430 * response will be optionally completed on. If the value is
47431 * -1, then no CR completion shall be generated for the
47432 * encapsulated response. Any other value must be a
47433 * valid CR ring_id value. If a valid encap_resp_cmpl_ring
47434 * is provided, then a CR completion shall be generated for
47435 * the encapsulated response.
47436 */
47437 uint16_t encap_resp_cmpl_ring;
47438 /* This field indicates the length of encapsulated response. */
47439 uint16_t encap_resp_len;
47440 uint8_t unused_0;
47441 uint8_t unused_1;
47442 /*
47443 * This is the host address where the encapsulated response
47444 * will be written.
47445 * This area must be 16B aligned and must be cleared to zero
47446 * before the original request is made.
47447 */
47448 uint64_t encap_resp_addr;
47449 /* This is an encapsulated response. */
47450 uint32_t encap_resp[24];
47451 } hwrm_fwd_resp_input_t, *phwrm_fwd_resp_input_t;
47452
47453 /* hwrm_fwd_resp_output (size:128b/16B) */
47454
47455 typedef struct hwrm_fwd_resp_output {
47456 /* The specific error status for the command. */
47457 uint16_t error_code;
47458 /* The HWRM command request type. */
47459 uint16_t req_type;
47460 /* The sequence ID from the original command. */
47461 uint16_t seq_id;
47462 /* The length of the response data in number of bytes. */
47463 uint16_t resp_len;
47464 uint8_t unused_0[7];
47465 /*
47466 * This field is used in Output records to indicate that the output
47467 * is completely written to RAM. This field should be read as '1'
47468 * to indicate that the output has been completely written.
47469 * When writing a command completion or response to an internal processor,
47470 * the order of writes has to be such that this field is written last.
47471 */
47472 uint8_t valid;
47473 } hwrm_fwd_resp_output_t, *phwrm_fwd_resp_output_t;
47474
47475 /*****************************
47476 * hwrm_fwd_async_event_cmpl *
47477 *****************************/
47478
47479
47480 /* hwrm_fwd_async_event_cmpl_input (size:320b/40B) */
47481
47482 typedef struct hwrm_fwd_async_event_cmpl_input {
47483 /* The HWRM command request type. */
47484 uint16_t req_type;
47485 /*
47486 * The completion ring to send the completion event on. This should
47487 * be the NQ ID returned from the `nq_alloc` HWRM command.
47488 */
47489 uint16_t cmpl_ring;
47490 /*
47491 * The sequence ID is used by the driver for tracking multiple
47492 * commands. This ID is treated as opaque data by the firmware and
47493 * the value is returned in the `hwrm_resp_hdr` upon completion.
47494 */
47495 uint16_t seq_id;
47496 /*
47497 * The target ID of the command:
47498 * * 0x0-0xFFF8 - The function ID
47499 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47500 * * 0xFFFD - Reserved for user-space HWRM interface
47501 * * 0xFFFF - HWRM
47502 */
47503 uint16_t target_id;
47504 /*
47505 * A physical address pointer pointing to a host buffer that the
47506 * command's response data will be written. This can be either a host
47507 * physical address (HPA) or a guest physical address (GPA) and must
47508 * point to a physically contiguous block of memory.
47509 */
47510 uint64_t resp_addr;
47511 /*
47512 * This value indicates the target id of the encapsulated
47513 * asynchronous event.
47514 * 0x0 - 0xFFF8 - Used for function ids
47515 * 0xFFF8 - 0xFFFE - Reserved for internal processors
47516 * 0xFFFF - Broadcast to all children VFs (only applicable when
47517 * a PF is the requester)
47518 */
47519 uint16_t encap_async_event_target_id;
47520 uint8_t unused_0[6];
47521 /* This is an encapsulated asynchronous event completion. */
47522 uint32_t encap_async_event_cmpl[4];
47523 } hwrm_fwd_async_event_cmpl_input_t, *phwrm_fwd_async_event_cmpl_input_t;
47524
47525 /* hwrm_fwd_async_event_cmpl_output (size:128b/16B) */
47526
47527 typedef struct hwrm_fwd_async_event_cmpl_output {
47528 /* The specific error status for the command. */
47529 uint16_t error_code;
47530 /* The HWRM command request type. */
47531 uint16_t req_type;
47532 /* The sequence ID from the original command. */
47533 uint16_t seq_id;
47534 /* The length of the response data in number of bytes. */
47535 uint16_t resp_len;
47536 uint8_t unused_0[7];
47537 /*
47538 * This field is used in Output records to indicate that the output
47539 * is completely written to RAM. This field should be read as '1'
47540 * to indicate that the output has been completely written.
47541 * When writing a command completion or response to an internal processor,
47542 * the order of writes has to be such that this field is written last.
47543 */
47544 uint8_t valid;
47545 } hwrm_fwd_async_event_cmpl_output_t, *phwrm_fwd_async_event_cmpl_output_t;
47546
47547 /***************************
47548 * hwrm_temp_monitor_query *
47549 ***************************/
47550
47551
47552 /* hwrm_temp_monitor_query_input (size:128b/16B) */
47553
47554 typedef struct hwrm_temp_monitor_query_input {
47555 /* The HWRM command request type. */
47556 uint16_t req_type;
47557 /*
47558 * The completion ring to send the completion event on. This should
47559 * be the NQ ID returned from the `nq_alloc` HWRM command.
47560 */
47561 uint16_t cmpl_ring;
47562 /*
47563 * The sequence ID is used by the driver for tracking multiple
47564 * commands. This ID is treated as opaque data by the firmware and
47565 * the value is returned in the `hwrm_resp_hdr` upon completion.
47566 */
47567 uint16_t seq_id;
47568 /*
47569 * The target ID of the command:
47570 * * 0x0-0xFFF8 - The function ID
47571 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47572 * * 0xFFFD - Reserved for user-space HWRM interface
47573 * * 0xFFFF - HWRM
47574 */
47575 uint16_t target_id;
47576 /*
47577 * A physical address pointer pointing to a host buffer that the
47578 * command's response data will be written. This can be either a host
47579 * physical address (HPA) or a guest physical address (GPA) and must
47580 * point to a physically contiguous block of memory.
47581 */
47582 uint64_t resp_addr;
47583 } hwrm_temp_monitor_query_input_t, *phwrm_temp_monitor_query_input_t;
47584
47585 /* hwrm_temp_monitor_query_output (size:128b/16B) */
47586
47587 typedef struct hwrm_temp_monitor_query_output {
47588 /* The specific error status for the command. */
47589 uint16_t error_code;
47590 /* The HWRM command request type. */
47591 uint16_t req_type;
47592 /* The sequence ID from the original command. */
47593 uint16_t seq_id;
47594 /* The length of the response data in number of bytes. */
47595 uint16_t resp_len;
47596 /*
47597 * The HWRM shall provide the current temperature of
47598 * the device in Celsius. This is the max of PCIe_temp
47599 * and PM_temp
47600 */
47601 uint8_t temp;
47602 /*
47603 * The HWRM shall provide the current temperature of
47604 * the phy in Celsius.
47605 */
47606 uint8_t phy_temp;
47607 /*
47608 * The HWRM shall provide the current temperature of
47609 * the module_index in Celsius.
47610 */
47611 uint8_t om_temp;
47612 /* Describe individual temperature sensor condition. */
47613 uint8_t flags;
47614 /*
47615 * "1" in this bit indicates temperature read not
47616 * successful.
47617 */
47618 #define HWRM_TEMP_MONITOR_QUERY_OUTPUT_FLAGS_TEMP_NOT_AVAILABLE UINT32_C(0x1)
47619 /*
47620 * "1" in this bit indicates phy temperature read not
47621 * successful.
47622 */
47623 #define HWRM_TEMP_MONITOR_QUERY_OUTPUT_FLAGS_PHY_TEMP_NOT_AVAILABLE UINT32_C(0x2)
47624 /* "1" in this bit indicates optical module(s) not present. */
47625 #define HWRM_TEMP_MONITOR_QUERY_OUTPUT_FLAGS_OM_NOT_PRESENT UINT32_C(0x4)
47626 /*
47627 * "1" in this bit indicates om temperature read not
47628 * successful.
47629 */
47630 #define HWRM_TEMP_MONITOR_QUERY_OUTPUT_FLAGS_OM_TEMP_NOT_AVAILABLE UINT32_C(0x8)
47631 /*
47632 * "1" in this bit indicates the extended temperature fields are
47633 * available.
47634 */
47635 #define HWRM_TEMP_MONITOR_QUERY_OUTPUT_FLAGS_EXT_TEMP_FIELDS_AVAILABLE UINT32_C(0x10)
47636 /*
47637 * This field encodes the current device temperature in Celsius.
47638 * This field is unsigned and the value range of 0 to 255 is used to
47639 * indicate a temperature range from -64 to +191. The actual
47640 * temperature is derived by subtracting 64 from this field.
47641 * Example: A value of 0 represents a temperature of -64, a value of
47642 * 255 represents a temperature of 191.
47643 */
47644 uint8_t temp2;
47645 /*
47646 * This field encodes the current phy temperature in Celsius. This
47647 * field is unsigned and the value range of 0 to 255 is used to
47648 * indicate a temperature range from -64 to +191. The actual
47649 * temperature is derived by subtracting 64 from this field.
47650 * Example: A value of 0 represents a temperature of -64, a value of
47651 * 255 represents a temperature of 191.
47652 */
47653 uint8_t phy_temp2;
47654 /*
47655 * This field encodes the current module index temperature in Celsius.
47656 * This field is unsigned and the value range of 0 to 255 is used to
47657 * indicate a temperature range from -64 to +191. The actual
47658 * temperature is derived by subtracting 64 from this field.
47659 * Example: A value of 0 represents a temperature of -64, a value of
47660 * 255 represents a temperature of 191.
47661 */
47662 uint8_t om_temp2;
47663 /*
47664 * This field is used in Output records to indicate that the output
47665 * is completely written to RAM. This field should be read as '1'
47666 * to indicate that the output has been completely written.
47667 * When writing a command completion or response to an internal processor,
47668 * the order of writes has to be such that this field is written last.
47669 */
47670 uint8_t valid;
47671 } hwrm_temp_monitor_query_output_t, *phwrm_temp_monitor_query_output_t;
47672
47673 /************************
47674 * hwrm_reg_power_query *
47675 ************************/
47676
47677
47678 /* hwrm_reg_power_query_input (size:128b/16B) */
47679
47680 typedef struct hwrm_reg_power_query_input {
47681 /* The HWRM command request type. */
47682 uint16_t req_type;
47683 /*
47684 * The completion ring to send the completion event on. This should
47685 * be the NQ ID returned from the `nq_alloc` HWRM command.
47686 */
47687 uint16_t cmpl_ring;
47688 /*
47689 * The sequence ID is used by the driver for tracking multiple
47690 * commands. This ID is treated as opaque data by the firmware and
47691 * the value is returned in the `hwrm_resp_hdr` upon completion.
47692 */
47693 uint16_t seq_id;
47694 /*
47695 * The target ID of the command:
47696 * * 0x0-0xFFF8 - The function ID
47697 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47698 * * 0xFFFD - Reserved for user-space HWRM interface
47699 * * 0xFFFF - HWRM
47700 */
47701 uint16_t target_id;
47702 /*
47703 * A physical address pointer pointing to a host buffer that the
47704 * command's response data will be written. This can be either a host
47705 * physical address (HPA) or a guest physical address (GPA) and must
47706 * point to a physically contiguous block of memory.
47707 */
47708 uint64_t resp_addr;
47709 } hwrm_reg_power_query_input_t, *phwrm_reg_power_query_input_t;
47710
47711 /* hwrm_reg_power_query_output (size:192b/24B) */
47712
47713 typedef struct hwrm_reg_power_query_output {
47714 /* The specific error status for the command. */
47715 uint16_t error_code;
47716 /* The HWRM command request type. */
47717 uint16_t req_type;
47718 /* The sequence ID from the original command. */
47719 uint16_t seq_id;
47720 /* The length of the response data in number of bytes. */
47721 uint16_t resp_len;
47722 /* Describe availability of switching regulator power values. */
47723 uint32_t flags;
47724 /* When this bit is set to '1', the input power is available. */
47725 #define HWRM_REG_POWER_QUERY_OUTPUT_FLAGS_IN_POWER_AVAILABLE UINT32_C(0x1)
47726 /* When this bit is set to '1', the output power is available. */
47727 #define HWRM_REG_POWER_QUERY_OUTPUT_FLAGS_OUT_POWER_AVAILABLE UINT32_C(0x2)
47728 /*
47729 * The HWRM shall provide the current switching regulator
47730 * input power in mW, if available.
47731 */
47732 uint32_t in_power_mw;
47733 /*
47734 * The HWRM shall provide the current switching regulator
47735 * output power in mW, if available.
47736 */
47737 uint32_t out_power_mw;
47738 uint8_t unused_0[3];
47739 /*
47740 * This field is used in Output records to indicate that the output
47741 * is completely written to RAM. This field should be read as '1'
47742 * to indicate that the output has been completely written.
47743 * When writing a command completion or response to an internal processor,
47744 * the order of writes has to be such that this field is written last.
47745 */
47746 uint8_t valid;
47747 } hwrm_reg_power_query_output_t, *phwrm_reg_power_query_output_t;
47748
47749 /*****************************
47750 * hwrm_core_frequency_query *
47751 *****************************/
47752
47753
47754 /* hwrm_core_frequency_query_input (size:128b/16B) */
47755
47756 typedef struct hwrm_core_frequency_query_input {
47757 /* The HWRM command request type. */
47758 uint16_t req_type;
47759 /*
47760 * The completion ring to send the completion event on. This should
47761 * be the NQ ID returned from the `nq_alloc` HWRM command.
47762 */
47763 uint16_t cmpl_ring;
47764 /*
47765 * The sequence ID is used by the driver for tracking multiple
47766 * commands. This ID is treated as opaque data by the firmware and
47767 * the value is returned in the `hwrm_resp_hdr` upon completion.
47768 */
47769 uint16_t seq_id;
47770 /*
47771 * The target ID of the command:
47772 * * 0x0-0xFFF8 - The function ID
47773 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47774 * * 0xFFFD - Reserved for user-space HWRM interface
47775 * * 0xFFFF - HWRM
47776 */
47777 uint16_t target_id;
47778 /*
47779 * A physical address pointer pointing to a host buffer that the
47780 * command's response data will be written. This can be either a host
47781 * physical address (HPA) or a guest physical address (GPA) and must
47782 * point to a physically contiguous block of memory.
47783 */
47784 uint64_t resp_addr;
47785 } hwrm_core_frequency_query_input_t, *phwrm_core_frequency_query_input_t;
47786
47787 /* hwrm_core_frequency_query_output (size:128b/16B) */
47788
47789 typedef struct hwrm_core_frequency_query_output {
47790 /* The specific error status for the command. */
47791 uint16_t error_code;
47792 /* The HWRM command request type. */
47793 uint16_t req_type;
47794 /* The sequence ID from the original command. */
47795 uint16_t seq_id;
47796 /* The length of the response data in number of bytes. */
47797 uint16_t resp_len;
47798 /* The HWRM shall provide the core frequency in Hz. */
47799 uint32_t core_frequency_hz;
47800 uint8_t unused_0[3];
47801 /*
47802 * This field is used in Output records to indicate that the output
47803 * is completely written to RAM. This field should be read as '1'
47804 * to indicate that the output has been completely written.
47805 * When writing a command completion or response to an internal processor,
47806 * the order of writes has to be such that this field is written last.
47807 */
47808 uint8_t valid;
47809 } hwrm_core_frequency_query_output_t, *phwrm_core_frequency_query_output_t;
47810
47811 /****************************
47812 * hwrm_reg_power_histogram *
47813 ****************************/
47814
47815
47816 /* hwrm_reg_power_histogram_input (size:192b/24B) */
47817
47818 typedef struct hwrm_reg_power_histogram_input {
47819 /* The HWRM command request type. */
47820 uint16_t req_type;
47821 /*
47822 * The completion ring to send the completion event on. This should
47823 * be the NQ ID returned from the `nq_alloc` HWRM command.
47824 */
47825 uint16_t cmpl_ring;
47826 /*
47827 * The sequence ID is used by the driver for tracking multiple
47828 * commands. This ID is treated as opaque data by the firmware and
47829 * the value is returned in the `hwrm_resp_hdr` upon completion.
47830 */
47831 uint16_t seq_id;
47832 /*
47833 * The target ID of the command:
47834 * * 0x0-0xFFF8 - The function ID
47835 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47836 * * 0xFFFD - Reserved for user-space HWRM interface
47837 * * 0xFFFF - HWRM
47838 */
47839 uint16_t target_id;
47840 /*
47841 * A physical address pointer pointing to a host buffer that the
47842 * command's response data will be written. This can be either a host
47843 * physical address (HPA) or a guest physical address (GPA) and must
47844 * point to a physically contiguous block of memory.
47845 */
47846 uint64_t resp_addr;
47847 /* Describe operational mode of power histogram command. */
47848 uint32_t flags;
47849 /*
47850 * When this bit is set to '1', histogram data for the respective
47851 * client (HWRM or BMC) is cleared after read.
47852 */
47853 #define HWRM_REG_POWER_HISTOGRAM_INPUT_FLAGS_CLEAR_HISTOGRAM UINT32_C(0x1)
47854 uint32_t unused_0;
47855 } hwrm_reg_power_histogram_input_t, *phwrm_reg_power_histogram_input_t;
47856
47857 /* hwrm_reg_power_histogram_output (size:1088b/136B) */
47858
47859 typedef struct hwrm_reg_power_histogram_output {
47860 /* The specific error status for the command. */
47861 uint16_t error_code;
47862 /* The HWRM command request type. */
47863 uint16_t req_type;
47864 /* The sequence ID from the original command. */
47865 uint16_t seq_id;
47866 /* The length of the response data in number of bytes. */
47867 uint16_t resp_len;
47868 /* Describe output characteristics of power histogram command. */
47869 uint16_t flags;
47870 /*
47871 * Indicates whether input or output power is used. Some switching
47872 * regulators provide both input and output voltage and current
47873 * measurements, and others provide only output measurements. When
47874 * both are available, input is used. This value is constant for a
47875 * given board.
47876 */
47877 #define HWRM_REG_POWER_HISTOGRAM_OUTPUT_FLAGS_POWER_IN_OUT UINT32_C(0x1)
47878 /*
47879 * The switching regulator's input power is used
47880 * data.
47881 */
47882 #define HWRM_REG_POWER_HISTOGRAM_OUTPUT_FLAGS_POWER_IN_OUT_INPUT UINT32_C(0x0)
47883 /*
47884 * The switching regulator's output power is used
47885 * data.
47886 */
47887 #define HWRM_REG_POWER_HISTOGRAM_OUTPUT_FLAGS_POWER_IN_OUT_OUTPUT UINT32_C(0x1)
47888 #define HWRM_REG_POWER_HISTOGRAM_OUTPUT_FLAGS_POWER_IN_OUT_LAST HWRM_REG_POWER_HISTOGRAM_OUTPUT_FLAGS_POWER_IN_OUT_OUTPUT
47889 uint8_t unused_0[2];
47890 /*
47891 * Time in microseconds between samples. This value is constant in
47892 * firmware. The initial design sets this constant at 10000 us (10
47893 * ms). Power values for voltage regulators calculate a power value
47894 * over a 300 us period, so a 10 ms sampling period covers 3% of
47895 * time ranges. Future firmware designs may opt for different
47896 * sampling periods, so this value is provided on output.
47897 */
47898 uint32_t sampling_period;
47899 /*
47900 * Total samples taken since last clear. If no counter has
47901 * saturated, the sum of counts in each bucket equates to this
47902 * sample_count value. If a single counter has saturated, its value
47903 * can be calculated by subtracting the remaining bucket values from
47904 * this sample_count value.
47905 */
47906 uint64_t sample_count;
47907 /*
47908 * The power usage expressed in histogram buckets. Bucket value
47909 * ranges and array indices are defined per the enumeration
47910 * power_histogram_bucket_enum. Values saturate at the max 32-bit
47911 * value, 0xFFFFFFFF, and do not roll over. Clients should use the
47912 * clear bit on input to clear the histogram array periodically or
47913 * when saturation is observed.
47914 */
47915 uint32_t power_hist[26];
47916 uint8_t unused_1[7];
47917 /*
47918 * This field is used in Output records to indicate that the output
47919 * is completely written to RAM. This field should be read as '1'
47920 * to indicate that the output has been completely written.
47921 * When writing a command completion or response to an internal processor,
47922 * the order of writes has to be such that this field is written last.
47923 */
47924 uint8_t valid;
47925 } hwrm_reg_power_histogram_output_t, *phwrm_reg_power_histogram_output_t;
47926
47927 /*
47928 * Count of timer callback routines run with no data measured. This
47929 * may occur when data from the switching regulator is not available
47930 * to the firmware timer callback routine. One possible reason for
47931 * this is contention with other users of the i2c bus which is used
47932 * to communicate with the switching regulator, for example when a
47933 * call to hwrm_reg_power_query occurs while the timer routine is
47934 * running.
47935 */
47936 #define BUCKET_NO_DATA_FOR_SAMPLE UINT32_C(0x0)
47937 /* Count of samples measured at less than 8W */
47938 #define BUCKET_RANGE_8W_OR_LESS UINT32_C(0x1)
47939 /* Count of samples measured >= 8 W and < 9 W */
47940 #define BUCKET_RANGE_8W_TO_9W UINT32_C(0x2)
47941 /* Count of samples measured >= 9 W and < 10 W */
47942 #define BUCKET_RANGE_9W_TO_10W UINT32_C(0x3)
47943 /* Count of samples measured >= 10 W and < 11 W */
47944 #define BUCKET_RANGE_10W_TO_11W UINT32_C(0x4)
47945 /* Count of samples measured >= 11 W and < 12 W */
47946 #define BUCKET_RANGE_11W_TO_12W UINT32_C(0x5)
47947 /* Count of samples measured >= 12 W and < 13 W */
47948 #define BUCKET_RANGE_12W_TO_13W UINT32_C(0x6)
47949 /* Count of samples measured >= 13 W and < 14 W */
47950 #define BUCKET_RANGE_13W_TO_14W UINT32_C(0x7)
47951 /* Count of samples measured >= 14 W and < 15 W */
47952 #define BUCKET_RANGE_14W_TO_15W UINT32_C(0x8)
47953 /* Count of samples measured >= 15 W and < 16 W */
47954 #define BUCKET_RANGE_15W_TO_16W UINT32_C(0x9)
47955 /* Count of samples measured >= 16 W and < 18 W */
47956 #define BUCKET_RANGE_16W_TO_18W UINT32_C(0xa)
47957 /* Count of samples measured >= 18 W and < 20 W */
47958 #define BUCKET_RANGE_18W_TO_20W UINT32_C(0xb)
47959 /* Count of samples measured >= 20 W and < 22 W */
47960 #define BUCKET_RANGE_20W_TO_22W UINT32_C(0xc)
47961 /* Count of samples measured >= 22 W and < 24 W */
47962 #define BUCKET_RANGE_22W_TO_24W UINT32_C(0xd)
47963 /* Count of samples measured >= 24 W and < 26 W */
47964 #define BUCKET_RANGE_24W_TO_26W UINT32_C(0xe)
47965 /* Count of samples measured >= 26 W and < 28 W */
47966 #define BUCKET_RANGE_26W_TO_28W UINT32_C(0xf)
47967 /* Count of samples measured >= 28 W and < 30 W */
47968 #define BUCKET_RANGE_28W_TO_30W UINT32_C(0x10)
47969 /* Count of samples measured >= 30 W and < 32 W */
47970 #define BUCKET_RANGE_30W_TO_32W UINT32_C(0x11)
47971 /* Count of samples measured >= 32 W and < 34 W */
47972 #define BUCKET_RANGE_32W_TO_34W UINT32_C(0x12)
47973 /* Count of samples measured >= 34 W and < 36 W */
47974 #define BUCKET_RANGE_34W_TO_36W UINT32_C(0x13)
47975 /* Count of samples measured >= 36 W and < 38 W */
47976 #define BUCKET_RANGE_36W_TO_38W UINT32_C(0x14)
47977 /* Count of samples measured >= 38 W and < 40 W */
47978 #define BUCKET_RANGE_38W_TO_40W UINT32_C(0x15)
47979 /* Count of samples measured >= 40 W and < 42 W */
47980 #define BUCKET_RANGE_40W_TO_42W UINT32_C(0x16)
47981 /* Count of samples measured >= 42 W and < 44 W */
47982 #define BUCKET_RANGE_42W_TO_44W UINT32_C(0x17)
47983 /* Count of samples measured >= 44 W and < 50 W */
47984 #define BUCKET_RANGE_44W_TO_50W UINT32_C(0x18)
47985 /* Count of samples measured at 50 W or greater */
47986 #define BUCKET_RANGE_OVER_50W UINT32_C(0x19)
47987 #define BUCKET_LAST BUCKET_RANGE_OVER_50W
47988
47989
47990 /*************************
47991 * hwrm_wol_filter_alloc *
47992 *************************/
47993
47994
47995 /* hwrm_wol_filter_alloc_input (size:512b/64B) */
47996
47997 typedef struct hwrm_wol_filter_alloc_input {
47998 /* The HWRM command request type. */
47999 uint16_t req_type;
48000 /*
48001 * The completion ring to send the completion event on. This should
48002 * be the NQ ID returned from the `nq_alloc` HWRM command.
48003 */
48004 uint16_t cmpl_ring;
48005 /*
48006 * The sequence ID is used by the driver for tracking multiple
48007 * commands. This ID is treated as opaque data by the firmware and
48008 * the value is returned in the `hwrm_resp_hdr` upon completion.
48009 */
48010 uint16_t seq_id;
48011 /*
48012 * The target ID of the command:
48013 * * 0x0-0xFFF8 - The function ID
48014 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48015 * * 0xFFFD - Reserved for user-space HWRM interface
48016 * * 0xFFFF - HWRM
48017 */
48018 uint16_t target_id;
48019 /*
48020 * A physical address pointer pointing to a host buffer that the
48021 * command's response data will be written. This can be either a host
48022 * physical address (HPA) or a guest physical address (GPA) and must
48023 * point to a physically contiguous block of memory.
48024 */
48025 uint64_t resp_addr;
48026 uint32_t flags;
48027 uint32_t enables;
48028 /*
48029 * This bit must be '1' for the mac_address field to be
48030 * configured.
48031 */
48032 #define HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_MAC_ADDRESS UINT32_C(0x1)
48033 /*
48034 * This bit must be '1' for the pattern_offset field to be
48035 * configured.
48036 */
48037 #define HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_PATTERN_OFFSET UINT32_C(0x2)
48038 /*
48039 * This bit must be '1' for the pattern_buf_size field to be
48040 * configured.
48041 */
48042 #define HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_PATTERN_BUF_SIZE UINT32_C(0x4)
48043 /*
48044 * This bit must be '1' for the pattern_buf_addr field to be
48045 * configured.
48046 */
48047 #define HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_PATTERN_BUF_ADDR UINT32_C(0x8)
48048 /*
48049 * This bit must be '1' for the pattern_mask_addr field to be
48050 * configured.
48051 */
48052 #define HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_PATTERN_MASK_ADDR UINT32_C(0x10)
48053 /*
48054 * This bit must be '1' for the pattern_mask_size field to be
48055 * configured.
48056 */
48057 #define HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_PATTERN_MASK_SIZE UINT32_C(0x20)
48058 /* Port ID of port on which WoL filter is configured. */
48059 uint16_t port_id;
48060 /* This value represents a Wake-on-LAN type. */
48061 uint8_t wol_type;
48062 /* Magic Packet */
48063 #define HWRM_WOL_FILTER_ALLOC_INPUT_WOL_TYPE_MAGICPKT UINT32_C(0x0)
48064 /* Bitmap */
48065 #define HWRM_WOL_FILTER_ALLOC_INPUT_WOL_TYPE_BMP UINT32_C(0x1)
48066 /* Invalid */
48067 #define HWRM_WOL_FILTER_ALLOC_INPUT_WOL_TYPE_INVALID UINT32_C(0xff)
48068 #define HWRM_WOL_FILTER_ALLOC_INPUT_WOL_TYPE_LAST HWRM_WOL_FILTER_ALLOC_INPUT_WOL_TYPE_INVALID
48069 uint8_t unused_0[5];
48070 /*
48071 * # If this field is enabled and magic packet WoL filter
48072 * type is specified in this command, the value set in this
48073 * field shall be used in setting the magic packet based
48074 * WoL filter.
48075 * # If this field is not enabled and magic packet WoL
48076 * filter type is specified and port id is specified to
48077 * 0xFF in this command, then the HWRM
48078 * shall use default MAC address configured on the
48079 * function associated with the HWRM client.
48080 * # If this field is not enabled and magic packet WoL
48081 * filter type is specified and port id is not specified to
48082 * 0xFF in this command, then the HWRM
48083 * shall use default MAC address configured on the port.
48084 */
48085 uint8_t mac_address[6];
48086 /*
48087 * The offset from the beginning of MAC header where
48088 * pattern should be matched.
48089 * Applies to bitmap WoL.
48090 */
48091 uint16_t pattern_offset;
48092 /*
48093 * The size of the pattern that is being matched.
48094 * Applies to bitmap WoL.
48095 */
48096 uint16_t pattern_buf_size;
48097 /*
48098 * The size of the pattern mask.
48099 * Applies to bitmap WoL.
48100 */
48101 uint16_t pattern_mask_size;
48102 uint8_t unused_1[4];
48103 /*
48104 * Physical address of the pattern buffer.
48105 * Applies to bitmap WoL.
48106 */
48107 uint64_t pattern_buf_addr;
48108 /*
48109 * Physical address of the pattern mask.
48110 * Applies to bitmap WoL.
48111 */
48112 uint64_t pattern_mask_addr;
48113 } hwrm_wol_filter_alloc_input_t, *phwrm_wol_filter_alloc_input_t;
48114
48115 /* hwrm_wol_filter_alloc_output (size:128b/16B) */
48116
48117 typedef struct hwrm_wol_filter_alloc_output {
48118 /* The specific error status for the command. */
48119 uint16_t error_code;
48120 /* The HWRM command request type. */
48121 uint16_t req_type;
48122 /* The sequence ID from the original command. */
48123 uint16_t seq_id;
48124 /* The length of the response data in number of bytes. */
48125 uint16_t resp_len;
48126 /* This value identifies a Wake-on-LAN (WoL) filter. */
48127 uint8_t wol_filter_id;
48128 uint8_t unused_0[6];
48129 /*
48130 * This field is used in Output records to indicate that the output
48131 * is completely written to RAM. This field should be read as '1'
48132 * to indicate that the output has been completely written.
48133 * When writing a command completion or response to an internal processor,
48134 * the order of writes has to be such that this field is written last.
48135 */
48136 uint8_t valid;
48137 } hwrm_wol_filter_alloc_output_t, *phwrm_wol_filter_alloc_output_t;
48138
48139 /************************
48140 * hwrm_wol_filter_free *
48141 ************************/
48142
48143
48144 /* hwrm_wol_filter_free_input (size:256b/32B) */
48145
48146 typedef struct hwrm_wol_filter_free_input {
48147 /* The HWRM command request type. */
48148 uint16_t req_type;
48149 /*
48150 * The completion ring to send the completion event on. This should
48151 * be the NQ ID returned from the `nq_alloc` HWRM command.
48152 */
48153 uint16_t cmpl_ring;
48154 /*
48155 * The sequence ID is used by the driver for tracking multiple
48156 * commands. This ID is treated as opaque data by the firmware and
48157 * the value is returned in the `hwrm_resp_hdr` upon completion.
48158 */
48159 uint16_t seq_id;
48160 /*
48161 * The target ID of the command:
48162 * * 0x0-0xFFF8 - The function ID
48163 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48164 * * 0xFFFD - Reserved for user-space HWRM interface
48165 * * 0xFFFF - HWRM
48166 */
48167 uint16_t target_id;
48168 /*
48169 * A physical address pointer pointing to a host buffer that the
48170 * command's response data will be written. This can be either a host
48171 * physical address (HPA) or a guest physical address (GPA) and must
48172 * point to a physically contiguous block of memory.
48173 */
48174 uint64_t resp_addr;
48175 uint32_t flags;
48176 /*
48177 * # When this bit is set to '1', then all active WoL
48178 * filters on the port are requested to be freed.
48179 * # If the a function driver sets this flag to '1', then
48180 * the HWRM shall free all active WoL filters that are not
48181 * set by other function drivers on that port.
48182 */
48183 #define HWRM_WOL_FILTER_FREE_INPUT_FLAGS_FREE_ALL_WOL_FILTERS UINT32_C(0x1)
48184 uint32_t enables;
48185 /*
48186 * This bit must be '1' for the wol_filter_id field to be
48187 * configured.
48188 */
48189 #define HWRM_WOL_FILTER_FREE_INPUT_ENABLES_WOL_FILTER_ID UINT32_C(0x1)
48190 /* Port ID of the port on which WoL filter(s) is (are) being freed. */
48191 uint16_t port_id;
48192 /*
48193 * The HWRM shall ignore this field if free_all_wol_filters
48194 * flag is set.
48195 */
48196 uint8_t wol_filter_id;
48197 uint8_t unused_0[5];
48198 } hwrm_wol_filter_free_input_t, *phwrm_wol_filter_free_input_t;
48199
48200 /* hwrm_wol_filter_free_output (size:128b/16B) */
48201
48202 typedef struct hwrm_wol_filter_free_output {
48203 /* The specific error status for the command. */
48204 uint16_t error_code;
48205 /* The HWRM command request type. */
48206 uint16_t req_type;
48207 /* The sequence ID from the original command. */
48208 uint16_t seq_id;
48209 /* The length of the response data in number of bytes. */
48210 uint16_t resp_len;
48211 uint8_t unused_0[7];
48212 /*
48213 * This field is used in Output records to indicate that the output
48214 * is completely written to RAM. This field should be read as '1'
48215 * to indicate that the output has been completely written.
48216 * When writing a command completion or response to an internal processor,
48217 * the order of writes has to be such that this field is written last.
48218 */
48219 uint8_t valid;
48220 } hwrm_wol_filter_free_output_t, *phwrm_wol_filter_free_output_t;
48221
48222 /************************
48223 * hwrm_wol_filter_qcfg *
48224 ************************/
48225
48226
48227 /* hwrm_wol_filter_qcfg_input (size:448b/56B) */
48228
48229 typedef struct hwrm_wol_filter_qcfg_input {
48230 /* The HWRM command request type. */
48231 uint16_t req_type;
48232 /*
48233 * The completion ring to send the completion event on. This should
48234 * be the NQ ID returned from the `nq_alloc` HWRM command.
48235 */
48236 uint16_t cmpl_ring;
48237 /*
48238 * The sequence ID is used by the driver for tracking multiple
48239 * commands. This ID is treated as opaque data by the firmware and
48240 * the value is returned in the `hwrm_resp_hdr` upon completion.
48241 */
48242 uint16_t seq_id;
48243 /*
48244 * The target ID of the command:
48245 * * 0x0-0xFFF8 - The function ID
48246 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48247 * * 0xFFFD - Reserved for user-space HWRM interface
48248 * * 0xFFFF - HWRM
48249 */
48250 uint16_t target_id;
48251 /*
48252 * A physical address pointer pointing to a host buffer that the
48253 * command's response data will be written. This can be either a host
48254 * physical address (HPA) or a guest physical address (GPA) and must
48255 * point to a physically contiguous block of memory.
48256 */
48257 uint64_t resp_addr;
48258 /* Port ID of port on which WoL filter that is being queried. */
48259 uint16_t port_id;
48260 /*
48261 * This is an opaque handle used to access filters.
48262 * # The HWRM client shall set this field to 0x0000 to begin
48263 * the query.
48264 * # After the first query, the HWRM client shall retrieve
48265 * next filters (if they exist) using the HWRM provided handle
48266 * in the response.
48267 */
48268 uint16_t handle;
48269 uint8_t unused_0[4];
48270 /*
48271 * Physical address of the pattern buffer.
48272 * Applies to bitmap WoL filter only.
48273 * # Value of 0 indicates an invalid buffer address.
48274 * If this field is set to 0, then HWRM shall ignore
48275 * pattern_buf_size.
48276 * # If the HWRM client provides an invalid buffer address
48277 * for the pattern, then the HWRM is not required to
48278 * provide pattern when the response contains a bitmap WoL
48279 * filter.
48280 */
48281 uint64_t pattern_buf_addr;
48282 /*
48283 * The size of the pattern buffer.
48284 * Applies to bitmap WoL filter only.
48285 */
48286 uint16_t pattern_buf_size;
48287 uint8_t unused_1[6];
48288 /*
48289 * Physical address of the pattern mask.
48290 * Applies to bitmap WoL filter only.
48291 * # Value of 0 indicates an invalid pattern mask address.
48292 * If this field is set to 0, then HWRM shall ignore
48293 * pattern_mask_size.
48294 * # If the HWRM client provides an invalid mask address
48295 * for the pattern, then the HWRM is not required to
48296 * provide mask when the response contains a bitmap WoL
48297 * filter.
48298 */
48299 uint64_t pattern_mask_addr;
48300 /*
48301 * The size of the buffer for pattern mask.
48302 * Applies to bitmap WoL filter only.
48303 */
48304 uint16_t pattern_mask_size;
48305 uint8_t unused_2[6];
48306 } hwrm_wol_filter_qcfg_input_t, *phwrm_wol_filter_qcfg_input_t;
48307
48308 /* hwrm_wol_filter_qcfg_output (size:256b/32B) */
48309
48310 typedef struct hwrm_wol_filter_qcfg_output {
48311 /* The specific error status for the command. */
48312 uint16_t error_code;
48313 /* The HWRM command request type. */
48314 uint16_t req_type;
48315 /* The sequence ID from the original command. */
48316 uint16_t seq_id;
48317 /* The length of the response data in number of bytes. */
48318 uint16_t resp_len;
48319 /*
48320 * This is the next handle that is used to access filters.
48321 * # If this field is set to 0x0000, then no WoL filters are
48322 * currently configured on this port and all other fields in
48323 * the output shall be ignored by the HWRM client.
48324 * # If this field is set to neither 0x0000 nor 0xFFFF, then the
48325 * wol_filter_id is valid and the parameters provided in the
48326 * response are based on the wol_type.
48327 * # If this field is set to 0xFFFF, then there are no remaining
48328 * configured WoL filters to be queried for the queried function
48329 * after this response, wol_filter_id is valid and the parameters
48330 * provided in the response are based on the wol_type.
48331 */
48332 uint16_t next_handle;
48333 /*
48334 * This value identifies the filter returned in this
48335 * response.
48336 */
48337 uint8_t wol_filter_id;
48338 /*
48339 * This value identifies the type of WoL filter returned
48340 * in this response.
48341 */
48342 uint8_t wol_type;
48343 /* Magic Packet */
48344 #define HWRM_WOL_FILTER_QCFG_OUTPUT_WOL_TYPE_MAGICPKT UINT32_C(0x0)
48345 /* Bitmap */
48346 #define HWRM_WOL_FILTER_QCFG_OUTPUT_WOL_TYPE_BMP UINT32_C(0x1)
48347 /* Invalid */
48348 #define HWRM_WOL_FILTER_QCFG_OUTPUT_WOL_TYPE_INVALID UINT32_C(0xff)
48349 #define HWRM_WOL_FILTER_QCFG_OUTPUT_WOL_TYPE_LAST HWRM_WOL_FILTER_QCFG_OUTPUT_WOL_TYPE_INVALID
48350 uint32_t unused_0;
48351 /*
48352 * The MAC address value used by the WoL filter.
48353 * Applies to magic packet based WoL.
48354 */
48355 uint8_t mac_address[6];
48356 /*
48357 * The offset from the beginning of MAC header where
48358 * pattern should be matched.
48359 * Applies to bitmap WoL.
48360 */
48361 uint16_t pattern_offset;
48362 /*
48363 * The actual size of the pattern that is being returned.
48364 * Applies to bitmap WoL.
48365 */
48366 uint16_t pattern_size;
48367 /*
48368 * The actual size of the pattern mask that is being returned.
48369 * Applies to bitmap WoL.
48370 */
48371 uint16_t pattern_mask_size;
48372 uint8_t unused_1[3];
48373 /*
48374 * This field is used in Output records to indicate that the output
48375 * is completely written to RAM. This field should be read as '1'
48376 * to indicate that the output has been completely written.
48377 * When writing a command completion or response to an internal processor,
48378 * the order of writes has to be such that this field is written last.
48379 */
48380 uint8_t valid;
48381 } hwrm_wol_filter_qcfg_output_t, *phwrm_wol_filter_qcfg_output_t;
48382
48383 /************************
48384 * hwrm_wol_reason_qcfg *
48385 ************************/
48386
48387
48388 /* hwrm_wol_reason_qcfg_input (size:320b/40B) */
48389
48390 typedef struct hwrm_wol_reason_qcfg_input {
48391 /* The HWRM command request type. */
48392 uint16_t req_type;
48393 /*
48394 * The completion ring to send the completion event on. This should
48395 * be the NQ ID returned from the `nq_alloc` HWRM command.
48396 */
48397 uint16_t cmpl_ring;
48398 /*
48399 * The sequence ID is used by the driver for tracking multiple
48400 * commands. This ID is treated as opaque data by the firmware and
48401 * the value is returned in the `hwrm_resp_hdr` upon completion.
48402 */
48403 uint16_t seq_id;
48404 /*
48405 * The target ID of the command:
48406 * * 0x0-0xFFF8 - The function ID
48407 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48408 * * 0xFFFD - Reserved for user-space HWRM interface
48409 * * 0xFFFF - HWRM
48410 */
48411 uint16_t target_id;
48412 /*
48413 * A physical address pointer pointing to a host buffer that the
48414 * command's response data will be written. This can be either a host
48415 * physical address (HPA) or a guest physical address (GPA) and must
48416 * point to a physically contiguous block of memory.
48417 */
48418 uint64_t resp_addr;
48419 /* Port ID of port for which this query is for. */
48420 uint16_t port_id;
48421 uint8_t unused_0[6];
48422 /*
48423 * Physical address of the packet buffer for querying
48424 * WoL packet.
48425 */
48426 uint64_t wol_pkt_buf_addr;
48427 /* The size of the buffer for the WoL packet. */
48428 uint16_t wol_pkt_buf_size;
48429 uint8_t unused_1[6];
48430 } hwrm_wol_reason_qcfg_input_t, *phwrm_wol_reason_qcfg_input_t;
48431
48432 /* hwrm_wol_reason_qcfg_output (size:128b/16B) */
48433
48434 typedef struct hwrm_wol_reason_qcfg_output {
48435 /* The specific error status for the command. */
48436 uint16_t error_code;
48437 /* The HWRM command request type. */
48438 uint16_t req_type;
48439 /* The sequence ID from the original command. */
48440 uint16_t seq_id;
48441 /* The length of the response data in number of bytes. */
48442 uint16_t resp_len;
48443 /*
48444 * This value identifies the filter that matched
48445 * the last WoL packet.
48446 * This id is only valid with valid WoL reason.
48447 */
48448 uint8_t wol_filter_id;
48449 /*
48450 * This value identifies the type of WoL reason returned
48451 * in this response.
48452 * When the wol_type is set to invalid, then there is
48453 * no WoL event that happened during last system
48454 * wake-up.
48455 */
48456 uint8_t wol_reason;
48457 /* Magic Packet */
48458 #define HWRM_WOL_REASON_QCFG_OUTPUT_WOL_REASON_MAGICPKT UINT32_C(0x0)
48459 /* Bitmap */
48460 #define HWRM_WOL_REASON_QCFG_OUTPUT_WOL_REASON_BMP UINT32_C(0x1)
48461 /* Invalid */
48462 #define HWRM_WOL_REASON_QCFG_OUTPUT_WOL_REASON_INVALID UINT32_C(0xff)
48463 #define HWRM_WOL_REASON_QCFG_OUTPUT_WOL_REASON_LAST HWRM_WOL_REASON_QCFG_OUTPUT_WOL_REASON_INVALID
48464 /* The value identifies the length of the WoL packet in bytes. */
48465 uint8_t wol_pkt_len;
48466 uint8_t unused_0[4];
48467 /*
48468 * This field is used in Output records to indicate that the output
48469 * is completely written to RAM. This field should be read as '1'
48470 * to indicate that the output has been completely written.
48471 * When writing a command completion or response to an internal processor,
48472 * the order of writes has to be such that this field is written last.
48473 */
48474 uint8_t valid;
48475 } hwrm_wol_reason_qcfg_output_t, *phwrm_wol_reason_qcfg_output_t;
48476
48477 /*****************************
48478 * hwrm_dbg_crashdump_header *
48479 *****************************/
48480
48481
48482 /* hwrm_dbg_crashdump_header_input (size:192b/24B) */
48483
48484 typedef struct hwrm_dbg_crashdump_header_input {
48485 /* The HWRM command request type. */
48486 uint16_t req_type;
48487 /*
48488 * The completion ring to send the completion event on. This should
48489 * be the NQ ID returned from the `nq_alloc` HWRM command.
48490 */
48491 uint16_t cmpl_ring;
48492 /*
48493 * The sequence ID is used by the driver for tracking multiple
48494 * commands. This ID is treated as opaque data by the firmware and
48495 * the value is returned in the `hwrm_resp_hdr` upon completion.
48496 */
48497 uint16_t seq_id;
48498 /*
48499 * The target ID of the command:
48500 * * 0x0-0xFFF8 - The function ID
48501 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48502 * * 0xFFFD - Reserved for user-space HWRM interface
48503 * * 0xFFFF - HWRM
48504 */
48505 uint16_t target_id;
48506 /*
48507 * A physical address pointer pointing to a host buffer that the
48508 * command's response data will be written. This can be either a host
48509 * physical address (HPA) or a guest physical address (GPA) and must
48510 * point to a physically contiguous block of memory.
48511 */
48512 uint64_t resp_addr;
48513 uint64_t unused_0;
48514 } hwrm_dbg_crashdump_header_input_t, *phwrm_dbg_crashdump_header_input_t;
48515
48516 /* hwrm_dbg_crashdump_header_output (size:512b/64B) */
48517
48518 typedef struct hwrm_dbg_crashdump_header_output {
48519 /* The specific error status for the command. */
48520 uint16_t error_code;
48521 /* The HWRM command request type. */
48522 uint16_t req_type;
48523 /* The sequence ID from the original command. */
48524 uint16_t seq_id;
48525 /* The length of the response data in number of bytes. */
48526 uint16_t resp_len;
48527 /* Major version. */
48528 uint8_t version_hi;
48529 /* Minor version. */
48530 uint8_t version_low;
48531 /*
48532 * Header length in bytes. This includes all fields from version
48533 * to dev_uid (whose length is specified in dev_uid_length).
48534 */
48535 uint16_t header_len;
48536 /* This is the crash dump size in bytes. */
48537 uint32_t dump_size;
48538 /*
48539 * This is a "wall clock" timestamp value of when the crash occurred.
48540 * Format is of time_t type.
48541 */
48542 uint32_t crash_time;
48543 /* This is the timezone information for the crash_time. */
48544 int8_t utc_offset;
48545 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_UTC 0
48546 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AMSTERDAM 4
48547 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_EGYPT 8
48548 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_EUROPE_MOSCOW 12
48549 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_IRAN 14
48550 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ASIA_DUBAI 16
48551 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ASIA_KABUL 18
48552 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ANTARCTICA_MAWSON 20
48553 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ASIA_COLOMBO 22
48554 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ASIA_KATHMANDU 23
48555 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_INDIAN_CHAGOS 24
48556 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_INDIAN_COCOS 26
48557 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ASIA_BANGKOK 28
48558 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ASIA_HONG_KONG 32
48559 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ASIA_PYONGYANG 34
48560 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AUSTRALIA_EUCLA 35
48561 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ASIA_TOKYO 36
48562 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AUSTRALIA_ADELAIDE 38
48563 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AUSTRALIA_BROKEN_HILL 38
48564 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AUSTRALIA_DARWIN 38
48565 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AUSTRALIA_SYDNEY 40
48566 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AUSTRALIA_LORD_HOWE 42
48567 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ANTARCTICA_MACQUARIE 44
48568 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ANTARCTICA_SOUTH_POLE 48
48569 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_PACIFIC_CHATHAM 51
48570 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_PACIFIC_APIA 52
48571 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_PACIFIC_KIRITIMATIS 56
48572 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ATLANTIC_CAPE_VERDE -4
48573 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ATLANTIC_SOUTH_GEORGIA -8
48574 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AMERICA_ARGENTINA_BUENOS_AIRES -12
48575 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AMERICA_SAO_PAULO -12
48576 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AMERICA_NEWFOUNDLAND -14
48577 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AMERICA_BARBADOS -16
48578 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AMERICA_CANCUN -20
48579 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AMERICA_COSTA_RICA -24
48580 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AMERICA_PHOENIX -28
48581 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_US_ARIZONA -28
48582 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_US_PACIFIC -32
48583 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_US_ALASKA -36
48584 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_PACIFIC_MARQUESAS -38
48585 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_PACIFIC_HAWAII -40
48586 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_PACIFIC_MIDWAY -44
48587 #define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_LAST HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_PACIFIC_MIDWAY
48588 /*
48589 * This field is a counter value of the crash dump available. This
48590 * value is incremented monotonically at each crash.
48591 */
48592 uint8_t crash_cntr;
48593 /*
48594 * This specifies the length of the dev_uid in bytes. The maximum
48595 * value is 31.
48596 */
48597 uint16_t dev_uid_length;
48598 /*
48599 * This is a unique device identifier (e.g. the first port MAC
48600 * address for a network controller or a serial number for an
48601 * en/decryption device) in ASCII format. It is used to identify
48602 * where the crash dump content is coming from. Unused bytes must
48603 * have '\0' character.
48604 */
48605 uint8_t dev_uid[32];
48606 /*
48607 * This is a count value tracking the number of successful boots
48608 * before the crash occurred.
48609 */
48610 uint32_t power_on_count;
48611 uint8_t unused_2[3];
48612 /*
48613 * This field is used in Output records to indicate that the output
48614 * is completely written to RAM. This field should be read as '1'
48615 * to indicate that the output has been completely written.
48616 * When writing a command completion or response to an internal processor,
48617 * the order of writes has to be such that this field is written last.
48618 */
48619 uint8_t valid;
48620 } hwrm_dbg_crashdump_header_output_t, *phwrm_dbg_crashdump_header_output_t;
48621
48622 /****************************
48623 * hwrm_dbg_crashdump_erase *
48624 ****************************/
48625
48626
48627 /* hwrm_dbg_crashdump_erase_input (size:192b/24B) */
48628
48629 typedef struct hwrm_dbg_crashdump_erase_input {
48630 /* The HWRM command request type. */
48631 uint16_t req_type;
48632 /*
48633 * The completion ring to send the completion event on. This should
48634 * be the NQ ID returned from the `nq_alloc` HWRM command.
48635 */
48636 uint16_t cmpl_ring;
48637 /*
48638 * The sequence ID is used by the driver for tracking multiple
48639 * commands. This ID is treated as opaque data by the firmware and
48640 * the value is returned in the `hwrm_resp_hdr` upon completion.
48641 */
48642 uint16_t seq_id;
48643 /*
48644 * The target ID of the command:
48645 * * 0x0-0xFFF8 - The function ID
48646 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48647 * * 0xFFFD - Reserved for user-space HWRM interface
48648 * * 0xFFFF - HWRM
48649 */
48650 uint16_t target_id;
48651 /*
48652 * A physical address pointer pointing to a host buffer that the
48653 * command's response data will be written. This can be either a host
48654 * physical address (HPA) or a guest physical address (GPA) and must
48655 * point to a physically contiguous block of memory.
48656 */
48657 uint64_t resp_addr;
48658 /* The scope of the erase */
48659 uint8_t scope;
48660 /*
48661 * Wipe all crashdump data blocks, making them available for
48662 * the next crash(es). This is the typical value to be used.
48663 */
48664 #define HWRM_DBG_CRASHDUMP_ERASE_INPUT_SCOPE_INVALIDATE UINT32_C(0x0)
48665 /*
48666 * Experimental: Remove all data blocks from the directory
48667 * (without erasing any existing contents), re-allocate and
48668 * re-initialize new ones. In case where the crash dump feature
48669 * stops functioning, this can be used to restore it back to the
48670 * clean slate.
48671 */
48672 #define HWRM_DBG_CRASHDUMP_ERASE_INPUT_SCOPE_REINIT UINT32_C(0x1)
48673 #define HWRM_DBG_CRASHDUMP_ERASE_INPUT_SCOPE_LAST HWRM_DBG_CRASHDUMP_ERASE_INPUT_SCOPE_REINIT
48674 uint8_t unused_0[3];
48675 uint32_t unused_1;
48676 } hwrm_dbg_crashdump_erase_input_t, *phwrm_dbg_crashdump_erase_input_t;
48677
48678 /* hwrm_dbg_crashdump_erase_output (size:128b/16B) */
48679
48680 typedef struct hwrm_dbg_crashdump_erase_output {
48681 /* The specific error status for the command. */
48682 uint16_t error_code;
48683 /* The HWRM command request type. */
48684 uint16_t req_type;
48685 /* The sequence ID from the original command. */
48686 uint16_t seq_id;
48687 /* The length of the response data in number of bytes. */
48688 uint16_t resp_len;
48689 uint8_t unused_1[7];
48690 /*
48691 * This field is used in Output records to indicate that the output
48692 * is completely written to RAM. This field should be read as '1'
48693 * to indicate that the output has been completely written.
48694 * When writing a command completion or response to an internal processor,
48695 * the order of writes has to be such that this field is written last.
48696 */
48697 uint8_t valid;
48698 } hwrm_dbg_crashdump_erase_output_t, *phwrm_dbg_crashdump_erase_output_t;
48699
48700 /******************
48701 * hwrm_dbg_qcaps *
48702 ******************/
48703
48704
48705 /* hwrm_dbg_qcaps_input (size:192b/24B) */
48706
48707 typedef struct hwrm_dbg_qcaps_input {
48708 /* The HWRM command request type. */
48709 uint16_t req_type;
48710 /*
48711 * The completion ring to send the completion event on. This should
48712 * be the NQ ID returned from the `nq_alloc` HWRM command.
48713 */
48714 uint16_t cmpl_ring;
48715 /*
48716 * The sequence ID is used by the driver for tracking multiple
48717 * commands. This ID is treated as opaque data by the firmware and
48718 * the value is returned in the `hwrm_resp_hdr` upon completion.
48719 */
48720 uint16_t seq_id;
48721 /*
48722 * The target ID of the command:
48723 * * 0x0-0xFFF8 - The function ID
48724 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48725 * * 0xFFFD - Reserved for user-space HWRM interface
48726 * * 0xFFFF - HWRM
48727 */
48728 uint16_t target_id;
48729 /*
48730 * A physical address pointer pointing to a host buffer that the
48731 * command's response data will be written. This can be either a host
48732 * physical address (HPA) or a guest physical address (GPA) and must
48733 * point to a physically contiguous block of memory.
48734 */
48735 uint64_t resp_addr;
48736 /*
48737 * Function ID of the function that is being queried.
48738 * 0xFF... (All Fs) if the query is for the requesting
48739 * function.
48740 */
48741 uint16_t fid;
48742 uint8_t unused_0[6];
48743 } hwrm_dbg_qcaps_input_t, *phwrm_dbg_qcaps_input_t;
48744
48745 /* hwrm_dbg_qcaps_output (size:192b/24B) */
48746
48747 typedef struct hwrm_dbg_qcaps_output {
48748 /* The specific error status for the command. */
48749 uint16_t error_code;
48750 /* The HWRM command request type. */
48751 uint16_t req_type;
48752 /* The sequence ID from the original command. */
48753 uint16_t seq_id;
48754 /* The length of the response data in number of bytes. */
48755 uint16_t resp_len;
48756 /*
48757 * FID value. This value is used to identify operations on the PCI
48758 * bus as belonging to a particular PCI function.
48759 */
48760 uint16_t fid;
48761 uint8_t unused_0[2];
48762 /*
48763 * Bitwise field of components FW supports skipping during collection
48764 * of coredump as part of a crash collection.
48765 */
48766 uint32_t coredump_component_disable_caps;
48767 /*
48768 * If 1, FW supports disabling the collection of NVM during a
48769 * coredump taken as part of crash collection.
48770 */
48771 #define HWRM_DBG_QCAPS_OUTPUT_COREDUMP_COMPONENT_DISABLE_CAPS_NVRAM UINT32_C(0x1)
48772 uint32_t flags;
48773 /* If 1, FW supports writing a crashdump to NVM. */
48774 #define HWRM_DBG_QCAPS_OUTPUT_FLAGS_CRASHDUMP_NVM UINT32_C(0x1)
48775 /* If 1, FW supports writing a crashdump to host ddr. */
48776 #define HWRM_DBG_QCAPS_OUTPUT_FLAGS_CRASHDUMP_HOST_DDR UINT32_C(0x2)
48777 /* If 1, FW supports writing a crashdump to soc ddr. */
48778 #define HWRM_DBG_QCAPS_OUTPUT_FLAGS_CRASHDUMP_SOC_DDR UINT32_C(0x4)
48779 /* If 1, FW supports USEQ operations */
48780 #define HWRM_DBG_QCAPS_OUTPUT_FLAGS_USEQ UINT32_C(0x8)
48781 uint8_t unused_1[3];
48782 /*
48783 * This field is used in Output records to indicate that the output
48784 * is completely written to RAM. This field should be read as '1'
48785 * to indicate that the output has been completely written.
48786 * When writing a command completion or response to an internal processor,
48787 * the order of writes has to be such that this field is written last.
48788 */
48789 uint8_t valid;
48790 } hwrm_dbg_qcaps_output_t, *phwrm_dbg_qcaps_output_t;
48791
48792 /*****************
48793 * hwrm_dbg_qcfg *
48794 *****************/
48795
48796
48797 /* hwrm_dbg_qcfg_input (size:192b/24B) */
48798
48799 typedef struct hwrm_dbg_qcfg_input {
48800 /* The HWRM command request type. */
48801 uint16_t req_type;
48802 /*
48803 * The completion ring to send the completion event on. This should
48804 * be the NQ ID returned from the `nq_alloc` HWRM command.
48805 */
48806 uint16_t cmpl_ring;
48807 /*
48808 * The sequence ID is used by the driver for tracking multiple
48809 * commands. This ID is treated as opaque data by the firmware and
48810 * the value is returned in the `hwrm_resp_hdr` upon completion.
48811 */
48812 uint16_t seq_id;
48813 /*
48814 * The target ID of the command:
48815 * * 0x0-0xFFF8 - The function ID
48816 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48817 * * 0xFFFD - Reserved for user-space HWRM interface
48818 * * 0xFFFF - HWRM
48819 */
48820 uint16_t target_id;
48821 /*
48822 * A physical address pointer pointing to a host buffer that the
48823 * command's response data will be written. This can be either a host
48824 * physical address (HPA) or a guest physical address (GPA) and must
48825 * point to a physically contiguous block of memory.
48826 */
48827 uint64_t resp_addr;
48828 /*
48829 * Function ID of the function that is being queried.
48830 * 0xFF... (All Fs) if the query is for the requesting
48831 * function.
48832 */
48833 uint16_t fid;
48834 uint16_t flags;
48835 /*
48836 * The crashdump size represents size of crashdump
48837 * written to the specified destination.
48838 */
48839 #define HWRM_DBG_QCFG_INPUT_FLAGS_CRASHDUMP_SIZE_FOR_DEST_MASK UINT32_C(0x3)
48840 #define HWRM_DBG_QCFG_INPUT_FLAGS_CRASHDUMP_SIZE_FOR_DEST_SFT 0
48841 /* crashdump size written to nvm */
48842 #define HWRM_DBG_QCFG_INPUT_FLAGS_CRASHDUMP_SIZE_FOR_DEST_DEST_NVM UINT32_C(0x0)
48843 /* crashdump size written to host_ddr */
48844 #define HWRM_DBG_QCFG_INPUT_FLAGS_CRASHDUMP_SIZE_FOR_DEST_DEST_HOST_DDR UINT32_C(0x1)
48845 /* crashdump size written to soc_ddr */
48846 #define HWRM_DBG_QCFG_INPUT_FLAGS_CRASHDUMP_SIZE_FOR_DEST_DEST_SOC_DDR UINT32_C(0x2)
48847 #define HWRM_DBG_QCFG_INPUT_FLAGS_CRASHDUMP_SIZE_FOR_DEST_LAST HWRM_DBG_QCFG_INPUT_FLAGS_CRASHDUMP_SIZE_FOR_DEST_DEST_SOC_DDR
48848 /*
48849 * Bitwise field of components requested for FW to skip when
48850 * calculating the size of a coredump collection.
48851 */
48852 uint32_t coredump_component_disable_flags;
48853 /*
48854 * If 1, NVM will not be collected during a coredump taken as part
48855 * of crash collection.
48856 */
48857 #define HWRM_DBG_QCFG_INPUT_COREDUMP_COMPONENT_DISABLE_FLAGS_NVRAM UINT32_C(0x1)
48858 } hwrm_dbg_qcfg_input_t, *phwrm_dbg_qcfg_input_t;
48859
48860 /* hwrm_dbg_qcfg_output (size:256b/32B) */
48861
48862 typedef struct hwrm_dbg_qcfg_output {
48863 /* The specific error status for the command. */
48864 uint16_t error_code;
48865 /* The HWRM command request type. */
48866 uint16_t req_type;
48867 /* The sequence ID from the original command. */
48868 uint16_t seq_id;
48869 /* The length of the response data in number of bytes. */
48870 uint16_t resp_len;
48871 /*
48872 * FID value. This value is used to identify operations on the PCI
48873 * bus as belonging to a particular PCI function.
48874 */
48875 uint16_t fid;
48876 uint8_t unused_0[2];
48877 /*
48878 * Size in bytes of a coredump file created by the FW. This takes into
48879 * consideration any components selected in the
48880 * coredump_component_disable_flags field from hwrm_dbg_qcfg_input.
48881 */
48882 uint32_t coredump_size;
48883 uint32_t flags;
48884 /*
48885 * If set to 1, then UART logging is enabled for the primary
48886 * firmware. Disabled otherwise.
48887 */
48888 #define HWRM_DBG_QCFG_OUTPUT_FLAGS_UART_LOG UINT32_C(0x1)
48889 /*
48890 * If set to 1, then UART logging is enabled for the secondary
48891 * firmware. Disabled otherwise.
48892 */
48893 #define HWRM_DBG_QCFG_OUTPUT_FLAGS_UART_LOG_SECONDARY UINT32_C(0x2)
48894 /*
48895 * If set to 1, then completion ring logging is enabled for the
48896 * primary firmware. Disabled otherwise.
48897 */
48898 #define HWRM_DBG_QCFG_OUTPUT_FLAGS_FW_TRACE UINT32_C(0x4)
48899 /*
48900 * If set to 1, then completion ring logging is enabled for the
48901 * secondary firmware. Disabled otherwise.
48902 */
48903 #define HWRM_DBG_QCFG_OUTPUT_FLAGS_FW_TRACE_SECONDARY UINT32_C(0x8)
48904 /*
48905 * If set to 1, firmware will generate debug_notification async
48906 * events to the driver as applicable.
48907 */
48908 #define HWRM_DBG_QCFG_OUTPUT_FLAGS_DEBUG_NOTIFY UINT32_C(0x10)
48909 /*
48910 * If set to 1, firmware is allowed to be unresponsive to heartbeat
48911 * health checks, allowing for JTAG debugging scenarios where the
48912 * debugger has the firmware processes stopped indefinitely. This
48913 * flag has effect only on debug builds of firmware.
48914 */
48915 #define HWRM_DBG_QCFG_OUTPUT_FLAGS_JTAG_DEBUG UINT32_C(0x20)
48916 /*
48917 * Notification queue (completion ring) used by the firmware to post
48918 * async debug notifications and fw trace logs. This field is valid
48919 * when fw_trace, fw_trace_secondary or debug_notify flags are set.
48920 */
48921 uint16_t async_cmpl_ring;
48922 uint8_t unused_2[2];
48923 /*
48924 * Size in bytes of a crashdump file created by the FW. Uses input
48925 * flags to determine medium destination and corresponding size.
48926 */
48927 uint32_t crashdump_size;
48928 uint8_t unused_3[3];
48929 /*
48930 * This field is used in Output records to indicate that the output
48931 * is completely written to RAM. This field should be read as '1'
48932 * to indicate that the output has been completely written.
48933 * When writing a command completion or response to an internal processor,
48934 * the order of writes has to be such that this field is written last.
48935 */
48936 uint8_t valid;
48937 } hwrm_dbg_qcfg_output_t, *phwrm_dbg_qcfg_output_t;
48938
48939 /*********************************
48940 * hwrm_dbg_crashdump_medium_cfg *
48941 *********************************/
48942
48943
48944 /* hwrm_dbg_crashdump_medium_cfg_input (size:320b/40B) */
48945
48946 typedef struct hwrm_dbg_crashdump_medium_cfg_input {
48947 /* The HWRM command request type. */
48948 uint16_t req_type;
48949 /*
48950 * The completion ring to send the completion event on. This should
48951 * be the NQ ID returned from the `nq_alloc` HWRM command.
48952 */
48953 uint16_t cmpl_ring;
48954 /*
48955 * The sequence ID is used by the driver for tracking multiple
48956 * commands. This ID is treated as opaque data by the firmware and
48957 * the value is returned in the `hwrm_resp_hdr` upon completion.
48958 */
48959 uint16_t seq_id;
48960 /*
48961 * The target ID of the command:
48962 * * 0x0-0xFFF8 - The function ID
48963 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48964 * * 0xFFFD - Reserved for user-space HWRM interface
48965 * * 0xFFFF - HWRM
48966 */
48967 uint16_t target_id;
48968 /*
48969 * A physical address pointer pointing to a host buffer that the
48970 * command's response data will be written. This can be either a host
48971 * physical address (HPA) or a guest physical address (GPA) and must
48972 * point to a physically contiguous block of memory.
48973 */
48974 uint64_t resp_addr;
48975 uint16_t output_dest_flags;
48976 /* Destination is DDR ram. */
48977 #define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_TYPE_DDR UINT32_C(0x1)
48978 uint16_t pg_size_lvl;
48979 /* PBL indirect levels. */
48980 #define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_LVL_MASK UINT32_C(0x3)
48981 #define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_LVL_SFT 0
48982 /* PBL pointer is physical start address. */
48983 #define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_LVL_LVL_0 UINT32_C(0x0)
48984 /* PBL pointer points to PTE table. */
48985 #define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_LVL_LVL_1 UINT32_C(0x1)
48986 /*
48987 * PBL pointer points to PDE table with each entry pointing to
48988 * PTE tables.
48989 */
48990 #define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_LVL_LVL_2 UINT32_C(0x2)
48991 #define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_LVL_LAST HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_LVL_LVL_2
48992 /* page size. */
48993 #define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_MASK UINT32_C(0x1c)
48994 #define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_SFT 2
48995 /* 4KB. */
48996 #define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_PG_4K (UINT32_C(0x0) << 2)
48997 /* 8KB. */
48998 #define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_PG_8K (UINT32_C(0x1) << 2)
48999 /* 64KB. */
49000 #define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_PG_64K (UINT32_C(0x2) << 2)
49001 /* 2MB. */
49002 #define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_PG_2M (UINT32_C(0x3) << 2)
49003 /* 8MB. */
49004 #define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_PG_8M (UINT32_C(0x4) << 2)
49005 /* 1GB. */
49006 #define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_PG_1G (UINT32_C(0x5) << 2)
49007 #define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_LAST HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_PG_1G
49008 /* unused11 is 11 b */
49009 #define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_UNUSED11_MASK UINT32_C(0xffe0)
49010 #define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_UNUSED11_SFT 5
49011 /* Crashdump buffer size. */
49012 uint32_t size;
49013 /*
49014 * Bitwise field of components that FW is requested to skip during
49015 * coredump as part of a crash collection.
49016 */
49017 uint32_t coredump_component_disable_flags;
49018 /*
49019 * If 1, then NVM will not be collected during a coredump taken as
49020 * part of crash collection.
49021 */
49022 #define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_NVRAM UINT32_C(0x1)
49023 uint32_t unused_0;
49024 /* Crashdump buffer PBL physical address. */
49025 uint64_t pbl;
49026 } hwrm_dbg_crashdump_medium_cfg_input_t, *phwrm_dbg_crashdump_medium_cfg_input_t;
49027
49028 /* hwrm_dbg_crashdump_medium_cfg_output (size:128b/16B) */
49029
49030 typedef struct hwrm_dbg_crashdump_medium_cfg_output {
49031 /* The specific error status for the command. */
49032 uint16_t error_code;
49033 /* The HWRM command request type. */
49034 uint16_t req_type;
49035 /* The sequence ID from the original command. */
49036 uint16_t seq_id;
49037 /* The length of the response data in number of bytes. */
49038 uint16_t resp_len;
49039 uint8_t unused_1[7];
49040 /*
49041 * This field is used in Output records to indicate that the output
49042 * is completely written to RAM. This field should be read as '1'
49043 * to indicate that the output has been completely written.
49044 * When writing a command completion or response to an internal processor,
49045 * the order of writes has to be such that this field is written last.
49046 */
49047 uint8_t valid;
49048 } hwrm_dbg_crashdump_medium_cfg_output_t, *phwrm_dbg_crashdump_medium_cfg_output_t;
49049
49050 /* coredump_segment_record (size:128b/16B) */
49051
49052 typedef struct coredump_segment_record {
49053 /* Component id of the returned component. */
49054 uint16_t component_id;
49055 /* Segment id of the returned component. */
49056 uint16_t segment_id;
49057 /* Not used. */
49058 uint16_t max_instances;
49059 /* Major version. */
49060 uint8_t version_hi;
49061 /* Minor version. */
49062 uint8_t version_low;
49063 /*
49064 * bit 0: live data
49065 * bit 1: crashed data
49066 */
49067 uint8_t seg_flags;
49068 /* This field is used to indicate the segment is compressed. */
49069 uint8_t compress_flags;
49070 /*
49071 * SFLAG_COMPRESSED_ZLIB indicates that the segment data is
49072 * compressed.
49073 */
49074 #define SFLAG_COMPRESSED_ZLIB UINT32_C(0x1)
49075 uint8_t unused_0[2];
49076 /*
49077 * This field is the length of the segment data. It will be zero if
49078 * the firmware does not support returning the segment data length.
49079 */
49080 uint32_t segment_len;
49081 } coredump_segment_record_t, *pcoredump_segment_record_t;
49082
49083 /**************************
49084 * hwrm_dbg_coredump_list *
49085 **************************/
49086
49087
49088 /* hwrm_dbg_coredump_list_input (size:256b/32B) */
49089
49090 typedef struct hwrm_dbg_coredump_list_input {
49091 /* The HWRM command request type. */
49092 uint16_t req_type;
49093 /*
49094 * The completion ring to send the completion event on. This should
49095 * be the NQ ID returned from the `nq_alloc` HWRM command.
49096 */
49097 uint16_t cmpl_ring;
49098 /*
49099 * The sequence ID is used by the driver for tracking multiple
49100 * commands. This ID is treated as opaque data by the firmware and
49101 * the value is returned in the `hwrm_resp_hdr` upon completion.
49102 */
49103 uint16_t seq_id;
49104 /*
49105 * The target ID of the command:
49106 * * 0x0-0xFFF8 - The function ID
49107 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49108 * * 0xFFFD - Reserved for user-space HWRM interface
49109 * * 0xFFFF - HWRM
49110 */
49111 uint16_t target_id;
49112 /*
49113 * A physical address pointer pointing to a host buffer that the
49114 * command's response data will be written. This can be either a host
49115 * physical address (HPA) or a guest physical address (GPA) and must
49116 * point to a physically contiguous block of memory.
49117 */
49118 uint64_t resp_addr;
49119 /*
49120 * host address where the data content will be written
49121 * when the request is complete. This area must be 16B aligned.
49122 */
49123 uint64_t host_dest_addr;
49124 /* Length of host buffer used for transferring debug data. */
49125 uint32_t host_buf_len;
49126 /* Sequence number of the request. Starts at 0. */
49127 uint16_t seq_no;
49128 /* */
49129 uint8_t flags;
49130 /*
49131 * If set to 1, crash dump is requested.
49132 * If set to 0, both live core and crash dump are requested.
49133 */
49134 #define HWRM_DBG_COREDUMP_LIST_INPUT_FLAGS_CRASHDUMP UINT32_C(0x1)
49135 uint8_t unused_0[1];
49136 } hwrm_dbg_coredump_list_input_t, *phwrm_dbg_coredump_list_input_t;
49137
49138 /* hwrm_dbg_coredump_list_output (size:128b/16B) */
49139
49140 typedef struct hwrm_dbg_coredump_list_output {
49141 /* The specific error status for the command. */
49142 uint16_t error_code;
49143 /* The HWRM command request type. */
49144 uint16_t req_type;
49145 /* The sequence ID from the original command. */
49146 uint16_t seq_id;
49147 /* The length of the response data in number of bytes. */
49148 uint16_t resp_len;
49149 uint8_t flags;
49150 /*
49151 * Value of 1 means that there is more data available.
49152 * Issue the request again with the next sequence number.
49153 */
49154 #define HWRM_DBG_COREDUMP_LIST_OUTPUT_FLAGS_MORE UINT32_C(0x1)
49155 uint8_t unused_0;
49156 /* Total number of segments to be returned. */
49157 uint16_t total_segments;
49158 /* Actual length of data returned in bytes. */
49159 uint16_t data_len;
49160 uint8_t unused_1;
49161 /*
49162 * This field is used in Output records to indicate that the output
49163 * is completely written to RAM. This field should be read as '1'
49164 * to indicate that the output has been completely written.
49165 * When writing a command completion or response to an internal processor,
49166 * the order of writes has to be such that this field is written last.
49167 */
49168 uint8_t valid;
49169 } hwrm_dbg_coredump_list_output_t, *phwrm_dbg_coredump_list_output_t;
49170
49171 /******************************
49172 * hwrm_dbg_coredump_initiate *
49173 ******************************/
49174
49175
49176 /* hwrm_dbg_coredump_initiate_input (size:256b/32B) */
49177
49178 typedef struct hwrm_dbg_coredump_initiate_input {
49179 /* The HWRM command request type. */
49180 uint16_t req_type;
49181 /*
49182 * The completion ring to send the completion event on. This should
49183 * be the NQ ID returned from the `nq_alloc` HWRM command.
49184 */
49185 uint16_t cmpl_ring;
49186 /*
49187 * The sequence ID is used by the driver for tracking multiple
49188 * commands. This ID is treated as opaque data by the firmware and
49189 * the value is returned in the `hwrm_resp_hdr` upon completion.
49190 */
49191 uint16_t seq_id;
49192 /*
49193 * The target ID of the command:
49194 * * 0x0-0xFFF8 - The function ID
49195 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49196 * * 0xFFFD - Reserved for user-space HWRM interface
49197 * * 0xFFFF - HWRM
49198 */
49199 uint16_t target_id;
49200 /*
49201 * A physical address pointer pointing to a host buffer that the
49202 * command's response data will be written. This can be either a host
49203 * physical address (HPA) or a guest physical address (GPA) and must
49204 * point to a physically contiguous block of memory.
49205 */
49206 uint64_t resp_addr;
49207 /* Component id of the returned component. */
49208 uint16_t component_id;
49209 /* Segment id of the returned component. */
49210 uint16_t segment_id;
49211 /* Not used. */
49212 uint16_t instance;
49213 /* Not used. */
49214 uint16_t unused_0;
49215 /*
49216 * bit 0: live data
49217 * bit 1: crashed data
49218 */
49219 uint8_t seg_flags;
49220 /* Not used. */
49221 uint8_t unused_1[7];
49222 } hwrm_dbg_coredump_initiate_input_t, *phwrm_dbg_coredump_initiate_input_t;
49223
49224 /* hwrm_dbg_coredump_initiate_output (size:128b/16B) */
49225
49226 typedef struct hwrm_dbg_coredump_initiate_output {
49227 /* The specific error status for the command. */
49228 uint16_t error_code;
49229 /* The HWRM command request type. */
49230 uint16_t req_type;
49231 /* The sequence ID from the original command. */
49232 uint16_t seq_id;
49233 /* The length of the response data in number of bytes. */
49234 uint16_t resp_len;
49235 uint8_t unused_0[7];
49236 /*
49237 * This field is used in Output records to indicate that the output
49238 * is completely written to RAM. This field should be read as '1'
49239 * to indicate that the output has been completely written.
49240 * When writing a command completion or response to an internal processor,
49241 * the order of writes has to be such that this field is written last.
49242 */
49243 uint8_t valid;
49244 } hwrm_dbg_coredump_initiate_output_t, *phwrm_dbg_coredump_initiate_output_t;
49245
49246 /* coredump_data_hdr (size:128b/16B) */
49247
49248 typedef struct coredump_data_hdr {
49249 /* Starting address of the register range. */
49250 uint32_t address;
49251 /*
49252 * length: 0 - 23 bits represents the actual data without the pad.
49253 * flags: 24 - 31 bits represents indirect register ranges.
49254 * - bit 24: Set if registers in this segment are indirect accessed.
49255 */
49256 uint32_t flags_length;
49257 /* These bits represents the actual length of the data segment */
49258 #define COREDUMP_DATA_HDR_FLAGS_LENGTH_ACTUAL_LEN_MASK UINT32_C(0xffffff)
49259 #define COREDUMP_DATA_HDR_FLAGS_LENGTH_ACTUAL_LEN_SFT 0
49260 /* Set if registers in this segment are indirect accessed. */
49261 #define COREDUMP_DATA_HDR_FLAGS_LENGTH_INDIRECT_ACCESS UINT32_C(0x1000000)
49262 /* Value in the partner register for indirect or multi-field registers. */
49263 uint32_t instance;
49264 /* Starting address of the next register after the current data range */
49265 uint32_t next_offset;
49266 } coredump_data_hdr_t, *pcoredump_data_hdr_t;
49267
49268 /******************************
49269 * hwrm_dbg_coredump_retrieve *
49270 ******************************/
49271
49272
49273 /* hwrm_dbg_coredump_retrieve_input (size:448b/56B) */
49274
49275 typedef struct hwrm_dbg_coredump_retrieve_input {
49276 /* The HWRM command request type. */
49277 uint16_t req_type;
49278 /*
49279 * The completion ring to send the completion event on. This should
49280 * be the NQ ID returned from the `nq_alloc` HWRM command.
49281 */
49282 uint16_t cmpl_ring;
49283 /*
49284 * The sequence ID is used by the driver for tracking multiple
49285 * commands. This ID is treated as opaque data by the firmware and
49286 * the value is returned in the `hwrm_resp_hdr` upon completion.
49287 */
49288 uint16_t seq_id;
49289 /*
49290 * The target ID of the command:
49291 * * 0x0-0xFFF8 - The function ID
49292 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49293 * * 0xFFFD - Reserved for user-space HWRM interface
49294 * * 0xFFFF - HWRM
49295 */
49296 uint16_t target_id;
49297 /*
49298 * A physical address pointer pointing to a host buffer that the
49299 * command's response data will be written. This can be either a host
49300 * physical address (HPA) or a guest physical address (GPA) and must
49301 * point to a physically contiguous block of memory.
49302 */
49303 uint64_t resp_addr;
49304 /*
49305 * host address where the data content will be written
49306 * when the request is complete. This area must be 16B aligned.
49307 */
49308 uint64_t host_dest_addr;
49309 /* Length of host buffer used for transferring debug data. */
49310 uint32_t host_buf_len;
49311 /* Not used. */
49312 uint32_t unused_0;
49313 /* Component id of the returned component. */
49314 uint16_t component_id;
49315 /* Segment id of the returned component. */
49316 uint16_t segment_id;
49317 /* Not used. */
49318 uint16_t instance;
49319 /* Not used. */
49320 uint16_t unused_1;
49321 /*
49322 * bit 0: live data
49323 * bit 1: crashed data
49324 */
49325 uint8_t seg_flags;
49326 uint8_t unused_2;
49327 uint16_t unused_3;
49328 /* Not used. */
49329 uint32_t unused_4;
49330 /* Sequence number is used per segment request. Starts at 0. */
49331 uint32_t seq_no;
49332 uint32_t unused_5;
49333 } hwrm_dbg_coredump_retrieve_input_t, *phwrm_dbg_coredump_retrieve_input_t;
49334
49335 /* hwrm_dbg_coredump_retrieve_output (size:128b/16B) */
49336
49337 typedef struct hwrm_dbg_coredump_retrieve_output {
49338 /* The specific error status for the command. */
49339 uint16_t error_code;
49340 /* The HWRM command request type. */
49341 uint16_t req_type;
49342 /* The sequence ID from the original command. */
49343 uint16_t seq_id;
49344 /* The length of the response data in number of bytes. */
49345 uint16_t resp_len;
49346 uint8_t flags;
49347 /*
49348 * Value of 1 means that there is more data available.
49349 * Issue the request again with the next sequence number.
49350 */
49351 #define HWRM_DBG_COREDUMP_RETRIEVE_OUTPUT_FLAGS_MORE UINT32_C(0x1)
49352 uint8_t unused_0;
49353 /* Actual length of data returned in bytes. */
49354 uint16_t data_len;
49355 uint8_t unused_1[3];
49356 /*
49357 * This field is used in Output records to indicate that the output
49358 * is completely written to RAM. This field should be read as '1'
49359 * to indicate that the output has been completely written.
49360 * When writing a command completion or response to an internal processor,
49361 * the order of writes has to be such that this field is written last.
49362 */
49363 uint8_t valid;
49364 } hwrm_dbg_coredump_retrieve_output_t, *phwrm_dbg_coredump_retrieve_output_t;
49365
49366 /*******************
49367 * hwrm_dbg_fw_cli *
49368 *******************/
49369
49370
49371 /* hwrm_dbg_fw_cli_input (size:1024b/128B) */
49372
49373 typedef struct hwrm_dbg_fw_cli_input {
49374 /* The HWRM command request type. */
49375 uint16_t req_type;
49376 /*
49377 * The completion ring to send the completion event on. This should
49378 * be the NQ ID returned from the `nq_alloc` HWRM command.
49379 */
49380 uint16_t cmpl_ring;
49381 /*
49382 * The sequence ID is used by the driver for tracking multiple
49383 * commands. This ID is treated as opaque data by the firmware and
49384 * the value is returned in the `hwrm_resp_hdr` upon completion.
49385 */
49386 uint16_t seq_id;
49387 /*
49388 * The target ID of the command:
49389 * * 0x0-0xFFF8 - The function ID
49390 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49391 * * 0xFFFD - Reserved for user-space HWRM interface
49392 * * 0xFFFF - HWRM
49393 */
49394 uint16_t target_id;
49395 /*
49396 * A physical address pointer pointing to a host buffer that the
49397 * command's response data will be written. This can be either a host
49398 * physical address (HPA) or a guest physical address (GPA) and must
49399 * point to a physically contiguous block of memory.
49400 */
49401 uint64_t resp_addr;
49402 /*
49403 * Address of the host buffer where debug CLI data
49404 * is requested to be dumped.
49405 */
49406 uint64_t host_dest_addr;
49407 /* Length of host buffer used for transferring debug data. */
49408 uint32_t host_buf_len;
49409 /* Length of CLI command. */
49410 uint16_t cli_cmd_len;
49411 uint8_t unused_0[2];
49412 /* CLI command string, a single ASCII encoded null terminated string. */
49413 uint8_t cli_cmd[96];
49414 } hwrm_dbg_fw_cli_input_t, *phwrm_dbg_fw_cli_input_t;
49415
49416 /* hwrm_dbg_fw_cli_output (size:128b/16B) */
49417
49418 typedef struct hwrm_dbg_fw_cli_output {
49419 /* The specific error status for the command. */
49420 uint16_t error_code;
49421 /* The HWRM command request type. */
49422 uint16_t req_type;
49423 /* The sequence ID from the original command. */
49424 uint16_t seq_id;
49425 /* The length of the response data in number of bytes. */
49426 uint16_t resp_len;
49427 /* Size of debug CLI data returned in bytes. */
49428 uint32_t cli_data_len;
49429 uint8_t unused_0[3];
49430 /*
49431 * This field is used in Output records to indicate that the output
49432 * is completely written to RAM. This field should be read as '1'
49433 * to indicate that the output has been completely written.
49434 * When writing a command completion or response to an internal processor,
49435 * the order of writes has to be such that this field is written last.
49436 */
49437 uint8_t valid;
49438 } hwrm_dbg_fw_cli_output_t, *phwrm_dbg_fw_cli_output_t;
49439
49440 /**************************
49441 * hwrm_dbg_ring_info_get *
49442 **************************/
49443
49444
49445 /* hwrm_dbg_ring_info_get_input (size:192b/24B) */
49446
49447 typedef struct hwrm_dbg_ring_info_get_input {
49448 /* The HWRM command request type. */
49449 uint16_t req_type;
49450 /*
49451 * The completion ring to send the completion event on. This should
49452 * be the NQ ID returned from the `nq_alloc` HWRM command.
49453 */
49454 uint16_t cmpl_ring;
49455 /*
49456 * The sequence ID is used by the driver for tracking multiple
49457 * commands. This ID is treated as opaque data by the firmware and
49458 * the value is returned in the `hwrm_resp_hdr` upon completion.
49459 */
49460 uint16_t seq_id;
49461 /*
49462 * The target ID of the command:
49463 * * 0x0-0xFFF8 - The function ID
49464 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49465 * * 0xFFFD - Reserved for user-space HWRM interface
49466 * * 0xFFFF - HWRM
49467 */
49468 uint16_t target_id;
49469 /*
49470 * A physical address pointer pointing to a host buffer that the
49471 * command's response data will be written. This can be either a host
49472 * physical address (HPA) or a guest physical address (GPA) and must
49473 * point to a physically contiguous block of memory.
49474 */
49475 uint64_t resp_addr;
49476 /* Ring Type. */
49477 uint8_t ring_type;
49478 /* L2 Completion Ring (CR) */
49479 #define HWRM_DBG_RING_INFO_GET_INPUT_RING_TYPE_L2_CMPL UINT32_C(0x0)
49480 /* TX Ring (TR) */
49481 #define HWRM_DBG_RING_INFO_GET_INPUT_RING_TYPE_TX UINT32_C(0x1)
49482 /* RX Ring (RR) */
49483 #define HWRM_DBG_RING_INFO_GET_INPUT_RING_TYPE_RX UINT32_C(0x2)
49484 /* Notification Queue (NQ) */
49485 #define HWRM_DBG_RING_INFO_GET_INPUT_RING_TYPE_NQ UINT32_C(0x3)
49486 #define HWRM_DBG_RING_INFO_GET_INPUT_RING_TYPE_LAST HWRM_DBG_RING_INFO_GET_INPUT_RING_TYPE_NQ
49487 uint8_t unused_0[3];
49488 /* Firmware ring ID associated with ring being queried. */
49489 uint32_t fw_ring_id;
49490 } hwrm_dbg_ring_info_get_input_t, *phwrm_dbg_ring_info_get_input_t;
49491
49492 /* hwrm_dbg_ring_info_get_output (size:192b/24B) */
49493
49494 typedef struct hwrm_dbg_ring_info_get_output {
49495 /* The specific error status for the command. */
49496 uint16_t error_code;
49497 /* The HWRM command request type. */
49498 uint16_t req_type;
49499 /* The sequence ID from the original command. */
49500 uint16_t seq_id;
49501 /* The length of the response data in number of bytes. */
49502 uint16_t resp_len;
49503 /* Producer index for the queried ring. */
49504 uint32_t producer_index;
49505 /* Consumer index for the queried ring. */
49506 uint32_t consumer_index;
49507 /*
49508 * CAG Vector Control for the queried NQ ring.
49509 * Not valid for other ring types.
49510 */
49511 uint32_t cag_vector_ctrl;
49512 uint8_t unused_0[3];
49513 /*
49514 * This field is used in Output records to indicate that the output
49515 * is completely written to RAM. This field should be read as '1'
49516 * to indicate that the output has been completely written.
49517 * When writing a command completion or response to an internal processor,
49518 * the order of writes has to be such that this field is written last.
49519 */
49520 uint8_t valid;
49521 } hwrm_dbg_ring_info_get_output_t, *phwrm_dbg_ring_info_get_output_t;
49522
49523 /**********************
49524 * hwrm_dbg_drv_trace *
49525 **********************/
49526
49527
49528 /* hwrm_dbg_drv_trace_input (size:1024b/128B) */
49529
49530 typedef struct hwrm_dbg_drv_trace_input {
49531 /* The HWRM command request type. */
49532 uint16_t req_type;
49533 /*
49534 * The completion ring to send the completion event on. This should
49535 * be the NQ ID returned from the `nq_alloc` HWRM command.
49536 */
49537 uint16_t cmpl_ring;
49538 /*
49539 * The sequence ID is used by the driver for tracking multiple
49540 * commands. This ID is treated as opaque data by the firmware and
49541 * the value is returned in the `hwrm_resp_hdr` upon completion.
49542 */
49543 uint16_t seq_id;
49544 /*
49545 * The target ID of the command:
49546 * * 0x0-0xFFF8 - The function ID
49547 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49548 * * 0xFFFD - Reserved for user-space HWRM interface
49549 * * 0xFFFF - HWRM
49550 */
49551 uint16_t target_id;
49552 /*
49553 * A physical address pointer pointing to a host buffer that the
49554 * command's response data will be written. This can be either a host
49555 * physical address (HPA) or a guest physical address (GPA) and must
49556 * point to a physically contiguous block of memory.
49557 */
49558 uint64_t resp_addr;
49559 /* Severity of the messege. */
49560 uint8_t severity;
49561 /* Fatal */
49562 #define HWRM_DBG_DRV_TRACE_INPUT_SEVERITY_TRACE_LEVEL_FATAL UINT32_C(0x0)
49563 /* Error */
49564 #define HWRM_DBG_DRV_TRACE_INPUT_SEVERITY_TRACE_LEVEL_ERROR UINT32_C(0x1)
49565 /* Warning */
49566 #define HWRM_DBG_DRV_TRACE_INPUT_SEVERITY_TRACE_LEVEL_WARNING UINT32_C(0x2)
49567 /* Info */
49568 #define HWRM_DBG_DRV_TRACE_INPUT_SEVERITY_TRACE_LEVEL_INFO UINT32_C(0x3)
49569 /* Debug */
49570 #define HWRM_DBG_DRV_TRACE_INPUT_SEVERITY_TRACE_LEVEL_DEBUG UINT32_C(0x4)
49571 #define HWRM_DBG_DRV_TRACE_INPUT_SEVERITY_LAST HWRM_DBG_DRV_TRACE_INPUT_SEVERITY_TRACE_LEVEL_DEBUG
49572 /* Number of bytes to write including terminating 'NULL' if any. */
49573 uint8_t write_len;
49574 uint8_t unused_0[6];
49575 /*
49576 * This field reprsents the debug data sent by driver
49577 * ASCII chars, 'NULL' termination not required.
49578 */
49579 char trace_data[104];
49580 } hwrm_dbg_drv_trace_input_t, *phwrm_dbg_drv_trace_input_t;
49581
49582 /* hwrm_dbg_drv_trace_output (size:128b/16B) */
49583
49584 typedef struct hwrm_dbg_drv_trace_output {
49585 /* The specific error status for the command. */
49586 uint16_t error_code;
49587 /* The HWRM command request type. */
49588 uint16_t req_type;
49589 /* The sequence ID from the original command. */
49590 uint16_t seq_id;
49591 /* The length of the response data in number of bytes. */
49592 uint16_t resp_len;
49593 uint8_t unused_0[7];
49594 /*
49595 * This field is used in Output records to indicate that the output
49596 * is completely written to RAM. This field should be read as '1'
49597 * to indicate that the output has been completely written.
49598 * When writing a command completion or response to an internal processor,
49599 * the order of writes has to be such that this field is written last.
49600 */
49601 uint8_t valid;
49602 } hwrm_dbg_drv_trace_output_t, *phwrm_dbg_drv_trace_output_t;
49603
49604 /***********************
49605 * hwrm_dbg_useq_alloc *
49606 ***********************/
49607
49608
49609 /* hwrm_dbg_useq_alloc_input (size:192b/24B) */
49610
49611 typedef struct hwrm_dbg_useq_alloc_input {
49612 /* The HWRM command request type. */
49613 uint16_t req_type;
49614 /*
49615 * The completion ring to send the completion event on. This should
49616 * be the NQ ID returned from the `nq_alloc` HWRM command.
49617 */
49618 uint16_t cmpl_ring;
49619 /*
49620 * The sequence ID is used by the driver for tracking multiple
49621 * commands. This ID is treated as opaque data by the firmware and
49622 * the value is returned in the `hwrm_resp_hdr` upon completion.
49623 */
49624 uint16_t seq_id;
49625 /*
49626 * The target ID of the command:
49627 * * 0x0-0xFFF8 - The function ID
49628 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49629 * * 0xFFFD - Reserved for user-space HWRM interface
49630 * * 0xFFFF - HWRM
49631 */
49632 uint16_t target_id;
49633 /*
49634 * A physical address pointer pointing to a host buffer that the
49635 * command's response data will be written. This can be either a host
49636 * physical address (HPA) or a guest physical address (GPA) and must
49637 * point to a physically contiguous block of memory.
49638 */
49639 uint64_t resp_addr;
49640 /* Number size of the allocation, in bytes, for the USEQ in the code words array */
49641 uint32_t size;
49642 /* Number of bytes executing the USEQ will produce. Must be a multiple of 4 */
49643 uint16_t output_bytes;
49644 /* This field is reserved */
49645 uint16_t unused_0;
49646 } hwrm_dbg_useq_alloc_input_t, *phwrm_dbg_useq_alloc_input_t;
49647
49648 /* hwrm_dbg_useq_alloc_output (size:256b/32B) */
49649
49650 typedef struct hwrm_dbg_useq_alloc_output {
49651 /* The specific error status for the command. */
49652 uint16_t error_code;
49653 /* The HWRM command request type. */
49654 uint16_t req_type;
49655 /* The sequence ID from the original command. */
49656 uint16_t seq_id;
49657 /* The length of the response data in number of bytes. */
49658 uint16_t resp_len;
49659 /* Non-zero firmware timestamp */
49660 uint32_t nz_fw_timestamp;
49661 /* The last selected USID */
49662 uint16_t last_usid;
49663 /* The number of USEQs currently allocated */
49664 uint16_t num_useq_allocd;
49665 /* A non-zero value indicates data is available for delivery */
49666 uint8_t avail;
49667 /* Current count of the number of full buffers available for delivery */
49668 uint8_t full_cnt;
49669 /* Reserved */
49670 uint16_t durh_unused_0;
49671 /* A non-zero value indicates that all internal buffers are full */
49672 uint8_t overflow;
49673 /* Reserved */
49674 uint8_t durh_unused_1[3];
49675 /* This field is reserved */
49676 uint32_t unused_0;
49677 /*
49678 * This field is used in Output records to indicate that the output
49679 * is completely written to RAM. This field should be read as '1'
49680 * to indicate that the output has been completely written.
49681 * When writing a command completion or response to an internal processor,
49682 * the order of writes has to be such that this field is written last.
49683 */
49684 uint32_t valid;
49685 } hwrm_dbg_useq_alloc_output_t, *phwrm_dbg_useq_alloc_output_t;
49686
49687 /**********************
49688 * hwrm_dbg_useq_free *
49689 **********************/
49690
49691
49692 /* hwrm_dbg_useq_free_input (size:192b/24B) */
49693
49694 typedef struct hwrm_dbg_useq_free_input {
49695 /* The HWRM command request type. */
49696 uint16_t req_type;
49697 /*
49698 * The completion ring to send the completion event on. This should
49699 * be the NQ ID returned from the `nq_alloc` HWRM command.
49700 */
49701 uint16_t cmpl_ring;
49702 /*
49703 * The sequence ID is used by the driver for tracking multiple
49704 * commands. This ID is treated as opaque data by the firmware and
49705 * the value is returned in the `hwrm_resp_hdr` upon completion.
49706 */
49707 uint16_t seq_id;
49708 /*
49709 * The target ID of the command:
49710 * * 0x0-0xFFF8 - The function ID
49711 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49712 * * 0xFFFD - Reserved for user-space HWRM interface
49713 * * 0xFFFF - HWRM
49714 */
49715 uint16_t target_id;
49716 /*
49717 * A physical address pointer pointing to a host buffer that the
49718 * command's response data will be written. This can be either a host
49719 * physical address (HPA) or a guest physical address (GPA) and must
49720 * point to a physically contiguous block of memory.
49721 */
49722 uint64_t resp_addr;
49723 /* The USID of the sequence to free */
49724 uint16_t usid;
49725 /* This field is reserved */
49726 uint8_t unused_0[6];
49727 } hwrm_dbg_useq_free_input_t, *phwrm_dbg_useq_free_input_t;
49728
49729 /* hwrm_dbg_useq_free_output (size:256b/32B) */
49730
49731 typedef struct hwrm_dbg_useq_free_output {
49732 /* The specific error status for the command. */
49733 uint16_t error_code;
49734 /* The HWRM command request type. */
49735 uint16_t req_type;
49736 /* The sequence ID from the original command. */
49737 uint16_t seq_id;
49738 /* The length of the response data in number of bytes. */
49739 uint16_t resp_len;
49740 /* Non-zero firmware timestamp */
49741 uint32_t nz_fw_timestamp;
49742 /* The last selected USID */
49743 uint16_t last_usid;
49744 /* The number of USEQs currently allocated */
49745 uint16_t num_useq_allocd;
49746 /* A non-zero value indicates data is available for delivery */
49747 uint8_t avail;
49748 /* Current count of the number of full buffers available for delivery */
49749 uint8_t full_cnt;
49750 /* Reserved */
49751 uint16_t durh_unused_0;
49752 /* A non-zero value indicates that all internal buffers are full */
49753 uint8_t overflow;
49754 /* Reserved */
49755 uint8_t durh_unused_1[3];
49756 /* This field is reserved */
49757 uint32_t unused_0;
49758 /*
49759 * This field is used in Output records to indicate that the output
49760 * is completely written to RAM. This field should be read as '1'
49761 * to indicate that the output has been completely written.
49762 * When writing a command completion or response to an internal processor,
49763 * the order of writes has to be such that this field is written last.
49764 */
49765 uint32_t valid;
49766 } hwrm_dbg_useq_free_output_t, *phwrm_dbg_useq_free_output_t;
49767
49768 /***********************
49769 * hwrm_dbg_useq_flush *
49770 ***********************/
49771
49772
49773 /* hwrm_dbg_useq_flush_input (size:192b/24B) */
49774
49775 typedef struct hwrm_dbg_useq_flush_input {
49776 /* The HWRM command request type. */
49777 uint16_t req_type;
49778 /*
49779 * The completion ring to send the completion event on. This should
49780 * be the NQ ID returned from the `nq_alloc` HWRM command.
49781 */
49782 uint16_t cmpl_ring;
49783 /*
49784 * The sequence ID is used by the driver for tracking multiple
49785 * commands. This ID is treated as opaque data by the firmware and
49786 * the value is returned in the `hwrm_resp_hdr` upon completion.
49787 */
49788 uint16_t seq_id;
49789 /*
49790 * The target ID of the command:
49791 * * 0x0-0xFFF8 - The function ID
49792 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49793 * * 0xFFFD - Reserved for user-space HWRM interface
49794 * * 0xFFFF - HWRM
49795 */
49796 uint16_t target_id;
49797 /*
49798 * A physical address pointer pointing to a host buffer that the
49799 * command's response data will be written. This can be either a host
49800 * physical address (HPA) or a guest physical address (GPA) and must
49801 * point to a physically contiguous block of memory.
49802 */
49803 uint64_t resp_addr;
49804 /* Bitwise flags described below */
49805 uint16_t flags;
49806 /* Flush all USEQ code words, resetting all USIDs to invalid */
49807 #define HWRM_DBG_USEQ_FLUSH_INPUT_USEQ_CODE_WORDS UINT32_C(0x1)
49808 /* Initialize all buffers, clearing out any collected data */
49809 #define HWRM_DBG_USEQ_FLUSH_INPUT_BUFFERS UINT32_C(0x2)
49810 #define HWRM_DBG_USEQ_FLUSH_INPUT_LAST HWRM_DBG_USEQ_FLUSH_INPUT_BUFFERS
49811 /* This field is reserved */
49812 uint8_t unused_0[6];
49813 } hwrm_dbg_useq_flush_input_t, *phwrm_dbg_useq_flush_input_t;
49814
49815 /* hwrm_dbg_useq_flush_output (size:256b/32B) */
49816
49817 typedef struct hwrm_dbg_useq_flush_output {
49818 /* The specific error status for the command. */
49819 uint16_t error_code;
49820 /* The HWRM command request type. */
49821 uint16_t req_type;
49822 /* The sequence ID from the original command. */
49823 uint16_t seq_id;
49824 /* The length of the response data in number of bytes. */
49825 uint16_t resp_len;
49826 /* Non-zero firmware timestamp */
49827 uint32_t nz_fw_timestamp;
49828 /* The last selected USID */
49829 uint16_t last_usid;
49830 /* The number of USEQs currently allocated */
49831 uint16_t num_useq_allocd;
49832 /* A non-zero value indicates data is available for delivery */
49833 uint8_t avail;
49834 /* Current count of the number of full buffers available for delivery */
49835 uint8_t full_cnt;
49836 /* Reserved */
49837 uint16_t durh_unused_0;
49838 /* A non-zero value indicates that all internal buffers are full */
49839 uint8_t overflow;
49840 /* Reserved */
49841 uint8_t durh_unused_1[3];
49842 /* This field is reserved */
49843 uint32_t unused_0;
49844 /*
49845 * This field is used in Output records to indicate that the output
49846 * is completely written to RAM. This field should be read as '1'
49847 * to indicate that the output has been completely written.
49848 * When writing a command completion or response to an internal processor,
49849 * the order of writes has to be such that this field is written last.
49850 */
49851 uint32_t valid;
49852 } hwrm_dbg_useq_flush_output_t, *phwrm_dbg_useq_flush_output_t;
49853
49854 /***********************
49855 * hwrm_dbg_useq_qcaps *
49856 ***********************/
49857
49858
49859 /* hwrm_dbg_useq_qcaps_input (size:128b/16B) */
49860
49861 typedef struct hwrm_dbg_useq_qcaps_input {
49862 /* The HWRM command request type. */
49863 uint16_t req_type;
49864 /*
49865 * The completion ring to send the completion event on. This should
49866 * be the NQ ID returned from the `nq_alloc` HWRM command.
49867 */
49868 uint16_t cmpl_ring;
49869 /*
49870 * The sequence ID is used by the driver for tracking multiple
49871 * commands. This ID is treated as opaque data by the firmware and
49872 * the value is returned in the `hwrm_resp_hdr` upon completion.
49873 */
49874 uint16_t seq_id;
49875 /*
49876 * The target ID of the command:
49877 * * 0x0-0xFFF8 - The function ID
49878 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49879 * * 0xFFFD - Reserved for user-space HWRM interface
49880 * * 0xFFFF - HWRM
49881 */
49882 uint16_t target_id;
49883 /*
49884 * A physical address pointer pointing to a host buffer that the
49885 * command's response data will be written. This can be either a host
49886 * physical address (HPA) or a guest physical address (GPA) and must
49887 * point to a physically contiguous block of memory.
49888 */
49889 uint64_t resp_addr;
49890 } hwrm_dbg_useq_qcaps_input_t, *phwrm_dbg_useq_qcaps_input_t;
49891
49892 /* hwrm_dbg_useq_qcaps_output (size:384b/48B) */
49893
49894 typedef struct hwrm_dbg_useq_qcaps_output {
49895 /* The specific error status for the command. */
49896 uint16_t error_code;
49897 /* The HWRM command request type. */
49898 uint16_t req_type;
49899 /* The sequence ID from the original command. */
49900 uint16_t seq_id;
49901 /* The length of the response data in number of bytes. */
49902 uint16_t resp_len;
49903 /* Non-zero firmware timestamp */
49904 uint32_t nz_fw_timestamp;
49905 /* The last selected USID */
49906 uint16_t last_usid;
49907 /* The number of USEQs currently allocated */
49908 uint16_t num_useq_allocd;
49909 /* A non-zero value indicates data is available for delivery */
49910 uint8_t avail;
49911 /* Current count of the number of full buffers available for delivery */
49912 uint8_t full_cnt;
49913 /* Reserved */
49914 uint16_t durh_unused_0;
49915 /* A non-zero value indicates that all internal buffers are full */
49916 uint8_t overflow;
49917 /* Reserved */
49918 uint8_t durh_unused_1[3];
49919 /* Maximum number of USEQ that can be tracked by firmware */
49920 uint32_t max_num_useq;
49921 /* Maximum number of code words for a single USEQ */
49922 uint32_t max_useq_len;
49923 /* The maximum number of 32-bit words a single USEQ may generate */
49924 uint32_t max_useq_32b_output_words;
49925 /* The number of internal USEQ output buffers, each of 4096 bytes */
49926 uint32_t num_buf;
49927 /* This field is reserved */
49928 uint32_t unused_0;
49929 /*
49930 * This field is used in Output records to indicate that the output
49931 * is completely written to RAM. This field should be read as '1'
49932 * to indicate that the output has been completely written.
49933 * When writing a command completion or response to an internal processor,
49934 * the order of writes has to be such that this field is written last.
49935 */
49936 uint32_t valid;
49937 } hwrm_dbg_useq_qcaps_output_t, *phwrm_dbg_useq_qcaps_output_t;
49938
49939 /***************************
49940 * hwrm_dbg_useq_sched_cfg *
49941 ***************************/
49942
49943
49944 /* hwrm_dbg_useq_sched_cfg_input (size:192b/24B) */
49945
49946 typedef struct hwrm_dbg_useq_sched_cfg_input {
49947 /* The HWRM command request type. */
49948 uint16_t req_type;
49949 /*
49950 * The completion ring to send the completion event on. This should
49951 * be the NQ ID returned from the `nq_alloc` HWRM command.
49952 */
49953 uint16_t cmpl_ring;
49954 /*
49955 * The sequence ID is used by the driver for tracking multiple
49956 * commands. This ID is treated as opaque data by the firmware and
49957 * the value is returned in the `hwrm_resp_hdr` upon completion.
49958 */
49959 uint16_t seq_id;
49960 /*
49961 * The target ID of the command:
49962 * * 0x0-0xFFF8 - The function ID
49963 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49964 * * 0xFFFD - Reserved for user-space HWRM interface
49965 * * 0xFFFF - HWRM
49966 */
49967 uint16_t target_id;
49968 /*
49969 * A physical address pointer pointing to a host buffer that the
49970 * command's response data will be written. This can be either a host
49971 * physical address (HPA) or a guest physical address (GPA) and must
49972 * point to a physically contiguous block of memory.
49973 */
49974 uint64_t resp_addr;
49975 /* Enumeration values for enabling, disabling scheduler */
49976 uint16_t global_cfg;
49977 /* This value will leave the global scheduler in its current state */
49978 #define HWRM_DBG_USEQ_SCHED_CFG_INPUT_NO_CHANGE UINT32_C(0x0)
49979 /*
49980 * This value disables the global scheduler. This mode must be used
49981 * when the RUN command is being used to run individual sequences.
49982 */
49983 #define HWRM_DBG_USEQ_SCHED_CFG_INPUT_DISABLE UINT32_C(0x1)
49984 /*
49985 * This value enables the global scheduler. When enabled, USEQs will
49986 * be scheduled based on their polling intervals
49987 */
49988 #define HWRM_DBG_USEQ_SCHED_CFG_INPUT_ENABLE UINT32_C(0x2)
49989 #define HWRM_DBG_USEQ_SCHED_CFG_INPUT_LAST HWRM_DBG_USEQ_SCHED_CFG_INPUT_ENABLE
49990 /*
49991 * The given polling interval will be associated with this USID. A value
49992 * of -1 indicates that the USID is invalid. The invalid USID is used when
49993 * using this message only for global scheduler configuration.
49994 */
49995 uint16_t usid;
49996 /* This value represents microseconds between runs of the USEQ */
49997 uint32_t polling_interval;
49998 } hwrm_dbg_useq_sched_cfg_input_t, *phwrm_dbg_useq_sched_cfg_input_t;
49999
50000 /* hwrm_dbg_useq_sched_cfg_output (size:256b/32B) */
50001
50002 typedef struct hwrm_dbg_useq_sched_cfg_output {
50003 /* The specific error status for the command. */
50004 uint16_t error_code;
50005 /* The HWRM command request type. */
50006 uint16_t req_type;
50007 /* The sequence ID from the original command. */
50008 uint16_t seq_id;
50009 /* The length of the response data in number of bytes. */
50010 uint16_t resp_len;
50011 /* Non-zero firmware timestamp */
50012 uint32_t nz_fw_timestamp;
50013 /* The last selected USID */
50014 uint16_t last_usid;
50015 /* The number of USEQs currently allocated */
50016 uint16_t num_useq_allocd;
50017 /* A non-zero value indicates data is available for delivery */
50018 uint8_t avail;
50019 /* Current count of the number of full buffers available for delivery */
50020 uint8_t full_cnt;
50021 /* Reserved */
50022 uint16_t durh_unused_0;
50023 /* A non-zero value indicates that all internal buffers are full */
50024 uint8_t overflow;
50025 /* Reserved */
50026 uint8_t durh_unused_1[3];
50027 /* This field is reserved */
50028 uint32_t unused_0;
50029 /*
50030 * This field is used in Output records to indicate that the output
50031 * is completely written to RAM. This field should be read as '1'
50032 * to indicate that the output has been completely written.
50033 * When writing a command completion or response to an internal processor,
50034 * the order of writes has to be such that this field is written last.
50035 */
50036 uint32_t valid;
50037 } hwrm_dbg_useq_sched_cfg_output_t, *phwrm_dbg_useq_sched_cfg_output_t;
50038
50039 /*********************
50040 * hwrm_dbg_useq_run *
50041 *********************/
50042
50043
50044 /* hwrm_dbg_useq_run_input (size:320b/40B) */
50045
50046 typedef struct hwrm_dbg_useq_run_input {
50047 /* The HWRM command request type. */
50048 uint16_t req_type;
50049 /*
50050 * The completion ring to send the completion event on. This should
50051 * be the NQ ID returned from the `nq_alloc` HWRM command.
50052 */
50053 uint16_t cmpl_ring;
50054 /*
50055 * The sequence ID is used by the driver for tracking multiple
50056 * commands. This ID is treated as opaque data by the firmware and
50057 * the value is returned in the `hwrm_resp_hdr` upon completion.
50058 */
50059 uint16_t seq_id;
50060 /*
50061 * The target ID of the command:
50062 * * 0x0-0xFFF8 - The function ID
50063 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50064 * * 0xFFFD - Reserved for user-space HWRM interface
50065 * * 0xFFFF - HWRM
50066 */
50067 uint16_t target_id;
50068 /*
50069 * A physical address pointer pointing to a host buffer that the
50070 * command's response data will be written. This can be either a host
50071 * physical address (HPA) or a guest physical address (GPA) and must
50072 * point to a physically contiguous block of memory.
50073 */
50074 uint64_t resp_addr;
50075 /* The USID to be run */
50076 uint16_t usid;
50077 /* Type of run to execute for the given USID */
50078 uint8_t run_type;
50079 /* This run type will execute the requested USEQ only a single time */
50080 #define HWRM_DBG_USEQ_RUN_INPUT_RUN_TYPE_SINGLE UINT32_C(0x0)
50081 /*
50082 * This run type will execute the requested USEQ a number of times given
50083 * by run_cnt with a run interval given by the run_interval parameter.
50084 */
50085 #define HWRM_DBG_USEQ_RUN_INPUT_RUN_TYPE_CNT UINT32_C(0x1)
50086 /*
50087 * This run type will execute the requested USEQ as many times as it needs
50088 * to fill an entire buffer to return to the host. The runs will occur
50089 * with a run interval given by the run_interval parameter.
50090 */
50091 #define HWRM_DBG_USEQ_RUN_INPUT_RUN_TYPE_FILL_BUF UINT32_C(0x2)
50092 #define HWRM_DBG_USEQ_RUN_INPUT_RUN_TYPE_LAST HWRM_DBG_USEQ_RUN_INPUT_RUN_TYPE_FILL_BUF
50093 /*
50094 * If indicated by flags, this represents the number of times to run the USEQ.
50095 * Note that runs are stopped if the buffer fills prior regardless of the
50096 * number of runs. For example, if a run_cnt of 10 is specified and 3 runs
50097 * results in the buffer being full then only 3 runs are executed.
50098 */
50099 uint8_t run_cnt;
50100 /*
50101 * This value represents microseconds between runs of the USEQ when running
50102 * multiple times as indicated by flags.
50103 */
50104 uint32_t run_interval;
50105 /* Address of the host buffer where collected USEQ output data will be placed */
50106 uint64_t host_dest_addr;
50107 /*
50108 * Size, in bytes, of the memory associated with host_dest_addr. It is expected
50109 * that this is >= 4096
50110 */
50111 uint32_t host_dest_len;
50112 /* This field is reserved */
50113 uint32_t unused_0;
50114 } hwrm_dbg_useq_run_input_t, *phwrm_dbg_useq_run_input_t;
50115
50116 /* hwrm_dbg_useq_run_output (size:256b/32B) */
50117
50118 typedef struct hwrm_dbg_useq_run_output {
50119 /* The specific error status for the command. */
50120 uint16_t error_code;
50121 /* The HWRM command request type. */
50122 uint16_t req_type;
50123 /* The sequence ID from the original command. */
50124 uint16_t seq_id;
50125 /* The length of the response data in number of bytes. */
50126 uint16_t resp_len;
50127 /* Non-zero firmware timestamp */
50128 uint32_t nz_fw_timestamp;
50129 /* The last selected USID */
50130 uint16_t last_usid;
50131 /* The number of USEQs currently allocated */
50132 uint16_t num_useq_allocd;
50133 /* A non-zero value indicates data is available for delivery */
50134 uint8_t avail;
50135 /* Current count of the number of full buffers available for delivery */
50136 uint8_t full_cnt;
50137 /* Reserved */
50138 uint16_t durh_unused_0;
50139 /* A non-zero value indicates that all internal buffers are full */
50140 uint8_t overflow;
50141 /* Reserved */
50142 uint8_t durh_unused_1[3];
50143 /*
50144 * The length, in bytes, of the amount of data placed in the corresponding
50145 * host_dest_addr given in the input message. This will always be a multiple
50146 * of 4096
50147 */
50148 uint32_t host_dest_filled_len;
50149 /*
50150 * This field is used in Output records to indicate that the output
50151 * is completely written to RAM. This field should be read as '1'
50152 * to indicate that the output has been completely written.
50153 * When writing a command completion or response to an internal processor,
50154 * the order of writes has to be such that this field is written last.
50155 */
50156 uint32_t valid;
50157 } hwrm_dbg_useq_run_output_t, *phwrm_dbg_useq_run_output_t;
50158
50159 /******************************
50160 * hwrm_dbg_useq_delivery_req *
50161 ******************************/
50162
50163
50164 /* hwrm_dbg_useq_delivery_req_input (size:896b/112B) */
50165
50166 typedef struct hwrm_dbg_useq_delivery_req_input {
50167 /* The HWRM command request type. */
50168 uint16_t req_type;
50169 /*
50170 * The completion ring to send the completion event on. This should
50171 * be the NQ ID returned from the `nq_alloc` HWRM command.
50172 */
50173 uint16_t cmpl_ring;
50174 /*
50175 * The sequence ID is used by the driver for tracking multiple
50176 * commands. This ID is treated as opaque data by the firmware and
50177 * the value is returned in the `hwrm_resp_hdr` upon completion.
50178 */
50179 uint16_t seq_id;
50180 /*
50181 * The target ID of the command:
50182 * * 0x0-0xFFF8 - The function ID
50183 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50184 * * 0xFFFD - Reserved for user-space HWRM interface
50185 * * 0xFFFF - HWRM
50186 */
50187 uint16_t target_id;
50188 /*
50189 * A physical address pointer pointing to a host buffer that the
50190 * command's response data will be written. This can be either a host
50191 * physical address (HPA) or a guest physical address (GPA) and must
50192 * point to a physically contiguous block of memory.
50193 */
50194 uint64_t resp_addr;
50195 /*
50196 * Eight destination addresses provide host memory space for FW to deliver
50197 * USEQ output details. A value of 0x0 for the address can be used to
50198 * inform FW that the buffer is not available.
50199 */
50200 uint64_t host_dest_addrs[8];
50201 /*
50202 * The length, in bytes, of the corresponding host_dest_addrs array entry. Each
50203 * valid hist_dest_addrs entry must have a len of at least 4096 bytes
50204 */
50205 uint32_t host_dest_len[8];
50206 } hwrm_dbg_useq_delivery_req_input_t, *phwrm_dbg_useq_delivery_req_input_t;
50207
50208 /* hwrm_dbg_useq_delivery_req_output (size:512b/64B) */
50209
50210 typedef struct hwrm_dbg_useq_delivery_req_output {
50211 /* The specific error status for the command. */
50212 uint16_t error_code;
50213 /* The HWRM command request type. */
50214 uint16_t req_type;
50215 /* The sequence ID from the original command. */
50216 uint16_t seq_id;
50217 /* The length of the response data in number of bytes. */
50218 uint16_t resp_len;
50219 /* Non-zero firmware timestamp */
50220 uint32_t nz_fw_timestamp;
50221 /* The last selected USID */
50222 uint16_t last_usid;
50223 /* The number of USEQs currently allocated */
50224 uint16_t num_useq_allocd;
50225 /* A non-zero value indicates data is available for delivery */
50226 uint8_t avail;
50227 /* Current count of the number of full buffers available for delivery */
50228 uint8_t full_cnt;
50229 /* Reserved */
50230 uint16_t durh_unused_0;
50231 /* A non-zero value indicates that all internal buffers are full */
50232 uint8_t overflow;
50233 /* Reserved */
50234 uint8_t durh_unused_1[3];
50235 /*
50236 * The length, in bytes, of the amount of data placed in the corresponding
50237 * host_dest_addrs entry given in the input message. This will always be a
50238 * multiple of 4096
50239 */
50240 uint32_t host_dest_filled_len[8];
50241 /* This field is reserved */
50242 uint32_t unused_0;
50243 /*
50244 * This field is used in Output records to indicate that the output
50245 * is completely written to RAM. This field should be read as '1'
50246 * to indicate that the output has been completely written.
50247 * When writing a command completion or response to an internal processor,
50248 * the order of writes has to be such that this field is written last.
50249 */
50250 uint32_t valid;
50251 } hwrm_dbg_useq_delivery_req_output_t, *phwrm_dbg_useq_delivery_req_output_t;
50252
50253 /**************************
50254 * hwrm_nvm_raw_write_blk *
50255 **************************/
50256
50257
50258 /* hwrm_nvm_raw_write_blk_input (size:256b/32B) */
50259
50260 typedef struct hwrm_nvm_raw_write_blk_input {
50261 /* The HWRM command request type. */
50262 uint16_t req_type;
50263 /*
50264 * The completion ring to send the completion event on. This should
50265 * be the NQ ID returned from the `nq_alloc` HWRM command.
50266 */
50267 uint16_t cmpl_ring;
50268 /*
50269 * The sequence ID is used by the driver for tracking multiple
50270 * commands. This ID is treated as opaque data by the firmware and
50271 * the value is returned in the `hwrm_resp_hdr` upon completion.
50272 */
50273 uint16_t seq_id;
50274 /*
50275 * The target ID of the command:
50276 * * 0x0-0xFFF8 - The function ID
50277 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50278 * * 0xFFFD - Reserved for user-space HWRM interface
50279 * * 0xFFFF - HWRM
50280 */
50281 uint16_t target_id;
50282 /*
50283 * A physical address pointer pointing to a host buffer that the
50284 * command's response data will be written. This can be either a host
50285 * physical address (HPA) or a guest physical address (GPA) and must
50286 * point to a physically contiguous block of memory.
50287 */
50288 uint64_t resp_addr;
50289 /*
50290 * 64-bit Host Source Address.
50291 * This is the location of the source data to be written.
50292 */
50293 uint64_t host_src_addr;
50294 /*
50295 * 32-bit Destination Address.
50296 * This is the NVRAM byte-offset where the source data will be written to.
50297 */
50298 uint32_t dest_addr;
50299 /* Length of data to be written, in bytes. */
50300 uint32_t len;
50301 } hwrm_nvm_raw_write_blk_input_t, *phwrm_nvm_raw_write_blk_input_t;
50302
50303 /* hwrm_nvm_raw_write_blk_output (size:128b/16B) */
50304
50305 typedef struct hwrm_nvm_raw_write_blk_output {
50306 /* The specific error status for the command. */
50307 uint16_t error_code;
50308 /* The HWRM command request type. */
50309 uint16_t req_type;
50310 /* The sequence ID from the original command. */
50311 uint16_t seq_id;
50312 /* The length of the response data in number of bytes. */
50313 uint16_t resp_len;
50314 uint8_t unused_0[7];
50315 /*
50316 * This field is used in Output records to indicate that the output
50317 * is completely written to RAM. This field should be read as '1'
50318 * to indicate that the output has been completely written.
50319 * When writing a command completion or response to an internal processor,
50320 * the order of writes has to be such that this field is written last.
50321 */
50322 uint8_t valid;
50323 } hwrm_nvm_raw_write_blk_output_t, *phwrm_nvm_raw_write_blk_output_t;
50324
50325 /*****************
50326 * hwrm_nvm_read *
50327 *****************/
50328
50329
50330 /* hwrm_nvm_read_input (size:320b/40B) */
50331
50332 typedef struct hwrm_nvm_read_input {
50333 /* The HWRM command request type. */
50334 uint16_t req_type;
50335 /*
50336 * The completion ring to send the completion event on. This should
50337 * be the NQ ID returned from the `nq_alloc` HWRM command.
50338 */
50339 uint16_t cmpl_ring;
50340 /*
50341 * The sequence ID is used by the driver for tracking multiple
50342 * commands. This ID is treated as opaque data by the firmware and
50343 * the value is returned in the `hwrm_resp_hdr` upon completion.
50344 */
50345 uint16_t seq_id;
50346 /*
50347 * The target ID of the command:
50348 * * 0x0-0xFFF8 - The function ID
50349 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50350 * * 0xFFFD - Reserved for user-space HWRM interface
50351 * * 0xFFFF - HWRM
50352 */
50353 uint16_t target_id;
50354 /*
50355 * A physical address pointer pointing to a host buffer that the
50356 * command's response data will be written. This can be either a host
50357 * physical address (HPA) or a guest physical address (GPA) and must
50358 * point to a physically contiguous block of memory.
50359 */
50360 uint64_t resp_addr;
50361 /*
50362 * 64-bit Host Destination Address.
50363 * This is the host address where the data will be written to.
50364 */
50365 uint64_t host_dest_addr;
50366 /* The 0-based index of the directory entry. */
50367 uint16_t dir_idx;
50368 uint8_t unused_0[2];
50369 /* The NVRAM byte-offset to read from. */
50370 uint32_t offset;
50371 /* The length of the data to be read, in bytes. */
50372 uint32_t len;
50373 uint8_t unused_1[4];
50374 } hwrm_nvm_read_input_t, *phwrm_nvm_read_input_t;
50375
50376 /* hwrm_nvm_read_output (size:128b/16B) */
50377
50378 typedef struct hwrm_nvm_read_output {
50379 /* The specific error status for the command. */
50380 uint16_t error_code;
50381 /* The HWRM command request type. */
50382 uint16_t req_type;
50383 /* The sequence ID from the original command. */
50384 uint16_t seq_id;
50385 /* The length of the response data in number of bytes. */
50386 uint16_t resp_len;
50387 uint8_t unused_0[7];
50388 /*
50389 * This field is used in Output records to indicate that the output
50390 * is completely written to RAM. This field should be read as '1'
50391 * to indicate that the output has been completely written.
50392 * When writing a command completion or response to an internal processor,
50393 * the order of writes has to be such that this field is written last.
50394 */
50395 uint8_t valid;
50396 } hwrm_nvm_read_output_t, *phwrm_nvm_read_output_t;
50397
50398 /*********************
50399 * hwrm_nvm_raw_dump *
50400 *********************/
50401
50402
50403 /* hwrm_nvm_raw_dump_input (size:256b/32B) */
50404
50405 typedef struct hwrm_nvm_raw_dump_input {
50406 /* The HWRM command request type. */
50407 uint16_t req_type;
50408 /*
50409 * The completion ring to send the completion event on. This should
50410 * be the NQ ID returned from the `nq_alloc` HWRM command.
50411 */
50412 uint16_t cmpl_ring;
50413 /*
50414 * The sequence ID is used by the driver for tracking multiple
50415 * commands. This ID is treated as opaque data by the firmware and
50416 * the value is returned in the `hwrm_resp_hdr` upon completion.
50417 */
50418 uint16_t seq_id;
50419 /*
50420 * The target ID of the command:
50421 * * 0x0-0xFFF8 - The function ID
50422 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50423 * * 0xFFFD - Reserved for user-space HWRM interface
50424 * * 0xFFFF - HWRM
50425 */
50426 uint16_t target_id;
50427 /*
50428 * A physical address pointer pointing to a host buffer that the
50429 * command's response data will be written. This can be either a host
50430 * physical address (HPA) or a guest physical address (GPA) and must
50431 * point to a physically contiguous block of memory.
50432 */
50433 uint64_t resp_addr;
50434 /*
50435 * 64-bit Host Destination Address.
50436 * This is the host address where the data will be written to.
50437 */
50438 uint64_t host_dest_addr;
50439 /* 32-bit NVRAM byte-offset to read from. */
50440 uint32_t offset;
50441 /* Total length of NVRAM contents to be read, in bytes. */
50442 uint32_t len;
50443 } hwrm_nvm_raw_dump_input_t, *phwrm_nvm_raw_dump_input_t;
50444
50445 /* hwrm_nvm_raw_dump_output (size:128b/16B) */
50446
50447 typedef struct hwrm_nvm_raw_dump_output {
50448 /* The specific error status for the command. */
50449 uint16_t error_code;
50450 /* The HWRM command request type. */
50451 uint16_t req_type;
50452 /* The sequence ID from the original command. */
50453 uint16_t seq_id;
50454 /* The length of the response data in number of bytes. */
50455 uint16_t resp_len;
50456 uint8_t unused_0[7];
50457 /*
50458 * This field is used in Output records to indicate that the output
50459 * is completely written to RAM. This field should be read as '1'
50460 * to indicate that the output has been completely written.
50461 * When writing a command completion or response to an internal processor,
50462 * the order of writes has to be such that this field is written last.
50463 */
50464 uint8_t valid;
50465 } hwrm_nvm_raw_dump_output_t, *phwrm_nvm_raw_dump_output_t;
50466
50467 /****************************
50468 * hwrm_nvm_get_dir_entries *
50469 ****************************/
50470
50471
50472 /* hwrm_nvm_get_dir_entries_input (size:192b/24B) */
50473
50474 typedef struct hwrm_nvm_get_dir_entries_input {
50475 /* The HWRM command request type. */
50476 uint16_t req_type;
50477 /*
50478 * The completion ring to send the completion event on. This should
50479 * be the NQ ID returned from the `nq_alloc` HWRM command.
50480 */
50481 uint16_t cmpl_ring;
50482 /*
50483 * The sequence ID is used by the driver for tracking multiple
50484 * commands. This ID is treated as opaque data by the firmware and
50485 * the value is returned in the `hwrm_resp_hdr` upon completion.
50486 */
50487 uint16_t seq_id;
50488 /*
50489 * The target ID of the command:
50490 * * 0x0-0xFFF8 - The function ID
50491 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50492 * * 0xFFFD - Reserved for user-space HWRM interface
50493 * * 0xFFFF - HWRM
50494 */
50495 uint16_t target_id;
50496 /*
50497 * A physical address pointer pointing to a host buffer that the
50498 * command's response data will be written. This can be either a host
50499 * physical address (HPA) or a guest physical address (GPA) and must
50500 * point to a physically contiguous block of memory.
50501 */
50502 uint64_t resp_addr;
50503 /*
50504 * 64-bit Host Destination Address.
50505 * This is the host address where the directory will be written.
50506 */
50507 uint64_t host_dest_addr;
50508 } hwrm_nvm_get_dir_entries_input_t, *phwrm_nvm_get_dir_entries_input_t;
50509
50510 /* hwrm_nvm_get_dir_entries_output (size:128b/16B) */
50511
50512 typedef struct hwrm_nvm_get_dir_entries_output {
50513 /* The specific error status for the command. */
50514 uint16_t error_code;
50515 /* The HWRM command request type. */
50516 uint16_t req_type;
50517 /* The sequence ID from the original command. */
50518 uint16_t seq_id;
50519 /* The length of the response data in number of bytes. */
50520 uint16_t resp_len;
50521 uint8_t unused_0[7];
50522 /*
50523 * This field is used in Output records to indicate that the output
50524 * is completely written to RAM. This field should be read as '1'
50525 * to indicate that the output has been completely written.
50526 * When writing a command completion or response to an internal processor,
50527 * the order of writes has to be such that this field is written last.
50528 */
50529 uint8_t valid;
50530 } hwrm_nvm_get_dir_entries_output_t, *phwrm_nvm_get_dir_entries_output_t;
50531
50532 /*************************
50533 * hwrm_nvm_get_dir_info *
50534 *************************/
50535
50536
50537 /* hwrm_nvm_get_dir_info_input (size:128b/16B) */
50538
50539 typedef struct hwrm_nvm_get_dir_info_input {
50540 /* The HWRM command request type. */
50541 uint16_t req_type;
50542 /*
50543 * The completion ring to send the completion event on. This should
50544 * be the NQ ID returned from the `nq_alloc` HWRM command.
50545 */
50546 uint16_t cmpl_ring;
50547 /*
50548 * The sequence ID is used by the driver for tracking multiple
50549 * commands. This ID is treated as opaque data by the firmware and
50550 * the value is returned in the `hwrm_resp_hdr` upon completion.
50551 */
50552 uint16_t seq_id;
50553 /*
50554 * The target ID of the command:
50555 * * 0x0-0xFFF8 - The function ID
50556 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50557 * * 0xFFFD - Reserved for user-space HWRM interface
50558 * * 0xFFFF - HWRM
50559 */
50560 uint16_t target_id;
50561 /*
50562 * A physical address pointer pointing to a host buffer that the
50563 * command's response data will be written. This can be either a host
50564 * physical address (HPA) or a guest physical address (GPA) and must
50565 * point to a physically contiguous block of memory.
50566 */
50567 uint64_t resp_addr;
50568 } hwrm_nvm_get_dir_info_input_t, *phwrm_nvm_get_dir_info_input_t;
50569
50570 /* hwrm_nvm_get_dir_info_output (size:192b/24B) */
50571
50572 typedef struct hwrm_nvm_get_dir_info_output {
50573 /* The specific error status for the command. */
50574 uint16_t error_code;
50575 /* The HWRM command request type. */
50576 uint16_t req_type;
50577 /* The sequence ID from the original command. */
50578 uint16_t seq_id;
50579 /* The length of the response data in number of bytes. */
50580 uint16_t resp_len;
50581 /* Number of directory entries in the directory. */
50582 uint32_t entries;
50583 /* Size of each directory entry, in bytes. */
50584 uint32_t entry_length;
50585 uint8_t unused_0[7];
50586 /*
50587 * This field is used in Output records to indicate that the output
50588 * is completely written to RAM. This field should be read as '1'
50589 * to indicate that the output has been completely written.
50590 * When writing a command completion or response to an internal processor,
50591 * the order of writes has to be such that this field is written last.
50592 */
50593 uint8_t valid;
50594 } hwrm_nvm_get_dir_info_output_t, *phwrm_nvm_get_dir_info_output_t;
50595
50596 /******************
50597 * hwrm_nvm_write *
50598 ******************/
50599
50600
50601 /* hwrm_nvm_write_input (size:384b/48B) */
50602
50603 typedef struct hwrm_nvm_write_input {
50604 /* The HWRM command request type. */
50605 uint16_t req_type;
50606 /*
50607 * The completion ring to send the completion event on. This should
50608 * be the NQ ID returned from the `nq_alloc` HWRM command.
50609 */
50610 uint16_t cmpl_ring;
50611 /*
50612 * The sequence ID is used by the driver for tracking multiple
50613 * commands. This ID is treated as opaque data by the firmware and
50614 * the value is returned in the `hwrm_resp_hdr` upon completion.
50615 */
50616 uint16_t seq_id;
50617 /*
50618 * The target ID of the command:
50619 * * 0x0-0xFFF8 - The function ID
50620 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50621 * * 0xFFFD - Reserved for user-space HWRM interface
50622 * * 0xFFFF - HWRM
50623 */
50624 uint16_t target_id;
50625 /*
50626 * A physical address pointer pointing to a host buffer that the
50627 * command's response data will be written. This can be either a host
50628 * physical address (HPA) or a guest physical address (GPA) and must
50629 * point to a physically contiguous block of memory.
50630 */
50631 uint64_t resp_addr;
50632 /*
50633 * 64-bit Host Source Address.
50634 * This is where the source data is.
50635 */
50636 uint64_t host_src_addr;
50637 /* The Directory Entry Type (valid values are defined in the bnxnvm_directory_type enum defined in the file bnxnvm_defs.h). */
50638 uint16_t dir_type;
50639 /*
50640 * Directory ordinal.
50641 * The 0-based instance of the combined Directory Entry Type and Extension.
50642 */
50643 uint16_t dir_ordinal;
50644 /* The Directory Entry Extension flags (see BNX_DIR_EXT_* in the file bnxnvm_defs.h). */
50645 uint16_t dir_ext;
50646 /* Directory Entry Attribute flags (see BNX_DIR_ATTR_* in the file bnxnvm_defs.h). */
50647 uint16_t dir_attr;
50648 /*
50649 * Length of data to write, in bytes. May be less than or equal to the allocated size for the directory entry.
50650 * The data length stored in the directory entry will be updated to reflect this value once the write is complete.
50651 */
50652 uint32_t dir_data_length;
50653 /* Option. */
50654 uint16_t option;
50655 uint16_t flags;
50656 /*
50657 * When this bit is '1', the original active image
50658 * will not be removed. TBD: what purpose is this?
50659 */
50660 #define HWRM_NVM_WRITE_INPUT_FLAGS_KEEP_ORIG_ACTIVE_IMG UINT32_C(0x1)
50661 /*
50662 * The requested length of the allocated NVM for the item, in bytes. This value may be greater than or equal to the specified data length (dir_data_length).
50663 * If this value is less than the specified data length, it will be ignored.
50664 * The response will contain the actual allocated item length, which may be greater than the requested item length.
50665 * The purpose for allocating more than the required number of bytes for an item's data is to pre-allocate extra storage (padding) to accommodate
50666 * the potential future growth of an item (e.g. upgraded firmware with a size increase, log growth, expanded configuration data).
50667 */
50668 uint32_t dir_item_length;
50669 uint32_t unused_0;
50670 } hwrm_nvm_write_input_t, *phwrm_nvm_write_input_t;
50671
50672 /* hwrm_nvm_write_output (size:128b/16B) */
50673
50674 typedef struct hwrm_nvm_write_output {
50675 /* The specific error status for the command. */
50676 uint16_t error_code;
50677 /* The HWRM command request type. */
50678 uint16_t req_type;
50679 /* The sequence ID from the original command. */
50680 uint16_t seq_id;
50681 /* The length of the response data in number of bytes. */
50682 uint16_t resp_len;
50683 /*
50684 * Length of the allocated NVM for the item, in bytes. The value may be greater than or equal to the specified data length or the requested item length.
50685 * The actual item length used when creating a new directory entry will be a multiple of an NVM block size.
50686 */
50687 uint32_t dir_item_length;
50688 /* The directory index of the created or modified item. */
50689 uint16_t dir_idx;
50690 uint8_t unused_0;
50691 /*
50692 * This field is used in Output records to indicate that the output
50693 * is completely written to RAM. This field should be read as '1'
50694 * to indicate that the output has been completely written.
50695 * When writing a command completion or response to an internal processor,
50696 * the order of writes has to be such that this field is written last.
50697 */
50698 uint8_t valid;
50699 } hwrm_nvm_write_output_t, *phwrm_nvm_write_output_t;
50700
50701 /* hwrm_nvm_write_cmd_err (size:64b/8B) */
50702
50703 typedef struct hwrm_nvm_write_cmd_err {
50704 /*
50705 * command specific error codes that goes to
50706 * the cmd_err field in Common HWRM Error Response.
50707 */
50708 uint8_t code;
50709 /* Unknown error */
50710 #define HWRM_NVM_WRITE_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
50711 /* Unable to complete operation due to fragmentation */
50712 #define HWRM_NVM_WRITE_CMD_ERR_CODE_FRAG_ERR UINT32_C(0x1)
50713 /* nvm is completely full. */
50714 #define HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE UINT32_C(0x2)
50715 #define HWRM_NVM_WRITE_CMD_ERR_CODE_LAST HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE
50716 uint8_t unused_0[7];
50717 } hwrm_nvm_write_cmd_err_t, *phwrm_nvm_write_cmd_err_t;
50718
50719 /*******************
50720 * hwrm_nvm_modify *
50721 *******************/
50722
50723
50724 /* hwrm_nvm_modify_input (size:320b/40B) */
50725
50726 typedef struct hwrm_nvm_modify_input {
50727 /* The HWRM command request type. */
50728 uint16_t req_type;
50729 /*
50730 * The completion ring to send the completion event on. This should
50731 * be the NQ ID returned from the `nq_alloc` HWRM command.
50732 */
50733 uint16_t cmpl_ring;
50734 /*
50735 * The sequence ID is used by the driver for tracking multiple
50736 * commands. This ID is treated as opaque data by the firmware and
50737 * the value is returned in the `hwrm_resp_hdr` upon completion.
50738 */
50739 uint16_t seq_id;
50740 /*
50741 * The target ID of the command:
50742 * * 0x0-0xFFF8 - The function ID
50743 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50744 * * 0xFFFD - Reserved for user-space HWRM interface
50745 * * 0xFFFF - HWRM
50746 */
50747 uint16_t target_id;
50748 /*
50749 * A physical address pointer pointing to a host buffer that the
50750 * command's response data will be written. This can be either a host
50751 * physical address (HPA) or a guest physical address (GPA) and must
50752 * point to a physically contiguous block of memory.
50753 */
50754 uint64_t resp_addr;
50755 /*
50756 * 64-bit Host Source Address.
50757 * This is where the modified data is.
50758 */
50759 uint64_t host_src_addr;
50760 /* 16-bit directory entry index. */
50761 uint16_t dir_idx;
50762 uint16_t flags;
50763 /*
50764 * This flag indicates the sender wants to modify a continuous NVRAM
50765 * area using a batch of this HWRM requests. The offset of a request
50766 * must be continuous to the end of previous request's. Firmware does
50767 * not update the directory entry until receiving the last request,
50768 * which is indicated by the batch_last flag.
50769 * This flag is set usually when a sender does not have a block of
50770 * memory that is big enough to hold the entire NVRAM data for send
50771 * at one time.
50772 */
50773 #define HWRM_NVM_MODIFY_INPUT_FLAGS_BATCH_MODE UINT32_C(0x1)
50774 /*
50775 * This flag can be used only when the batch_mode flag is set.
50776 * It indicates this request is the last of batch requests.
50777 */
50778 #define HWRM_NVM_MODIFY_INPUT_FLAGS_BATCH_LAST UINT32_C(0x2)
50779 /* 32-bit NVRAM byte-offset to modify content from. */
50780 uint32_t offset;
50781 /*
50782 * Length of data to be modified, in bytes. The length shall
50783 * be non-zero.
50784 */
50785 uint32_t len;
50786 uint8_t unused_1[4];
50787 } hwrm_nvm_modify_input_t, *phwrm_nvm_modify_input_t;
50788
50789 /* hwrm_nvm_modify_output (size:128b/16B) */
50790
50791 typedef struct hwrm_nvm_modify_output {
50792 /* The specific error status for the command. */
50793 uint16_t error_code;
50794 /* The HWRM command request type. */
50795 uint16_t req_type;
50796 /* The sequence ID from the original command. */
50797 uint16_t seq_id;
50798 /* The length of the response data in number of bytes. */
50799 uint16_t resp_len;
50800 uint8_t unused_0[7];
50801 /*
50802 * This field is used in Output records to indicate that the output
50803 * is completely written to RAM. This field should be read as '1'
50804 * to indicate that the output has been completely written.
50805 * When writing a command completion or response to an internal processor,
50806 * the order of writes has to be such that this field is written last.
50807 */
50808 uint8_t valid;
50809 } hwrm_nvm_modify_output_t, *phwrm_nvm_modify_output_t;
50810
50811 /***************************
50812 * hwrm_nvm_find_dir_entry *
50813 ***************************/
50814
50815
50816 /* hwrm_nvm_find_dir_entry_input (size:256b/32B) */
50817
50818 typedef struct hwrm_nvm_find_dir_entry_input {
50819 /* The HWRM command request type. */
50820 uint16_t req_type;
50821 /*
50822 * The completion ring to send the completion event on. This should
50823 * be the NQ ID returned from the `nq_alloc` HWRM command.
50824 */
50825 uint16_t cmpl_ring;
50826 /*
50827 * The sequence ID is used by the driver for tracking multiple
50828 * commands. This ID is treated as opaque data by the firmware and
50829 * the value is returned in the `hwrm_resp_hdr` upon completion.
50830 */
50831 uint16_t seq_id;
50832 /*
50833 * The target ID of the command:
50834 * * 0x0-0xFFF8 - The function ID
50835 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50836 * * 0xFFFD - Reserved for user-space HWRM interface
50837 * * 0xFFFF - HWRM
50838 */
50839 uint16_t target_id;
50840 /*
50841 * A physical address pointer pointing to a host buffer that the
50842 * command's response data will be written. This can be either a host
50843 * physical address (HPA) or a guest physical address (GPA) and must
50844 * point to a physically contiguous block of memory.
50845 */
50846 uint64_t resp_addr;
50847 uint32_t enables;
50848 /*
50849 * This bit must be '1' for the dir_idx_valid field to be
50850 * configured.
50851 */
50852 #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_ENABLES_DIR_IDX_VALID UINT32_C(0x1)
50853 /* Directory Entry Index */
50854 uint16_t dir_idx;
50855 /* Directory Entry (Image) Type */
50856 uint16_t dir_type;
50857 /*
50858 * Directory ordinal.
50859 * The instance of this Directory Type
50860 */
50861 uint16_t dir_ordinal;
50862 /* The Directory Entry Extension flags. */
50863 uint16_t dir_ext;
50864 /* This value indicates the search option using dir_ordinal. */
50865 uint8_t opt_ordinal;
50866 /* This value indicates the search option using dir_ordinal. */
50867 #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_MASK UINT32_C(0x3)
50868 #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_SFT 0
50869 /* Equal to specified ordinal value. */
50870 #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_EQ UINT32_C(0x0)
50871 /* Greater than or equal to specified ordinal value */
50872 #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GE UINT32_C(0x1)
50873 /* Greater than specified ordinal value */
50874 #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT UINT32_C(0x2)
50875 #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_LAST HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT
50876 uint8_t unused_0[3];
50877 } hwrm_nvm_find_dir_entry_input_t, *phwrm_nvm_find_dir_entry_input_t;
50878
50879 /* hwrm_nvm_find_dir_entry_output (size:256b/32B) */
50880
50881 typedef struct hwrm_nvm_find_dir_entry_output {
50882 /* The specific error status for the command. */
50883 uint16_t error_code;
50884 /* The HWRM command request type. */
50885 uint16_t req_type;
50886 /* The sequence ID from the original command. */
50887 uint16_t seq_id;
50888 /* The length of the response data in number of bytes. */
50889 uint16_t resp_len;
50890 /* Allocated NVRAM for this directory entry, in bytes. */
50891 uint32_t dir_item_length;
50892 /* Size of the stored data for this directory entry, in bytes. */
50893 uint32_t dir_data_length;
50894 /*
50895 * Firmware version.
50896 * Only valid if the directory entry is for embedded firmware stored in APE_BIN Format.
50897 */
50898 uint32_t fw_ver;
50899 /* Directory ordinal. */
50900 uint16_t dir_ordinal;
50901 /* Directory Entry Index */
50902 uint16_t dir_idx;
50903 uint8_t unused_0[7];
50904 /*
50905 * This field is used in Output records to indicate that the output
50906 * is completely written to RAM. This field should be read as '1'
50907 * to indicate that the output has been completely written.
50908 * When writing a command completion or response to an internal processor,
50909 * the order of writes has to be such that this field is written last.
50910 */
50911 uint8_t valid;
50912 } hwrm_nvm_find_dir_entry_output_t, *phwrm_nvm_find_dir_entry_output_t;
50913
50914 /****************************
50915 * hwrm_nvm_erase_dir_entry *
50916 ****************************/
50917
50918
50919 /* hwrm_nvm_erase_dir_entry_input (size:192b/24B) */
50920
50921 typedef struct hwrm_nvm_erase_dir_entry_input {
50922 /* The HWRM command request type. */
50923 uint16_t req_type;
50924 /*
50925 * The completion ring to send the completion event on. This should
50926 * be the NQ ID returned from the `nq_alloc` HWRM command.
50927 */
50928 uint16_t cmpl_ring;
50929 /*
50930 * The sequence ID is used by the driver for tracking multiple
50931 * commands. This ID is treated as opaque data by the firmware and
50932 * the value is returned in the `hwrm_resp_hdr` upon completion.
50933 */
50934 uint16_t seq_id;
50935 /*
50936 * The target ID of the command:
50937 * * 0x0-0xFFF8 - The function ID
50938 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50939 * * 0xFFFD - Reserved for user-space HWRM interface
50940 * * 0xFFFF - HWRM
50941 */
50942 uint16_t target_id;
50943 /*
50944 * A physical address pointer pointing to a host buffer that the
50945 * command's response data will be written. This can be either a host
50946 * physical address (HPA) or a guest physical address (GPA) and must
50947 * point to a physically contiguous block of memory.
50948 */
50949 uint64_t resp_addr;
50950 /* Directory Entry Index */
50951 uint16_t dir_idx;
50952 uint8_t unused_0[6];
50953 } hwrm_nvm_erase_dir_entry_input_t, *phwrm_nvm_erase_dir_entry_input_t;
50954
50955 /* hwrm_nvm_erase_dir_entry_output (size:128b/16B) */
50956
50957 typedef struct hwrm_nvm_erase_dir_entry_output {
50958 /* The specific error status for the command. */
50959 uint16_t error_code;
50960 /* The HWRM command request type. */
50961 uint16_t req_type;
50962 /* The sequence ID from the original command. */
50963 uint16_t seq_id;
50964 /* The length of the response data in number of bytes. */
50965 uint16_t resp_len;
50966 uint8_t unused_0[7];
50967 /*
50968 * This field is used in Output records to indicate that the output
50969 * is completely written to RAM. This field should be read as '1'
50970 * to indicate that the output has been completely written.
50971 * When writing a command completion or response to an internal processor,
50972 * the order of writes has to be such that this field is written last.
50973 */
50974 uint8_t valid;
50975 } hwrm_nvm_erase_dir_entry_output_t, *phwrm_nvm_erase_dir_entry_output_t;
50976
50977 /*************************
50978 * hwrm_nvm_get_dev_info *
50979 *************************/
50980
50981
50982 /* hwrm_nvm_get_dev_info_input (size:128b/16B) */
50983
50984 typedef struct hwrm_nvm_get_dev_info_input {
50985 /* The HWRM command request type. */
50986 uint16_t req_type;
50987 /*
50988 * The completion ring to send the completion event on. This should
50989 * be the NQ ID returned from the `nq_alloc` HWRM command.
50990 */
50991 uint16_t cmpl_ring;
50992 /*
50993 * The sequence ID is used by the driver for tracking multiple
50994 * commands. This ID is treated as opaque data by the firmware and
50995 * the value is returned in the `hwrm_resp_hdr` upon completion.
50996 */
50997 uint16_t seq_id;
50998 /*
50999 * The target ID of the command:
51000 * * 0x0-0xFFF8 - The function ID
51001 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51002 * * 0xFFFD - Reserved for user-space HWRM interface
51003 * * 0xFFFF - HWRM
51004 */
51005 uint16_t target_id;
51006 /*
51007 * A physical address pointer pointing to a host buffer that the
51008 * command's response data will be written. This can be either a host
51009 * physical address (HPA) or a guest physical address (GPA) and must
51010 * point to a physically contiguous block of memory.
51011 */
51012 uint64_t resp_addr;
51013 } hwrm_nvm_get_dev_info_input_t, *phwrm_nvm_get_dev_info_input_t;
51014
51015 /* hwrm_nvm_get_dev_info_output (size:640b/80B) */
51016
51017 typedef struct hwrm_nvm_get_dev_info_output {
51018 /* The specific error status for the command. */
51019 uint16_t error_code;
51020 /* The HWRM command request type. */
51021 uint16_t req_type;
51022 /* The sequence ID from the original command. */
51023 uint16_t seq_id;
51024 /* The length of the response data in number of bytes. */
51025 uint16_t resp_len;
51026 /* Manufacturer ID. */
51027 uint16_t manufacturer_id;
51028 /* Device ID. */
51029 uint16_t device_id;
51030 /* Sector size of the NVRAM device. */
51031 uint32_t sector_size;
51032 /* Total size, in bytes of the NVRAM device. */
51033 uint32_t nvram_size;
51034 uint32_t reserved_size;
51035 /* Available size that can be used, in bytes. Available size is the NVRAM size take away the used size and reserved size. */
51036 uint32_t available_size;
51037 /* This field represents the major version of NVM cfg */
51038 uint8_t nvm_cfg_ver_maj;
51039 /* This field represents the minor version of NVM cfg */
51040 uint8_t nvm_cfg_ver_min;
51041 /* This field represents the update version of NVM cfg */
51042 uint8_t nvm_cfg_ver_upd;
51043 uint8_t flags;
51044 /*
51045 * If set to 1, firmware will provide various firmware version
51046 * information stored in the flash.
51047 */
51048 #define HWRM_NVM_GET_DEV_INFO_OUTPUT_FLAGS_FW_VER_VALID UINT32_C(0x1)
51049 /*
51050 * This field represents the board package name stored in the flash.
51051 * (ASCII chars with NULL at the end).
51052 */
51053 char pkg_name[16];
51054 /*
51055 * This field represents the major version of HWRM firmware, stored in
51056 * the flash.
51057 */
51058 uint16_t hwrm_fw_major;
51059 /*
51060 * This field represents the minor version of HWRM firmware, stored in
51061 * the flash.
51062 */
51063 uint16_t hwrm_fw_minor;
51064 /*
51065 * This field represents the build version of HWRM firmware, stored in
51066 * the flash.
51067 */
51068 uint16_t hwrm_fw_build;
51069 /*
51070 * This field can be used to represent firmware branches or customer
51071 * specific releases tied to a specific (major, minor, build) version
51072 * of the HWRM firmware.
51073 */
51074 uint16_t hwrm_fw_patch;
51075 /*
51076 * This field represents the major version of mgmt firmware, stored in
51077 * the flash.
51078 */
51079 uint16_t mgmt_fw_major;
51080 /*
51081 * This field represents the minor version of mgmt firmware, stored in
51082 * the flash.
51083 */
51084 uint16_t mgmt_fw_minor;
51085 /*
51086 * This field represents the build version of mgmt firmware, stored in
51087 * the flash.
51088 */
51089 uint16_t mgmt_fw_build;
51090 /*
51091 * This field can be used to represent firmware branches or customer
51092 * specific releases tied to a specific (major, minor, build) version
51093 * of the mgmt firmware.
51094 */
51095 uint16_t mgmt_fw_patch;
51096 /*
51097 * This field represents the major version of roce firmware, stored in
51098 * the flash.
51099 */
51100 uint16_t roce_fw_major;
51101 /*
51102 * This field represents the minor version of roce firmware, stored in
51103 * the flash.
51104 */
51105 uint16_t roce_fw_minor;
51106 /*
51107 * This field represents the build version of roce firmware, stored in
51108 * the flash.
51109 */
51110 uint16_t roce_fw_build;
51111 /*
51112 * This field can be used to represent firmware branches or customer
51113 * specific releases tied to a specific (major, minor, build) version
51114 * of the roce firmware.
51115 */
51116 uint16_t roce_fw_patch;
51117 uint8_t unused_0[7];
51118 /*
51119 * This field is used in Output records to indicate that the output
51120 * is completely written to RAM. This field should be read as '1'
51121 * to indicate that the output has been completely written.
51122 * When writing a command completion or response to an internal processor,
51123 * the order of writes has to be such that this field is written last.
51124 */
51125 uint8_t valid;
51126 } hwrm_nvm_get_dev_info_output_t, *phwrm_nvm_get_dev_info_output_t;
51127
51128 /**************************
51129 * hwrm_nvm_mod_dir_entry *
51130 **************************/
51131
51132
51133 /* hwrm_nvm_mod_dir_entry_input (size:256b/32B) */
51134
51135 typedef struct hwrm_nvm_mod_dir_entry_input {
51136 /* The HWRM command request type. */
51137 uint16_t req_type;
51138 /*
51139 * The completion ring to send the completion event on. This should
51140 * be the NQ ID returned from the `nq_alloc` HWRM command.
51141 */
51142 uint16_t cmpl_ring;
51143 /*
51144 * The sequence ID is used by the driver for tracking multiple
51145 * commands. This ID is treated as opaque data by the firmware and
51146 * the value is returned in the `hwrm_resp_hdr` upon completion.
51147 */
51148 uint16_t seq_id;
51149 /*
51150 * The target ID of the command:
51151 * * 0x0-0xFFF8 - The function ID
51152 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51153 * * 0xFFFD - Reserved for user-space HWRM interface
51154 * * 0xFFFF - HWRM
51155 */
51156 uint16_t target_id;
51157 /*
51158 * A physical address pointer pointing to a host buffer that the
51159 * command's response data will be written. This can be either a host
51160 * physical address (HPA) or a guest physical address (GPA) and must
51161 * point to a physically contiguous block of memory.
51162 */
51163 uint64_t resp_addr;
51164 uint32_t enables;
51165 /*
51166 * This bit must be '1' for the checksum field to be
51167 * configured.
51168 */
51169 #define HWRM_NVM_MOD_DIR_ENTRY_INPUT_ENABLES_CHECKSUM UINT32_C(0x1)
51170 /* Directory Entry Index */
51171 uint16_t dir_idx;
51172 /*
51173 * Directory ordinal.
51174 * The (0-based) instance of this Directory Type.
51175 */
51176 uint16_t dir_ordinal;
51177 /* The Directory Entry Extension flags (see BNX_DIR_EXT_* for extension flag definitions). */
51178 uint16_t dir_ext;
51179 /* Directory Entry Attribute flags (see BNX_DIR_ATTR_* for attribute flag definitions). */
51180 uint16_t dir_attr;
51181 /*
51182 * If valid, then this field updates the checksum
51183 * value of the content in the directory entry.
51184 */
51185 uint32_t checksum;
51186 } hwrm_nvm_mod_dir_entry_input_t, *phwrm_nvm_mod_dir_entry_input_t;
51187
51188 /* hwrm_nvm_mod_dir_entry_output (size:128b/16B) */
51189
51190 typedef struct hwrm_nvm_mod_dir_entry_output {
51191 /* The specific error status for the command. */
51192 uint16_t error_code;
51193 /* The HWRM command request type. */
51194 uint16_t req_type;
51195 /* The sequence ID from the original command. */
51196 uint16_t seq_id;
51197 /* The length of the response data in number of bytes. */
51198 uint16_t resp_len;
51199 uint8_t unused_0[7];
51200 /*
51201 * This field is used in Output records to indicate that the output
51202 * is completely written to RAM. This field should be read as '1'
51203 * to indicate that the output has been completely written.
51204 * When writing a command completion or response to an internal processor,
51205 * the order of writes has to be such that this field is written last.
51206 */
51207 uint8_t valid;
51208 } hwrm_nvm_mod_dir_entry_output_t, *phwrm_nvm_mod_dir_entry_output_t;
51209
51210 /**************************
51211 * hwrm_nvm_verify_update *
51212 **************************/
51213
51214
51215 /* hwrm_nvm_verify_update_input (size:192b/24B) */
51216
51217 typedef struct hwrm_nvm_verify_update_input {
51218 /* The HWRM command request type. */
51219 uint16_t req_type;
51220 /*
51221 * The completion ring to send the completion event on. This should
51222 * be the NQ ID returned from the `nq_alloc` HWRM command.
51223 */
51224 uint16_t cmpl_ring;
51225 /*
51226 * The sequence ID is used by the driver for tracking multiple
51227 * commands. This ID is treated as opaque data by the firmware and
51228 * the value is returned in the `hwrm_resp_hdr` upon completion.
51229 */
51230 uint16_t seq_id;
51231 /*
51232 * The target ID of the command:
51233 * * 0x0-0xFFF8 - The function ID
51234 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51235 * * 0xFFFD - Reserved for user-space HWRM interface
51236 * * 0xFFFF - HWRM
51237 */
51238 uint16_t target_id;
51239 /*
51240 * A physical address pointer pointing to a host buffer that the
51241 * command's response data will be written. This can be either a host
51242 * physical address (HPA) or a guest physical address (GPA) and must
51243 * point to a physically contiguous block of memory.
51244 */
51245 uint64_t resp_addr;
51246 /* Directory Entry Type, to be verified. */
51247 uint16_t dir_type;
51248 /*
51249 * Directory ordinal.
51250 * The instance of the Directory Type to be verified.
51251 */
51252 uint16_t dir_ordinal;
51253 /*
51254 * The Directory Entry Extension flags.
51255 * The "UPDATE" extension flag must be set in this value.
51256 * A corresponding directory entry with the same type and ordinal values but *without*
51257 * the "UPDATE" extension flag must also exist. The other flags of the extension must
51258 * be identical between the active and update entries.
51259 */
51260 uint16_t dir_ext;
51261 uint8_t unused_0[2];
51262 } hwrm_nvm_verify_update_input_t, *phwrm_nvm_verify_update_input_t;
51263
51264 /* hwrm_nvm_verify_update_output (size:128b/16B) */
51265
51266 typedef struct hwrm_nvm_verify_update_output {
51267 /* The specific error status for the command. */
51268 uint16_t error_code;
51269 /* The HWRM command request type. */
51270 uint16_t req_type;
51271 /* The sequence ID from the original command. */
51272 uint16_t seq_id;
51273 /* The length of the response data in number of bytes. */
51274 uint16_t resp_len;
51275 uint8_t unused_0[7];
51276 /*
51277 * This field is used in Output records to indicate that the output
51278 * is completely written to RAM. This field should be read as '1'
51279 * to indicate that the output has been completely written.
51280 * When writing a command completion or response to an internal processor,
51281 * the order of writes has to be such that this field is written last.
51282 */
51283 uint8_t valid;
51284 } hwrm_nvm_verify_update_output_t, *phwrm_nvm_verify_update_output_t;
51285
51286 /***************************
51287 * hwrm_nvm_install_update *
51288 ***************************/
51289
51290
51291 /* hwrm_nvm_install_update_input (size:192b/24B) */
51292
51293 typedef struct hwrm_nvm_install_update_input {
51294 /* The HWRM command request type. */
51295 uint16_t req_type;
51296 /*
51297 * The completion ring to send the completion event on. This should
51298 * be the NQ ID returned from the `nq_alloc` HWRM command.
51299 */
51300 uint16_t cmpl_ring;
51301 /*
51302 * The sequence ID is used by the driver for tracking multiple
51303 * commands. This ID is treated as opaque data by the firmware and
51304 * the value is returned in the `hwrm_resp_hdr` upon completion.
51305 */
51306 uint16_t seq_id;
51307 /*
51308 * The target ID of the command:
51309 * * 0x0-0xFFF8 - The function ID
51310 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51311 * * 0xFFFD - Reserved for user-space HWRM interface
51312 * * 0xFFFF - HWRM
51313 */
51314 uint16_t target_id;
51315 /*
51316 * A physical address pointer pointing to a host buffer that the
51317 * command's response data will be written. This can be either a host
51318 * physical address (HPA) or a guest physical address (GPA) and must
51319 * point to a physically contiguous block of memory.
51320 */
51321 uint64_t resp_addr;
51322 /*
51323 * Installation type. If the value 3 through 0xffff is used,
51324 * only packaged items with that type value will be installed and
51325 * conditional installation directives for those packaged items
51326 * will be over-ridden (i.e. 'create' or 'replace' will be treated
51327 * as 'install').
51328 */
51329 uint32_t install_type;
51330 /*
51331 * Perform a normal package installation. Conditional installation
51332 * directives (e.g. 'create' and 'replace') of packaged items
51333 * will be followed.
51334 */
51335 #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_NORMAL UINT32_C(0x0)
51336 /*
51337 * Install all packaged items regardless of installation directive
51338 * (i.e. treat all packaged items as though they have an installation
51339 * directive of 'install').
51340 */
51341 #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_ALL UINT32_C(0xffffffff)
51342 #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_LAST HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_ALL
51343 uint16_t flags;
51344 /* If set to 1, then securely erase all unused locations in persistent storage. */
51345 #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_ERASE_UNUSED_SPACE UINT32_C(0x1)
51346 /*
51347 * If set to 1, then unspecified images, images not in the package file, will be safely deleted.
51348 * When combined with erase_unused_space then unspecified images will be securely erased.
51349 */
51350 #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_REMOVE_UNUSED_PKG UINT32_C(0x2)
51351 /*
51352 * If set to 1, FW will defragment the NVM if defragmentation is required for the update.
51353 * Allow additional time for this command to complete if this bit is set to 1.
51354 */
51355 #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_ALLOWED_TO_DEFRAG UINT32_C(0x4)
51356 /*
51357 * If set to 1, FW will verify the package in the "UPDATE" NVM item
51358 * without installing it. This flag is for FW internal use only.
51359 * Users should not set this flag. The request will otherwise fail.
51360 */
51361 #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_VERIFY_ONLY UINT32_C(0x8)
51362 uint8_t unused_0[2];
51363 } hwrm_nvm_install_update_input_t, *phwrm_nvm_install_update_input_t;
51364
51365 /* hwrm_nvm_install_update_output (size:192b/24B) */
51366
51367 typedef struct hwrm_nvm_install_update_output {
51368 /* The specific error status for the command. */
51369 uint16_t error_code;
51370 /* The HWRM command request type. */
51371 uint16_t req_type;
51372 /* The sequence ID from the original command. */
51373 uint16_t seq_id;
51374 /* The length of the response data in number of bytes. */
51375 uint16_t resp_len;
51376 /*
51377 * Bit-mask of successfully installed items.
51378 * Bit-0 corresponding to the first packaged item, Bit-1 for the second item, etc.
51379 * A value of 0 indicates that no items were successfully installed.
51380 */
51381 uint64_t installed_items;
51382 /* result is 8 b */
51383 uint8_t result;
51384 /* There was no problem with the package installation. */
51385 #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_SUCCESS UINT32_C(0x0)
51386 #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_LAST HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_SUCCESS
51387 /* problem_item is 8 b */
51388 uint8_t problem_item;
51389 /* There was no problem with any packaged items. */
51390 #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_NONE UINT32_C(0x0)
51391 /* There was a problem with the NVM package itself. */
51392 #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_PACKAGE UINT32_C(0xff)
51393 #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_LAST HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_PACKAGE
51394 /* reset_required is 8 b */
51395 uint8_t reset_required;
51396 /*
51397 * No reset is required for installed/updated firmware or
51398 * microcode to take effect.
51399 */
51400 #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_NONE UINT32_C(0x0)
51401 /*
51402 * A PCIe reset (e.g. system reboot) is
51403 * required for newly installed/updated firmware or
51404 * microcode to take effect.
51405 */
51406 #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_PCI UINT32_C(0x1)
51407 /*
51408 * A controller power reset (e.g. system power-cycle) is
51409 * required for newly installed/updated firmware or
51410 * microcode to take effect. Some newly installed/updated
51411 * firmware or microcode may still take effect upon the
51412 * next PCIe reset.
51413 */
51414 #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_POWER UINT32_C(0x2)
51415 #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_LAST HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_POWER
51416 uint8_t unused_0[4];
51417 /*
51418 * This field is used in Output records to indicate that the output
51419 * is completely written to RAM. This field should be read as '1'
51420 * to indicate that the output has been completely written.
51421 * When writing a command completion or response to an internal processor,
51422 * the order of writes has to be such that this field is written last.
51423 */
51424 uint8_t valid;
51425 } hwrm_nvm_install_update_output_t, *phwrm_nvm_install_update_output_t;
51426
51427 /* hwrm_nvm_install_update_cmd_err (size:64b/8B) */
51428
51429 typedef struct hwrm_nvm_install_update_cmd_err {
51430 /*
51431 * command specific error codes that goes to
51432 * the cmd_err field in Common HWRM Error Response.
51433 */
51434 uint8_t code;
51435 /* Unknown error */
51436 #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
51437 /* Unable to complete operation due to fragmentation */
51438 #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR UINT32_C(0x1)
51439 /* nvm is completely full. */
51440 #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_NO_SPACE UINT32_C(0x2)
51441 #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_LAST HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_NO_SPACE
51442 uint8_t unused_0[7];
51443 } hwrm_nvm_install_update_cmd_err_t, *phwrm_nvm_install_update_cmd_err_t;
51444
51445 /******************
51446 * hwrm_nvm_flush *
51447 ******************/
51448
51449
51450 /* hwrm_nvm_flush_input (size:128b/16B) */
51451
51452 typedef struct hwrm_nvm_flush_input {
51453 /* The HWRM command request type. */
51454 uint16_t req_type;
51455 /*
51456 * The completion ring to send the completion event on. This should
51457 * be the NQ ID returned from the `nq_alloc` HWRM command.
51458 */
51459 uint16_t cmpl_ring;
51460 /*
51461 * The sequence ID is used by the driver for tracking multiple
51462 * commands. This ID is treated as opaque data by the firmware and
51463 * the value is returned in the `hwrm_resp_hdr` upon completion.
51464 */
51465 uint16_t seq_id;
51466 /*
51467 * The target ID of the command:
51468 * * 0x0-0xFFF8 - The function ID
51469 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51470 * * 0xFFFD - Reserved for user-space HWRM interface
51471 * * 0xFFFF - HWRM
51472 */
51473 uint16_t target_id;
51474 /*
51475 * A physical address pointer pointing to a host buffer that the
51476 * command's response data will be written. This can be either a host
51477 * physical address (HPA) or a guest physical address (GPA) and must
51478 * point to a physically contiguous block of memory.
51479 */
51480 uint64_t resp_addr;
51481 } hwrm_nvm_flush_input_t, *phwrm_nvm_flush_input_t;
51482
51483 /* hwrm_nvm_flush_output (size:128b/16B) */
51484
51485 typedef struct hwrm_nvm_flush_output {
51486 /* The specific error status for the command. */
51487 uint16_t error_code;
51488 /* The HWRM command request type. */
51489 uint16_t req_type;
51490 /* The sequence ID from the original command. */
51491 uint16_t seq_id;
51492 /* The length of the response data in number of bytes. */
51493 uint16_t resp_len;
51494 uint8_t unused_0[7];
51495 /*
51496 * This field is used in Output records to indicate that the output
51497 * is completely written to RAM. This field should be read as '1'
51498 * to indicate that the output has been completely written.
51499 * When writing a command completion or response to an internal processor,
51500 * the order of writes has to be such that this field is written last.
51501 */
51502 uint8_t valid;
51503 } hwrm_nvm_flush_output_t, *phwrm_nvm_flush_output_t;
51504
51505 /* hwrm_nvm_flush_cmd_err (size:64b/8B) */
51506
51507 typedef struct hwrm_nvm_flush_cmd_err {
51508 /*
51509 * command specific error codes that goes to
51510 * the cmd_err field in Common HWRM Error Response.
51511 */
51512 uint8_t code;
51513 /* Unknown error */
51514 #define HWRM_NVM_FLUSH_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
51515 /* flush could not be performed */
51516 #define HWRM_NVM_FLUSH_CMD_ERR_CODE_FAIL UINT32_C(0x1)
51517 #define HWRM_NVM_FLUSH_CMD_ERR_CODE_LAST HWRM_NVM_FLUSH_CMD_ERR_CODE_FAIL
51518 uint8_t unused_0[7];
51519 } hwrm_nvm_flush_cmd_err_t, *phwrm_nvm_flush_cmd_err_t;
51520
51521 /*************************
51522 * hwrm_nvm_get_variable *
51523 *************************/
51524
51525
51526 /* hwrm_nvm_get_variable_input (size:320b/40B) */
51527
51528 typedef struct hwrm_nvm_get_variable_input {
51529 /* The HWRM command request type. */
51530 uint16_t req_type;
51531 /*
51532 * The completion ring to send the completion event on. This should
51533 * be the NQ ID returned from the `nq_alloc` HWRM command.
51534 */
51535 uint16_t cmpl_ring;
51536 /*
51537 * The sequence ID is used by the driver for tracking multiple
51538 * commands. This ID is treated as opaque data by the firmware and
51539 * the value is returned in the `hwrm_resp_hdr` upon completion.
51540 */
51541 uint16_t seq_id;
51542 /*
51543 * The target ID of the command:
51544 * * 0x0-0xFFF8 - The function ID
51545 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51546 * * 0xFFFD - Reserved for user-space HWRM interface
51547 * * 0xFFFF - HWRM
51548 */
51549 uint16_t target_id;
51550 /*
51551 * A physical address pointer pointing to a host buffer that the
51552 * command's response data will be written. This can be either a host
51553 * physical address (HPA) or a guest physical address (GPA) and must
51554 * point to a physically contiguous block of memory.
51555 */
51556 uint64_t resp_addr;
51557 /*
51558 * This is the host address where
51559 * nvm variable will be stored
51560 */
51561 uint64_t dest_data_addr;
51562 /* size of data in bits */
51563 uint16_t data_len;
51564 /* nvm cfg option number */
51565 uint16_t option_num;
51566 /* reserved. */
51567 #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_0 UINT32_C(0x0)
51568 /* reserved. */
51569 #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF UINT32_C(0xffff)
51570 #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_LAST HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF
51571 /*
51572 * Number of dimensions for this nvm configuration variable.
51573 * This value indicates how many of the indexN values to use.
51574 * A value of 0 means that none of the indexN values are valid.
51575 * A value of 1 requires at index0 is valued, a value of 2
51576 * requires that index0 and index1 are valid, and so forth
51577 */
51578 uint16_t dimensions;
51579 /* index for the 1st dimensions */
51580 uint16_t index_0;
51581 /* index for the 2nd dimensions */
51582 uint16_t index_1;
51583 /* index for the 3rd dimensions */
51584 uint16_t index_2;
51585 /* index for the 4th dimensions */
51586 uint16_t index_3;
51587 uint8_t flags;
51588 /*
51589 * When this bit is set to 1, the factory default value will be returned,
51590 * 0 returns the operational value.
51591 */
51592 #define HWRM_NVM_GET_VARIABLE_INPUT_FLAGS_FACTORY_DFLT UINT32_C(0x1)
51593 uint8_t unused_0;
51594 } hwrm_nvm_get_variable_input_t, *phwrm_nvm_get_variable_input_t;
51595
51596 /* hwrm_nvm_get_variable_output (size:128b/16B) */
51597
51598 typedef struct hwrm_nvm_get_variable_output {
51599 /* The specific error status for the command. */
51600 uint16_t error_code;
51601 /* The HWRM command request type. */
51602 uint16_t req_type;
51603 /* The sequence ID from the original command. */
51604 uint16_t seq_id;
51605 /* The length of the response data in number of bytes. */
51606 uint16_t resp_len;
51607 /* size of data of the actual variable retrieved in bits */
51608 uint16_t data_len;
51609 /*
51610 * option_num is the option number for the data retrieved. It is possible in the
51611 * future that the option number returned would be different than requested. This
51612 * condition could occur if an option is deprecated and a new option id is defined
51613 * with similar characteristics, but has a slightly different definition. This
51614 * also makes it convenient for the caller to identify the variable result with
51615 * the option id from the response.
51616 */
51617 uint16_t option_num;
51618 /* reserved. */
51619 #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_0 UINT32_C(0x0)
51620 /* reserved. */
51621 #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_FFFF UINT32_C(0xffff)
51622 #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_LAST HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_FFFF
51623 uint8_t unused_0[3];
51624 /*
51625 * This field is used in Output records to indicate that the output
51626 * is completely written to RAM. This field should be read as '1'
51627 * to indicate that the output has been completely written.
51628 * When writing a command completion or response to an internal processor,
51629 * the order of writes has to be such that this field is written last.
51630 */
51631 uint8_t valid;
51632 } hwrm_nvm_get_variable_output_t, *phwrm_nvm_get_variable_output_t;
51633
51634 /* hwrm_nvm_get_variable_cmd_err (size:64b/8B) */
51635
51636 typedef struct hwrm_nvm_get_variable_cmd_err {
51637 /*
51638 * command specific error codes that goes to
51639 * the cmd_err field in Common HWRM Error Response.
51640 */
51641 uint8_t code;
51642 /* Unknown error */
51643 #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
51644 /* variable does not exist */
51645 #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_VAR_NOT_EXIST UINT32_C(0x1)
51646 /* configuration is corrupted and the variable cannot be saved */
51647 #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR UINT32_C(0x2)
51648 /* length specified is too small */
51649 #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LEN_TOO_SHORT UINT32_C(0x3)
51650 #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LAST HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LEN_TOO_SHORT
51651 uint8_t unused_0[7];
51652 } hwrm_nvm_get_variable_cmd_err_t, *phwrm_nvm_get_variable_cmd_err_t;
51653
51654 /*************************
51655 * hwrm_nvm_set_variable *
51656 *************************/
51657
51658
51659 /* hwrm_nvm_set_variable_input (size:320b/40B) */
51660
51661 typedef struct hwrm_nvm_set_variable_input {
51662 /* The HWRM command request type. */
51663 uint16_t req_type;
51664 /*
51665 * The completion ring to send the completion event on. This should
51666 * be the NQ ID returned from the `nq_alloc` HWRM command.
51667 */
51668 uint16_t cmpl_ring;
51669 /*
51670 * The sequence ID is used by the driver for tracking multiple
51671 * commands. This ID is treated as opaque data by the firmware and
51672 * the value is returned in the `hwrm_resp_hdr` upon completion.
51673 */
51674 uint16_t seq_id;
51675 /*
51676 * The target ID of the command:
51677 * * 0x0-0xFFF8 - The function ID
51678 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51679 * * 0xFFFD - Reserved for user-space HWRM interface
51680 * * 0xFFFF - HWRM
51681 */
51682 uint16_t target_id;
51683 /*
51684 * A physical address pointer pointing to a host buffer that the
51685 * command's response data will be written. This can be either a host
51686 * physical address (HPA) or a guest physical address (GPA) and must
51687 * point to a physically contiguous block of memory.
51688 */
51689 uint64_t resp_addr;
51690 /*
51691 * This is the host address where
51692 * nvm variable will be copied from
51693 */
51694 uint64_t src_data_addr;
51695 /* size of data in bits */
51696 uint16_t data_len;
51697 /* nvm cfg option number */
51698 uint16_t option_num;
51699 /* reserved. */
51700 #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_0 UINT32_C(0x0)
51701 /* reserved. */
51702 #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF UINT32_C(0xffff)
51703 #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_LAST HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF
51704 /*
51705 * Number of dimensions for this nvm configuration variable.
51706 * This value indicates how many of the indexN values to use.
51707 * A value of 0 means that none of the indexN values are valid.
51708 * A value of 1 requires at index0 is valued, a value of 2
51709 * requires that index0 and index1 are valid, and so forth
51710 */
51711 uint16_t dimensions;
51712 /* index for the 1st dimensions */
51713 uint16_t index_0;
51714 /* index for the 2nd dimensions */
51715 uint16_t index_1;
51716 /* index for the 3rd dimensions */
51717 uint16_t index_2;
51718 /* index for the 4th dimensions */
51719 uint16_t index_3;
51720 uint8_t flags;
51721 /* When this bit is 1, flush internal cache after this write operation (see hwrm_nvm_flush command.) */
51722 #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FORCE_FLUSH UINT32_C(0x1)
51723 /* encryption method */
51724 #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_MASK UINT32_C(0xe)
51725 #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_SFT 1
51726 /* No encryption. */
51727 #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_NONE (UINT32_C(0x0) << 1)
51728 /* one-way encryption. */
51729 #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1 (UINT32_C(0x1) << 1)
51730 /* symmetric AES256 encryption. */
51731 #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_AES256 (UINT32_C(0x2) << 1)
51732 /* SHA1 digest appended to plaintext contents, for authentication */
51733 #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1_AUTH (UINT32_C(0x3) << 1)
51734 #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_LAST HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1_AUTH
51735 #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FLAGS_UNUSED_0_MASK UINT32_C(0x70)
51736 #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FLAGS_UNUSED_0_SFT 4
51737 /* When this bit is 1, update the factory default region */
51738 #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FACTORY_DEFAULT UINT32_C(0x80)
51739 uint8_t unused_0;
51740 } hwrm_nvm_set_variable_input_t, *phwrm_nvm_set_variable_input_t;
51741
51742 /* hwrm_nvm_set_variable_output (size:128b/16B) */
51743
51744 typedef struct hwrm_nvm_set_variable_output {
51745 /* The specific error status for the command. */
51746 uint16_t error_code;
51747 /* The HWRM command request type. */
51748 uint16_t req_type;
51749 /* The sequence ID from the original command. */
51750 uint16_t seq_id;
51751 /* The length of the response data in number of bytes. */
51752 uint16_t resp_len;
51753 uint8_t unused_0[7];
51754 /*
51755 * This field is used in Output records to indicate that the output
51756 * is completely written to RAM. This field should be read as '1'
51757 * to indicate that the output has been completely written.
51758 * When writing a command completion or response to an internal processor,
51759 * the order of writes has to be such that this field is written last.
51760 */
51761 uint8_t valid;
51762 } hwrm_nvm_set_variable_output_t, *phwrm_nvm_set_variable_output_t;
51763
51764 /* hwrm_nvm_set_variable_cmd_err (size:64b/8B) */
51765
51766 typedef struct hwrm_nvm_set_variable_cmd_err {
51767 /*
51768 * command specific error codes that goes to
51769 * the cmd_err field in Common HWRM Error Response.
51770 */
51771 uint8_t code;
51772 /* Unknown error */
51773 #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
51774 /* variable does not exist */
51775 #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_VAR_NOT_EXIST UINT32_C(0x1)
51776 /* configuration is corrupted and the variable cannot be saved */
51777 #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR UINT32_C(0x2)
51778 #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_LAST HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR
51779 uint8_t unused_0[7];
51780 } hwrm_nvm_set_variable_cmd_err_t, *phwrm_nvm_set_variable_cmd_err_t;
51781
51782 /****************************
51783 * hwrm_nvm_validate_option *
51784 ****************************/
51785
51786
51787 /* hwrm_nvm_validate_option_input (size:320b/40B) */
51788
51789 typedef struct hwrm_nvm_validate_option_input {
51790 /* The HWRM command request type. */
51791 uint16_t req_type;
51792 /*
51793 * The completion ring to send the completion event on. This should
51794 * be the NQ ID returned from the `nq_alloc` HWRM command.
51795 */
51796 uint16_t cmpl_ring;
51797 /*
51798 * The sequence ID is used by the driver for tracking multiple
51799 * commands. This ID is treated as opaque data by the firmware and
51800 * the value is returned in the `hwrm_resp_hdr` upon completion.
51801 */
51802 uint16_t seq_id;
51803 /*
51804 * The target ID of the command:
51805 * * 0x0-0xFFF8 - The function ID
51806 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51807 * * 0xFFFD - Reserved for user-space HWRM interface
51808 * * 0xFFFF - HWRM
51809 */
51810 uint16_t target_id;
51811 /*
51812 * A physical address pointer pointing to a host buffer that the
51813 * command's response data will be written. This can be either a host
51814 * physical address (HPA) or a guest physical address (GPA) and must
51815 * point to a physically contiguous block of memory.
51816 */
51817 uint64_t resp_addr;
51818 /*
51819 * This is the host address where
51820 * nvm variable will be copied from
51821 */
51822 uint64_t src_data_addr;
51823 /* size of data in bits */
51824 uint16_t data_len;
51825 /* nvm cfg option number */
51826 uint16_t option_num;
51827 /* reserved. */
51828 #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_0 UINT32_C(0x0)
51829 /* reserved. */
51830 #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_FFFF UINT32_C(0xffff)
51831 #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_LAST HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_FFFF
51832 /*
51833 * Number of dimensions for this nvm configuration variable.
51834 * This value indicates how many of the indexN values to use.
51835 * A value of 0 means that none of the indexN values are valid.
51836 * A value of 1 requires at index0 is valued, a value of 2
51837 * requires that index0 and index1 are valid, and so forth
51838 */
51839 uint16_t dimensions;
51840 /* index for the 1st dimensions */
51841 uint16_t index_0;
51842 /* index for the 2nd dimensions */
51843 uint16_t index_1;
51844 /* index for the 3rd dimensions */
51845 uint16_t index_2;
51846 /* index for the 4th dimensions */
51847 uint16_t index_3;
51848 uint8_t unused_0[2];
51849 } hwrm_nvm_validate_option_input_t, *phwrm_nvm_validate_option_input_t;
51850
51851 /* hwrm_nvm_validate_option_output (size:128b/16B) */
51852
51853 typedef struct hwrm_nvm_validate_option_output {
51854 /* The specific error status for the command. */
51855 uint16_t error_code;
51856 /* The HWRM command request type. */
51857 uint16_t req_type;
51858 /* The sequence ID from the original command. */
51859 uint16_t seq_id;
51860 /* The length of the response data in number of bytes. */
51861 uint16_t resp_len;
51862 uint8_t result;
51863 /* indicates that the value provided for the option is not matching with the saved data. */
51864 #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_NOT_MATCH UINT32_C(0x0)
51865 /* indicates that the value provided for the option is matching the saved data. */
51866 #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_MATCH UINT32_C(0x1)
51867 #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_LAST HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_MATCH
51868 uint8_t unused_0[6];
51869 /*
51870 * This field is used in Output records to indicate that the output
51871 * is completely written to RAM. This field should be read as '1'
51872 * to indicate that the output has been completely written.
51873 * When writing a command completion or response to an internal processor,
51874 * the order of writes has to be such that this field is written last.
51875 */
51876 uint8_t valid;
51877 } hwrm_nvm_validate_option_output_t, *phwrm_nvm_validate_option_output_t;
51878
51879 /* hwrm_nvm_validate_option_cmd_err (size:64b/8B) */
51880
51881 typedef struct hwrm_nvm_validate_option_cmd_err {
51882 /*
51883 * command specific error codes that goes to
51884 * the cmd_err field in Common HWRM Error Response.
51885 */
51886 uint8_t code;
51887 /* Unknown error */
51888 #define HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
51889 #define HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_LAST HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_UNKNOWN
51890 uint8_t unused_0[7];
51891 } hwrm_nvm_validate_option_cmd_err_t, *phwrm_nvm_validate_option_cmd_err_t;
51892
51893 #define ROCE_SP_HSI_VERSION_MAJOR 1
51894 #define ROCE_SP_HSI_VERSION_MINOR 8
51895 #define ROCE_SP_HSI_VERSION_UPDATE 4
51896 #define ROCE_SP_HSI_VERSION_STR "1.8.4"
51897 /*
51898 * Following is the signature for ROCE_SP_HSI message field that indicates not
51899 * applicable (All F's). Need to cast it the size of the field if needed.
51900 */
51901 #define ROCE_SP_HSI_NA_SIGNATURE ((uint32_t)(-1))
51902
51903 /* cmdq_init (size:128b/16B) */
51904
51905 typedef struct cmdq_init {
51906 /* CMDQ PBL physical address. */
51907 uint64_t cmdq_pbl;
51908 uint16_t cmdq_size_cmdq_lvl;
51909 /* CMDQ PBL indirection levels. */
51910 #define CMDQ_INIT_CMDQ_LVL_MASK UINT32_C(0x3)
51911 #define CMDQ_INIT_CMDQ_LVL_SFT 0
51912 /* CMDQ size. */
51913 #define CMDQ_INIT_CMDQ_SIZE_MASK UINT32_C(0xfffc)
51914 #define CMDQ_INIT_CMDQ_SIZE_SFT 2
51915 /* CREQ completion ring id. */
51916 uint16_t creq_ring_id;
51917 /* Mailbox producer index. MSB must also be set. */
51918 uint32_t prod_idx;
51919 } cmdq_init_t, *pcmdq_init_t;
51920
51921 /* cmdq_update (size:128b/16B) */
51922
51923 typedef struct cmdq_update {
51924 /* reserved64 is 64 b */
51925 uint64_t reserved64;
51926 /* reserved32 is 32 b */
51927 uint32_t reserved32;
51928 /* Mailbox producer index. */
51929 uint32_t prod_idx;
51930 } cmdq_update_t, *pcmdq_update_t;
51931
51932 /* cmdq_base (size:128b/16B) */
51933
51934 typedef struct cmdq_base {
51935 /* Command opcode. */
51936 uint8_t opcode;
51937 /*
51938 * Create QP command allocates QP context with the specified
51939 * SQ, RQ/SRQ, CQ and other parameters.
51940 */
51941 #define CMDQ_BASE_OPCODE_CREATE_QP UINT32_C(0x1)
51942 /*
51943 * Destroy QP command deletes the QP context and ceases
51944 * any further reference.
51945 */
51946 #define CMDQ_BASE_OPCODE_DESTROY_QP UINT32_C(0x2)
51947 /*
51948 * Modify QP command changes QP states and other QP specific
51949 * parameters.
51950 */
51951 #define CMDQ_BASE_OPCODE_MODIFY_QP UINT32_C(0x3)
51952 /* Query QP command retrieves info about the specified QP. */
51953 #define CMDQ_BASE_OPCODE_QUERY_QP UINT32_C(0x4)
51954 /* Create SRQ command allocates a SRQ with the specified parameters. */
51955 #define CMDQ_BASE_OPCODE_CREATE_SRQ UINT32_C(0x5)
51956 /* Destroy SRQ command deletes and flushes the specified SRQ. */
51957 #define CMDQ_BASE_OPCODE_DESTROY_SRQ UINT32_C(0x6)
51958 /* Query SRP command retrieves info about the specified SRQ. */
51959 #define CMDQ_BASE_OPCODE_QUERY_SRQ UINT32_C(0x8)
51960 /* Create CQ command allocates a CQ with the specified parameters. */
51961 #define CMDQ_BASE_OPCODE_CREATE_CQ UINT32_C(0x9)
51962 /* Destroy CQ command deletes and flushes the specified CQ. */
51963 #define CMDQ_BASE_OPCODE_DESTROY_CQ UINT32_C(0xa)
51964 /* Resize CQ command resizes the specified CQ. */
51965 #define CMDQ_BASE_OPCODE_RESIZE_CQ UINT32_C(0xc)
51966 /*
51967 * Allocate MRW command allocates a MR/MW with the specified parameters
51968 * and returns the region's L_KEY/R_KEY
51969 */
51970 #define CMDQ_BASE_OPCODE_ALLOCATE_MRW UINT32_C(0xd)
51971 /* De-allocate key command frees a MR/MW entry associated with the specified key. */
51972 #define CMDQ_BASE_OPCODE_DEALLOCATE_KEY UINT32_C(0xe)
51973 /* Register MR command registers memory to the specified MR. */
51974 #define CMDQ_BASE_OPCODE_REGISTER_MR UINT32_C(0xf)
51975 /* Deregister MR command de-registers memory from the specified MR. */
51976 #define CMDQ_BASE_OPCODE_DEREGISTER_MR UINT32_C(0x10)
51977 /* Add GID command adds a GID to the local address table. */
51978 #define CMDQ_BASE_OPCODE_ADD_GID UINT32_C(0x11)
51979 /* Delete GID command deletes a GID from the local address table. */
51980 #define CMDQ_BASE_OPCODE_DELETE_GID UINT32_C(0x12)
51981 /* Modify GID command modifies a GID in the local address table. */
51982 #define CMDQ_BASE_OPCODE_MODIFY_GID UINT32_C(0x17)
51983 /* Query GID command queries a GID in the local address table. */
51984 #define CMDQ_BASE_OPCODE_QUERY_GID UINT32_C(0x18)
51985 /* Create QP1 command allocates a QP1 only. */
51986 #define CMDQ_BASE_OPCODE_CREATE_QP1 UINT32_C(0x13)
51987 /* Destroy QP1 command deletes and flushes the specified QP1. */
51988 #define CMDQ_BASE_OPCODE_DESTROY_QP1 UINT32_C(0x14)
51989 /* Create AH command allocates an AH with the specified parameters. */
51990 #define CMDQ_BASE_OPCODE_CREATE_AH UINT32_C(0x15)
51991 /* Destroy AH command deletes the specified AH. */
51992 #define CMDQ_BASE_OPCODE_DESTROY_AH UINT32_C(0x16)
51993 /*
51994 * Initialize firmware command initializes the firmware with
51995 * the specified parameters.
51996 */
51997 #define CMDQ_BASE_OPCODE_INITIALIZE_FW UINT32_C(0x80)
51998 /* De-initialize firmware command deinitializes the firmware. */
51999 #define CMDQ_BASE_OPCODE_DEINITIALIZE_FW UINT32_C(0x81)
52000 /* Stop the function */
52001 #define CMDQ_BASE_OPCODE_STOP_FUNC UINT32_C(0x82)
52002 /* Query the HW capabilities for the function. */
52003 #define CMDQ_BASE_OPCODE_QUERY_FUNC UINT32_C(0x83)
52004 /*
52005 * Set the following resources for the function:
52006 * - Max QP, CQ, MR+MW, SRQ per PF
52007 * - Max QP, CQ, MR+MW, SRQ per VF
52008 */
52009 #define CMDQ_BASE_OPCODE_SET_FUNC_RESOURCES UINT32_C(0x84)
52010 /* Read the current state of any internal resource context. Can only be issued from a PF. */
52011 #define CMDQ_BASE_OPCODE_READ_CONTEXT UINT32_C(0x85)
52012 /* Send a request from VF to pass a command to the PF. VF HSI is suspended until the PF returns the response */
52013 #define CMDQ_BASE_OPCODE_VF_BACKCHANNEL_REQUEST UINT32_C(0x86)
52014 /* Read VF memory (primarily to get the backchannel request blob). Can only be issued from a PF. */
52015 #define CMDQ_BASE_OPCODE_READ_VF_MEMORY UINT32_C(0x87)
52016 /* Write VF memory (primarily to put the backchannel response blob), and reenable VF HSI (post a CAG completion to it). Can only be issued from a PF. */
52017 #define CMDQ_BASE_OPCODE_COMPLETE_VF_REQUEST UINT32_C(0x88)
52018 /* Extend resource (QPC, MRW, CQ, SRQ) array, after the host allocates more. Can only be issued from a PF. */
52019 #define CMDQ_BASE_OPCODE_EXTEND_CONTEXT_ARRRAY UINT32_C(0x89)
52020 /* Map TC to COS. Can only be issued from a PF. */
52021 #define CMDQ_BASE_OPCODE_MAP_TC_TO_COS UINT32_C(0x8a)
52022 /* Query version. */
52023 #define CMDQ_BASE_OPCODE_QUERY_VERSION UINT32_C(0x8b)
52024 /* Modify congestion control. Can only be issued from a PF. */
52025 #define CMDQ_BASE_OPCODE_MODIFY_ROCE_CC UINT32_C(0x8c)
52026 /* Query congestion control. */
52027 #define CMDQ_BASE_OPCODE_QUERY_ROCE_CC UINT32_C(0x8d)
52028 /* Query RoCE statistics. */
52029 #define CMDQ_BASE_OPCODE_QUERY_ROCE_STATS UINT32_C(0x8e)
52030 /* Set LAG mode. */
52031 #define CMDQ_BASE_OPCODE_SET_LINK_AGGR_MODE UINT32_C(0x8f)
52032 /* Modify CQ */
52033 #define CMDQ_BASE_OPCODE_MODIFY_CQ UINT32_C(0x90)
52034 /*
52035 * Query QP for a PF other than the requesting PF. Also can query for more
52036 * than one QP.
52037 */
52038 #define CMDQ_BASE_OPCODE_QUERY_QP_EXTEND UINT32_C(0x91)
52039 /* Query extended RoCE statistics. */
52040 #define CMDQ_BASE_OPCODE_QUERY_ROCE_STATS_EXT UINT32_C(0x92)
52041 #define CMDQ_BASE_OPCODE_LAST CMDQ_BASE_OPCODE_QUERY_ROCE_STATS_EXT
52042 /* Size of the command in 16-byte units. */
52043 uint8_t cmd_size;
52044 /* Flags and attribs of the command. */
52045 uint16_t flags;
52046 /* Driver supplied handle to associate the command and the response. */
52047 uint16_t cookie;
52048 /* Size of the response buffer in 16-byte units. */
52049 uint8_t resp_size;
52050 uint8_t reserved8;
52051 /* Host address of the response. */
52052 uint64_t resp_addr;
52053 } cmdq_base_t, *pcmdq_base_t;
52054
52055 /* creq_base (size:128b/16B) */
52056
52057 typedef struct creq_base {
52058 uint8_t type;
52059 /*
52060 * This field indicates the exact type of the completion.
52061 * By convention, the LSB identifies the length of the
52062 * record in 16B units. Even values indicate 16B
52063 * records. Odd values indicate 32B
52064 * records.
52065 */
52066 #define CREQ_BASE_TYPE_MASK UINT32_C(0x3f)
52067 #define CREQ_BASE_TYPE_SFT 0
52068 /* QP Async Notification */
52069 #define CREQ_BASE_TYPE_QP_EVENT UINT32_C(0x38)
52070 /* Function Async Notification */
52071 #define CREQ_BASE_TYPE_FUNC_EVENT UINT32_C(0x3a)
52072 #define CREQ_BASE_TYPE_LAST CREQ_BASE_TYPE_FUNC_EVENT
52073 uint8_t reserved56[7];
52074 uint8_t v;
52075 /*
52076 * This value is written by the NIC such that it will be different
52077 * for each pass through the completion queue. The even passes
52078 * will write 1. The odd passes will write 0.
52079 */
52080 #define CREQ_BASE_V UINT32_C(0x1)
52081 /* This is the modifier on to the type field. */
52082 uint8_t event;
52083 uint8_t reserved48[6];
52084 } creq_base_t, *pcreq_base_t;
52085
52086 /*****************
52087 * query_version *
52088 *****************/
52089
52090
52091 /* cmdq_query_version (size:128b/16B) */
52092
52093 typedef struct cmdq_query_version {
52094 /* Command opcode. */
52095 uint8_t opcode;
52096 /* Query version. */
52097 #define CMDQ_QUERY_VERSION_OPCODE_QUERY_VERSION UINT32_C(0x8b)
52098 #define CMDQ_QUERY_VERSION_OPCODE_LAST CMDQ_QUERY_VERSION_OPCODE_QUERY_VERSION
52099 /* Size of the command in 16-byte units. */
52100 uint8_t cmd_size;
52101 /* Flags and attribs of the command. */
52102 uint16_t flags;
52103 /* Driver supplied handle to associate the command and the response. */
52104 uint16_t cookie;
52105 /* Size of the response buffer in 16-byte units. */
52106 uint8_t resp_size;
52107 uint8_t reserved8;
52108 /* Host address of the response. */
52109 uint64_t resp_addr;
52110 } cmdq_query_version_t, *pcmdq_query_version_t;
52111
52112 /* creq_query_version_resp (size:128b/16B) */
52113
52114 typedef struct creq_query_version_resp {
52115 uint8_t type;
52116 /*
52117 * This field indicates the exact type of the completion.
52118 * By convention, the LSB identifies the length of the
52119 * record in 16B units. Even values indicate 16B
52120 * records. Odd values indicate 32B
52121 * records.
52122 */
52123 #define CREQ_QUERY_VERSION_RESP_TYPE_MASK UINT32_C(0x3f)
52124 #define CREQ_QUERY_VERSION_RESP_TYPE_SFT 0
52125 /* QP Async Notification */
52126 #define CREQ_QUERY_VERSION_RESP_TYPE_QP_EVENT UINT32_C(0x38)
52127 #define CREQ_QUERY_VERSION_RESP_TYPE_LAST CREQ_QUERY_VERSION_RESP_TYPE_QP_EVENT
52128 /* Status of the response. */
52129 uint8_t status;
52130 /* Driver supplied handle to associate the command and the response. */
52131 uint16_t cookie;
52132 /* firmware major version */
52133 uint8_t fw_maj;
52134 /* firmware minor version */
52135 uint8_t fw_minor;
52136 /* firmware build version */
52137 uint8_t fw_bld;
52138 /* firmware reserved version */
52139 uint8_t fw_rsvd;
52140 uint8_t v;
52141 /*
52142 * This value is written by the NIC such that it will be different
52143 * for each pass through the completion queue. The even passes
52144 * will write 1. The odd passes will write 0.
52145 */
52146 #define CREQ_QUERY_VERSION_RESP_V UINT32_C(0x1)
52147 /* Event or command opcode. */
52148 uint8_t event;
52149 /* Query firmware and interface version response. */
52150 #define CREQ_QUERY_VERSION_RESP_EVENT_QUERY_VERSION UINT32_C(0x8b)
52151 #define CREQ_QUERY_VERSION_RESP_EVENT_LAST CREQ_QUERY_VERSION_RESP_EVENT_QUERY_VERSION
52152 uint16_t reserved16;
52153 /* interface major version */
52154 uint8_t intf_maj;
52155 /* interface minor version */
52156 uint8_t intf_minor;
52157 /* interface build version */
52158 uint8_t intf_bld;
52159 /* interface reserved version */
52160 uint8_t intf_rsvd;
52161 } creq_query_version_resp_t, *pcreq_query_version_resp_t;
52162
52163 /*****************
52164 * initialize_fw *
52165 *****************/
52166
52167
52168 /* cmdq_initialize_fw (size:896b/112B) */
52169
52170 typedef struct cmdq_initialize_fw {
52171 /* Command opcode. */
52172 uint8_t opcode;
52173 /*
52174 * Initialize firmware command initializes the firmware with
52175 * the specified parameters.
52176 */
52177 #define CMDQ_INITIALIZE_FW_OPCODE_INITIALIZE_FW UINT32_C(0x80)
52178 #define CMDQ_INITIALIZE_FW_OPCODE_LAST CMDQ_INITIALIZE_FW_OPCODE_INITIALIZE_FW
52179 /* Size of the command in 16-byte units. */
52180 uint8_t cmd_size;
52181 /* Flags and attribs of the command. */
52182 uint16_t flags;
52183 /*
52184 * When set, the 32b `max_mrw_per_vf` field is logically divided
52185 * into two 16b fields, `max_mr_per_vf` and `max_av_per_vf`.
52186 */
52187 #define CMDQ_INITIALIZE_FW_FLAGS_MRAV_RESERVATION_SPLIT UINT32_C(0x1)
52188 /* Driver supplied handle to associate the command and the response. */
52189 uint16_t cookie;
52190 /* Size of the response buffer in 16-byte units. */
52191 uint8_t resp_size;
52192 uint8_t reserved8;
52193 /* Host address of the response. */
52194 uint64_t resp_addr;
52195 uint8_t qpc_pg_size_qpc_lvl;
52196 /* QPC PBL indirect levels. */
52197 #define CMDQ_INITIALIZE_FW_QPC_LVL_MASK UINT32_C(0xf)
52198 #define CMDQ_INITIALIZE_FW_QPC_LVL_SFT 0
52199 /* PBL pointer is physical start address. */
52200 #define CMDQ_INITIALIZE_FW_QPC_LVL_LVL_0 UINT32_C(0x0)
52201 /* PBL pointer points to PTE table. */
52202 #define CMDQ_INITIALIZE_FW_QPC_LVL_LVL_1 UINT32_C(0x1)
52203 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
52204 #define CMDQ_INITIALIZE_FW_QPC_LVL_LVL_2 UINT32_C(0x2)
52205 #define CMDQ_INITIALIZE_FW_QPC_LVL_LAST CMDQ_INITIALIZE_FW_QPC_LVL_LVL_2
52206 /* QPC page size. */
52207 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_MASK UINT32_C(0xf0)
52208 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_SFT 4
52209 /* 4KB. */
52210 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
52211 /* 8KB. */
52212 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
52213 /* 64KB. */
52214 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
52215 /* 2MB. */
52216 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
52217 /* 8MB. */
52218 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
52219 /* 1GB. */
52220 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
52221 #define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_LAST CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_1G
52222 uint8_t mrw_pg_size_mrw_lvl;
52223 /* MRW PBL indirect levels. */
52224 #define CMDQ_INITIALIZE_FW_MRW_LVL_MASK UINT32_C(0xf)
52225 #define CMDQ_INITIALIZE_FW_MRW_LVL_SFT 0
52226 /* PBL pointer is physical start address. */
52227 #define CMDQ_INITIALIZE_FW_MRW_LVL_LVL_0 UINT32_C(0x0)
52228 /* PBL pointer points to PTE table. */
52229 #define CMDQ_INITIALIZE_FW_MRW_LVL_LVL_1 UINT32_C(0x1)
52230 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
52231 #define CMDQ_INITIALIZE_FW_MRW_LVL_LVL_2 UINT32_C(0x2)
52232 #define CMDQ_INITIALIZE_FW_MRW_LVL_LAST CMDQ_INITIALIZE_FW_MRW_LVL_LVL_2
52233 /* MRW page size. */
52234 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_MASK UINT32_C(0xf0)
52235 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_SFT 4
52236 /* 4KB. */
52237 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
52238 /* 8KB. */
52239 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
52240 /* 64KB. */
52241 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
52242 /* 2MB. */
52243 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
52244 /* 8MB. */
52245 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
52246 /* 1GB. */
52247 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
52248 #define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_LAST CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_1G
52249 uint8_t srq_pg_size_srq_lvl;
52250 /* SRQ PBL indirect levels. */
52251 #define CMDQ_INITIALIZE_FW_SRQ_LVL_MASK UINT32_C(0xf)
52252 #define CMDQ_INITIALIZE_FW_SRQ_LVL_SFT 0
52253 /* PBL pointer is physical start address. */
52254 #define CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_0 UINT32_C(0x0)
52255 /* PBL pointer points to PTE table. */
52256 #define CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_1 UINT32_C(0x1)
52257 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
52258 #define CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_2 UINT32_C(0x2)
52259 #define CMDQ_INITIALIZE_FW_SRQ_LVL_LAST CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_2
52260 /* SRQ page size. */
52261 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_MASK UINT32_C(0xf0)
52262 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_SFT 4
52263 /* 4KB. */
52264 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
52265 /* 8KB. */
52266 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
52267 /* 64KB. */
52268 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
52269 /* 2MB. */
52270 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
52271 /* 8MB. */
52272 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
52273 /* 1GB. */
52274 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
52275 #define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_LAST CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_1G
52276 uint8_t cq_pg_size_cq_lvl;
52277 /* CQ PBL indirect levels. */
52278 #define CMDQ_INITIALIZE_FW_CQ_LVL_MASK UINT32_C(0xf)
52279 #define CMDQ_INITIALIZE_FW_CQ_LVL_SFT 0
52280 /* PBL pointer is physical start address. */
52281 #define CMDQ_INITIALIZE_FW_CQ_LVL_LVL_0 UINT32_C(0x0)
52282 /* PBL pointer points to PTE table. */
52283 #define CMDQ_INITIALIZE_FW_CQ_LVL_LVL_1 UINT32_C(0x1)
52284 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
52285 #define CMDQ_INITIALIZE_FW_CQ_LVL_LVL_2 UINT32_C(0x2)
52286 #define CMDQ_INITIALIZE_FW_CQ_LVL_LAST CMDQ_INITIALIZE_FW_CQ_LVL_LVL_2
52287 /* CQ page size. */
52288 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_MASK UINT32_C(0xf0)
52289 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_SFT 4
52290 /* 4KB. */
52291 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
52292 /* 8KB. */
52293 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
52294 /* 64KB. */
52295 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
52296 /* 2MB. */
52297 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
52298 /* 8MB. */
52299 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
52300 /* 1GB. */
52301 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
52302 #define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_LAST CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_1G
52303 uint8_t tqm_pg_size_tqm_lvl;
52304 /* TQM PBL indirect levels. */
52305 #define CMDQ_INITIALIZE_FW_TQM_LVL_MASK UINT32_C(0xf)
52306 #define CMDQ_INITIALIZE_FW_TQM_LVL_SFT 0
52307 /* PBL pointer is physical start address. */
52308 #define CMDQ_INITIALIZE_FW_TQM_LVL_LVL_0 UINT32_C(0x0)
52309 /* PBL pointer points to PTE table. */
52310 #define CMDQ_INITIALIZE_FW_TQM_LVL_LVL_1 UINT32_C(0x1)
52311 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
52312 #define CMDQ_INITIALIZE_FW_TQM_LVL_LVL_2 UINT32_C(0x2)
52313 #define CMDQ_INITIALIZE_FW_TQM_LVL_LAST CMDQ_INITIALIZE_FW_TQM_LVL_LVL_2
52314 /* TQM page size. */
52315 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_MASK UINT32_C(0xf0)
52316 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_SFT 4
52317 /* 4KB. */
52318 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
52319 /* 8KB. */
52320 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
52321 /* 64KB. */
52322 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
52323 /* 2MB. */
52324 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
52325 /* 8MB. */
52326 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
52327 /* 1GB. */
52328 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
52329 #define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_LAST CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_1G
52330 uint8_t tim_pg_size_tim_lvl;
52331 /* TIM PBL indirect levels. */
52332 #define CMDQ_INITIALIZE_FW_TIM_LVL_MASK UINT32_C(0xf)
52333 #define CMDQ_INITIALIZE_FW_TIM_LVL_SFT 0
52334 /* PBL pointer is physical start address. */
52335 #define CMDQ_INITIALIZE_FW_TIM_LVL_LVL_0 UINT32_C(0x0)
52336 /* PBL pointer points to PTE table. */
52337 #define CMDQ_INITIALIZE_FW_TIM_LVL_LVL_1 UINT32_C(0x1)
52338 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
52339 #define CMDQ_INITIALIZE_FW_TIM_LVL_LVL_2 UINT32_C(0x2)
52340 #define CMDQ_INITIALIZE_FW_TIM_LVL_LAST CMDQ_INITIALIZE_FW_TIM_LVL_LVL_2
52341 /* TIM page size. */
52342 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_MASK UINT32_C(0xf0)
52343 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_SFT 4
52344 /* 4KB. */
52345 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
52346 /* 8KB. */
52347 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
52348 /* 64KB. */
52349 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
52350 /* 2MB. */
52351 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
52352 /* 8MB. */
52353 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
52354 /* 1GB. */
52355 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
52356 #define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_LAST CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_1G
52357 uint16_t log2_dbr_pg_size;
52358 /* Log base 2 of DBR page size - 12. 0 for 4KB. HW supported values are enumerated below. */
52359 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_MASK UINT32_C(0xf)
52360 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_SFT 0
52361 /* 4KB. */
52362 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_4K UINT32_C(0x0)
52363 /* 8KB. */
52364 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_8K UINT32_C(0x1)
52365 /* 16KB. */
52366 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_16K UINT32_C(0x2)
52367 /* 32KB. */
52368 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_32K UINT32_C(0x3)
52369 /* 64KB. */
52370 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_64K UINT32_C(0x4)
52371 /* 128KB. */
52372 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_128K UINT32_C(0x5)
52373 /* 256KB. */
52374 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_256K UINT32_C(0x6)
52375 /* 512KB. */
52376 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_512K UINT32_C(0x7)
52377 /* 1MB. */
52378 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_1M UINT32_C(0x8)
52379 /* 2MB. */
52380 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_2M UINT32_C(0x9)
52381 /* 4MB. */
52382 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_4M UINT32_C(0xa)
52383 /* 8MB. */
52384 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_8M UINT32_C(0xb)
52385 /* 16MB. */
52386 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_16M UINT32_C(0xc)
52387 /* 32MB. */
52388 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_32M UINT32_C(0xd)
52389 /* 64MB. */
52390 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_64M UINT32_C(0xe)
52391 /* 128MB. */
52392 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_128M UINT32_C(0xf)
52393 #define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_LAST CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_128M
52394 /* rsvd is 12 b */
52395 #define CMDQ_INITIALIZE_FW_RSVD_MASK UINT32_C(0xfff0)
52396 #define CMDQ_INITIALIZE_FW_RSVD_SFT 4
52397 /* Kernel notification queue page directory. */
52398 uint64_t qpc_page_dir;
52399 /* MRW page directory. */
52400 uint64_t mrw_page_dir;
52401 /* SRQ page directory. */
52402 uint64_t srq_page_dir;
52403 /* CQ page directory. */
52404 uint64_t cq_page_dir;
52405 /* TQM page directory. */
52406 uint64_t tqm_page_dir;
52407 /* TIM page directory. */
52408 uint64_t tim_page_dir;
52409 /* Number of QPs. */
52410 uint32_t number_of_qp;
52411 /* Number of MRWs. */
52412 uint32_t number_of_mrw;
52413 /* Number of SRQs. */
52414 uint32_t number_of_srq;
52415 /* Number of CQs. */
52416 uint32_t number_of_cq;
52417 /* Number of QPs per VF. */
52418 uint32_t max_qp_per_vf;
52419 /*
52420 * If the MR/AV split reservation flag is not set, then this field
52421 * represents the total number of MR plus AV entries allowed per
52422 * VF. For versions of firmware that support the split reservation,
52423 * when it is not specified half of the entries will be reserved
52424 * for MRs and the other half for AVs.
52425 *
52426 * If the MR/AV split reservation flag is set, then this
52427 * field is logically divided into two 16b fields. Bits `[31:16]`
52428 * represents the `max_mr_per_vf` and bits `[15:0]` represents
52429 * `max_av_per_vf`. The granularity of these values is defined by
52430 * the `mrav_num_entries_unit` field returned by the
52431 * `backing_store_qcaps` command.
52432 */
52433 uint32_t max_mrw_per_vf;
52434 /* Number of SRQs per VF. */
52435 uint32_t max_srq_per_vf;
52436 /* Number of CQs per VF. */
52437 uint32_t max_cq_per_vf;
52438 /* Number of GIDs per VF. */
52439 uint32_t max_gid_per_vf;
52440 /* Statistics context index for this function. */
52441 uint32_t stat_ctx_id;
52442 } cmdq_initialize_fw_t, *pcmdq_initialize_fw_t;
52443
52444 /* creq_initialize_fw_resp (size:128b/16B) */
52445
52446 typedef struct creq_initialize_fw_resp {
52447 uint8_t type;
52448 /*
52449 * This field indicates the exact type of the completion.
52450 * By convention, the LSB identifies the length of the
52451 * record in 16B units. Even values indicate 16B
52452 * records. Odd values indicate 32B
52453 * records.
52454 */
52455 #define CREQ_INITIALIZE_FW_RESP_TYPE_MASK UINT32_C(0x3f)
52456 #define CREQ_INITIALIZE_FW_RESP_TYPE_SFT 0
52457 /* QP Async Notification */
52458 #define CREQ_INITIALIZE_FW_RESP_TYPE_QP_EVENT UINT32_C(0x38)
52459 #define CREQ_INITIALIZE_FW_RESP_TYPE_LAST CREQ_INITIALIZE_FW_RESP_TYPE_QP_EVENT
52460 /* Status of the response. */
52461 uint8_t status;
52462 /* Driver supplied handle to associate the command and the response. */
52463 uint16_t cookie;
52464 uint32_t reserved32;
52465 uint8_t v;
52466 /*
52467 * This value is written by the NIC such that it will be different
52468 * for each pass through the completion queue. The even passes
52469 * will write 1. The odd passes will write 0.
52470 */
52471 #define CREQ_INITIALIZE_FW_RESP_V UINT32_C(0x1)
52472 /* Event or command opcode. */
52473 uint8_t event;
52474 /* Initialize firmware command response. */
52475 #define CREQ_INITIALIZE_FW_RESP_EVENT_INITIALIZE_FW UINT32_C(0x80)
52476 #define CREQ_INITIALIZE_FW_RESP_EVENT_LAST CREQ_INITIALIZE_FW_RESP_EVENT_INITIALIZE_FW
52477 uint8_t reserved48[6];
52478 } creq_initialize_fw_resp_t, *pcreq_initialize_fw_resp_t;
52479
52480 /*******************
52481 * deinitialize_fw *
52482 *******************/
52483
52484
52485 /* cmdq_deinitialize_fw (size:128b/16B) */
52486
52487 typedef struct cmdq_deinitialize_fw {
52488 /* Command opcode. */
52489 uint8_t opcode;
52490 /* De-initialize firmware command deinitializes the firmware. */
52491 #define CMDQ_DEINITIALIZE_FW_OPCODE_DEINITIALIZE_FW UINT32_C(0x81)
52492 #define CMDQ_DEINITIALIZE_FW_OPCODE_LAST CMDQ_DEINITIALIZE_FW_OPCODE_DEINITIALIZE_FW
52493 /* Size of the command in 16-byte units. */
52494 uint8_t cmd_size;
52495 /* Flags and attribs of the command. */
52496 uint16_t flags;
52497 /* Driver supplied handle to associate the command and the response. */
52498 uint16_t cookie;
52499 /* Size of the response buffer in 16-byte units. */
52500 uint8_t resp_size;
52501 uint8_t reserved8;
52502 /* Host address of the response. */
52503 uint64_t resp_addr;
52504 } cmdq_deinitialize_fw_t, *pcmdq_deinitialize_fw_t;
52505
52506 /* creq_deinitialize_fw_resp (size:128b/16B) */
52507
52508 typedef struct creq_deinitialize_fw_resp {
52509 uint8_t type;
52510 /*
52511 * This field indicates the exact type of the completion.
52512 * By convention, the LSB identifies the length of the
52513 * record in 16B units. Even values indicate 16B
52514 * records. Odd values indicate 32B
52515 * records.
52516 */
52517 #define CREQ_DEINITIALIZE_FW_RESP_TYPE_MASK UINT32_C(0x3f)
52518 #define CREQ_DEINITIALIZE_FW_RESP_TYPE_SFT 0
52519 /* QP Async Notification */
52520 #define CREQ_DEINITIALIZE_FW_RESP_TYPE_QP_EVENT UINT32_C(0x38)
52521 #define CREQ_DEINITIALIZE_FW_RESP_TYPE_LAST CREQ_DEINITIALIZE_FW_RESP_TYPE_QP_EVENT
52522 /* Status of the response. */
52523 uint8_t status;
52524 /* Driver supplied handle to associate the command and the response. */
52525 uint16_t cookie;
52526 uint32_t reserved32;
52527 uint8_t v;
52528 /*
52529 * This value is written by the NIC such that it will be different
52530 * for each pass through the completion queue. The even passes
52531 * will write 1. The odd passes will write 0.
52532 */
52533 #define CREQ_DEINITIALIZE_FW_RESP_V UINT32_C(0x1)
52534 /* Event or command opcode. */
52535 uint8_t event;
52536 /* De-initialize firmware command response. */
52537 #define CREQ_DEINITIALIZE_FW_RESP_EVENT_DEINITIALIZE_FW UINT32_C(0x81)
52538 #define CREQ_DEINITIALIZE_FW_RESP_EVENT_LAST CREQ_DEINITIALIZE_FW_RESP_EVENT_DEINITIALIZE_FW
52539 uint8_t reserved48[6];
52540 } creq_deinitialize_fw_resp_t, *pcreq_deinitialize_fw_resp_t;
52541
52542 /*************
52543 * create_qp *
52544 *************/
52545
52546
52547 /* cmdq_create_qp (size:768b/96B) */
52548
52549 typedef struct cmdq_create_qp {
52550 /* Command opcode. */
52551 uint8_t opcode;
52552 /*
52553 * Create QP command allocates QP context with the specified
52554 * SQ, RQ/SRQ, CQ and other parameters.
52555 */
52556 #define CMDQ_CREATE_QP_OPCODE_CREATE_QP UINT32_C(0x1)
52557 #define CMDQ_CREATE_QP_OPCODE_LAST CMDQ_CREATE_QP_OPCODE_CREATE_QP
52558 /* Size of the command in 16-byte units. */
52559 uint8_t cmd_size;
52560 /* Flags and attribs of the command. */
52561 uint16_t flags;
52562 /* Driver supplied handle to associate the command and the response. */
52563 uint16_t cookie;
52564 /* Size of the response buffer in 16-byte units. */
52565 uint8_t resp_size;
52566 uint8_t reserved8;
52567 /* Host address of the response. */
52568 uint64_t resp_addr;
52569 /* QP handle. */
52570 uint64_t qp_handle;
52571 /* Create QP flags. */
52572 uint32_t qp_flags;
52573 /* SRQ is used. */
52574 #define CMDQ_CREATE_QP_QP_FLAGS_SRQ_USED UINT32_C(0x1)
52575 /* post CQE for all SQ WQEs. */
52576 #define CMDQ_CREATE_QP_QP_FLAGS_FORCE_COMPLETION UINT32_C(0x2)
52577 /* This QP can use reserved L_Key */
52578 #define CMDQ_CREATE_QP_QP_FLAGS_RESERVED_LKEY_ENABLE UINT32_C(0x4)
52579 /* This QP can fast register physical memory */
52580 #define CMDQ_CREATE_QP_QP_FLAGS_FR_PMR_ENABLED UINT32_C(0x8)
52581 /* This QP can send variable sized WQEs. */
52582 #define CMDQ_CREATE_QP_QP_FLAGS_VARIABLE_SIZED_WQE_ENABLED UINT32_C(0x10)
52583 /*
52584 * WQEs with inline data sent on this QP are able to flow
52585 * through an optimized transmit path to lower latency. This
52586 * transmit path is opportunistic and not guaranteed to always
52587 * occur.
52588 */
52589 #define CMDQ_CREATE_QP_QP_FLAGS_OPTIMIZED_TRANSMIT_ENABLED UINT32_C(0x20)
52590 /*
52591 * For UD QPs the default responder CQE format is `cq_res_ud`.
52592 * This flag specifies the `cq_res_ud_cfa` format to be used
52593 * instead.
52594 */
52595 #define CMDQ_CREATE_QP_QP_FLAGS_RESPONDER_UD_CQE_WITH_CFA UINT32_C(0x40)
52596 /*
52597 * This QP must be included in the extended RoCE statistics
52598 * that can be queried via `query_roce_stats_ext`.
52599 */
52600 #define CMDQ_CREATE_QP_QP_FLAGS_EXT_STATS_ENABLED UINT32_C(0x80)
52601 #define CMDQ_CREATE_QP_QP_FLAGS_LAST CMDQ_CREATE_QP_QP_FLAGS_EXT_STATS_ENABLED
52602 /* Supported QP types. */
52603 uint8_t type;
52604 /* Reliable Connection. */
52605 #define CMDQ_CREATE_QP_TYPE_RC UINT32_C(0x2)
52606 /* Unreliable Datagram. */
52607 #define CMDQ_CREATE_QP_TYPE_UD UINT32_C(0x4)
52608 /* Raw Ethertype. */
52609 #define CMDQ_CREATE_QP_TYPE_RAW_ETHERTYPE UINT32_C(0x6)
52610 /* General Services Interface on QP1 over UD. */
52611 #define CMDQ_CREATE_QP_TYPE_GSI UINT32_C(0x7)
52612 #define CMDQ_CREATE_QP_TYPE_LAST CMDQ_CREATE_QP_TYPE_GSI
52613 uint8_t sq_pg_size_sq_lvl;
52614 /* SQ PBL indirect levels. */
52615 #define CMDQ_CREATE_QP_SQ_LVL_MASK UINT32_C(0xf)
52616 #define CMDQ_CREATE_QP_SQ_LVL_SFT 0
52617 /* PBL pointer is physical start address. */
52618 #define CMDQ_CREATE_QP_SQ_LVL_LVL_0 UINT32_C(0x0)
52619 /* PBL pointer points to PTE table. */
52620 #define CMDQ_CREATE_QP_SQ_LVL_LVL_1 UINT32_C(0x1)
52621 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
52622 #define CMDQ_CREATE_QP_SQ_LVL_LVL_2 UINT32_C(0x2)
52623 #define CMDQ_CREATE_QP_SQ_LVL_LAST CMDQ_CREATE_QP_SQ_LVL_LVL_2
52624 /* SQ page size. */
52625 #define CMDQ_CREATE_QP_SQ_PG_SIZE_MASK UINT32_C(0xf0)
52626 #define CMDQ_CREATE_QP_SQ_PG_SIZE_SFT 4
52627 /* 4KB. */
52628 #define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
52629 /* 8KB. */
52630 #define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
52631 /* 64KB. */
52632 #define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
52633 /* 2MB. */
52634 #define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
52635 /* 8MB. */
52636 #define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
52637 /* 1GB. */
52638 #define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
52639 #define CMDQ_CREATE_QP_SQ_PG_SIZE_LAST CMDQ_CREATE_QP_SQ_PG_SIZE_PG_1G
52640 uint8_t rq_pg_size_rq_lvl;
52641 /* RQ PBL indirect levels. */
52642 #define CMDQ_CREATE_QP_RQ_LVL_MASK UINT32_C(0xf)
52643 #define CMDQ_CREATE_QP_RQ_LVL_SFT 0
52644 /* PBL pointer is physical start address. */
52645 #define CMDQ_CREATE_QP_RQ_LVL_LVL_0 UINT32_C(0x0)
52646 /* PBL pointer points to PTE table. */
52647 #define CMDQ_CREATE_QP_RQ_LVL_LVL_1 UINT32_C(0x1)
52648 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
52649 #define CMDQ_CREATE_QP_RQ_LVL_LVL_2 UINT32_C(0x2)
52650 #define CMDQ_CREATE_QP_RQ_LVL_LAST CMDQ_CREATE_QP_RQ_LVL_LVL_2
52651 /* RQ page size. */
52652 #define CMDQ_CREATE_QP_RQ_PG_SIZE_MASK UINT32_C(0xf0)
52653 #define CMDQ_CREATE_QP_RQ_PG_SIZE_SFT 4
52654 /* 4KB. */
52655 #define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
52656 /* 8KB. */
52657 #define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
52658 /* 64KB. */
52659 #define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
52660 /* 2MB. */
52661 #define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
52662 /* 8MB. */
52663 #define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
52664 /* 1GB. */
52665 #define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
52666 #define CMDQ_CREATE_QP_RQ_PG_SIZE_LAST CMDQ_CREATE_QP_RQ_PG_SIZE_PG_1G
52667 uint8_t unused_0;
52668 /* Doorbell page index. */
52669 uint32_t dpi;
52670 /* Max number of SQ wqes. */
52671 uint32_t sq_size;
52672 /* Max number of RQ wqes. */
52673 uint32_t rq_size;
52674 uint16_t sq_fwo_sq_sge;
52675 /* Max send SGEs per SWQE. */
52676 #define CMDQ_CREATE_QP_SQ_SGE_MASK UINT32_C(0xf)
52677 #define CMDQ_CREATE_QP_SQ_SGE_SFT 0
52678 /* Offset of First WQE in the first SQ page, in 128 byte units */
52679 #define CMDQ_CREATE_QP_SQ_FWO_MASK UINT32_C(0xfff0)
52680 #define CMDQ_CREATE_QP_SQ_FWO_SFT 4
52681 uint16_t rq_fwo_rq_sge;
52682 /*
52683 * Max recv SGEs per RWQE.
52684 * On chips with variable-size WQE support, a value of zero implies 30 SGEs.
52685 */
52686 #define CMDQ_CREATE_QP_RQ_SGE_MASK UINT32_C(0xf)
52687 #define CMDQ_CREATE_QP_RQ_SGE_SFT 0
52688 /* Offset of First WQE in the first RQ page, in 128 byte units */
52689 #define CMDQ_CREATE_QP_RQ_FWO_MASK UINT32_C(0xfff0)
52690 #define CMDQ_CREATE_QP_RQ_FWO_SFT 4
52691 /* Send CQ context id. */
52692 uint32_t scq_cid;
52693 /* Receive CQ context id. */
52694 uint32_t rcq_cid;
52695 /* SRQ context id. */
52696 uint32_t srq_cid;
52697 /* Protection domain id. */
52698 uint32_t pd_id;
52699 /* SQ PBL physical address. */
52700 uint64_t sq_pbl;
52701 /* RQ PBL physical address. */
52702 uint64_t rq_pbl;
52703 /* IRRQ address. */
52704 uint64_t irrq_addr;
52705 /* ORRQ address. */
52706 uint64_t orrq_addr;
52707 } cmdq_create_qp_t, *pcmdq_create_qp_t;
52708
52709 /* creq_create_qp_resp (size:128b/16B) */
52710
52711 typedef struct creq_create_qp_resp {
52712 uint8_t type;
52713 /*
52714 * This field indicates the exact type of the completion.
52715 * By convention, the LSB identifies the length of the
52716 * record in 16B units. Even values indicate 16B
52717 * records. Odd values indicate 32B
52718 * records.
52719 */
52720 #define CREQ_CREATE_QP_RESP_TYPE_MASK UINT32_C(0x3f)
52721 #define CREQ_CREATE_QP_RESP_TYPE_SFT 0
52722 /* QP Async Notification */
52723 #define CREQ_CREATE_QP_RESP_TYPE_QP_EVENT UINT32_C(0x38)
52724 #define CREQ_CREATE_QP_RESP_TYPE_LAST CREQ_CREATE_QP_RESP_TYPE_QP_EVENT
52725 /* Status of the response. */
52726 uint8_t status;
52727 /* Driver supplied handle to associate the command and the response. */
52728 uint16_t cookie;
52729 /* QP context id */
52730 uint32_t xid;
52731 uint8_t v;
52732 /*
52733 * This value is written by the NIC such that it will be different
52734 * for each pass through the completion queue. The even passes
52735 * will write 1. The odd passes will write 0.
52736 */
52737 #define CREQ_CREATE_QP_RESP_V UINT32_C(0x1)
52738 /* Event or command opcode. */
52739 uint8_t event;
52740 /* Create QP command response. */
52741 #define CREQ_CREATE_QP_RESP_EVENT_CREATE_QP UINT32_C(0x1)
52742 #define CREQ_CREATE_QP_RESP_EVENT_LAST CREQ_CREATE_QP_RESP_EVENT_CREATE_QP
52743 /*
52744 * Support for optimized transmit path to lower latency
52745 * for WQEs with inline data has been enabled for this QP.
52746 */
52747 uint8_t optimized_transmit_enabled;
52748 uint8_t reserved48[5];
52749 } creq_create_qp_resp_t, *pcreq_create_qp_resp_t;
52750
52751 /**************
52752 * destroy_qp *
52753 **************/
52754
52755
52756 /* cmdq_destroy_qp (size:192b/24B) */
52757
52758 typedef struct cmdq_destroy_qp {
52759 /* Command opcode. */
52760 uint8_t opcode;
52761 /*
52762 * Destroy QP command deletes the QP context and ceases
52763 * any further reference.
52764 */
52765 #define CMDQ_DESTROY_QP_OPCODE_DESTROY_QP UINT32_C(0x2)
52766 #define CMDQ_DESTROY_QP_OPCODE_LAST CMDQ_DESTROY_QP_OPCODE_DESTROY_QP
52767 /* Size of the command in 16-byte units. */
52768 uint8_t cmd_size;
52769 /* Flags and attribs of the command. */
52770 uint16_t flags;
52771 /* Driver supplied handle to associate the command and the response. */
52772 uint16_t cookie;
52773 /* Size of the response buffer in 16-byte units. */
52774 uint8_t resp_size;
52775 uint8_t reserved8;
52776 /* Host address of the response. */
52777 uint64_t resp_addr;
52778 /* QP context id */
52779 uint32_t qp_cid;
52780 uint32_t unused_0;
52781 } cmdq_destroy_qp_t, *pcmdq_destroy_qp_t;
52782
52783 /* creq_destroy_qp_resp (size:128b/16B) */
52784
52785 typedef struct creq_destroy_qp_resp {
52786 uint8_t type;
52787 /*
52788 * This field indicates the exact type of the completion.
52789 * By convention, the LSB identifies the length of the
52790 * record in 16B units. Even values indicate 16B
52791 * records. Odd values indicate 32B
52792 * records.
52793 */
52794 #define CREQ_DESTROY_QP_RESP_TYPE_MASK UINT32_C(0x3f)
52795 #define CREQ_DESTROY_QP_RESP_TYPE_SFT 0
52796 /* QP Async Notification */
52797 #define CREQ_DESTROY_QP_RESP_TYPE_QP_EVENT UINT32_C(0x38)
52798 #define CREQ_DESTROY_QP_RESP_TYPE_LAST CREQ_DESTROY_QP_RESP_TYPE_QP_EVENT
52799 /* Status of the response. */
52800 uint8_t status;
52801 /* Driver supplied handle to associate the command and the response. */
52802 uint16_t cookie;
52803 /* QP context id */
52804 uint32_t xid;
52805 uint8_t v;
52806 /*
52807 * This value is written by the NIC such that it will be different
52808 * for each pass through the completion queue. The even passes
52809 * will write 1. The odd passes will write 0.
52810 */
52811 #define CREQ_DESTROY_QP_RESP_V UINT32_C(0x1)
52812 /* Event or command opcode. */
52813 uint8_t event;
52814 /* Destroy QP command response. */
52815 #define CREQ_DESTROY_QP_RESP_EVENT_DESTROY_QP UINT32_C(0x2)
52816 #define CREQ_DESTROY_QP_RESP_EVENT_LAST CREQ_DESTROY_QP_RESP_EVENT_DESTROY_QP
52817 uint8_t reserved48[6];
52818 } creq_destroy_qp_resp_t, *pcreq_destroy_qp_resp_t;
52819
52820 /*************
52821 * modify_qp *
52822 *************/
52823
52824
52825 /* cmdq_modify_qp (size:1024b/128B) */
52826
52827 typedef struct cmdq_modify_qp {
52828 /* Command opcode. */
52829 uint8_t opcode;
52830 /*
52831 * Modify QP command changes QP states and other QP specific
52832 * parameters.
52833 */
52834 #define CMDQ_MODIFY_QP_OPCODE_MODIFY_QP UINT32_C(0x3)
52835 #define CMDQ_MODIFY_QP_OPCODE_LAST CMDQ_MODIFY_QP_OPCODE_MODIFY_QP
52836 /* Size of the command in 16-byte units. */
52837 uint8_t cmd_size;
52838 /* Flags and attribs of the command. */
52839 uint16_t flags;
52840 /* Driver supplied handle to associate the command and the response. */
52841 uint16_t cookie;
52842 /* Size of the response buffer in 16-byte units. */
52843 uint8_t resp_size;
52844 uint8_t reserved8;
52845 /* Host address of the response. */
52846 uint64_t resp_addr;
52847 /* Modify mask signifies the field that is requesting the change. */
52848 uint32_t modify_mask;
52849 /* QP state change. */
52850 #define CMDQ_MODIFY_QP_MODIFY_MASK_STATE UINT32_C(0x1)
52851 /* Enable SQ drain asynchronous notification change. */
52852 #define CMDQ_MODIFY_QP_MODIFY_MASK_EN_SQD_ASYNC_NOTIFY UINT32_C(0x2)
52853 /* Access change. */
52854 #define CMDQ_MODIFY_QP_MODIFY_MASK_ACCESS UINT32_C(0x4)
52855 /* P_KEY change. */
52856 #define CMDQ_MODIFY_QP_MODIFY_MASK_PKEY UINT32_C(0x8)
52857 /* Q_KEY index change. */
52858 #define CMDQ_MODIFY_QP_MODIFY_MASK_QKEY UINT32_C(0x10)
52859 /* Destination GID change. */
52860 #define CMDQ_MODIFY_QP_MODIFY_MASK_DGID UINT32_C(0x20)
52861 /* Flow label change. */
52862 #define CMDQ_MODIFY_QP_MODIFY_MASK_FLOW_LABEL UINT32_C(0x40)
52863 /* SGID change. */
52864 #define CMDQ_MODIFY_QP_MODIFY_MASK_SGID_INDEX UINT32_C(0x80)
52865 /* Hop limit change. */
52866 #define CMDQ_MODIFY_QP_MODIFY_MASK_HOP_LIMIT UINT32_C(0x100)
52867 /* Traffic class change. */
52868 #define CMDQ_MODIFY_QP_MODIFY_MASK_TRAFFIC_CLASS UINT32_C(0x200)
52869 /* destination MAC change. */
52870 #define CMDQ_MODIFY_QP_MODIFY_MASK_DEST_MAC UINT32_C(0x400)
52871 /* Ping pong push mode change. */
52872 #define CMDQ_MODIFY_QP_MODIFY_MASK_PINGPONG_PUSH_MODE UINT32_C(0x800)
52873 /* Path MTU change. */
52874 #define CMDQ_MODIFY_QP_MODIFY_MASK_PATH_MTU UINT32_C(0x1000)
52875 /* Timeout change. */
52876 #define CMDQ_MODIFY_QP_MODIFY_MASK_TIMEOUT UINT32_C(0x2000)
52877 /* Retry count change. */
52878 #define CMDQ_MODIFY_QP_MODIFY_MASK_RETRY_CNT UINT32_C(0x4000)
52879 /* RNR Retry change. */
52880 #define CMDQ_MODIFY_QP_MODIFY_MASK_RNR_RETRY UINT32_C(0x8000)
52881 /* RQ start packet sequence number change. */
52882 #define CMDQ_MODIFY_QP_MODIFY_MASK_RQ_PSN UINT32_C(0x10000)
52883 /* Max outstanding RDMA read atomic change. */
52884 #define CMDQ_MODIFY_QP_MODIFY_MASK_MAX_RD_ATOMIC UINT32_C(0x20000)
52885 /* RNR minimum timer change. */
52886 #define CMDQ_MODIFY_QP_MODIFY_MASK_MIN_RNR_TIMER UINT32_C(0x40000)
52887 /* SQ start packet sequence number change. */
52888 #define CMDQ_MODIFY_QP_MODIFY_MASK_SQ_PSN UINT32_C(0x80000)
52889 /* Max destination outstanding RDMA read atomic change. */
52890 #define CMDQ_MODIFY_QP_MODIFY_MASK_MAX_DEST_RD_ATOMIC UINT32_C(0x100000)
52891 /* Max send WQE change. */
52892 #define CMDQ_MODIFY_QP_MODIFY_MASK_SQ_SIZE UINT32_C(0x200000)
52893 /* Max recv WQE change. */
52894 #define CMDQ_MODIFY_QP_MODIFY_MASK_RQ_SIZE UINT32_C(0x400000)
52895 /* Max recv SGEs per SWQE change. */
52896 #define CMDQ_MODIFY_QP_MODIFY_MASK_SQ_SGE UINT32_C(0x800000)
52897 /* Max send SGEs per RWQE change. */
52898 #define CMDQ_MODIFY_QP_MODIFY_MASK_RQ_SGE UINT32_C(0x1000000)
52899 /* Max inline data length change. */
52900 #define CMDQ_MODIFY_QP_MODIFY_MASK_MAX_INLINE_DATA UINT32_C(0x2000000)
52901 /* Destination QP id change. */
52902 #define CMDQ_MODIFY_QP_MODIFY_MASK_DEST_QP_ID UINT32_C(0x4000000)
52903 /* Source MAC change. */
52904 #define CMDQ_MODIFY_QP_MODIFY_MASK_SRC_MAC UINT32_C(0x8000000)
52905 /* Source VLAN id change. */
52906 #define CMDQ_MODIFY_QP_MODIFY_MASK_VLAN_ID UINT32_C(0x10000000)
52907 /* Congestion control RoCE v2 change. */
52908 #define CMDQ_MODIFY_QP_MODIFY_MASK_ENABLE_CC UINT32_C(0x20000000)
52909 /* IP TOS ECN change */
52910 #define CMDQ_MODIFY_QP_MODIFY_MASK_TOS_ECN UINT32_C(0x40000000)
52911 /* IP TOS DSCP change */
52912 #define CMDQ_MODIFY_QP_MODIFY_MASK_TOS_DSCP UINT32_C(0x80000000)
52913 /* QP context id */
52914 uint32_t qp_cid;
52915 uint8_t network_type_en_sqd_async_notify_new_state;
52916 /* New QP state. */
52917 #define CMDQ_MODIFY_QP_NEW_STATE_MASK UINT32_C(0xf)
52918 #define CMDQ_MODIFY_QP_NEW_STATE_SFT 0
52919 /* Reset. */
52920 #define CMDQ_MODIFY_QP_NEW_STATE_RESET UINT32_C(0x0)
52921 /* Init. */
52922 #define CMDQ_MODIFY_QP_NEW_STATE_INIT UINT32_C(0x1)
52923 /* Ready To Receive. */
52924 #define CMDQ_MODIFY_QP_NEW_STATE_RTR UINT32_C(0x2)
52925 /* Ready To Send. */
52926 #define CMDQ_MODIFY_QP_NEW_STATE_RTS UINT32_C(0x3)
52927 /* SQ Drain. */
52928 #define CMDQ_MODIFY_QP_NEW_STATE_SQD UINT32_C(0x4)
52929 /* SQ Error. */
52930 #define CMDQ_MODIFY_QP_NEW_STATE_SQE UINT32_C(0x5)
52931 /* Error. */
52932 #define CMDQ_MODIFY_QP_NEW_STATE_ERR UINT32_C(0x6)
52933 #define CMDQ_MODIFY_QP_NEW_STATE_LAST CMDQ_MODIFY_QP_NEW_STATE_ERR
52934 /* Enable SQ drain asynchronous notification. */
52935 #define CMDQ_MODIFY_QP_EN_SQD_ASYNC_NOTIFY UINT32_C(0x10)
52936 /* unused1 is 1 b */
52937 #define CMDQ_MODIFY_QP_UNUSED1 UINT32_C(0x20)
52938 /* network type. */
52939 #define CMDQ_MODIFY_QP_NETWORK_TYPE_MASK UINT32_C(0xc0)
52940 #define CMDQ_MODIFY_QP_NETWORK_TYPE_SFT 6
52941 /* RoCEv1. */
52942 #define CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV1 (UINT32_C(0x0) << 6)
52943 /* RoCEv2 IPv4. */
52944 #define CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV2_IPV4 (UINT32_C(0x2) << 6)
52945 /* RoCEv2 IPv6. */
52946 #define CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV2_IPV6 (UINT32_C(0x3) << 6)
52947 #define CMDQ_MODIFY_QP_NETWORK_TYPE_LAST CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV2_IPV6
52948 /* Access flags. */
52949 uint8_t access;
52950 #define CMDQ_MODIFY_QP_ACCESS_REMOTE_ATOMIC_REMOTE_READ_REMOTE_WRITE_LOCAL_WRITE_MASK UINT32_C(0xff)
52951 #define CMDQ_MODIFY_QP_ACCESS_REMOTE_ATOMIC_REMOTE_READ_REMOTE_WRITE_LOCAL_WRITE_SFT 0
52952 /* Local write access. */
52953 #define CMDQ_MODIFY_QP_ACCESS_LOCAL_WRITE UINT32_C(0x1)
52954 /* Remote write access. */
52955 #define CMDQ_MODIFY_QP_ACCESS_REMOTE_WRITE UINT32_C(0x2)
52956 /* Remote read access. */
52957 #define CMDQ_MODIFY_QP_ACCESS_REMOTE_READ UINT32_C(0x4)
52958 /* Remote atomic access. */
52959 #define CMDQ_MODIFY_QP_ACCESS_REMOTE_ATOMIC UINT32_C(0x8)
52960 /* P_KEY. */
52961 uint16_t pkey;
52962 /* Q_KEY. */
52963 uint32_t qkey;
52964 /* Destination GID. */
52965 uint32_t dgid[4];
52966 /* Flow label. */
52967 uint32_t flow_label;
52968 /* Source GID index. */
52969 uint16_t sgid_index;
52970 /* Hop limit. */
52971 uint8_t hop_limit;
52972 /* Traffic class. */
52973 uint8_t traffic_class;
52974 /* Destination MAC address. */
52975 uint16_t dest_mac[3];
52976 uint8_t tos_dscp_tos_ecn;
52977 /* IP TOS ECN. Valid values are 1 or 2 when ECN is enabled. */
52978 #define CMDQ_MODIFY_QP_TOS_ECN_MASK UINT32_C(0x3)
52979 #define CMDQ_MODIFY_QP_TOS_ECN_SFT 0
52980 /* IP TOS DSCP. */
52981 #define CMDQ_MODIFY_QP_TOS_DSCP_MASK UINT32_C(0xfc)
52982 #define CMDQ_MODIFY_QP_TOS_DSCP_SFT 2
52983 uint8_t path_mtu_pingpong_push_enable;
52984 /*
52985 * Driver requests for ping pong push mode to be enbabled for this
52986 * QP. This request can be done only during modify from RST to INIT
52987 * state.
52988 */
52989 #define CMDQ_MODIFY_QP_PINGPONG_PUSH_ENABLE UINT32_C(0x1)
52990 /* unused3 is 3 b */
52991 #define CMDQ_MODIFY_QP_UNUSED3_MASK UINT32_C(0xe)
52992 #define CMDQ_MODIFY_QP_UNUSED3_SFT 1
52993 /* Path MTU. */
52994 #define CMDQ_MODIFY_QP_PATH_MTU_MASK UINT32_C(0xf0)
52995 #define CMDQ_MODIFY_QP_PATH_MTU_SFT 4
52996 /* 256. */
52997 #define CMDQ_MODIFY_QP_PATH_MTU_MTU_256 (UINT32_C(0x0) << 4)
52998 /* 512. */
52999 #define CMDQ_MODIFY_QP_PATH_MTU_MTU_512 (UINT32_C(0x1) << 4)
53000 /* 1024. */
53001 #define CMDQ_MODIFY_QP_PATH_MTU_MTU_1024 (UINT32_C(0x2) << 4)
53002 /* 2048. */
53003 #define CMDQ_MODIFY_QP_PATH_MTU_MTU_2048 (UINT32_C(0x3) << 4)
53004 /* 4096. */
53005 #define CMDQ_MODIFY_QP_PATH_MTU_MTU_4096 (UINT32_C(0x4) << 4)
53006 /* 8192. */
53007 #define CMDQ_MODIFY_QP_PATH_MTU_MTU_8192 (UINT32_C(0x5) << 4)
53008 #define CMDQ_MODIFY_QP_PATH_MTU_LAST CMDQ_MODIFY_QP_PATH_MTU_MTU_8192
53009 /* Timeout value for SWQEs. */
53010 uint8_t timeout;
53011 /* Max retry count for WQEs. */
53012 uint8_t retry_cnt;
53013 /* Max RNR retry count for WQEs. */
53014 uint8_t rnr_retry;
53015 /* Min RNR timer that the QP will report to the remote. */
53016 uint8_t min_rnr_timer;
53017 /* RQ start packet sequence number. */
53018 uint32_t rq_psn;
53019 /* SQ start packet sequence number. */
53020 uint32_t sq_psn;
53021 /* Max outstanding RDMA read atomic. */
53022 uint8_t max_rd_atomic;
53023 /* Max destination outstanding RDMA read atomic. */
53024 uint8_t max_dest_rd_atomic;
53025 uint16_t enable_cc;
53026 /* Enable congestion control. */
53027 #define CMDQ_MODIFY_QP_ENABLE_CC UINT32_C(0x1)
53028 /* unused15 is 15 b */
53029 #define CMDQ_MODIFY_QP_UNUSED15_MASK UINT32_C(0xfffe)
53030 #define CMDQ_MODIFY_QP_UNUSED15_SFT 1
53031 /* Max send WQE. */
53032 uint32_t sq_size;
53033 /* Max recv WQE. */
53034 uint32_t rq_size;
53035 /* Max send SGEs per SWQE. */
53036 uint16_t sq_sge;
53037 /* Max recv SGEs per RWQE. */
53038 uint16_t rq_sge;
53039 /* Max inline data length (upto 120 bytes). */
53040 uint32_t max_inline_data;
53041 /* Destination QP id. */
53042 uint32_t dest_qp_id;
53043 /* This is the DPI RoCE driver allocated for ping pong push. */
53044 uint32_t pingpong_push_dpi;
53045 /* Source MAC. (Unused. Comes from Source GID index) */
53046 uint16_t src_mac[3];
53047 uint16_t vlan_pcp_vlan_dei_vlan_id;
53048 /* VLAN id. (Unused. Comes from Source GID index) */
53049 #define CMDQ_MODIFY_QP_VLAN_ID_MASK UINT32_C(0xfff)
53050 #define CMDQ_MODIFY_QP_VLAN_ID_SFT 0
53051 /* VLAN DEI field - Drop Eligibility Indicator. */
53052 #define CMDQ_MODIFY_QP_VLAN_DEI UINT32_C(0x1000)
53053 /* VLAN PCP field - Priority Code Point. */
53054 #define CMDQ_MODIFY_QP_VLAN_PCP_MASK UINT32_C(0xe000)
53055 #define CMDQ_MODIFY_QP_VLAN_PCP_SFT 13
53056 /* IRRQ address. */
53057 uint64_t irrq_addr;
53058 /* ORRQ address. */
53059 uint64_t orrq_addr;
53060 } cmdq_modify_qp_t, *pcmdq_modify_qp_t;
53061
53062 /* creq_modify_qp_resp (size:128b/16B) */
53063
53064 typedef struct creq_modify_qp_resp {
53065 uint8_t type;
53066 /*
53067 * This field indicates the exact type of the completion.
53068 * By convention, the LSB identifies the length of the
53069 * record in 16B units. Even values indicate 16B
53070 * records. Odd values indicate 32B
53071 * records.
53072 */
53073 #define CREQ_MODIFY_QP_RESP_TYPE_MASK UINT32_C(0x3f)
53074 #define CREQ_MODIFY_QP_RESP_TYPE_SFT 0
53075 /* QP Async Notification */
53076 #define CREQ_MODIFY_QP_RESP_TYPE_QP_EVENT UINT32_C(0x38)
53077 #define CREQ_MODIFY_QP_RESP_TYPE_LAST CREQ_MODIFY_QP_RESP_TYPE_QP_EVENT
53078 /* Status of the response. */
53079 uint8_t status;
53080 /* Driver supplied handle to associate the command and the response. */
53081 uint16_t cookie;
53082 /* QP context id */
53083 uint32_t xid;
53084 uint8_t v;
53085 /*
53086 * This value is written by the NIC such that it will be different
53087 * for each pass through the completion queue. The even passes
53088 * will write 1. The odd passes will write 0.
53089 */
53090 #define CREQ_MODIFY_QP_RESP_V UINT32_C(0x1)
53091 /* Event or command opcode. */
53092 uint8_t event;
53093 /* Modify QP command response. */
53094 #define CREQ_MODIFY_QP_RESP_EVENT_MODIFY_QP UINT32_C(0x3)
53095 #define CREQ_MODIFY_QP_RESP_EVENT_LAST CREQ_MODIFY_QP_RESP_EVENT_MODIFY_QP
53096 uint8_t pingpong_push_state_index_enabled;
53097 /*
53098 * When set it indicates that FW was able to successfully enable
53099 * ping pong push mode for this QP.
53100 */
53101 #define CREQ_MODIFY_QP_RESP_PINGPONG_PUSH_ENABLED UINT32_C(0x1)
53102 /*
53103 * When ping pong push mode is enabled this field will give the
53104 * index into the push page where the QP has been mapped.
53105 */
53106 #define CREQ_MODIFY_QP_RESP_PINGPONG_PUSH_INDEX_MASK UINT32_C(0xe)
53107 #define CREQ_MODIFY_QP_RESP_PINGPONG_PUSH_INDEX_SFT 1
53108 /*
53109 * This bit will tell whether to use ping or pong buffer
53110 * for first push operation. 0 - ping buffer, 1 - pong buffer.
53111 */
53112 #define CREQ_MODIFY_QP_RESP_PINGPONG_PUSH_STATE UINT32_C(0x10)
53113 uint8_t reserved8;
53114 /* Scrambled src mac needed to calculate UDP source port. */
53115 uint32_t lag_src_mac;
53116 } creq_modify_qp_resp_t, *pcreq_modify_qp_resp_t;
53117
53118 /************
53119 * query_qp *
53120 ************/
53121
53122
53123 /* cmdq_query_qp (size:192b/24B) */
53124
53125 typedef struct cmdq_query_qp {
53126 /* Command opcode. */
53127 uint8_t opcode;
53128 /* Query QP command retrieves info about the specified QP. */
53129 #define CMDQ_QUERY_QP_OPCODE_QUERY_QP UINT32_C(0x4)
53130 #define CMDQ_QUERY_QP_OPCODE_LAST CMDQ_QUERY_QP_OPCODE_QUERY_QP
53131 /* Size of the command in 16-byte units. */
53132 uint8_t cmd_size;
53133 /* Flags and attribs of the command. */
53134 uint16_t flags;
53135 /* Driver supplied handle to associate the command and the response. */
53136 uint16_t cookie;
53137 /* Size of the response buffer in 16-byte units. */
53138 uint8_t resp_size;
53139 uint8_t reserved8;
53140 /* Host address of the response. */
53141 uint64_t resp_addr;
53142 /* QP context id */
53143 uint32_t qp_cid;
53144 uint32_t unused_0;
53145 } cmdq_query_qp_t, *pcmdq_query_qp_t;
53146
53147 /* creq_query_qp_resp (size:128b/16B) */
53148
53149 typedef struct creq_query_qp_resp {
53150 uint8_t type;
53151 /*
53152 * This field indicates the exact type of the completion.
53153 * By convention, the LSB identifies the length of the
53154 * record in 16B units. Even values indicate 16B
53155 * records. Odd values indicate 32B
53156 * records.
53157 */
53158 #define CREQ_QUERY_QP_RESP_TYPE_MASK UINT32_C(0x3f)
53159 #define CREQ_QUERY_QP_RESP_TYPE_SFT 0
53160 /* QP Async Notification */
53161 #define CREQ_QUERY_QP_RESP_TYPE_QP_EVENT UINT32_C(0x38)
53162 #define CREQ_QUERY_QP_RESP_TYPE_LAST CREQ_QUERY_QP_RESP_TYPE_QP_EVENT
53163 /* Status of the response. */
53164 uint8_t status;
53165 /* Driver supplied handle to associate the command and the response. */
53166 uint16_t cookie;
53167 /* Side buffer size in 16-byte units */
53168 uint32_t size;
53169 uint8_t v;
53170 /*
53171 * This value is written by the NIC such that it will be different
53172 * for each pass through the completion queue. The even passes
53173 * will write 1. The odd passes will write 0.
53174 */
53175 #define CREQ_QUERY_QP_RESP_V UINT32_C(0x1)
53176 /* Event or command opcode. */
53177 uint8_t event;
53178 /* Query QP command response. */
53179 #define CREQ_QUERY_QP_RESP_EVENT_QUERY_QP UINT32_C(0x4)
53180 #define CREQ_QUERY_QP_RESP_EVENT_LAST CREQ_QUERY_QP_RESP_EVENT_QUERY_QP
53181 uint8_t reserved48[6];
53182 } creq_query_qp_resp_t, *pcreq_query_qp_resp_t;
53183
53184 /* Query QP command response side buffer structure. */
53185 /* creq_query_qp_resp_sb (size:832b/104B) */
53186
53187 typedef struct creq_query_qp_resp_sb {
53188 /* Command opcode. */
53189 uint8_t opcode;
53190 /* Query QP command response. */
53191 #define CREQ_QUERY_QP_RESP_SB_OPCODE_QUERY_QP UINT32_C(0x4)
53192 #define CREQ_QUERY_QP_RESP_SB_OPCODE_LAST CREQ_QUERY_QP_RESP_SB_OPCODE_QUERY_QP
53193 /* Status of the response. */
53194 uint8_t status;
53195 /* Driver supplied handle to associate the command and the response. */
53196 uint16_t cookie;
53197 /* Flags and attribs of the command. */
53198 uint16_t flags;
53199 /* Size of the response buffer in 16-byte units. */
53200 uint8_t resp_size;
53201 uint8_t reserved8;
53202 /* QP context id */
53203 uint32_t xid;
53204 uint8_t en_sqd_async_notify_state;
53205 /* QP state */
53206 #define CREQ_QUERY_QP_RESP_SB_STATE_MASK UINT32_C(0xf)
53207 #define CREQ_QUERY_QP_RESP_SB_STATE_SFT 0
53208 /* Reset. */
53209 #define CREQ_QUERY_QP_RESP_SB_STATE_RESET UINT32_C(0x0)
53210 /* Init. */
53211 #define CREQ_QUERY_QP_RESP_SB_STATE_INIT UINT32_C(0x1)
53212 /* Ready To Receive. */
53213 #define CREQ_QUERY_QP_RESP_SB_STATE_RTR UINT32_C(0x2)
53214 /* Ready To Send. */
53215 #define CREQ_QUERY_QP_RESP_SB_STATE_RTS UINT32_C(0x3)
53216 /* SQ Drain. */
53217 #define CREQ_QUERY_QP_RESP_SB_STATE_SQD UINT32_C(0x4)
53218 /* SQ Error. */
53219 #define CREQ_QUERY_QP_RESP_SB_STATE_SQE UINT32_C(0x5)
53220 /* Error. */
53221 #define CREQ_QUERY_QP_RESP_SB_STATE_ERR UINT32_C(0x6)
53222 #define CREQ_QUERY_QP_RESP_SB_STATE_LAST CREQ_QUERY_QP_RESP_SB_STATE_ERR
53223 /* SQ drain asynchronous notification. */
53224 #define CREQ_QUERY_QP_RESP_SB_EN_SQD_ASYNC_NOTIFY UINT32_C(0x10)
53225 /* Enable congestion control. */
53226 #define CREQ_QUERY_QP_RESP_SB_UNUSED3_MASK UINT32_C(0xe0)
53227 #define CREQ_QUERY_QP_RESP_SB_UNUSED3_SFT 5
53228 /* Access flags. */
53229 uint8_t access;
53230 #define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_ATOMIC_REMOTE_READ_REMOTE_WRITE_LOCAL_WRITE_MASK UINT32_C(0xff)
53231 #define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_ATOMIC_REMOTE_READ_REMOTE_WRITE_LOCAL_WRITE_SFT 0
53232 /* Local write access. */
53233 #define CREQ_QUERY_QP_RESP_SB_ACCESS_LOCAL_WRITE UINT32_C(0x1)
53234 /* Remote write access. */
53235 #define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_WRITE UINT32_C(0x2)
53236 /* Remote read access. */
53237 #define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_READ UINT32_C(0x4)
53238 /* Remote atomic access. */
53239 #define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_ATOMIC UINT32_C(0x8)
53240 /* P_KEY index. */
53241 uint16_t pkey;
53242 /* Q_KEY. */
53243 uint32_t qkey;
53244 uint32_t reserved32;
53245 /* Destination GID. */
53246 uint32_t dgid[4];
53247 /* Flow label. */
53248 uint32_t flow_label;
53249 /* Source GID index. */
53250 uint16_t sgid_index;
53251 /* Hop limit. */
53252 uint8_t hop_limit;
53253 /* Traffic class. */
53254 uint8_t traffic_class;
53255 /* Destination MAC address. */
53256 uint16_t dest_mac[3];
53257 uint16_t path_mtu_dest_vlan_id;
53258 /* Destination VLAN ID. */
53259 #define CREQ_QUERY_QP_RESP_SB_DEST_VLAN_ID_MASK UINT32_C(0xfff)
53260 #define CREQ_QUERY_QP_RESP_SB_DEST_VLAN_ID_SFT 0
53261 /* Path MTU. */
53262 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MASK UINT32_C(0xf000)
53263 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_SFT 12
53264 /* 256. */
53265 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_256 (UINT32_C(0x0) << 12)
53266 /* 512. */
53267 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_512 (UINT32_C(0x1) << 12)
53268 /* 1024. */
53269 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_1024 (UINT32_C(0x2) << 12)
53270 /* 2048. */
53271 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_2048 (UINT32_C(0x3) << 12)
53272 /* 4096. */
53273 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_4096 (UINT32_C(0x4) << 12)
53274 /* 8192. */
53275 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_8192 (UINT32_C(0x5) << 12)
53276 #define CREQ_QUERY_QP_RESP_SB_PATH_MTU_LAST CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_8192
53277 /* Timeout value for SWQEs. */
53278 uint8_t timeout;
53279 /* Max retry count for WQEs. */
53280 uint8_t retry_cnt;
53281 /* Max RNR retry count for WQEs. */
53282 uint8_t rnr_retry;
53283 /* Min RNR timer that the QP will report to the remote. */
53284 uint8_t min_rnr_timer;
53285 /* RQ start packet sequence number. */
53286 uint32_t rq_psn;
53287 /* SQ start packet sequence number. */
53288 uint32_t sq_psn;
53289 /* Max outstanding RDMA read atomic. */
53290 uint8_t max_rd_atomic;
53291 /* Max destination outstanding RDMA read atomic. */
53292 uint8_t max_dest_rd_atomic;
53293 uint8_t tos_dscp_tos_ecn;
53294 /* IP TOS ECN. */
53295 #define CREQ_QUERY_QP_RESP_SB_TOS_ECN_MASK UINT32_C(0x3)
53296 #define CREQ_QUERY_QP_RESP_SB_TOS_ECN_SFT 0
53297 /* IP TOS DSCP. */
53298 #define CREQ_QUERY_QP_RESP_SB_TOS_DSCP_MASK UINT32_C(0xfc)
53299 #define CREQ_QUERY_QP_RESP_SB_TOS_DSCP_SFT 2
53300 uint8_t enable_cc;
53301 /* enable_cc is 1 b */
53302 #define CREQ_QUERY_QP_RESP_SB_ENABLE_CC UINT32_C(0x1)
53303 /* Max send WQE. */
53304 uint32_t sq_size;
53305 /* Max recv WQE. */
53306 uint32_t rq_size;
53307 /* Max send SGEs per SWQE. */
53308 uint16_t sq_sge;
53309 /* Max recv SGEs per RWQE (NOT SUPPORTED BY HARDWARE). */
53310 uint16_t rq_sge;
53311 /* Max inline data length (upto 120 bytes). */
53312 uint32_t max_inline_data;
53313 /* Destination QP id. */
53314 uint32_t dest_qp_id;
53315 /* Port ID associated with the QP. */
53316 uint16_t port_id;
53317 uint8_t unused_0;
53318 /* Statistic collection ID allocated for this QP. */
53319 uint8_t stat_collection_id;
53320 /* Source MAC. */
53321 uint16_t src_mac[3];
53322 uint16_t vlan_pcp_vlan_dei_vlan_id;
53323 /* Source VLAN id. */
53324 #define CREQ_QUERY_QP_RESP_SB_VLAN_ID_MASK UINT32_C(0xfff)
53325 #define CREQ_QUERY_QP_RESP_SB_VLAN_ID_SFT 0
53326 /* VLAN DEI field - Drop Eligibility Indicator. */
53327 #define CREQ_QUERY_QP_RESP_SB_VLAN_DEI UINT32_C(0x1000)
53328 /* VLAN PCP field - Priority Code Point. */
53329 #define CREQ_QUERY_QP_RESP_SB_VLAN_PCP_MASK UINT32_C(0xe000)
53330 #define CREQ_QUERY_QP_RESP_SB_VLAN_PCP_SFT 13
53331 } creq_query_qp_resp_sb_t, *pcreq_query_qp_resp_sb_t;
53332
53333 /*******************
53334 * query_qp_extend *
53335 *******************/
53336
53337
53338 /* cmdq_query_qp_extend (size:192b/24B) */
53339
53340 typedef struct cmdq_query_qp_extend {
53341 /* Command opcode. */
53342 uint8_t opcode;
53343 /*
53344 * Query QP extend command retrieves info about multiple QPs associated
53345 * with a specific PF.
53346 */
53347 #define CMDQ_QUERY_QP_EXTEND_OPCODE_QUERY_QP_EXTEND UINT32_C(0x91)
53348 #define CMDQ_QUERY_QP_EXTEND_OPCODE_LAST CMDQ_QUERY_QP_EXTEND_OPCODE_QUERY_QP_EXTEND
53349 /* Size of the command in 16-byte units. */
53350 uint8_t cmd_size;
53351 /* Flags and attribs of the command. */
53352 uint16_t flags;
53353 /* Driver supplied handle to associate the command and the response. */
53354 uint16_t cookie;
53355 /* Size of the response buffer in 16-byte units. */
53356 uint8_t resp_size;
53357 /* Number of QPs for which FW needs to query and provide info back to host. */
53358 uint8_t num_qps;
53359 /* Host address of the response. */
53360 uint64_t resp_addr;
53361 /* Unique identified for a function */
53362 uint32_t function_id;
53363 /* PF number */
53364 #define CMDQ_QUERY_QP_EXTEND_PF_NUM_MASK UINT32_C(0xff)
53365 #define CMDQ_QUERY_QP_EXTEND_PF_NUM_SFT 0
53366 /* VF number */
53367 #define CMDQ_QUERY_QP_EXTEND_VF_NUM_MASK UINT32_C(0xffff00)
53368 #define CMDQ_QUERY_QP_EXTEND_VF_NUM_SFT 8
53369 /* When set the vf_num is valid. */
53370 #define CMDQ_QUERY_QP_EXTEND_VF_VALID UINT32_C(0x1000000)
53371 /*
53372 * This is the current index where firmware left off for query qp. Driver
53373 * will pass this back in the next query_qp_extend command.
53374 */
53375 uint32_t current_index;
53376 } cmdq_query_qp_extend_t, *pcmdq_query_qp_extend_t;
53377
53378 /* creq_query_qp_extend_resp (size:128b/16B) */
53379
53380 typedef struct creq_query_qp_extend_resp {
53381 uint8_t type;
53382 /*
53383 * This field indicates the exact type of the completion.
53384 * By convention, the LSB identifies the length of the
53385 * record in 16B units. Even values indicate 16B
53386 * records. Odd values indicate 32B
53387 * records.
53388 */
53389 #define CREQ_QUERY_QP_EXTEND_RESP_TYPE_MASK UINT32_C(0x3f)
53390 #define CREQ_QUERY_QP_EXTEND_RESP_TYPE_SFT 0
53391 /* QP Async Notification */
53392 #define CREQ_QUERY_QP_EXTEND_RESP_TYPE_QP_EVENT UINT32_C(0x38)
53393 #define CREQ_QUERY_QP_EXTEND_RESP_TYPE_LAST CREQ_QUERY_QP_EXTEND_RESP_TYPE_QP_EVENT
53394 /* Status of the response. */
53395 uint8_t status;
53396 /* Driver supplied handle to associate the command and the response. */
53397 uint16_t cookie;
53398 /* Side buffer size in 16-byte units */
53399 uint32_t size;
53400 uint8_t v;
53401 /*
53402 * This value is written by the NIC such that it will be different
53403 * for each pass through the completion queue. The even passes
53404 * will write 1. The odd passes will write 0.
53405 */
53406 #define CREQ_QUERY_QP_EXTEND_RESP_V UINT32_C(0x1)
53407 /* Event or command opcode. */
53408 uint8_t event;
53409 /* Query QP extend command response. */
53410 #define CREQ_QUERY_QP_EXTEND_RESP_EVENT_QUERY_QP_EXTEND UINT32_C(0x91)
53411 #define CREQ_QUERY_QP_EXTEND_RESP_EVENT_LAST CREQ_QUERY_QP_EXTEND_RESP_EVENT_QUERY_QP_EXTEND
53412 uint16_t reserved16;
53413 /*
53414 * This is the current index where firmware left off for query qp. Driver
53415 * will pass this back in the next query_qp_extend command.
53416 */
53417 uint32_t current_index;
53418 } creq_query_qp_extend_resp_t, *pcreq_query_qp_extend_resp_t;
53419
53420 /* Query QP extend command response side buffer structure. */
53421 /* creq_query_qp_extend_resp_sb (size:384b/48B) */
53422
53423 typedef struct creq_query_qp_extend_resp_sb {
53424 /* Command opcode. */
53425 uint8_t opcode;
53426 /* Query QP command extend response. */
53427 #define CREQ_QUERY_QP_EXTEND_RESP_SB_OPCODE_QUERY_QP_EXTEND UINT32_C(0x91)
53428 #define CREQ_QUERY_QP_EXTEND_RESP_SB_OPCODE_LAST CREQ_QUERY_QP_EXTEND_RESP_SB_OPCODE_QUERY_QP_EXTEND
53429 /* Status of the response. */
53430 uint8_t status;
53431 /* Driver supplied handle to associate the command and the response. */
53432 uint16_t cookie;
53433 /* Flags and attribs of the command. */
53434 uint16_t flags;
53435 /* Size of the response buffer in 16-byte units. */
53436 uint8_t resp_size;
53437 uint8_t reserved8;
53438 /* QP context id */
53439 uint32_t xid;
53440 uint8_t state;
53441 /* QP state */
53442 #define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_MASK UINT32_C(0xf)
53443 #define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_SFT 0
53444 /* Reset. */
53445 #define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_RESET UINT32_C(0x0)
53446 /* Init. */
53447 #define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_INIT UINT32_C(0x1)
53448 /* Ready To Receive. */
53449 #define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_RTR UINT32_C(0x2)
53450 /* Ready To Send. */
53451 #define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_RTS UINT32_C(0x3)
53452 /* SQ Drain. */
53453 #define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_SQD UINT32_C(0x4)
53454 /* SQ Error. */
53455 #define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_SQE UINT32_C(0x5)
53456 /* Error. */
53457 #define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_ERR UINT32_C(0x6)
53458 #define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_LAST CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_ERR
53459 /* */
53460 #define CREQ_QUERY_QP_EXTEND_RESP_SB_UNUSED4_MASK UINT32_C(0xf0)
53461 #define CREQ_QUERY_QP_EXTEND_RESP_SB_UNUSED4_SFT 4
53462 uint8_t reserved_8;
53463 /* Port ID associated with the QP. */
53464 uint16_t port_id;
53465 /* Q_KEY. */
53466 uint32_t qkey;
53467 /* Source GID index. */
53468 uint16_t sgid_index;
53469 /* Network type. */
53470 uint8_t network_type;
53471 /* RoCEv1. */
53472 #define CREQ_QUERY_QP_EXTEND_RESP_SB_NETWORK_TYPE_ROCEV1 UINT32_C(0x0)
53473 /* RoCEv2 IPv4. */
53474 #define CREQ_QUERY_QP_EXTEND_RESP_SB_NETWORK_TYPE_ROCEV2_IPV4 UINT32_C(0x2)
53475 /* RoCEv2 IPv6. */
53476 #define CREQ_QUERY_QP_EXTEND_RESP_SB_NETWORK_TYPE_ROCEV2_IPV6 UINT32_C(0x3)
53477 #define CREQ_QUERY_QP_EXTEND_RESP_SB_NETWORK_TYPE_LAST CREQ_QUERY_QP_EXTEND_RESP_SB_NETWORK_TYPE_ROCEV2_IPV6
53478 uint8_t unused_0;
53479 /* Destination GID. */
53480 uint32_t dgid[4];
53481 /* Destination QP id. */
53482 uint32_t dest_qp_id;
53483 /* Statistic collection ID allocated for this QP. */
53484 uint8_t stat_collection_id;
53485 uint8_t reservred_8;
53486 uint16_t reserved_16;
53487 } creq_query_qp_extend_resp_sb_t, *pcreq_query_qp_extend_resp_sb_t;
53488
53489 /*
53490 * TLV encapsulated Query QP extend control command response
53491 * side buffer.
53492 */
53493 /* creq_query_qp_extend_resp_sb_tlv (size:512b/64B) */
53494
53495 typedef struct creq_query_qp_extend_resp_sb_tlv {
53496 /*
53497 * The command discriminator is used to differentiate between various
53498 * types of HWRM messages. This includes legacy HWRM and RoCE slowpath
53499 * command messages as well as newer TLV encapsulated HWRM commands.
53500 *
53501 * For TLV encapsulated messages this field must be 0x8000.
53502 */
53503 uint16_t cmd_discr;
53504 uint8_t reserved_8b;
53505 uint8_t tlv_flags;
53506 /*
53507 * Indicates the presence of additional TLV encapsulated data
53508 * follows this TLV.
53509 */
53510 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_MORE UINT32_C(0x1)
53511 /* Last TLV in a sequence of TLVs. */
53512 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_MORE_LAST UINT32_C(0x0)
53513 /* More TLVs follow this TLV. */
53514 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_MORE_NOT_LAST UINT32_C(0x1)
53515 /*
53516 * When an HWRM receiver detects a TLV type that it does not
53517 * support with the TLV required flag set, the receiver must
53518 * reject the HWRM message with an error code indicating an
53519 * unsupported TLV type.
53520 */
53521 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_REQUIRED UINT32_C(0x2)
53522 /* No */
53523 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_REQUIRED_NO (UINT32_C(0x0) << 1)
53524 /* Yes */
53525 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES (UINT32_C(0x1) << 1)
53526 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_REQUIRED_LAST CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES
53527 /*
53528 * This field defines the TLV type value which is divided into
53529 * two ranges to differentiate between global and local TLV types.
53530 * Global TLV types must be unique across all defined TLV types.
53531 * Local TLV types are valid only for extensions to a given
53532 * HWRM message and may be repeated across different HWRM message
53533 * types. There is a direct correlation of each HWRM message type
53534 * to a single global TLV type value.
53535 *
53536 * Global TLV range: `0 - (63k-1)`
53537 *
53538 * Local TLV range: `63k - (64k-1)`
53539 */
53540 uint16_t tlv_type;
53541 /*
53542 * Length of the message data encapsulated by this TLV in bytes.
53543 * This length does not include the size of the TLV header itself
53544 * and it must be an integer multiple of 8B.
53545 */
53546 uint16_t length;
53547 /*
53548 * Size of the tlv encapsulated response,
53549 * including all tlvs and extension data in 16-byte units.
53550 */
53551 uint8_t total_size;
53552 uint8_t reserved56[7];
53553 /* Command opcode. */
53554 uint8_t opcode;
53555 /* Query QP command extend response. */
53556 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_OPCODE_QUERY_QP_EXTEND UINT32_C(0x91)
53557 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_OPCODE_LAST CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_OPCODE_QUERY_QP_EXTEND
53558 /* Status of the response. */
53559 uint8_t status;
53560 /* Driver supplied handle to associate the command and the response. */
53561 uint16_t cookie;
53562 /* Flags and attribs of the command. */
53563 uint16_t flags;
53564 /* Size of the response buffer in 16-byte units. */
53565 uint8_t resp_size;
53566 uint8_t reserved8;
53567 /* QP context id */
53568 uint32_t xid;
53569 uint8_t state;
53570 /* QP state */
53571 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_MASK UINT32_C(0xf)
53572 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_SFT 0
53573 /* Reset. */
53574 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_RESET UINT32_C(0x0)
53575 /* Init. */
53576 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_INIT UINT32_C(0x1)
53577 /* Ready To Receive. */
53578 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_RTR UINT32_C(0x2)
53579 /* Ready To Send. */
53580 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_RTS UINT32_C(0x3)
53581 /* SQ Drain. */
53582 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_SQD UINT32_C(0x4)
53583 /* SQ Error. */
53584 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_SQE UINT32_C(0x5)
53585 /* Error. */
53586 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_ERR UINT32_C(0x6)
53587 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_LAST CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_ERR
53588 /* */
53589 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_UNUSED4_MASK UINT32_C(0xf0)
53590 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_UNUSED4_SFT 4
53591 uint8_t reserved_8;
53592 /* Port ID associated with the QP. */
53593 uint16_t port_id;
53594 /* Q_KEY. */
53595 uint32_t qkey;
53596 /* Source GID index. */
53597 uint16_t sgid_index;
53598 /* Network type. */
53599 uint8_t network_type;
53600 /* RoCEv1. */
53601 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_NETWORK_TYPE_ROCEV1 UINT32_C(0x0)
53602 /* RoCEv2 IPv4. */
53603 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_NETWORK_TYPE_ROCEV2_IPV4 UINT32_C(0x2)
53604 /* RoCEv2 IPv6. */
53605 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_NETWORK_TYPE_ROCEV2_IPV6 UINT32_C(0x3)
53606 #define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_NETWORK_TYPE_LAST CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_NETWORK_TYPE_ROCEV2_IPV6
53607 uint8_t unused_0;
53608 /* Destination GID. */
53609 uint32_t dgid[4];
53610 /* Destination QP id. */
53611 uint32_t dest_qp_id;
53612 /* Statistic collection ID allocated for this QP. */
53613 uint8_t stat_collection_id;
53614 uint8_t reservred_8;
53615 uint16_t reserved_16;
53616 } creq_query_qp_extend_resp_sb_tlv_t, *pcreq_query_qp_extend_resp_sb_tlv_t;
53617
53618 /**************
53619 * create_srq *
53620 **************/
53621
53622
53623 /* cmdq_create_srq (size:384b/48B) */
53624
53625 typedef struct cmdq_create_srq {
53626 /* Command opcode. */
53627 uint8_t opcode;
53628 /* Create SRQ command allocates a SRQ with the specified parameters. */
53629 #define CMDQ_CREATE_SRQ_OPCODE_CREATE_SRQ UINT32_C(0x5)
53630 #define CMDQ_CREATE_SRQ_OPCODE_LAST CMDQ_CREATE_SRQ_OPCODE_CREATE_SRQ
53631 /* Size of the command in 16-byte units. */
53632 uint8_t cmd_size;
53633 /* Flags and attribs of the command. */
53634 uint16_t flags;
53635 /* Driver supplied handle to associate the command and the response. */
53636 uint16_t cookie;
53637 /* Size of the response buffer in 16-byte units. */
53638 uint8_t resp_size;
53639 uint8_t reserved8;
53640 /* Host address of the response. */
53641 uint64_t resp_addr;
53642 /* SRQ handle. */
53643 uint64_t srq_handle;
53644 uint16_t pg_size_lvl;
53645 /* SRQ PBL indirect levels. */
53646 #define CMDQ_CREATE_SRQ_LVL_MASK UINT32_C(0x3)
53647 #define CMDQ_CREATE_SRQ_LVL_SFT 0
53648 /* PBL pointer is physical start address. */
53649 #define CMDQ_CREATE_SRQ_LVL_LVL_0 UINT32_C(0x0)
53650 /* PBL pointer points to PTE table. */
53651 #define CMDQ_CREATE_SRQ_LVL_LVL_1 UINT32_C(0x1)
53652 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
53653 #define CMDQ_CREATE_SRQ_LVL_LVL_2 UINT32_C(0x2)
53654 #define CMDQ_CREATE_SRQ_LVL_LAST CMDQ_CREATE_SRQ_LVL_LVL_2
53655 /* page size. */
53656 #define CMDQ_CREATE_SRQ_PG_SIZE_MASK UINT32_C(0x1c)
53657 #define CMDQ_CREATE_SRQ_PG_SIZE_SFT 2
53658 /* 4KB. */
53659 #define CMDQ_CREATE_SRQ_PG_SIZE_PG_4K (UINT32_C(0x0) << 2)
53660 /* 8KB. */
53661 #define CMDQ_CREATE_SRQ_PG_SIZE_PG_8K (UINT32_C(0x1) << 2)
53662 /* 64KB. */
53663 #define CMDQ_CREATE_SRQ_PG_SIZE_PG_64K (UINT32_C(0x2) << 2)
53664 /* 2MB. */
53665 #define CMDQ_CREATE_SRQ_PG_SIZE_PG_2M (UINT32_C(0x3) << 2)
53666 /* 8MB. */
53667 #define CMDQ_CREATE_SRQ_PG_SIZE_PG_8M (UINT32_C(0x4) << 2)
53668 /* 1GB. */
53669 #define CMDQ_CREATE_SRQ_PG_SIZE_PG_1G (UINT32_C(0x5) << 2)
53670 #define CMDQ_CREATE_SRQ_PG_SIZE_LAST CMDQ_CREATE_SRQ_PG_SIZE_PG_1G
53671 /* unused11 is 11 b */
53672 #define CMDQ_CREATE_SRQ_UNUSED11_MASK UINT32_C(0xffe0)
53673 #define CMDQ_CREATE_SRQ_UNUSED11_SFT 5
53674 uint16_t eventq_id;
53675 /* eventq_id is 12 b */
53676 #define CMDQ_CREATE_SRQ_EVENTQ_ID_MASK UINT32_C(0xfff)
53677 #define CMDQ_CREATE_SRQ_EVENTQ_ID_SFT 0
53678 /* unused4 is 4 b */
53679 #define CMDQ_CREATE_SRQ_UNUSED4_MASK UINT32_C(0xf000)
53680 #define CMDQ_CREATE_SRQ_UNUSED4_SFT 12
53681 /* Max number of SRQ wqes. */
53682 uint16_t srq_size;
53683 /* Offsetof first WQE in the first page of SRQ, in 128 byte units */
53684 uint16_t srq_fwo;
53685 /* Doorbell page index. */
53686 uint32_t dpi;
53687 /* Protection domain id. */
53688 uint32_t pd_id;
53689 /* RQ PBL physical address. */
53690 uint64_t pbl;
53691 } cmdq_create_srq_t, *pcmdq_create_srq_t;
53692
53693 /* creq_create_srq_resp (size:128b/16B) */
53694
53695 typedef struct creq_create_srq_resp {
53696 uint8_t type;
53697 /*
53698 * This field indicates the exact type of the completion.
53699 * By convention, the LSB identifies the length of the
53700 * record in 16B units. Even values indicate 16B
53701 * records. Odd values indicate 32B
53702 * records.
53703 */
53704 #define CREQ_CREATE_SRQ_RESP_TYPE_MASK UINT32_C(0x3f)
53705 #define CREQ_CREATE_SRQ_RESP_TYPE_SFT 0
53706 /* QP Async Notification */
53707 #define CREQ_CREATE_SRQ_RESP_TYPE_QP_EVENT UINT32_C(0x38)
53708 #define CREQ_CREATE_SRQ_RESP_TYPE_LAST CREQ_CREATE_SRQ_RESP_TYPE_QP_EVENT
53709 /* Status of the response. */
53710 uint8_t status;
53711 /* Driver supplied handle to associate the command and the response. */
53712 uint16_t cookie;
53713 /* SRQ context id */
53714 uint32_t xid;
53715 uint8_t v;
53716 /*
53717 * This value is written by the NIC such that it will be different
53718 * for each pass through the completion queue. The even passes
53719 * will write 1. The odd passes will write 0.
53720 */
53721 #define CREQ_CREATE_SRQ_RESP_V UINT32_C(0x1)
53722 /* Event or command opcode. */
53723 uint8_t event;
53724 /* Create SRQ command response. */
53725 #define CREQ_CREATE_SRQ_RESP_EVENT_CREATE_SRQ UINT32_C(0x5)
53726 #define CREQ_CREATE_SRQ_RESP_EVENT_LAST CREQ_CREATE_SRQ_RESP_EVENT_CREATE_SRQ
53727 uint8_t reserved48[6];
53728 } creq_create_srq_resp_t, *pcreq_create_srq_resp_t;
53729
53730 /***************
53731 * destroy_srq *
53732 ***************/
53733
53734
53735 /* cmdq_destroy_srq (size:192b/24B) */
53736
53737 typedef struct cmdq_destroy_srq {
53738 /* Command opcode. */
53739 uint8_t opcode;
53740 /* Destroy SRQ command deletes and flushes the specified SRQ. */
53741 #define CMDQ_DESTROY_SRQ_OPCODE_DESTROY_SRQ UINT32_C(0x6)
53742 #define CMDQ_DESTROY_SRQ_OPCODE_LAST CMDQ_DESTROY_SRQ_OPCODE_DESTROY_SRQ
53743 /* Size of the command in 16-byte units. */
53744 uint8_t cmd_size;
53745 /* Flags and attribs of the command. */
53746 uint16_t flags;
53747 /* Driver supplied handle to associate the command and the response. */
53748 uint16_t cookie;
53749 /* Size of the response buffer in 16-byte units. */
53750 uint8_t resp_size;
53751 uint8_t reserved8;
53752 /* Host address of the response. */
53753 uint64_t resp_addr;
53754 /* SRQ context id */
53755 uint32_t srq_cid;
53756 uint32_t unused_0;
53757 } cmdq_destroy_srq_t, *pcmdq_destroy_srq_t;
53758
53759 /* creq_destroy_srq_resp (size:128b/16B) */
53760
53761 typedef struct creq_destroy_srq_resp {
53762 uint8_t type;
53763 /*
53764 * This field indicates the exact type of the completion.
53765 * By convention, the LSB identifies the length of the
53766 * record in 16B units. Even values indicate 16B
53767 * records. Odd values indicate 32B
53768 * records.
53769 */
53770 #define CREQ_DESTROY_SRQ_RESP_TYPE_MASK UINT32_C(0x3f)
53771 #define CREQ_DESTROY_SRQ_RESP_TYPE_SFT 0
53772 /* QP Async Notification */
53773 #define CREQ_DESTROY_SRQ_RESP_TYPE_QP_EVENT UINT32_C(0x38)
53774 #define CREQ_DESTROY_SRQ_RESP_TYPE_LAST CREQ_DESTROY_SRQ_RESP_TYPE_QP_EVENT
53775 /* Status of the response. */
53776 uint8_t status;
53777 /* Driver supplied handle to associate the command and the response. */
53778 uint16_t cookie;
53779 /* SRQ context id */
53780 uint32_t xid;
53781 uint8_t v;
53782 /*
53783 * This value is written by the NIC such that it will be different
53784 * for each pass through the completion queue. The even passes
53785 * will write 1. The odd passes will write 0.
53786 */
53787 #define CREQ_DESTROY_SRQ_RESP_V UINT32_C(0x1)
53788 /* Event or command opcode. */
53789 uint8_t event;
53790 /* Destroy SRQ command response. */
53791 #define CREQ_DESTROY_SRQ_RESP_EVENT_DESTROY_SRQ UINT32_C(0x6)
53792 #define CREQ_DESTROY_SRQ_RESP_EVENT_LAST CREQ_DESTROY_SRQ_RESP_EVENT_DESTROY_SRQ
53793 uint16_t enable_for_arm[3];
53794 #define CREQ_DESTROY_SRQ_RESP_UNUSED0_MASK UINT32_C(0xffff)
53795 #define CREQ_DESTROY_SRQ_RESP_UNUSED0_SFT 0
53796 /* Set to 1 if this SRQ is allowed to be armed for threshold async event */
53797 #define CREQ_DESTROY_SRQ_RESP_ENABLE_FOR_ARM_MASK UINT32_C(0x30000)
53798 #define CREQ_DESTROY_SRQ_RESP_ENABLE_FOR_ARM_SFT 16
53799 } creq_destroy_srq_resp_t, *pcreq_destroy_srq_resp_t;
53800
53801 /*************
53802 * query_srq *
53803 *************/
53804
53805
53806 /* cmdq_query_srq (size:192b/24B) */
53807
53808 typedef struct cmdq_query_srq {
53809 /* Command opcode. */
53810 uint8_t opcode;
53811 /* Query SRP command retrieves info about the specified SRQ. */
53812 #define CMDQ_QUERY_SRQ_OPCODE_QUERY_SRQ UINT32_C(0x8)
53813 #define CMDQ_QUERY_SRQ_OPCODE_LAST CMDQ_QUERY_SRQ_OPCODE_QUERY_SRQ
53814 /* Size of the command in 16-byte units. */
53815 uint8_t cmd_size;
53816 /* Flags and attribs of the command. */
53817 uint16_t flags;
53818 /* Driver supplied handle to associate the command and the response. */
53819 uint16_t cookie;
53820 /* Size of the response buffer in 16-byte units. */
53821 uint8_t resp_size;
53822 uint8_t reserved8;
53823 /* Host address of the response. */
53824 uint64_t resp_addr;
53825 /* SRQ context id */
53826 uint32_t srq_cid;
53827 uint32_t unused_0;
53828 } cmdq_query_srq_t, *pcmdq_query_srq_t;
53829
53830 /* creq_query_srq_resp (size:128b/16B) */
53831
53832 typedef struct creq_query_srq_resp {
53833 uint8_t type;
53834 /*
53835 * This field indicates the exact type of the completion.
53836 * By convention, the LSB identifies the length of the
53837 * record in 16B units. Even values indicate 16B
53838 * records. Odd values indicate 32B
53839 * records.
53840 */
53841 #define CREQ_QUERY_SRQ_RESP_TYPE_MASK UINT32_C(0x3f)
53842 #define CREQ_QUERY_SRQ_RESP_TYPE_SFT 0
53843 /* QP Async Notification */
53844 #define CREQ_QUERY_SRQ_RESP_TYPE_QP_EVENT UINT32_C(0x38)
53845 #define CREQ_QUERY_SRQ_RESP_TYPE_LAST CREQ_QUERY_SRQ_RESP_TYPE_QP_EVENT
53846 /* Status of the response. */
53847 uint8_t status;
53848 /* Driver supplied handle to associate the command and the response. */
53849 uint16_t cookie;
53850 /* Side buffer size in 16-byte units */
53851 uint32_t size;
53852 uint8_t v;
53853 /*
53854 * This value is written by the NIC such that it will be different
53855 * for each pass through the completion queue. The even passes
53856 * will write 1. The odd passes will write 0.
53857 */
53858 #define CREQ_QUERY_SRQ_RESP_V UINT32_C(0x1)
53859 /* Event or command opcode. */
53860 uint8_t event;
53861 /* Query SRQ command response. */
53862 #define CREQ_QUERY_SRQ_RESP_EVENT_QUERY_SRQ UINT32_C(0x8)
53863 #define CREQ_QUERY_SRQ_RESP_EVENT_LAST CREQ_QUERY_SRQ_RESP_EVENT_QUERY_SRQ
53864 uint8_t reserved48[6];
53865 } creq_query_srq_resp_t, *pcreq_query_srq_resp_t;
53866
53867 /* Query SRQ command response side buffer structure. */
53868 /* creq_query_srq_resp_sb (size:256b/32B) */
53869
53870 typedef struct creq_query_srq_resp_sb {
53871 /* Command opcode. */
53872 uint8_t opcode;
53873 /* Query SRQ command response. */
53874 #define CREQ_QUERY_SRQ_RESP_SB_OPCODE_QUERY_SRQ UINT32_C(0x8)
53875 #define CREQ_QUERY_SRQ_RESP_SB_OPCODE_LAST CREQ_QUERY_SRQ_RESP_SB_OPCODE_QUERY_SRQ
53876 /* Status of the response. */
53877 uint8_t status;
53878 /* Driver supplied handle to associate the command and the response. */
53879 uint16_t cookie;
53880 /* Flags and attribs of the command. */
53881 uint16_t flags;
53882 /* Size of the response buffer in 16-byte units. */
53883 uint8_t resp_size;
53884 uint8_t reserved8;
53885 /* SRQ context id */
53886 uint32_t xid;
53887 /* Watermark value to generate a SRQ limit event. */
53888 uint16_t srq_limit;
53889 uint16_t reserved16;
53890 /* data is 128 b */
53891 uint32_t data[4];
53892 } creq_query_srq_resp_sb_t, *pcreq_query_srq_resp_sb_t;
53893
53894 /*************
53895 * create_cq *
53896 *************/
53897
53898
53899 /* cmdq_create_cq (size:384b/48B) */
53900
53901 typedef struct cmdq_create_cq {
53902 /* Command opcode. */
53903 uint8_t opcode;
53904 /* Create CQ command allocates a CQ with the specified parameters. */
53905 #define CMDQ_CREATE_CQ_OPCODE_CREATE_CQ UINT32_C(0x9)
53906 #define CMDQ_CREATE_CQ_OPCODE_LAST CMDQ_CREATE_CQ_OPCODE_CREATE_CQ
53907 /* Size of the command in 16-byte units. */
53908 uint8_t cmd_size;
53909 /* Flags and attribs of the command. */
53910 uint16_t flags;
53911 /* Driver supplied handle to associate the command and the response. */
53912 uint16_t cookie;
53913 /* Size of the response buffer in 16-byte units. */
53914 uint8_t resp_size;
53915 uint8_t reserved8;
53916 /* Host address of the response. */
53917 uint64_t resp_addr;
53918 /* CQ handle. */
53919 uint64_t cq_handle;
53920 uint32_t pg_size_lvl;
53921 /* PBL indirect levels. */
53922 #define CMDQ_CREATE_CQ_LVL_MASK UINT32_C(0x3)
53923 #define CMDQ_CREATE_CQ_LVL_SFT 0
53924 /* PBL pointer is physical start address. */
53925 #define CMDQ_CREATE_CQ_LVL_LVL_0 UINT32_C(0x0)
53926 /* PBL pointer points to PTE table. */
53927 #define CMDQ_CREATE_CQ_LVL_LVL_1 UINT32_C(0x1)
53928 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
53929 #define CMDQ_CREATE_CQ_LVL_LVL_2 UINT32_C(0x2)
53930 #define CMDQ_CREATE_CQ_LVL_LAST CMDQ_CREATE_CQ_LVL_LVL_2
53931 /* page size. */
53932 #define CMDQ_CREATE_CQ_PG_SIZE_MASK UINT32_C(0x1c)
53933 #define CMDQ_CREATE_CQ_PG_SIZE_SFT 2
53934 /* 4KB. */
53935 #define CMDQ_CREATE_CQ_PG_SIZE_PG_4K (UINT32_C(0x0) << 2)
53936 /* 8KB. */
53937 #define CMDQ_CREATE_CQ_PG_SIZE_PG_8K (UINT32_C(0x1) << 2)
53938 /* 64KB. */
53939 #define CMDQ_CREATE_CQ_PG_SIZE_PG_64K (UINT32_C(0x2) << 2)
53940 /* 2MB. */
53941 #define CMDQ_CREATE_CQ_PG_SIZE_PG_2M (UINT32_C(0x3) << 2)
53942 /* 8MB. */
53943 #define CMDQ_CREATE_CQ_PG_SIZE_PG_8M (UINT32_C(0x4) << 2)
53944 /* 1GB. */
53945 #define CMDQ_CREATE_CQ_PG_SIZE_PG_1G (UINT32_C(0x5) << 2)
53946 #define CMDQ_CREATE_CQ_PG_SIZE_LAST CMDQ_CREATE_CQ_PG_SIZE_PG_1G
53947 /* unused27 is 27 b */
53948 #define CMDQ_CREATE_CQ_UNUSED27_MASK UINT32_C(0xffffffe0)
53949 #define CMDQ_CREATE_CQ_UNUSED27_SFT 5
53950 uint32_t cq_fco_cnq_id;
53951 /* cnq_id is 12 b */
53952 #define CMDQ_CREATE_CQ_CNQ_ID_MASK UINT32_C(0xfff)
53953 #define CMDQ_CREATE_CQ_CNQ_ID_SFT 0
53954 /* Offset of first CQE in the first Page, in 32 byte units */
53955 #define CMDQ_CREATE_CQ_CQ_FCO_MASK UINT32_C(0xfffff000)
53956 #define CMDQ_CREATE_CQ_CQ_FCO_SFT 12
53957 /* Doorbell page index. */
53958 uint32_t dpi;
53959 /* Max number of CQ wqes. */
53960 uint32_t cq_size;
53961 /* CQ PBL physical address. */
53962 uint64_t pbl;
53963 } cmdq_create_cq_t, *pcmdq_create_cq_t;
53964
53965 /* creq_create_cq_resp (size:128b/16B) */
53966
53967 typedef struct creq_create_cq_resp {
53968 uint8_t type;
53969 /*
53970 * This field indicates the exact type of the completion.
53971 * By convention, the LSB identifies the length of the
53972 * record in 16B units. Even values indicate 16B
53973 * records. Odd values indicate 32B
53974 * records.
53975 */
53976 #define CREQ_CREATE_CQ_RESP_TYPE_MASK UINT32_C(0x3f)
53977 #define CREQ_CREATE_CQ_RESP_TYPE_SFT 0
53978 /* QP Async Notification */
53979 #define CREQ_CREATE_CQ_RESP_TYPE_QP_EVENT UINT32_C(0x38)
53980 #define CREQ_CREATE_CQ_RESP_TYPE_LAST CREQ_CREATE_CQ_RESP_TYPE_QP_EVENT
53981 /* Status of the response. */
53982 uint8_t status;
53983 /* Driver supplied handle to associate the command and the response. */
53984 uint16_t cookie;
53985 /* CQ context id */
53986 uint32_t xid;
53987 uint8_t v;
53988 /*
53989 * This value is written by the NIC such that it will be different
53990 * for each pass through the completion queue. The even passes
53991 * will write 1. The odd passes will write 0.
53992 */
53993 #define CREQ_CREATE_CQ_RESP_V UINT32_C(0x1)
53994 /* Event or command opcode. */
53995 uint8_t event;
53996 /* Create CQ command response. */
53997 #define CREQ_CREATE_CQ_RESP_EVENT_CREATE_CQ UINT32_C(0x9)
53998 #define CREQ_CREATE_CQ_RESP_EVENT_LAST CREQ_CREATE_CQ_RESP_EVENT_CREATE_CQ
53999 uint8_t reserved48[6];
54000 } creq_create_cq_resp_t, *pcreq_create_cq_resp_t;
54001
54002 /**************
54003 * destroy_cq *
54004 **************/
54005
54006
54007 /* cmdq_destroy_cq (size:192b/24B) */
54008
54009 typedef struct cmdq_destroy_cq {
54010 /* Command opcode. */
54011 uint8_t opcode;
54012 /* Destroy CQ command deletes and flushes the specified CQ. */
54013 #define CMDQ_DESTROY_CQ_OPCODE_DESTROY_CQ UINT32_C(0xa)
54014 #define CMDQ_DESTROY_CQ_OPCODE_LAST CMDQ_DESTROY_CQ_OPCODE_DESTROY_CQ
54015 /* Size of the command in 16-byte units. */
54016 uint8_t cmd_size;
54017 /* Flags and attribs of the command. */
54018 uint16_t flags;
54019 /* Driver supplied handle to associate the command and the response. */
54020 uint16_t cookie;
54021 /* Size of the response buffer in 16-byte units. */
54022 uint8_t resp_size;
54023 uint8_t reserved8;
54024 /* Host address of the response. */
54025 uint64_t resp_addr;
54026 /* CQ context id */
54027 uint32_t cq_cid;
54028 uint32_t unused_0;
54029 } cmdq_destroy_cq_t, *pcmdq_destroy_cq_t;
54030
54031 /* creq_destroy_cq_resp (size:128b/16B) */
54032
54033 typedef struct creq_destroy_cq_resp {
54034 uint8_t type;
54035 /*
54036 * This field indicates the exact type of the completion.
54037 * By convention, the LSB identifies the length of the
54038 * record in 16B units. Even values indicate 16B
54039 * records. Odd values indicate 32B
54040 * records.
54041 */
54042 #define CREQ_DESTROY_CQ_RESP_TYPE_MASK UINT32_C(0x3f)
54043 #define CREQ_DESTROY_CQ_RESP_TYPE_SFT 0
54044 /* QP Async Notification */
54045 #define CREQ_DESTROY_CQ_RESP_TYPE_QP_EVENT UINT32_C(0x38)
54046 #define CREQ_DESTROY_CQ_RESP_TYPE_LAST CREQ_DESTROY_CQ_RESP_TYPE_QP_EVENT
54047 /* Status of the response. */
54048 uint8_t status;
54049 /* Driver supplied handle to associate the command and the response. */
54050 uint16_t cookie;
54051 /* CQ context id */
54052 uint32_t xid;
54053 uint8_t v;
54054 /*
54055 * This value is written by the NIC such that it will be different
54056 * for each pass through the completion queue. The even passes
54057 * will write 1. The odd passes will write 0.
54058 */
54059 #define CREQ_DESTROY_CQ_RESP_V UINT32_C(0x1)
54060 /* Event or command opcode. */
54061 uint8_t event;
54062 /* Destroy CQ command response. */
54063 #define CREQ_DESTROY_CQ_RESP_EVENT_DESTROY_CQ UINT32_C(0xa)
54064 #define CREQ_DESTROY_CQ_RESP_EVENT_LAST CREQ_DESTROY_CQ_RESP_EVENT_DESTROY_CQ
54065 uint16_t cq_arm_lvl;
54066 /*
54067 * CQ ARM Level:
54068 * 0 ? Not Armed
54069 * 1 ? Arm SE Only, Generate CNQE only for incoming Solicted Events
54070 * 2 ? Arm all, Generate CNQE for Rx and Tx
54071 */
54072 #define CREQ_DESTROY_CQ_RESP_CQ_ARM_LVL_MASK UINT32_C(0x3)
54073 #define CREQ_DESTROY_CQ_RESP_CQ_ARM_LVL_SFT 0
54074 /*
54075 * The total number of CNQ events for the CQ, incremented on each CNQ event for the CQ
54076 * (including firmware-generated CQ error notification).
54077 */
54078 uint16_t total_cnq_events;
54079 uint16_t reserved16;
54080 } creq_destroy_cq_resp_t, *pcreq_destroy_cq_resp_t;
54081
54082 /*************
54083 * resize_cq *
54084 *************/
54085
54086
54087 /* cmdq_resize_cq (size:320b/40B) */
54088
54089 typedef struct cmdq_resize_cq {
54090 /* Command opcode. */
54091 uint8_t opcode;
54092 /* Resize CQ command resizes the specified CQ. */
54093 #define CMDQ_RESIZE_CQ_OPCODE_RESIZE_CQ UINT32_C(0xc)
54094 #define CMDQ_RESIZE_CQ_OPCODE_LAST CMDQ_RESIZE_CQ_OPCODE_RESIZE_CQ
54095 /* Size of the command in 16-byte units. */
54096 uint8_t cmd_size;
54097 /* Flags and attribs of the command. */
54098 uint16_t flags;
54099 /* Driver supplied handle to associate the command and the response. */
54100 uint16_t cookie;
54101 /* Size of the response buffer in 16-byte units. */
54102 uint8_t resp_size;
54103 uint8_t reserved8;
54104 /* Host address of the response. */
54105 uint64_t resp_addr;
54106 /* CQ context id */
54107 uint32_t cq_cid;
54108 uint32_t new_cq_size_pg_size_lvl;
54109 /* PBL indirect levels. */
54110 #define CMDQ_RESIZE_CQ_LVL_MASK UINT32_C(0x3)
54111 #define CMDQ_RESIZE_CQ_LVL_SFT 0
54112 /* PBL pointer is physical start address. */
54113 #define CMDQ_RESIZE_CQ_LVL_LVL_0 UINT32_C(0x0)
54114 /* PBL pointer points to PTE table. */
54115 #define CMDQ_RESIZE_CQ_LVL_LVL_1 UINT32_C(0x1)
54116 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
54117 #define CMDQ_RESIZE_CQ_LVL_LVL_2 UINT32_C(0x2)
54118 #define CMDQ_RESIZE_CQ_LVL_LAST CMDQ_RESIZE_CQ_LVL_LVL_2
54119 /* page size. */
54120 #define CMDQ_RESIZE_CQ_PG_SIZE_MASK UINT32_C(0x1c)
54121 #define CMDQ_RESIZE_CQ_PG_SIZE_SFT 2
54122 /* 4KB. */
54123 #define CMDQ_RESIZE_CQ_PG_SIZE_PG_4K (UINT32_C(0x0) << 2)
54124 /* 8KB. */
54125 #define CMDQ_RESIZE_CQ_PG_SIZE_PG_8K (UINT32_C(0x1) << 2)
54126 /* 64KB. */
54127 #define CMDQ_RESIZE_CQ_PG_SIZE_PG_64K (UINT32_C(0x2) << 2)
54128 /* 2MB. */
54129 #define CMDQ_RESIZE_CQ_PG_SIZE_PG_2M (UINT32_C(0x3) << 2)
54130 /* 8MB. */
54131 #define CMDQ_RESIZE_CQ_PG_SIZE_PG_8M (UINT32_C(0x4) << 2)
54132 /* 1GB. */
54133 #define CMDQ_RESIZE_CQ_PG_SIZE_PG_1G (UINT32_C(0x5) << 2)
54134 #define CMDQ_RESIZE_CQ_PG_SIZE_LAST CMDQ_RESIZE_CQ_PG_SIZE_PG_1G
54135 /* New max number of CQ wqes. */
54136 #define CMDQ_RESIZE_CQ_NEW_CQ_SIZE_MASK UINT32_C(0x1fffffe0)
54137 #define CMDQ_RESIZE_CQ_NEW_CQ_SIZE_SFT 5
54138 /* CQ PBL physical address. */
54139 uint64_t new_pbl;
54140 /* Offset of first CQE in the first Page, in 32 byte units */
54141 uint32_t new_cq_fco;
54142 uint32_t unused_0;
54143 } cmdq_resize_cq_t, *pcmdq_resize_cq_t;
54144
54145 /* creq_resize_cq_resp (size:128b/16B) */
54146
54147 typedef struct creq_resize_cq_resp {
54148 uint8_t type;
54149 /*
54150 * This field indicates the exact type of the completion.
54151 * By convention, the LSB identifies the length of the
54152 * record in 16B units. Even values indicate 16B
54153 * records. Odd values indicate 32B
54154 * records.
54155 */
54156 #define CREQ_RESIZE_CQ_RESP_TYPE_MASK UINT32_C(0x3f)
54157 #define CREQ_RESIZE_CQ_RESP_TYPE_SFT 0
54158 /* QP Async Notification */
54159 #define CREQ_RESIZE_CQ_RESP_TYPE_QP_EVENT UINT32_C(0x38)
54160 #define CREQ_RESIZE_CQ_RESP_TYPE_LAST CREQ_RESIZE_CQ_RESP_TYPE_QP_EVENT
54161 /* Status of the response. */
54162 uint8_t status;
54163 /* Driver supplied handle to associate the command and the response. */
54164 uint16_t cookie;
54165 /* CQ context id */
54166 uint32_t xid;
54167 uint8_t v;
54168 /*
54169 * This value is written by the NIC such that it will be different
54170 * for each pass through the completion queue. The even passes
54171 * will write 1. The odd passes will write 0.
54172 */
54173 #define CREQ_RESIZE_CQ_RESP_V UINT32_C(0x1)
54174 /* Event or command opcode. */
54175 uint8_t event;
54176 /* Resize CQ command response. */
54177 #define CREQ_RESIZE_CQ_RESP_EVENT_RESIZE_CQ UINT32_C(0xc)
54178 #define CREQ_RESIZE_CQ_RESP_EVENT_LAST CREQ_RESIZE_CQ_RESP_EVENT_RESIZE_CQ
54179 uint8_t reserved48[6];
54180 } creq_resize_cq_resp_t, *pcreq_resize_cq_resp_t;
54181
54182 /*************
54183 * modify_cq *
54184 *************/
54185
54186
54187 /* cmdq_modify_cq (size:512b/64B) */
54188
54189 typedef struct cmdq_modify_cq {
54190 /* Command opcode. */
54191 uint8_t opcode;
54192 /* Modify CQ updates specific params in the CQ context. */
54193 #define CMDQ_MODIFY_CQ_OPCODE_MODIFY_CQ UINT32_C(0x90)
54194 #define CMDQ_MODIFY_CQ_OPCODE_LAST CMDQ_MODIFY_CQ_OPCODE_MODIFY_CQ
54195 /* Size of the command in 16-byte units. */
54196 uint8_t cmd_size;
54197 /* Flags and attribs of the command. */
54198 uint16_t flags;
54199 /* Driver supplied handle to associate the command and the response. */
54200 uint16_t cookie;
54201 /* Size of the response buffer in 16-byte units. */
54202 uint8_t resp_size;
54203 uint8_t reserved8;
54204 /* Host address of the response. */
54205 uint64_t resp_addr;
54206 /* Modify mask signifies the field that is requesting the change. */
54207 uint32_t modify_mask;
54208 /* Enable change. */
54209 #define CMDQ_MODIFY_CQ_MODIFY_MASK_CQ_HANDLE UINT32_C(0x1)
54210 /* CNQ ID */
54211 #define CMDQ_MODIFY_CQ_MODIFY_MASK_CNQ_ID UINT32_C(0x2)
54212 /* Offset of first CQE in the first page, in 32 byte units */
54213 #define CMDQ_MODIFY_CQ_MODIFY_MASK_FCO UINT32_C(0x4)
54214 /* Doorbell page index */
54215 #define CMDQ_MODIFY_CQ_MODIFY_MASK_DPI UINT32_C(0x8)
54216 /* Max number of CQ Wqes */
54217 #define CMDQ_MODIFY_CQ_MODIFY_MASK_CQ_SIZE UINT32_C(0x10)
54218 /* CQ PBL physical address */
54219 #define CMDQ_MODIFY_CQ_MODIFY_MASK_PBL UINT32_C(0x20)
54220 /* reserved32 is 32 b */
54221 uint32_t reserved32;
54222 /* CQ handle. */
54223 uint64_t cq_handle;
54224 uint32_t cq_fco_cnq_id;
54225 /* cnq_id is 12 b */
54226 #define CMDQ_MODIFY_CQ_CNQ_ID_MASK UINT32_C(0xfff)
54227 #define CMDQ_MODIFY_CQ_CNQ_ID_SFT 0
54228 /* Offset of first CQE in the first Page, in 32 byte units */
54229 #define CMDQ_MODIFY_CQ_CQ_FCO_MASK UINT32_C(0xfffff000)
54230 #define CMDQ_MODIFY_CQ_CQ_FCO_SFT 12
54231 /* Doorbell page index. */
54232 uint32_t dpi;
54233 /* Max number of CQ wqes. */
54234 uint32_t cq_size;
54235 /* reserved32_1 is 32 b */
54236 uint32_t reserved32_1;
54237 /* CQ PBL physical address. */
54238 uint64_t pbl;
54239 /* reserved64 is 64 b */
54240 uint64_t reserved64;
54241 } cmdq_modify_cq_t, *pcmdq_modify_cq_t;
54242
54243 /* creq_modify_cq_resp (size:128b/16B) */
54244
54245 typedef struct creq_modify_cq_resp {
54246 uint8_t type;
54247 /*
54248 * This field indicates the exact type of the completion.
54249 * By convention, the LSB identifies the length of the
54250 * record in 16B units. Even values indicate 16B
54251 * records. Odd values indicate 32B
54252 * records.
54253 */
54254 #define CREQ_MODIFY_CQ_RESP_TYPE_MASK UINT32_C(0x3f)
54255 #define CREQ_MODIFY_CQ_RESP_TYPE_SFT 0
54256 /* QP Async Notification */
54257 #define CREQ_MODIFY_CQ_RESP_TYPE_QP_EVENT UINT32_C(0x38)
54258 #define CREQ_MODIFY_CQ_RESP_TYPE_LAST CREQ_MODIFY_CQ_RESP_TYPE_QP_EVENT
54259 /* Status of the response. */
54260 uint8_t status;
54261 /* Driver supplied handle to associate the command and the response. */
54262 uint16_t cookie;
54263 /* CQ context id */
54264 uint32_t xid;
54265 uint8_t v;
54266 /*
54267 * This value is written by the NIC such that it will be different
54268 * for each pass through the completion queue. The even passes
54269 * will write 1. The odd passes will write 0.
54270 */
54271 #define CREQ_MODIFY_CQ_RESP_V UINT32_C(0x1)
54272 /* Event or command opcode. */
54273 uint8_t event;
54274 /* Modify CQ command response. */
54275 #define CREQ_MODIFY_CQ_RESP_EVENT_MODIFY_CQ UINT32_C(0x9)
54276 #define CREQ_MODIFY_CQ_RESP_EVENT_LAST CREQ_MODIFY_CQ_RESP_EVENT_MODIFY_CQ
54277 uint8_t reserved48[6];
54278 } creq_modify_cq_resp_t, *pcreq_modify_cq_resp_t;
54279
54280 /****************
54281 * allocate_mrw *
54282 ****************/
54283
54284
54285 /* cmdq_allocate_mrw (size:256b/32B) */
54286
54287 typedef struct cmdq_allocate_mrw {
54288 /* Command opcode. */
54289 uint8_t opcode;
54290 /*
54291 * Allocate MRW command allocates a MR/MW with the specified parameters
54292 * and returns the region's L_KEY/R_KEY
54293 */
54294 #define CMDQ_ALLOCATE_MRW_OPCODE_ALLOCATE_MRW UINT32_C(0xd)
54295 #define CMDQ_ALLOCATE_MRW_OPCODE_LAST CMDQ_ALLOCATE_MRW_OPCODE_ALLOCATE_MRW
54296 /* Size of the command in 16-byte units. */
54297 uint8_t cmd_size;
54298 /* Flags and attribs of the command. */
54299 uint16_t flags;
54300 /* Driver supplied handle to associate the command and the response. */
54301 uint16_t cookie;
54302 /* Size of the response buffer in 16-byte units. */
54303 uint8_t resp_size;
54304 uint8_t reserved8;
54305 /* Host address of the response. */
54306 uint64_t resp_addr;
54307 /* MRW handle. */
54308 uint64_t mrw_handle;
54309 uint8_t mrw_flags;
54310 /* Allocate MRW flags. */
54311 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MASK UINT32_C(0xf)
54312 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_SFT 0
54313 /* Allocate Memory Region */
54314 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MR UINT32_C(0x0)
54315 /* Allocate Physical Memory Region */
54316 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_PMR UINT32_C(0x1)
54317 /* Allocate Memory Window (type 1) */
54318 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1 UINT32_C(0x2)
54319 /* Allocate Memory Window (type 2A) */
54320 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A UINT32_C(0x3)
54321 /* Allocate Memory Window (type 2B) */
54322 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B UINT32_C(0x4)
54323 #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_LAST CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B
54324 /* unused4 is 4 b */
54325 #define CMDQ_ALLOCATE_MRW_UNUSED4_MASK UINT32_C(0xf0)
54326 #define CMDQ_ALLOCATE_MRW_UNUSED4_SFT 4
54327 /* Access flags. */
54328 uint8_t access;
54329 /* Consumer owns the key */
54330 #define CMDQ_ALLOCATE_MRW_ACCESS_CONSUMER_OWNED_KEY UINT32_C(0x20)
54331 /* unused16 is 16 b */
54332 uint16_t unused16;
54333 /* Protection domain id. */
54334 uint32_t pd_id;
54335 } cmdq_allocate_mrw_t, *pcmdq_allocate_mrw_t;
54336
54337 /* creq_allocate_mrw_resp (size:128b/16B) */
54338
54339 typedef struct creq_allocate_mrw_resp {
54340 uint8_t type;
54341 /*
54342 * This field indicates the exact type of the completion.
54343 * By convention, the LSB identifies the length of the
54344 * record in 16B units. Even values indicate 16B
54345 * records. Odd values indicate 32B
54346 * records.
54347 */
54348 #define CREQ_ALLOCATE_MRW_RESP_TYPE_MASK UINT32_C(0x3f)
54349 #define CREQ_ALLOCATE_MRW_RESP_TYPE_SFT 0
54350 /* QP Async Notification */
54351 #define CREQ_ALLOCATE_MRW_RESP_TYPE_QP_EVENT UINT32_C(0x38)
54352 #define CREQ_ALLOCATE_MRW_RESP_TYPE_LAST CREQ_ALLOCATE_MRW_RESP_TYPE_QP_EVENT
54353 /* Status of the response. */
54354 uint8_t status;
54355 /* Driver supplied handle to associate the command and the response. */
54356 uint16_t cookie;
54357 /* L_KEY for MR, R_KEY for MW */
54358 uint32_t xid;
54359 uint8_t v;
54360 /*
54361 * This value is written by the NIC such that it will be different
54362 * for each pass through the completion queue. The even passes
54363 * will write 1. The odd passes will write 0.
54364 */
54365 #define CREQ_ALLOCATE_MRW_RESP_V UINT32_C(0x1)
54366 /* Event or command opcode. */
54367 uint8_t event;
54368 /* Allocate MRW command response. */
54369 #define CREQ_ALLOCATE_MRW_RESP_EVENT_ALLOCATE_MRW UINT32_C(0xd)
54370 #define CREQ_ALLOCATE_MRW_RESP_EVENT_LAST CREQ_ALLOCATE_MRW_RESP_EVENT_ALLOCATE_MRW
54371 uint8_t reserved48[6];
54372 } creq_allocate_mrw_resp_t, *pcreq_allocate_mrw_resp_t;
54373
54374 /******************
54375 * deallocate_key *
54376 ******************/
54377
54378
54379 /* cmdq_deallocate_key (size:192b/24B) */
54380
54381 typedef struct cmdq_deallocate_key {
54382 /* Command opcode. */
54383 uint8_t opcode;
54384 /* De-allocate key command frees a MR/MW entry associated with the specified key. */
54385 #define CMDQ_DEALLOCATE_KEY_OPCODE_DEALLOCATE_KEY UINT32_C(0xe)
54386 #define CMDQ_DEALLOCATE_KEY_OPCODE_LAST CMDQ_DEALLOCATE_KEY_OPCODE_DEALLOCATE_KEY
54387 /* Size of the command in 16-byte units. */
54388 uint8_t cmd_size;
54389 /* Flags and attribs of the command. */
54390 uint16_t flags;
54391 /* Driver supplied handle to associate the command and the response. */
54392 uint16_t cookie;
54393 /* Size of the response buffer in 16-byte units. */
54394 uint8_t resp_size;
54395 uint8_t reserved8;
54396 /* Host address of the response. */
54397 uint64_t resp_addr;
54398 uint8_t mrw_flags;
54399 /* Deallocate MRW flags. */
54400 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MASK UINT32_C(0xf)
54401 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_SFT 0
54402 /* Deallocate Memory Region */
54403 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MR UINT32_C(0x0)
54404 /* Deallocate Physical Memory Region */
54405 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_PMR UINT32_C(0x1)
54406 /* Deallocate Memory Window (type 1) */
54407 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE1 UINT32_C(0x2)
54408 /* Deallocate Memory Window (type 2A) */
54409 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE2A UINT32_C(0x3)
54410 /* Deallocate Memory Window (type 2B) */
54411 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE2B UINT32_C(0x4)
54412 #define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_LAST CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE2B
54413 /* unused4 is 4 b */
54414 #define CMDQ_DEALLOCATE_KEY_UNUSED4_MASK UINT32_C(0xf0)
54415 #define CMDQ_DEALLOCATE_KEY_UNUSED4_SFT 4
54416 /* unused24 is 24 b */
54417 uint8_t unused24[3];
54418 /* key is 32 b */
54419 uint32_t key;
54420 } cmdq_deallocate_key_t, *pcmdq_deallocate_key_t;
54421
54422 /* creq_deallocate_key_resp (size:128b/16B) */
54423
54424 typedef struct creq_deallocate_key_resp {
54425 uint8_t type;
54426 /*
54427 * This field indicates the exact type of the completion.
54428 * By convention, the LSB identifies the length of the
54429 * record in 16B units. Even values indicate 16B
54430 * records. Odd values indicate 32B
54431 * records.
54432 */
54433 #define CREQ_DEALLOCATE_KEY_RESP_TYPE_MASK UINT32_C(0x3f)
54434 #define CREQ_DEALLOCATE_KEY_RESP_TYPE_SFT 0
54435 /* QP Async Notification */
54436 #define CREQ_DEALLOCATE_KEY_RESP_TYPE_QP_EVENT UINT32_C(0x38)
54437 #define CREQ_DEALLOCATE_KEY_RESP_TYPE_LAST CREQ_DEALLOCATE_KEY_RESP_TYPE_QP_EVENT
54438 /* Status of the response. */
54439 uint8_t status;
54440 /* Driver supplied handle to associate the command and the response. */
54441 uint16_t cookie;
54442 /* L_KEY for MR, R_KEY for MW */
54443 uint32_t xid;
54444 uint8_t v;
54445 /*
54446 * This value is written by the NIC such that it will be different
54447 * for each pass through the completion queue. The even passes
54448 * will write 1. The odd passes will write 0.
54449 */
54450 #define CREQ_DEALLOCATE_KEY_RESP_V UINT32_C(0x1)
54451 /* Event or command opcode. */
54452 uint8_t event;
54453 /* De-allocate key command response. */
54454 #define CREQ_DEALLOCATE_KEY_RESP_EVENT_DEALLOCATE_KEY UINT32_C(0xe)
54455 #define CREQ_DEALLOCATE_KEY_RESP_EVENT_LAST CREQ_DEALLOCATE_KEY_RESP_EVENT_DEALLOCATE_KEY
54456 uint16_t reserved16;
54457 /*
54458 * This is advisory data to facilitate eventual descruction of lingering memory regions in Windows.
54459 * For memory window, it contains non-zero HWID of a region this window was bound to (without the 8-bit key portion).
54460 * The host may check if the region is lingering in destroyed state and try to destroy it now.
54461 * For memory region, if deallocation fails because there are windows bound to this region, this field will contain
54462 * approximate number of those windows. This number is read from the context right before the
54463 * deregistration is attempted and can potentially be slightly different from the current number.
54464 */
54465 uint32_t bound_window_info;
54466 } creq_deallocate_key_resp_t, *pcreq_deallocate_key_resp_t;
54467
54468 /***************
54469 * register_mr *
54470 ***************/
54471
54472
54473 /* cmdq_register_mr (size:384b/48B) */
54474
54475 typedef struct cmdq_register_mr {
54476 /* Command opcode. */
54477 uint8_t opcode;
54478 /* Register MR command registers memory to the specified MR. */
54479 #define CMDQ_REGISTER_MR_OPCODE_REGISTER_MR UINT32_C(0xf)
54480 #define CMDQ_REGISTER_MR_OPCODE_LAST CMDQ_REGISTER_MR_OPCODE_REGISTER_MR
54481 /* Size of the command in 16-byte units. */
54482 uint8_t cmd_size;
54483 /* Flags and attribs of the command. */
54484 uint16_t flags;
54485 /*
54486 * When set, a new MR will be allocated first and then registered
54487 * using the fields in this command. Note that for MR allocation
54488 * the `key` field doesn't hold a valid L_KEY and is instead
54489 * overloaded to hold the Protection Domain ID `pd_id`.
54490 */
54491 #define CMDQ_REGISTER_MR_FLAGS_ALLOC_MR UINT32_C(0x1)
54492 /* Driver supplied handle to associate the command and the response. */
54493 uint16_t cookie;
54494 /* Size of the response buffer in 16-byte units. */
54495 uint8_t resp_size;
54496 uint8_t reserved8;
54497 /* Host address of the response. */
54498 uint64_t resp_addr;
54499 uint8_t log2_pg_size_lvl;
54500 /* PBL indirect levels. */
54501 #define CMDQ_REGISTER_MR_LVL_MASK UINT32_C(0x3)
54502 #define CMDQ_REGISTER_MR_LVL_SFT 0
54503 /* PBL pointer is physical start address. */
54504 #define CMDQ_REGISTER_MR_LVL_LVL_0 UINT32_C(0x0)
54505 /* PBL pointer points to PTE table. */
54506 #define CMDQ_REGISTER_MR_LVL_LVL_1 UINT32_C(0x1)
54507 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
54508 #define CMDQ_REGISTER_MR_LVL_LVL_2 UINT32_C(0x2)
54509 #define CMDQ_REGISTER_MR_LVL_LAST CMDQ_REGISTER_MR_LVL_LVL_2
54510 /* Log base 2 of page size; 12 is the minimum for 4KB. HW supported values are enumerated below. */
54511 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_MASK UINT32_C(0x7c)
54512 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_SFT 2
54513 /* 4KB. */
54514 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_4K (UINT32_C(0xc) << 2)
54515 /* 8KB. */
54516 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_8K (UINT32_C(0xd) << 2)
54517 /* 64KB. */
54518 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_64K (UINT32_C(0x10) << 2)
54519 /* 256KB. */
54520 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_256K (UINT32_C(0x12) << 2)
54521 /* 1MB. */
54522 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_1M (UINT32_C(0x14) << 2)
54523 /* 2MB. */
54524 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_2M (UINT32_C(0x15) << 2)
54525 /* 4MB. */
54526 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_4M (UINT32_C(0x16) << 2)
54527 /* 1GB. */
54528 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_1G (UINT32_C(0x1e) << 2)
54529 #define CMDQ_REGISTER_MR_LOG2_PG_SIZE_LAST CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_1G
54530 /* unused1 is 1 b */
54531 #define CMDQ_REGISTER_MR_UNUSED1 UINT32_C(0x80)
54532 /* Access flags. */
54533 uint8_t access;
54534 /* Local write access. */
54535 #define CMDQ_REGISTER_MR_ACCESS_LOCAL_WRITE UINT32_C(0x1)
54536 /* Remote read access. */
54537 #define CMDQ_REGISTER_MR_ACCESS_REMOTE_READ UINT32_C(0x2)
54538 /* Remote write access. */
54539 #define CMDQ_REGISTER_MR_ACCESS_REMOTE_WRITE UINT32_C(0x4)
54540 /* Remote atomic access. */
54541 #define CMDQ_REGISTER_MR_ACCESS_REMOTE_ATOMIC UINT32_C(0x8)
54542 /* Bind access allowed. */
54543 #define CMDQ_REGISTER_MR_ACCESS_MW_BIND UINT32_C(0x10)
54544 /* Indicate Zero Based Virtual Address (ZBVA). */
54545 #define CMDQ_REGISTER_MR_ACCESS_ZERO_BASED UINT32_C(0x20)
54546 uint16_t log2_pbl_pg_size;
54547 /* Log base 2 of PBL page size; 12 is the minimum for 4KB. HW supported values are enumerated below */
54548 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_MASK UINT32_C(0x1f)
54549 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_SFT 0
54550 /* 4KB. */
54551 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_4K UINT32_C(0xc)
54552 /* 8KB. */
54553 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_8K UINT32_C(0xd)
54554 /* 64KB. */
54555 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_64K UINT32_C(0x10)
54556 /* 256KB. */
54557 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_256K UINT32_C(0x12)
54558 /* 1MB. */
54559 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_1M UINT32_C(0x14)
54560 /* 2MB. */
54561 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_2M UINT32_C(0x15)
54562 /* 4MB. */
54563 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_4M UINT32_C(0x16)
54564 /* 1GB. */
54565 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_1G UINT32_C(0x1e)
54566 #define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_LAST CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_1G
54567 /* unused11 is 11 b */
54568 #define CMDQ_REGISTER_MR_UNUSED11_MASK UINT32_C(0xffe0)
54569 #define CMDQ_REGISTER_MR_UNUSED11_SFT 5
54570 /*
54571 * L_KEY of the previously allocated MR.
54572 *
54573 * If the `ALLOC_MR` flag is set then this field does not hold an
54574 * L_KEY and instead contains the Protection Domain ID `pd_id`.
54575 */
54576 uint32_t key;
54577 /* Page table of the MR memory. */
54578 uint64_t pbl;
54579 /* Virtual address of the MR. */
54580 uint64_t va;
54581 /* Size of the MR. */
54582 uint64_t mr_size;
54583 } cmdq_register_mr_t, *pcmdq_register_mr_t;
54584
54585 /* creq_register_mr_resp (size:128b/16B) */
54586
54587 typedef struct creq_register_mr_resp {
54588 uint8_t type;
54589 /*
54590 * This field indicates the exact type of the completion.
54591 * By convention, the LSB identifies the length of the
54592 * record in 16B units. Even values indicate 16B
54593 * records. Odd values indicate 32B
54594 * records.
54595 */
54596 #define CREQ_REGISTER_MR_RESP_TYPE_MASK UINT32_C(0x3f)
54597 #define CREQ_REGISTER_MR_RESP_TYPE_SFT 0
54598 /* QP Async Notification */
54599 #define CREQ_REGISTER_MR_RESP_TYPE_QP_EVENT UINT32_C(0x38)
54600 #define CREQ_REGISTER_MR_RESP_TYPE_LAST CREQ_REGISTER_MR_RESP_TYPE_QP_EVENT
54601 /* Status of the response. */
54602 uint8_t status;
54603 /* Driver supplied handle to associate the command and the response. */
54604 uint16_t cookie;
54605 /* L_KEY */
54606 uint32_t xid;
54607 uint8_t v;
54608 /*
54609 * This value is written by the NIC such that it will be different
54610 * for each pass through the completion queue. The even passes
54611 * will write 1. The odd passes will write 0.
54612 */
54613 #define CREQ_REGISTER_MR_RESP_V UINT32_C(0x1)
54614 /* Event or command opcode. */
54615 uint8_t event;
54616 /* Register MR command response. */
54617 #define CREQ_REGISTER_MR_RESP_EVENT_REGISTER_MR UINT32_C(0xf)
54618 #define CREQ_REGISTER_MR_RESP_EVENT_LAST CREQ_REGISTER_MR_RESP_EVENT_REGISTER_MR
54619 uint8_t reserved48[6];
54620 } creq_register_mr_resp_t, *pcreq_register_mr_resp_t;
54621
54622 /*****************
54623 * deregister_mr *
54624 *****************/
54625
54626
54627 /* cmdq_deregister_mr (size:192b/24B) */
54628
54629 typedef struct cmdq_deregister_mr {
54630 /* Command opcode. */
54631 uint8_t opcode;
54632 /* Deregister MR command de-registers memory from the specified MR. */
54633 #define CMDQ_DEREGISTER_MR_OPCODE_DEREGISTER_MR UINT32_C(0x10)
54634 #define CMDQ_DEREGISTER_MR_OPCODE_LAST CMDQ_DEREGISTER_MR_OPCODE_DEREGISTER_MR
54635 /* Size of the command in 16-byte units. */
54636 uint8_t cmd_size;
54637 /* Flags and attribs of the command. */
54638 uint16_t flags;
54639 /* Driver supplied handle to associate the command and the response. */
54640 uint16_t cookie;
54641 /* Size of the response buffer in 16-byte units. */
54642 uint8_t resp_size;
54643 uint8_t reserved8;
54644 /* Host address of the response. */
54645 uint64_t resp_addr;
54646 /* L_KEY of the MR. */
54647 uint32_t lkey;
54648 uint32_t unused_0;
54649 } cmdq_deregister_mr_t, *pcmdq_deregister_mr_t;
54650
54651 /* creq_deregister_mr_resp (size:128b/16B) */
54652
54653 typedef struct creq_deregister_mr_resp {
54654 uint8_t type;
54655 /*
54656 * This field indicates the exact type of the completion.
54657 * By convention, the LSB identifies the length of the
54658 * record in 16B units. Even values indicate 16B
54659 * records. Odd values indicate 32B
54660 * records.
54661 */
54662 #define CREQ_DEREGISTER_MR_RESP_TYPE_MASK UINT32_C(0x3f)
54663 #define CREQ_DEREGISTER_MR_RESP_TYPE_SFT 0
54664 /* QP Async Notification */
54665 #define CREQ_DEREGISTER_MR_RESP_TYPE_QP_EVENT UINT32_C(0x38)
54666 #define CREQ_DEREGISTER_MR_RESP_TYPE_LAST CREQ_DEREGISTER_MR_RESP_TYPE_QP_EVENT
54667 /* Status of the response. */
54668 uint8_t status;
54669 /* Driver supplied handle to associate the command and the response. */
54670 uint16_t cookie;
54671 /* L_KEY */
54672 uint32_t xid;
54673 uint8_t v;
54674 /*
54675 * This value is written by the NIC such that it will be different
54676 * for each pass through the completion queue. The even passes
54677 * will write 1. The odd passes will write 0.
54678 */
54679 #define CREQ_DEREGISTER_MR_RESP_V UINT32_C(0x1)
54680 /* Event or command opcode. */
54681 uint8_t event;
54682 /* Deregister MR command response. */
54683 #define CREQ_DEREGISTER_MR_RESP_EVENT_DEREGISTER_MR UINT32_C(0x10)
54684 #define CREQ_DEREGISTER_MR_RESP_EVENT_LAST CREQ_DEREGISTER_MR_RESP_EVENT_DEREGISTER_MR
54685 uint16_t reserved16;
54686 /*
54687 * If deregister fails because there are windows bound to this region, this field will contain
54688 * approximate number of those windows. This number is read from the context right before the
54689 * deregistration is attempted and can potentially be slightly different from the current number.
54690 */
54691 uint32_t bound_windows;
54692 } creq_deregister_mr_resp_t, *pcreq_deregister_mr_resp_t;
54693
54694 /***********
54695 * add_gid *
54696 ***********/
54697
54698
54699 /* cmdq_add_gid (size:384b/48B) */
54700
54701 typedef struct cmdq_add_gid {
54702 /* Command opcode. */
54703 uint8_t opcode;
54704 /* Add GID command adds a GID to the local address table. */
54705 #define CMDQ_ADD_GID_OPCODE_ADD_GID UINT32_C(0x11)
54706 #define CMDQ_ADD_GID_OPCODE_LAST CMDQ_ADD_GID_OPCODE_ADD_GID
54707 /* Size of the command in 16-byte units. */
54708 uint8_t cmd_size;
54709 /* Flags and attribs of the command. */
54710 uint16_t flags;
54711 /* Driver supplied handle to associate the command and the response. */
54712 uint16_t cookie;
54713 /* Size of the response buffer in 16-byte units. */
54714 uint8_t resp_size;
54715 uint8_t reserved8;
54716 /* Host address of the response. */
54717 uint64_t resp_addr;
54718 /* GID, specified in LE format. */
54719 uint32_t gid[4];
54720 /* Source MAC. */
54721 uint16_t src_mac[3];
54722 /* flags. */
54723 uint16_t vlan;
54724 #define CMDQ_ADD_GID_VLAN_VLAN_EN_TPID_VLAN_ID_MASK UINT32_C(0xffff)
54725 #define CMDQ_ADD_GID_VLAN_VLAN_EN_TPID_VLAN_ID_SFT 0
54726 /* Source VLAN id. */
54727 #define CMDQ_ADD_GID_VLAN_VLAN_ID_MASK UINT32_C(0xfff)
54728 #define CMDQ_ADD_GID_VLAN_VLAN_ID_SFT 0
54729 /* This set of bits select the TPID of the VLAN Tag. */
54730 #define CMDQ_ADD_GID_VLAN_TPID_MASK UINT32_C(0x7000)
54731 #define CMDQ_ADD_GID_VLAN_TPID_SFT 12
54732 /* TPID = 0x88A8. */
54733 #define CMDQ_ADD_GID_VLAN_TPID_TPID_88A8 (UINT32_C(0x0) << 12)
54734 /* TPID = 0x8100. */
54735 #define CMDQ_ADD_GID_VLAN_TPID_TPID_8100 (UINT32_C(0x1) << 12)
54736 /* TPID = 0x9100. */
54737 #define CMDQ_ADD_GID_VLAN_TPID_TPID_9100 (UINT32_C(0x2) << 12)
54738 /* TPID = 0x9200. */
54739 #define CMDQ_ADD_GID_VLAN_TPID_TPID_9200 (UINT32_C(0x3) << 12)
54740 /* TPID = 0x9300. */
54741 #define CMDQ_ADD_GID_VLAN_TPID_TPID_9300 (UINT32_C(0x4) << 12)
54742 /* TPID = Configurable 1. */
54743 #define CMDQ_ADD_GID_VLAN_TPID_TPID_CFG1 (UINT32_C(0x5) << 12)
54744 /* TPID = Configurable 2. */
54745 #define CMDQ_ADD_GID_VLAN_TPID_TPID_CFG2 (UINT32_C(0x6) << 12)
54746 /* TPID = Configurable 3. */
54747 #define CMDQ_ADD_GID_VLAN_TPID_TPID_CFG3 (UINT32_C(0x7) << 12)
54748 #define CMDQ_ADD_GID_VLAN_TPID_LAST CMDQ_ADD_GID_VLAN_TPID_TPID_CFG3
54749 /* Setting this bit to 1 enables insertion of a VLAN Tag to a RoCE header. */
54750 #define CMDQ_ADD_GID_VLAN_VLAN_EN UINT32_C(0x8000)
54751 /* Identifier field in the IP header. */
54752 uint16_t ipid;
54753 /* Stats context ID to use with this SGID */
54754 uint16_t stats_ctx;
54755 #define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_VALID_STATS_CTX_ID_MASK UINT32_C(0xffff)
54756 #define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_VALID_STATS_CTX_ID_SFT 0
54757 /* stats_ctx_id is 15 b */
54758 #define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_ID_MASK UINT32_C(0x7fff)
54759 #define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_ID_SFT 0
54760 /* Setting this bit to 1 enables use of own stats context ID instead of per-function */
54761 #define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_VALID UINT32_C(0x8000)
54762 uint32_t unused_0;
54763 } cmdq_add_gid_t, *pcmdq_add_gid_t;
54764
54765 /* creq_add_gid_resp (size:128b/16B) */
54766
54767 typedef struct creq_add_gid_resp {
54768 uint8_t type;
54769 /*
54770 * This field indicates the exact type of the completion.
54771 * By convention, the LSB identifies the length of the
54772 * record in 16B units. Even values indicate 16B
54773 * records. Odd values indicate 32B
54774 * records.
54775 */
54776 #define CREQ_ADD_GID_RESP_TYPE_MASK UINT32_C(0x3f)
54777 #define CREQ_ADD_GID_RESP_TYPE_SFT 0
54778 /* QP Async Notification */
54779 #define CREQ_ADD_GID_RESP_TYPE_QP_EVENT UINT32_C(0x38)
54780 #define CREQ_ADD_GID_RESP_TYPE_LAST CREQ_ADD_GID_RESP_TYPE_QP_EVENT
54781 /* Status of the response. */
54782 uint8_t status;
54783 /* Driver supplied handle to associate the command and the response. */
54784 uint16_t cookie;
54785 /* GID index */
54786 uint32_t xid;
54787 uint8_t v;
54788 /*
54789 * This value is written by the NIC such that it will be different
54790 * for each pass through the completion queue. The even passes
54791 * will write 1. The odd passes will write 0.
54792 */
54793 #define CREQ_ADD_GID_RESP_V UINT32_C(0x1)
54794 /* Event or command opcode. */
54795 uint8_t event;
54796 /* Add GID command response. */
54797 #define CREQ_ADD_GID_RESP_EVENT_ADD_GID UINT32_C(0x11)
54798 #define CREQ_ADD_GID_RESP_EVENT_LAST CREQ_ADD_GID_RESP_EVENT_ADD_GID
54799 uint8_t reserved48[6];
54800 } creq_add_gid_resp_t, *pcreq_add_gid_resp_t;
54801
54802 /**************
54803 * delete_gid *
54804 **************/
54805
54806
54807 /* cmdq_delete_gid (size:192b/24B) */
54808
54809 typedef struct cmdq_delete_gid {
54810 /* Command opcode. */
54811 uint8_t opcode;
54812 /* Delete GID command deletes a GID from the local address table. */
54813 #define CMDQ_DELETE_GID_OPCODE_DELETE_GID UINT32_C(0x12)
54814 #define CMDQ_DELETE_GID_OPCODE_LAST CMDQ_DELETE_GID_OPCODE_DELETE_GID
54815 /* Size of the command in 16-byte units. */
54816 uint8_t cmd_size;
54817 /* Flags and attribs of the command. */
54818 uint16_t flags;
54819 /* Driver supplied handle to associate the command and the response. */
54820 uint16_t cookie;
54821 /* Size of the response buffer in 16-byte units. */
54822 uint8_t resp_size;
54823 uint8_t reserved8;
54824 /* Host address of the response. */
54825 uint64_t resp_addr;
54826 /* GID index */
54827 uint16_t gid_index;
54828 uint8_t unused_0[6];
54829 } cmdq_delete_gid_t, *pcmdq_delete_gid_t;
54830
54831 /* creq_delete_gid_resp (size:128b/16B) */
54832
54833 typedef struct creq_delete_gid_resp {
54834 uint8_t type;
54835 /*
54836 * This field indicates the exact type of the completion.
54837 * By convention, the LSB identifies the length of the
54838 * record in 16B units. Even values indicate 16B
54839 * records. Odd values indicate 32B
54840 * records.
54841 */
54842 #define CREQ_DELETE_GID_RESP_TYPE_MASK UINT32_C(0x3f)
54843 #define CREQ_DELETE_GID_RESP_TYPE_SFT 0
54844 /* QP Async Notification */
54845 #define CREQ_DELETE_GID_RESP_TYPE_QP_EVENT UINT32_C(0x38)
54846 #define CREQ_DELETE_GID_RESP_TYPE_LAST CREQ_DELETE_GID_RESP_TYPE_QP_EVENT
54847 /* Status of the response. */
54848 uint8_t status;
54849 /* Driver supplied handle to associate the command and the response. */
54850 uint16_t cookie;
54851 /* GID index */
54852 uint32_t xid;
54853 uint8_t v;
54854 /*
54855 * This value is written by the NIC such that it will be different
54856 * for each pass through the completion queue. The even passes
54857 * will write 1. The odd passes will write 0.
54858 */
54859 #define CREQ_DELETE_GID_RESP_V UINT32_C(0x1)
54860 /* Event or command opcode. */
54861 uint8_t event;
54862 /* Delete GID command response. */
54863 #define CREQ_DELETE_GID_RESP_EVENT_DELETE_GID UINT32_C(0x12)
54864 #define CREQ_DELETE_GID_RESP_EVENT_LAST CREQ_DELETE_GID_RESP_EVENT_DELETE_GID
54865 uint8_t reserved48[6];
54866 } creq_delete_gid_resp_t, *pcreq_delete_gid_resp_t;
54867
54868 /**************
54869 * modify_gid *
54870 **************/
54871
54872
54873 /* cmdq_modify_gid (size:384b/48B) */
54874
54875 typedef struct cmdq_modify_gid {
54876 /* Command opcode. */
54877 uint8_t opcode;
54878 /* Modify GID command modifies a GID in the local address table. */
54879 #define CMDQ_MODIFY_GID_OPCODE_MODIFY_GID UINT32_C(0x17)
54880 #define CMDQ_MODIFY_GID_OPCODE_LAST CMDQ_MODIFY_GID_OPCODE_MODIFY_GID
54881 /* Size of the command in 16-byte units. */
54882 uint8_t cmd_size;
54883 /* Flags and attribs of the command. */
54884 uint16_t flags;
54885 /* Driver supplied handle to associate the command and the response. */
54886 uint16_t cookie;
54887 /* Size of the response buffer in 16-byte units. */
54888 uint8_t resp_size;
54889 uint8_t reserved8;
54890 /* Host address of the response. */
54891 uint64_t resp_addr;
54892 /* GID */
54893 uint32_t gid[4];
54894 /* Source MAC. */
54895 uint16_t src_mac[3];
54896 /* flags. */
54897 uint16_t vlan;
54898 /* Source VLAN id. */
54899 #define CMDQ_MODIFY_GID_VLAN_VLAN_ID_MASK UINT32_C(0xfff)
54900 #define CMDQ_MODIFY_GID_VLAN_VLAN_ID_SFT 0
54901 /* This set of bits select the TPID of the VLAN Tag. */
54902 #define CMDQ_MODIFY_GID_VLAN_TPID_MASK UINT32_C(0x7000)
54903 #define CMDQ_MODIFY_GID_VLAN_TPID_SFT 12
54904 /* TPID = 0x88A8. */
54905 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_88A8 (UINT32_C(0x0) << 12)
54906 /* TPID = 0x8100. */
54907 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_8100 (UINT32_C(0x1) << 12)
54908 /* TPID = 0x9100. */
54909 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_9100 (UINT32_C(0x2) << 12)
54910 /* TPID = 0x9200. */
54911 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_9200 (UINT32_C(0x3) << 12)
54912 /* TPID = 0x9300. */
54913 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_9300 (UINT32_C(0x4) << 12)
54914 /* TPID = Configurable 1. */
54915 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG1 (UINT32_C(0x5) << 12)
54916 /* TPID = Configurable 2. */
54917 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG2 (UINT32_C(0x6) << 12)
54918 /* TPID = Configurable 3. */
54919 #define CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG3 (UINT32_C(0x7) << 12)
54920 #define CMDQ_MODIFY_GID_VLAN_TPID_LAST CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG3
54921 /* Setting this bit to 1 enables insertion of a VLAN Tag to a RoCE header. */
54922 #define CMDQ_MODIFY_GID_VLAN_VLAN_EN UINT32_C(0x8000)
54923 /* Identifier field in the IP header. */
54924 uint16_t ipid;
54925 /* GID index */
54926 uint16_t gid_index;
54927 /* Stats context ID to use with this SGID */
54928 uint16_t stats_ctx;
54929 /* stats_ctx_id is 15 b */
54930 #define CMDQ_MODIFY_GID_STATS_CTX_STATS_CTX_ID_MASK UINT32_C(0x7fff)
54931 #define CMDQ_MODIFY_GID_STATS_CTX_STATS_CTX_ID_SFT 0
54932 /* Setting this bit to 1 enables use of own stats context ID instead of per-function */
54933 #define CMDQ_MODIFY_GID_STATS_CTX_STATS_CTX_VALID UINT32_C(0x8000)
54934 uint16_t unused_0;
54935 } cmdq_modify_gid_t, *pcmdq_modify_gid_t;
54936
54937 /* creq_modify_gid_resp (size:128b/16B) */
54938
54939 typedef struct creq_modify_gid_resp {
54940 uint8_t type;
54941 /*
54942 * This field indicates the exact type of the completion.
54943 * By convention, the LSB identifies the length of the
54944 * record in 16B units. Even values indicate 16B
54945 * records. Odd values indicate 32B
54946 * records.
54947 */
54948 #define CREQ_MODIFY_GID_RESP_TYPE_MASK UINT32_C(0x3f)
54949 #define CREQ_MODIFY_GID_RESP_TYPE_SFT 0
54950 /* QP Async Notification */
54951 #define CREQ_MODIFY_GID_RESP_TYPE_QP_EVENT UINT32_C(0x38)
54952 #define CREQ_MODIFY_GID_RESP_TYPE_LAST CREQ_MODIFY_GID_RESP_TYPE_QP_EVENT
54953 /* Status of the response. */
54954 uint8_t status;
54955 /* Driver supplied handle to associate the command and the response. */
54956 uint16_t cookie;
54957 /* GID index */
54958 uint32_t xid;
54959 uint8_t v;
54960 /*
54961 * This value is written by the NIC such that it will be different
54962 * for each pass through the completion queue. The even passes
54963 * will write 1. The odd passes will write 0.
54964 */
54965 #define CREQ_MODIFY_GID_RESP_V UINT32_C(0x1)
54966 /* Event or command opcode. */
54967 uint8_t event;
54968 /* Add GID command response. */
54969 #define CREQ_MODIFY_GID_RESP_EVENT_ADD_GID UINT32_C(0x11)
54970 #define CREQ_MODIFY_GID_RESP_EVENT_LAST CREQ_MODIFY_GID_RESP_EVENT_ADD_GID
54971 uint8_t reserved48[6];
54972 } creq_modify_gid_resp_t, *pcreq_modify_gid_resp_t;
54973
54974 /*************
54975 * query_gid *
54976 *************/
54977
54978
54979 /* cmdq_query_gid (size:192b/24B) */
54980
54981 typedef struct cmdq_query_gid {
54982 /* Command opcode. */
54983 uint8_t opcode;
54984 /* Query GID command queries a GID in the local address table. */
54985 #define CMDQ_QUERY_GID_OPCODE_QUERY_GID UINT32_C(0x18)
54986 #define CMDQ_QUERY_GID_OPCODE_LAST CMDQ_QUERY_GID_OPCODE_QUERY_GID
54987 /* Size of the command in 16-byte units. */
54988 uint8_t cmd_size;
54989 /* Flags and attribs of the command. */
54990 uint16_t flags;
54991 /* Driver supplied handle to associate the command and the response. */
54992 uint16_t cookie;
54993 /* Size of the response buffer in 16-byte units. */
54994 uint8_t resp_size;
54995 uint8_t reserved8;
54996 /* Host address of the response. */
54997 uint64_t resp_addr;
54998 /* GID index */
54999 uint16_t gid_index;
55000 /* unused16 is 16 b */
55001 uint8_t unused16[6];
55002 } cmdq_query_gid_t, *pcmdq_query_gid_t;
55003
55004 /* creq_query_gid_resp (size:128b/16B) */
55005
55006 typedef struct creq_query_gid_resp {
55007 uint8_t type;
55008 /*
55009 * This field indicates the exact type of the completion.
55010 * By convention, the LSB identifies the length of the
55011 * record in 16B units. Even values indicate 16B
55012 * records. Odd values indicate 32B
55013 * records.
55014 */
55015 #define CREQ_QUERY_GID_RESP_TYPE_MASK UINT32_C(0x3f)
55016 #define CREQ_QUERY_GID_RESP_TYPE_SFT 0
55017 /* QP Async Notification */
55018 #define CREQ_QUERY_GID_RESP_TYPE_QP_EVENT UINT32_C(0x38)
55019 #define CREQ_QUERY_GID_RESP_TYPE_LAST CREQ_QUERY_GID_RESP_TYPE_QP_EVENT
55020 /* Status of the response. */
55021 uint8_t status;
55022 /* Driver supplied handle to associate the command and the response. */
55023 uint16_t cookie;
55024 /* Side buffer size in 16-byte units */
55025 uint32_t size;
55026 uint8_t v;
55027 /*
55028 * This value is written by the NIC such that it will be different
55029 * for each pass through the completion queue. The even passes
55030 * will write 1. The odd passes will write 0.
55031 */
55032 #define CREQ_QUERY_GID_RESP_V UINT32_C(0x1)
55033 /* Event or command opcode. */
55034 uint8_t event;
55035 /* Query GID command response. */
55036 #define CREQ_QUERY_GID_RESP_EVENT_QUERY_GID UINT32_C(0x18)
55037 #define CREQ_QUERY_GID_RESP_EVENT_LAST CREQ_QUERY_GID_RESP_EVENT_QUERY_GID
55038 uint8_t reserved48[6];
55039 } creq_query_gid_resp_t, *pcreq_query_gid_resp_t;
55040
55041 /* Query GID command response side buffer structure */
55042 /* creq_query_gid_resp_sb (size:320b/40B) */
55043
55044 typedef struct creq_query_gid_resp_sb {
55045 /* Command opcode. */
55046 uint8_t opcode;
55047 /* Query GID command response. */
55048 #define CREQ_QUERY_GID_RESP_SB_OPCODE_QUERY_GID UINT32_C(0x18)
55049 #define CREQ_QUERY_GID_RESP_SB_OPCODE_LAST CREQ_QUERY_GID_RESP_SB_OPCODE_QUERY_GID
55050 /* Status of the response. */
55051 uint8_t status;
55052 /* Driver supplied handle to associate the command and the response. */
55053 uint16_t cookie;
55054 /* Flags and attribs of the command. */
55055 uint16_t flags;
55056 /* Size of the response buffer in 16-byte units. */
55057 uint8_t resp_size;
55058 uint8_t reserved8;
55059 /* GID */
55060 uint32_t gid[4];
55061 /* Source MAC. */
55062 uint16_t src_mac[3];
55063 /* flags. */
55064 uint16_t vlan;
55065 #define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_EN_TPID_VLAN_ID_MASK UINT32_C(0xffff)
55066 #define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_EN_TPID_VLAN_ID_SFT 0
55067 /* Source VLAN id. */
55068 #define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_ID_MASK UINT32_C(0xfff)
55069 #define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_ID_SFT 0
55070 /* This set of bits select the TPID of the VLAN Tag. */
55071 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_MASK UINT32_C(0x7000)
55072 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_SFT 12
55073 /* TPID = 0x88A8. */
55074 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_88A8 (UINT32_C(0x0) << 12)
55075 /* TPID = 0x8100. */
55076 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_8100 (UINT32_C(0x1) << 12)
55077 /* TPID = 0x9100. */
55078 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_9100 (UINT32_C(0x2) << 12)
55079 /* TPID = 0x9200. */
55080 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_9200 (UINT32_C(0x3) << 12)
55081 /* TPID = 0x9300. */
55082 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_9300 (UINT32_C(0x4) << 12)
55083 /* TPID = Configurable 1. */
55084 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG1 (UINT32_C(0x5) << 12)
55085 /* TPID = Configurable 2. */
55086 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG2 (UINT32_C(0x6) << 12)
55087 /* TPID = Configurable 3. */
55088 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG3 (UINT32_C(0x7) << 12)
55089 #define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_LAST CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG3
55090 /* Setting this bit to 1 enables insertion of a VLAN Tag to a RoCE header. */
55091 #define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_EN UINT32_C(0x8000)
55092 /* Identifier field in the IP header. */
55093 uint16_t ipid;
55094 /* GID index */
55095 uint16_t gid_index;
55096 uint32_t unused_0;
55097 } creq_query_gid_resp_sb_t, *pcreq_query_gid_resp_sb_t;
55098
55099 /**************
55100 * create_qp1 *
55101 **************/
55102
55103
55104 /* cmdq_create_qp1 (size:640b/80B) */
55105
55106 typedef struct cmdq_create_qp1 {
55107 /* Command opcode. */
55108 uint8_t opcode;
55109 /* Create QP1 command allocates a QP1 only. */
55110 #define CMDQ_CREATE_QP1_OPCODE_CREATE_QP1 UINT32_C(0x13)
55111 #define CMDQ_CREATE_QP1_OPCODE_LAST CMDQ_CREATE_QP1_OPCODE_CREATE_QP1
55112 /* Size of the command in 16-byte units. */
55113 uint8_t cmd_size;
55114 /* Flags and attribs of the command. */
55115 uint16_t flags;
55116 /* Driver supplied handle to associate the command and the response. */
55117 uint16_t cookie;
55118 /* Size of the response buffer in 16-byte units. */
55119 uint8_t resp_size;
55120 uint8_t reserved8;
55121 /* Host address of the response. */
55122 uint64_t resp_addr;
55123 /* QP1 handle. */
55124 uint64_t qp_handle;
55125 /* Create QP1 flags. */
55126 uint32_t qp_flags;
55127 /* SRQ is used. */
55128 #define CMDQ_CREATE_QP1_QP_FLAGS_SRQ_USED UINT32_C(0x1)
55129 /* post CQE for all SQ WQEs. */
55130 #define CMDQ_CREATE_QP1_QP_FLAGS_FORCE_COMPLETION UINT32_C(0x2)
55131 /* This QP can use reserved L_Key */
55132 #define CMDQ_CREATE_QP1_QP_FLAGS_RESERVED_LKEY_ENABLE UINT32_C(0x4)
55133 #define CMDQ_CREATE_QP1_QP_FLAGS_LAST CMDQ_CREATE_QP1_QP_FLAGS_RESERVED_LKEY_ENABLE
55134 /* Supported QP1 types. */
55135 uint8_t type;
55136 /* General Services Interface on QP 1. */
55137 #define CMDQ_CREATE_QP1_TYPE_GSI UINT32_C(0x1)
55138 #define CMDQ_CREATE_QP1_TYPE_LAST CMDQ_CREATE_QP1_TYPE_GSI
55139 uint8_t sq_pg_size_sq_lvl;
55140 /* SQ PBL indirect levels. */
55141 #define CMDQ_CREATE_QP1_SQ_LVL_MASK UINT32_C(0xf)
55142 #define CMDQ_CREATE_QP1_SQ_LVL_SFT 0
55143 /* PBL pointer is physical start address. */
55144 #define CMDQ_CREATE_QP1_SQ_LVL_LVL_0 UINT32_C(0x0)
55145 /* PBL pointer points to PTE table. */
55146 #define CMDQ_CREATE_QP1_SQ_LVL_LVL_1 UINT32_C(0x1)
55147 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
55148 #define CMDQ_CREATE_QP1_SQ_LVL_LVL_2 UINT32_C(0x2)
55149 #define CMDQ_CREATE_QP1_SQ_LVL_LAST CMDQ_CREATE_QP1_SQ_LVL_LVL_2
55150 /* SQ page size. */
55151 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_MASK UINT32_C(0xf0)
55152 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_SFT 4
55153 /* 4KB. */
55154 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
55155 /* 8KB. */
55156 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
55157 /* 64KB. */
55158 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
55159 /* 2MB. */
55160 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
55161 /* 8MB. */
55162 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
55163 /* 1GB. */
55164 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
55165 #define CMDQ_CREATE_QP1_SQ_PG_SIZE_LAST CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_1G
55166 uint8_t rq_pg_size_rq_lvl;
55167 /* RQ PBL indirect levels. */
55168 #define CMDQ_CREATE_QP1_RQ_LVL_MASK UINT32_C(0xf)
55169 #define CMDQ_CREATE_QP1_RQ_LVL_SFT 0
55170 /* PBL pointer is physical start address. */
55171 #define CMDQ_CREATE_QP1_RQ_LVL_LVL_0 UINT32_C(0x0)
55172 /* PBL pointer points to PTE table. */
55173 #define CMDQ_CREATE_QP1_RQ_LVL_LVL_1 UINT32_C(0x1)
55174 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
55175 #define CMDQ_CREATE_QP1_RQ_LVL_LVL_2 UINT32_C(0x2)
55176 #define CMDQ_CREATE_QP1_RQ_LVL_LAST CMDQ_CREATE_QP1_RQ_LVL_LVL_2
55177 /* RQ page size. */
55178 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_MASK UINT32_C(0xf0)
55179 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_SFT 4
55180 /* 4KB. */
55181 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_4K (UINT32_C(0x0) << 4)
55182 /* 8KB. */
55183 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_8K (UINT32_C(0x1) << 4)
55184 /* 64KB. */
55185 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_64K (UINT32_C(0x2) << 4)
55186 /* 2MB. */
55187 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_2M (UINT32_C(0x3) << 4)
55188 /* 8MB. */
55189 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_8M (UINT32_C(0x4) << 4)
55190 /* 1GB. */
55191 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_1G (UINT32_C(0x5) << 4)
55192 #define CMDQ_CREATE_QP1_RQ_PG_SIZE_LAST CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_1G
55193 uint8_t unused_0;
55194 /* Doorbell page index. */
55195 uint32_t dpi;
55196 /* Max number of SQ wqes. */
55197 uint32_t sq_size;
55198 /* Max number of RQ wqes. */
55199 uint32_t rq_size;
55200 uint16_t sq_fwo_sq_sge;
55201 /* Max send SGEs per SWQE. */
55202 #define CMDQ_CREATE_QP1_SQ_SGE_MASK UINT32_C(0xf)
55203 #define CMDQ_CREATE_QP1_SQ_SGE_SFT 0
55204 /* Offset of First WQE in the first SQ page, in 128 byte units */
55205 #define CMDQ_CREATE_QP1_SQ_FWO_MASK UINT32_C(0xfff0)
55206 #define CMDQ_CREATE_QP1_SQ_FWO_SFT 4
55207 uint16_t rq_fwo_rq_sge;
55208 /* Max recv SGEs per RWQE (NOT SUPPORTED BY HARDWARE). */
55209 #define CMDQ_CREATE_QP1_RQ_SGE_MASK UINT32_C(0xf)
55210 #define CMDQ_CREATE_QP1_RQ_SGE_SFT 0
55211 /* Offset of First WQE in the first RQ page, in 128 byte units */
55212 #define CMDQ_CREATE_QP1_RQ_FWO_MASK UINT32_C(0xfff0)
55213 #define CMDQ_CREATE_QP1_RQ_FWO_SFT 4
55214 /* Send CQ context id. */
55215 uint32_t scq_cid;
55216 /* Receive CQ context id. */
55217 uint32_t rcq_cid;
55218 /* SRQ CQ context id. */
55219 uint32_t srq_cid;
55220 /* Protection domain id. */
55221 uint32_t pd_id;
55222 /* SQ PBL physical address. */
55223 uint64_t sq_pbl;
55224 /* RQ PBL physical address. */
55225 uint64_t rq_pbl;
55226 } cmdq_create_qp1_t, *pcmdq_create_qp1_t;
55227
55228 /* creq_create_qp1_resp (size:128b/16B) */
55229
55230 typedef struct creq_create_qp1_resp {
55231 uint8_t type;
55232 /*
55233 * This field indicates the exact type of the completion.
55234 * By convention, the LSB identifies the length of the
55235 * record in 16B units. Even values indicate 16B
55236 * records. Odd values indicate 32B
55237 * records.
55238 */
55239 #define CREQ_CREATE_QP1_RESP_TYPE_MASK UINT32_C(0x3f)
55240 #define CREQ_CREATE_QP1_RESP_TYPE_SFT 0
55241 /* QP Async Notification */
55242 #define CREQ_CREATE_QP1_RESP_TYPE_QP_EVENT UINT32_C(0x38)
55243 #define CREQ_CREATE_QP1_RESP_TYPE_LAST CREQ_CREATE_QP1_RESP_TYPE_QP_EVENT
55244 /* Status of the response. */
55245 uint8_t status;
55246 /* Driver supplied handle to associate the command and the response. */
55247 uint16_t cookie;
55248 /* QP1 context id */
55249 uint32_t xid;
55250 uint8_t v;
55251 /*
55252 * This value is written by the NIC such that it will be different
55253 * for each pass through the completion queue. The even passes
55254 * will write 1. The odd passes will write 0.
55255 */
55256 #define CREQ_CREATE_QP1_RESP_V UINT32_C(0x1)
55257 /* Event or command opcode. */
55258 uint8_t event;
55259 /* Create QP1 command response. */
55260 #define CREQ_CREATE_QP1_RESP_EVENT_CREATE_QP1 UINT32_C(0x13)
55261 #define CREQ_CREATE_QP1_RESP_EVENT_LAST CREQ_CREATE_QP1_RESP_EVENT_CREATE_QP1
55262 uint8_t reserved48[6];
55263 } creq_create_qp1_resp_t, *pcreq_create_qp1_resp_t;
55264
55265 /***************
55266 * destroy_qp1 *
55267 ***************/
55268
55269
55270 /* cmdq_destroy_qp1 (size:192b/24B) */
55271
55272 typedef struct cmdq_destroy_qp1 {
55273 /* Command opcode. */
55274 uint8_t opcode;
55275 /* Destroy QP1 command deletes and flushes the specified QP1. */
55276 #define CMDQ_DESTROY_QP1_OPCODE_DESTROY_QP1 UINT32_C(0x14)
55277 #define CMDQ_DESTROY_QP1_OPCODE_LAST CMDQ_DESTROY_QP1_OPCODE_DESTROY_QP1
55278 /* Size of the command in 16-byte units. */
55279 uint8_t cmd_size;
55280 /* Flags and attribs of the command. */
55281 uint16_t flags;
55282 /* Driver supplied handle to associate the command and the response. */
55283 uint16_t cookie;
55284 /* Size of the response buffer in 16-byte units. */
55285 uint8_t resp_size;
55286 uint8_t reserved8;
55287 /* Host address of the response. */
55288 uint64_t resp_addr;
55289 /* QP1 context id */
55290 uint32_t qp1_cid;
55291 uint32_t unused_0;
55292 } cmdq_destroy_qp1_t, *pcmdq_destroy_qp1_t;
55293
55294 /* creq_destroy_qp1_resp (size:128b/16B) */
55295
55296 typedef struct creq_destroy_qp1_resp {
55297 uint8_t type;
55298 /*
55299 * This field indicates the exact type of the completion.
55300 * By convention, the LSB identifies the length of the
55301 * record in 16B units. Even values indicate 16B
55302 * records. Odd values indicate 32B
55303 * records.
55304 */
55305 #define CREQ_DESTROY_QP1_RESP_TYPE_MASK UINT32_C(0x3f)
55306 #define CREQ_DESTROY_QP1_RESP_TYPE_SFT 0
55307 /* QP Async Notification */
55308 #define CREQ_DESTROY_QP1_RESP_TYPE_QP_EVENT UINT32_C(0x38)
55309 #define CREQ_DESTROY_QP1_RESP_TYPE_LAST CREQ_DESTROY_QP1_RESP_TYPE_QP_EVENT
55310 /* Status of the response. */
55311 uint8_t status;
55312 /* Driver supplied handle to associate the command and the response. */
55313 uint16_t cookie;
55314 /* QP1 context id */
55315 uint32_t xid;
55316 uint8_t v;
55317 /*
55318 * This value is written by the NIC such that it will be different
55319 * for each pass through the completion queue. The even passes
55320 * will write 1. The odd passes will write 0.
55321 */
55322 #define CREQ_DESTROY_QP1_RESP_V UINT32_C(0x1)
55323 /* Event or command opcode. */
55324 uint8_t event;
55325 /* Destroy QP1 command response. */
55326 #define CREQ_DESTROY_QP1_RESP_EVENT_DESTROY_QP1 UINT32_C(0x14)
55327 #define CREQ_DESTROY_QP1_RESP_EVENT_LAST CREQ_DESTROY_QP1_RESP_EVENT_DESTROY_QP1
55328 uint8_t reserved48[6];
55329 } creq_destroy_qp1_resp_t, *pcreq_destroy_qp1_resp_t;
55330
55331 /*************
55332 * create_ah *
55333 *************/
55334
55335
55336 /* cmdq_create_ah (size:512b/64B) */
55337
55338 typedef struct cmdq_create_ah {
55339 /* Command opcode. */
55340 uint8_t opcode;
55341 /* Create AH command allocates an AH with the specified parameters. */
55342 #define CMDQ_CREATE_AH_OPCODE_CREATE_AH UINT32_C(0x15)
55343 #define CMDQ_CREATE_AH_OPCODE_LAST CMDQ_CREATE_AH_OPCODE_CREATE_AH
55344 /* Size of the command in 16-byte units. */
55345 uint8_t cmd_size;
55346 /* Flags and attribs of the command. */
55347 uint16_t flags;
55348 /* Driver supplied handle to associate the command and the response. */
55349 uint16_t cookie;
55350 /* Size of the response buffer in 16-byte units. */
55351 uint8_t resp_size;
55352 uint8_t reserved8;
55353 /* Host address of the response. */
55354 uint64_t resp_addr;
55355 /* AH handle. */
55356 uint64_t ah_handle;
55357 /* Destination GID, specified in BE format. */
55358 uint32_t dgid[4];
55359 /* V1, V2IPv4 or V2IPv6. */
55360 uint8_t type;
55361 /* V2IPv4. */
55362 #define CMDQ_CREATE_AH_TYPE_V1 UINT32_C(0x0)
55363 /* V2IPv4. */
55364 #define CMDQ_CREATE_AH_TYPE_V2IPV4 UINT32_C(0x2)
55365 /* V2IPv6. */
55366 #define CMDQ_CREATE_AH_TYPE_V2IPV6 UINT32_C(0x3)
55367 #define CMDQ_CREATE_AH_TYPE_LAST CMDQ_CREATE_AH_TYPE_V2IPV6
55368 /* IPv6 Hop limit. */
55369 uint8_t hop_limit;
55370 /* SGID index. */
55371 uint16_t sgid_index;
55372 uint32_t dest_vlan_id_flow_label;
55373 /* Flow label. */
55374 #define CMDQ_CREATE_AH_FLOW_LABEL_MASK UINT32_C(0xfffff)
55375 #define CMDQ_CREATE_AH_FLOW_LABEL_SFT 0
55376 /* Destination VLAN ID. */
55377 #define CMDQ_CREATE_AH_DEST_VLAN_ID_MASK UINT32_C(0xfff00000)
55378 #define CMDQ_CREATE_AH_DEST_VLAN_ID_SFT 20
55379 /* Protection domain id. */
55380 uint32_t pd_id;
55381 uint32_t unused_0;
55382 /* Destination MAC address. */
55383 uint16_t dest_mac[3];
55384 /* Traffic class. */
55385 uint8_t traffic_class;
55386 uint8_t enable_cc;
55387 /* Enable congestion control. */
55388 #define CMDQ_CREATE_AH_ENABLE_CC UINT32_C(0x1)
55389 } cmdq_create_ah_t, *pcmdq_create_ah_t;
55390
55391 /* creq_create_ah_resp (size:128b/16B) */
55392
55393 typedef struct creq_create_ah_resp {
55394 uint8_t type;
55395 /*
55396 * This field indicates the exact type of the completion.
55397 * By convention, the LSB identifies the length of the
55398 * record in 16B units. Even values indicate 16B
55399 * records. Odd values indicate 32B
55400 * records.
55401 */
55402 #define CREQ_CREATE_AH_RESP_TYPE_MASK UINT32_C(0x3f)
55403 #define CREQ_CREATE_AH_RESP_TYPE_SFT 0
55404 /* QP Async Notification */
55405 #define CREQ_CREATE_AH_RESP_TYPE_QP_EVENT UINT32_C(0x38)
55406 #define CREQ_CREATE_AH_RESP_TYPE_LAST CREQ_CREATE_AH_RESP_TYPE_QP_EVENT
55407 /* Status of the response. */
55408 uint8_t status;
55409 /* Driver supplied handle to associate the command and the response. */
55410 uint16_t cookie;
55411 /* AH context id */
55412 uint32_t xid;
55413 uint8_t v;
55414 /*
55415 * This value is written by the NIC such that it will be different
55416 * for each pass through the completion queue. The even passes
55417 * will write 1. The odd passes will write 0.
55418 */
55419 #define CREQ_CREATE_AH_RESP_V UINT32_C(0x1)
55420 /* Event or command opcode. */
55421 uint8_t event;
55422 /* Create AH command response. */
55423 #define CREQ_CREATE_AH_RESP_EVENT_CREATE_AH UINT32_C(0x15)
55424 #define CREQ_CREATE_AH_RESP_EVENT_LAST CREQ_CREATE_AH_RESP_EVENT_CREATE_AH
55425 uint8_t reserved48[6];
55426 } creq_create_ah_resp_t, *pcreq_create_ah_resp_t;
55427
55428 /**************
55429 * destroy_ah *
55430 **************/
55431
55432
55433 /* cmdq_destroy_ah (size:192b/24B) */
55434
55435 typedef struct cmdq_destroy_ah {
55436 /* Command opcode. */
55437 uint8_t opcode;
55438 /* Destroy AH command deletes the specified AH. */
55439 #define CMDQ_DESTROY_AH_OPCODE_DESTROY_AH UINT32_C(0x16)
55440 #define CMDQ_DESTROY_AH_OPCODE_LAST CMDQ_DESTROY_AH_OPCODE_DESTROY_AH
55441 /* Size of the command in 16-byte units. */
55442 uint8_t cmd_size;
55443 /* Flags and attribs of the command. */
55444 uint16_t flags;
55445 /* Driver supplied handle to associate the command and the response. */
55446 uint16_t cookie;
55447 /* Size of the response buffer in 16-byte units. */
55448 uint8_t resp_size;
55449 uint8_t reserved8;
55450 /* Host address of the response. */
55451 uint64_t resp_addr;
55452 /* AH context id */
55453 uint32_t ah_cid;
55454 uint32_t unused_0;
55455 } cmdq_destroy_ah_t, *pcmdq_destroy_ah_t;
55456
55457 /* creq_destroy_ah_resp (size:128b/16B) */
55458
55459 typedef struct creq_destroy_ah_resp {
55460 uint8_t type;
55461 /*
55462 * This field indicates the exact type of the completion.
55463 * By convention, the LSB identifies the length of the
55464 * record in 16B units. Even values indicate 16B
55465 * records. Odd values indicate 32B
55466 * records.
55467 */
55468 #define CREQ_DESTROY_AH_RESP_TYPE_MASK UINT32_C(0x3f)
55469 #define CREQ_DESTROY_AH_RESP_TYPE_SFT 0
55470 /* QP Async Notification */
55471 #define CREQ_DESTROY_AH_RESP_TYPE_QP_EVENT UINT32_C(0x38)
55472 #define CREQ_DESTROY_AH_RESP_TYPE_LAST CREQ_DESTROY_AH_RESP_TYPE_QP_EVENT
55473 /* Status of the response. */
55474 uint8_t status;
55475 /* Driver supplied handle to associate the command and the response. */
55476 uint16_t cookie;
55477 /* AH context id */
55478 uint32_t xid;
55479 uint8_t v;
55480 /*
55481 * This value is written by the NIC such that it will be different
55482 * for each pass through the completion queue. The even passes
55483 * will write 1. The odd passes will write 0.
55484 */
55485 #define CREQ_DESTROY_AH_RESP_V UINT32_C(0x1)
55486 /* Event or command opcode. */
55487 uint8_t event;
55488 /* Destroy AH command response. */
55489 #define CREQ_DESTROY_AH_RESP_EVENT_DESTROY_AH UINT32_C(0x16)
55490 #define CREQ_DESTROY_AH_RESP_EVENT_LAST CREQ_DESTROY_AH_RESP_EVENT_DESTROY_AH
55491 uint8_t reserved48[6];
55492 } creq_destroy_ah_resp_t, *pcreq_destroy_ah_resp_t;
55493
55494 /********************
55495 * query_roce_stats *
55496 ********************/
55497
55498
55499 /* cmdq_query_roce_stats (size:192b/24B) */
55500
55501 typedef struct cmdq_query_roce_stats {
55502 /* Command opcode. */
55503 uint8_t opcode;
55504 /* Query RoCE statistics. */
55505 #define CMDQ_QUERY_ROCE_STATS_OPCODE_QUERY_ROCE_STATS UINT32_C(0x8e)
55506 #define CMDQ_QUERY_ROCE_STATS_OPCODE_LAST CMDQ_QUERY_ROCE_STATS_OPCODE_QUERY_ROCE_STATS
55507 /* Size of the command in 16-byte units. */
55508 uint8_t cmd_size;
55509 /* Flags and attribs of the command. */
55510 uint16_t flags;
55511 /*
55512 * When this bit is set FW will use the collection_id to extract RoCE statistics.
55513 * If function_id is also specified the FW will return stats corresponding to the
55514 * collection for the function_id specified.
55515 */
55516 #define CMDQ_QUERY_ROCE_STATS_FLAGS_COLLECTION_ID UINT32_C(0x1)
55517 /*
55518 * When this bit is set FW will use the function_id to extract RoCE statistics.
55519 * When collection is specified then FW will return the specific collection
55520 * stats and if the collection is not specified then FW will return the default
55521 * stats which will be for all QPs.
55522 */
55523 #define CMDQ_QUERY_ROCE_STATS_FLAGS_FUNCTION_ID UINT32_C(0x2)
55524 /* Driver supplied handle to associate the command and the response. */
55525 uint16_t cookie;
55526 /* Size of the response buffer in 16-byte units. */
55527 uint8_t resp_size;
55528 /* The specific statistics group being queried. */
55529 uint8_t collection_id;
55530 /* Host address of the response. */
55531 uint64_t resp_addr;
55532 /* Unique identifier for a function */
55533 uint32_t function_id;
55534 /* PF number */
55535 #define CMDQ_QUERY_ROCE_STATS_PF_NUM_MASK UINT32_C(0xff)
55536 #define CMDQ_QUERY_ROCE_STATS_PF_NUM_SFT 0
55537 /* VF number */
55538 #define CMDQ_QUERY_ROCE_STATS_VF_NUM_MASK UINT32_C(0xffff00)
55539 #define CMDQ_QUERY_ROCE_STATS_VF_NUM_SFT 8
55540 /* When set the vf_num is valid. */
55541 #define CMDQ_QUERY_ROCE_STATS_VF_VALID UINT32_C(0x1000000)
55542 uint32_t reserved32;
55543 } cmdq_query_roce_stats_t, *pcmdq_query_roce_stats_t;
55544
55545 /* creq_query_roce_stats_resp (size:128b/16B) */
55546
55547 typedef struct creq_query_roce_stats_resp {
55548 uint8_t type;
55549 /*
55550 * This field indicates the exact type of the completion.
55551 * By convention, the LSB identifies the length of the
55552 * record in 16B units. Even values indicate 16B
55553 * records. Odd values indicate 32B
55554 * records.
55555 */
55556 #define CREQ_QUERY_ROCE_STATS_RESP_TYPE_MASK UINT32_C(0x3f)
55557 #define CREQ_QUERY_ROCE_STATS_RESP_TYPE_SFT 0
55558 /* QP Async Notification */
55559 #define CREQ_QUERY_ROCE_STATS_RESP_TYPE_QP_EVENT UINT32_C(0x38)
55560 #define CREQ_QUERY_ROCE_STATS_RESP_TYPE_LAST CREQ_QUERY_ROCE_STATS_RESP_TYPE_QP_EVENT
55561 /* Status of the response. */
55562 uint8_t status;
55563 /* Driver supplied handle to associate the command and the response. */
55564 uint16_t cookie;
55565 /* Side buffer size in 16-byte units */
55566 uint32_t size;
55567 uint8_t v;
55568 /*
55569 * This value is written by the NIC such that it will be different
55570 * for each pass through the completion queue. The even passes
55571 * will write 1. The odd passes will write 0.
55572 */
55573 #define CREQ_QUERY_ROCE_STATS_RESP_V UINT32_C(0x1)
55574 /* Event or command opcode. */
55575 uint8_t event;
55576 /* Query RoCE statistics. */
55577 #define CREQ_QUERY_ROCE_STATS_RESP_EVENT_QUERY_ROCE_STATS UINT32_C(0x8e)
55578 #define CREQ_QUERY_ROCE_STATS_RESP_EVENT_LAST CREQ_QUERY_ROCE_STATS_RESP_EVENT_QUERY_ROCE_STATS
55579 uint8_t reserved48[6];
55580 } creq_query_roce_stats_resp_t, *pcreq_query_roce_stats_resp_t;
55581
55582 /* Query RoCE Stats command response side buffer structure. */
55583 /* creq_query_roce_stats_resp_sb (size:2944b/368B) */
55584
55585 typedef struct creq_query_roce_stats_resp_sb {
55586 /* Command opcode. */
55587 uint8_t opcode;
55588 /* Query RoCE statistics. */
55589 #define CREQ_QUERY_ROCE_STATS_RESP_SB_OPCODE_QUERY_ROCE_STATS UINT32_C(0x8e)
55590 #define CREQ_QUERY_ROCE_STATS_RESP_SB_OPCODE_LAST CREQ_QUERY_ROCE_STATS_RESP_SB_OPCODE_QUERY_ROCE_STATS
55591 /* Status of the response. */
55592 uint8_t status;
55593 /* Driver supplied handle to associate the command and the response. */
55594 uint16_t cookie;
55595 /* Flags and attribs of the command. */
55596 uint16_t flags;
55597 /* Size of the response buffer in 16-byte units. */
55598 uint8_t resp_size;
55599 uint8_t rsvd;
55600 uint32_t num_counters;
55601 uint32_t rsvd1;
55602 uint64_t to_retransmits;
55603 /* seq_err_naks_rcvd is 64 b */
55604 uint64_t seq_err_naks_rcvd;
55605 /* max_retry_exceeded is 64 b */
55606 uint64_t max_retry_exceeded;
55607 /* rnr_naks_rcvd is 64 b */
55608 uint64_t rnr_naks_rcvd;
55609 uint64_t missing_resp;
55610 /* unrecoverable_err is 64 b */
55611 uint64_t unrecoverable_err;
55612 /* bad_resp_err is 64 b */
55613 uint64_t bad_resp_err;
55614 /* local_qp_op_err is 64 b */
55615 uint64_t local_qp_op_err;
55616 /* local_protection_err is 64 b */
55617 uint64_t local_protection_err;
55618 /* mem_mgmt_op_err is 64 b */
55619 uint64_t mem_mgmt_op_err;
55620 /* remote_invalid_req_err is 64 b */
55621 uint64_t remote_invalid_req_err;
55622 /* remote_access_err is 64 b */
55623 uint64_t remote_access_err;
55624 /* remote_op_err is 64 b */
55625 uint64_t remote_op_err;
55626 /* dup_req is 64 b */
55627 uint64_t dup_req;
55628 /* res_exceed_max is 64 b */
55629 uint64_t res_exceed_max;
55630 /* res_length_mismatch is 64 b */
55631 uint64_t res_length_mismatch;
55632 /* res_exceeds_wqe is 64 b */
55633 uint64_t res_exceeds_wqe;
55634 /* res_opcode_err is 64 b */
55635 uint64_t res_opcode_err;
55636 /* res_rx_invalid_rkey is 64 b */
55637 uint64_t res_rx_invalid_rkey;
55638 /* res_rx_domain_err is 64 b */
55639 uint64_t res_rx_domain_err;
55640 /* res_rx_no_perm is 64 b */
55641 uint64_t res_rx_no_perm;
55642 /* res_rx_range_err is 64 b */
55643 uint64_t res_rx_range_err;
55644 /* res_tx_invalid_rkey is 64 b */
55645 uint64_t res_tx_invalid_rkey;
55646 /* res_tx_domain_err is 64 b */
55647 uint64_t res_tx_domain_err;
55648 /* res_tx_no_perm is 64 b */
55649 uint64_t res_tx_no_perm;
55650 /* res_tx_range_err is 64 b */
55651 uint64_t res_tx_range_err;
55652 /* res_irrq_oflow is 64 b */
55653 uint64_t res_irrq_oflow;
55654 /* res_unsup_opcode is 64 b */
55655 uint64_t res_unsup_opcode;
55656 /* res_unaligned_atomic is 64 b */
55657 uint64_t res_unaligned_atomic;
55658 /* res_rem_inv_err is 64 b */
55659 uint64_t res_rem_inv_err;
55660 /* res_mem_error is 64 b */
55661 uint64_t res_mem_error;
55662 /* res_srq_err is 64 b */
55663 uint64_t res_srq_err;
55664 /* res_cmp_err is 64 b */
55665 uint64_t res_cmp_err;
55666 /* res_invalid_dup_rkey is 64 b */
55667 uint64_t res_invalid_dup_rkey;
55668 /* res_wqe_format_err is 64 b */
55669 uint64_t res_wqe_format_err;
55670 /* res_cq_load_err is 64 b */
55671 uint64_t res_cq_load_err;
55672 /* res_srq_load_err is 64 b */
55673 uint64_t res_srq_load_err;
55674 /* res_tx_pci_err is 64 b */
55675 uint64_t res_tx_pci_err;
55676 /* res_rx_pci_err is 64 b */
55677 uint64_t res_rx_pci_err;
55678 /* res_oos_drop_count is 64 b */
55679 uint64_t res_oos_drop_count;
55680 /* active_qp_count_p0 is 64 b */
55681 uint64_t active_qp_count_p0;
55682 /* active_qp_count_p1 is 64 b */
55683 uint64_t active_qp_count_p1;
55684 /* active_qp_count_p2 is 64 b */
55685 uint64_t active_qp_count_p2;
55686 /* active_qp_count_p3 is 64 b */
55687 uint64_t active_qp_count_p3;
55688 } creq_query_roce_stats_resp_sb_t, *pcreq_query_roce_stats_resp_sb_t;
55689
55690 /************************
55691 * query_roce_stats_ext *
55692 ************************/
55693
55694
55695 /* cmdq_query_roce_stats_ext (size:192b/24B) */
55696
55697 typedef struct cmdq_query_roce_stats_ext {
55698 /* Command opcode. */
55699 uint8_t opcode;
55700 /* Query extended RoCE statistics. */
55701 #define CMDQ_QUERY_ROCE_STATS_EXT_OPCODE_QUERY_ROCE_STATS UINT32_C(0x92)
55702 #define CMDQ_QUERY_ROCE_STATS_EXT_OPCODE_LAST CMDQ_QUERY_ROCE_STATS_EXT_OPCODE_QUERY_ROCE_STATS
55703 /* Size of the command in 16-byte units. */
55704 uint8_t cmd_size;
55705 /* Flags and attribs of the command. */
55706 uint16_t flags;
55707 /*
55708 * When this bit is set FW will use the collection_id to extract RoCE statistics.
55709 * If function_id is also specified the FW will return stats corresponding to the
55710 * collection for the function_id specified.
55711 */
55712 #define CMDQ_QUERY_ROCE_STATS_EXT_FLAGS_COLLECTION_ID UINT32_C(0x1)
55713 /*
55714 * When this bit is set FW will use the function_id to extract RoCE statistics.
55715 * When collection is specified then FW will return the specific collection
55716 * stats and if the collection is not specified then FW will return the default
55717 * stats which will be for all QPs.
55718 */
55719 #define CMDQ_QUERY_ROCE_STATS_EXT_FLAGS_FUNCTION_ID UINT32_C(0x2)
55720 /* Driver supplied handle to associate the command and the response. */
55721 uint16_t cookie;
55722 /* Size of the response buffer in 16-byte units. */
55723 uint8_t resp_size;
55724 /* The specific statistics group being queried. */
55725 uint8_t collection_id;
55726 /* Host address of the response. */
55727 uint64_t resp_addr;
55728 /* Unique identifier for a function */
55729 uint32_t function_id;
55730 /* PF number */
55731 #define CMDQ_QUERY_ROCE_STATS_EXT_PF_NUM_MASK UINT32_C(0xff)
55732 #define CMDQ_QUERY_ROCE_STATS_EXT_PF_NUM_SFT 0
55733 /* VF number */
55734 #define CMDQ_QUERY_ROCE_STATS_EXT_VF_NUM_MASK UINT32_C(0xffff00)
55735 #define CMDQ_QUERY_ROCE_STATS_EXT_VF_NUM_SFT 8
55736 /* When set the vf_num is valid. */
55737 #define CMDQ_QUERY_ROCE_STATS_EXT_VF_VALID UINT32_C(0x1000000)
55738 uint32_t reserved32;
55739 } cmdq_query_roce_stats_ext_t, *pcmdq_query_roce_stats_ext_t;
55740
55741 /* creq_query_roce_stats_ext_resp (size:128b/16B) */
55742
55743 typedef struct creq_query_roce_stats_ext_resp {
55744 uint8_t type;
55745 /*
55746 * This field indicates the exact type of the completion.
55747 * By convention, the LSB identifies the length of the
55748 * record in 16B units. Even values indicate 16B
55749 * records. Odd values indicate 32B
55750 * records.
55751 */
55752 #define CREQ_QUERY_ROCE_STATS_EXT_RESP_TYPE_MASK UINT32_C(0x3f)
55753 #define CREQ_QUERY_ROCE_STATS_EXT_RESP_TYPE_SFT 0
55754 /* QP Async Notification */
55755 #define CREQ_QUERY_ROCE_STATS_EXT_RESP_TYPE_QP_EVENT UINT32_C(0x38)
55756 #define CREQ_QUERY_ROCE_STATS_EXT_RESP_TYPE_LAST CREQ_QUERY_ROCE_STATS_EXT_RESP_TYPE_QP_EVENT
55757 /* Status of the response. */
55758 uint8_t status;
55759 /* Driver supplied handle to associate the command and the response. */
55760 uint16_t cookie;
55761 /* Side buffer size in 16-byte units */
55762 uint32_t size;
55763 uint8_t v;
55764 /*
55765 * This value is written by the NIC such that it will be different
55766 * for each pass through the completion queue. The even passes
55767 * will write 1. The odd passes will write 0.
55768 */
55769 #define CREQ_QUERY_ROCE_STATS_EXT_RESP_V UINT32_C(0x1)
55770 /* Event or command opcode. */
55771 uint8_t event;
55772 /* Query extended RoCE statistics. */
55773 #define CREQ_QUERY_ROCE_STATS_EXT_RESP_EVENT_QUERY_ROCE_STATS_EXT UINT32_C(0x92)
55774 #define CREQ_QUERY_ROCE_STATS_EXT_RESP_EVENT_LAST CREQ_QUERY_ROCE_STATS_EXT_RESP_EVENT_QUERY_ROCE_STATS_EXT
55775 uint8_t reserved48[6];
55776 } creq_query_roce_stats_ext_resp_t, *pcreq_query_roce_stats_ext_resp_t;
55777
55778 /* Query extended RoCE Stats command response side buffer structure. */
55779 /* creq_query_roce_stats_ext_resp_sb (size:1536b/192B) */
55780
55781 typedef struct creq_query_roce_stats_ext_resp_sb {
55782 /* Command opcode. */
55783 uint8_t opcode;
55784 /* Query extended RoCE statistics. */
55785 #define CREQ_QUERY_ROCE_STATS_EXT_RESP_SB_OPCODE_QUERY_ROCE_STATS_EXT UINT32_C(0x92)
55786 #define CREQ_QUERY_ROCE_STATS_EXT_RESP_SB_OPCODE_LAST CREQ_QUERY_ROCE_STATS_EXT_RESP_SB_OPCODE_QUERY_ROCE_STATS_EXT
55787 /* Status of the response. */
55788 uint8_t status;
55789 /* Driver supplied handle to associate the command and the response. */
55790 uint16_t cookie;
55791 /* Flags and attribs of the command. */
55792 uint16_t flags;
55793 /* Size of the response buffer in 16-byte units. */
55794 uint8_t resp_size;
55795 uint8_t rsvd;
55796 /* Number of transmitted Atomic request packets. */
55797 uint64_t tx_atomic_req_pkts;
55798 /* Number of transmitted Read request packets. */
55799 uint64_t tx_read_req_pkts;
55800 /* Number of transmitted Read response packets. */
55801 uint64_t tx_read_res_pkts;
55802 /* Number of transmitted Write request packets. */
55803 uint64_t tx_write_req_pkts;
55804 /*
55805 * Number of transmitted Send request packets.
55806 * This is for RC QPs only.
55807 */
55808 uint64_t tx_send_req_pkts;
55809 /*
55810 * Number of transmitted RoCE packets.
55811 * This includes RC, UD, RawEth, and QP1 packets
55812 */
55813 uint64_t tx_roce_pkts;
55814 /*
55815 * Number of transmitted RoCE header and payload bytes.
55816 * This includes RC, UD, RawEth, and QP1 packets.
55817 */
55818 uint64_t tx_roce_bytes;
55819 /* Number of received Atomic request packets. */
55820 uint64_t rx_atomic_req_pkts;
55821 /* Number of received Read request packets. */
55822 uint64_t rx_read_req_pkts;
55823 /* Number of received Read response packets. */
55824 uint64_t rx_read_res_pkts;
55825 /* Number of received Write request packets. */
55826 uint64_t rx_write_req_pkts;
55827 /*
55828 * Number of received Send request packets.
55829 * This is for RC QPs only.
55830 */
55831 uint64_t rx_send_req_pkts;
55832 /*
55833 * Number of received RoCE packets including RoCE packets with errors.
55834 * This includes RC, UD, RawEth, and QP1 packets
55835 */
55836 uint64_t rx_roce_pkts;
55837 /*
55838 * Number of received RoCE header and payload bytes including RoCE
55839 * packets with errors.
55840 * This includes RC, UD, RawEth, and QP1 packets.
55841 */
55842 uint64_t rx_roce_bytes;
55843 /*
55844 * Number of received RoCE packets.
55845 * This includes RC, UD, RawEth, and QP1 packets
55846 */
55847 uint64_t rx_roce_good_pkts;
55848 /*
55849 * Number of received RoCE header and payload bytes.
55850 * This includes RC, UD, RawEth, and QP1 packets.
55851 */
55852 uint64_t rx_roce_good_bytes;
55853 /*
55854 * Number of drops that occurred to lack of buffers.
55855 * This is for RC QPs only.
55856 */
55857 uint64_t rx_out_of_buffer_pkts;
55858 /* Number of packets that were received out of sequence. */
55859 uint64_t rx_out_of_sequence_pkts;
55860 /* Number of transmitted CNP packets. */
55861 uint64_t tx_cnp_pkts;
55862 /* Number of received CNP packets. */
55863 uint64_t rx_cnp_pkts;
55864 /* Number of received ECN-marked RoCE packets. */
55865 uint64_t rx_ecn_marked_pkts;
55866 /* Number of transmitted CNP bytes. */
55867 uint64_t tx_cnp_bytes;
55868 /* Number of received CNP bytes. */
55869 uint64_t rx_cnp_bytes;
55870 } creq_query_roce_stats_ext_resp_sb_t, *pcreq_query_roce_stats_ext_resp_sb_t;
55871
55872 /**************
55873 * query_func *
55874 **************/
55875
55876
55877 /* cmdq_query_func (size:128b/16B) */
55878
55879 typedef struct cmdq_query_func {
55880 /* Command opcode. */
55881 uint8_t opcode;
55882 /* Query the HW capabilities for the function. */
55883 #define CMDQ_QUERY_FUNC_OPCODE_QUERY_FUNC UINT32_C(0x83)
55884 #define CMDQ_QUERY_FUNC_OPCODE_LAST CMDQ_QUERY_FUNC_OPCODE_QUERY_FUNC
55885 /* Size of the command in 16-byte units. */
55886 uint8_t cmd_size;
55887 /* Flags and attribs of the command. */
55888 uint16_t flags;
55889 /* Driver supplied handle to associate the command and the response. */
55890 uint16_t cookie;
55891 /* Size of the response buffer in 16-byte units. */
55892 uint8_t resp_size;
55893 uint8_t reserved8;
55894 /* Host address of the response. */
55895 uint64_t resp_addr;
55896 } cmdq_query_func_t, *pcmdq_query_func_t;
55897
55898 /* creq_query_func_resp (size:128b/16B) */
55899
55900 typedef struct creq_query_func_resp {
55901 uint8_t type;
55902 /*
55903 * This field indicates the exact type of the completion.
55904 * By convention, the LSB identifies the length of the
55905 * record in 16B units. Even values indicate 16B
55906 * records. Odd values indicate 32B
55907 * records.
55908 */
55909 #define CREQ_QUERY_FUNC_RESP_TYPE_MASK UINT32_C(0x3f)
55910 #define CREQ_QUERY_FUNC_RESP_TYPE_SFT 0
55911 /* QP Async Notification */
55912 #define CREQ_QUERY_FUNC_RESP_TYPE_QP_EVENT UINT32_C(0x38)
55913 #define CREQ_QUERY_FUNC_RESP_TYPE_LAST CREQ_QUERY_FUNC_RESP_TYPE_QP_EVENT
55914 /* Status of the response. */
55915 uint8_t status;
55916 /* Driver supplied handle to associate the command and the response. */
55917 uint16_t cookie;
55918 /* Side buffer size in 16-byte units */
55919 uint32_t size;
55920 uint8_t v;
55921 /*
55922 * This value is written by the NIC such that it will be different
55923 * for each pass through the completion queue. The even passes
55924 * will write 1. The odd passes will write 0.
55925 */
55926 #define CREQ_QUERY_FUNC_RESP_V UINT32_C(0x1)
55927 /* Event or command opcode. */
55928 uint8_t event;
55929 /* Query info PF command response. */
55930 #define CREQ_QUERY_FUNC_RESP_EVENT_QUERY_FUNC UINT32_C(0x83)
55931 #define CREQ_QUERY_FUNC_RESP_EVENT_LAST CREQ_QUERY_FUNC_RESP_EVENT_QUERY_FUNC
55932 uint8_t reserved48[6];
55933 } creq_query_func_resp_t, *pcreq_query_func_resp_t;
55934
55935 /* Query function command response side buffer structure. */
55936 /* creq_query_func_resp_sb (size:1088b/136B) */
55937
55938 typedef struct creq_query_func_resp_sb {
55939 /* Command opcode. */
55940 uint8_t opcode;
55941 /* Query info PF command response. */
55942 #define CREQ_QUERY_FUNC_RESP_SB_OPCODE_QUERY_FUNC UINT32_C(0x83)
55943 #define CREQ_QUERY_FUNC_RESP_SB_OPCODE_LAST CREQ_QUERY_FUNC_RESP_SB_OPCODE_QUERY_FUNC
55944 /* Status of the response. */
55945 uint8_t status;
55946 /* Driver supplied handle to associate the command and the response. */
55947 uint16_t cookie;
55948 /* Flags and attribs of the command. */
55949 uint16_t flags;
55950 /* Size of the response buffer in 16-byte units. */
55951 uint8_t resp_size;
55952 uint8_t reserved8;
55953 /* Max MR size supported. */
55954 uint64_t max_mr_size;
55955 /* Max QP supported. */
55956 uint32_t max_qp;
55957 /* Max WQEs per QP. */
55958 uint16_t max_qp_wr;
55959 /* Device capability flags. */
55960 uint16_t dev_cap_flags;
55961 /* Allow QP resizing. */
55962 #define CREQ_QUERY_FUNC_RESP_SB_RESIZE_QP UINT32_C(0x1)
55963 /* Specifies Congestion Control (CC) generation. */
55964 #define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_MASK UINT32_C(0xe)
55965 #define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_SFT 1
55966 /*
55967 * Includes support for DCTCP and TCP CC algorithms,
55968 * enabling operation in networks where PFC is enabled.
55969 */
55970 #define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_CC_GEN0 (UINT32_C(0x0) << 1)
55971 /*
55972 * Enhances cc_gen0 support with probabilistic marking algorithm,
55973 * enabling fast ramp up and convergence,
55974 * as well as operation in networks where PFC is not enabled.
55975 * Includes a number of parameters that are different from cc_gen0
55976 * chips as well as new parameters. TCP CC algorithm is not supported.
55977 */
55978 #define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_CC_GEN1 (UINT32_C(0x1) << 1)
55979 /*
55980 * Enhances cc_gen1 support for additional CC parameters:
55981 * reduce_init_en, reduce_init_cong_free_rtts_th, random_no_red_en,
55982 * actual_cr_shift_correction_en, quota_period_adjust_en
55983 */
55984 #define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_CC_GEN1_EXT (UINT32_C(0x2) << 1)
55985 #define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_LAST CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_CC_GEN1_EXT
55986 /*
55987 * Support for the extended RoCE statistics is available. These
55988 * statistics are queried via the `query_roce_stats_ext` command
55989 * and are enabled on a per-QP basis via `create_qp`.
55990 */
55991 #define CREQ_QUERY_FUNC_RESP_SB_EXT_STATS UINT32_C(0x10)
55992 /*
55993 * Support for both allocating and registering a new MR via the
55994 * `register_mr` command is available. With this feature the
55995 * `allocate_mrw` command does not have to be called before
55996 * registering.
55997 */
55998 #define CREQ_QUERY_FUNC_RESP_SB_MR_REGISTER_ALLOC UINT32_C(0x20)
55999 /*
56000 * Support for optimized transmit path to lower latency for WQEs
56001 * with inline data.
56002 */
56003 #define CREQ_QUERY_FUNC_RESP_SB_OPTIMIZED_TRANSMIT_ENABLED UINT32_C(0x40)
56004 /*
56005 * The underlying HW uses the version 2 of the CQEs definitions for
56006 * the following CQE types:
56007 * RES_UD, RES_RAWETH_QP1, RES_UD_CFA
56008 */
56009 #define CREQ_QUERY_FUNC_RESP_SB_CQE_V2 UINT32_C(0x80)
56010 /* Support for ping pong push mode is available. */
56011 #define CREQ_QUERY_FUNC_RESP_SB_PINGPONG_PUSH_MODE UINT32_C(0x100)
56012 /* Max CQs supported. */
56013 uint32_t max_cq;
56014 /* Max CQEs per CQ supported. */
56015 uint32_t max_cqe;
56016 /* Max PDs supported. */
56017 uint32_t max_pd;
56018 /*
56019 * Max SGEs per QP WQE supported. On chips with variable-size WQE support,
56020 * this field is applicable only for the backward compatible mode.
56021 */
56022 uint8_t max_sge;
56023 /* Max SGEs per SRQ WQE supported. */
56024 uint8_t max_srq_sge;
56025 /* Max outstanding RDMA read & atomic supported. */
56026 uint8_t max_qp_rd_atom;
56027 /* Max outstanding RDMA read & atomic that can be sent from an initiator. */
56028 uint8_t max_qp_init_rd_atom;
56029 /* Max MRs supported. */
56030 uint32_t max_mr;
56031 /* Max MWs supported. */
56032 uint32_t max_mw;
56033 /* Max Raw Ethertype QPs supported. */
56034 uint32_t max_raw_eth_qp;
56035 /* Max AHs supported. */
56036 uint32_t max_ah;
56037 /* Max FMRs supported. */
56038 uint32_t max_fmr;
56039 /* Max WQEs per SRQ supported. */
56040 uint32_t max_srq_wr;
56041 /* Max PKEYs supported. */
56042 uint32_t max_pkeys;
56043 /*
56044 * Max inline data supported. On chips with variable-size WQE support,
56045 * this field is applicable only for the backward compatible mode.
56046 */
56047 uint32_t max_inline_data;
56048 /* Max mappings per FMR supported. */
56049 uint8_t max_map_per_fmr;
56050 /* L2 DB space size in pages. */
56051 uint8_t l2_db_space_size;
56052 /* Max SRQs supported. */
56053 uint16_t max_srq;
56054 /* Max GIDs supported. */
56055 uint32_t max_gid;
56056 /*
56057 * An array of 48 8-bit values to specify allocation multiplier for TQM host buffer regions.
56058 * Each region occupies 16 MB of TQM PBL address space: 0x00000000, 0x01000000, 0x02000000, etc.
56059 * The host needs to allocate (<Number of QPs>*multiplier, rounded up to page size) of physical memory for non-zero slots
56060 * and map the pages to the corresponding 16MB regions.
56061 * Typically there are total 3 non-zero values in this array, their values are 16, 16, 12.
56062 * Cu+ will only populate up to index 11. SR may populate up to index 47.
56063 */
56064 uint32_t tqm_alloc_reqs[12];
56065 /* Max Doorbell page indices supported. */
56066 uint32_t max_dpi;
56067 /* Max SGEs per QP WQE supported in the variable-size WQE mode. */
56068 uint8_t max_sge_var_wqe;
56069 uint8_t reserved_8;
56070 /* Max inline data supported in the variable-size WQE mode. */
56071 uint16_t max_inline_data_var_wqe;
56072 } creq_query_func_resp_sb_t, *pcreq_query_func_resp_sb_t;
56073
56074 /**********************
56075 * set_func_resources *
56076 **********************/
56077
56078
56079 /* cmdq_set_func_resources (size:448b/56B) */
56080
56081 typedef struct cmdq_set_func_resources {
56082 /* Command opcode. */
56083 uint8_t opcode;
56084 /*
56085 * Set the following resources for the function:
56086 * - Max QP, CQ, MR+MW, SRQ per PF
56087 * - Max QP, CQ, MR+MW, SRQ per VF
56088 */
56089 #define CMDQ_SET_FUNC_RESOURCES_OPCODE_SET_FUNC_RESOURCES UINT32_C(0x84)
56090 #define CMDQ_SET_FUNC_RESOURCES_OPCODE_LAST CMDQ_SET_FUNC_RESOURCES_OPCODE_SET_FUNC_RESOURCES
56091 /* Size of the command in 16-byte units. */
56092 uint8_t cmd_size;
56093 /* Flags and attribs of the command. */
56094 uint16_t flags;
56095 /*
56096 * When set, the 32b `max_mrw_per_vf` field is logically divided
56097 * into two 16b fields, `max_mr_per_vf` and `max_av_per_vf`.
56098 */
56099 #define CMDQ_SET_FUNC_RESOURCES_FLAGS_MRAV_RESERVATION_SPLIT UINT32_C(0x1)
56100 /* Driver supplied handle to associate the command and the response. */
56101 uint16_t cookie;
56102 /* Size of the response buffer in 16-byte units. */
56103 uint8_t resp_size;
56104 uint8_t reserved8;
56105 /* Host address of the response. */
56106 uint64_t resp_addr;
56107 /* Number of QPs. It is the responsibility of the host to first extend the existing PBL with new addresses to pages to handle the adjustment. Must be greater or equal to current. */
56108 uint32_t number_of_qp;
56109 /* Number of MRWs. It is the responsibility of the host to first extend the existing PBL with new addresses to pages to handle the adjustment. Must be greater or equal to current. */
56110 uint32_t number_of_mrw;
56111 /* Number of SRQs. It is the responsibility of the host to first extend the existing PBL with new addresses to pages to handle the adjustment. Must be greater or equal to current. */
56112 uint32_t number_of_srq;
56113 /* Number of CQs. It is the responsibility of the host to first extend the existing PBL with new addresses to pages to handle the adjustment. Must be greater or equal to current. */
56114 uint32_t number_of_cq;
56115 /* Number of QPs per VF. */
56116 uint32_t max_qp_per_vf;
56117 /*
56118 * If the MR/AV split reservation flag is not set, then this field
56119 * represents the total number of MR plus AV entries allowed per
56120 * VF. For versions of firmware that support the split reservation,
56121 * when it is not specified half of the entries will be reserved
56122 * for MRs and the other half for AVs.
56123 *
56124 * If the MR/AV split reservation flag is set, then this
56125 * field is logically divided into two 16b fields. Bits `[31:16]`
56126 * represents the `max_mr_per_vf` and bits `[15:0]` represents
56127 * `max_av_per_vf`. The granularity of these values is defined by
56128 * the `mrav_num_entries_unit` field returned by the
56129 * `backing_store_qcaps` command.
56130 */
56131 uint32_t max_mrw_per_vf;
56132 /* Number of SRQs per VF. */
56133 uint32_t max_srq_per_vf;
56134 /* Number of CQs per VF. */
56135 uint32_t max_cq_per_vf;
56136 /* Number of GIDs per VF. */
56137 uint32_t max_gid_per_vf;
56138 /* Statistics context index for this function. */
56139 uint32_t stat_ctx_id;
56140 } cmdq_set_func_resources_t, *pcmdq_set_func_resources_t;
56141
56142 /* creq_set_func_resources_resp (size:128b/16B) */
56143
56144 typedef struct creq_set_func_resources_resp {
56145 uint8_t type;
56146 /*
56147 * This field indicates the exact type of the completion.
56148 * By convention, the LSB identifies the length of the
56149 * record in 16B units. Even values indicate 16B
56150 * records. Odd values indicate 32B
56151 * records.
56152 */
56153 #define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_MASK UINT32_C(0x3f)
56154 #define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_SFT 0
56155 /* QP Async Notification */
56156 #define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_QP_EVENT UINT32_C(0x38)
56157 #define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_LAST CREQ_SET_FUNC_RESOURCES_RESP_TYPE_QP_EVENT
56158 /* Status of the response. */
56159 uint8_t status;
56160 /* Driver supplied handle to associate the command and the response. */
56161 uint16_t cookie;
56162 uint32_t reserved32;
56163 uint8_t v;
56164 /*
56165 * This value is written by the NIC such that it will be different
56166 * for each pass through the completion queue. The even passes
56167 * will write 1. The odd passes will write 0.
56168 */
56169 #define CREQ_SET_FUNC_RESOURCES_RESP_V UINT32_C(0x1)
56170 /* Event or command opcode. */
56171 uint8_t event;
56172 /* Set function resources command response. */
56173 #define CREQ_SET_FUNC_RESOURCES_RESP_EVENT_SET_FUNC_RESOURCES UINT32_C(0x84)
56174 #define CREQ_SET_FUNC_RESOURCES_RESP_EVENT_LAST CREQ_SET_FUNC_RESOURCES_RESP_EVENT_SET_FUNC_RESOURCES
56175 uint8_t reserved48[6];
56176 } creq_set_func_resources_resp_t, *pcreq_set_func_resources_resp_t;
56177
56178 /*************
56179 * stop_func *
56180 *************/
56181
56182
56183 /* cmdq_stop_func (size:128b/16B) */
56184
56185 typedef struct cmdq_stop_func {
56186 /* Command opcode. */
56187 uint8_t opcode;
56188 /* Stop the function */
56189 #define CMDQ_STOP_FUNC_OPCODE_STOP_FUNC UINT32_C(0x82)
56190 #define CMDQ_STOP_FUNC_OPCODE_LAST CMDQ_STOP_FUNC_OPCODE_STOP_FUNC
56191 /* Size of the command in 16-byte units. */
56192 uint8_t cmd_size;
56193 /* Flags and attribs of the command. */
56194 uint16_t flags;
56195 /* Driver supplied handle to associate the command and the response. */
56196 uint16_t cookie;
56197 /* Size of the response buffer in 16-byte units. */
56198 uint8_t resp_size;
56199 uint8_t reserved8;
56200 /* Host address of the response. */
56201 uint64_t resp_addr;
56202 } cmdq_stop_func_t, *pcmdq_stop_func_t;
56203
56204 /* creq_stop_func_resp (size:128b/16B) */
56205
56206 typedef struct creq_stop_func_resp {
56207 uint8_t type;
56208 /*
56209 * This field indicates the exact type of the completion.
56210 * By convention, the LSB identifies the length of the
56211 * record in 16B units. Even values indicate 16B
56212 * records. Odd values indicate 32B
56213 * records.
56214 */
56215 #define CREQ_STOP_FUNC_RESP_TYPE_MASK UINT32_C(0x3f)
56216 #define CREQ_STOP_FUNC_RESP_TYPE_SFT 0
56217 /* QP Async Notification */
56218 #define CREQ_STOP_FUNC_RESP_TYPE_QP_EVENT UINT32_C(0x38)
56219 #define CREQ_STOP_FUNC_RESP_TYPE_LAST CREQ_STOP_FUNC_RESP_TYPE_QP_EVENT
56220 /* Status of the response. */
56221 uint8_t status;
56222 /* Driver supplied handle to associate the command and the response. */
56223 uint16_t cookie;
56224 uint32_t reserved32;
56225 uint8_t v;
56226 /*
56227 * This value is written by the NIC such that it will be different
56228 * for each pass through the completion queue. The even passes
56229 * will write 1. The odd passes will write 0.
56230 */
56231 #define CREQ_STOP_FUNC_RESP_V UINT32_C(0x1)
56232 /* Event or command opcode. */
56233 uint8_t event;
56234 /* Stop PF command response. */
56235 #define CREQ_STOP_FUNC_RESP_EVENT_STOP_FUNC UINT32_C(0x82)
56236 #define CREQ_STOP_FUNC_RESP_EVENT_LAST CREQ_STOP_FUNC_RESP_EVENT_STOP_FUNC
56237 uint8_t reserved48[6];
56238 } creq_stop_func_resp_t, *pcreq_stop_func_resp_t;
56239
56240 /****************
56241 * read_context *
56242 ****************/
56243
56244
56245 /* cmdq_read_context (size:192b/24B) */
56246
56247 typedef struct cmdq_read_context {
56248 /* Command opcode. */
56249 uint8_t opcode;
56250 /* Read the current state of any internal resource context. Can only be issued from a PF. */
56251 #define CMDQ_READ_CONTEXT_OPCODE_READ_CONTEXT UINT32_C(0x85)
56252 #define CMDQ_READ_CONTEXT_OPCODE_LAST CMDQ_READ_CONTEXT_OPCODE_READ_CONTEXT
56253 /* Size of the command in 16-byte units. */
56254 uint8_t cmd_size;
56255 /* Flags and attribs of the command. */
56256 uint16_t flags;
56257 /* Driver supplied handle to associate the command and the response. */
56258 uint16_t cookie;
56259 /* Size of the response buffer in 16-byte units. */
56260 uint8_t resp_size;
56261 uint8_t reserved8;
56262 /* Host address of the response. */
56263 uint64_t resp_addr;
56264 uint32_t type_xid;
56265 /* Context ID */
56266 #define CMDQ_READ_CONTEXT_XID_MASK UINT32_C(0xffffff)
56267 #define CMDQ_READ_CONTEXT_XID_SFT 0
56268 /* Context type */
56269 #define CMDQ_READ_CONTEXT_TYPE_MASK UINT32_C(0xff000000)
56270 #define CMDQ_READ_CONTEXT_TYPE_SFT 24
56271 /* Read QPC. The context (448 bytes) goes to resp_addr (as is, without a header), and resp_size should be set to 28 (448/16) */
56272 #define CMDQ_READ_CONTEXT_TYPE_QPC (UINT32_C(0x0) << 24)
56273 /* Read CQ. The context (64 bytes) goes to resp_addr (as is, without a header), and resp_size should be set to 4 (64/16) */
56274 #define CMDQ_READ_CONTEXT_TYPE_CQ (UINT32_C(0x1) << 24)
56275 /* Read MRW. The context (128 bytes) goes to resp_addr (as is, without a header), and resp_size should be set to 8 (128/16) */
56276 #define CMDQ_READ_CONTEXT_TYPE_MRW (UINT32_C(0x2) << 24)
56277 /* Read SRQ. The context (64 bytes) goes to resp_addr (as is, without a header), and resp_size should be set to 4 (64/16) */
56278 #define CMDQ_READ_CONTEXT_TYPE_SRQ (UINT32_C(0x3) << 24)
56279 #define CMDQ_READ_CONTEXT_TYPE_LAST CMDQ_READ_CONTEXT_TYPE_SRQ
56280 uint32_t unused_0;
56281 } cmdq_read_context_t, *pcmdq_read_context_t;
56282
56283 /* creq_read_context (size:128b/16B) */
56284
56285 typedef struct creq_read_context {
56286 uint8_t type;
56287 /*
56288 * This field indicates the exact type of the completion.
56289 * By convention, the LSB identifies the length of the
56290 * record in 16B units. Even values indicate 16B
56291 * records. Odd values indicate 32B records.
56292 * records.
56293 */
56294 #define CREQ_READ_CONTEXT_TYPE_MASK UINT32_C(0x3f)
56295 #define CREQ_READ_CONTEXT_TYPE_SFT 0
56296 /* QP Async Notification */
56297 #define CREQ_READ_CONTEXT_TYPE_QP_EVENT UINT32_C(0x38)
56298 #define CREQ_READ_CONTEXT_TYPE_LAST CREQ_READ_CONTEXT_TYPE_QP_EVENT
56299 /* Status of the response. */
56300 uint8_t status;
56301 /* Driver supplied handle to associate the command and the response. */
56302 uint16_t cookie;
56303 uint32_t reserved32;
56304 uint8_t v;
56305 /*
56306 * This value is written by the NIC such that it will be different
56307 * for each pass through the completion queue. The even passes
56308 * will write 1. The odd passes will write 0.
56309 */
56310 #define CREQ_READ_CONTEXT_V UINT32_C(0x1)
56311 /* Event or command opcode. */
56312 uint8_t event;
56313 /* Read the current state of any internal resource context. Can only be issued from a PF. */
56314 #define CREQ_READ_CONTEXT_EVENT_READ_CONTEXT UINT32_C(0x85)
56315 #define CREQ_READ_CONTEXT_EVENT_LAST CREQ_READ_CONTEXT_EVENT_READ_CONTEXT
56316 uint16_t reserved16;
56317 uint32_t reserved_32;
56318 } creq_read_context_t, *pcreq_read_context_t;
56319
56320 /*****************
56321 * map_tc_to_cos *
56322 *****************/
56323
56324
56325 /* cmdq_map_tc_to_cos (size:192b/24B) */
56326
56327 typedef struct cmdq_map_tc_to_cos {
56328 /* Command opcode. */
56329 uint8_t opcode;
56330 /* Map TC to COS. Can only be issued from a PF. */
56331 #define CMDQ_MAP_TC_TO_COS_OPCODE_MAP_TC_TO_COS UINT32_C(0x8a)
56332 #define CMDQ_MAP_TC_TO_COS_OPCODE_LAST CMDQ_MAP_TC_TO_COS_OPCODE_MAP_TC_TO_COS
56333 /* Size of the command in 16-byte units. */
56334 uint8_t cmd_size;
56335 /* Flags and attribs of the command. */
56336 uint16_t flags;
56337 /* Driver supplied handle to associate the command and the response. */
56338 uint16_t cookie;
56339 /* Size of the response buffer in 16-byte units. */
56340 uint8_t resp_size;
56341 uint8_t reserved8;
56342 /* Host address of the response. */
56343 uint64_t resp_addr;
56344 /* 1st COS index mapped to RoCE */
56345 uint16_t cos0;
56346 /* Don't change this COS. */
56347 #define CMDQ_MAP_TC_TO_COS_COS0_NO_CHANGE UINT32_C(0xffff)
56348 #define CMDQ_MAP_TC_TO_COS_COS0_LAST CMDQ_MAP_TC_TO_COS_COS0_NO_CHANGE
56349 /* 2nd COS index mapped to RoCE */
56350 uint16_t cos1;
56351 /* Disable this COS. */
56352 #define CMDQ_MAP_TC_TO_COS_COS1_DISABLE UINT32_C(0x8000)
56353 /* Don't change this COS. */
56354 #define CMDQ_MAP_TC_TO_COS_COS1_NO_CHANGE UINT32_C(0xffff)
56355 #define CMDQ_MAP_TC_TO_COS_COS1_LAST CMDQ_MAP_TC_TO_COS_COS1_NO_CHANGE
56356 uint32_t unused_0;
56357 } cmdq_map_tc_to_cos_t, *pcmdq_map_tc_to_cos_t;
56358
56359 /* creq_map_tc_to_cos_resp (size:128b/16B) */
56360
56361 typedef struct creq_map_tc_to_cos_resp {
56362 uint8_t type;
56363 /*
56364 * This field indicates the exact type of the completion.
56365 * By convention, the LSB identifies the length of the
56366 * record in 16B units. Even values indicate 16B
56367 * records. Odd values indicate 32B
56368 * records.
56369 */
56370 #define CREQ_MAP_TC_TO_COS_RESP_TYPE_MASK UINT32_C(0x3f)
56371 #define CREQ_MAP_TC_TO_COS_RESP_TYPE_SFT 0
56372 /* QP Async Notification */
56373 #define CREQ_MAP_TC_TO_COS_RESP_TYPE_QP_EVENT UINT32_C(0x38)
56374 #define CREQ_MAP_TC_TO_COS_RESP_TYPE_LAST CREQ_MAP_TC_TO_COS_RESP_TYPE_QP_EVENT
56375 /* Status of the response. */
56376 uint8_t status;
56377 /* Driver supplied handle to associate the command and the response. */
56378 uint16_t cookie;
56379 uint32_t reserved32;
56380 uint8_t v;
56381 /*
56382 * This value is written by the NIC such that it will be different
56383 * for each pass through the completion queue. The even passes
56384 * will write 1. The odd passes will write 0.
56385 */
56386 #define CREQ_MAP_TC_TO_COS_RESP_V UINT32_C(0x1)
56387 /* Event or command opcode. */
56388 uint8_t event;
56389 /* Map TC to COS response. */
56390 #define CREQ_MAP_TC_TO_COS_RESP_EVENT_MAP_TC_TO_COS UINT32_C(0x8a)
56391 #define CREQ_MAP_TC_TO_COS_RESP_EVENT_LAST CREQ_MAP_TC_TO_COS_RESP_EVENT_MAP_TC_TO_COS
56392 uint8_t reserved48[6];
56393 } creq_map_tc_to_cos_resp_t, *pcreq_map_tc_to_cos_resp_t;
56394
56395 /*****************
56396 * query_roce_cc *
56397 *****************/
56398
56399
56400 /* cmdq_query_roce_cc (size:128b/16B) */
56401
56402 typedef struct cmdq_query_roce_cc {
56403 /* Command opcode. */
56404 uint8_t opcode;
56405 /* Query congestion control. */
56406 #define CMDQ_QUERY_ROCE_CC_OPCODE_QUERY_ROCE_CC UINT32_C(0x8d)
56407 #define CMDQ_QUERY_ROCE_CC_OPCODE_LAST CMDQ_QUERY_ROCE_CC_OPCODE_QUERY_ROCE_CC
56408 /* Size of the command in 16-byte units. */
56409 uint8_t cmd_size;
56410 /* Flags and attribs of the command. */
56411 uint16_t flags;
56412 /* Driver supplied handle to associate the command and the response. */
56413 uint16_t cookie;
56414 /* Size of the response buffer in 16-byte units. */
56415 uint8_t resp_size;
56416 uint8_t reserved8;
56417 /* Host address of the response. */
56418 uint64_t resp_addr;
56419 } cmdq_query_roce_cc_t, *pcmdq_query_roce_cc_t;
56420
56421 /* creq_query_roce_cc_resp (size:128b/16B) */
56422
56423 typedef struct creq_query_roce_cc_resp {
56424 uint8_t type;
56425 /*
56426 * This field indicates the exact type of the completion.
56427 * By convention, the LSB identifies the length of the
56428 * record in 16B units. Even values indicate 16B
56429 * records. Odd values indicate 32B
56430 * records.
56431 */
56432 #define CREQ_QUERY_ROCE_CC_RESP_TYPE_MASK UINT32_C(0x3f)
56433 #define CREQ_QUERY_ROCE_CC_RESP_TYPE_SFT 0
56434 /* QP Async Notification */
56435 #define CREQ_QUERY_ROCE_CC_RESP_TYPE_QP_EVENT UINT32_C(0x38)
56436 #define CREQ_QUERY_ROCE_CC_RESP_TYPE_LAST CREQ_QUERY_ROCE_CC_RESP_TYPE_QP_EVENT
56437 /* Status of the response. */
56438 uint8_t status;
56439 /* Driver supplied handle to associate the command and the response. */
56440 uint16_t cookie;
56441 /* Side buffer size in 16-byte units */
56442 uint32_t size;
56443 uint8_t v;
56444 /*
56445 * This value is written by the NIC such that it will be different
56446 * for each pass through the completion queue. The even passes
56447 * will write 1. The odd passes will write 0.
56448 */
56449 #define CREQ_QUERY_ROCE_CC_RESP_V UINT32_C(0x1)
56450 /* Event or command opcode. */
56451 uint8_t event;
56452 /* Query congestion control response. */
56453 #define CREQ_QUERY_ROCE_CC_RESP_EVENT_QUERY_ROCE_CC UINT32_C(0x8d)
56454 #define CREQ_QUERY_ROCE_CC_RESP_EVENT_LAST CREQ_QUERY_ROCE_CC_RESP_EVENT_QUERY_ROCE_CC
56455 uint8_t reserved48[6];
56456 } creq_query_roce_cc_resp_t, *pcreq_query_roce_cc_resp_t;
56457
56458 /* Query congestion control command response side buffer structure. */
56459 /* creq_query_roce_cc_resp_sb (size:256b/32B) */
56460
56461 typedef struct creq_query_roce_cc_resp_sb {
56462 /* Command opcode. */
56463 uint8_t opcode;
56464 /* Query congestion control response. */
56465 #define CREQ_QUERY_ROCE_CC_RESP_SB_OPCODE_QUERY_ROCE_CC UINT32_C(0x8d)
56466 #define CREQ_QUERY_ROCE_CC_RESP_SB_OPCODE_LAST CREQ_QUERY_ROCE_CC_RESP_SB_OPCODE_QUERY_ROCE_CC
56467 /* Status of the response. */
56468 uint8_t status;
56469 /* Driver supplied handle to associate the command and the response. */
56470 uint16_t cookie;
56471 /* Flags and attribs of the command. */
56472 uint16_t flags;
56473 /* Size of the response buffer in 16-byte units. */
56474 uint8_t resp_size;
56475 uint8_t reserved8;
56476 uint8_t enable_cc;
56477 /* Enable. */
56478 #define CREQ_QUERY_ROCE_CC_RESP_SB_ENABLE_CC UINT32_C(0x1)
56479 /* unused7 is 7 b */
56480 #define CREQ_QUERY_ROCE_CC_RESP_SB_UNUSED7_MASK UINT32_C(0xfe)
56481 #define CREQ_QUERY_ROCE_CC_RESP_SB_UNUSED7_SFT 1
56482 uint8_t tos_dscp_tos_ecn;
56483 /* IP TOS ECN. */
56484 #define CREQ_QUERY_ROCE_CC_RESP_SB_TOS_ECN_MASK UINT32_C(0x3)
56485 #define CREQ_QUERY_ROCE_CC_RESP_SB_TOS_ECN_SFT 0
56486 /* IP TOS DSCP. */
56487 #define CREQ_QUERY_ROCE_CC_RESP_SB_TOS_DSCP_MASK UINT32_C(0xfc)
56488 #define CREQ_QUERY_ROCE_CC_RESP_SB_TOS_DSCP_SFT 2
56489 /* Congestion Probability averaging factor. */
56490 uint8_t g;
56491 /* Number of phases in Fast Recovery and Active Increase. */
56492 uint8_t num_phases_per_state;
56493 /* The starting value of rate. */
56494 uint16_t init_cr;
56495 /* The starting value of target rate. */
56496 uint16_t init_tr;
56497 uint8_t alt_vlan_pcp;
56498 /* Alternate vlan pcp value for CNP packets. */
56499 #define CREQ_QUERY_ROCE_CC_RESP_SB_ALT_VLAN_PCP_MASK UINT32_C(0x7)
56500 #define CREQ_QUERY_ROCE_CC_RESP_SB_ALT_VLAN_PCP_SFT 0
56501 /* rsvd1 is 5 b */
56502 #define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD1_MASK UINT32_C(0xf8)
56503 #define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD1_SFT 3
56504 uint8_t alt_tos_dscp;
56505 /* Alternate IP TOS DSCP. */
56506 #define CREQ_QUERY_ROCE_CC_RESP_SB_ALT_TOS_DSCP_MASK UINT32_C(0x3f)
56507 #define CREQ_QUERY_ROCE_CC_RESP_SB_ALT_TOS_DSCP_SFT 0
56508 /* rsvd4 is 2 b */
56509 #define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD4_MASK UINT32_C(0xc0)
56510 #define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD4_SFT 6
56511 uint8_t cc_mode;
56512 /* DCTCP CC algorithm. */
56513 #define CREQ_QUERY_ROCE_CC_RESP_SB_CC_MODE_DCTCP UINT32_C(0x0)
56514 /*
56515 * Probabilistic marking CC algorithm. On chips with CC Gen 0
56516 * support this will be TCP CC algorithm.
56517 */
56518 #define CREQ_QUERY_ROCE_CC_RESP_SB_CC_MODE_PROBABILISTIC UINT32_C(0x1)
56519 #define CREQ_QUERY_ROCE_CC_RESP_SB_CC_MODE_LAST CREQ_QUERY_ROCE_CC_RESP_SB_CC_MODE_PROBABILISTIC
56520 /* Specifies the RoCE Tx Queue to use for sending CNP packets. */
56521 uint8_t tx_queue;
56522 uint16_t rtt;
56523 /* Round trip time in units of usecs */
56524 #define CREQ_QUERY_ROCE_CC_RESP_SB_RTT_MASK UINT32_C(0x3fff)
56525 #define CREQ_QUERY_ROCE_CC_RESP_SB_RTT_SFT 0
56526 /* rsvd5 is 2 b */
56527 #define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD5_MASK UINT32_C(0xc000)
56528 #define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD5_SFT 14
56529 uint16_t tcp_cp;
56530 /* The value used as CP when cc_mode is 1(TCP) */
56531 #define CREQ_QUERY_ROCE_CC_RESP_SB_TCP_CP_MASK UINT32_C(0x3ff)
56532 #define CREQ_QUERY_ROCE_CC_RESP_SB_TCP_CP_SFT 0
56533 /* rsvd6 is 6 b */
56534 #define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD6_MASK UINT32_C(0xfc00)
56535 #define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD6_SFT 10
56536 /* Inactivity time after which QP CC parameters are initialized */
56537 uint16_t inactivity_th;
56538 /* Number of packets per phase. Max is 255. */
56539 uint8_t pkts_per_phase;
56540 /* Amount of time per phase in units of ms. Max is 15 */
56541 uint8_t time_per_phase;
56542 uint32_t reserved32;
56543 } creq_query_roce_cc_resp_sb_t, *pcreq_query_roce_cc_resp_sb_t;
56544
56545 /*
56546 * TLV encapsulated Query congestion control command response
56547 * side buffer, with extended TLV record included for specifying
56548 * the extended configuration for CC level 1.
56549 */
56550 /* creq_query_roce_cc_resp_sb_tlv (size:384b/48B) */
56551
56552 typedef struct creq_query_roce_cc_resp_sb_tlv {
56553 /*
56554 * The command discriminator is used to differentiate between various
56555 * types of HWRM messages. This includes legacy HWRM and RoCE slowpath
56556 * command messages as well as newer TLV encapsulated HWRM commands.
56557 *
56558 * For TLV encapsulated messages this field must be 0x8000.
56559 */
56560 uint16_t cmd_discr;
56561 uint8_t reserved_8b;
56562 uint8_t tlv_flags;
56563 /*
56564 * Indicates the presence of additional TLV encapsulated data
56565 * follows this TLV.
56566 */
56567 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_MORE UINT32_C(0x1)
56568 /* Last TLV in a sequence of TLVs. */
56569 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_MORE_LAST UINT32_C(0x0)
56570 /* More TLVs follow this TLV. */
56571 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_MORE_NOT_LAST UINT32_C(0x1)
56572 /*
56573 * When an HWRM receiver detects a TLV type that it does not
56574 * support with the TLV required flag set, the receiver must
56575 * reject the HWRM message with an error code indicating an
56576 * unsupported TLV type.
56577 */
56578 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_REQUIRED UINT32_C(0x2)
56579 /* No */
56580 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_REQUIRED_NO (UINT32_C(0x0) << 1)
56581 /* Yes */
56582 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES (UINT32_C(0x1) << 1)
56583 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_REQUIRED_LAST CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES
56584 /*
56585 * This field defines the TLV type value which is divided into
56586 * two ranges to differentiate between global and local TLV types.
56587 * Global TLV types must be unique across all defined TLV types.
56588 * Local TLV types are valid only for extensions to a given
56589 * HWRM message and may be repeated across different HWRM message
56590 * types. There is a direct correlation of each HWRM message type
56591 * to a single global TLV type value.
56592 *
56593 * Global TLV range: `0 - (63k-1)`
56594 *
56595 * Local TLV range: `63k - (64k-1)`
56596 */
56597 uint16_t tlv_type;
56598 /*
56599 * Length of the message data encapsulated by this TLV in bytes.
56600 * This length does not include the size of the TLV header itself
56601 * and it must be an integer multiple of 8B.
56602 */
56603 uint16_t length;
56604 /*
56605 * Size of the tlv encapsulated response,
56606 * including all tlvs and extension data in 16-byte units.
56607 */
56608 uint8_t total_size;
56609 uint8_t reserved56[7];
56610 /* Command opcode. */
56611 uint8_t opcode;
56612 /* Query congestion control response. */
56613 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_OPCODE_QUERY_ROCE_CC UINT32_C(0x8d)
56614 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_OPCODE_LAST CREQ_QUERY_ROCE_CC_RESP_SB_TLV_OPCODE_QUERY_ROCE_CC
56615 /* Status of the response. */
56616 uint8_t status;
56617 /* Driver supplied handle to associate the command and the response. */
56618 uint16_t cookie;
56619 /* Flags and attribs of the command. */
56620 uint16_t flags;
56621 /* Size of the response buffer in 16-byte units. */
56622 uint8_t resp_size;
56623 uint8_t reserved8;
56624 uint8_t enable_cc;
56625 /* Enable. */
56626 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_ENABLE_CC UINT32_C(0x1)
56627 /* unused7 is 7 b */
56628 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_UNUSED7_MASK UINT32_C(0xfe)
56629 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_UNUSED7_SFT 1
56630 uint8_t tos_dscp_tos_ecn;
56631 /* IP TOS ECN. */
56632 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TOS_ECN_MASK UINT32_C(0x3)
56633 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TOS_ECN_SFT 0
56634 /* IP TOS DSCP. */
56635 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TOS_DSCP_MASK UINT32_C(0xfc)
56636 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TOS_DSCP_SFT 2
56637 /* Congestion Probability averaging factor. */
56638 uint8_t g;
56639 /* Number of phases in Fast Recovery and Active Increase. */
56640 uint8_t num_phases_per_state;
56641 /* The starting value of rate. */
56642 uint16_t init_cr;
56643 /* The starting value of target rate. */
56644 uint16_t init_tr;
56645 uint8_t alt_vlan_pcp;
56646 /* Alternate vlan pcp value for CNP packets. */
56647 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_ALT_VLAN_PCP_MASK UINT32_C(0x7)
56648 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_ALT_VLAN_PCP_SFT 0
56649 /* rsvd1 is 5 b */
56650 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD1_MASK UINT32_C(0xf8)
56651 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD1_SFT 3
56652 uint8_t alt_tos_dscp;
56653 /* Alternate IP TOS DSCP. */
56654 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_ALT_TOS_DSCP_MASK UINT32_C(0x3f)
56655 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_ALT_TOS_DSCP_SFT 0
56656 /* rsvd4 is 2 b */
56657 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD4_MASK UINT32_C(0xc0)
56658 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD4_SFT 6
56659 uint8_t cc_mode;
56660 /* DCTCP CC algorithm. */
56661 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_CC_MODE_DCTCP UINT32_C(0x0)
56662 /*
56663 * Probabilistic marking CC algorithm. On chips with CC Gen 0
56664 * support this will be TCP CC algorithm.
56665 */
56666 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_CC_MODE_PROBABILISTIC UINT32_C(0x1)
56667 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_CC_MODE_LAST CREQ_QUERY_ROCE_CC_RESP_SB_TLV_CC_MODE_PROBABILISTIC
56668 /* Specifies the RoCE Tx Queue to use for sending CNP packets. */
56669 uint8_t tx_queue;
56670 uint16_t rtt;
56671 /* Round trip time in units of usecs */
56672 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RTT_MASK UINT32_C(0x3fff)
56673 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RTT_SFT 0
56674 /* rsvd5 is 2 b */
56675 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD5_MASK UINT32_C(0xc000)
56676 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD5_SFT 14
56677 uint16_t tcp_cp;
56678 /* The value used as CP when cc_mode is 1(TCP) */
56679 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TCP_CP_MASK UINT32_C(0x3ff)
56680 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TCP_CP_SFT 0
56681 /* rsvd6 is 6 b */
56682 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD6_MASK UINT32_C(0xfc00)
56683 #define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD6_SFT 10
56684 /* Inactivity time after which QP CC parameters are initialized */
56685 uint16_t inactivity_th;
56686 /* Number of packets per phase. Max is 255. */
56687 uint8_t pkts_per_phase;
56688 /* Amount of time per phase in units of ms. Max is 15 */
56689 uint8_t time_per_phase;
56690 uint32_t reserved32;
56691 } creq_query_roce_cc_resp_sb_tlv_t, *pcreq_query_roce_cc_resp_sb_tlv_t;
56692
56693 /* creq_query_roce_cc_gen1_resp_sb_tlv (size:704b/88B) */
56694
56695 typedef struct creq_query_roce_cc_gen1_resp_sb_tlv {
56696 /*
56697 * The command discriminator is used to differentiate between various
56698 * types of HWRM messages. This includes legacy HWRM and RoCE slowpath
56699 * command messages as well as newer TLV encapsulated HWRM commands.
56700 *
56701 * For TLV encapsulated messages this field must be 0x8000.
56702 */
56703 uint16_t cmd_discr;
56704 uint8_t reserved_8b;
56705 uint8_t tlv_flags;
56706 /*
56707 * Indicates the presence of additional TLV encapsulated data
56708 * follows this TLV.
56709 */
56710 #define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_MORE UINT32_C(0x1)
56711 /* Last TLV in a sequence of TLVs. */
56712 #define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_MORE_LAST UINT32_C(0x0)
56713 /* More TLVs follow this TLV. */
56714 #define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_MORE_NOT_LAST UINT32_C(0x1)
56715 /*
56716 * When an HWRM receiver detects a TLV type that it does not
56717 * support with the TLV required flag set, the receiver must
56718 * reject the HWRM message with an error code indicating an
56719 * unsupported TLV type.
56720 */
56721 #define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_REQUIRED UINT32_C(0x2)
56722 /* No */
56723 #define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_REQUIRED_NO (UINT32_C(0x0) << 1)
56724 /* Yes */
56725 #define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES (UINT32_C(0x1) << 1)
56726 #define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_REQUIRED_LAST CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES
56727 /*
56728 * This field defines the TLV type value which is divided into
56729 * two ranges to differentiate between global and local TLV types.
56730 * Global TLV types must be unique across all defined TLV types.
56731 * Local TLV types are valid only for extensions to a given
56732 * HWRM message and may be repeated across different HWRM message
56733 * types. There is a direct correlation of each HWRM message type
56734 * to a single global TLV type value.
56735 *
56736 * Global TLV range: `0 - (63k-1)`
56737 *
56738 * Local TLV range: `63k - (64k-1)`
56739 */
56740 uint16_t tlv_type;
56741 /*
56742 * Length of the message data encapsulated by this TLV in bytes.
56743 * This length does not include the size of the TLV header itself
56744 * and it must be an integer multiple of 8B.
56745 */
56746 uint16_t length;
56747 uint64_t reserved64;
56748 /* High order bits of inactivity threshold. */
56749 uint16_t inactivity_th_hi;
56750 /* The number of uS between generation of CNPs when cc_mode is probabilistic marking. */
56751 uint16_t min_time_between_cnps;
56752 /* The starting value of congestion probability. Input range is 0 - 1023. */
56753 uint16_t init_cp;
56754 /*
56755 * In tr_update_mode 0, Target Rate (TR) is updated to
56756 * halfway between the Current Rate (CR) before and after reduction.
56757 * In tr_update_mode 1, TR is updated to CR's value before reduction.
56758 */
56759 uint8_t tr_update_mode;
56760 /*
56761 * Determine for how many RTTs with CNPs in a row, TR is being updated.
56762 * 0: TR is updated when QPC. rtts_with_cnps == 0
56763 * 1-6: TR is updated if QPC. rtts_with_cnps <= tr_update_cycles
56764 * 7: TR is updated on all reductions.
56765 */
56766 uint8_t tr_update_cycles;
56767 /* Number of RTTs in Fast Recovery stage. */
56768 uint8_t fr_num_rtts;
56769 /* Time increment to increase TR in active increase phase. */
56770 uint8_t ai_rate_increase;
56771 /*
56772 * Indicates for how many RTTs with CNPs after the first one
56773 * to not reduce rate even if CNPs are received.
56774 */
56775 uint16_t reduction_relax_rtts_th;
56776 /*
56777 * For low rates, additional number of RTTS with CNPs
56778 * for which no rate reduction is made.
56779 * num_bits: 14
56780 */
56781 uint16_t additional_relax_cr_th;
56782 /*
56783 * If CR is less than or equal to this value,
56784 * then the actual CR average is set to this value
56785 * (shifted by bw_avg_weight).
56786 */
56787 uint16_t cr_min_th;
56788 /* Log based averaging weight for QPC variable actual_cr_avg. */
56789 uint8_t bw_avg_weight;
56790 /*
56791 * Used to compare CR to this factor times QPC.actual_cr_average
56792 * as a reduction reference. Values between 0 and 6 represent factor of
56793 * 1.125, 1.25, 1.5, 1.75, 2, 2.25, 2.5 respectively.
56794 */
56795 uint8_t actual_cr_factor;
56796 /* The level of CR above which CP is set to maximum level. */
56797 uint16_t max_cp_cr_th;
56798 /*
56799 * Enable adding fraction of CR to CP.
56800 * 0 for disable, 1 for enable.
56801 */
56802 uint8_t cp_bias_en;
56803 /* Log based fraction of cr to add to CP when cp_bias_en is 1. */
56804 uint8_t cp_bias;
56805 /*
56806 * The value of ECN bits in a CNP packet generated by hardware.
56807 * ECN-Capabale Transport (ECT) codepoints supported include:
56808 * 0 for not_ect, 1 for ect_0, 2 for ect_1
56809 */
56810 uint8_t cnp_ecn;
56811 /* Not ECN capable Transport */
56812 #define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_CNP_ECN_NOT_ECT UINT32_C(0x0)
56813 /* ECN Capable Transport-1 */
56814 #define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_CNP_ECN_ECT_1 UINT32_C(0x1)
56815 /* ECN Capable Transport-0 */
56816 #define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_CNP_ECN_ECT_0 UINT32_C(0x2)
56817 #define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_CNP_ECN_LAST CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_CNP_ECN_ECT_0
56818 /* Enables jitter in RTT. */
56819 uint8_t rtt_jitter_en;
56820 /*
56821 * Number of bytes per usec, dependant on port speed.
56822 * 200 Gbps: 25,000
56823 * 100 Gbps: 12,500
56824 * 50 Gbps: 6,250
56825 * 25 Gbps: 3125
56826 * 10 Gbps: 1250
56827 */
56828 uint16_t link_bytes_per_usec;
56829 /*
56830 * If CR is greater than or equal to this threshold,
56831 * QPC's CC state is reset to its initial state.
56832 */
56833 uint16_t reset_cc_cr_th;
56834 /*
56835 * The number of valid lsbits in CR and TR.
56836 * Supported values include 10 through 14 to support 2^cr_width rate.
56837 */
56838 uint8_t cr_width;
56839 /* Lower end of random selection of quota_period. */
56840 uint8_t quota_period_min;
56841 /* Upper end of random selection of quota_period. */
56842 uint8_t quota_period_max;
56843 /*
56844 * The absolute maximum possible quota_period,
56845 * applicable when rate table for lower 24 levels is used.
56846 */
56847 uint8_t quota_period_abs_max;
56848 /* TR never goes below this level. */
56849 uint16_t tr_lower_bound;
56850 /* Factor on probability threshold for adding 0.5 to CR randomly. */
56851 uint8_t cr_prob_factor;
56852 /* Factor on probability threshold for adding 0.5 to TR randomly. */
56853 uint8_t tr_prob_factor;
56854 /*
56855 * Threshold to ensure fairness between requester and responder.
56856 * If CR is less than the fairness threshold and a quota period has passed
56857 * priority will be given to the path that did not last transfer data.
56858 */
56859 uint16_t fairness_cr_th;
56860 /* Log based rate reduction divider. */
56861 uint8_t red_div;
56862 /* Threshold for rate reductions when CNPS received over last RTT. */
56863 uint8_t cnp_ratio_th;
56864 /*
56865 * Extended number of RTTS to wait, when there is no congestion,
56866 * to start doubling the rate.
56867 */
56868 uint16_t exp_ai_rtts;
56869 /* Log based CR to CP ratio used in exponential increase. */
56870 uint8_t exp_ai_cr_cp_ratio;
56871 /* Enable use of lowest 24 rate levels rate_table. */
56872 uint8_t use_rate_table;
56873 /*
56874 * Determines after how many congestion free RTTs to start
56875 * updating CP to track CR.
56876 */
56877 uint16_t cp_exp_update_th;
56878 /* The threshold on congestion free RTTs above which AI can increase to 16. */
56879 uint16_t high_exp_ai_rtts_th1;
56880 /* The threshold on congestion free RTTs above which AI can increase to 32. */
56881 uint16_t high_exp_ai_rtts_th2;
56882 /*
56883 * The number of congestion free RTTs above which
56884 * reduction based on actual rate is enabled.
56885 */
56886 uint16_t actual_cr_cong_free_rtts_th;
56887 /*
56888 * If rtts_with_cong is greater than 7 (severe congestion) and
56889 * CR level post reduction is above this threshold,
56890 * then TR is capped to 1.5 times CR..
56891 */
56892 uint16_t severe_cong_cr_th1;
56893 /*
56894 * If rtts_with_cong is greater than 7 (severe congestion) and
56895 * CR level post reduction is above this threshold,
56896 * then TR is capped to 1.25 times CR..
56897 */
56898 uint16_t severe_cong_cr_th2;
56899 /*
56900 * The maximum number of 64B that can be transmitted during RTT time,
56901 * including all headers and Inter Packet Gap.
56902 */
56903 uint32_t link64B_per_rtt;
56904 /*
56905 * The number of bytes to subtract from QPC.cc_bucket
56906 * when an ack is scheduled.
56907 */
56908 uint8_t cc_ack_bytes;
56909 /*
56910 * Enables reduction of CR, TR, and CP to init values when
56911 * congestion free RTTs is greater than reduce2_init_cong_free_rtts_th.
56912 */
56913 uint8_t reduce_init_en;
56914 /*
56915 * Minimum threshold value for number of congestion free RTTs before reducing
56916 * to init values for CR, TR, and CP when reduce_init_en is enabled.
56917 */
56918 uint16_t reduce_init_cong_free_rtts_th;
56919 /* Enables random no reduction of CR. */
56920 uint8_t random_no_red_en;
56921 /* Enables coarse correction to actual CR when actual RTT is longer than nominal. */
56922 uint8_t actual_cr_shift_correction_en;
56923 /* Enables adjustment to refill quota. */
56924 uint8_t quota_period_adjust_en;
56925 uint8_t reserved[5];
56926 } creq_query_roce_cc_gen1_resp_sb_tlv_t, *pcreq_query_roce_cc_gen1_resp_sb_tlv_t;
56927
56928 /***********************
56929 * cmdq_modify_roce_cc *
56930 ***********************/
56931
56932
56933 /* cmdq_modify_roce_cc (size:448b/56B) */
56934
56935 typedef struct cmdq_modify_roce_cc {
56936 /* Command opcode. */
56937 uint8_t opcode;
56938 /* Modify congestion control. Can only be issued from a PF. */
56939 #define CMDQ_MODIFY_ROCE_CC_OPCODE_MODIFY_ROCE_CC UINT32_C(0x8c)
56940 #define CMDQ_MODIFY_ROCE_CC_OPCODE_LAST CMDQ_MODIFY_ROCE_CC_OPCODE_MODIFY_ROCE_CC
56941 /* Size of the command in 16-byte units. */
56942 uint8_t cmd_size;
56943 /* Flags and attribs of the command. */
56944 uint16_t flags;
56945 /* Driver supplied handle to associate the command and the response. */
56946 uint16_t cookie;
56947 /* Size of the response buffer in 16-byte units. */
56948 uint8_t resp_size;
56949 uint8_t reserved8;
56950 /* Host address of the response. */
56951 uint64_t resp_addr;
56952 /* Modify mask signifies the field that is requesting the change. */
56953 uint32_t modify_mask;
56954 /* Enable change. */
56955 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_ENABLE_CC UINT32_C(0x1)
56956 /* Running average weight change. */
56957 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_G UINT32_C(0x2)
56958 /* Number of phases in Fast Recovery. */
56959 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_NUMPHASEPERSTATE UINT32_C(0x4)
56960 /* The starting value of rate change. */
56961 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_INIT_CR UINT32_C(0x8)
56962 /* The starting value of target rate change. */
56963 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_INIT_TR UINT32_C(0x10)
56964 /* IP TOS ECN change */
56965 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TOS_ECN UINT32_C(0x20)
56966 /* IP TOS DSCP change */
56967 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TOS_DSCP UINT32_C(0x40)
56968 /* Alternate IP TOS ECN change */
56969 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_ALT_VLAN_PCP UINT32_C(0x80)
56970 /* Alternate IP TOS DSCP change */
56971 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_ALT_TOS_DSCP UINT32_C(0x100)
56972 /* Round trip time in units of usecs */
56973 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_RTT UINT32_C(0x200)
56974 /* Congestion Control mode */
56975 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_CC_MODE UINT32_C(0x400)
56976 /* The value used as CP when cc_mode is 1(TCP) */
56977 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TCP_CP UINT32_C(0x800)
56978 /* Specifies the RoCE Tx Queue to use for sending CNP packets */
56979 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TX_QUEUE UINT32_C(0x1000)
56980 /* Inactivity time after which QP CC parameters are initialized */
56981 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_INACTIVITY_CP UINT32_C(0x2000)
56982 /* Amount of time per phase in units of ms. Max is 15. */
56983 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TIME_PER_PHASE UINT32_C(0x4000)
56984 /* Number of packets per phase. Max is 255. */
56985 #define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_PKTS_PER_PHASE UINT32_C(0x8000)
56986 uint8_t enable_cc;
56987 /* Enable. */
56988 #define CMDQ_MODIFY_ROCE_CC_ENABLE_CC UINT32_C(0x1)
56989 /* rsvd1 is 7 b */
56990 #define CMDQ_MODIFY_ROCE_CC_RSVD1_MASK UINT32_C(0xfe)
56991 #define CMDQ_MODIFY_ROCE_CC_RSVD1_SFT 1
56992 /* Congestion Probability averaging factor. */
56993 uint8_t g;
56994 /* Number of phases in Fast Recovery. */
56995 uint8_t num_phases_per_state;
56996 /* Number of packets per phase. Max is 255. */
56997 uint8_t pkts_per_phase;
56998 /*
56999 * The starting value of rate.
57000 * The max value supported for CC support level 1 is 1024.
57001 */
57002 uint16_t init_cr;
57003 /*
57004 * The starting value of target rate.
57005 * The max value supported for CC support level 1 is 1024.
57006 */
57007 uint16_t init_tr;
57008 uint8_t tos_dscp_tos_ecn;
57009 /* IP TOS ECN. Valid values are 1 or 2 when ECN is enabled. */
57010 #define CMDQ_MODIFY_ROCE_CC_TOS_ECN_MASK UINT32_C(0x3)
57011 #define CMDQ_MODIFY_ROCE_CC_TOS_ECN_SFT 0
57012 /* IP TOS DSCP. */
57013 #define CMDQ_MODIFY_ROCE_CC_TOS_DSCP_MASK UINT32_C(0xfc)
57014 #define CMDQ_MODIFY_ROCE_CC_TOS_DSCP_SFT 2
57015 uint8_t alt_vlan_pcp;
57016 /* Alternate vlan pcp value for CNP packets. */
57017 #define CMDQ_MODIFY_ROCE_CC_ALT_VLAN_PCP_MASK UINT32_C(0x7)
57018 #define CMDQ_MODIFY_ROCE_CC_ALT_VLAN_PCP_SFT 0
57019 /* rsvd3 is 5 b */
57020 #define CMDQ_MODIFY_ROCE_CC_RSVD3_MASK UINT32_C(0xf8)
57021 #define CMDQ_MODIFY_ROCE_CC_RSVD3_SFT 3
57022 uint16_t alt_tos_dscp;
57023 /* Alternate IP TOS DSCP. */
57024 #define CMDQ_MODIFY_ROCE_CC_ALT_TOS_DSCP_MASK UINT32_C(0x3f)
57025 #define CMDQ_MODIFY_ROCE_CC_ALT_TOS_DSCP_SFT 0
57026 /* rsvd4 is 10 b */
57027 #define CMDQ_MODIFY_ROCE_CC_RSVD4_MASK UINT32_C(0xffc0)
57028 #define CMDQ_MODIFY_ROCE_CC_RSVD4_SFT 6
57029 uint16_t rtt;
57030 /*
57031 * Round trip time in units of usecs.
57032 * The max value supported for CC support level 1 is 2047.
57033 */
57034 #define CMDQ_MODIFY_ROCE_CC_RTT_MASK UINT32_C(0x3fff)
57035 #define CMDQ_MODIFY_ROCE_CC_RTT_SFT 0
57036 /* rsvd5 is 2 b */
57037 #define CMDQ_MODIFY_ROCE_CC_RSVD5_MASK UINT32_C(0xc000)
57038 #define CMDQ_MODIFY_ROCE_CC_RSVD5_SFT 14
57039 uint16_t tcp_cp;
57040 /* The value used as CP when cc_mode is 1(TCP) */
57041 #define CMDQ_MODIFY_ROCE_CC_TCP_CP_MASK UINT32_C(0x3ff)
57042 #define CMDQ_MODIFY_ROCE_CC_TCP_CP_SFT 0
57043 /* rsvd6 is 6 b */
57044 #define CMDQ_MODIFY_ROCE_CC_RSVD6_MASK UINT32_C(0xfc00)
57045 #define CMDQ_MODIFY_ROCE_CC_RSVD6_SFT 10
57046 uint8_t cc_mode;
57047 /* DCTCP */
57048 #define CMDQ_MODIFY_ROCE_CC_CC_MODE_DCTCP_CC_MODE UINT32_C(0x0)
57049 /*
57050 * Probabilistic marking. On chips with CC Gen 0 support this
57051 * will be TCP CC algorithm.
57052 */
57053 #define CMDQ_MODIFY_ROCE_CC_CC_MODE_PROBABILISTIC_CC_MODE UINT32_C(0x1)
57054 #define CMDQ_MODIFY_ROCE_CC_CC_MODE_LAST CMDQ_MODIFY_ROCE_CC_CC_MODE_PROBABILISTIC_CC_MODE
57055 /*
57056 * Specifies the RoCE Tx Queue to use for sending CNP packets.
57057 * CC support level 0 support 0 to 3 Tx queues.
57058 * CC support level 1 supports 0 to 7 Tx queues.
57059 */
57060 uint8_t tx_queue;
57061 /* Inactivity time after which QP CC parameters are initialized */
57062 uint16_t inactivity_th;
57063 /* Amount of time per phase in units of ms. Max is 15 */
57064 uint8_t time_per_phase;
57065 /* reserved8 is 8 b */
57066 uint8_t reserved8_1;
57067 /* reserved16 is 16 b */
57068 uint16_t reserved16;
57069 uint32_t reserved32;
57070 uint64_t reserved64;
57071 } cmdq_modify_roce_cc_t, *pcmdq_modify_roce_cc_t;
57072
57073 /*
57074 * TLV encapsulated modify CC command, with extended TLV record
57075 * included for specifying the extended configuration for CC level 1.
57076 */
57077 /* cmdq_modify_roce_cc_tlv (size:640b/80B) */
57078
57079 typedef struct cmdq_modify_roce_cc_tlv {
57080 /*
57081 * The command discriminator is used to differentiate between various
57082 * types of HWRM messages. This includes legacy HWRM and RoCE slowpath
57083 * command messages as well as newer TLV encapsulated HWRM commands.
57084 *
57085 * For TLV encapsulated messages this field must be 0x8000.
57086 */
57087 uint16_t cmd_discr;
57088 uint8_t reserved_8b;
57089 uint8_t tlv_flags;
57090 /*
57091 * Indicates the presence of additional TLV encapsulated data
57092 * follows this TLV.
57093 */
57094 #define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_MORE UINT32_C(0x1)
57095 /* Last TLV in a sequence of TLVs. */
57096 #define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_MORE_LAST UINT32_C(0x0)
57097 /* More TLVs follow this TLV. */
57098 #define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_MORE_NOT_LAST UINT32_C(0x1)
57099 /*
57100 * When an HWRM receiver detects a TLV type that it does not
57101 * support with the TLV required flag set, the receiver must
57102 * reject the HWRM message with an error code indicating an
57103 * unsupported TLV type.
57104 */
57105 #define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_REQUIRED UINT32_C(0x2)
57106 /* No */
57107 #define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_REQUIRED_NO (UINT32_C(0x0) << 1)
57108 /* Yes */
57109 #define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_REQUIRED_YES (UINT32_C(0x1) << 1)
57110 #define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_REQUIRED_LAST CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_REQUIRED_YES
57111 /*
57112 * This field defines the TLV type value which is divided into
57113 * two ranges to differentiate between global and local TLV types.
57114 * Global TLV types must be unique across all defined TLV types.
57115 * Local TLV types are valid only for extensions to a given
57116 * HWRM message and may be repeated across different HWRM message
57117 * types. There is a direct correlation of each HWRM message type
57118 * to a single global TLV type value.
57119 *
57120 * Global TLV range: `0 - (63k-1)`
57121 *
57122 * Local TLV range: `63k - (64k-1)`
57123 */
57124 uint16_t tlv_type;
57125 /*
57126 * Length of the message data encapsulated by this TLV in bytes.
57127 * This length does not include the size of the TLV header itself
57128 * and it must be an integer multiple of 8B.
57129 */
57130 uint16_t length;
57131 /* Size of the tlv encapsulated command, including all tlvs and extension data in 16-byte units. */
57132 uint8_t total_size;
57133 uint8_t reserved56[7];
57134 /* Command opcode. */
57135 uint8_t opcode;
57136 /* Modify congestion control. Can only be issued from a PF. */
57137 #define CMDQ_MODIFY_ROCE_CC_TLV_OPCODE_MODIFY_ROCE_CC UINT32_C(0x8c)
57138 #define CMDQ_MODIFY_ROCE_CC_TLV_OPCODE_LAST CMDQ_MODIFY_ROCE_CC_TLV_OPCODE_MODIFY_ROCE_CC
57139 /* Size of the command in 16-byte units. */
57140 uint8_t cmd_size;
57141 /* Flags and attribs of the command. */
57142 uint16_t flags;
57143 /* Driver supplied handle to associate the command and the response. */
57144 uint16_t cookie;
57145 /* Size of the response buffer in 16-byte units. */
57146 uint8_t resp_size;
57147 uint8_t reserved8;
57148 /* Host address of the response. */
57149 uint64_t resp_addr;
57150 /* Modify mask signifies the field that is requesting the change. */
57151 uint32_t modify_mask;
57152 /* Enable change. */
57153 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_ENABLE_CC UINT32_C(0x1)
57154 /* Running average weight change. */
57155 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_G UINT32_C(0x2)
57156 /* Number of phases in Fast Recovery. */
57157 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_NUMPHASEPERSTATE UINT32_C(0x4)
57158 /* The starting value of rate change. */
57159 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_INIT_CR UINT32_C(0x8)
57160 /* The starting value of target rate change. */
57161 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_INIT_TR UINT32_C(0x10)
57162 /* IP TOS ECN change */
57163 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_TOS_ECN UINT32_C(0x20)
57164 /* IP TOS DSCP change */
57165 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_TOS_DSCP UINT32_C(0x40)
57166 /* Alternate IP TOS ECN change */
57167 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_ALT_VLAN_PCP UINT32_C(0x80)
57168 /* Alternate IP TOS DSCP change */
57169 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_ALT_TOS_DSCP UINT32_C(0x100)
57170 /* Round trip time in units of usecs */
57171 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_RTT UINT32_C(0x200)
57172 /* Congestion Control mode */
57173 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_CC_MODE UINT32_C(0x400)
57174 /* The value used as CP when cc_mode is 1(TCP) */
57175 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_TCP_CP UINT32_C(0x800)
57176 /* Specifies the RoCE Tx Queue to use for sending CNP packets */
57177 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_TX_QUEUE UINT32_C(0x1000)
57178 /* Inactivity time after which QP CC parameters are initialized */
57179 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_INACTIVITY_CP UINT32_C(0x2000)
57180 /* Amount of time per phase in units of ms. Max is 15. */
57181 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_TIME_PER_PHASE UINT32_C(0x4000)
57182 /* Number of packets per phase. Max is 255. */
57183 #define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_PKTS_PER_PHASE UINT32_C(0x8000)
57184 uint8_t enable_cc;
57185 /* Enable. */
57186 #define CMDQ_MODIFY_ROCE_CC_TLV_ENABLE_CC UINT32_C(0x1)
57187 /* rsvd1 is 7 b */
57188 #define CMDQ_MODIFY_ROCE_CC_TLV_RSVD1_MASK UINT32_C(0xfe)
57189 #define CMDQ_MODIFY_ROCE_CC_TLV_RSVD1_SFT 1
57190 /* Congestion Probability averaging factor. */
57191 uint8_t g;
57192 /* Number of phases in Fast Recovery. */
57193 uint8_t num_phases_per_state;
57194 /* Number of packets per phase. Max is 255. */
57195 uint8_t pkts_per_phase;
57196 /*
57197 * The starting value of rate.
57198 * The max value supported for CC support level 1 is 1024.
57199 */
57200 uint16_t init_cr;
57201 /*
57202 * The starting value of target rate.
57203 * The max value supported for CC support level 1 is 1024.
57204 */
57205 uint16_t init_tr;
57206 uint8_t tos_dscp_tos_ecn;
57207 /* IP TOS ECN. Valid values are 1 or 2 when ECN is enabled. */
57208 #define CMDQ_MODIFY_ROCE_CC_TLV_TOS_ECN_MASK UINT32_C(0x3)
57209 #define CMDQ_MODIFY_ROCE_CC_TLV_TOS_ECN_SFT 0
57210 /* IP TOS DSCP. */
57211 #define CMDQ_MODIFY_ROCE_CC_TLV_TOS_DSCP_MASK UINT32_C(0xfc)
57212 #define CMDQ_MODIFY_ROCE_CC_TLV_TOS_DSCP_SFT 2
57213 uint8_t alt_vlan_pcp;
57214 /* Alternate vlan pcp value for CNP packets. */
57215 #define CMDQ_MODIFY_ROCE_CC_TLV_ALT_VLAN_PCP_MASK UINT32_C(0x7)
57216 #define CMDQ_MODIFY_ROCE_CC_TLV_ALT_VLAN_PCP_SFT 0
57217 /* rsvd3 is 5 b */
57218 #define CMDQ_MODIFY_ROCE_CC_TLV_RSVD3_MASK UINT32_C(0xf8)
57219 #define CMDQ_MODIFY_ROCE_CC_TLV_RSVD3_SFT 3
57220 uint16_t alt_tos_dscp;
57221 /* Alternate IP TOS DSCP. */
57222 #define CMDQ_MODIFY_ROCE_CC_TLV_ALT_TOS_DSCP_MASK UINT32_C(0x3f)
57223 #define CMDQ_MODIFY_ROCE_CC_TLV_ALT_TOS_DSCP_SFT 0
57224 /* rsvd4 is 10 b */
57225 #define CMDQ_MODIFY_ROCE_CC_TLV_RSVD4_MASK UINT32_C(0xffc0)
57226 #define CMDQ_MODIFY_ROCE_CC_TLV_RSVD4_SFT 6
57227 uint16_t rtt;
57228 /*
57229 * Round trip time in units of usecs.
57230 * The max value supported for CC support level 1 is 2047.
57231 */
57232 #define CMDQ_MODIFY_ROCE_CC_TLV_RTT_MASK UINT32_C(0x3fff)
57233 #define CMDQ_MODIFY_ROCE_CC_TLV_RTT_SFT 0
57234 /* rsvd5 is 2 b */
57235 #define CMDQ_MODIFY_ROCE_CC_TLV_RSVD5_MASK UINT32_C(0xc000)
57236 #define CMDQ_MODIFY_ROCE_CC_TLV_RSVD5_SFT 14
57237 uint16_t tcp_cp;
57238 /* The value used as CP when cc_mode is 1(TCP) */
57239 #define CMDQ_MODIFY_ROCE_CC_TLV_TCP_CP_MASK UINT32_C(0x3ff)
57240 #define CMDQ_MODIFY_ROCE_CC_TLV_TCP_CP_SFT 0
57241 /* rsvd6 is 6 b */
57242 #define CMDQ_MODIFY_ROCE_CC_TLV_RSVD6_MASK UINT32_C(0xfc00)
57243 #define CMDQ_MODIFY_ROCE_CC_TLV_RSVD6_SFT 10
57244 uint8_t cc_mode;
57245 /* DCTCP */
57246 #define CMDQ_MODIFY_ROCE_CC_TLV_CC_MODE_DCTCP_CC_MODE UINT32_C(0x0)
57247 /*
57248 * Probabilistic marking. On chips with CC Gen 0 support this
57249 * will be TCP CC algorithm.
57250 */
57251 #define CMDQ_MODIFY_ROCE_CC_TLV_CC_MODE_PROBABILISTIC_CC_MODE UINT32_C(0x1)
57252 #define CMDQ_MODIFY_ROCE_CC_TLV_CC_MODE_LAST CMDQ_MODIFY_ROCE_CC_TLV_CC_MODE_PROBABILISTIC_CC_MODE
57253 /*
57254 * Specifies the RoCE Tx Queue to use for sending CNP packets.
57255 * CC support level 0 support 0 to 3 Tx queues.
57256 * CC support level 1 supports 0 to 7 Tx queues.
57257 */
57258 uint8_t tx_queue;
57259 /* Inactivity time after which QP CC parameters are initialized */
57260 uint16_t inactivity_th;
57261 /* Amount of time per phase in units of ms. Max is 15 */
57262 uint8_t time_per_phase;
57263 /* reserved8 is 8 b */
57264 uint8_t reserved8_1;
57265 /* reserved16 is 16 b */
57266 uint16_t reserved16;
57267 uint32_t reserved32;
57268 uint64_t reserved64;
57269 uint64_t reservedtlvpad;
57270 } cmdq_modify_roce_cc_tlv_t, *pcmdq_modify_roce_cc_tlv_t;
57271
57272 /* cmdq_modify_roce_cc_gen1_tlv (size:768b/96B) */
57273
57274 typedef struct cmdq_modify_roce_cc_gen1_tlv {
57275 /*
57276 * The command discriminator is used to differentiate between various
57277 * types of HWRM messages. This includes legacy HWRM and RoCE slowpath
57278 * command messages as well as newer TLV encapsulated HWRM commands.
57279 *
57280 * For TLV encapsulated messages this field must be 0x8000.
57281 */
57282 uint16_t cmd_discr;
57283 uint8_t reserved_8b;
57284 uint8_t tlv_flags;
57285 /*
57286 * Indicates the presence of additional TLV encapsulated data
57287 * follows this TLV.
57288 */
57289 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_MORE UINT32_C(0x1)
57290 /* Last TLV in a sequence of TLVs. */
57291 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_MORE_LAST UINT32_C(0x0)
57292 /* More TLVs follow this TLV. */
57293 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_MORE_NOT_LAST UINT32_C(0x1)
57294 /*
57295 * When an HWRM receiver detects a TLV type that it does not
57296 * support with the TLV required flag set, the receiver must
57297 * reject the HWRM message with an error code indicating an
57298 * unsupported TLV type.
57299 */
57300 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_REQUIRED UINT32_C(0x2)
57301 /* No */
57302 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_REQUIRED_NO (UINT32_C(0x0) << 1)
57303 /* Yes */
57304 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_REQUIRED_YES (UINT32_C(0x1) << 1)
57305 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_REQUIRED_LAST CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_REQUIRED_YES
57306 /*
57307 * This field defines the TLV type value which is divided into
57308 * two ranges to differentiate between global and local TLV types.
57309 * Global TLV types must be unique across all defined TLV types.
57310 * Local TLV types are valid only for extensions to a given
57311 * HWRM message and may be repeated across different HWRM message
57312 * types. There is a direct correlation of each HWRM message type
57313 * to a single global TLV type value.
57314 *
57315 * Global TLV range: `0 - (63k-1)`
57316 *
57317 * Local TLV range: `63k - (64k-1)`
57318 */
57319 uint16_t tlv_type;
57320 /*
57321 * Length of the message data encapsulated by this TLV in bytes.
57322 * This length does not include the size of the TLV header itself
57323 * and it must be an integer multiple of 8B.
57324 */
57325 uint16_t length;
57326 uint64_t reserved64;
57327 /* Modify mask signifies the field that is requesting the change. */
57328 uint64_t modify_mask;
57329 /* Update the number of uS between generation of CNPs for probabilistic marking mode. */
57330 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_MIN_TIME_BETWEEN_CNPS UINT32_C(0x1)
57331 /*
57332 * Update starting value of Congestion Probability (CP).
57333 * Maximum value supported is 1023.
57334 */
57335 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_INIT_CP UINT32_C(0x2)
57336 /* Update Target Rate (TR) Update Mode. */
57337 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_TR_UPDATE_MODE UINT32_C(0x4)
57338 /* Update number of RTTs with CNPs in a row for TR update. */
57339 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_TR_UPDATE_CYCLES UINT32_C(0x8)
57340 /* Update number of RTTs in Fast Recovery stage. */
57341 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_FR_NUM_RTTS UINT32_C(0x10)
57342 /* Update time increment to increase TR in active increase phase. */
57343 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_AI_RATE_INCREASE UINT32_C(0x20)
57344 /*
57345 * Update count of RTTs with CNPs, received after
57346 * the first one, to wait, before reducing rate.
57347 */
57348 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_REDUCTION_RELAX_RTTS_TH UINT32_C(0x40)
57349 /*
57350 * Update additional number of RTTS with CNPs, to wait,
57351 * before further rate reduction, for low rates.
57352 */
57353 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_ADDITIONAL_RELAX_CR_TH UINT32_C(0x80)
57354 /* Update threshold for update to Actual Current Rate (CR) */
57355 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CR_MIN_TH UINT32_C(0x100)
57356 /* Update log based averaging weight for QPC variable actual_cr */
57357 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_BW_AVG_WEIGHT UINT32_C(0x200)
57358 /* Update factor used in the computation of rate reduction. */
57359 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_ACTUAL_CR_FACTOR UINT32_C(0x400)
57360 /* Update the level of CR above which CP is set to maximum level. */
57361 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_MAX_CP_CR_TH UINT32_C(0x800)
57362 /* Enable adding fraction of CR to CP. */
57363 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CP_BIAS_EN UINT32_C(0x1000)
57364 /*
57365 * Update log based fraction of CR to add to CP
57366 * when cp_bias_en is 1.
57367 */
57368 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CP_BIAS UINT32_C(0x2000)
57369 /* Update ECN bits in a CNP packet generated by hardware. */
57370 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CNP_ECN UINT32_C(0x4000)
57371 /* Update enable of jitter in RTT. */
57372 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_RTT_JITTER_EN UINT32_C(0x8000)
57373 /* Update number of bytes per usec. */
57374 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_LINK_BYTES_PER_USEC UINT32_C(0x10000)
57375 /* Update threshold used to reset QPC CC state to its initial state. */
57376 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_RESET_CC_CR_TH UINT32_C(0x20000)
57377 /* Update number of valid lsbits in CR and TR */
57378 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CR_WIDTH UINT32_C(0x40000)
57379 /* Update lower end of random selection of quota_period. */
57380 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_QUOTA_PERIOD_MIN UINT32_C(0x80000)
57381 /* Update upper end of random selection of quota_period. */
57382 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_QUOTA_PERIOD_MAX UINT32_C(0x100000)
57383 /*
57384 * Update absolute maximum possible quota_period,
57385 * when rate table for lower 24 levels is used.
57386 */
57387 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_QUOTA_PERIOD_ABS_MAX UINT32_C(0x200000)
57388 /* Update lower bound of TR. */
57389 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_TR_LOWER_BOUND UINT32_C(0x400000)
57390 /*
57391 * Update factor on probability threshold for adding
57392 * 0.5 to CR randomly.
57393 */
57394 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CR_PROB_FACTOR UINT32_C(0x800000)
57395 /*
57396 * Update factor on probability threshold for adding
57397 * 0.5 to TR randomly.
57398 */
57399 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_TR_PROB_FACTOR UINT32_C(0x1000000)
57400 /*
57401 * Update threshold that ensures fairness between requester
57402 * and responder
57403 */
57404 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_FAIRNESS_CR_TH UINT32_C(0x2000000)
57405 /* Update log based rate reduction divider. */
57406 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_RED_DIV UINT32_C(0x4000000)
57407 /*
57408 * Update threshold for rate reductions when CNPS received
57409 * over last RTT.
57410 */
57411 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CNP_RATIO_TH UINT32_C(0x8000000)
57412 /*
57413 * Update extended number of RTTS to wait,
57414 * when there is no congestion, to start doubling the rate.
57415 */
57416 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_EXP_AI_RTTS UINT32_C(0x10000000)
57417 /* Update log based CR to CP ratio used in exponential increase. */
57418 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_EXP_AI_CR_CP_RATIO UINT32_C(0x20000000)
57419 /*
57420 * Update threshold, in congestion free RTTs,
57421 * that triggers start of CP update to track CR.
57422 */
57423 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CP_EXP_UPDATE_TH UINT32_C(0x40000000)
57424 /*
57425 * Update threshold on congestion free RTTs above
57426 * which AI can increase to 16.
57427 */
57428 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_HIGH_EXP_AI_RTTS_TH1 UINT32_C(0x80000000)
57429 /*
57430 * Update threshold on congestion free RTTs above
57431 * which AI can increase to 32.
57432 */
57433 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_HIGH_EXP_AI_RTTS_TH2 UINT32_C(0x100000000)L
57434 /* Update use of lowest 24 rate levels rate_table. */
57435 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_USE_RATE_TABLE UINT32_C(0x200000000)L
57436 /*
57437 * Update the maximum number of 64B that can be transmitted
57438 * during RTT time.
57439 */
57440 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_LINK64B_PER_RTT UINT32_C(0x400000000)L
57441 /*
57442 * Update number of congestion free RTTs above which
57443 * reduction based on actual rate is enabled.
57444 */
57445 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_ACTUAL_CR_CONG_FREE_RTTS_TH UINT32_C(0x800000000)L
57446 /*
57447 * Update threshold used in severe congestion for
57448 * limiting TR to 1.5 times CR.
57449 */
57450 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_SEVERE_CONG_CR_TH1 UINT32_C(0x1000000000)L
57451 /*
57452 * Update threshold used in severe congestion for
57453 * limiting TR to 1.25 times CR.
57454 */
57455 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_SEVERE_CONG_CR_TH2 UINT32_C(0x2000000000)L
57456 /*
57457 * Update number of bytes to subtract from QPC.cc_bucket
57458 * when an ack is scheduled.
57459 */
57460 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CC_ACK_BYTES UINT32_C(0x4000000000)L
57461 /* Update enable of reduction of CR, TR, and CP to init values. */
57462 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_REDUCE_INIT_EN UINT32_C(0x8000000000)L
57463 /* Update threshold used for reduction of CR, TR, and CP to init values. */
57464 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_REDUCE_INIT_CONG_FREE_RTTS_TH UINT32_C(0x10000000000)L
57465 /* Update enable of random no reduction of CR. */
57466 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_RANDOM_NO_RED_EN UINT32_C(0x20000000000)L
57467 /* Update enable of coarse correction to actual CR. */
57468 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_ACTUAL_CR_SHIFT_CORRECTION_EN UINT32_C(0x40000000000)L
57469 /* Update enable of adjustment to refill quota. */
57470 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_QUOTA_PERIOD_ADJUST_EN UINT32_C(0x80000000000)L
57471 /* High order bits of inactivity threshold. */
57472 uint16_t inactivity_th_hi;
57473 /* The number of uS between generation of CNPs when cc_mode is probabilistic marking. */
57474 uint16_t min_time_between_cnps;
57475 /* The starting value of congestion probability. Input range is 0 - 1023. */
57476 uint16_t init_cp;
57477 /*
57478 * In tr_update_mode 0, Target Rate (TR) is updated to
57479 * halfway between the Current Rate (CR) before and after reduction.
57480 * In tr_update_mode 1, TR is updated to CR's value before reduction.
57481 */
57482 uint8_t tr_update_mode;
57483 /*
57484 * Determine for how many RTTs with CNPs in a row, TR is being updated.
57485 * 0: TR is updated when QPC. rtts_with_cnps == 0
57486 * 1-6: TR is updated if QPC. rtts_with_cnps <= tr_update_cycles
57487 * 7: TR is updated on all reductions.
57488 */
57489 uint8_t tr_update_cycles;
57490 /* Number of RTTs in Fast Recovery stage. */
57491 uint8_t fr_num_rtts;
57492 /* Time increment to increase TR in active increase phase. */
57493 uint8_t ai_rate_increase;
57494 /*
57495 * Indicates for how many RTTs with CNPs after the first one
57496 * to not reduce rate even if CNPs are received.
57497 */
57498 uint16_t reduction_relax_rtts_th;
57499 /*
57500 * For low rates, additional number of RTTS with CNPs
57501 * for which no rate reduction is made.
57502 * num_bits: 14
57503 */
57504 uint16_t additional_relax_cr_th;
57505 /*
57506 * If CR is less than or equal to this value,
57507 * then the actual CR average is set to this value
57508 * (shifted by bw_avg_weight).
57509 */
57510 uint16_t cr_min_th;
57511 /* Log based averaging weight for QPC variable actual_cr_avg. */
57512 uint8_t bw_avg_weight;
57513 /*
57514 * Used to compare CR to this factor times QPC.actual_cr_average
57515 * as a reduction reference. Values between 0 and 6 represent factor of
57516 * 1.125, 1.25, 1.5, 1.75, 2, 2.25, 2.5 respectively.
57517 */
57518 uint8_t actual_cr_factor;
57519 /* The level of CR above which CP is set to maximum level. */
57520 uint16_t max_cp_cr_th;
57521 /*
57522 * Enable adding fraction of CR to CP.
57523 * 0 for disable, 1 for enable.
57524 */
57525 uint8_t cp_bias_en;
57526 /* Log based fraction of cr to add to CP when cp_bias_en is 1. */
57527 uint8_t cp_bias;
57528 /*
57529 * The value of ECN bits in a CNP packet generated by hardware.
57530 * ECN-Capabale Transport (ECT) codepoints supported include:
57531 * 0 for not_ect, 1 for ect_0, 2 for ect_1
57532 */
57533 uint8_t cnp_ecn;
57534 /* Not ECN capable Transport */
57535 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_CNP_ECN_NOT_ECT UINT32_C(0x0)
57536 /* ECN Capable Transport-1 */
57537 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_CNP_ECN_ECT_1 UINT32_C(0x1)
57538 /* ECN Capable Transport-0 */
57539 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_CNP_ECN_ECT_0 UINT32_C(0x2)
57540 #define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_CNP_ECN_LAST CMDQ_MODIFY_ROCE_CC_GEN1_TLV_CNP_ECN_ECT_0
57541 /* Enables jitter in RTT. */
57542 uint8_t rtt_jitter_en;
57543 /*
57544 * Number of bytes per usec, dependant on port speed.
57545 * 200 Gbps: 25,000
57546 * 100 Gbps: 12,500
57547 * 50 Gbps: 6,250
57548 * 25 Gbps: 3125
57549 * 10 Gbps: 1250
57550 */
57551 uint16_t link_bytes_per_usec;
57552 /*
57553 * If CR is greater than or equal to this threshold,
57554 * QPC's CC state is reset to its initial state.
57555 */
57556 uint16_t reset_cc_cr_th;
57557 /*
57558 * The number of valid lsbits in CR and TR.
57559 * Supported values include 10 through 14 to support 2^cr_width rate.
57560 */
57561 uint8_t cr_width;
57562 /* Lower end of random selection of quota_period. */
57563 uint8_t quota_period_min;
57564 /* Upper end of random selection of quota_period. */
57565 uint8_t quota_period_max;
57566 /*
57567 * The absolute maximum possible quota_period,
57568 * applicable when rate table for lower 24 levels is used.
57569 */
57570 uint8_t quota_period_abs_max;
57571 /* TR never goes below this level. */
57572 uint16_t tr_lower_bound;
57573 /* Factor on probability threshold for adding 0.5 to CR randomly. */
57574 uint8_t cr_prob_factor;
57575 /* Factor on probability threshold for adding 0.5 to TR randomly. */
57576 uint8_t tr_prob_factor;
57577 /*
57578 * Threshold to ensure fairness between requester and responder.
57579 * If CR is less than the fairness threshold and a quota period has passed
57580 * priority will be given to the path that did not last transfer data.
57581 */
57582 uint16_t fairness_cr_th;
57583 /* Log based rate reduction divider. */
57584 uint8_t red_div;
57585 /* Threshold for rate reductions when CNPS received over last RTT. */
57586 uint8_t cnp_ratio_th;
57587 /*
57588 * Extended number of RTTS to wait, when there is no congestion,
57589 * to start doubling the rate.
57590 */
57591 uint16_t exp_ai_rtts;
57592 /* Log based CR to CP ratio used in exponential increase. */
57593 uint8_t exp_ai_cr_cp_ratio;
57594 /* Enable use of lowest 24 rate levels rate_table. */
57595 uint8_t use_rate_table;
57596 /*
57597 * Determines after how many congestion free RTTs to start
57598 * updating CP to track CR.
57599 */
57600 uint16_t cp_exp_update_th;
57601 /* The threshold on congestion free RTTs above which AI can increase to 16. */
57602 uint16_t high_exp_ai_rtts_th1;
57603 /* The threshold on congestion free RTTs above which AI can increase to 32. */
57604 uint16_t high_exp_ai_rtts_th2;
57605 /*
57606 * The number of congestion free RTTs above which
57607 * reduction based on actual rate is enabled.
57608 */
57609 uint16_t actual_cr_cong_free_rtts_th;
57610 /*
57611 * If rtts_with_cong is greater than 7 (severe congestion) and
57612 * CR level post reduction is above this threshold,
57613 * then TR is capped to 1.5 times CR..
57614 */
57615 uint16_t severe_cong_cr_th1;
57616 /*
57617 * If rtts_with_cong is greater than 7 (severe congestion) and
57618 * CR level post reduction is above this threshold,
57619 * then TR is capped to 1.25 times CR..
57620 */
57621 uint16_t severe_cong_cr_th2;
57622 /*
57623 * The maximum number of 64B that can be transmitted during RTT time,
57624 * including all headers and Inter Packet Gap.
57625 */
57626 uint32_t link64B_per_rtt;
57627 /*
57628 * The number of bytes to subtract from QPC.cc_bucket
57629 * when an ack is scheduled.
57630 */
57631 uint8_t cc_ack_bytes;
57632 /*
57633 * Enables reduction of CR, TR, and CP to init values when
57634 * congestion free RTTs is greater than reduce2_init_cong_free_rtts_th.
57635 */
57636 uint8_t reduce_init_en;
57637 /*
57638 * Minimum threshold value for number of congestion free RTTs before reducing
57639 * to init values for CR, TR, and CP when reduce_init_en is enabled.
57640 */
57641 uint16_t reduce_init_cong_free_rtts_th;
57642 /* Enables random no reduction of CR. */
57643 uint8_t random_no_red_en;
57644 /* Enables coarse correction to actual CR when actual RTT is longer than nominal. */
57645 uint8_t actual_cr_shift_correction_en;
57646 /* Enables adjustment to refill quota. */
57647 uint8_t quota_period_adjust_en;
57648 uint8_t reserved[5];
57649 } cmdq_modify_roce_cc_gen1_tlv_t, *pcmdq_modify_roce_cc_gen1_tlv_t;
57650
57651 /* creq_modify_roce_cc_resp (size:128b/16B) */
57652
57653 typedef struct creq_modify_roce_cc_resp {
57654 uint8_t type;
57655 /*
57656 * This field indicates the exact type of the completion.
57657 * By convention, the LSB identifies the length of the
57658 * record in 16B units. Even values indicate 16B
57659 * records. Odd values indicate 32B
57660 * records.
57661 */
57662 #define CREQ_MODIFY_ROCE_CC_RESP_TYPE_MASK UINT32_C(0x3f)
57663 #define CREQ_MODIFY_ROCE_CC_RESP_TYPE_SFT 0
57664 /* QP Async Notification */
57665 #define CREQ_MODIFY_ROCE_CC_RESP_TYPE_QP_EVENT UINT32_C(0x38)
57666 #define CREQ_MODIFY_ROCE_CC_RESP_TYPE_LAST CREQ_MODIFY_ROCE_CC_RESP_TYPE_QP_EVENT
57667 /* Status of the response. */
57668 uint8_t status;
57669 /* Driver supplied handle to associate the command and the response. */
57670 uint16_t cookie;
57671 uint32_t reserved32;
57672 uint8_t v;
57673 /*
57674 * This value is written by the NIC such that it will be different
57675 * for each pass through the completion queue. The even passes
57676 * will write 1. The odd passes will write 0.
57677 */
57678 #define CREQ_MODIFY_ROCE_CC_RESP_V UINT32_C(0x1)
57679 /* Event or command opcode. */
57680 uint8_t event;
57681 /* Modify congestion control response. */
57682 #define CREQ_MODIFY_ROCE_CC_RESP_EVENT_MODIFY_ROCE_CC UINT32_C(0x8c)
57683 #define CREQ_MODIFY_ROCE_CC_RESP_EVENT_LAST CREQ_MODIFY_ROCE_CC_RESP_EVENT_MODIFY_ROCE_CC
57684 uint8_t reserved48[6];
57685 } creq_modify_roce_cc_resp_t, *pcreq_modify_roce_cc_resp_t;
57686
57687 /******************************
57688 * cmdq_set_link_aggr_mode_cc *
57689 ******************************/
57690
57691
57692 /* cmdq_set_link_aggr_mode_cc (size:320b/40B) */
57693
57694 typedef struct cmdq_set_link_aggr_mode_cc {
57695 /* Command opcode. */
57696 uint8_t opcode;
57697 /* Set LAG mode. */
57698 #define CMDQ_SET_LINK_AGGR_MODE_OPCODE_SET_LINK_AGGR_MODE UINT32_C(0x8f)
57699 #define CMDQ_SET_LINK_AGGR_MODE_OPCODE_LAST CMDQ_SET_LINK_AGGR_MODE_OPCODE_SET_LINK_AGGR_MODE
57700 /* Size of the command in 16-byte units. */
57701 uint8_t cmd_size;
57702 /* Flags and attribs of the command. */
57703 uint16_t flags;
57704 /* Driver supplied handle to associate the command and the response. */
57705 uint16_t cookie;
57706 /* Size of the response buffer in 16-byte units. */
57707 uint8_t resp_size;
57708 uint8_t reserved8;
57709 /* Host address of the response. */
57710 uint64_t resp_addr;
57711 /* Modify mask signifies the field that is requesting the change. */
57712 uint32_t modify_mask;
57713 /* Enable Link aggregation. */
57714 #define CMDQ_SET_LINK_AGGR_MODE_MODIFY_MASK_AGGR_EN UINT32_C(0x1)
57715 /* Bitmap of ports that are eligible to transmit RoCE traffic. */
57716 #define CMDQ_SET_LINK_AGGR_MODE_MODIFY_MASK_ACTIVE_PORT_MAP UINT32_C(0x2)
57717 /* Bitmap of ports that are members of the RoCE LAG. */
57718 #define CMDQ_SET_LINK_AGGR_MODE_MODIFY_MASK_MEMBER_PORT_MAP UINT32_C(0x4)
57719 /* Link aggregation mode being used. */
57720 #define CMDQ_SET_LINK_AGGR_MODE_MODIFY_MASK_AGGR_MODE UINT32_C(0x8)
57721 /* Stat context ID for all the ports. */
57722 #define CMDQ_SET_LINK_AGGR_MODE_MODIFY_MASK_STAT_CTX_ID UINT32_C(0x10)
57723 uint8_t aggr_enable;
57724 /* Enable Link aggregation. */
57725 #define CMDQ_SET_LINK_AGGR_MODE_AGGR_ENABLE UINT32_C(0x1)
57726 /* rsvd1 is 7 b */
57727 #define CMDQ_SET_LINK_AGGR_MODE_RSVD1_MASK UINT32_C(0xfe)
57728 #define CMDQ_SET_LINK_AGGR_MODE_RSVD1_SFT 1
57729 uint8_t active_port_map;
57730 /* Bitmap of ports that are eligible to transmit RoCE traffic. */
57731 #define CMDQ_SET_LINK_AGGR_MODE_ACTIVE_PORT_MAP_MASK UINT32_C(0xf)
57732 #define CMDQ_SET_LINK_AGGR_MODE_ACTIVE_PORT_MAP_SFT 0
57733 /* rsvd2 is 4 b */
57734 #define CMDQ_SET_LINK_AGGR_MODE_RSVD2_MASK UINT32_C(0xf0)
57735 #define CMDQ_SET_LINK_AGGR_MODE_RSVD2_SFT 4
57736 /* Bitmap of ports that are members of the RoCE LAG. */
57737 uint8_t member_port_map;
57738 /* Link aggregation mode being used. */
57739 uint8_t link_aggr_mode;
57740 /* active active mode. */
57741 #define CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_ACTIVE_ACTIVE UINT32_C(0x1)
57742 /* active backup mode. */
57743 #define CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_ACTIVE_BACKUP UINT32_C(0x2)
57744 /* Balance XOR mode. */
57745 #define CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_BALANCE_XOR UINT32_C(0x3)
57746 /* 802.3AD mode. */
57747 #define CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_802_3_AD UINT32_C(0x4)
57748 #define CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_LAST CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_802_3_AD
57749 /* Stat context IDs for all 4 ports. */
57750 uint16_t stat_ctx_id[4];
57751 uint64_t rsvd1;
57752 } cmdq_set_link_aggr_mode_cc_t, *pcmdq_set_link_aggr_mode_cc_t;
57753
57754 /* creq_set_link_aggr_mode_resources_resp (size:128b/16B) */
57755
57756 typedef struct creq_set_link_aggr_mode_resources_resp {
57757 uint8_t type;
57758 /*
57759 * This field indicates the exact type of the completion.
57760 * By convention, the LSB identifies the length of the
57761 * record in 16B units. Even values indicate 16B
57762 * records. Odd values indicate 32B
57763 * records.
57764 */
57765 #define CREQ_SET_LINK_AGGR_MODE_RESP_TYPE_MASK UINT32_C(0x3f)
57766 #define CREQ_SET_LINK_AGGR_MODE_RESP_TYPE_SFT 0
57767 /* QP Async Notification */
57768 #define CREQ_SET_LINK_AGGR_MODE_RESP_TYPE_QP_EVENT UINT32_C(0x38)
57769 #define CREQ_SET_LINK_AGGR_MODE_RESP_TYPE_LAST CREQ_SET_LINK_AGGR_MODE_RESP_TYPE_QP_EVENT
57770 /* Status of the response. */
57771 uint8_t status;
57772 /* Driver supplied handle to associate the command and the response. */
57773 uint16_t cookie;
57774 uint32_t reserved32;
57775 uint8_t v;
57776 /*
57777 * This value is written by the NIC such that it will be different
57778 * for each pass through the completion queue. The even passes
57779 * will write 1. The odd passes will write 0.
57780 */
57781 #define CREQ_SET_LINK_AGGR_MODE_RESP_V UINT32_C(0x1)
57782 /* Event or command opcode. */
57783 uint8_t event;
57784 /* Set LAG mode. */
57785 #define CREQ_SET_LINK_AGGR_MODE_RESP_EVENT_SET_LINK_AGGR_MODE UINT32_C(0x8f)
57786 #define CREQ_SET_LINK_AGGR_MODE_RESP_EVENT_LAST CREQ_SET_LINK_AGGR_MODE_RESP_EVENT_SET_LINK_AGGR_MODE
57787 uint8_t reserved48[6];
57788 } creq_set_link_aggr_mode_resources_resp_t, *pcreq_set_link_aggr_mode_resources_resp_t;
57789
57790 /* Send a request from VF to pass a command to the PF. VF HSI is suspended. */
57791 /* cmdq_vf_backchannel_request (size:256b/32B) */
57792
57793 typedef struct cmdq_vf_backchannel_request {
57794 /* Command opcode. */
57795 uint8_t opcode;
57796 /* Send a request from VF to pass a command to the PF. VF HSI is suspended until the PF returns the response */
57797 #define CMDQ_VF_BACKCHANNEL_REQUEST_OPCODE_VF_BACKCHANNEL_REQUEST UINT32_C(0x86)
57798 #define CMDQ_VF_BACKCHANNEL_REQUEST_OPCODE_LAST CMDQ_VF_BACKCHANNEL_REQUEST_OPCODE_VF_BACKCHANNEL_REQUEST
57799 /* Size of the command in 16-byte units. */
57800 uint8_t cmd_size;
57801 /* Flags and attribs of the command. */
57802 uint16_t flags;
57803 /* Driver supplied handle to associate the command and the response. */
57804 uint16_t cookie;
57805 /* Size of the response buffer in 16-byte units. */
57806 uint8_t resp_size;
57807 uint8_t reserved8;
57808 /* Host address of the response. */
57809 uint64_t resp_addr;
57810 /* Address of command request structure in VF space */
57811 uint64_t command_addr;
57812 /* Command request length (up to 4K). An optional address of the extended response buffer should be provided in the request */
57813 uint16_t command_length;
57814 uint8_t unused_0[6];
57815 } cmdq_vf_backchannel_request_t, *pcmdq_vf_backchannel_request_t;
57816
57817 /* Read VF memory (primarily to get the backchannel request blob). */
57818 /* cmdq_read_vf_memory (size:256b/32B) */
57819
57820 typedef struct cmdq_read_vf_memory {
57821 /* Command opcode. */
57822 uint8_t opcode;
57823 /* Read VF memory (primarily to get the backchannel request blob). Can only be issued from a PF. */
57824 #define CMDQ_READ_VF_MEMORY_OPCODE_READ_VF_MEMORY UINT32_C(0x87)
57825 #define CMDQ_READ_VF_MEMORY_OPCODE_LAST CMDQ_READ_VF_MEMORY_OPCODE_READ_VF_MEMORY
57826 /* Size of the command in 16-byte units. */
57827 uint8_t cmd_size;
57828 /* Flags and attribs of the command. */
57829 uint16_t flags;
57830 /* Driver supplied handle to associate the command and the response. */
57831 uint16_t cookie;
57832 /* Size of the response buffer in 16-byte units. */
57833 uint8_t resp_size;
57834 uint8_t reserved8;
57835 /* Host address of the response. */
57836 uint64_t resp_addr;
57837 /* Address of memory in VF space to read */
57838 uint64_t addr;
57839 /* VF id, as provided in 0xC0 VF request notification */
57840 uint16_t vf_id;
57841 /* Length to read, up to 4K */
57842 uint16_t length;
57843 uint32_t unused_0;
57844 } cmdq_read_vf_memory_t, *pcmdq_read_vf_memory_t;
57845
57846 /* Write VF memory (primarily to put the backchannel response blob). */
57847 /* cmdq_complete_vf_request (size:320b/40B) */
57848
57849 typedef struct cmdq_complete_vf_request {
57850 /* Command opcode. */
57851 uint8_t opcode;
57852 /* Write VF memory (primarily to put the backchannel response blob), and reenable VF HSI (post a CAG completion to it). Can only be issued from a PF. */
57853 #define CMDQ_COMPLETE_VF_REQUEST_OPCODE_COMPLETE_VF_REQUEST UINT32_C(0x88)
57854 #define CMDQ_COMPLETE_VF_REQUEST_OPCODE_LAST CMDQ_COMPLETE_VF_REQUEST_OPCODE_COMPLETE_VF_REQUEST
57855 /* Size of the command in 16-byte units. */
57856 uint8_t cmd_size;
57857 /* Flags and attribs of the command. */
57858 uint16_t flags;
57859 /* Driver supplied handle to associate the command and the response. */
57860 uint16_t cookie;
57861 /* Size of the response buffer in 16-byte units. */
57862 uint8_t resp_size;
57863 uint8_t reserved8;
57864 /* Host address of the response. */
57865 uint64_t resp_addr;
57866 /* Optional address of extended response in VF space to write. Length is in resp_size in 16 byte units. */
57867 uint64_t addr;
57868 /* Completion misc field to VF CREQ */
57869 uint32_t vf_misc;
57870 /* VF id, as provided in 0xC0 VF request notification */
57871 uint16_t vf_id;
57872 /* Completion cookie for the VF command, goes to VF CREQ */
57873 uint16_t vf_cookie;
57874 /* Completion status for the VF command, goes to VF CREQ */
57875 uint8_t vf_status;
57876 uint8_t unused_0[3];
57877 uint32_t unused_1;
57878 } cmdq_complete_vf_request_t, *pcmdq_complete_vf_request_t;
57879
57880 /* RoCE function async event notifications. */
57881 /* creq_func_event (size:128b/16B) */
57882
57883 typedef struct creq_func_event {
57884 uint8_t type;
57885 /*
57886 * This field indicates the exact type of the completion.
57887 * By convention, the LSB identifies the length of the
57888 * record in 16B units. Even values indicate 16B
57889 * records. Odd values indicate 32B
57890 * records.
57891 */
57892 #define CREQ_FUNC_EVENT_TYPE_MASK UINT32_C(0x3f)
57893 #define CREQ_FUNC_EVENT_TYPE_SFT 0
57894 /* Function Async Notification */
57895 #define CREQ_FUNC_EVENT_TYPE_FUNC_EVENT UINT32_C(0x3a)
57896 #define CREQ_FUNC_EVENT_TYPE_LAST CREQ_FUNC_EVENT_TYPE_FUNC_EVENT
57897 uint8_t reserved56[7];
57898 uint8_t v;
57899 /*
57900 * This value is written by the NIC such that it will be different
57901 * for each pass through the completion queue. The even passes
57902 * will write 1. The odd passes will write 0.
57903 */
57904 #define CREQ_FUNC_EVENT_V UINT32_C(0x1)
57905 /*
57906 * This value defines what type of async event has occurred
57907 * on the function.
57908 */
57909 uint8_t event;
57910 /*
57911 * Invalid PBL or PCIE UR response occurred
57912 * in SQ WQE or IRRQ read access.
57913 */
57914 #define CREQ_FUNC_EVENT_EVENT_TX_WQE_ERROR UINT32_C(0x1)
57915 /*
57916 * Invalid PBL or PCIE UR response occurred
57917 * during data read access.
57918 */
57919 #define CREQ_FUNC_EVENT_EVENT_TX_DATA_ERROR UINT32_C(0x2)
57920 /*
57921 * Invalid PBL or PCIE UR response occurred
57922 * in RQ/SRQ WQE or ORRQ read access.
57923 */
57924 #define CREQ_FUNC_EVENT_EVENT_RX_WQE_ERROR UINT32_C(0x3)
57925 /* Invalid PBL occurred during data write access. */
57926 #define CREQ_FUNC_EVENT_EVENT_RX_DATA_ERROR UINT32_C(0x4)
57927 /* Invalid PBL occurred during CQ write access. */
57928 #define CREQ_FUNC_EVENT_EVENT_CQ_ERROR UINT32_C(0x5)
57929 /*
57930 * Invalid PBL or PCIE UR response occurred in TQM
57931 * read access.
57932 */
57933 #define CREQ_FUNC_EVENT_EVENT_TQM_ERROR UINT32_C(0x6)
57934 /* PCIE UR response occurred in CFC read access. */
57935 #define CREQ_FUNC_EVENT_EVENT_CFCQ_ERROR UINT32_C(0x7)
57936 /* PCIE UR response occurred in CFC read access. */
57937 #define CREQ_FUNC_EVENT_EVENT_CFCS_ERROR UINT32_C(0x8)
57938 /* PCIE UR response occurred in CFC read access. */
57939 #define CREQ_FUNC_EVENT_EVENT_CFCC_ERROR UINT32_C(0x9)
57940 /* PCIE UR response occurred in CFC read access. */
57941 #define CREQ_FUNC_EVENT_EVENT_CFCM_ERROR UINT32_C(0xa)
57942 /*
57943 * Invalid PBL or
57944 * PCIE UR response
57945 * occurred on timer read access.
57946 */
57947 #define CREQ_FUNC_EVENT_EVENT_TIM_ERROR UINT32_C(0xb)
57948 /* A VF sent a backchannel command request */
57949 #define CREQ_FUNC_EVENT_EVENT_VF_COMM_REQUEST UINT32_C(0x80)
57950 /* Communication resource (QPC, CQ, SRQ, MRW) exhausted, and resource array extension is enabled */
57951 #define CREQ_FUNC_EVENT_EVENT_RESOURCE_EXHAUSTED UINT32_C(0x81)
57952 #define CREQ_FUNC_EVENT_EVENT_LAST CREQ_FUNC_EVENT_EVENT_RESOURCE_EXHAUSTED
57953 uint8_t reserved48[6];
57954 } creq_func_event_t, *pcreq_func_event_t;
57955
57956 /* RoCE slowpath command completion events. */
57957 /* creq_qp_event (size:128b/16B) */
57958
57959 typedef struct creq_qp_event {
57960 uint8_t type;
57961 /*
57962 * This field indicates the exact type of the completion.
57963 * By convention, the LSB identifies the length of the
57964 * record in 16B units. Even values indicate 16B
57965 * records. Odd values indicate 32B
57966 * records.
57967 */
57968 #define CREQ_QP_EVENT_TYPE_MASK UINT32_C(0x3f)
57969 #define CREQ_QP_EVENT_TYPE_SFT 0
57970 /* QP Async Notification */
57971 #define CREQ_QP_EVENT_TYPE_QP_EVENT UINT32_C(0x38)
57972 #define CREQ_QP_EVENT_TYPE_LAST CREQ_QP_EVENT_TYPE_QP_EVENT
57973 /* Status of the response. */
57974 uint8_t status;
57975 /* Success. */
57976 #define CREQ_QP_EVENT_STATUS_SUCCESS UINT32_C(0x0)
57977 /* Fail. */
57978 #define CREQ_QP_EVENT_STATUS_FAIL UINT32_C(0x1)
57979 /* Resources. */
57980 #define CREQ_QP_EVENT_STATUS_RESOURCES UINT32_C(0x2)
57981 /* Invalid command. */
57982 #define CREQ_QP_EVENT_STATUS_INVALID_CMD UINT32_C(0x3)
57983 /* Not implemented. */
57984 #define CREQ_QP_EVENT_STATUS_NOT_IMPLEMENTED UINT32_C(0x4)
57985 /* Invalid parameter. */
57986 #define CREQ_QP_EVENT_STATUS_INVALID_PARAMETER UINT32_C(0x5)
57987 /* Hardware operation failed. */
57988 #define CREQ_QP_EVENT_STATUS_HARDWARE_ERROR UINT32_C(0x6)
57989 /* Firmware operation failed due to internal error. */
57990 #define CREQ_QP_EVENT_STATUS_INTERNAL_ERROR UINT32_C(0x7)
57991 #define CREQ_QP_EVENT_STATUS_LAST CREQ_QP_EVENT_STATUS_INTERNAL_ERROR
57992 /* Driver supplied handle to associate the command and the response. */
57993 uint16_t cookie;
57994 uint32_t reserved32;
57995 uint8_t v;
57996 /*
57997 * This value is written by the NIC such that it will be different
57998 * for each pass through the completion queue. The even passes
57999 * will write 1. The odd passes will write 0.
58000 */
58001 #define CREQ_QP_EVENT_V UINT32_C(0x1)
58002 /* Event or command opcode. */
58003 uint8_t event;
58004 /* Create QP command response. */
58005 #define CREQ_QP_EVENT_EVENT_CREATE_QP UINT32_C(0x1)
58006 /* Destroy QP command response. */
58007 #define CREQ_QP_EVENT_EVENT_DESTROY_QP UINT32_C(0x2)
58008 /* Modify QP command response. */
58009 #define CREQ_QP_EVENT_EVENT_MODIFY_QP UINT32_C(0x3)
58010 /* Query QP command response. */
58011 #define CREQ_QP_EVENT_EVENT_QUERY_QP UINT32_C(0x4)
58012 /* Create SRQ command response. */
58013 #define CREQ_QP_EVENT_EVENT_CREATE_SRQ UINT32_C(0x5)
58014 /* Destroy SRQ command response. */
58015 #define CREQ_QP_EVENT_EVENT_DESTROY_SRQ UINT32_C(0x6)
58016 /* Query SRQ command response. */
58017 #define CREQ_QP_EVENT_EVENT_QUERY_SRQ UINT32_C(0x8)
58018 /* Create CQ command response. */
58019 #define CREQ_QP_EVENT_EVENT_CREATE_CQ UINT32_C(0x9)
58020 /* Destroy CQ command response. */
58021 #define CREQ_QP_EVENT_EVENT_DESTROY_CQ UINT32_C(0xa)
58022 /* Resize CQ command response. */
58023 #define CREQ_QP_EVENT_EVENT_RESIZE_CQ UINT32_C(0xc)
58024 /* Allocate MRW command response. */
58025 #define CREQ_QP_EVENT_EVENT_ALLOCATE_MRW UINT32_C(0xd)
58026 /* De-allocate key command response. */
58027 #define CREQ_QP_EVENT_EVENT_DEALLOCATE_KEY UINT32_C(0xe)
58028 /* Register MR command response. */
58029 #define CREQ_QP_EVENT_EVENT_REGISTER_MR UINT32_C(0xf)
58030 /* Deregister MR command response. */
58031 #define CREQ_QP_EVENT_EVENT_DEREGISTER_MR UINT32_C(0x10)
58032 /* Add GID command response. */
58033 #define CREQ_QP_EVENT_EVENT_ADD_GID UINT32_C(0x11)
58034 /* Delete GID command response. */
58035 #define CREQ_QP_EVENT_EVENT_DELETE_GID UINT32_C(0x12)
58036 /* Modify GID command response. */
58037 #define CREQ_QP_EVENT_EVENT_MODIFY_GID UINT32_C(0x17)
58038 /* Query GID command response. */
58039 #define CREQ_QP_EVENT_EVENT_QUERY_GID UINT32_C(0x18)
58040 /* Create QP1 command response. */
58041 #define CREQ_QP_EVENT_EVENT_CREATE_QP1 UINT32_C(0x13)
58042 /* Destroy QP1 command response. */
58043 #define CREQ_QP_EVENT_EVENT_DESTROY_QP1 UINT32_C(0x14)
58044 /* Create AH command response. */
58045 #define CREQ_QP_EVENT_EVENT_CREATE_AH UINT32_C(0x15)
58046 /* Destroy AH command response. */
58047 #define CREQ_QP_EVENT_EVENT_DESTROY_AH UINT32_C(0x16)
58048 /* Initialize firmware command response. */
58049 #define CREQ_QP_EVENT_EVENT_INITIALIZE_FW UINT32_C(0x80)
58050 /* De-initialize firmware command response. */
58051 #define CREQ_QP_EVENT_EVENT_DEINITIALIZE_FW UINT32_C(0x81)
58052 /* Stop PF command response. */
58053 #define CREQ_QP_EVENT_EVENT_STOP_FUNC UINT32_C(0x82)
58054 /* Query info PF command response. */
58055 #define CREQ_QP_EVENT_EVENT_QUERY_FUNC UINT32_C(0x83)
58056 /* Set function resources command response. */
58057 #define CREQ_QP_EVENT_EVENT_SET_FUNC_RESOURCES UINT32_C(0x84)
58058 /* Read the current state of any internal resource context. Can only be issued from a PF. */
58059 #define CREQ_QP_EVENT_EVENT_READ_CONTEXT UINT32_C(0x85)
58060 /* Map TC to COS response. */
58061 #define CREQ_QP_EVENT_EVENT_MAP_TC_TO_COS UINT32_C(0x8a)
58062 /* Query firmware and interface version response. */
58063 #define CREQ_QP_EVENT_EVENT_QUERY_VERSION UINT32_C(0x8b)
58064 /* Modify congestion control response. */
58065 #define CREQ_QP_EVENT_EVENT_MODIFY_CC UINT32_C(0x8c)
58066 /* Query congestion control response. */
58067 #define CREQ_QP_EVENT_EVENT_QUERY_CC UINT32_C(0x8d)
58068 /* Query RoCE statistics. */
58069 #define CREQ_QP_EVENT_EVENT_QUERY_ROCE_STATS UINT32_C(0x8e)
58070 /* Set LAG mode. */
58071 #define CREQ_QP_EVENT_EVENT_SET_LINK_AGGR_MODE UINT32_C(0x8f)
58072 /*
58073 * Query QP for a PF other than the requesting PF. Also can query for more
58074 * than one QP.
58075 */
58076 #define CREQ_QP_EVENT_EVENT_QUERY_QP_EXTEND UINT32_C(0x91)
58077 /* QP error notification event. */
58078 #define CREQ_QP_EVENT_EVENT_QP_ERROR_NOTIFICATION UINT32_C(0xc0)
58079 /* CQ error notification event. */
58080 #define CREQ_QP_EVENT_EVENT_CQ_ERROR_NOTIFICATION UINT32_C(0xc1)
58081 #define CREQ_QP_EVENT_EVENT_LAST CREQ_QP_EVENT_EVENT_CQ_ERROR_NOTIFICATION
58082 uint8_t reserved48[6];
58083 } creq_qp_event_t, *pcreq_qp_event_t;
58084
58085 /* QP error notification event. */
58086 /* creq_qp_error_notification (size:128b/16B) */
58087
58088 typedef struct creq_qp_error_notification {
58089 uint8_t type;
58090 /*
58091 * This field indicates the exact type of the completion.
58092 * By convention, the LSB identifies the length of the
58093 * record in 16B units. Even values indicate 16B
58094 * records. Odd values indicate 32B
58095 * records.
58096 */
58097 #define CREQ_QP_ERROR_NOTIFICATION_TYPE_MASK UINT32_C(0x3f)
58098 #define CREQ_QP_ERROR_NOTIFICATION_TYPE_SFT 0
58099 /* QP Async Notification */
58100 #define CREQ_QP_ERROR_NOTIFICATION_TYPE_QP_EVENT UINT32_C(0x38)
58101 #define CREQ_QP_ERROR_NOTIFICATION_TYPE_LAST CREQ_QP_ERROR_NOTIFICATION_TYPE_QP_EVENT
58102 /* Status of the response. */
58103 uint8_t status;
58104 /* requestor slow path state */
58105 uint8_t req_slow_path_state;
58106 /* requestor error reason */
58107 uint8_t req_err_state_reason;
58108 /* QP context id */
58109 uint32_t xid;
58110 uint8_t v;
58111 /*
58112 * This value is written by the NIC such that it will be different
58113 * for each pass through the completion queue. The even passes
58114 * will write 1. The odd passes will write 0.
58115 */
58116 #define CREQ_QP_ERROR_NOTIFICATION_V UINT32_C(0x1)
58117 /* Event or command opcode. */
58118 uint8_t event;
58119 /* QP error notification event. */
58120 #define CREQ_QP_ERROR_NOTIFICATION_EVENT_QP_ERROR_NOTIFICATION UINT32_C(0xc0)
58121 #define CREQ_QP_ERROR_NOTIFICATION_EVENT_LAST CREQ_QP_ERROR_NOTIFICATION_EVENT_QP_ERROR_NOTIFICATION
58122 /* responder slow path state */
58123 uint8_t res_slow_path_state;
58124 uint8_t res_err_state_reason;
58125 /*
58126 * Final SQ Consumer Index value. Any additional SQ WQEs will
58127 * have to be completed by the user provider.
58128 */
58129 uint16_t sq_cons_idx;
58130 /*
58131 * Final RQ Consumer Index value. Any additional RQ WQEs will
58132 * have to be completed by the user provider.
58133 */
58134 uint16_t rq_cons_idx;
58135 } creq_qp_error_notification_t, *pcreq_qp_error_notification_t;
58136
58137 /* CQ error notification event. */
58138 /* creq_cq_error_notification (size:128b/16B) */
58139
58140 typedef struct creq_cq_error_notification {
58141 uint8_t type;
58142 /*
58143 * This field indicates the exact type of the completion.
58144 * By convention, the LSB identifies the length of the
58145 * record in 16B units. Even values indicate 16B
58146 * records. Odd values indicate 32B
58147 * records.
58148 */
58149 #define CREQ_CQ_ERROR_NOTIFICATION_TYPE_MASK UINT32_C(0x3f)
58150 #define CREQ_CQ_ERROR_NOTIFICATION_TYPE_SFT 0
58151 /* CQ Async Notification */
58152 #define CREQ_CQ_ERROR_NOTIFICATION_TYPE_CQ_EVENT UINT32_C(0x38)
58153 #define CREQ_CQ_ERROR_NOTIFICATION_TYPE_LAST CREQ_CQ_ERROR_NOTIFICATION_TYPE_CQ_EVENT
58154 /* Status of the response. */
58155 uint8_t status;
58156 /* CQ error reason code. */
58157 uint8_t cq_err_reason;
58158 /* Requester completion error for invalid CQ state. */
58159 #define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_REQ_CQ_INVALID_ERROR UINT32_C(0x1)
58160 /* Requester completion error for CQ overflow. */
58161 #define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_REQ_CQ_OVERFLOW_ERROR UINT32_C(0x2)
58162 /* Attempt to load CQ context resulted in error. */
58163 #define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_REQ_CQ_LOAD_ERROR UINT32_C(0x3)
58164 /* Responder completion error for invalid CQ state. */
58165 #define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_RES_CQ_INVALID_ERROR UINT32_C(0x4)
58166 /* Responder completion error for CQ overflow. */
58167 #define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_RES_CQ_OVERFLOW_ERROR UINT32_C(0x5)
58168 /* Attempt to load CQ context resulted in error. */
58169 #define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_RES_CQ_LOAD_ERROR UINT32_C(0x6)
58170 #define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_LAST CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_RES_CQ_LOAD_ERROR
58171 uint8_t reserved8;
58172 /* CQ context id */
58173 uint32_t xid;
58174 uint8_t v;
58175 /*
58176 * This value is written by the NIC such that it will be different
58177 * for each pass through the completion queue. The even passes
58178 * will write 1. The odd passes will write 0.
58179 */
58180 #define CREQ_CQ_ERROR_NOTIFICATION_V UINT32_C(0x1)
58181 /* Event or command opcode. */
58182 uint8_t event;
58183 /* CQ error notification event. */
58184 #define CREQ_CQ_ERROR_NOTIFICATION_EVENT_CQ_ERROR_NOTIFICATION UINT32_C(0xc1)
58185 #define CREQ_CQ_ERROR_NOTIFICATION_EVENT_LAST CREQ_CQ_ERROR_NOTIFICATION_EVENT_CQ_ERROR_NOTIFICATION
58186 uint8_t reserved48[6];
58187 } creq_cq_error_notification_t, *pcreq_cq_error_notification_t;
58188
58189 /* sq_base (size:64b/8B) */
58190
58191 typedef struct sq_base {
58192 /* This field defines the type of SQ WQE. */
58193 uint8_t wqe_type;
58194 /* Send */
58195 #define SQ_BASE_WQE_TYPE_SEND UINT32_C(0x0)
58196 /*
58197 * Send with Immediate
58198 *
58199 * Allowed only on reliable connection (RC) and
58200 * unreliable datagram (UD) SQs.
58201 */
58202 #define SQ_BASE_WQE_TYPE_SEND_W_IMMEAD UINT32_C(0x1)
58203 /*
58204 * Send with Invalidate.
58205 *
58206 * Allowed only on reliable connection (RC) SQs.
58207 */
58208 #define SQ_BASE_WQE_TYPE_SEND_W_INVALID UINT32_C(0x2)
58209 /*
58210 * RDMA Write.
58211 *
58212 * Allowed only on reliable connection (RC) SQs.
58213 */
58214 #define SQ_BASE_WQE_TYPE_WRITE_WQE UINT32_C(0x4)
58215 /*
58216 * RDMA Write with Immediate.
58217 *
58218 * Allowed only on reliable connection (RC) SQs.
58219 */
58220 #define SQ_BASE_WQE_TYPE_WRITE_W_IMMEAD UINT32_C(0x5)
58221 /*
58222 * RDMA Read.
58223 *
58224 * Allowed only on reliable connection (RC) SQs.
58225 */
58226 #define SQ_BASE_WQE_TYPE_READ_WQE UINT32_C(0x6)
58227 /*
58228 * Atomic Compare/Swap.
58229 *
58230 * Allowed only on reliable connection (RC) SQs.
58231 */
58232 #define SQ_BASE_WQE_TYPE_ATOMIC_CS UINT32_C(0x8)
58233 /*
58234 * Atomic Fetch/Add.
58235 *
58236 * Allowed only on reliable connection (RC) SQs.
58237 */
58238 #define SQ_BASE_WQE_TYPE_ATOMIC_FA UINT32_C(0xb)
58239 /*
58240 * Local Invalidate.
58241 *
58242 * Allowed only on reliable connection (RC) SQs.
58243 */
58244 #define SQ_BASE_WQE_TYPE_LOCAL_INVALID UINT32_C(0xc)
58245 /*
58246 * FR-PMR (Fast Register Physical Memory Region)
58247 *
58248 * Allowed only on reliable connection (RC) SQs.
58249 */
58250 #define SQ_BASE_WQE_TYPE_FR_PMR UINT32_C(0xd)
58251 /*
58252 * Memory Bind
58253 *
58254 * Allowed only on reliable connection (RC) SQs.
58255 */
58256 #define SQ_BASE_WQE_TYPE_BIND UINT32_C(0xe)
58257 /*
58258 * FR-PPMR (Fast Register Proxy Physical Memory Region)
58259 *
58260 * Allowed only on reliable connection (RC) SQs.
58261 */
58262 #define SQ_BASE_WQE_TYPE_FR_PPMR UINT32_C(0xf)
58263 #define SQ_BASE_WQE_TYPE_LAST SQ_BASE_WQE_TYPE_FR_PPMR
58264 uint8_t unused_0[7];
58265 } sq_base_t, *psq_base_t;
58266
58267 /* sq_sge (size:128b/16B) */
58268
58269 typedef struct sq_sge {
58270 /*
58271 * The virtual address in local memory or a physical address
58272 * when l_key value is a reserved value of a physical address.
58273 * Driver configures this value in the chip and the chip compares
58274 * l_key in SGEs with that reserved value, if equal it access
58275 * the physical address specified. The chip however MUST verify
58276 * that the QP allows the use reserved key.
58277 */
58278 uint64_t va_or_pa;
58279 /*
58280 * Local Key associated with this registered MR; The 24 msb of
58281 * the key used to index the MRW Table and the 8 lsb are compared
58282 * with the 8 bits key part stored in the MRWC. The PBL in the
58283 * MRW Context is used to translate the above VA to physical
58284 * address.
58285 */
58286 uint32_t l_key;
58287 /*
58288 * Size of SGE in bytes; Based on page size of the system the
58289 * chip knows how many entries are in the PBL
58290 */
58291 uint32_t size;
58292 } sq_sge_t, *psq_sge_t;
58293
58294 /* sq_psn_search (size:64b/8B) */
58295
58296 typedef struct sq_psn_search {
58297 /* Start PSN. */
58298 uint32_t opcode_start_psn;
58299 /* Start PSN. */
58300 #define SQ_PSN_SEARCH_START_PSN_MASK UINT32_C(0xffffff)
58301 #define SQ_PSN_SEARCH_START_PSN_SFT 0
58302 /* The opcodes are software defined. */
58303 #define SQ_PSN_SEARCH_OPCODE_MASK UINT32_C(0xff000000)
58304 #define SQ_PSN_SEARCH_OPCODE_SFT 24
58305 uint32_t flags_next_psn;
58306 /* Next PSN. Equal to the start PSN of the next WQE. */
58307 #define SQ_PSN_SEARCH_NEXT_PSN_MASK UINT32_C(0xffffff)
58308 #define SQ_PSN_SEARCH_NEXT_PSN_SFT 0
58309 /* Opcode specific flags. */
58310 #define SQ_PSN_SEARCH_FLAGS_MASK UINT32_C(0xff000000)
58311 #define SQ_PSN_SEARCH_FLAGS_SFT 24
58312 } sq_psn_search_t, *psq_psn_search_t;
58313
58314 /* This PSN table structure is used only on devices where variable size WQEs are supported. */
58315 /* sq_psn_search_ext (size:128b/16B) */
58316
58317 typedef struct sq_psn_search_ext {
58318 /* Start PSN. */
58319 uint32_t opcode_start_psn;
58320 /* Start PSN. */
58321 #define SQ_PSN_SEARCH_EXT_START_PSN_MASK UINT32_C(0xffffff)
58322 #define SQ_PSN_SEARCH_EXT_START_PSN_SFT 0
58323 /* The opcodes are software defined. */
58324 #define SQ_PSN_SEARCH_EXT_OPCODE_MASK UINT32_C(0xff000000)
58325 #define SQ_PSN_SEARCH_EXT_OPCODE_SFT 24
58326 uint32_t flags_next_psn;
58327 /* Next PSN. Equal to the start PSN of the next WQE. */
58328 #define SQ_PSN_SEARCH_EXT_NEXT_PSN_MASK UINT32_C(0xffffff)
58329 #define SQ_PSN_SEARCH_EXT_NEXT_PSN_SFT 0
58330 /* Opcode specific flags. */
58331 #define SQ_PSN_SEARCH_EXT_FLAGS_MASK UINT32_C(0xff000000)
58332 #define SQ_PSN_SEARCH_EXT_FLAGS_SFT 24
58333 /*
58334 * This field is used only when variable sized WQEs are being used.
58335 * This indicates the starting slot index of the corresponding WQE.
58336 */
58337 uint16_t start_slot_idx;
58338 /* reserved16 is 16 b */
58339 uint16_t reserved16;
58340 /* reserved32 is 32 b */
58341 uint32_t reserved32;
58342 } sq_psn_search_ext_t, *psq_psn_search_ext_t;
58343
58344 /* Send SQ WQE */
58345 /* sq_send (size:1024b/128B) */
58346
58347 typedef struct sq_send {
58348 /* This field defines the type of SQ WQE. */
58349 uint8_t wqe_type;
58350 /* Send */
58351 #define SQ_SEND_WQE_TYPE_SEND UINT32_C(0x0)
58352 /*
58353 * Send with Immediate
58354 *
58355 * Allowed only on reliable connection (RC) and
58356 * unreliable datagram (UD) SQs.
58357 */
58358 #define SQ_SEND_WQE_TYPE_SEND_W_IMMEAD UINT32_C(0x1)
58359 /*
58360 * Send with Invalidate.
58361 *
58362 * Allowed only on reliable connection (RC) SQs.
58363 */
58364 #define SQ_SEND_WQE_TYPE_SEND_W_INVALID UINT32_C(0x2)
58365 #define SQ_SEND_WQE_TYPE_LAST SQ_SEND_WQE_TYPE_SEND_W_INVALID
58366 uint8_t flags;
58367 #define SQ_SEND_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK UINT32_C(0xff)
58368 #define SQ_SEND_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT 0
58369 /*
58370 * Set if completion signaling is requested. If this bit is
58371 * 0, and the SQ is configured to support Unsignaled completion
58372 * the controller should not generate a CQE unless there was
58373 * an error. This refers to the CQE on the sender side. (The se
58374 * flag refers to the receiver side).
58375 */
58376 #define SQ_SEND_FLAGS_SIGNAL_COMP UINT32_C(0x1)
58377 /*
58378 * Indication to complete all previous RDMA Read or Atomic WQEs
58379 * on the SQ before executing this WQE.
58380 *
58381 * This flag must be zero for a UD send.
58382 */
58383 #define SQ_SEND_FLAGS_RD_OR_ATOMIC_FENCE UINT32_C(0x2)
58384 /*
58385 * For local invalidate request. Indication to complete all
58386 * previous SQ's WQEs before executing this WQE.
58387 *
58388 * This flag must be zero for a UD send.
58389 */
58390 #define SQ_SEND_FLAGS_UC_FENCE UINT32_C(0x4)
58391 /*
58392 * Solicit event flag. Indication sent in BTH header to the
58393 * receiver to generate a Completion Event Notification, i.e.
58394 * CNQE. This bit should be set only in the last (or only) packet
58395 * of the message.
58396 */
58397 #define SQ_SEND_FLAGS_SE UINT32_C(0x8)
58398 /*
58399 * Indicate that inline data is posted to the SQ in the data
58400 * area of this WQE.
58401 */
58402 #define SQ_SEND_FLAGS_INLINE UINT32_C(0x10)
58403 /*
58404 * If set to 1, then the timestamp from the WQE is used. If
58405 * cleared to 0, then TWE provides the timestamp.
58406 */
58407 #define SQ_SEND_FLAGS_WQE_TS_EN UINT32_C(0x20)
58408 /*
58409 * When set to '1', this operation will cause a trace capture in
58410 * each block it passes through.
58411 */
58412 #define SQ_SEND_FLAGS_DEBUG_TRACE UINT32_C(0x40)
58413 /*
58414 * The number of 16 bytes chunks of data including this first
58415 * word of the request that are a valid part of the request. The
58416 * valid 16 bytes units other than the WQE structure can be
58417 * SGEs (Scatter Gather Elements) OR inline data.
58418 *
58419 * While this field defines the valid WQE size. The actual
58420 * total WQE size is always 128B.
58421 */
58422 uint8_t wqe_size;
58423 uint8_t reserved8_1;
58424 /*
58425 * Either invalidate key (R_Key of the remote host) that will
58426 * be send with IETH (Invalidate ETH) if wqe_type is of Send
58427 * with Invalidate, or immediate value that will be sent with
58428 * ImmDt header if wqe_type is Send with Immediate.
58429 */
58430 uint32_t inv_key_or_imm_data;
58431 /* This field represents a 32-bit total data length, in bytes. */
58432 uint32_t length;
58433 /*
58434 * When in the SQ of a UD QP, indicates the q_key to be used in
58435 * the transmitted packet. However, if the most significant bit
58436 * of this field is set, then the q_key will be taken from QP
58437 * context, rather than from this field.
58438 *
58439 * When in the SQ of a non-UD QP, this field is reserved and
58440 * should be filled with zeros.
58441 */
58442 uint32_t q_key;
58443 /*
58444 * When in the SQ of a UD QP, indicates the destination QP to be
58445 * used in the transmitted packet.
58446 *
58447 * When in the SQ of a non-UD QP, this field is reserved and
58448 * should be filled with zeros.
58449 */
58450 uint32_t dst_qp;
58451 #define SQ_SEND_DST_QP_MASK UINT32_C(0xffffff)
58452 #define SQ_SEND_DST_QP_SFT 0
58453 uint32_t avid;
58454 /*
58455 * If the serv_type is 'UD', then this field supplies the AVID
58456 * (Address Vector ID).
58457 */
58458 #define SQ_SEND_AVID_MASK UINT32_C(0xfffff)
58459 #define SQ_SEND_AVID_SFT 0
58460 uint32_t reserved32;
58461 uint32_t timestamp;
58462 /*
58463 * This field specifies a 24-bit timestamp that can be passed
58464 * down the TX path and optionally logged in the TXP timestamp
58465 * histogram.
58466 */
58467 #define SQ_SEND_TIMESTAMP_MASK UINT32_C(0xffffff)
58468 #define SQ_SEND_TIMESTAMP_SFT 0
58469 /*
58470 * When inline=0, then this area is filled with from 1 to 6
58471 * SGEs based on the wqe_size field.
58472 *
58473 * When inline=1, this area is filled with payload data for the
58474 * send based on the length_or_AVID field. Bits [7:0] of word 0
58475 * hold the first byte to go out on the wire.
58476 */
58477 uint32_t data[24];
58478 } sq_send_t, *psq_send_t;
58479
58480 /* Send SQ WQE header. */
58481 /* sq_send_hdr (size:256b/32B) */
58482
58483 typedef struct sq_send_hdr {
58484 /* This field defines the type of SQ WQE. */
58485 uint8_t wqe_type;
58486 /* Send */
58487 #define SQ_SEND_HDR_WQE_TYPE_SEND UINT32_C(0x0)
58488 /*
58489 * Send with Immediate
58490 *
58491 * Allowed only on reliable connection (RC) and
58492 * unreliable datagram (UD) SQs.
58493 */
58494 #define SQ_SEND_HDR_WQE_TYPE_SEND_W_IMMEAD UINT32_C(0x1)
58495 /*
58496 * Send with Invalidate.
58497 *
58498 * Allowed only on reliable connection (RC) SQs.
58499 */
58500 #define SQ_SEND_HDR_WQE_TYPE_SEND_W_INVALID UINT32_C(0x2)
58501 #define SQ_SEND_HDR_WQE_TYPE_LAST SQ_SEND_HDR_WQE_TYPE_SEND_W_INVALID
58502 uint8_t flags;
58503 #define SQ_SEND_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK UINT32_C(0xff)
58504 #define SQ_SEND_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT 0
58505 /*
58506 * Set if completion signaling is requested. If this bit is
58507 * 0, and the SQ is configured to support Unsignaled completion
58508 * the controller should not generate a CQE unless there was
58509 * an error. This refers to the CQE on the sender side. (The se
58510 * flag refers to the receiver side).
58511 */
58512 #define SQ_SEND_HDR_FLAGS_SIGNAL_COMP UINT32_C(0x1)
58513 /*
58514 * Indication to complete all previous RDMA Read or Atomic WQEs
58515 * on the SQ before executing this WQE.
58516 *
58517 * This flag must be zero for a UD send.
58518 */
58519 #define SQ_SEND_HDR_FLAGS_RD_OR_ATOMIC_FENCE UINT32_C(0x2)
58520 /*
58521 * For local invalidate request. Indication to complete all
58522 * previous SQ's WQEs before executing this WQE.
58523 *
58524 * This flag must be zero for a UD send.
58525 */
58526 #define SQ_SEND_HDR_FLAGS_UC_FENCE UINT32_C(0x4)
58527 /*
58528 * Solicit event flag. Indication sent in BTH header to the
58529 * receiver to generate a Completion Event Notification, i.e.
58530 * CNQE. This bit should be set only in the last (or only) packet
58531 * of the message.
58532 */
58533 #define SQ_SEND_HDR_FLAGS_SE UINT32_C(0x8)
58534 /*
58535 * Indicate that inline data is posted to the SQ in the data
58536 * area of this WQE.
58537 */
58538 #define SQ_SEND_HDR_FLAGS_INLINE UINT32_C(0x10)
58539 /*
58540 * If set to 1, then the timestamp from the WQE is used. If
58541 * cleared to 0, then TWE provides the timestamp.
58542 */
58543 #define SQ_SEND_HDR_FLAGS_WQE_TS_EN UINT32_C(0x20)
58544 /*
58545 * When set to '1', this operation will cause a trace capture in
58546 * each block it passes through.
58547 */
58548 #define SQ_SEND_HDR_FLAGS_DEBUG_TRACE UINT32_C(0x40)
58549 /*
58550 * The number of 16 bytes chunks of data including this first
58551 * word of the request that are a valid part of the request. The
58552 * valid 16 bytes units other than the WQE structure can be
58553 * SGEs (Scatter Gather Elements) OR inline data.
58554 *
58555 * While this field defines the valid WQE size. The actual
58556 * total WQE size is always 128B.
58557 */
58558 uint8_t wqe_size;
58559 uint8_t reserved8_1;
58560 /*
58561 * Either invalidate key (R_Key of the remote host) that will
58562 * be send with IETH (Invalidate ETH) if wqe_type is of Send
58563 * with Invalidate, or immediate value that will be sent with
58564 * ImmDt header if wqe_type is Send with Immediate.
58565 */
58566 uint32_t inv_key_or_imm_data;
58567 /* This field represents a 32-bit total data length, in bytes. */
58568 uint32_t length;
58569 /*
58570 * When in the SQ of a UD QP, indicates the q_key to be used in
58571 * the transmitted packet. However, if the most significant bit
58572 * of this field is set, then the q_key will be taken from QP
58573 * context, rather than from this field.
58574 *
58575 * When in the SQ of a non-UD QP, this field is reserved and
58576 * should be filled with zeros.
58577 */
58578 uint32_t q_key;
58579 /*
58580 * When in the SQ of a UD QP, indicates the destination QP to be
58581 * used in the transmitted packet.
58582 *
58583 * When in the SQ of a non-UD QP, this field is reserved and
58584 * should be filled with zeros.
58585 */
58586 uint32_t dst_qp;
58587 #define SQ_SEND_HDR_DST_QP_MASK UINT32_C(0xffffff)
58588 #define SQ_SEND_HDR_DST_QP_SFT 0
58589 uint32_t avid;
58590 /*
58591 * If the serv_type is 'UD', then this field supplies the AVID
58592 * (Address Vector ID).
58593 */
58594 #define SQ_SEND_HDR_AVID_MASK UINT32_C(0xfffff)
58595 #define SQ_SEND_HDR_AVID_SFT 0
58596 uint32_t reserved32;
58597 uint32_t timestamp;
58598 /*
58599 * This field specifies a 24-bit timestamp that can be passed
58600 * down the TX path and optionally logged in the TXP timestamp
58601 * histogram.
58602 */
58603 #define SQ_SEND_HDR_TIMESTAMP_MASK UINT32_C(0xffffff)
58604 #define SQ_SEND_HDR_TIMESTAMP_SFT 0
58605 } sq_send_hdr_t, *psq_send_hdr_t;
58606
58607 /* Send Raw Ethernet and QP1 SQ WQE */
58608 /* sq_send_raweth_qp1 (size:1024b/128B) */
58609
58610 typedef struct sq_send_raweth_qp1 {
58611 /* This field defines the type of SQ WQE. */
58612 uint8_t wqe_type;
58613 /* Send */
58614 #define SQ_SEND_RAWETH_QP1_WQE_TYPE_SEND UINT32_C(0x0)
58615 #define SQ_SEND_RAWETH_QP1_WQE_TYPE_LAST SQ_SEND_RAWETH_QP1_WQE_TYPE_SEND
58616 uint8_t flags;
58617 #define SQ_SEND_RAWETH_QP1_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK UINT32_C(0xff)
58618 #define SQ_SEND_RAWETH_QP1_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT 0
58619 /*
58620 * Set if completion signaling is requested. If this bit is
58621 * 0, and the SQ is configured to support Unsignaled completion
58622 * the controller should not generate a CQE unless there was
58623 * an error. This refers to the CQE on the sender side. (The se
58624 * flag refers to the receiver side).
58625 */
58626 #define SQ_SEND_RAWETH_QP1_FLAGS_SIGNAL_COMP UINT32_C(0x1)
58627 /* This flag must be zero for a Raweth or QP1 send. */
58628 #define SQ_SEND_RAWETH_QP1_FLAGS_RD_OR_ATOMIC_FENCE UINT32_C(0x2)
58629 /* This flag must be zero for a Raweth or QP1 send. */
58630 #define SQ_SEND_RAWETH_QP1_FLAGS_UC_FENCE UINT32_C(0x4)
58631 /* This flag must be zero for a Raweth or QP1 send. */
58632 #define SQ_SEND_RAWETH_QP1_FLAGS_SE UINT32_C(0x8)
58633 /*
58634 * Indicate that inline data is posted to the SQ in the data
58635 * area of this WQE.
58636 */
58637 #define SQ_SEND_RAWETH_QP1_FLAGS_INLINE UINT32_C(0x10)
58638 /*
58639 * If set to 1, then the timestamp from the WQE is used. If
58640 * cleared to 0, then TWE provides the timestamp.
58641 */
58642 #define SQ_SEND_RAWETH_QP1_FLAGS_WQE_TS_EN UINT32_C(0x20)
58643 /*
58644 * When set to '1', this operation will cause a trace capture in
58645 * each block it passes through.
58646 */
58647 #define SQ_SEND_RAWETH_QP1_FLAGS_DEBUG_TRACE UINT32_C(0x40)
58648 /*
58649 * The number of 16 bytes chunks of data including this first
58650 * word of the request that are a valid part of the request. The
58651 * valid 16 bytes units other than the WQE structure can be
58652 * SGEs (Scatter Gather Elements) OR inline data.
58653 *
58654 * While this field defines the valid WQE size. The actual
58655 * total WQE size is always 128B.
58656 */
58657 uint8_t wqe_size;
58658 uint8_t reserved8;
58659 /*
58660 * All bits in this field must be valid on the first BD of a packet.
58661 * Their value on other BDs of the packet will be ignored.
58662 */
58663 uint16_t lflags;
58664 /*
58665 * If set to 1, the controller replaces the TCP/UPD checksum
58666 * fields of normal TCP/UPD checksum, or the inner TCP/UDP
58667 * checksum field of the encapsulated TCP/UDP packets with the
58668 * hardware calculated TCP/UDP checksum for the packet associated
58669 * with this descriptor.
58670 *
58671 * This bit must be valid on the first BD of a packet.
58672 */
58673 #define SQ_SEND_RAWETH_QP1_LFLAGS_TCP_UDP_CHKSUM UINT32_C(0x1)
58674 /*
58675 * If set to 1, the controller replaces the IP checksum of the
58676 * normal packets, or the inner IP checksum of the encapsulated
58677 * packets with the hardware calculated IP checksum for the
58678 * packet associated with this descriptor.
58679 *
58680 * This bit must be valid on the first BD of a packet.
58681 */
58682 #define SQ_SEND_RAWETH_QP1_LFLAGS_IP_CHKSUM UINT32_C(0x2)
58683 /*
58684 * If set to 1, the controller will not append an Ethernet CRC
58685 * to the end of the frame.
58686 *
58687 * This bit must be valid on the first BD of a packet.
58688 *
58689 * Packet must be 64B or longer when this flag is set. It is not
58690 * usefull to use this bit with any form of TX offload such as
58691 * CSO or LSO. The intent is that the packet from the host already
58692 * has a valid Ethernet CRC on the packet.
58693 */
58694 #define SQ_SEND_RAWETH_QP1_LFLAGS_NOCRC UINT32_C(0x4)
58695 /*
58696 * If set to 1, the device will record the time at which the packet
58697 * was actually transmitted at the TX MAC.
58698 *
58699 * This bit must be valid on the first BD of a packet.
58700 */
58701 #define SQ_SEND_RAWETH_QP1_LFLAGS_STAMP UINT32_C(0x8)
58702 /*
58703 * If set to 1, The controller replaces the tunnel IP checksum
58704 * field with hardware calculated IP checksum for the IP header
58705 * of the packet associated with this descriptor. In case of
58706 * VXLAN, the controller also replaces the outer header UDP
58707 * checksum with hardware calculated UDP checksum for the packet
58708 * associated with this descriptor.
58709 */
58710 #define SQ_SEND_RAWETH_QP1_LFLAGS_T_IP_CHKSUM UINT32_C(0x10)
58711 /*
58712 * If set to '1', then the RoCE ICRC will be appended to the
58713 * packet. Packet must be a valid RoCE format packet.
58714 */
58715 #define SQ_SEND_RAWETH_QP1_LFLAGS_ROCE_CRC UINT32_C(0x100)
58716 /*
58717 * If set to '1', then the FCoE CRC will be appended to the
58718 * packet. Packet must be a valid FCoE format packet.
58719 */
58720 #define SQ_SEND_RAWETH_QP1_LFLAGS_FCOE_CRC UINT32_C(0x200)
58721 /*
58722 * This value selects a CFA action to perform on the packet.
58723 * Set this value to zero if no CFA action is desired.
58724 *
58725 * This value must be valid on the first BD of a packet.
58726 */
58727 uint16_t cfa_action;
58728 /*
58729 * This field represents a 32-bit total data length, in bytes.
58730 * Note, however, that the length cannot exceed the MTU.
58731 */
58732 uint32_t length;
58733 uint32_t reserved32_1;
58734 /*
58735 * This value is action meta-data that defines CFA edit operations
58736 * that are done in addition to any action editing.
58737 */
58738 uint32_t cfa_meta;
58739 /* When key=1, This is the VLAN tag VID value. */
58740 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_VID_MASK UINT32_C(0xfff)
58741 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_VID_SFT 0
58742 /* When key=1, This is the VLAN tag DE value. */
58743 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_DE UINT32_C(0x1000)
58744 /* When key=1, This is the VLAN tag PRI value. */
58745 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_PRI_MASK UINT32_C(0xe000)
58746 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_PRI_SFT 13
58747 /* When key=1, This is the VLAN tag TPID select value. */
58748 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_MASK UINT32_C(0x70000)
58749 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_SFT 16
58750 /* 0x88a8 */
58751 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID88A8 (UINT32_C(0x0) << 16)
58752 /* 0x8100 */
58753 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID8100 (UINT32_C(0x1) << 16)
58754 /* 0x9100 */
58755 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID9100 (UINT32_C(0x2) << 16)
58756 /* 0x9200 */
58757 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID9200 (UINT32_C(0x3) << 16)
58758 /* 0x9300 */
58759 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID9300 (UINT32_C(0x4) << 16)
58760 /* Value programmed in CFA VLANTPID register. */
58761 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPIDCFG (UINT32_C(0x5) << 16)
58762 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_LAST SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPIDCFG
58763 /* When key=1, This is the VLAN tag TPID select value. */
58764 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_RESERVED_MASK UINT32_C(0xff80000)
58765 #define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_RESERVED_SFT 19
58766 /*
58767 * This field identifies the type of edit to be performed
58768 * on the packet.
58769 *
58770 * This value must be valid on the first BD of a packet.
58771 */
58772 #define SQ_SEND_RAWETH_QP1_CFA_META_KEY_MASK UINT32_C(0xf0000000)
58773 #define SQ_SEND_RAWETH_QP1_CFA_META_KEY_SFT 28
58774 /* No editing */
58775 #define SQ_SEND_RAWETH_QP1_CFA_META_KEY_NONE (UINT32_C(0x0) << 28)
58776 /*
58777 * - meta[17:16] - TPID select value (0 = 0x8100).
58778 * - meta[15:12] - PRI/DE value.
58779 * - meta[11:0] - VID value.
58780 */
58781 #define SQ_SEND_RAWETH_QP1_CFA_META_KEY_VLAN_TAG (UINT32_C(0x1) << 28)
58782 #define SQ_SEND_RAWETH_QP1_CFA_META_KEY_LAST SQ_SEND_RAWETH_QP1_CFA_META_KEY_VLAN_TAG
58783 uint32_t reserved32_2;
58784 uint32_t reserved32_3;
58785 uint32_t timestamp;
58786 /*
58787 * This field specifies a 24-bit timestamp that can be passed
58788 * down the TX path and optionally logged in the TXP timestamp
58789 * histogram.
58790 */
58791 #define SQ_SEND_RAWETH_QP1_TIMESTAMP_MASK UINT32_C(0xffffff)
58792 #define SQ_SEND_RAWETH_QP1_TIMESTAMP_SFT 0
58793 /*
58794 * When inline=0, then this area is filled with from 1 to 6
58795 * SGEs based on the wqe_size field.
58796 *
58797 * When inline=1, this area is filled with payload data for the
58798 * send based on the length_or_AVID field. Bits [7:0] of word 0
58799 * hold the first byte to go out on the wire.
58800 */
58801 uint32_t data[24];
58802 } sq_send_raweth_qp1_t, *psq_send_raweth_qp1_t;
58803
58804 /* Send Raw Ethernet and QP1 SQ WQE header. */
58805 /* sq_send_raweth_qp1_hdr (size:256b/32B) */
58806
58807 typedef struct sq_send_raweth_qp1_hdr {
58808 /* This field defines the type of SQ WQE. */
58809 uint8_t wqe_type;
58810 /* Send */
58811 #define SQ_SEND_RAWETH_QP1_HDR_WQE_TYPE_SEND UINT32_C(0x0)
58812 #define SQ_SEND_RAWETH_QP1_HDR_WQE_TYPE_LAST SQ_SEND_RAWETH_QP1_HDR_WQE_TYPE_SEND
58813 uint8_t flags;
58814 #define SQ_SEND_RAWETH_QP1_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK UINT32_C(0xff)
58815 #define SQ_SEND_RAWETH_QP1_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT 0
58816 /*
58817 * Set if completion signaling is requested. If this bit is
58818 * 0, and the SQ is configured to support Unsignaled completion
58819 * the controller should not generate a CQE unless there was
58820 * an error. This refers to the CQE on the sender side. (The se
58821 * flag refers to the receiver side).
58822 */
58823 #define SQ_SEND_RAWETH_QP1_HDR_FLAGS_SIGNAL_COMP UINT32_C(0x1)
58824 /* This flag must be zero for a Raweth or QP1 send. */
58825 #define SQ_SEND_RAWETH_QP1_HDR_FLAGS_RD_OR_ATOMIC_FENCE UINT32_C(0x2)
58826 /* This flag must be zero for a Raweth or QP1 send. */
58827 #define SQ_SEND_RAWETH_QP1_HDR_FLAGS_UC_FENCE UINT32_C(0x4)
58828 /* This flag must be zero for a Raweth or QP1 send. */
58829 #define SQ_SEND_RAWETH_QP1_HDR_FLAGS_SE UINT32_C(0x8)
58830 /*
58831 * Indicate that inline data is posted to the SQ in the data
58832 * area of this WQE.
58833 */
58834 #define SQ_SEND_RAWETH_QP1_HDR_FLAGS_INLINE UINT32_C(0x10)
58835 /*
58836 * If set to 1, then the timestamp from the WQE is used. If
58837 * cleared to 0, then TWE provides the timestamp.
58838 */
58839 #define SQ_SEND_RAWETH_QP1_HDR_FLAGS_WQE_TS_EN UINT32_C(0x20)
58840 /*
58841 * When set to '1', this operation will cause a trace capture in
58842 * each block it passes through.
58843 */
58844 #define SQ_SEND_RAWETH_QP1_HDR_FLAGS_DEBUG_TRACE UINT32_C(0x40)
58845 /*
58846 * The number of 16 bytes chunks of data including this first
58847 * word of the request that are a valid part of the request. The
58848 * valid 16 bytes units other than the WQE structure can be
58849 * SGEs (Scatter Gather Elements) OR inline data.
58850 *
58851 * While this field defines the valid WQE size. The actual
58852 * total WQE size is always 128B.
58853 */
58854 uint8_t wqe_size;
58855 uint8_t reserved8;
58856 /*
58857 * All bits in this field must be valid on the first BD of a packet.
58858 * Their value on other BDs of the packet will be ignored.
58859 */
58860 uint16_t lflags;
58861 /*
58862 * If set to 1, the controller replaces the TCP/UPD checksum
58863 * fields of normal TCP/UPD checksum, or the inner TCP/UDP
58864 * checksum field of the encapsulated TCP/UDP packets with the
58865 * hardware calculated TCP/UDP checksum for the packet associated
58866 * with this descriptor.
58867 *
58868 * This bit must be valid on the first BD of a packet.
58869 */
58870 #define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_TCP_UDP_CHKSUM UINT32_C(0x1)
58871 /*
58872 * If set to 1, the controller replaces the IP checksum of the
58873 * normal packets, or the inner IP checksum of the encapsulated
58874 * packets with the hardware calculated IP checksum for the
58875 * packet associated with this descriptor.
58876 *
58877 * This bit must be valid on the first BD of a packet.
58878 */
58879 #define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_IP_CHKSUM UINT32_C(0x2)
58880 /*
58881 * If set to 1, the controller will not append an Ethernet CRC
58882 * to the end of the frame.
58883 *
58884 * This bit must be valid on the first BD of a packet.
58885 *
58886 * Packet must be 64B or longer when this flag is set. It is not
58887 * usefull to use this bit with any form of TX offload such as
58888 * CSO or LSO. The intent is that the packet from the host already
58889 * has a valid Ethernet CRC on the packet.
58890 */
58891 #define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_NOCRC UINT32_C(0x4)
58892 /*
58893 * If set to 1, the device will record the time at which the packet
58894 * was actually transmitted at the TX MAC.
58895 *
58896 * This bit must be valid on the first BD of a packet.
58897 */
58898 #define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_STAMP UINT32_C(0x8)
58899 /*
58900 * If set to 1, The controller replaces the tunnel IP checksum
58901 * field with hardware calculated IP checksum for the IP header
58902 * of the packet associated with this descriptor. In case of
58903 * VXLAN, the controller also replaces the outer header UDP
58904 * checksum with hardware calculated UDP checksum for the packet
58905 * associated with this descriptor.
58906 */
58907 #define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_T_IP_CHKSUM UINT32_C(0x10)
58908 /*
58909 * If set to '1', then the RoCE ICRC will be appended to the
58910 * packet. Packet must be a valid RoCE format packet.
58911 */
58912 #define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_ROCE_CRC UINT32_C(0x100)
58913 /*
58914 * If set to '1', then the FCoE CRC will be appended to the
58915 * packet. Packet must be a valid FCoE format packet.
58916 */
58917 #define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_FCOE_CRC UINT32_C(0x200)
58918 /*
58919 * This value selects a CFA action to perform on the packet.
58920 * Set this value to zero if no CFA action is desired.
58921 *
58922 * This value must be valid on the first BD of a packet.
58923 */
58924 uint16_t cfa_action;
58925 /*
58926 * This field represents a 32-bit total data length, in bytes.
58927 * Note, however, that the length cannot exceed the MTU.
58928 */
58929 uint32_t length;
58930 uint32_t reserved32_1;
58931 /*
58932 * This value is action meta-data that defines CFA edit operations
58933 * that are done in addition to any action editing.
58934 */
58935 uint32_t cfa_meta;
58936 /* When key=1, This is the VLAN tag VID value. */
58937 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_VID_MASK UINT32_C(0xfff)
58938 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_VID_SFT 0
58939 /* When key=1, This is the VLAN tag DE value. */
58940 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_DE UINT32_C(0x1000)
58941 /* When key=1, This is the VLAN tag PRI value. */
58942 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_PRI_MASK UINT32_C(0xe000)
58943 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_PRI_SFT 13
58944 /* When key=1, This is the VLAN tag TPID select value. */
58945 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_MASK UINT32_C(0x70000)
58946 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_SFT 16
58947 /* 0x88a8 */
58948 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPID88A8 (UINT32_C(0x0) << 16)
58949 /* 0x8100 */
58950 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPID8100 (UINT32_C(0x1) << 16)
58951 /* 0x9100 */
58952 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPID9100 (UINT32_C(0x2) << 16)
58953 /* 0x9200 */
58954 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPID9200 (UINT32_C(0x3) << 16)
58955 /* 0x9300 */
58956 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPID9300 (UINT32_C(0x4) << 16)
58957 /* Value programmed in CFA VLANTPID register. */
58958 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPIDCFG (UINT32_C(0x5) << 16)
58959 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_LAST SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPIDCFG
58960 /* When key=1, This is the VLAN tag TPID select value. */
58961 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_RESERVED_MASK UINT32_C(0xff80000)
58962 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_RESERVED_SFT 19
58963 /*
58964 * This field identifies the type of edit to be performed
58965 * on the packet.
58966 *
58967 * This value must be valid on the first BD of a packet.
58968 */
58969 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_MASK UINT32_C(0xf0000000)
58970 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_SFT 28
58971 /* No editing */
58972 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_NONE (UINT32_C(0x0) << 28)
58973 /*
58974 * - meta[17:16] - TPID select value (0 = 0x8100).
58975 * - meta[15:12] - PRI/DE value.
58976 * - meta[11:0] - VID value.
58977 */
58978 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_VLAN_TAG (UINT32_C(0x1) << 28)
58979 #define SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_LAST SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_VLAN_TAG
58980 uint32_t reserved32_2;
58981 uint32_t reserved32_3;
58982 uint32_t timestamp;
58983 /*
58984 * This field specifies a 24-bit timestamp that can be passed
58985 * down the TX path and optionally logged in the TXP timestamp
58986 * histogram.
58987 */
58988 #define SQ_SEND_RAWETH_QP1_HDR_TIMESTAMP_MASK UINT32_C(0xffffff)
58989 #define SQ_SEND_RAWETH_QP1_HDR_TIMESTAMP_SFT 0
58990 } sq_send_raweth_qp1_hdr_t, *psq_send_raweth_qp1_hdr_t;
58991
58992 /* RDMA SQ WQE */
58993 /* sq_rdma (size:1024b/128B) */
58994
58995 typedef struct sq_rdma {
58996 /* This field defines the type of SQ WQE. */
58997 uint8_t wqe_type;
58998 /*
58999 * RDMA Write.
59000 *
59001 * Allowed only on reliable connection (RC) SQs.
59002 */
59003 #define SQ_RDMA_WQE_TYPE_WRITE_WQE UINT32_C(0x4)
59004 /*
59005 * RDMA Write with Immediate.
59006 *
59007 * Allowed only on reliable connection (RC) SQs.
59008 */
59009 #define SQ_RDMA_WQE_TYPE_WRITE_W_IMMEAD UINT32_C(0x5)
59010 /*
59011 * RDMA Read.
59012 *
59013 * Allowed only on reliable connection (RC) SQs.
59014 */
59015 #define SQ_RDMA_WQE_TYPE_READ_WQE UINT32_C(0x6)
59016 #define SQ_RDMA_WQE_TYPE_LAST SQ_RDMA_WQE_TYPE_READ_WQE
59017 uint8_t flags;
59018 #define SQ_RDMA_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK UINT32_C(0xff)
59019 #define SQ_RDMA_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT 0
59020 /*
59021 * Set if completion signaling is requested. If this bit is
59022 * 0, and the SQ is configured to support Unsignaled
59023 * completion the controller should not generate a CQE
59024 * unless there was an error. This refers to CQE on the
59025 * sender side (se_flag refers to the receiver side)
59026 */
59027 #define SQ_RDMA_FLAGS_SIGNAL_COMP UINT32_C(0x1)
59028 /*
59029 * Indication to complete all previous RDMA Read or Atomic
59030 * WQEs on the SQ before executing this WQE
59031 */
59032 #define SQ_RDMA_FLAGS_RD_OR_ATOMIC_FENCE UINT32_C(0x2)
59033 /*
59034 * Unconditional fence. Indication to complete all previous
59035 * SQ's WQEs before executing this WQE.
59036 */
59037 #define SQ_RDMA_FLAGS_UC_FENCE UINT32_C(0x4)
59038 /*
59039 * Solicit event. Indication sent in BTH header to the
59040 * receiver to generate a Completion Event Notification,
59041 * i.e. CNQE. This bit should be set only in the last (or
59042 * only) packet of the message.
59043 */
59044 #define SQ_RDMA_FLAGS_SE UINT32_C(0x8)
59045 /*
59046 * Indicate that inline data is posted to the SQ following
59047 * this WQE. This bit may be 1 only for write operations.
59048 */
59049 #define SQ_RDMA_FLAGS_INLINE UINT32_C(0x10)
59050 /*
59051 * If set to 1, then the timestamp from the WQE is used. If
59052 * cleared to 0, then TWE provides the timestamp.
59053 */
59054 #define SQ_RDMA_FLAGS_WQE_TS_EN UINT32_C(0x20)
59055 /*
59056 * When set to '1', this operation will cause a trace capture in
59057 * each block it passes through.
59058 */
59059 #define SQ_RDMA_FLAGS_DEBUG_TRACE UINT32_C(0x40)
59060 /*
59061 * The number of 16 bytes chunks of data including this first
59062 * wqe of the request that are a valid part of the request. The
59063 * valid 16 bytes units other than the WQE structure can be
59064 * SGEs (Scatter Gather Elements) OR inline data.
59065 *
59066 * While this field defines the valid WQE size. The actual
59067 * total WQE size is always 128B.
59068 */
59069 uint8_t wqe_size;
59070 uint8_t reserved8;
59071 /*
59072 * Immediate data - valid for RDMA Write with immediate and
59073 * causes the controller to add immDt header with this value
59074 */
59075 uint32_t imm_data;
59076 /* Total data length in bytes */
59077 uint32_t length;
59078 uint32_t reserved32_1;
59079 /* Remote VA sent to the destination QP */
59080 uint64_t remote_va;
59081 /*
59082 * R_Key provided by remote node when the connection was
59083 * established and placed in the RETH header. It identify the
59084 * MRW on the remote host
59085 */
59086 uint32_t remote_key;
59087 uint32_t timestamp;
59088 /*
59089 * This field specifies a 24-bit timestamp that can be passed
59090 * down the TX path and optionally logged in the TXP timestamp
59091 * histogram.
59092 */
59093 #define SQ_RDMA_TIMESTAMP_MASK UINT32_C(0xffffff)
59094 #define SQ_RDMA_TIMESTAMP_SFT 0
59095 /*
59096 * When inline=0, then this area is filled with from 1 to 6
59097 * SGEs based on the wqe_size field.
59098 *
59099 * When inline=1, this area is filled with payload data for the
59100 * write based on the length field. Bits [7:0] of word 0
59101 * hold the first byte to go out on the wire.
59102 */
59103 uint32_t data[24];
59104 } sq_rdma_t, *psq_rdma_t;
59105
59106 /* RDMA SQ WQE header. */
59107 /* sq_rdma_hdr (size:256b/32B) */
59108
59109 typedef struct sq_rdma_hdr {
59110 /* This field defines the type of SQ WQE. */
59111 uint8_t wqe_type;
59112 /*
59113 * RDMA Write.
59114 *
59115 * Allowed only on reliable connection (RC) SQs.
59116 */
59117 #define SQ_RDMA_HDR_WQE_TYPE_WRITE_WQE UINT32_C(0x4)
59118 /*
59119 * RDMA Write with Immediate.
59120 *
59121 * Allowed only on reliable connection (RC) SQs.
59122 */
59123 #define SQ_RDMA_HDR_WQE_TYPE_WRITE_W_IMMEAD UINT32_C(0x5)
59124 /*
59125 * RDMA Read.
59126 *
59127 * Allowed only on reliable connection (RC) SQs.
59128 */
59129 #define SQ_RDMA_HDR_WQE_TYPE_READ_WQE UINT32_C(0x6)
59130 #define SQ_RDMA_HDR_WQE_TYPE_LAST SQ_RDMA_HDR_WQE_TYPE_READ_WQE
59131 uint8_t flags;
59132 #define SQ_RDMA_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK UINT32_C(0xff)
59133 #define SQ_RDMA_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT 0
59134 /*
59135 * Set if completion signaling is requested. If this bit is
59136 * 0, and the SQ is configured to support Unsignaled
59137 * completion the controller should not generate a CQE
59138 * unless there was an error. This refers to CQE on the
59139 * sender side (se_flag refers to the receiver side)
59140 */
59141 #define SQ_RDMA_HDR_FLAGS_SIGNAL_COMP UINT32_C(0x1)
59142 /*
59143 * Indication to complete all previous RDMA Read or Atomic
59144 * WQEs on the SQ before executing this WQE
59145 */
59146 #define SQ_RDMA_HDR_FLAGS_RD_OR_ATOMIC_FENCE UINT32_C(0x2)
59147 /*
59148 * Unconditional fence. Indication to complete all previous
59149 * SQ's WQEs before executing this WQE.
59150 */
59151 #define SQ_RDMA_HDR_FLAGS_UC_FENCE UINT32_C(0x4)
59152 /*
59153 * Solicit event. Indication sent in BTH header to the
59154 * receiver to generate a Completion Event Notification,
59155 * i.e. CNQE. This bit should be set only in the last (or
59156 * only) packet of the message.
59157 */
59158 #define SQ_RDMA_HDR_FLAGS_SE UINT32_C(0x8)
59159 /*
59160 * Indicate that inline data is posted to the SQ following
59161 * this WQE. This bit may be 1 only for write operations.
59162 */
59163 #define SQ_RDMA_HDR_FLAGS_INLINE UINT32_C(0x10)
59164 /*
59165 * If set to 1, then the timestamp from the WQE is used. If
59166 * cleared to 0, then TWE provides the timestamp.
59167 */
59168 #define SQ_RDMA_HDR_FLAGS_WQE_TS_EN UINT32_C(0x20)
59169 /*
59170 * When set to '1', this operation will cause a trace capture in
59171 * each block it passes through.
59172 */
59173 #define SQ_RDMA_HDR_FLAGS_DEBUG_TRACE UINT32_C(0x40)
59174 /*
59175 * The number of 16 bytes chunks of data including this first
59176 * wqe of the request that are a valid part of the request. The
59177 * valid 16 bytes units other than the WQE structure can be
59178 * SGEs (Scatter Gather Elements) OR inline data.
59179 *
59180 * While this field defines the valid WQE size. The actual
59181 * total WQE size is always 128B.
59182 */
59183 uint8_t wqe_size;
59184 uint8_t reserved8;
59185 /*
59186 * Immediate data - valid for RDMA Write with immediate and
59187 * causes the controller to add immDt header with this value
59188 */
59189 uint32_t imm_data;
59190 /* Total data length in bytes */
59191 uint32_t length;
59192 uint32_t reserved32_1;
59193 /* Remote VA sent to the destination QP */
59194 uint64_t remote_va;
59195 /*
59196 * R_Key provided by remote node when the connection was
59197 * established and placed in the RETH header. It identify the
59198 * MRW on the remote host
59199 */
59200 uint32_t remote_key;
59201 uint32_t timestamp;
59202 /*
59203 * This field specifies a 24-bit timestamp that can be passed
59204 * down the TX path and optionally logged in the TXP timestamp
59205 * histogram.
59206 */
59207 #define SQ_RDMA_HDR_TIMESTAMP_MASK UINT32_C(0xffffff)
59208 #define SQ_RDMA_HDR_TIMESTAMP_SFT 0
59209 } sq_rdma_hdr_t, *psq_rdma_hdr_t;
59210
59211 /* Atomic SQ WQE */
59212 /* sq_atomic (size:1024b/128B) */
59213
59214 typedef struct sq_atomic {
59215 /* This field defines the type of SQ WQE. */
59216 uint8_t wqe_type;
59217 /*
59218 * Atomic Compare/Swap.
59219 *
59220 * Allowed only on reliable connection (RC) SQs.
59221 */
59222 #define SQ_ATOMIC_WQE_TYPE_ATOMIC_CS UINT32_C(0x8)
59223 /*
59224 * Atomic Fetch/Add.
59225 *
59226 * Allowed only on reliable connection (RC) SQs.
59227 */
59228 #define SQ_ATOMIC_WQE_TYPE_ATOMIC_FA UINT32_C(0xb)
59229 #define SQ_ATOMIC_WQE_TYPE_LAST SQ_ATOMIC_WQE_TYPE_ATOMIC_FA
59230 uint8_t flags;
59231 #define SQ_ATOMIC_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK UINT32_C(0xff)
59232 #define SQ_ATOMIC_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT 0
59233 /*
59234 * Set if completion signaling is requested. If this bit is
59235 * 0, and the SQ is configured to support Unsignaled
59236 * completion the controller should not generate a CQE
59237 * unless there was an error. This refers to CQE on the
59238 * sender side (se_flag refers to the receiver side)
59239 */
59240 #define SQ_ATOMIC_FLAGS_SIGNAL_COMP UINT32_C(0x1)
59241 /*
59242 * Indication to complete all previous RDMA Read or Atomic
59243 * WQEs on the SQ before executing this WQE
59244 */
59245 #define SQ_ATOMIC_FLAGS_RD_OR_ATOMIC_FENCE UINT32_C(0x2)
59246 /*
59247 * Unconditional fence. Indication to complete all previous
59248 * SQ's WQEs before executing this WQE.
59249 */
59250 #define SQ_ATOMIC_FLAGS_UC_FENCE UINT32_C(0x4)
59251 /*
59252 * Solicit event. Indication sent in BTH header to the
59253 * receiver to generate a Completion Event Notification,
59254 * i.e. CNQE. This bit should be set only in the last (or
59255 * only) packet of the message.
59256 */
59257 #define SQ_ATOMIC_FLAGS_SE UINT32_C(0x8)
59258 /* NA for this WQE */
59259 #define SQ_ATOMIC_FLAGS_INLINE UINT32_C(0x10)
59260 /*
59261 * The atomic WQE does not have a timestamp field, so this field is
59262 * ignored and should be zero.
59263 */
59264 #define SQ_ATOMIC_FLAGS_WQE_TS_EN UINT32_C(0x20)
59265 /*
59266 * When set to '1', this operation will cause a trace capture in
59267 * each block it passes through.
59268 */
59269 #define SQ_ATOMIC_FLAGS_DEBUG_TRACE UINT32_C(0x40)
59270 uint16_t reserved16;
59271 /*
59272 * R_Key provided by remote node when the connection was
59273 * established and placed in the AETH header. It identify the
59274 * MRW on the remote host
59275 */
59276 uint32_t remote_key;
59277 /* Remote VA sent to the destination QP */
59278 uint64_t remote_va;
59279 /* Data value to be placed in remote host specified address */
59280 uint64_t swap_data;
59281 /*
59282 * Data value to be compared with the value in the remote host
59283 * specified address
59284 */
59285 uint64_t cmp_data;
59286 /*
59287 * The first 16B of the data field must be filled with a single
59288 * SGE. This will be used to store the return value from the
59289 * Atomic Ack response. The size of the single SGE must be 8B.
59290 */
59291 uint32_t data[24];
59292 } sq_atomic_t, *psq_atomic_t;
59293
59294 /* Atomic SQ WQE header. */
59295 /* sq_atomic_hdr (size:256b/32B) */
59296
59297 typedef struct sq_atomic_hdr {
59298 /* This field defines the type of SQ WQE. */
59299 uint8_t wqe_type;
59300 /*
59301 * Atomic Compare/Swap.
59302 *
59303 * Allowed only on reliable connection (RC) SQs.
59304 */
59305 #define SQ_ATOMIC_HDR_WQE_TYPE_ATOMIC_CS UINT32_C(0x8)
59306 /*
59307 * Atomic Fetch/Add.
59308 *
59309 * Allowed only on reliable connection (RC) SQs.
59310 */
59311 #define SQ_ATOMIC_HDR_WQE_TYPE_ATOMIC_FA UINT32_C(0xb)
59312 #define SQ_ATOMIC_HDR_WQE_TYPE_LAST SQ_ATOMIC_HDR_WQE_TYPE_ATOMIC_FA
59313 uint8_t flags;
59314 #define SQ_ATOMIC_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK UINT32_C(0xff)
59315 #define SQ_ATOMIC_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT 0
59316 /*
59317 * Set if completion signaling is requested. If this bit is
59318 * 0, and the SQ is configured to support Unsignaled
59319 * completion the controller should not generate a CQE
59320 * unless there was an error. This refers to CQE on the
59321 * sender side (se_flag refers to the receiver side)
59322 */
59323 #define SQ_ATOMIC_HDR_FLAGS_SIGNAL_COMP UINT32_C(0x1)
59324 /*
59325 * Indication to complete all previous RDMA Read or Atomic
59326 * WQEs on the SQ before executing this WQE
59327 */
59328 #define SQ_ATOMIC_HDR_FLAGS_RD_OR_ATOMIC_FENCE UINT32_C(0x2)
59329 /*
59330 * Unconditional fence. Indication to complete all previous
59331 * SQ's WQEs before executing this WQE.
59332 */
59333 #define SQ_ATOMIC_HDR_FLAGS_UC_FENCE UINT32_C(0x4)
59334 /*
59335 * Solicit event. Indication sent in BTH header to the
59336 * receiver to generate a Completion Event Notification,
59337 * i.e. CNQE. This bit should be set only in the last (or
59338 * only) packet of the message.
59339 */
59340 #define SQ_ATOMIC_HDR_FLAGS_SE UINT32_C(0x8)
59341 /* NA for this WQE */
59342 #define SQ_ATOMIC_HDR_FLAGS_INLINE UINT32_C(0x10)
59343 /*
59344 * The atomic WQE does not have a timestamp field, so this field is
59345 * ignored and should be zero.
59346 */
59347 #define SQ_ATOMIC_HDR_FLAGS_WQE_TS_EN UINT32_C(0x20)
59348 /*
59349 * When set to '1', this operation will cause a trace capture in
59350 * each block it passes through.
59351 */
59352 #define SQ_ATOMIC_HDR_FLAGS_DEBUG_TRACE UINT32_C(0x40)
59353 uint16_t reserved16;
59354 /*
59355 * R_Key provided by remote node when the connection was
59356 * established and placed in the AETH header. It identify the
59357 * MRW on the remote host
59358 */
59359 uint32_t remote_key;
59360 /* Remote VA sent to the destination QP */
59361 uint64_t remote_va;
59362 /* Data value to be placed in remote host specified address */
59363 uint64_t swap_data;
59364 /*
59365 * Data value to be compared with the value in the remote host
59366 * specified address
59367 */
59368 uint64_t cmp_data;
59369 } sq_atomic_hdr_t, *psq_atomic_hdr_t;
59370
59371 /* Local Invalidate SQ WQE */
59372 /* sq_localinvalidate (size:1024b/128B) */
59373
59374 typedef struct sq_localinvalidate {
59375 /* This field defines the type of SQ WQE. */
59376 uint8_t wqe_type;
59377 /*
59378 * Local Invalidate.
59379 *
59380 * Allowed only on reliable connection (RC) SQs.
59381 */
59382 #define SQ_LOCALINVALIDATE_WQE_TYPE_LOCAL_INVALID UINT32_C(0xc)
59383 #define SQ_LOCALINVALIDATE_WQE_TYPE_LAST SQ_LOCALINVALIDATE_WQE_TYPE_LOCAL_INVALID
59384 uint8_t flags;
59385 #define SQ_LOCALINVALIDATE_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK UINT32_C(0xff)
59386 #define SQ_LOCALINVALIDATE_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT 0
59387 /*
59388 * Set if completion signaling is requested. If this bit is
59389 * 0, and the SQ is configured to support Unsignaled
59390 * completion the controller should not generate a CQE
59391 * unless there was an error. This refers to CQE on the
59392 * sender side (se_flag refers to the receiver side)
59393 */
59394 #define SQ_LOCALINVALIDATE_FLAGS_SIGNAL_COMP UINT32_C(0x1)
59395 /*
59396 * Indication to complete all previous RDMA Read or Atomic
59397 * WQEs on the SQ before executing this WQE
59398 */
59399 #define SQ_LOCALINVALIDATE_FLAGS_RD_OR_ATOMIC_FENCE UINT32_C(0x2)
59400 /*
59401 * Unconditional fence. Indication to complete all previous
59402 * SQ's WQEs before executing this WQE.
59403 */
59404 #define SQ_LOCALINVALIDATE_FLAGS_UC_FENCE UINT32_C(0x4)
59405 /*
59406 * Solicit event. Indication sent in BTH header to the
59407 * receiver to generate a Completion Event Notification,
59408 * i.e. CNQE. This bit should be set only in the last (or
59409 * only) packet of the message.
59410 */
59411 #define SQ_LOCALINVALIDATE_FLAGS_SE UINT32_C(0x8)
59412 /* NA for this WQE */
59413 #define SQ_LOCALINVALIDATE_FLAGS_INLINE UINT32_C(0x10)
59414 /*
59415 * This flag is not applicable and should be 0 for a local memory
59416 * operation WQE.
59417 */
59418 #define SQ_LOCALINVALIDATE_FLAGS_WQE_TS_EN UINT32_C(0x20)
59419 /*
59420 * When set to '1', this operation will cause a trace capture in
59421 * each block it passes through.
59422 */
59423 #define SQ_LOCALINVALIDATE_FLAGS_DEBUG_TRACE UINT32_C(0x40)
59424 uint16_t reserved16;
59425 /*
59426 * The local key for the MR/W to invalidate; 24 msb of the key
59427 * are used to index the MRW table, 8 lsb are compared with the
59428 * 8 bit key in the MRWC
59429 */
59430 uint32_t inv_l_key;
59431 uint64_t reserved64;
59432 uint8_t reserved128[16];
59433 /* The data field for local invalidate is not used. */
59434 uint32_t data[24];
59435 } sq_localinvalidate_t, *psq_localinvalidate_t;
59436
59437 /* Local Invalidate SQ WQE header. */
59438 /* sq_localinvalidate_hdr (size:256b/32B) */
59439
59440 typedef struct sq_localinvalidate_hdr {
59441 /* This field defines the type of SQ WQE. */
59442 uint8_t wqe_type;
59443 /*
59444 * Local Invalidate.
59445 *
59446 * Allowed only on reliable connection (RC) SQs.
59447 */
59448 #define SQ_LOCALINVALIDATE_HDR_WQE_TYPE_LOCAL_INVALID UINT32_C(0xc)
59449 #define SQ_LOCALINVALIDATE_HDR_WQE_TYPE_LAST SQ_LOCALINVALIDATE_HDR_WQE_TYPE_LOCAL_INVALID
59450 uint8_t flags;
59451 #define SQ_LOCALINVALIDATE_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK UINT32_C(0xff)
59452 #define SQ_LOCALINVALIDATE_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT 0
59453 /*
59454 * Set if completion signaling is requested. If this bit is
59455 * 0, and the SQ is configured to support Unsignaled
59456 * completion the controller should not generate a CQE
59457 * unless there was an error. This refers to CQE on the
59458 * sender side (se_flag refers to the receiver side)
59459 */
59460 #define SQ_LOCALINVALIDATE_HDR_FLAGS_SIGNAL_COMP UINT32_C(0x1)
59461 /*
59462 * Indication to complete all previous RDMA Read or Atomic
59463 * WQEs on the SQ before executing this WQE
59464 */
59465 #define SQ_LOCALINVALIDATE_HDR_FLAGS_RD_OR_ATOMIC_FENCE UINT32_C(0x2)
59466 /*
59467 * Unconditional fence. Indication to complete all previous
59468 * SQ's WQEs before executing this WQE.
59469 */
59470 #define SQ_LOCALINVALIDATE_HDR_FLAGS_UC_FENCE UINT32_C(0x4)
59471 /*
59472 * Solicit event. Indication sent in BTH header to the
59473 * receiver to generate a Completion Event Notification,
59474 * i.e. CNQE. This bit should be set only in the last (or
59475 * only) packet of the message.
59476 */
59477 #define SQ_LOCALINVALIDATE_HDR_FLAGS_SE UINT32_C(0x8)
59478 /* NA for this WQE */
59479 #define SQ_LOCALINVALIDATE_HDR_FLAGS_INLINE UINT32_C(0x10)
59480 /*
59481 * This flag is not applicable and should be 0 for a local memory
59482 * operation WQE.
59483 */
59484 #define SQ_LOCALINVALIDATE_HDR_FLAGS_WQE_TS_EN UINT32_C(0x20)
59485 /*
59486 * When set to '1', this operation will cause a trace capture in
59487 * each block it passes through.
59488 */
59489 #define SQ_LOCALINVALIDATE_HDR_FLAGS_DEBUG_TRACE UINT32_C(0x40)
59490 uint16_t reserved16;
59491 /*
59492 * The local key for the MR/W to invalidate; 24 msb of the key
59493 * are used to index the MRW table, 8 lsb are compared with the
59494 * 8 bit key in the MRWC
59495 */
59496 uint32_t inv_l_key;
59497 uint64_t reserved64;
59498 uint8_t reserved128[16];
59499 } sq_localinvalidate_hdr_t, *psq_localinvalidate_hdr_t;
59500
59501 /* FR-PMR SQ WQE */
59502 /* sq_fr_pmr (size:1024b/128B) */
59503
59504 typedef struct sq_fr_pmr {
59505 /* This field defines the type of SQ WQE. */
59506 uint8_t wqe_type;
59507 /*
59508 * FR-PMR (Fast Register Physical Memory Region)
59509 *
59510 * Allowed only on reliable connection (RC) SQs.
59511 */
59512 #define SQ_FR_PMR_WQE_TYPE_FR_PMR UINT32_C(0xd)
59513 #define SQ_FR_PMR_WQE_TYPE_LAST SQ_FR_PMR_WQE_TYPE_FR_PMR
59514 uint8_t flags;
59515 /*
59516 * Set if completion signaling is requested. If this bit is
59517 * 0, and the SQ is configured to support Unsignaled
59518 * completion the controller should not generate a CQE
59519 * unless there was an error. This refers to CQE on the
59520 * sender side (se_flag refers to the receiver side)
59521 */
59522 #define SQ_FR_PMR_FLAGS_SIGNAL_COMP UINT32_C(0x1)
59523 /*
59524 * Indication to complete all previous RDMA Read or Atomic
59525 * WQEs on the SQ before executing this WQE
59526 */
59527 #define SQ_FR_PMR_FLAGS_RD_OR_ATOMIC_FENCE UINT32_C(0x2)
59528 /*
59529 * Unconditional fence. Indication to complete all previous
59530 * SQ's WQEs before executing this WQE.
59531 */
59532 #define SQ_FR_PMR_FLAGS_UC_FENCE UINT32_C(0x4)
59533 /* Not Applicable for FR_PMR. Nothing is sent */
59534 #define SQ_FR_PMR_FLAGS_SE UINT32_C(0x8)
59535 /* NA */
59536 #define SQ_FR_PMR_FLAGS_INLINE UINT32_C(0x10)
59537 /*
59538 * This flag is not applicable and should be 0 for a local memory
59539 * operation WQE.
59540 */
59541 #define SQ_FR_PMR_FLAGS_WQE_TS_EN UINT32_C(0x20)
59542 /*
59543 * When set to '1', this operation will cause a trace capture in
59544 * each block it passes through.
59545 */
59546 #define SQ_FR_PMR_FLAGS_DEBUG_TRACE UINT32_C(0x40)
59547 /*
59548 * This is the new access control for the MR. '1' means
59549 * the operation is allowed. '' means operation is
59550 * not allowed.
59551 */
59552 uint8_t access_cntl;
59553 /* Local Write Access */
59554 #define SQ_FR_PMR_ACCESS_CNTL_LOCAL_WRITE UINT32_C(0x1)
59555 /* Remote Read Access */
59556 #define SQ_FR_PMR_ACCESS_CNTL_REMOTE_READ UINT32_C(0x2)
59557 /* Remote Write Access */
59558 #define SQ_FR_PMR_ACCESS_CNTL_REMOTE_WRITE UINT32_C(0x4)
59559 /* Remote Atomic Access */
59560 #define SQ_FR_PMR_ACCESS_CNTL_REMOTE_ATOMIC UINT32_C(0x8)
59561 /* Window Binding Allowed */
59562 #define SQ_FR_PMR_ACCESS_CNTL_WINDOW_BIND UINT32_C(0x10)
59563 uint8_t zero_based_page_size_log;
59564 /* Page size. 0 for 4KB page size, ... to 8TB. */
59565 #define SQ_FR_PMR_PAGE_SIZE_LOG_MASK UINT32_C(0x1f)
59566 #define SQ_FR_PMR_PAGE_SIZE_LOG_SFT 0
59567 /* Page size is 4KB. */
59568 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4K UINT32_C(0x0)
59569 /* Page size is 8KB. */
59570 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8K UINT32_C(0x1)
59571 /* Page size is 16KB. */
59572 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_16K UINT32_C(0x2)
59573 /* Page size is 32KB. */
59574 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_32K UINT32_C(0x3)
59575 /* Page size is 64KB. */
59576 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_64K UINT32_C(0x4)
59577 /* Page size is 128KB. */
59578 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_128K UINT32_C(0x5)
59579 /* Page size is 256KB. */
59580 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_256K UINT32_C(0x6)
59581 /* Page size is 512KB. */
59582 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_512K UINT32_C(0x7)
59583 /* Page size is 1MB. */
59584 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_1M UINT32_C(0x8)
59585 /* Page size is 2MB. */
59586 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_2M UINT32_C(0x9)
59587 /* Page size is 4MB. */
59588 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4M UINT32_C(0xa)
59589 /* Page size is 8MB. */
59590 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8M UINT32_C(0xb)
59591 /* Page size is 16MB. */
59592 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_16M UINT32_C(0xc)
59593 /* Page size is 32MB. */
59594 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_32M UINT32_C(0xd)
59595 /* Page size is 64MB. */
59596 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_64M UINT32_C(0xe)
59597 /* Page size is 128MB. */
59598 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_128M UINT32_C(0xf)
59599 /* Page size is 256MB. */
59600 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_256M UINT32_C(0x10)
59601 /* Page size is 512MB. */
59602 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_512M UINT32_C(0x11)
59603 /* Page size is 1GB. */
59604 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_1G UINT32_C(0x12)
59605 /* Page size is 2GB. */
59606 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_2G UINT32_C(0x13)
59607 /* Page size is 4GB. */
59608 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4G UINT32_C(0x14)
59609 /* Page size is 8GB. */
59610 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8G UINT32_C(0x15)
59611 /* Page size is 16GB. */
59612 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_16G UINT32_C(0x16)
59613 /* Page size is 32GB. */
59614 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_32G UINT32_C(0x17)
59615 /* Page size is 64GB. */
59616 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_64G UINT32_C(0x18)
59617 /* Page size is 128GB. */
59618 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_128G UINT32_C(0x19)
59619 /* Page size is 256GB. */
59620 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_256G UINT32_C(0x1a)
59621 /* Page size is 512GB. */
59622 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_512G UINT32_C(0x1b)
59623 /* Page size is 1TB. */
59624 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_1T UINT32_C(0x1c)
59625 /* Page size is 2TB. */
59626 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_2T UINT32_C(0x1d)
59627 /* Page size is 4TB. */
59628 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4T UINT32_C(0x1e)
59629 /* Page size is 8TB. */
59630 #define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8T UINT32_C(0x1f)
59631 #define SQ_FR_PMR_PAGE_SIZE_LOG_LAST SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8T
59632 /* Indicate the MR is ZBVA (Zero Base VA) */
59633 #define SQ_FR_PMR_ZERO_BASED UINT32_C(0x20)
59634 /*
59635 * Local Key; 24 msb of the key are used to index the MRW
59636 * table, 8 lsb are assigned to the 8 bit key_lsb field in
59637 * the MRWC.
59638 */
59639 uint32_t l_key;
59640 /* Length in bytes of registered MR */
59641 uint8_t length[5];
59642 uint8_t reserved8_1;
59643 uint8_t reserved8_2;
59644 uint8_t numlevels_pbl_page_size_log;
59645 /* PBL page size. 0 for 4KB page size, ... to 8TB. */
59646 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_MASK UINT32_C(0x1f)
59647 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_SFT 0
59648 /* Page size is 4KB. */
59649 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4K UINT32_C(0x0)
59650 /* Page size is 8KB. */
59651 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8K UINT32_C(0x1)
59652 /* Page size is 16KB. */
59653 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_16K UINT32_C(0x2)
59654 /* Page size is 32KB. */
59655 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_32K UINT32_C(0x3)
59656 /* Page size is 64KB. */
59657 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_64K UINT32_C(0x4)
59658 /* Page size is 128KB. */
59659 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_128K UINT32_C(0x5)
59660 /* Page size is 256KB. */
59661 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_256K UINT32_C(0x6)
59662 /* Page size is 512KB. */
59663 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_512K UINT32_C(0x7)
59664 /* Page size is 1MB. */
59665 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_1M UINT32_C(0x8)
59666 /* Page size is 2MB. */
59667 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_2M UINT32_C(0x9)
59668 /* Page size is 4MB. */
59669 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4M UINT32_C(0xa)
59670 /* Page size is 8MB. */
59671 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8M UINT32_C(0xb)
59672 /* Page size is 16MB. */
59673 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_16M UINT32_C(0xc)
59674 /* Page size is 32MB. */
59675 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_32M UINT32_C(0xd)
59676 /* Page size is 64MB. */
59677 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_64M UINT32_C(0xe)
59678 /* Page size is 128MB. */
59679 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_128M UINT32_C(0xf)
59680 /* Page size is 256MB. */
59681 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_256M UINT32_C(0x10)
59682 /* Page size is 512MB. */
59683 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_512M UINT32_C(0x11)
59684 /* Page size is 1GB. */
59685 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_1G UINT32_C(0x12)
59686 /* Page size is 2GB. */
59687 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_2G UINT32_C(0x13)
59688 /* Page size is 4GB. */
59689 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4G UINT32_C(0x14)
59690 /* Page size is 8GB. */
59691 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8G UINT32_C(0x15)
59692 /* Page size is 16GB. */
59693 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_16G UINT32_C(0x16)
59694 /* Page size is 32GB. */
59695 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_32G UINT32_C(0x17)
59696 /* Page size is 64GB. */
59697 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_64G UINT32_C(0x18)
59698 /* Page size is 128GB. */
59699 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_128G UINT32_C(0x19)
59700 /* Page size is 256GB. */
59701 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_256G UINT32_C(0x1a)
59702 /* Page size is 512GB. */
59703 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_512G UINT32_C(0x1b)
59704 /* Page size is 1TB. */
59705 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_1T UINT32_C(0x1c)
59706 /* Page size is 2TB. */
59707 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_2T UINT32_C(0x1d)
59708 /* Page size is 4TB. */
59709 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4T UINT32_C(0x1e)
59710 /* Page size is 8TB. */
59711 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8T UINT32_C(0x1f)
59712 #define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_LAST SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8T
59713 /* Number of levels of PBL for translation */
59714 #define SQ_FR_PMR_NUMLEVELS_MASK UINT32_C(0xc0)
59715 #define SQ_FR_PMR_NUMLEVELS_SFT 6
59716 /*
59717 * A zero level PBL means that the VA is the physical address used
59718 * for the operation. No translation is done by the PTU.
59719 */
59720 #define SQ_FR_PMR_NUMLEVELS_PHYSICAL (UINT32_C(0x0) << 6)
59721 /*
59722 * A one layer translation is provided between the logical and
59723 * physical address. The PBL points to a physical page that contains
59724 * PBE values that point to actual pg_size physical pages.
59725 */
59726 #define SQ_FR_PMR_NUMLEVELS_LAYER1 (UINT32_C(0x1) << 6)
59727 /*
59728 * A two layer translation is provided between the logical and
59729 * physical address. The PBL points to a physical page that contains
59730 * PDE values that in turn point to pbl_pg_size physical pages that contain
59731 * PBE values that point to actual physical pages.
59732 */
59733 #define SQ_FR_PMR_NUMLEVELS_LAYER2 (UINT32_C(0x2) << 6)
59734 #define SQ_FR_PMR_NUMLEVELS_LAST SQ_FR_PMR_NUMLEVELS_LAYER2
59735 /* Pointer to the PBL, or PDL depending on number of levels */
59736 uint64_t pblptr;
59737 /* Local Virtual Address */
59738 uint64_t va;
59739 /* The data field for FR-PMR is not used. */
59740 uint32_t data[24];
59741 } sq_fr_pmr_t, *psq_fr_pmr_t;
59742
59743 /* FR-PMR SQ WQE header. */
59744 /* sq_fr_pmr_hdr (size:256b/32B) */
59745
59746 typedef struct sq_fr_pmr_hdr {
59747 /* This field defines the type of SQ WQE. */
59748 uint8_t wqe_type;
59749 /*
59750 * FR-PMR (Fast Register Physical Memory Region)
59751 *
59752 * Allowed only on reliable connection (RC) SQs.
59753 */
59754 #define SQ_FR_PMR_HDR_WQE_TYPE_FR_PMR UINT32_C(0xd)
59755 #define SQ_FR_PMR_HDR_WQE_TYPE_LAST SQ_FR_PMR_HDR_WQE_TYPE_FR_PMR
59756 uint8_t flags;
59757 /*
59758 * Set if completion signaling is requested. If this bit is
59759 * 0, and the SQ is configured to support Unsignaled
59760 * completion the controller should not generate a CQE
59761 * unless there was an error. This refers to CQE on the
59762 * sender side (se_flag refers to the receiver side)
59763 */
59764 #define SQ_FR_PMR_HDR_FLAGS_SIGNAL_COMP UINT32_C(0x1)
59765 /*
59766 * Indication to complete all previous RDMA Read or Atomic
59767 * WQEs on the SQ before executing this WQE
59768 */
59769 #define SQ_FR_PMR_HDR_FLAGS_RD_OR_ATOMIC_FENCE UINT32_C(0x2)
59770 /*
59771 * Unconditional fence. Indication to complete all previous
59772 * SQ's WQEs before executing this WQE.
59773 */
59774 #define SQ_FR_PMR_HDR_FLAGS_UC_FENCE UINT32_C(0x4)
59775 /* Not Applicable for FR_PMR. Nothing is sent */
59776 #define SQ_FR_PMR_HDR_FLAGS_SE UINT32_C(0x8)
59777 /* NA */
59778 #define SQ_FR_PMR_HDR_FLAGS_INLINE UINT32_C(0x10)
59779 /*
59780 * This flag is not applicable and should be 0 for a local memory
59781 * operation WQE.
59782 */
59783 #define SQ_FR_PMR_HDR_FLAGS_WQE_TS_EN UINT32_C(0x20)
59784 /*
59785 * When set to '1', this operation will cause a trace capture in
59786 * each block it passes through.
59787 */
59788 #define SQ_FR_PMR_HDR_FLAGS_DEBUG_TRACE UINT32_C(0x40)
59789 /*
59790 * This is the new access control for the MR. '1' means
59791 * the operation is allowed. '' means operation is
59792 * not allowed.
59793 */
59794 uint8_t access_cntl;
59795 /* Local Write Access */
59796 #define SQ_FR_PMR_HDR_ACCESS_CNTL_LOCAL_WRITE UINT32_C(0x1)
59797 /* Remote Read Access */
59798 #define SQ_FR_PMR_HDR_ACCESS_CNTL_REMOTE_READ UINT32_C(0x2)
59799 /* Remote Write Access */
59800 #define SQ_FR_PMR_HDR_ACCESS_CNTL_REMOTE_WRITE UINT32_C(0x4)
59801 /* Remote Atomic Access */
59802 #define SQ_FR_PMR_HDR_ACCESS_CNTL_REMOTE_ATOMIC UINT32_C(0x8)
59803 /* Window Binding Allowed */
59804 #define SQ_FR_PMR_HDR_ACCESS_CNTL_WINDOW_BIND UINT32_C(0x10)
59805 uint8_t zero_based_page_size_log;
59806 /* Page size. 0 for 4KB page size, ... to 8TB. */
59807 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_MASK UINT32_C(0x1f)
59808 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_SFT 0
59809 /* Page size is 4KB. */
59810 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_4K UINT32_C(0x0)
59811 /* Page size is 8KB. */
59812 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_8K UINT32_C(0x1)
59813 /* Page size is 16KB. */
59814 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_16K UINT32_C(0x2)
59815 /* Page size is 32KB. */
59816 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_32K UINT32_C(0x3)
59817 /* Page size is 64KB. */
59818 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_64K UINT32_C(0x4)
59819 /* Page size is 128KB. */
59820 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_128K UINT32_C(0x5)
59821 /* Page size is 256KB. */
59822 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_256K UINT32_C(0x6)
59823 /* Page size is 512KB. */
59824 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_512K UINT32_C(0x7)
59825 /* Page size is 1MB. */
59826 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_1M UINT32_C(0x8)
59827 /* Page size is 2MB. */
59828 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_2M UINT32_C(0x9)
59829 /* Page size is 4MB. */
59830 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_4M UINT32_C(0xa)
59831 /* Page size is 8MB. */
59832 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_8M UINT32_C(0xb)
59833 /* Page size is 16MB. */
59834 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_16M UINT32_C(0xc)
59835 /* Page size is 32MB. */
59836 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_32M UINT32_C(0xd)
59837 /* Page size is 64MB. */
59838 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_64M UINT32_C(0xe)
59839 /* Page size is 128MB. */
59840 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_128M UINT32_C(0xf)
59841 /* Page size is 256MB. */
59842 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_256M UINT32_C(0x10)
59843 /* Page size is 512MB. */
59844 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_512M UINT32_C(0x11)
59845 /* Page size is 1GB. */
59846 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_1G UINT32_C(0x12)
59847 /* Page size is 2GB. */
59848 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_2G UINT32_C(0x13)
59849 /* Page size is 4GB. */
59850 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_4G UINT32_C(0x14)
59851 /* Page size is 8GB. */
59852 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_8G UINT32_C(0x15)
59853 /* Page size is 16GB. */
59854 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_16G UINT32_C(0x16)
59855 /* Page size is 32GB. */
59856 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_32G UINT32_C(0x17)
59857 /* Page size is 64GB. */
59858 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_64G UINT32_C(0x18)
59859 /* Page size is 128GB. */
59860 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_128G UINT32_C(0x19)
59861 /* Page size is 256GB. */
59862 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_256G UINT32_C(0x1a)
59863 /* Page size is 512GB. */
59864 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_512G UINT32_C(0x1b)
59865 /* Page size is 1TB. */
59866 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_1T UINT32_C(0x1c)
59867 /* Page size is 2TB. */
59868 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_2T UINT32_C(0x1d)
59869 /* Page size is 4TB. */
59870 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_4T UINT32_C(0x1e)
59871 /* Page size is 8TB. */
59872 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_8T UINT32_C(0x1f)
59873 #define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_LAST SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_8T
59874 /* Indicate the MR is ZBVA (Zero Base VA) */
59875 #define SQ_FR_PMR_HDR_ZERO_BASED UINT32_C(0x20)
59876 /*
59877 * Local Key; 24 msb of the key are used to index the MRW
59878 * table, 8 lsb are assigned to the 8 bit key_lsb field in
59879 * the MRWC.
59880 */
59881 uint32_t l_key;
59882 /* Length in bytes of registered MR */
59883 uint8_t length[5];
59884 uint8_t reserved8_1;
59885 uint8_t reserved8_2;
59886 uint8_t numlevels_pbl_page_size_log;
59887 /* PBL page size. 0 for 4KB page size, ... to 8TB. */
59888 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_MASK UINT32_C(0x1f)
59889 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_SFT 0
59890 /* Page size is 4KB. */
59891 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4K UINT32_C(0x0)
59892 /* Page size is 8KB. */
59893 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8K UINT32_C(0x1)
59894 /* Page size is 16KB. */
59895 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_16K UINT32_C(0x2)
59896 /* Page size is 32KB. */
59897 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_32K UINT32_C(0x3)
59898 /* Page size is 64KB. */
59899 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_64K UINT32_C(0x4)
59900 /* Page size is 128KB. */
59901 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_128K UINT32_C(0x5)
59902 /* Page size is 256KB. */
59903 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_256K UINT32_C(0x6)
59904 /* Page size is 512KB. */
59905 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_512K UINT32_C(0x7)
59906 /* Page size is 1MB. */
59907 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_1M UINT32_C(0x8)
59908 /* Page size is 2MB. */
59909 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_2M UINT32_C(0x9)
59910 /* Page size is 4MB. */
59911 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4M UINT32_C(0xa)
59912 /* Page size is 8MB. */
59913 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8M UINT32_C(0xb)
59914 /* Page size is 16MB. */
59915 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_16M UINT32_C(0xc)
59916 /* Page size is 32MB. */
59917 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_32M UINT32_C(0xd)
59918 /* Page size is 64MB. */
59919 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_64M UINT32_C(0xe)
59920 /* Page size is 128MB. */
59921 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_128M UINT32_C(0xf)
59922 /* Page size is 256MB. */
59923 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_256M UINT32_C(0x10)
59924 /* Page size is 512MB. */
59925 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_512M UINT32_C(0x11)
59926 /* Page size is 1GB. */
59927 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_1G UINT32_C(0x12)
59928 /* Page size is 2GB. */
59929 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_2G UINT32_C(0x13)
59930 /* Page size is 4GB. */
59931 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4G UINT32_C(0x14)
59932 /* Page size is 8GB. */
59933 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8G UINT32_C(0x15)
59934 /* Page size is 16GB. */
59935 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_16G UINT32_C(0x16)
59936 /* Page size is 32GB. */
59937 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_32G UINT32_C(0x17)
59938 /* Page size is 64GB. */
59939 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_64G UINT32_C(0x18)
59940 /* Page size is 128GB. */
59941 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_128G UINT32_C(0x19)
59942 /* Page size is 256GB. */
59943 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_256G UINT32_C(0x1a)
59944 /* Page size is 512GB. */
59945 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_512G UINT32_C(0x1b)
59946 /* Page size is 1TB. */
59947 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_1T UINT32_C(0x1c)
59948 /* Page size is 2TB. */
59949 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_2T UINT32_C(0x1d)
59950 /* Page size is 4TB. */
59951 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4T UINT32_C(0x1e)
59952 /* Page size is 8TB. */
59953 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8T UINT32_C(0x1f)
59954 #define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_LAST SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8T
59955 /* Number of levels of PBL for translation */
59956 #define SQ_FR_PMR_HDR_NUMLEVELS_MASK UINT32_C(0xc0)
59957 #define SQ_FR_PMR_HDR_NUMLEVELS_SFT 6
59958 /*
59959 * A zero level PBL means that the VA is the physical address used
59960 * for the operation. No translation is done by the PTU.
59961 */
59962 #define SQ_FR_PMR_HDR_NUMLEVELS_PHYSICAL (UINT32_C(0x0) << 6)
59963 /*
59964 * A one layer translation is provided between the logical and
59965 * physical address. The PBL points to a physical page that contains
59966 * PBE values that point to actual pg_size physical pages.
59967 */
59968 #define SQ_FR_PMR_HDR_NUMLEVELS_LAYER1 (UINT32_C(0x1) << 6)
59969 /*
59970 * A two layer translation is provided between the logical and
59971 * physical address. The PBL points to a physical page that contains
59972 * PDE values that in turn point to pbl_pg_size physical pages that contain
59973 * PBE values that point to actual physical pages.
59974 */
59975 #define SQ_FR_PMR_HDR_NUMLEVELS_LAYER2 (UINT32_C(0x2) << 6)
59976 #define SQ_FR_PMR_HDR_NUMLEVELS_LAST SQ_FR_PMR_HDR_NUMLEVELS_LAYER2
59977 /* Pointer to the PBL, or PDL depending on number of levels */
59978 uint64_t pblptr;
59979 /* Local Virtual Address */
59980 uint64_t va;
59981 } sq_fr_pmr_hdr_t, *psq_fr_pmr_hdr_t;
59982
59983 /* FR-PPMR SQ WQE */
59984 /* sq_fr_ppmr (size:1024b/128B) */
59985
59986 typedef struct sq_fr_ppmr {
59987 /* This field defines the type of SQ WQE. */
59988 uint8_t wqe_type;
59989 /*
59990 * FR-PPMR (Fast Register Proxy Physical Memory Region)
59991 *
59992 * Allowed only on reliable connection (RC) SQs.
59993 */
59994 #define SQ_FR_PPMR_WQE_TYPE_FR_PPMR UINT32_C(0xf)
59995 #define SQ_FR_PPMR_WQE_TYPE_LAST SQ_FR_PPMR_WQE_TYPE_FR_PPMR
59996 uint8_t flags;
59997 /*
59998 * Set if completion signaling is requested. If this bit is
59999 * 0, and the SQ is configured to support Unsignaled
60000 * completion the controller should not generate a CQE
60001 * unless there was an error. This refers to CQE on the
60002 * sender side (se_flag refers to the receiver side)
60003 */
60004 #define SQ_FR_PPMR_FLAGS_SIGNAL_COMP UINT32_C(0x1)
60005 /*
60006 * Indication to complete all previous RDMA Read or Atomic
60007 * WQEs on the SQ before executing this WQE
60008 */
60009 #define SQ_FR_PPMR_FLAGS_RD_OR_ATOMIC_FENCE UINT32_C(0x2)
60010 /*
60011 * Unconditional fence. Indication to complete all previous
60012 * SQ's WQEs before executing this WQE.
60013 */
60014 #define SQ_FR_PPMR_FLAGS_UC_FENCE UINT32_C(0x4)
60015 /* Not Applicable for FR_PPMR. Nothing is sent */
60016 #define SQ_FR_PPMR_FLAGS_SE UINT32_C(0x8)
60017 /* NA */
60018 #define SQ_FR_PPMR_FLAGS_INLINE UINT32_C(0x10)
60019 /*
60020 * This flag is not applicable and should be 0 for a local memory
60021 * operation WQE.
60022 */
60023 #define SQ_FR_PPMR_FLAGS_WQE_TS_EN UINT32_C(0x20)
60024 /*
60025 * When set to '1', this operation will cause a trace capture in
60026 * each block it passes through.
60027 */
60028 #define SQ_FR_PPMR_FLAGS_DEBUG_TRACE UINT32_C(0x40)
60029 /*
60030 * This is the new access control for the MR. '1' means
60031 * the operation is allowed. '' means operation is
60032 * not allowed.
60033 */
60034 uint8_t access_cntl;
60035 /* Local Write Access */
60036 #define SQ_FR_PPMR_ACCESS_CNTL_LOCAL_WRITE UINT32_C(0x1)
60037 /* Remote Read Access */
60038 #define SQ_FR_PPMR_ACCESS_CNTL_REMOTE_READ UINT32_C(0x2)
60039 /* Remote Write Access */
60040 #define SQ_FR_PPMR_ACCESS_CNTL_REMOTE_WRITE UINT32_C(0x4)
60041 /* Remote Atomic Access */
60042 #define SQ_FR_PPMR_ACCESS_CNTL_REMOTE_ATOMIC UINT32_C(0x8)
60043 /* Window Binding Allowed */
60044 #define SQ_FR_PPMR_ACCESS_CNTL_WINDOW_BIND UINT32_C(0x10)
60045 uint8_t zero_based_page_size_log;
60046 /* Page size. 0 for 4KB page size, ... to 8TB. */
60047 #define SQ_FR_PPMR_PAGE_SIZE_LOG_MASK UINT32_C(0x1f)
60048 #define SQ_FR_PPMR_PAGE_SIZE_LOG_SFT 0
60049 /* Page size is 4KB. */
60050 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_4K UINT32_C(0x0)
60051 /* Page size is 8KB. */
60052 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_8K UINT32_C(0x1)
60053 /* Page size is 16KB. */
60054 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_16K UINT32_C(0x2)
60055 /* Page size is 32KB. */
60056 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_32K UINT32_C(0x3)
60057 /* Page size is 64KB. */
60058 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_64K UINT32_C(0x4)
60059 /* Page size is 128KB. */
60060 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_128K UINT32_C(0x5)
60061 /* Page size is 256KB. */
60062 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_256K UINT32_C(0x6)
60063 /* Page size is 512KB. */
60064 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_512K UINT32_C(0x7)
60065 /* Page size is 1MB. */
60066 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_1M UINT32_C(0x8)
60067 /* Page size is 2MB. */
60068 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_2M UINT32_C(0x9)
60069 /* Page size is 4MB. */
60070 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_4M UINT32_C(0xa)
60071 /* Page size is 8MB. */
60072 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_8M UINT32_C(0xb)
60073 /* Page size is 16MB. */
60074 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_16M UINT32_C(0xc)
60075 /* Page size is 32MB. */
60076 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_32M UINT32_C(0xd)
60077 /* Page size is 64MB. */
60078 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_64M UINT32_C(0xe)
60079 /* Page size is 128MB. */
60080 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_128M UINT32_C(0xf)
60081 /* Page size is 256MB. */
60082 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_256M UINT32_C(0x10)
60083 /* Page size is 512MB. */
60084 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_512M UINT32_C(0x11)
60085 /* Page size is 1GB. */
60086 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_1G UINT32_C(0x12)
60087 /* Page size is 2GB. */
60088 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_2G UINT32_C(0x13)
60089 /* Page size is 4GB. */
60090 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_4G UINT32_C(0x14)
60091 /* Page size is 8GB. */
60092 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_8G UINT32_C(0x15)
60093 /* Page size is 16GB. */
60094 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_16G UINT32_C(0x16)
60095 /* Page size is 32GB. */
60096 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_32G UINT32_C(0x17)
60097 /* Page size is 64GB. */
60098 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_64G UINT32_C(0x18)
60099 /* Page size is 128GB. */
60100 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_128G UINT32_C(0x19)
60101 /* Page size is 256GB. */
60102 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_256G UINT32_C(0x1a)
60103 /* Page size is 512GB. */
60104 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_512G UINT32_C(0x1b)
60105 /* Page size is 1TB. */
60106 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_1T UINT32_C(0x1c)
60107 /* Page size is 2TB. */
60108 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_2T UINT32_C(0x1d)
60109 /* Page size is 4TB. */
60110 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_4T UINT32_C(0x1e)
60111 /* Page size is 8TB. */
60112 #define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_8T UINT32_C(0x1f)
60113 #define SQ_FR_PPMR_PAGE_SIZE_LOG_LAST SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_8T
60114 /* Indicate the MR is ZBVA (Zero Base VA) */
60115 #define SQ_FR_PPMR_ZERO_BASED UINT32_C(0x20)
60116 /*
60117 * Local Key; 24 msb of the key are used to index the MRW
60118 * table, 8 lsb are assigned to the 8 bit key_lsb field in
60119 * the MRWC.
60120 */
60121 uint32_t l_key;
60122 /* Length in bytes of registered MR */
60123 uint32_t length;
60124 /* Sets the proxy_vfid field of the physical memory region. */
60125 uint16_t proxy_vfid;
60126 /* Sets the proxy_pfid field of the physical memory region. */
60127 uint8_t proxy_pfid;
60128 uint8_t numlevels_pbl_page_size_log;
60129 /* PBL page size. 0 for 4KB page size, ... to 8TB. */
60130 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_MASK UINT32_C(0x1f)
60131 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_SFT 0
60132 /* Page size is 4KB. */
60133 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_4K UINT32_C(0x0)
60134 /* Page size is 8KB. */
60135 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_8K UINT32_C(0x1)
60136 /* Page size is 16KB. */
60137 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_16K UINT32_C(0x2)
60138 /* Page size is 32KB. */
60139 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_32K UINT32_C(0x3)
60140 /* Page size is 64KB. */
60141 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_64K UINT32_C(0x4)
60142 /* Page size is 128KB. */
60143 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_128K UINT32_C(0x5)
60144 /* Page size is 256KB. */
60145 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_256K UINT32_C(0x6)
60146 /* Page size is 512KB. */
60147 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_512K UINT32_C(0x7)
60148 /* Page size is 1MB. */
60149 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_1M UINT32_C(0x8)
60150 /* Page size is 2MB. */
60151 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_2M UINT32_C(0x9)
60152 /* Page size is 4MB. */
60153 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_4M UINT32_C(0xa)
60154 /* Page size is 8MB. */
60155 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_8M UINT32_C(0xb)
60156 /* Page size is 16MB. */
60157 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_16M UINT32_C(0xc)
60158 /* Page size is 32MB. */
60159 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_32M UINT32_C(0xd)
60160 /* Page size is 64MB. */
60161 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_64M UINT32_C(0xe)
60162 /* Page size is 128MB. */
60163 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_128M UINT32_C(0xf)
60164 /* Page size is 256MB. */
60165 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_256M UINT32_C(0x10)
60166 /* Page size is 512MB. */
60167 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_512M UINT32_C(0x11)
60168 /* Page size is 1GB. */
60169 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_1G UINT32_C(0x12)
60170 /* Page size is 2GB. */
60171 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_2G UINT32_C(0x13)
60172 /* Page size is 4GB. */
60173 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_4G UINT32_C(0x14)
60174 /* Page size is 8GB. */
60175 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_8G UINT32_C(0x15)
60176 /* Page size is 16GB. */
60177 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_16G UINT32_C(0x16)
60178 /* Page size is 32GB. */
60179 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_32G UINT32_C(0x17)
60180 /* Page size is 64GB. */
60181 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_64G UINT32_C(0x18)
60182 /* Page size is 128GB. */
60183 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_128G UINT32_C(0x19)
60184 /* Page size is 256GB. */
60185 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_256G UINT32_C(0x1a)
60186 /* Page size is 512GB. */
60187 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_512G UINT32_C(0x1b)
60188 /* Page size is 1TB. */
60189 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_1T UINT32_C(0x1c)
60190 /* Page size is 2TB. */
60191 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_2T UINT32_C(0x1d)
60192 /* Page size is 4TB. */
60193 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_4T UINT32_C(0x1e)
60194 /* Page size is 8TB. */
60195 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_8T UINT32_C(0x1f)
60196 #define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_LAST SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_8T
60197 /* Sets the proxy_vf_valid field of the physical memory region. */
60198 #define SQ_FR_PPMR_PROXY_VF_VALID UINT32_C(0x20)
60199 /* Number of levels of PBL for translation */
60200 #define SQ_FR_PPMR_NUMLEVELS_MASK UINT32_C(0xc0)
60201 #define SQ_FR_PPMR_NUMLEVELS_SFT 6
60202 /*
60203 * A zero level PBL means that the VA is the physical address used
60204 * for the operation. No translation is done by the PTU.
60205 */
60206 #define SQ_FR_PPMR_NUMLEVELS_PHYSICAL (UINT32_C(0x0) << 6)
60207 /*
60208 * A one layer translation is provided between the logical and
60209 * physical address. The PBL points to a physical page that contains
60210 * PBE values that point to actual pg_size physical pages.
60211 */
60212 #define SQ_FR_PPMR_NUMLEVELS_LAYER1 (UINT32_C(0x1) << 6)
60213 /*
60214 * A two layer translation is provided between the logical and
60215 * physical address. The PBL points to a physical page that contains
60216 * PDE values that in turn point to pbl_pg_size physical pages that contain
60217 * PBE values that point to actual physical pages.
60218 */
60219 #define SQ_FR_PPMR_NUMLEVELS_LAYER2 (UINT32_C(0x2) << 6)
60220 #define SQ_FR_PPMR_NUMLEVELS_LAST SQ_FR_PPMR_NUMLEVELS_LAYER2
60221 /* Pointer to the PBL, or PDL depending on number of levels */
60222 uint64_t pblptr;
60223 /* Local Virtual Address */
60224 uint64_t va;
60225 /* The data field for FR-PPMR is not used. */
60226 uint32_t data[24];
60227 } sq_fr_ppmr_t, *psq_fr_ppmr_t;
60228
60229 /* FR-PPMR SQ WQE header. */
60230 /* sq_fr_ppmr_hdr (size:256b/32B) */
60231
60232 typedef struct sq_fr_ppmr_hdr {
60233 /* This field defines the type of SQ WQE. */
60234 uint8_t wqe_type;
60235 /*
60236 * FR-PPMR (Fast Register Proxy Physical Memory Region)
60237 *
60238 * Allowed only on reliable connection (RC) SQs.
60239 */
60240 #define SQ_FR_PPMR_HDR_WQE_TYPE_FR_PPMR UINT32_C(0xf)
60241 #define SQ_FR_PPMR_HDR_WQE_TYPE_LAST SQ_FR_PPMR_HDR_WQE_TYPE_FR_PPMR
60242 uint8_t flags;
60243 /*
60244 * Set if completion signaling is requested. If this bit is
60245 * 0, and the SQ is configured to support Unsignaled
60246 * completion the controller should not generate a CQE
60247 * unless there was an error. This refers to CQE on the
60248 * sender side (se_flag refers to the receiver side)
60249 */
60250 #define SQ_FR_PPMR_HDR_FLAGS_SIGNAL_COMP UINT32_C(0x1)
60251 /*
60252 * Indication to complete all previous RDMA Read or Atomic
60253 * WQEs on the SQ before executing this WQE
60254 */
60255 #define SQ_FR_PPMR_HDR_FLAGS_RD_OR_ATOMIC_FENCE UINT32_C(0x2)
60256 /*
60257 * Unconditional fence. Indication to complete all previous
60258 * SQ's WQEs before executing this WQE.
60259 */
60260 #define SQ_FR_PPMR_HDR_FLAGS_UC_FENCE UINT32_C(0x4)
60261 /* Not Applicable for FR_PPMR. Nothing is sent */
60262 #define SQ_FR_PPMR_HDR_FLAGS_SE UINT32_C(0x8)
60263 /* NA */
60264 #define SQ_FR_PPMR_HDR_FLAGS_INLINE UINT32_C(0x10)
60265 /*
60266 * This flag is not applicable and should be 0 for a local memory
60267 * operation WQE.
60268 */
60269 #define SQ_FR_PPMR_HDR_FLAGS_WQE_TS_EN UINT32_C(0x20)
60270 /*
60271 * When set to '1', this operation will cause a trace capture in
60272 * each block it passes through.
60273 */
60274 #define SQ_FR_PPMR_HDR_FLAGS_DEBUG_TRACE UINT32_C(0x40)
60275 /*
60276 * This is the new access control for the MR. '1' means
60277 * the operation is allowed. '' means operation is
60278 * not allowed.
60279 */
60280 uint8_t access_cntl;
60281 /* Local Write Access */
60282 #define SQ_FR_PPMR_HDR_ACCESS_CNTL_LOCAL_WRITE UINT32_C(0x1)
60283 /* Remote Read Access */
60284 #define SQ_FR_PPMR_HDR_ACCESS_CNTL_REMOTE_READ UINT32_C(0x2)
60285 /* Remote Write Access */
60286 #define SQ_FR_PPMR_HDR_ACCESS_CNTL_REMOTE_WRITE UINT32_C(0x4)
60287 /* Remote Atomic Access */
60288 #define SQ_FR_PPMR_HDR_ACCESS_CNTL_REMOTE_ATOMIC UINT32_C(0x8)
60289 /* Window Binding Allowed */
60290 #define SQ_FR_PPMR_HDR_ACCESS_CNTL_WINDOW_BIND UINT32_C(0x10)
60291 uint8_t zero_based_page_size_log;
60292 /* Page size. 0 for 4KB page size, ... to 8TB. */
60293 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_MASK UINT32_C(0x1f)
60294 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_SFT 0
60295 /* Page size is 4KB. */
60296 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_4K UINT32_C(0x0)
60297 /* Page size is 8KB. */
60298 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_8K UINT32_C(0x1)
60299 /* Page size is 16KB. */
60300 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_16K UINT32_C(0x2)
60301 /* Page size is 32KB. */
60302 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_32K UINT32_C(0x3)
60303 /* Page size is 64KB. */
60304 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_64K UINT32_C(0x4)
60305 /* Page size is 128KB. */
60306 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_128K UINT32_C(0x5)
60307 /* Page size is 256KB. */
60308 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_256K UINT32_C(0x6)
60309 /* Page size is 512KB. */
60310 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_512K UINT32_C(0x7)
60311 /* Page size is 1MB. */
60312 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_1M UINT32_C(0x8)
60313 /* Page size is 2MB. */
60314 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_2M UINT32_C(0x9)
60315 /* Page size is 4MB. */
60316 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_4M UINT32_C(0xa)
60317 /* Page size is 8MB. */
60318 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_8M UINT32_C(0xb)
60319 /* Page size is 16MB. */
60320 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_16M UINT32_C(0xc)
60321 /* Page size is 32MB. */
60322 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_32M UINT32_C(0xd)
60323 /* Page size is 64MB. */
60324 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_64M UINT32_C(0xe)
60325 /* Page size is 128MB. */
60326 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_128M UINT32_C(0xf)
60327 /* Page size is 256MB. */
60328 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_256M UINT32_C(0x10)
60329 /* Page size is 512MB. */
60330 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_512M UINT32_C(0x11)
60331 /* Page size is 1GB. */
60332 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_1G UINT32_C(0x12)
60333 /* Page size is 2GB. */
60334 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_2G UINT32_C(0x13)
60335 /* Page size is 4GB. */
60336 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_4G UINT32_C(0x14)
60337 /* Page size is 8GB. */
60338 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_8G UINT32_C(0x15)
60339 /* Page size is 16GB. */
60340 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_16G UINT32_C(0x16)
60341 /* Page size is 32GB. */
60342 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_32G UINT32_C(0x17)
60343 /* Page size is 64GB. */
60344 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_64G UINT32_C(0x18)
60345 /* Page size is 128GB. */
60346 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_128G UINT32_C(0x19)
60347 /* Page size is 256GB. */
60348 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_256G UINT32_C(0x1a)
60349 /* Page size is 512GB. */
60350 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_512G UINT32_C(0x1b)
60351 /* Page size is 1TB. */
60352 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_1T UINT32_C(0x1c)
60353 /* Page size is 2TB. */
60354 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_2T UINT32_C(0x1d)
60355 /* Page size is 4TB. */
60356 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_4T UINT32_C(0x1e)
60357 /* Page size is 8TB. */
60358 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_8T UINT32_C(0x1f)
60359 #define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_LAST SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_8T
60360 /* Indicate the MR is ZBVA (Zero Base VA) */
60361 #define SQ_FR_PPMR_HDR_ZERO_BASED UINT32_C(0x20)
60362 /*
60363 * Local Key; 24 msb of the key are used to index the MRW
60364 * table, 8 lsb are assigned to the 8 bit key_lsb field in
60365 * the MRWC.
60366 */
60367 uint32_t l_key;
60368 /* Length in bytes of registered MR */
60369 uint32_t length;
60370 /* Sets the proxy_vfid field of the physical memory region. */
60371 uint16_t proxy_vfid;
60372 /* Sets the proxy_pfid field of the physical memory region. */
60373 uint8_t proxy_pfid;
60374 uint8_t numlevels_pbl_page_size_log;
60375 /* PBL page size. 0 for 4KB page size, ... to 8TB. */
60376 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_MASK UINT32_C(0x1f)
60377 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_SFT 0
60378 /* Page size is 4KB. */
60379 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4K UINT32_C(0x0)
60380 /* Page size is 8KB. */
60381 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8K UINT32_C(0x1)
60382 /* Page size is 16KB. */
60383 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_16K UINT32_C(0x2)
60384 /* Page size is 32KB. */
60385 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_32K UINT32_C(0x3)
60386 /* Page size is 64KB. */
60387 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_64K UINT32_C(0x4)
60388 /* Page size is 128KB. */
60389 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_128K UINT32_C(0x5)
60390 /* Page size is 256KB. */
60391 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_256K UINT32_C(0x6)
60392 /* Page size is 512KB. */
60393 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_512K UINT32_C(0x7)
60394 /* Page size is 1MB. */
60395 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_1M UINT32_C(0x8)
60396 /* Page size is 2MB. */
60397 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_2M UINT32_C(0x9)
60398 /* Page size is 4MB. */
60399 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4M UINT32_C(0xa)
60400 /* Page size is 8MB. */
60401 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8M UINT32_C(0xb)
60402 /* Page size is 16MB. */
60403 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_16M UINT32_C(0xc)
60404 /* Page size is 32MB. */
60405 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_32M UINT32_C(0xd)
60406 /* Page size is 64MB. */
60407 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_64M UINT32_C(0xe)
60408 /* Page size is 128MB. */
60409 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_128M UINT32_C(0xf)
60410 /* Page size is 256MB. */
60411 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_256M UINT32_C(0x10)
60412 /* Page size is 512MB. */
60413 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_512M UINT32_C(0x11)
60414 /* Page size is 1GB. */
60415 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_1G UINT32_C(0x12)
60416 /* Page size is 2GB. */
60417 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_2G UINT32_C(0x13)
60418 /* Page size is 4GB. */
60419 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4G UINT32_C(0x14)
60420 /* Page size is 8GB. */
60421 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8G UINT32_C(0x15)
60422 /* Page size is 16GB. */
60423 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_16G UINT32_C(0x16)
60424 /* Page size is 32GB. */
60425 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_32G UINT32_C(0x17)
60426 /* Page size is 64GB. */
60427 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_64G UINT32_C(0x18)
60428 /* Page size is 128GB. */
60429 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_128G UINT32_C(0x19)
60430 /* Page size is 256GB. */
60431 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_256G UINT32_C(0x1a)
60432 /* Page size is 512GB. */
60433 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_512G UINT32_C(0x1b)
60434 /* Page size is 1TB. */
60435 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_1T UINT32_C(0x1c)
60436 /* Page size is 2TB. */
60437 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_2T UINT32_C(0x1d)
60438 /* Page size is 4TB. */
60439 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4T UINT32_C(0x1e)
60440 /* Page size is 8TB. */
60441 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8T UINT32_C(0x1f)
60442 #define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_LAST SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8T
60443 /* Sets the proxy_vf_valid field of the physical memory region. */
60444 #define SQ_FR_PPMR_HDR_PROXY_VF_VALID UINT32_C(0x20)
60445 /* Number of levels of PBL for translation */
60446 #define SQ_FR_PPMR_HDR_NUMLEVELS_MASK UINT32_C(0xc0)
60447 #define SQ_FR_PPMR_HDR_NUMLEVELS_SFT 6
60448 /*
60449 * A zero level PBL means that the VA is the physical address used
60450 * for the operation. No translation is done by the PTU.
60451 */
60452 #define SQ_FR_PPMR_HDR_NUMLEVELS_PHYSICAL (UINT32_C(0x0) << 6)
60453 /*
60454 * A one layer translation is provided between the logical and
60455 * physical address. The PBL points to a physical page that contains
60456 * PBE values that point to actual pg_size physical pages.
60457 */
60458 #define SQ_FR_PPMR_HDR_NUMLEVELS_LAYER1 (UINT32_C(0x1) << 6)
60459 /*
60460 * A two layer translation is provided between the logical and
60461 * physical address. The PBL points to a physical page that contains
60462 * PDE values that in turn point to pbl_pg_size physical pages that contain
60463 * PBE values that point to actual physical pages.
60464 */
60465 #define SQ_FR_PPMR_HDR_NUMLEVELS_LAYER2 (UINT32_C(0x2) << 6)
60466 #define SQ_FR_PPMR_HDR_NUMLEVELS_LAST SQ_FR_PPMR_HDR_NUMLEVELS_LAYER2
60467 /* Pointer to the PBL, or PDL depending on number of levels */
60468 uint64_t pblptr;
60469 /* Local Virtual Address */
60470 uint64_t va;
60471 } sq_fr_ppmr_hdr_t, *psq_fr_ppmr_hdr_t;
60472
60473 /*
60474 * Bind SQ WQE. This WQE can perform either:
60475 * * type1 "bind memory window", if mw_type==Type1
60476 * * type2 "post send bind memory window", if mw_type==Type2
60477 */
60478 /* sq_bind (size:1024b/128B) */
60479
60480 typedef struct sq_bind {
60481 /* This field defines the type of SQ WQE. */
60482 uint8_t wqe_type;
60483 /*
60484 * Memory Bind
60485 *
60486 * Allowed only on reliable connection (RC) SQs.
60487 */
60488 #define SQ_BIND_WQE_TYPE_BIND UINT32_C(0xe)
60489 #define SQ_BIND_WQE_TYPE_LAST SQ_BIND_WQE_TYPE_BIND
60490 uint8_t flags;
60491 #define SQ_BIND_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK UINT32_C(0xff)
60492 #define SQ_BIND_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT 0
60493 /*
60494 * Set if completion signaling is requested. If this bit is
60495 * 0, and the SQ is configured to support Unsignaled
60496 * completion the controller should not generate a CQE
60497 * unless there was an error. This refers to CQE on the
60498 * sender side (se_flag refers to the receiver side)
60499 */
60500 #define SQ_BIND_FLAGS_SIGNAL_COMP UINT32_C(0x1)
60501 /*
60502 * Indication to complete all previous RDMA Read or Atomic
60503 * WQEs on the SQ before executing this WQE
60504 */
60505 #define SQ_BIND_FLAGS_RD_OR_ATOMIC_FENCE UINT32_C(0x2)
60506 /*
60507 * Unconditional fence. Indication to complete all previous
60508 * SQ's WQEs before executing this WQE.
60509 */
60510 #define SQ_BIND_FLAGS_UC_FENCE UINT32_C(0x4)
60511 /* NA, nothing is sent. */
60512 #define SQ_BIND_FLAGS_SE UINT32_C(0x8)
60513 /* NA */
60514 #define SQ_BIND_FLAGS_INLINE UINT32_C(0x10)
60515 /*
60516 * This flag is not applicable and should be 0 for a local memory
60517 * operation WQE.
60518 */
60519 #define SQ_BIND_FLAGS_WQE_TS_EN UINT32_C(0x20)
60520 /*
60521 * When set to '1', this operation will cause a trace capture in
60522 * each block it passes through.
60523 */
60524 #define SQ_BIND_FLAGS_DEBUG_TRACE UINT32_C(0x40)
60525 /*
60526 * This is the new access control for the MR. '1' means
60527 * the operation is allowed. '' means operation is
60528 * not allowed.
60529 */
60530 uint8_t access_cntl;
60531 #define SQ_BIND_ACCESS_CNTL_WINDOW_BIND_REMOTE_ATOMIC_REMOTE_WRITE_REMOTE_READ_LOCAL_WRITE_MASK UINT32_C(0xff)
60532 #define SQ_BIND_ACCESS_CNTL_WINDOW_BIND_REMOTE_ATOMIC_REMOTE_WRITE_REMOTE_READ_LOCAL_WRITE_SFT 0
60533 /*
60534 * Local Write Access.
60535 *
60536 * Local accesses are never allowed for memory windows, so this
60537 * bit must always be zero in a bind WQE. If this bit is ever
60538 * set, the bind will fail with an errored completion.
60539 */
60540 #define SQ_BIND_ACCESS_CNTL_LOCAL_WRITE UINT32_C(0x1)
60541 /* Remote Read Access */
60542 #define SQ_BIND_ACCESS_CNTL_REMOTE_READ UINT32_C(0x2)
60543 /*
60544 * Remote Write Access.
60545 *
60546 * Note that, if this bit is set, then the parent region to which
60547 * the window is being bound must allow local writes. If this is not
60548 * the case, then the bind will fail with an errored completion.
60549 */
60550 #define SQ_BIND_ACCESS_CNTL_REMOTE_WRITE UINT32_C(0x4)
60551 /*
60552 * Remote Atomic Access.
60553 *
60554 * Note that, if this bit is set, then the parent region to which
60555 * the window is being bound must allow local writes. If this is not
60556 * the case, then the bind will fail with an errored completion.
60557 */
60558 #define SQ_BIND_ACCESS_CNTL_REMOTE_ATOMIC UINT32_C(0x8)
60559 /*
60560 * Window Binding Allowed.
60561 *
60562 * It is never allowed to bind windows to windows, so this bit
60563 * must always be zero in a bind WQE. If this bit is ever set,
60564 * the bind will fail with an errored completion.
60565 */
60566 #define SQ_BIND_ACCESS_CNTL_WINDOW_BIND UINT32_C(0x10)
60567 /* reserved8_1 is 8 b */
60568 uint8_t reserved8_1;
60569 uint8_t mw_type_zero_based;
60570 /*
60571 * If this bit is set, then the newly-bound memory window will be
60572 * zero-based. If clear, then the newly-bound memory window will be
60573 * non-zero-based.
60574 */
60575 #define SQ_BIND_ZERO_BASED UINT32_C(0x1)
60576 /*
60577 * If type1 is specified, then this WQE performs a "bind memory window"
60578 * operation on a type1 window. If type2 is specified, then this WQE
60579 * performs a "post send bind memory window" operation on a type2
60580 * window.
60581 *
60582 * Note that the bind WQE cannot change the type of the memory window.
60583 *
60584 * If a "bind memory window" operation is attempted on a memory window
60585 * that was allocated as type2, then the bind will fail with an errored
60586 * completion, as "bind memory window" is allowed only on type1 memory
60587 * windows.
60588 *
60589 * Similarly, if a "post send bind memory window" operation is attempted
60590 * on a memory window that was allocated as type1, then the bind will fail
60591 * with an errored completions, as "post send bind memory window" is allowed
60592 * only on type2 memory windows.
60593 */
60594 #define SQ_BIND_MW_TYPE UINT32_C(0x2)
60595 /* Type 1 Bind Memory Window */
60596 #define SQ_BIND_MW_TYPE_TYPE1 (UINT32_C(0x0) << 1)
60597 /* Type 2 Post Send Bind Memory Window */
60598 #define SQ_BIND_MW_TYPE_TYPE2 (UINT32_C(0x1) << 1)
60599 #define SQ_BIND_MW_TYPE_LAST SQ_BIND_MW_TYPE_TYPE2
60600 uint8_t reserved8_2;
60601 uint16_t reserved16;
60602 /*
60603 * The L_Key of the parent MR; 24 msb of the key are used to
60604 * index the MRW table, 8 lsb are compared with the 8 bit key
60605 * in the MRWC.
60606 */
60607 uint32_t parent_l_key;
60608 /*
60609 * Local Key; 24 msb of the key are used to index the memory
60610 * window being bound in the MRW table, 8 lsb are assign to the
60611 * 8 bit key_lsb field in the MRWC.
60612 */
60613 uint32_t l_key;
60614 /* Local Virtual Address */
60615 uint64_t va;
60616 /*
60617 * Length in bytes of registered MW; 40 bits as this is the max
60618 * size of an MR/W
60619 */
60620 uint8_t length[5];
60621 uint8_t reserved24[3];
60622 /* The data field for Bind is not used. */
60623 uint32_t data[24];
60624 } sq_bind_t, *psq_bind_t;
60625
60626 /*
60627 * Bind SQ WQE header. This WQE can perform either:
60628 * * type1 "bind memory window", if mw_type==Type1
60629 * * type2 "post send bind memory window", if mw_type==Type2
60630 */
60631 /* sq_bind_hdr (size:256b/32B) */
60632
60633 typedef struct sq_bind_hdr {
60634 /* This field defines the type of SQ WQE. */
60635 uint8_t wqe_type;
60636 /*
60637 * Memory Bind
60638 *
60639 * Allowed only on reliable connection (RC) SQs.
60640 */
60641 #define SQ_BIND_HDR_WQE_TYPE_BIND UINT32_C(0xe)
60642 #define SQ_BIND_HDR_WQE_TYPE_LAST SQ_BIND_HDR_WQE_TYPE_BIND
60643 uint8_t flags;
60644 #define SQ_BIND_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK UINT32_C(0xff)
60645 #define SQ_BIND_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT 0
60646 /*
60647 * Set if completion signaling is requested. If this bit is
60648 * 0, and the SQ is configured to support Unsignaled
60649 * completion the controller should not generate a CQE
60650 * unless there was an error. This refers to CQE on the
60651 * sender side (se_flag refers to the receiver side)
60652 */
60653 #define SQ_BIND_HDR_FLAGS_SIGNAL_COMP UINT32_C(0x1)
60654 /*
60655 * Indication to complete all previous RDMA Read or Atomic
60656 * WQEs on the SQ before executing this WQE
60657 */
60658 #define SQ_BIND_HDR_FLAGS_RD_OR_ATOMIC_FENCE UINT32_C(0x2)
60659 /*
60660 * Unconditional fence. Indication to complete all previous
60661 * SQ's WQEs before executing this WQE.
60662 */
60663 #define SQ_BIND_HDR_FLAGS_UC_FENCE UINT32_C(0x4)
60664 /* NA, nothing is sent. */
60665 #define SQ_BIND_HDR_FLAGS_SE UINT32_C(0x8)
60666 /* NA */
60667 #define SQ_BIND_HDR_FLAGS_INLINE UINT32_C(0x10)
60668 /*
60669 * This flag is not applicable and should be 0 for a local memory
60670 * operation WQE.
60671 */
60672 #define SQ_BIND_HDR_FLAGS_WQE_TS_EN UINT32_C(0x20)
60673 /*
60674 * When set to '1', this operation will cause a trace capture in
60675 * each block it passes through.
60676 */
60677 #define SQ_BIND_HDR_FLAGS_DEBUG_TRACE UINT32_C(0x40)
60678 /*
60679 * This is the new access control for the MR. '1' means
60680 * the operation is allowed. '' means operation is
60681 * not allowed.
60682 */
60683 uint8_t access_cntl;
60684 #define SQ_BIND_HDR_ACCESS_CNTL_WINDOW_BIND_REMOTE_ATOMIC_REMOTE_WRITE_REMOTE_READ_LOCAL_WRITE_MASK UINT32_C(0xff)
60685 #define SQ_BIND_HDR_ACCESS_CNTL_WINDOW_BIND_REMOTE_ATOMIC_REMOTE_WRITE_REMOTE_READ_LOCAL_WRITE_SFT 0
60686 /*
60687 * Local Write Access.
60688 *
60689 * Local accesses are never allowed for memory windows, so this
60690 * bit must always be zero in a bind WQE. If this bit is ever
60691 * set, the bind will fail with an errored completion.
60692 */
60693 #define SQ_BIND_HDR_ACCESS_CNTL_LOCAL_WRITE UINT32_C(0x1)
60694 /* Remote Read Access */
60695 #define SQ_BIND_HDR_ACCESS_CNTL_REMOTE_READ UINT32_C(0x2)
60696 /*
60697 * Remote Write Access.
60698 *
60699 * Note that, if this bit is set, then the parent region to which
60700 * the window is being bound must allow local writes. If this is not
60701 * the case, then the bind will fail with an errored completion.
60702 */
60703 #define SQ_BIND_HDR_ACCESS_CNTL_REMOTE_WRITE UINT32_C(0x4)
60704 /*
60705 * Remote Atomic Access.
60706 *
60707 * Note that, if this bit is set, then the parent region to which
60708 * the window is being bound must allow local writes. If this is not
60709 * the case, then the bind will fail with an errored completion.
60710 */
60711 #define SQ_BIND_HDR_ACCESS_CNTL_REMOTE_ATOMIC UINT32_C(0x8)
60712 /*
60713 * Window Binding Allowed.
60714 *
60715 * It is never allowed to bind windows to windows, so this bit
60716 * must always be zero in a bind WQE. If this bit is ever set,
60717 * the bind will fail with an errored completion.
60718 */
60719 #define SQ_BIND_HDR_ACCESS_CNTL_WINDOW_BIND UINT32_C(0x10)
60720 /* reserved8_1 is 8 b */
60721 uint8_t reserved8_1;
60722 uint8_t mw_type_zero_based;
60723 /*
60724 * If this bit is set, then the newly-bound memory window will be
60725 * zero-based. If clear, then the newly-bound memory window will be
60726 * non-zero-based.
60727 */
60728 #define SQ_BIND_HDR_ZERO_BASED UINT32_C(0x1)
60729 /*
60730 * If type1 is specified, then this WQE performs a "bind memory window"
60731 * operation on a type1 window. If type2 is specified, then this WQE
60732 * performs a "post send bind memory window" operation on a type2
60733 * window.
60734 *
60735 * Note that the bind WQE cannot change the type of the memory window.
60736 *
60737 * If a "bind memory window" operation is attempted on a memory window
60738 * that was allocated as type2, then the bind will fail with an errored
60739 * completion, as "bind memory window" is allowed only on type1 memory
60740 * windows.
60741 *
60742 * Similarly, if a "post send bind memory window" operation is attempted
60743 * on a memory window that was allocated as type1, then the bind will fail
60744 * with an errored completions, as "post send bind memory window" is allowed
60745 * only on type2 memory windows.
60746 */
60747 #define SQ_BIND_HDR_MW_TYPE UINT32_C(0x2)
60748 /* Type 1 Bind Memory Window */
60749 #define SQ_BIND_HDR_MW_TYPE_TYPE1 (UINT32_C(0x0) << 1)
60750 /* Type 2 Post Send Bind Memory Window */
60751 #define SQ_BIND_HDR_MW_TYPE_TYPE2 (UINT32_C(0x1) << 1)
60752 #define SQ_BIND_HDR_MW_TYPE_LAST SQ_BIND_HDR_MW_TYPE_TYPE2
60753 uint8_t reserved8_2;
60754 uint16_t reserved16;
60755 /*
60756 * The L_Key of the parent MR; 24 msb of the key are used to
60757 * index the MRW table, 8 lsb are compared with the 8 bit key
60758 * in the MRWC.
60759 */
60760 uint32_t parent_l_key;
60761 /*
60762 * Local Key; 24 msb of the key are used to index the memory
60763 * window being bound in the MRW table, 8 lsb are assign to the
60764 * 8 bit key_lsb field in the MRWC.
60765 */
60766 uint32_t l_key;
60767 /* Local Virtual Address */
60768 uint64_t va;
60769 /*
60770 * Length in bytes of registered MW; 40 bits as this is the max
60771 * size of an MR/W
60772 */
60773 uint8_t length[5];
60774 uint8_t reserved24[3];
60775 } sq_bind_hdr_t, *psq_bind_hdr_t;
60776
60777 /* RQ/SRQ WQE */
60778 /* rq_wqe (size:1024b/128B) */
60779
60780 typedef struct rq_wqe {
60781 /* wqe_type is 8 b */
60782 uint8_t wqe_type;
60783 /*
60784 * RQ/SRQ WQE. This WQE is used for posting buffers on
60785 * an RQ or SRQ.
60786 */
60787 #define RQ_WQE_WQE_TYPE_RCV UINT32_C(0x80)
60788 #define RQ_WQE_WQE_TYPE_LAST RQ_WQE_WQE_TYPE_RCV
60789 /* No flags supported for this WQE type. */
60790 uint8_t flags;
60791 /*
60792 * Specify the total number 16B chunks that make up the valid
60793 * portion of the WQE. This includes the first chunk that is the
60794 * WQE structure and up to 6 SGE structures.
60795 *
60796 * While the valid area is defined by the wqe_size field, the
60797 * actual WQE size is fixed at 128B.
60798 */
60799 uint8_t wqe_size;
60800 uint8_t reserved8;
60801 uint32_t reserved32;
60802 uint64_t wr_id;
60803 /*
60804 * Opaque value used by upper layer SW to identify the id of the
60805 * WR which generated the WQE. Used in CQE. Valid in the first
60806 * SGE of an SRQ WQE.
60807 */
60808 #define RQ_WQE_WR_ID_MASK UINT32_C(0xfffff)
60809 #define RQ_WQE_WR_ID_SFT 0
60810 uint8_t reserved128[16];
60811 /*
60812 * The data field for RQ WQE is filled with from 1 to 6 SGE
60813 * structures as defined by the wqe_size field.
60814 */
60815 uint32_t data[24];
60816 } rq_wqe_t, *prq_wqe_t;
60817
60818 /* RQ/SRQ WQE header. */
60819 /* rq_wqe_hdr (size:256b/32B) */
60820
60821 typedef struct rq_wqe_hdr {
60822 /* wqe_type is 8 b */
60823 uint8_t wqe_type;
60824 /*
60825 * RQ/SRQ WQE. This WQE is used for posting buffers on
60826 * an RQ or SRQ.
60827 */
60828 #define RQ_WQE_HDR_WQE_TYPE_RCV UINT32_C(0x80)
60829 #define RQ_WQE_HDR_WQE_TYPE_LAST RQ_WQE_HDR_WQE_TYPE_RCV
60830 /* No flags supported for this WQE type. */
60831 uint8_t flags;
60832 /*
60833 * Specify the total number 16B chunks that make up the valid
60834 * portion of the WQE. This includes the first chunk that is the
60835 * WQE structure and up to 6 SGE structures.
60836 *
60837 * While the valid area is defined by the wqe_size field, the
60838 * actual WQE size is fixed at 128B.
60839 */
60840 uint8_t wqe_size;
60841 uint8_t reserved8;
60842 uint32_t reserved32;
60843 uint64_t wr_id;
60844 /*
60845 * Opaque value used by upper layer SW to identify the id of the
60846 * WR which generated the WQE. Used in CQE. Valid in the first
60847 * SGE of an SRQ WQE.
60848 */
60849 #define RQ_WQE_HDR_WR_ID_MASK UINT32_C(0xfffff)
60850 #define RQ_WQE_HDR_WR_ID_SFT 0
60851 uint8_t reserved128[16];
60852 } rq_wqe_hdr_t, *prq_wqe_hdr_t;
60853
60854 /* cq_base (size:256b/32B) */
60855
60856 typedef struct cq_base {
60857 uint64_t reserved64_1;
60858 uint64_t reserved64_2;
60859 uint64_t reserved64_3;
60860 uint8_t cqe_type_toggle;
60861 /*
60862 * Indicate valid completion - written by the chip. Cumulus
60863 * toggle this bit each time it finished consuming all PBL
60864 * entries
60865 */
60866 #define CQ_BASE_TOGGLE UINT32_C(0x1)
60867 /* This field defines the type of SQ WQE. */
60868 #define CQ_BASE_CQE_TYPE_MASK UINT32_C(0x1e)
60869 #define CQ_BASE_CQE_TYPE_SFT 1
60870 /*
60871 * Requester completion - This is used for both RC and UD SQ
60872 * completions.
60873 */
60874 #define CQ_BASE_CQE_TYPE_REQ (UINT32_C(0x0) << 1)
60875 /*
60876 * Responder RC Completion - This is used for both RQ and SRQ
60877 * completions for RC service QPs.
60878 */
60879 #define CQ_BASE_CQE_TYPE_RES_RC (UINT32_C(0x1) << 1)
60880 /*
60881 * Responder UD Completion - This is used for both RQ and SRQ
60882 * completion for UD service QPs.
60883 */
60884 #define CQ_BASE_CQE_TYPE_RES_UD (UINT32_C(0x2) << 1)
60885 /*
60886 * Responder RawEth and QP1 Completion - This is used for RQ
60887 * completion for RawEth service and QP1 service QPs.
60888 */
60889 #define CQ_BASE_CQE_TYPE_RES_RAWETH_QP1 (UINT32_C(0x3) << 1)
60890 /*
60891 * Responder UD completion with CFA. This is used for both RQ
60892 * and SQ completion for UD service QPs. It includes cfa fields
60893 * (some of which carry VLAN information), in place of QP handle.
60894 */
60895 #define CQ_BASE_CQE_TYPE_RES_UD_CFA (UINT32_C(0x4) << 1)
60896 /*
60897 * NO_OP completion - This is used to indicate that no
60898 * operation completion.
60899 */
60900 #define CQ_BASE_CQE_TYPE_NO_OP (UINT32_C(0xd) << 1)
60901 /*
60902 * Terminal completion - This is used to indicate that no
60903 * further completions will be made for this QP on this CQ.
60904 */
60905 #define CQ_BASE_CQE_TYPE_TERMINAL (UINT32_C(0xe) << 1)
60906 /* Cut off CQE; for CQ resize see CQ and SRQ Resize */
60907 #define CQ_BASE_CQE_TYPE_CUT_OFF (UINT32_C(0xf) << 1)
60908 #define CQ_BASE_CQE_TYPE_LAST CQ_BASE_CQE_TYPE_CUT_OFF
60909 /* This field indicates the status for the CQE. */
60910 uint8_t status;
60911 uint16_t reserved16;
60912 uint32_t reserved32;
60913 } cq_base_t, *pcq_base_t;
60914
60915 /* Requester CQ CQE */
60916 /* cq_req (size:256b/32B) */
60917
60918 typedef struct cq_req {
60919 /*
60920 * This is an application level ID used to identify the
60921 * QP and its SQ and RQ.
60922 */
60923 uint64_t qp_handle;
60924 /*
60925 * SQ Consumer Index - points to the entry just past the last WQE
60926 * that has been completed by the chip. Wraps around at
60927 * QPC.sq_size (i.e. the valid range of the SQ Consumer Index is 0
60928 * to (QPC.sq_size - 1)).
60929 */
60930 uint16_t sq_cons_idx;
60931 uint16_t reserved16_1;
60932 uint32_t reserved32_2;
60933 uint64_t reserved64;
60934 uint8_t cqe_type_toggle;
60935 /*
60936 * Indicate valid completion - written by the chip. Cumulus
60937 * toggle this bit each time it finished consuming all PBL
60938 * entries
60939 */
60940 #define CQ_REQ_TOGGLE UINT32_C(0x1)
60941 /* This field defines the type of SQ WQE. */
60942 #define CQ_REQ_CQE_TYPE_MASK UINT32_C(0x1e)
60943 #define CQ_REQ_CQE_TYPE_SFT 1
60944 /*
60945 * Requester completion - This is used for both RC and UD SQ
60946 * completions.
60947 */
60948 #define CQ_REQ_CQE_TYPE_REQ (UINT32_C(0x0) << 1)
60949 #define CQ_REQ_CQE_TYPE_LAST CQ_REQ_CQE_TYPE_REQ
60950 /*
60951 * When this bit is '1', it indicates that the packet completed
60952 * was transmitted using the push accelerated data provided by
60953 * the driver. When this bit is '', it indicates that the packet
60954 * had not push acceleration data written or was executed as a
60955 * normal packet even though push data was provided.
60956 * This field is intended to be used for driver-generated push
60957 * statistics. It is not applicable for RC since not all RC packets
60958 * return a CQE.
60959 */
60960 #define CQ_REQ_PUSH UINT32_C(0x20)
60961 /* This field indicates the status for the CQE. */
60962 uint8_t status;
60963 /* OK is 0 */
60964 #define CQ_REQ_STATUS_OK UINT32_C(0x0)
60965 /* BAD_RESPONSE_ERR is 1 */
60966 #define CQ_REQ_STATUS_BAD_RESPONSE_ERR UINT32_C(0x1)
60967 /* LOCAL_LENGTH_ERR is 2 */
60968 #define CQ_REQ_STATUS_LOCAL_LENGTH_ERR UINT32_C(0x2)
60969 /* LOCAL_QP_OPERATION_ERR is 3 */
60970 #define CQ_REQ_STATUS_LOCAL_QP_OPERATION_ERR UINT32_C(0x3)
60971 /* LOCAL_PROTECTION_ERR is 4 */
60972 #define CQ_REQ_STATUS_LOCAL_PROTECTION_ERR UINT32_C(0x4)
60973 /* MEMORY_MGT_OPERATION_ERR is 5 */
60974 #define CQ_REQ_STATUS_MEMORY_MGT_OPERATION_ERR UINT32_C(0x5)
60975 /* REMOTE_INVALID_REQUEST_ERR is 6 */
60976 #define CQ_REQ_STATUS_REMOTE_INVALID_REQUEST_ERR UINT32_C(0x6)
60977 /* REMOTE_ACCESS_ERR is 7 */
60978 #define CQ_REQ_STATUS_REMOTE_ACCESS_ERR UINT32_C(0x7)
60979 /* REMOTE_OPERATION_ERR is 8 */
60980 #define CQ_REQ_STATUS_REMOTE_OPERATION_ERR UINT32_C(0x8)
60981 /* RNR_NAK_RETRY_CNT_ERR is 9 */
60982 #define CQ_REQ_STATUS_RNR_NAK_RETRY_CNT_ERR UINT32_C(0x9)
60983 /* TRANSPORT_RETRY_CNT_ERR is 10 */
60984 #define CQ_REQ_STATUS_TRANSPORT_RETRY_CNT_ERR UINT32_C(0xa)
60985 /* WORK_REQUEST_FLUSHED_ERR is 11 */
60986 #define CQ_REQ_STATUS_WORK_REQUEST_FLUSHED_ERR UINT32_C(0xb)
60987 #define CQ_REQ_STATUS_LAST CQ_REQ_STATUS_WORK_REQUEST_FLUSHED_ERR
60988 uint16_t reserved16_2;
60989 uint32_t reserved32_1;
60990 } cq_req_t, *pcq_req_t;
60991
60992 /* Responder RC CQE */
60993 /* cq_res_rc (size:256b/32B) */
60994
60995 typedef struct cq_res_rc {
60996 /*
60997 * The length of the message's payload in bytes, stored in
60998 * the SGEs
60999 */
61000 uint32_t length;
61001 /*
61002 * Immediate data in case the imm_flag set, R_Key to be
61003 * invalidated in case inv_flag is set.
61004 */
61005 uint32_t imm_data_or_inv_r_key;
61006 /*
61007 * This is an application level ID used to identify the
61008 * QP and its SQ and RQ.
61009 */
61010 uint64_t qp_handle;
61011 /*
61012 * Opaque value - valid when inv_flag is set. Used by driver
61013 * to reference the buffer used to store PBL when the MR was
61014 * fast registered. The driver can reclaim this buffer after
61015 * an MR was remotely invalidated. The controller take that
61016 * value from the MR referenced by R_Key
61017 */
61018 uint64_t mr_handle;
61019 uint8_t cqe_type_toggle;
61020 /*
61021 * Indicate valid completion - written by the chip. Cumulus
61022 * toggle this bit each time it finished consuming all PBL
61023 * entries
61024 */
61025 #define CQ_RES_RC_TOGGLE UINT32_C(0x1)
61026 /* This field defines the type of SQ WQE. */
61027 #define CQ_RES_RC_CQE_TYPE_MASK UINT32_C(0x1e)
61028 #define CQ_RES_RC_CQE_TYPE_SFT 1
61029 /*
61030 * Responder RC Completion - This is used for both RQ and SRQ
61031 * completions for RC service QPs.
61032 */
61033 #define CQ_RES_RC_CQE_TYPE_RES_RC (UINT32_C(0x1) << 1)
61034 #define CQ_RES_RC_CQE_TYPE_LAST CQ_RES_RC_CQE_TYPE_RES_RC
61035 /* This field indicates the status for the CQE. */
61036 uint8_t status;
61037 /* OK is 0 */
61038 #define CQ_RES_RC_STATUS_OK UINT32_C(0x0)
61039 /* LOCAL_ACCESS_ERROR is 1 */
61040 #define CQ_RES_RC_STATUS_LOCAL_ACCESS_ERROR UINT32_C(0x1)
61041 /* LOCAL_LENGTH_ERR is 2 */
61042 #define CQ_RES_RC_STATUS_LOCAL_LENGTH_ERR UINT32_C(0x2)
61043 /* LOCAL_PROTECTION_ERR is 3 */
61044 #define CQ_RES_RC_STATUS_LOCAL_PROTECTION_ERR UINT32_C(0x3)
61045 /* LOCAL_QP_OPERATION_ERR is 4 */
61046 #define CQ_RES_RC_STATUS_LOCAL_QP_OPERATION_ERR UINT32_C(0x4)
61047 /* MEMORY_MGT_OPERATION_ERR is 5 */
61048 #define CQ_RES_RC_STATUS_MEMORY_MGT_OPERATION_ERR UINT32_C(0x5)
61049 /* REMOTE_INVALID_REQUEST_ERR is 6 */
61050 #define CQ_RES_RC_STATUS_REMOTE_INVALID_REQUEST_ERR UINT32_C(0x6)
61051 /* WORK_REQUEST_FLUSHED_ERR is 7 */
61052 #define CQ_RES_RC_STATUS_WORK_REQUEST_FLUSHED_ERR UINT32_C(0x7)
61053 /* HW_FLUSH_ERR is 8 */
61054 #define CQ_RES_RC_STATUS_HW_FLUSH_ERR UINT32_C(0x8)
61055 #define CQ_RES_RC_STATUS_LAST CQ_RES_RC_STATUS_HW_FLUSH_ERR
61056 uint16_t flags;
61057 /*
61058 * This flag indicates that the completion is for a SRQ entry
61059 * rather than for an RQ entry.
61060 */
61061 #define CQ_RES_RC_FLAGS_SRQ UINT32_C(0x1)
61062 /* CQE relates to RQ WQE. */
61063 #define CQ_RES_RC_FLAGS_SRQ_RQ UINT32_C(0x0)
61064 /* CQE relates to SRQ WQE. */
61065 #define CQ_RES_RC_FLAGS_SRQ_SRQ UINT32_C(0x1)
61066 #define CQ_RES_RC_FLAGS_SRQ_LAST CQ_RES_RC_FLAGS_SRQ_SRQ
61067 /* Immediate data indicator */
61068 #define CQ_RES_RC_FLAGS_IMM UINT32_C(0x2)
61069 /* R_Key invalidate indicator */
61070 #define CQ_RES_RC_FLAGS_INV UINT32_C(0x4)
61071 #define CQ_RES_RC_FLAGS_RDMA UINT32_C(0x8)
61072 /* CQE relates to an incoming Send request */
61073 #define CQ_RES_RC_FLAGS_RDMA_SEND (UINT32_C(0x0) << 3)
61074 /* CQE relates to incoming RDMA Write request */
61075 #define CQ_RES_RC_FLAGS_RDMA_RDMA_WRITE (UINT32_C(0x1) << 3)
61076 #define CQ_RES_RC_FLAGS_RDMA_LAST CQ_RES_RC_FLAGS_RDMA_RDMA_WRITE
61077 uint32_t srq_or_rq_wr_id;
61078 /*
61079 * Opaque value from RQ or SRQ WQE. Used by driver/lib to
61080 * reference the WQE in order to claim the received data
61081 * and reuse the WQE space
61082 */
61083 #define CQ_RES_RC_SRQ_OR_RQ_WR_ID_MASK UINT32_C(0xfffff)
61084 #define CQ_RES_RC_SRQ_OR_RQ_WR_ID_SFT 0
61085 } cq_res_rc_t, *pcq_res_rc_t;
61086
61087 /* Responder UD CQE */
61088 /* cq_res_ud (size:256b/32B) */
61089
61090 typedef struct cq_res_ud {
61091 uint16_t length;
61092 /*
61093 * The length of the message's payload in bytes, stored in
61094 * the SGEs
61095 */
61096 #define CQ_RES_UD_LENGTH_MASK UINT32_C(0x3fff)
61097 #define CQ_RES_UD_LENGTH_SFT 0
61098 /*
61099 * This is data from the CFA or VNIC block as indicated by the
61100 * ext_meta_format and meta_format fields.
61101 */
61102 uint16_t cfa_metadata;
61103 /* When meta_format=1, this value is the VLAN VID. */
61104 #define CQ_RES_UD_CFA_METADATA_VID_MASK UINT32_C(0xfff)
61105 #define CQ_RES_UD_CFA_METADATA_VID_SFT 0
61106 /* When meta_format=1, this value is the VLAN DE. */
61107 #define CQ_RES_UD_CFA_METADATA_DE UINT32_C(0x1000)
61108 /* When meta_format=1, this value is the VLAN PRI. */
61109 #define CQ_RES_UD_CFA_METADATA_PRI_MASK UINT32_C(0xe000)
61110 #define CQ_RES_UD_CFA_METADATA_PRI_SFT 13
61111 /* Immediate data in case the imm_flag set. */
61112 uint32_t imm_data;
61113 /*
61114 * This is an application level ID used to identify the
61115 * QP and its SQ and RQ.
61116 */
61117 uint64_t qp_handle;
61118 /*
61119 * Source MAC address for the UD message placed in the WQE
61120 * that is completed by this CQE.
61121 */
61122 uint16_t src_mac[3];
61123 /* Lower 16b of the Source QP value from the DETH header. */
61124 uint16_t src_qp_low;
61125 uint8_t cqe_type_toggle;
61126 /*
61127 * Indicate valid completion - written by the chip. Cumulus
61128 * toggle this bit each time it finished consuming all PBL
61129 * entries
61130 */
61131 #define CQ_RES_UD_TOGGLE UINT32_C(0x1)
61132 /* This field defines the type of SQ WQE. */
61133 #define CQ_RES_UD_CQE_TYPE_MASK UINT32_C(0x1e)
61134 #define CQ_RES_UD_CQE_TYPE_SFT 1
61135 /*
61136 * Responder UD Completion - This is used for both RQ and SRQ
61137 * completion for UD service QPs.
61138 */
61139 #define CQ_RES_UD_CQE_TYPE_RES_UD (UINT32_C(0x2) << 1)
61140 #define CQ_RES_UD_CQE_TYPE_LAST CQ_RES_UD_CQE_TYPE_RES_UD
61141 /* This field indicates the status for the CQE. */
61142 uint8_t status;
61143 /*
61144 * This indicates that the completion is without error.
61145 * All fields are valid.
61146 */
61147 #define CQ_RES_UD_STATUS_OK UINT32_C(0x0)
61148 /*
61149 * This indicates that write access was not allowed for
61150 * at least one of the SGEs in the WQE.
61151 *
61152 * This is a fatal error. Only the srq_or_rq_wr_id is field
61153 * is valid.
61154 */
61155 #define CQ_RES_UD_STATUS_LOCAL_ACCESS_ERROR UINT32_C(0x1)
61156 /*
61157 * This indicates that the packet was too long for the WQE
61158 * provided on the SRQ/RQ.
61159 *
61160 * This is not a fatal error. All the fields are valid.
61161 */
61162 #define CQ_RES_UD_STATUS_HW_LOCAL_LENGTH_ERR UINT32_C(0x2)
61163 /* LOCAL_PROTECTION_ERR is 3 */
61164 #define CQ_RES_UD_STATUS_LOCAL_PROTECTION_ERR UINT32_C(0x3)
61165 /* LOCAL_QP_OPERATION_ERR is 4 */
61166 #define CQ_RES_UD_STATUS_LOCAL_QP_OPERATION_ERR UINT32_C(0x4)
61167 /* MEMORY_MGT_OPERATION_ERR is 5 */
61168 #define CQ_RES_UD_STATUS_MEMORY_MGT_OPERATION_ERR UINT32_C(0x5)
61169 /* WORK_REQUEST_FLUSHED_ERR is 7 */
61170 #define CQ_RES_UD_STATUS_WORK_REQUEST_FLUSHED_ERR UINT32_C(0x7)
61171 /* HW_FLUSH_ERR is 8 */
61172 #define CQ_RES_UD_STATUS_HW_FLUSH_ERR UINT32_C(0x8)
61173 #define CQ_RES_UD_STATUS_LAST CQ_RES_UD_STATUS_HW_FLUSH_ERR
61174 uint16_t flags;
61175 /*
61176 * This flag indicates that the completion is for a SRQ entry
61177 * rather than for an RQ entry.
61178 */
61179 #define CQ_RES_UD_FLAGS_SRQ UINT32_C(0x1)
61180 /* CQE relates to RQ WQE. */
61181 #define CQ_RES_UD_FLAGS_SRQ_RQ UINT32_C(0x0)
61182 /* CQE relates to SRQ WQE. */
61183 #define CQ_RES_UD_FLAGS_SRQ_SRQ UINT32_C(0x1)
61184 #define CQ_RES_UD_FLAGS_SRQ_LAST CQ_RES_UD_FLAGS_SRQ_SRQ
61185 /* Immediate data indicator */
61186 #define CQ_RES_UD_FLAGS_IMM UINT32_C(0x2)
61187 #define CQ_RES_UD_FLAGS_UNUSED_MASK UINT32_C(0xc)
61188 #define CQ_RES_UD_FLAGS_UNUSED_SFT 2
61189 #define CQ_RES_UD_FLAGS_ROCE_IP_VER_MASK UINT32_C(0x30)
61190 #define CQ_RES_UD_FLAGS_ROCE_IP_VER_SFT 4
61191 /* RoCEv1 Message */
61192 #define CQ_RES_UD_FLAGS_ROCE_IP_VER_V1 (UINT32_C(0x0) << 4)
61193 /* RoCEv2 IPv4 Message */
61194 #define CQ_RES_UD_FLAGS_ROCE_IP_VER_V2IPV4 (UINT32_C(0x2) << 4)
61195 /* RoCEv2 IPv6 Message */
61196 #define CQ_RES_UD_FLAGS_ROCE_IP_VER_V2IPV6 (UINT32_C(0x3) << 4)
61197 #define CQ_RES_UD_FLAGS_ROCE_IP_VER_LAST CQ_RES_UD_FLAGS_ROCE_IP_VER_V2IPV6
61198 /*
61199 * The combination of this value and ext_meta_format indicates
61200 * what format the metadata field is.
61201 */
61202 #define CQ_RES_UD_FLAGS_META_FORMAT_MASK UINT32_C(0x3c0)
61203 #define CQ_RES_UD_FLAGS_META_FORMAT_SFT 6
61204 /* No metadata information. Value is zero. */
61205 #define CQ_RES_UD_FLAGS_META_FORMAT_NONE (UINT32_C(0x0) << 6)
61206 /*
61207 * The metadata field contains the VLAN tag and TPID value.
61208 * - metadata[11:0] contains the vlan VID value.
61209 * - metadata[12] contains the vlan DE value.
61210 * - metadata[15:13] contains the vlan PRI value.
61211 */
61212 #define CQ_RES_UD_FLAGS_META_FORMAT_VLAN (UINT32_C(0x1) << 6)
61213 /*
61214 * If ext_meta_format is equal to 1, the metadata field
61215 * contains the lower 16b of the tunnel ID value, justified
61216 * to LSB
61217 * - VXLAN = VNI[23:0] -> VXLAN Network ID
61218 * - Geneve (NGE) = VNI[23:0] -> Virtual Network Identifier.
61219 * - NVGRE = TNI[23:0] -> Tenant Network ID
61220 * - GRE = KEY[31:0] -> key field with bit mask. zero if K = 0
61221 * - IPV4 = 0 (not populated)
61222 * - IPV6 = Flow Label[19:0]
61223 * - PPPoE = sessionID[15:0]
61224 * - MPLs = Outer label[19:0]
61225 * - UPAR = Selected[31:0] with bit mask
61226 */
61227 #define CQ_RES_UD_FLAGS_META_FORMAT_TUNNEL_ID (UINT32_C(0x2) << 6)
61228 /*
61229 * if ext_meta_format is equal to 1, metadata field contains
61230 * 16b metadata from the prepended header (chdr_data).
61231 */
61232 #define CQ_RES_UD_FLAGS_META_FORMAT_CHDR_DATA (UINT32_C(0x3) << 6)
61233 /*
61234 * If ext_meta_format is equal to 1, the metadata field contains
61235 * the outer_l3_offset and lower 7 bits of the inner_l2_offset,
61236 * - metadata[8:0] contains the outer_l3_offset.
61237 * - metadata[15:9] contains the inner_l2_offset[6:0]
61238 */
61239 #define CQ_RES_UD_FLAGS_META_FORMAT_HDR_OFFSET (UINT32_C(0x4) << 6)
61240 #define CQ_RES_UD_FLAGS_META_FORMAT_LAST CQ_RES_UD_FLAGS_META_FORMAT_HDR_OFFSET
61241 /*
61242 * The combination of this value and meta_format indicates what
61243 * format the metadata field is
61244 */
61245 #define CQ_RES_UD_FLAGS_EXT_META_FORMAT_MASK UINT32_C(0xc00)
61246 #define CQ_RES_UD_FLAGS_EXT_META_FORMAT_SFT 10
61247 uint32_t src_qp_high_srq_or_rq_wr_id;
61248 /*
61249 * Opaque value from RQ or SRQ WQE. Used by driver/lib to
61250 * reference the WQE in order to claim the received data
61251 * and reuse the WQE space
61252 */
61253 #define CQ_RES_UD_SRQ_OR_RQ_WR_ID_MASK UINT32_C(0xfffff)
61254 #define CQ_RES_UD_SRQ_OR_RQ_WR_ID_SFT 0
61255 /* Upper 8b of the Source QP value from the DETH header. */
61256 #define CQ_RES_UD_SRC_QP_HIGH_MASK UINT32_C(0xff000000)
61257 #define CQ_RES_UD_SRC_QP_HIGH_SFT 24
61258 } cq_res_ud_t, *pcq_res_ud_t;
61259
61260 /* Responder UD CQE version 2 */
61261 /* cq_res_ud_v2 (size:256b/32B) */
61262
61263 typedef struct cq_res_ud_v2 {
61264 uint16_t length;
61265 /*
61266 * The length of the message's payload in bytes, stored in
61267 * the SGEs
61268 */
61269 #define CQ_RES_UD_V2_LENGTH_MASK UINT32_C(0x3fff)
61270 #define CQ_RES_UD_V2_LENGTH_SFT 0
61271 /* This is data from the CFA as indicated by the meta_format field. */
61272 uint16_t cfa_metadata0;
61273 /* When meta_format=1, this value is the VLAN VID. */
61274 #define CQ_RES_UD_V2_CFA_METADATA0_VID_MASK UINT32_C(0xfff)
61275 #define CQ_RES_UD_V2_CFA_METADATA0_VID_SFT 0
61276 /* When meta_format=1, this value is the VLAN DE. */
61277 #define CQ_RES_UD_V2_CFA_METADATA0_DE UINT32_C(0x1000)
61278 /* When meta_format=1, this value is the VLAN PRI. */
61279 #define CQ_RES_UD_V2_CFA_METADATA0_PRI_MASK UINT32_C(0xe000)
61280 #define CQ_RES_UD_V2_CFA_METADATA0_PRI_SFT 13
61281 /* Immediate data in case the imm_flag set. */
61282 uint32_t imm_data;
61283 /*
61284 * This is an application level ID used to identify the
61285 * QP and its SQ and RQ.
61286 */
61287 uint64_t qp_handle;
61288 /*
61289 * Source MAC address for the UD message placed in the WQE
61290 * that is completed by this CQE.
61291 */
61292 uint16_t src_mac[3];
61293 /* Lower 16b of the Source QP value from the DETH header. */
61294 uint16_t src_qp_low;
61295 uint8_t cqe_type_toggle;
61296 /*
61297 * Indicate valid completion - written by the chip. Cumulus
61298 * toggle this bit each time it finished consuming all PBL
61299 * entries
61300 */
61301 #define CQ_RES_UD_V2_TOGGLE UINT32_C(0x1)
61302 /* This field defines the type of SQ WQE. */
61303 #define CQ_RES_UD_V2_CQE_TYPE_MASK UINT32_C(0x1e)
61304 #define CQ_RES_UD_V2_CQE_TYPE_SFT 1
61305 /*
61306 * Responder UD Completion - This is used for both RQ and SRQ
61307 * completion for UD service QPs.
61308 */
61309 #define CQ_RES_UD_V2_CQE_TYPE_RES_UD (UINT32_C(0x2) << 1)
61310 #define CQ_RES_UD_V2_CQE_TYPE_LAST CQ_RES_UD_V2_CQE_TYPE_RES_UD
61311 /* This field indicates the status for the CQE. */
61312 uint8_t status;
61313 /*
61314 * This indicates that the completion is without error.
61315 * All fields are valid.
61316 */
61317 #define CQ_RES_UD_V2_STATUS_OK UINT32_C(0x0)
61318 /*
61319 * This indicates that write access was not allowed for
61320 * at least one of the SGEs in the WQE.
61321 *
61322 * This is a fatal error. Only the srq_or_rq_wr_id is field
61323 * is valid.
61324 */
61325 #define CQ_RES_UD_V2_STATUS_LOCAL_ACCESS_ERROR UINT32_C(0x1)
61326 /*
61327 * This indicates that the packet was too long for the WQE
61328 * provided on the SRQ/RQ.
61329 *
61330 * This is not a fatal error. All the fields are valid.
61331 */
61332 #define CQ_RES_UD_V2_STATUS_HW_LOCAL_LENGTH_ERR UINT32_C(0x2)
61333 /* LOCAL_PROTECTION_ERR is 3 */
61334 #define CQ_RES_UD_V2_STATUS_LOCAL_PROTECTION_ERR UINT32_C(0x3)
61335 /* LOCAL_QP_OPERATION_ERR is 4 */
61336 #define CQ_RES_UD_V2_STATUS_LOCAL_QP_OPERATION_ERR UINT32_C(0x4)
61337 /* MEMORY_MGT_OPERATION_ERR is 5 */
61338 #define CQ_RES_UD_V2_STATUS_MEMORY_MGT_OPERATION_ERR UINT32_C(0x5)
61339 /* WORK_REQUEST_FLUSHED_ERR is 7 */
61340 #define CQ_RES_UD_V2_STATUS_WORK_REQUEST_FLUSHED_ERR UINT32_C(0x7)
61341 /* HW_FLUSH_ERR is 8 */
61342 #define CQ_RES_UD_V2_STATUS_HW_FLUSH_ERR UINT32_C(0x8)
61343 #define CQ_RES_UD_V2_STATUS_LAST CQ_RES_UD_V2_STATUS_HW_FLUSH_ERR
61344 uint16_t flags;
61345 /*
61346 * This flag indicates that the completion is for a SRQ entry
61347 * rather than for an RQ entry.
61348 */
61349 #define CQ_RES_UD_V2_FLAGS_SRQ UINT32_C(0x1)
61350 /* CQE relates to RQ WQE. */
61351 #define CQ_RES_UD_V2_FLAGS_SRQ_RQ UINT32_C(0x0)
61352 /* CQE relates to SRQ WQE. */
61353 #define CQ_RES_UD_V2_FLAGS_SRQ_SRQ UINT32_C(0x1)
61354 #define CQ_RES_UD_V2_FLAGS_SRQ_LAST CQ_RES_UD_V2_FLAGS_SRQ_SRQ
61355 /* Immediate data indicator */
61356 #define CQ_RES_UD_V2_FLAGS_IMM UINT32_C(0x2)
61357 #define CQ_RES_UD_V2_FLAGS_UNUSED_MASK UINT32_C(0xc)
61358 #define CQ_RES_UD_V2_FLAGS_UNUSED_SFT 2
61359 #define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_MASK UINT32_C(0x30)
61360 #define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_SFT 4
61361 /* RoCEv1 Message */
61362 #define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_V1 (UINT32_C(0x0) << 4)
61363 /* RoCEv2 IPv4 Message */
61364 #define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_V2IPV4 (UINT32_C(0x2) << 4)
61365 /* RoCEv2 IPv6 Message */
61366 #define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_V2IPV6 (UINT32_C(0x3) << 4)
61367 #define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_LAST CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_V2IPV6
61368 /* The field indicates what format the metadata field is. */
61369 #define CQ_RES_UD_V2_FLAGS_META_FORMAT_MASK UINT32_C(0x3c0)
61370 #define CQ_RES_UD_V2_FLAGS_META_FORMAT_SFT 6
61371 /* No metadata information. Value is zero. */
61372 #define CQ_RES_UD_V2_FLAGS_META_FORMAT_NONE (UINT32_C(0x0) << 6)
61373 /*
61374 * The {metadata1, metadata0} fields contain the vtag
61375 * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
61376 * de, vid[11:0]} The metadata2 field contains the table scope
61377 * and action record pointer. - metadata2[25:0] contains the
61378 * action record pointer. - metadata2[31:26] contains the table
61379 * scope.
61380 */
61381 #define CQ_RES_UD_V2_FLAGS_META_FORMAT_ACT_REC_PTR (UINT32_C(0x1) << 6)
61382 /*
61383 * The {metadata1, metadata0} fields contain the vtag
61384 * information:
61385 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
61386 * The metadata2 field contains the Tunnel ID
61387 * value, justified to LSB. i
61388 * - VXLAN = VNI[23:0] -> VXLAN Network ID
61389 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
61390 * - NVGRE = TNI[23:0] -> Tenant Network ID
61391 * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
61392 * - IPv4 = 0 (not populated)
61393 * - IPv6 = Flow Label[19:0]
61394 * - PPPoE = sessionID[15:0]
61395 * - MPLs = Outer label[19:0]
61396 * - UPAR = Selected[31:0] with bit mask
61397 */
61398 #define CQ_RES_UD_V2_FLAGS_META_FORMAT_TUNNEL_ID (UINT32_C(0x2) << 6)
61399 /*
61400 * The {metadata1, metadata0} fields contain the vtag
61401 * information:
61402 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
61403 * The metadata2 field contains the 32b metadata from the
61404 * prepended header (chdr_data).
61405 */
61406 #define CQ_RES_UD_V2_FLAGS_META_FORMAT_CHDR_DATA (UINT32_C(0x3) << 6)
61407 /*
61408 * If ext_meta_format is equal to 1, the metadata field contains
61409 * the outer_l3_offset and lower 7 bits of the inner_l2_offset,
61410 * - metadata[8:0] contains the outer_l3_offset.
61411 * - metadata[15:9] contains the inner_l2_offset[6:0]
61412 */
61413 #define CQ_RES_UD_V2_FLAGS_META_FORMAT_HDR_OFFSET (UINT32_C(0x4) << 6)
61414 #define CQ_RES_UD_V2_FLAGS_META_FORMAT_LAST CQ_RES_UD_V2_FLAGS_META_FORMAT_HDR_OFFSET
61415 uint32_t src_qp_high_srq_or_rq_wr_id;
61416 /*
61417 * Opaque value from RQ or SRQ WQE. Used by driver/lib to
61418 * reference the WQE in order to claim the received data
61419 * and reuse the WQE space
61420 */
61421 #define CQ_RES_UD_V2_SRQ_OR_RQ_WR_ID_MASK UINT32_C(0xfffff)
61422 #define CQ_RES_UD_V2_SRQ_OR_RQ_WR_ID_SFT 0
61423 #define CQ_RES_UD_V2_CFA_METADATA1_MASK UINT32_C(0xf00000)
61424 #define CQ_RES_UD_V2_CFA_METADATA1_SFT 20
61425 /* When meta_format != 0, this value is the VLAN TPID_SEL. */
61426 #define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_MASK UINT32_C(0x700000)
61427 #define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_SFT 20
61428 /* 0x88a8 */
61429 #define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPID88A8 (UINT32_C(0x0) << 20)
61430 /* 0x8100 */
61431 #define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPID8100 (UINT32_C(0x1) << 20)
61432 /* 0x9100 */
61433 #define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPID9100 (UINT32_C(0x2) << 20)
61434 /* 0x9200 */
61435 #define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPID9200 (UINT32_C(0x3) << 20)
61436 /* 0x9300 */
61437 #define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPID9300 (UINT32_C(0x4) << 20)
61438 /* Value programmed in CFA VLANTPID register. */
61439 #define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPIDCFG (UINT32_C(0x5) << 20)
61440 #define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_LAST CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPIDCFG
61441 /* When meta_format != 0, this value is the VLAN valid. */
61442 #define CQ_RES_UD_V2_CFA_METADATA1_VALID UINT32_C(0x800000)
61443 /* Upper 8b of the Source QP value from the DETH header. */
61444 #define CQ_RES_UD_V2_SRC_QP_HIGH_MASK UINT32_C(0xff000000)
61445 #define CQ_RES_UD_V2_SRC_QP_HIGH_SFT 24
61446 } cq_res_ud_v2_t, *pcq_res_ud_v2_t;
61447
61448 /* Responder UD with CFA CQE */
61449 /* cq_res_ud_cfa (size:256b/32B) */
61450
61451 typedef struct cq_res_ud_cfa {
61452 uint16_t length;
61453 /*
61454 * The length of the message's payload in bytes, stored in
61455 * the SGEs
61456 */
61457 #define CQ_RES_UD_CFA_LENGTH_MASK UINT32_C(0x3fff)
61458 #define CQ_RES_UD_CFA_LENGTH_SFT 0
61459 /*
61460 * This field identifies the CFA action rule that was used
61461 * for this packet.
61462 */
61463 uint16_t cfa_code;
61464 /* Immediate data in case the imm_flag set. */
61465 uint32_t imm_data;
61466 uint32_t qid;
61467 /*
61468 * This value indicates the QPID associated with this operation.
61469 * The driver will use the qid from thie CQE to map a QP handle
61470 * in the completion record returned to the application.
61471 */
61472 #define CQ_RES_UD_CFA_QID_MASK UINT32_C(0xfffff)
61473 #define CQ_RES_UD_CFA_QID_SFT 0
61474 /*
61475 * This is data from the CFA or VNIC block as indicated by the
61476 * ext_meta_format and meta_format fields.
61477 */
61478 uint32_t cfa_metadata;
61479 /* When meta_format=1, this value is the VLAN VID. */
61480 #define CQ_RES_UD_CFA_CFA_METADATA_VID_MASK UINT32_C(0xfff)
61481 #define CQ_RES_UD_CFA_CFA_METADATA_VID_SFT 0
61482 /* When meta_format=1, this value is the VLAN DE. */
61483 #define CQ_RES_UD_CFA_CFA_METADATA_DE UINT32_C(0x1000)
61484 /* When meta_format=1, this value is the VLAN PRI. */
61485 #define CQ_RES_UD_CFA_CFA_METADATA_PRI_MASK UINT32_C(0xe000)
61486 #define CQ_RES_UD_CFA_CFA_METADATA_PRI_SFT 13
61487 /* When meta_format=1, this value is the VLAN TPID. */
61488 #define CQ_RES_UD_CFA_CFA_METADATA_TPID_MASK UINT32_C(0xffff0000)
61489 #define CQ_RES_UD_CFA_CFA_METADATA_TPID_SFT 16
61490 /*
61491 * Source MAC address for the UD message placed in the WQE
61492 * that is completed by this CQE.
61493 */
61494 uint16_t src_mac[3];
61495 /* Lower 16b of the Source QP value from the DETH header. */
61496 uint16_t src_qp_low;
61497 uint8_t cqe_type_toggle;
61498 /*
61499 * Indicate valid completion - written by the chip. Cumulus
61500 * toggle this bit each time it finished consuming all PBL
61501 * entries
61502 */
61503 #define CQ_RES_UD_CFA_TOGGLE UINT32_C(0x1)
61504 /* This field defines the type of SQ WQE. */
61505 #define CQ_RES_UD_CFA_CQE_TYPE_MASK UINT32_C(0x1e)
61506 #define CQ_RES_UD_CFA_CQE_TYPE_SFT 1
61507 /*
61508 * Responder UD Completion with CFA - This is used for both RQ
61509 * and SRQ completion for UD service QPs. It includes cfa fields
61510 * (some of which carry VLAN information), in place of the QP
61511 * handle. It is also used for QP1 QPs that are treated as UD.
61512 */
61513 #define CQ_RES_UD_CFA_CQE_TYPE_RES_UD_CFA (UINT32_C(0x4) << 1)
61514 #define CQ_RES_UD_CFA_CQE_TYPE_LAST CQ_RES_UD_CFA_CQE_TYPE_RES_UD_CFA
61515 /* This field indicates the status for the CQE. */
61516 uint8_t status;
61517 /*
61518 * This indicates that the completion is without error.
61519 * All fields are valid.
61520 */
61521 #define CQ_RES_UD_CFA_STATUS_OK UINT32_C(0x0)
61522 /*
61523 * This indicates that write access was not allowed for
61524 * at least one of the SGEs in the WQE.
61525 *
61526 * This is a fatal error. Only the srq_or_rq_wr_id is field
61527 * is valid.
61528 */
61529 #define CQ_RES_UD_CFA_STATUS_LOCAL_ACCESS_ERROR UINT32_C(0x1)
61530 /*
61531 * This indicates that the packet was too long for the WQE
61532 * provided on the SRQ/RQ.
61533 *
61534 * This is not a fatal error. All the fields are valid.
61535 */
61536 #define CQ_RES_UD_CFA_STATUS_HW_LOCAL_LENGTH_ERR UINT32_C(0x2)
61537 /* LOCAL_PROTECTION_ERR is 3 */
61538 #define CQ_RES_UD_CFA_STATUS_LOCAL_PROTECTION_ERR UINT32_C(0x3)
61539 /* LOCAL_QP_OPERATION_ERR is 4 */
61540 #define CQ_RES_UD_CFA_STATUS_LOCAL_QP_OPERATION_ERR UINT32_C(0x4)
61541 /* MEMORY_MGT_OPERATION_ERR is 5 */
61542 #define CQ_RES_UD_CFA_STATUS_MEMORY_MGT_OPERATION_ERR UINT32_C(0x5)
61543 /* WORK_REQUEST_FLUSHED_ERR is 7 */
61544 #define CQ_RES_UD_CFA_STATUS_WORK_REQUEST_FLUSHED_ERR UINT32_C(0x7)
61545 /* HW_FLUSH_ERR is 8 */
61546 #define CQ_RES_UD_CFA_STATUS_HW_FLUSH_ERR UINT32_C(0x8)
61547 #define CQ_RES_UD_CFA_STATUS_LAST CQ_RES_UD_CFA_STATUS_HW_FLUSH_ERR
61548 uint16_t flags;
61549 /*
61550 * This flag indicates that the completion is for a SRQ entry
61551 * rather than for an RQ entry.
61552 */
61553 #define CQ_RES_UD_CFA_FLAGS_SRQ UINT32_C(0x1)
61554 /* CQE relates to RQ WQE. */
61555 #define CQ_RES_UD_CFA_FLAGS_SRQ_RQ UINT32_C(0x0)
61556 /* CQE relates to SRQ WQE. */
61557 #define CQ_RES_UD_CFA_FLAGS_SRQ_SRQ UINT32_C(0x1)
61558 #define CQ_RES_UD_CFA_FLAGS_SRQ_LAST CQ_RES_UD_CFA_FLAGS_SRQ_SRQ
61559 /* Immediate data indicator */
61560 #define CQ_RES_UD_CFA_FLAGS_IMM UINT32_C(0x2)
61561 #define CQ_RES_UD_CFA_FLAGS_UNUSED_MASK UINT32_C(0xc)
61562 #define CQ_RES_UD_CFA_FLAGS_UNUSED_SFT 2
61563 #define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_MASK UINT32_C(0x30)
61564 #define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_SFT 4
61565 /* RoCEv1 Message */
61566 #define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_V1 (UINT32_C(0x0) << 4)
61567 /* RoCEv2 IPv4 Message */
61568 #define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_V2IPV4 (UINT32_C(0x2) << 4)
61569 /* RoCEv2 IPv6 Message */
61570 #define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_V2IPV6 (UINT32_C(0x3) << 4)
61571 #define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_LAST CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_V2IPV6
61572 /*
61573 * The combination of this value and ext_meta_format indicates
61574 * what format the metadata field is.
61575 */
61576 #define CQ_RES_UD_CFA_FLAGS_META_FORMAT_MASK UINT32_C(0x3c0)
61577 #define CQ_RES_UD_CFA_FLAGS_META_FORMAT_SFT 6
61578 /*
61579 * If ext_meta_format is equal to 0, there is no metadata
61580 * information. Value is zero.
61581 */
61582 #define CQ_RES_UD_CFA_FLAGS_META_FORMAT_NONE (UINT32_C(0x0) << 6)
61583 /*
61584 * If ext_meta_format is equal to 0, the metadata field contains
61585 * the VLAN tag and TPID value.
61586 * - metadata[11:0] contains the vlan VID value.
61587 * - metadata[12] contains the vlan DE value.
61588 * - metadata[15:13] contains the vlan PRI value.
61589 * - metadata[31:16] contains the vlan TPID value.
61590 */
61591 #define CQ_RES_UD_CFA_FLAGS_META_FORMAT_VLAN (UINT32_C(0x1) << 6)
61592 /*
61593 * If ext_meta_format is equal to 1, the metadata field contains
61594 * the Tunnel ID value, justified to LSB.
61595 * - VXLAN = VNI[23:0] -> VXLAN Network ID
61596 * - Geneve (NGE) = VNI[23:0] -> Virtual Network Identifier
61597 * - NVGRE = TNI[23:0] -> Tenant Network ID
61598 * - GRE = KEY[31:0] -> key field with bit mask. zero if K = 0
61599 * - IPV4 = 0 (not populated)
61600 * - IPV6 = Flow Label[19:0]
61601 * - PPPoE = sessionID[15:0]
61602 * - MPLs = Outer label[19:0]
61603 * - UPAR = Selected[31:0] with bit mask
61604 */
61605 #define CQ_RES_UD_CFA_FLAGS_META_FORMAT_TUNNEL_ID (UINT32_C(0x2) << 6)
61606 /*
61607 * if ext_meta_format is equal to 1, metadata field contains
61608 * 16b metadata from the prepended header (chdr_data).
61609 */
61610 #define CQ_RES_UD_CFA_FLAGS_META_FORMAT_CHDR_DATA (UINT32_C(0x3) << 6)
61611 /*
61612 * If ext_meta_format is equal to 1, the metadata field contains
61613 * the outer_l3_offset, inner_l2_offset, inner_l3_offset, and
61614 * inner_l4_size.
61615 * - metadata[8:0] contains the outer_l3_offset.
61616 * - metadata[17:9] contains the inner_l2_offset.
61617 * - metadata[26:18] contains the inner_l3_offset.
61618 * - metadata[31:27] contains the inner_l4_size.
61619 */
61620 #define CQ_RES_UD_CFA_FLAGS_META_FORMAT_HDR_OFFSET (UINT32_C(0x4) << 6)
61621 #define CQ_RES_UD_CFA_FLAGS_META_FORMAT_LAST CQ_RES_UD_CFA_FLAGS_META_FORMAT_HDR_OFFSET
61622 /*
61623 * The combination of this value and meta_format indicates what
61624 * format the metadata field is
61625 */
61626 #define CQ_RES_UD_CFA_FLAGS_EXT_META_FORMAT_MASK UINT32_C(0xc00)
61627 #define CQ_RES_UD_CFA_FLAGS_EXT_META_FORMAT_SFT 10
61628 uint32_t src_qp_high_srq_or_rq_wr_id;
61629 /*
61630 * Opaque value from RQ or SRQ WQE. Used by driver/lib to
61631 * reference the WQE in order to claim the received data
61632 * and reuse the WQE space
61633 */
61634 #define CQ_RES_UD_CFA_SRQ_OR_RQ_WR_ID_MASK UINT32_C(0xfffff)
61635 #define CQ_RES_UD_CFA_SRQ_OR_RQ_WR_ID_SFT 0
61636 /* Upper 8b of the Source QP value from the DETH header. */
61637 #define CQ_RES_UD_CFA_SRC_QP_HIGH_MASK UINT32_C(0xff000000)
61638 #define CQ_RES_UD_CFA_SRC_QP_HIGH_SFT 24
61639 } cq_res_ud_cfa_t, *pcq_res_ud_cfa_t;
61640
61641 /* Responder UD with CFA CQE version 2 */
61642 /* cq_res_ud_cfa_v2 (size:256b/32B) */
61643
61644 typedef struct cq_res_ud_cfa_v2 {
61645 uint16_t length;
61646 /*
61647 * The length of the message's payload in bytes, stored in
61648 * the SGEs
61649 */
61650 #define CQ_RES_UD_CFA_V2_LENGTH_MASK UINT32_C(0x3fff)
61651 #define CQ_RES_UD_CFA_V2_LENGTH_SFT 0
61652 /* This is data from the CFA as indicated by the meta_format field. */
61653 uint16_t cfa_metadata0;
61654 /* When meta_format=1, this value is the VLAN VID. */
61655 #define CQ_RES_UD_CFA_V2_CFA_METADATA0_VID_MASK UINT32_C(0xfff)
61656 #define CQ_RES_UD_CFA_V2_CFA_METADATA0_VID_SFT 0
61657 /* When meta_format=1, this value is the VLAN DE. */
61658 #define CQ_RES_UD_CFA_V2_CFA_METADATA0_DE UINT32_C(0x1000)
61659 /* When meta_format=1, this value is the VLAN PRI. */
61660 #define CQ_RES_UD_CFA_V2_CFA_METADATA0_PRI_MASK UINT32_C(0xe000)
61661 #define CQ_RES_UD_CFA_V2_CFA_METADATA0_PRI_SFT 13
61662 /* Immediate data in case the imm_flag set. */
61663 uint32_t imm_data;
61664 uint32_t qid;
61665 /*
61666 * This value indicates the QPID associated with this operation.
61667 * The driver will use the qid from thie CQE to map a QP handle
61668 * in the completion record returned to the application.
61669 */
61670 #define CQ_RES_UD_CFA_V2_QID_MASK UINT32_C(0xfffff)
61671 #define CQ_RES_UD_CFA_V2_QID_SFT 0
61672 /*
61673 * This is data from the CFA block as indicated by the meta_format
61674 * field.
61675 * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
61676 * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
61677 * act_rec_ptr[25:0]}
61678 * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
61679 * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
61680 * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
61681 * When vee_cmpl_mode is set in VNIC context, this is the upper 32b
61682 * of the host address from the first BD used to place the packet.
61683 */
61684 uint32_t cfa_metadata2;
61685 /*
61686 * Source MAC address for the UD message placed in the WQE
61687 * that is completed by this CQE.
61688 */
61689 uint16_t src_mac[3];
61690 /* Lower 16b of the Source QP value from the DETH header. */
61691 uint16_t src_qp_low;
61692 uint8_t cqe_type_toggle;
61693 /*
61694 * Indicate valid completion - written by the chip. Cumulus
61695 * toggle this bit each time it finished consuming all PBL
61696 * entries
61697 */
61698 #define CQ_RES_UD_CFA_V2_TOGGLE UINT32_C(0x1)
61699 /* This field defines the type of SQ WQE. */
61700 #define CQ_RES_UD_CFA_V2_CQE_TYPE_MASK UINT32_C(0x1e)
61701 #define CQ_RES_UD_CFA_V2_CQE_TYPE_SFT 1
61702 /*
61703 * Responder UD Completion with CFA - This is used for both RQ
61704 * and SRQ completion for UD service QPs. It includes cfa fields
61705 * (some of which carry VLAN information), in place of the QP
61706 * handle. It is also used for QP1 QPs that are treated as UD.
61707 */
61708 #define CQ_RES_UD_CFA_V2_CQE_TYPE_RES_UD_CFA (UINT32_C(0x4) << 1)
61709 #define CQ_RES_UD_CFA_V2_CQE_TYPE_LAST CQ_RES_UD_CFA_V2_CQE_TYPE_RES_UD_CFA
61710 /* This field indicates the status for the CQE. */
61711 uint8_t status;
61712 /*
61713 * This indicates that the completion is without error.
61714 * All fields are valid.
61715 */
61716 #define CQ_RES_UD_CFA_V2_STATUS_OK UINT32_C(0x0)
61717 /*
61718 * This indicates that write access was not allowed for
61719 * at least one of the SGEs in the WQE.
61720 *
61721 * This is a fatal error. Only the srq_or_rq_wr_id is field
61722 * is valid.
61723 */
61724 #define CQ_RES_UD_CFA_V2_STATUS_LOCAL_ACCESS_ERROR UINT32_C(0x1)
61725 /*
61726 * This indicates that the packet was too long for the WQE
61727 * provided on the SRQ/RQ.
61728 *
61729 * This is not a fatal error. All the fields are valid.
61730 */
61731 #define CQ_RES_UD_CFA_V2_STATUS_HW_LOCAL_LENGTH_ERR UINT32_C(0x2)
61732 /* LOCAL_PROTECTION_ERR is 3 */
61733 #define CQ_RES_UD_CFA_V2_STATUS_LOCAL_PROTECTION_ERR UINT32_C(0x3)
61734 /* LOCAL_QP_OPERATION_ERR is 4 */
61735 #define CQ_RES_UD_CFA_V2_STATUS_LOCAL_QP_OPERATION_ERR UINT32_C(0x4)
61736 /* MEMORY_MGT_OPERATION_ERR is 5 */
61737 #define CQ_RES_UD_CFA_V2_STATUS_MEMORY_MGT_OPERATION_ERR UINT32_C(0x5)
61738 /* WORK_REQUEST_FLUSHED_ERR is 7 */
61739 #define CQ_RES_UD_CFA_V2_STATUS_WORK_REQUEST_FLUSHED_ERR UINT32_C(0x7)
61740 /* HW_FLUSH_ERR is 8 */
61741 #define CQ_RES_UD_CFA_V2_STATUS_HW_FLUSH_ERR UINT32_C(0x8)
61742 #define CQ_RES_UD_CFA_V2_STATUS_LAST CQ_RES_UD_CFA_V2_STATUS_HW_FLUSH_ERR
61743 uint16_t flags;
61744 /*
61745 * This flag indicates that the completion is for a SRQ entry
61746 * rather than for an RQ entry.
61747 */
61748 #define CQ_RES_UD_CFA_V2_FLAGS_SRQ UINT32_C(0x1)
61749 /* CQE relates to RQ WQE. */
61750 #define CQ_RES_UD_CFA_V2_FLAGS_SRQ_RQ UINT32_C(0x0)
61751 /* CQE relates to SRQ WQE. */
61752 #define CQ_RES_UD_CFA_V2_FLAGS_SRQ_SRQ UINT32_C(0x1)
61753 #define CQ_RES_UD_CFA_V2_FLAGS_SRQ_LAST CQ_RES_UD_CFA_V2_FLAGS_SRQ_SRQ
61754 /* Immediate data indicator */
61755 #define CQ_RES_UD_CFA_V2_FLAGS_IMM UINT32_C(0x2)
61756 #define CQ_RES_UD_CFA_V2_FLAGS_UNUSED_MASK UINT32_C(0xc)
61757 #define CQ_RES_UD_CFA_V2_FLAGS_UNUSED_SFT 2
61758 #define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_MASK UINT32_C(0x30)
61759 #define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_SFT 4
61760 /* RoCEv1 Message */
61761 #define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_V1 (UINT32_C(0x0) << 4)
61762 /* RoCEv2 IPv4 Message */
61763 #define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_V2IPV4 (UINT32_C(0x2) << 4)
61764 /* RoCEv2 IPv6 Message */
61765 #define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_V2IPV6 (UINT32_C(0x3) << 4)
61766 #define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_LAST CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_V2IPV6
61767 /* The field indicates what format the metadata field is. */
61768 #define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_MASK UINT32_C(0x3c0)
61769 #define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_SFT 6
61770 /* No metadata information. Value is zero. */
61771 #define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_NONE (UINT32_C(0x0) << 6)
61772 /*
61773 * The {metadata1, metadata0} fields contain the vtag
61774 * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
61775 * de, vid[11:0]} The metadata2 field contains the table scope
61776 * and action record pointer. - metadata2[25:0] contains the
61777 * action record pointer. - metadata2[31:26] contains the table
61778 * scope.
61779 */
61780 #define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_ACT_REC_PTR (UINT32_C(0x1) << 6)
61781 /*
61782 * The {metadata1, metadata0} fields contain the vtag
61783 * information:
61784 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
61785 * The metadata2 field contains the Tunnel ID
61786 * value, justified to LSB. i
61787 * - VXLAN = VNI[23:0] -> VXLAN Network ID
61788 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
61789 * - NVGRE = TNI[23:0] -> Tenant Network ID
61790 * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
61791 * - IPv4 = 0 (not populated)
61792 * - IPv6 = Flow Label[19:0]
61793 * - PPPoE = sessionID[15:0]
61794 * - MPLs = Outer label[19:0]
61795 * - UPAR = Selected[31:0] with bit mask
61796 */
61797 #define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_TUNNEL_ID (UINT32_C(0x2) << 6)
61798 /*
61799 * The {metadata1, metadata0} fields contain the vtag
61800 * information:
61801 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
61802 * The metadata2 field contains the 32b metadata from the
61803 * prepended header (chdr_data).
61804 */
61805 #define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_CHDR_DATA (UINT32_C(0x3) << 6)
61806 /*
61807 * If ext_meta_format is equal to 1, the metadata field contains
61808 * the outer_l3_offset and lower 7 bits of the inner_l2_offset,
61809 * - metadata[8:0] contains the outer_l3_offset.
61810 * - metadata[15:9] contains the inner_l2_offset[6:0]
61811 */
61812 #define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_HDR_OFFSET (UINT32_C(0x4) << 6)
61813 #define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_LAST CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_HDR_OFFSET
61814 uint32_t src_qp_high_srq_or_rq_wr_id;
61815 /*
61816 * Opaque value from RQ or SRQ WQE. Used by driver/lib to
61817 * reference the WQE in order to claim the received data
61818 * and reuse the WQE space
61819 */
61820 #define CQ_RES_UD_CFA_V2_SRQ_OR_RQ_WR_ID_MASK UINT32_C(0xfffff)
61821 #define CQ_RES_UD_CFA_V2_SRQ_OR_RQ_WR_ID_SFT 0
61822 #define CQ_RES_UD_CFA_V2_CFA_METADATA1_MASK UINT32_C(0xf00000)
61823 #define CQ_RES_UD_CFA_V2_CFA_METADATA1_SFT 20
61824 /* When meta_format != 0, this value is the VLAN TPID_SEL. */
61825 #define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_MASK UINT32_C(0x700000)
61826 #define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_SFT 20
61827 /* 0x88a8 */
61828 #define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPID88A8 (UINT32_C(0x0) << 20)
61829 /* 0x8100 */
61830 #define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPID8100 (UINT32_C(0x1) << 20)
61831 /* 0x9100 */
61832 #define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPID9100 (UINT32_C(0x2) << 20)
61833 /* 0x9200 */
61834 #define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPID9200 (UINT32_C(0x3) << 20)
61835 /* 0x9300 */
61836 #define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPID9300 (UINT32_C(0x4) << 20)
61837 /* Value programmed in CFA VLANTPID register. */
61838 #define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPIDCFG (UINT32_C(0x5) << 20)
61839 #define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_LAST CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPIDCFG
61840 /* When meta_format != 0, this value is the VLAN valid. */
61841 #define CQ_RES_UD_CFA_V2_CFA_METADATA1_VALID UINT32_C(0x800000)
61842 /* Upper 8b of the Source QP value from the DETH header. */
61843 #define CQ_RES_UD_CFA_V2_SRC_QP_HIGH_MASK UINT32_C(0xff000000)
61844 #define CQ_RES_UD_CFA_V2_SRC_QP_HIGH_SFT 24
61845 } cq_res_ud_cfa_v2_t, *pcq_res_ud_cfa_v2_t;
61846
61847 /* Responder RawEth and QP1 CQE */
61848 /* cq_res_raweth_qp1 (size:256b/32B) */
61849
61850 typedef struct cq_res_raweth_qp1 {
61851 uint16_t length;
61852 /*
61853 * The length of the message's payload in bytes, stored in
61854 * the SGEs
61855 */
61856 #define CQ_RES_RAWETH_QP1_LENGTH_MASK UINT32_C(0x3fff)
61857 #define CQ_RES_RAWETH_QP1_LENGTH_SFT 0
61858 uint16_t raweth_qp1_flags;
61859 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_MASK UINT32_C(0x3ff)
61860 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_SFT 0
61861 /*
61862 * When this bit is '1', it indicates a packet that has an
61863 * error of some type. Type of error is indicated in
61864 * raweth_qp1_errors.
61865 */
61866 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ERROR UINT32_C(0x1)
61867 /*
61868 * This value indicates what the inner packet determined for the
61869 * packet was.
61870 */
61871 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_MASK UINT32_C(0x3c0)
61872 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_SFT 6
61873 /*
61874 * Not Known:
61875 * Indicates that the packet type was not known.
61876 */
61877 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_NOT_KNOWN (UINT32_C(0x0) << 6)
61878 /*
61879 * IP Packet:
61880 * Indicates that the packet was an IP packet, but further
61881 * classification was not possible.
61882 */
61883 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_IP (UINT32_C(0x1) << 6)
61884 /*
61885 * TCP Packet:
61886 * Indicates that the packet was IP and TCP.
61887 * This indicates that the raweth_qp1_payload_offset field is valid.
61888 */
61889 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_TCP (UINT32_C(0x2) << 6)
61890 /*
61891 * UDP Packet:
61892 * Indicates that the packet was IP and UDP.
61893 * This indicates that the raweth_qp1_payload_offset field is valid.
61894 */
61895 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_UDP (UINT32_C(0x3) << 6)
61896 /*
61897 * FCoE Packet:
61898 * Indicates that the packet was recognized as a FCoE.
61899 * This also indicates that the raweth_qp1_payload_offset field is valid.
61900 */
61901 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_FCOE (UINT32_C(0x4) << 6)
61902 /*
61903 * RoCE Packet:
61904 * Indicates that the packet was recognized as a RoCE.
61905 * This also indicates that the raweth_qp1_payload_offset field is valid.
61906 */
61907 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_ROCE (UINT32_C(0x5) << 6)
61908 /*
61909 * ICMP Packet:
61910 * Indicates that the packet was recognized as ICMP.
61911 * This indicates that the raweth_qp1_payload_offset field is valid.
61912 */
61913 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_ICMP (UINT32_C(0x7) << 6)
61914 /*
61915 * PtP packet wo/timestamp:
61916 * Indicates that the packet was recognized as a PtP
61917 * packet.
61918 */
61919 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_PTP_WO_TIMESTAMP (UINT32_C(0x8) << 6)
61920 /*
61921 * PtP packet w/timestamp:
61922 * Indicates that the packet was recognized as a PtP
61923 * packet and that a timestamp was taken for the packet.
61924 */
61925 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP (UINT32_C(0x9) << 6)
61926 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_LAST CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP
61927 uint16_t raweth_qp1_errors;
61928 /*
61929 * This indicates that there was an error in the IP header
61930 * checksum.
61931 */
61932 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_IP_CS_ERROR UINT32_C(0x10)
61933 /*
61934 * This indicates that there was an error in the TCP, UDP
61935 * or ICMP checksum.
61936 */
61937 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_L4_CS_ERROR UINT32_C(0x20)
61938 /*
61939 * This indicates that there was an error in the tunnel
61940 * IP header checksum.
61941 */
61942 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_IP_CS_ERROR UINT32_C(0x40)
61943 /*
61944 * This indicates that there was an error in the tunnel
61945 * UDP checksum.
61946 */
61947 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_L4_CS_ERROR UINT32_C(0x80)
61948 /*
61949 * This indicates that there was a CRC error on either an FCoE
61950 * or RoCE packet. The itype indicates the packet type.
61951 */
61952 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_CRC_ERROR UINT32_C(0x100)
61953 /*
61954 * This indicates that there was an error in the tunnel
61955 * portion of the packet when this
61956 * field is non-zero.
61957 */
61958 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_MASK UINT32_C(0xe00)
61959 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_SFT 9
61960 /*
61961 * No additional error occurred on the tunnel portion
61962 * of the packet of the packet does not have a tunnel.
61963 */
61964 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_NO_ERROR (UINT32_C(0x0) << 9)
61965 /*
61966 * Indicates that IP header version does not match
61967 * expectation from L2 Ethertype for IPv4 and IPv6
61968 * in the tunnel header.
61969 */
61970 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION (UINT32_C(0x1) << 9)
61971 /*
61972 * Indicates that header length is out of range in the
61973 * tunnel header. Valid for
61974 * IPv4.
61975 */
61976 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN (UINT32_C(0x2) << 9)
61977 /*
61978 * Indicates that the physical packet is shorter than that
61979 * claimed by the PPPoE header length for a tunnel PPPoE
61980 * packet.
61981 */
61982 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR (UINT32_C(0x3) << 9)
61983 /*
61984 * Indicates that physical packet is shorter than that claimed
61985 * by the tunnel l3 header length. Valid for IPv4, or IPv6
61986 * tunnel packet packets.
61987 */
61988 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR (UINT32_C(0x4) << 9)
61989 /*
61990 * Indicates that the physical packet is shorter than that
61991 * claimed by the tunnel UDP header length for a tunnel
61992 * UDP packet that is not fragmented.
61993 */
61994 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR (UINT32_C(0x5) << 9)
61995 /*
61996 * indicates that the IPv4 TTL or IPv6 hop limit check
61997 * have failed (e.g. TTL = 0) in the tunnel header. Valid
61998 * for IPv4, and IPv6.
61999 */
62000 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL (UINT32_C(0x6) << 9)
62001 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_LAST CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL
62002 /*
62003 * This indicates that there was an error in the inner
62004 * portion of the packet when this
62005 * field is non-zero.
62006 */
62007 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_MASK UINT32_C(0xf000)
62008 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_SFT 12
62009 /*
62010 * No additional error occurred on the tunnel portion
62011 * of the packet of the packet does not have a tunnel.
62012 */
62013 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_NO_ERROR (UINT32_C(0x0) << 12)
62014 /*
62015 * Indicates that IP header version does not match
62016 * expectation from L2 Ethertype for IPv4 and IPv6 or that
62017 * option other than VFT was parsed on
62018 * FCoE packet.
62019 */
62020 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_VERSION (UINT32_C(0x1) << 12)
62021 /*
62022 * indicates that header length is out of range. Valid for
62023 * IPv4 and RoCE
62024 */
62025 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN (UINT32_C(0x2) << 12)
62026 /*
62027 * indicates that the IPv4 TTL or IPv6 hop limit check
62028 * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
62029 */
62030 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_TTL (UINT32_C(0x3) << 12)
62031 /*
62032 * Indicates that physical packet is shorter than that
62033 * claimed by the l3 header length. Valid for IPv4,
62034 * IPv6 packet or RoCE packets.
62035 */
62036 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_IP_TOTAL_ERROR (UINT32_C(0x4) << 12)
62037 /*
62038 * Indicates that the physical packet is shorter than that
62039 * claimed by the UDP header length for a UDP packet that is
62040 * not fragmented.
62041 */
62042 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR (UINT32_C(0x5) << 12)
62043 /*
62044 * Indicates that TCP header length > IP payload. Valid for
62045 * TCP packets only.
62046 */
62047 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN (UINT32_C(0x6) << 12)
62048 /* Indicates that TCP header length < 5. Valid for TCP. */
62049 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL (UINT32_C(0x7) << 12)
62050 /*
62051 * Indicates that TCP option headers result in a TCP header
62052 * size that does not match data offset in TCP header. Valid
62053 * for TCP.
62054 */
62055 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN (UINT32_C(0x8) << 12)
62056 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_LAST CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
62057 /*
62058 * This field identifies the CFA action rule that was used for this
62059 * packet.
62060 */
62061 uint16_t raweth_qp1_cfa_code;
62062 /*
62063 * This is an application level ID used to identify the
62064 * QP and its SQ and RQ.
62065 */
62066 uint64_t qp_handle;
62067 uint32_t raweth_qp1_flags2;
62068 /*
62069 * This indicates that the ip checksum was calculated for the
62070 * inner packet and that the ip_cs_error field indicates if there
62071 * was an error.
62072 */
62073 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_IP_CS_CALC UINT32_C(0x1)
62074 /*
62075 * This indicates that the TCP, UDP or ICMP checksum was
62076 * calculated for the inner packet and that the l4_cs_error field
62077 * indicates if there was an error.
62078 */
62079 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_L4_CS_CALC UINT32_C(0x2)
62080 /*
62081 * This indicates that the ip checksum was calculated for the
62082 * tunnel header and that the t_ip_cs_error field indicates if there
62083 * was an error.
62084 */
62085 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_T_IP_CS_CALC UINT32_C(0x4)
62086 /*
62087 * This indicates that the UDP checksum was
62088 * calculated for the tunnel packet and that the t_l4_cs_error field
62089 * indicates if there was an error.
62090 */
62091 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_T_L4_CS_CALC UINT32_C(0x8)
62092 /* This value indicates what format the raweth_qp1_metadata field is. */
62093 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_MASK UINT32_C(0xf0)
62094 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_SFT 4
62095 /* No metadata information. Value is zero. */
62096 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_NONE (UINT32_C(0x0) << 4)
62097 /*
62098 * The raweth_qp1_metadata field contains the VLAN tag and TPID value.
62099 * - raweth_qp1_metadata[11:0] contains the vlan VID value.
62100 * - raweth_qp1_metadata[12] contains the vlan DE value.
62101 * - raweth_qp1_metadata[15:13] contains the vlan PRI value.
62102 * - raweth_qp1_metadata[31:16] contains the vlan TPID value.
62103 */
62104 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_VLAN (UINT32_C(0x1) << 4)
62105 /*
62106 * If ext_meta_format is equal to 1, the metadata field
62107 * contains the lower 16b of the tunnel ID value, justified
62108 * to LSB
62109 * - VXLAN = VNI[23:0] -> VXLAN Network ID
62110 * - Geneve (NGE) = VNI[23:0] -> Virtual Network Identifier.
62111 * - NVGRE = TNI[23:0] -> Tenant Network ID
62112 * - GRE = KEY[31:0] -> key field with bit mask. zero if K = 0
62113 * - IPV4 = 0 (not populated)
62114 * - IPV6 = Flow Label[19:0]
62115 * - PPPoE = sessionID[15:0]
62116 * - MPLs = Outer label[19:0]
62117 * - UPAR = Selected[31:0] with bit mask
62118 */
62119 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_TUNNEL_ID (UINT32_C(0x2) << 4)
62120 /*
62121 * if ext_meta_format is equal to 1, metadata field contains
62122 * 16b metadata from the prepended header (chdr_data).
62123 */
62124 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_CHDR_DATA (UINT32_C(0x3) << 4)
62125 /*
62126 * If ext_meta_format is equal to 1, the metadata field contains
62127 * the outer_l3_offset and lower 7 bits of the inner_l2_offset,
62128 * - metadata[8:0] contains the outer_l3_offset.
62129 * - metadata[15:9] contains the inner_l2_offset[6:0]
62130 */
62131 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_HDR_OFFSET (UINT32_C(0x4) << 4)
62132 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_LAST CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_HDR_OFFSET
62133 /*
62134 * This field indicates the IP type for the inner-most IP header.
62135 * A value of '' indicates IPv4. A value of '1' indicates IPv6.
62136 * This value is only valid if itype indicates a packet
62137 * with an IP header.
62138 */
62139 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_IP_TYPE UINT32_C(0x100)
62140 /*
62141 * This indicates that the complete 1's complement checksum was
62142 * calculated for the packet.
62143 */
62144 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_CALC UINT32_C(0x200)
62145 /*
62146 * The combination of this value and meta_format indicated what
62147 * format the metadata field is.
62148 */
62149 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_EXT_META_FORMAT_MASK UINT32_C(0xc00)
62150 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_EXT_META_FORMAT_SFT 10
62151 /*
62152 * This value is the complete 1's complement checksum calculated from
62153 * the start of the outer L3 header to the end of the packet (not
62154 * including the ethernet crc). It is valid when the
62155 * 'complete_checksum_calc' flag is set.
62156 */
62157 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_MASK UINT32_C(0xffff0000)
62158 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_SFT 16
62159 /*
62160 * This is data from the CFA block as indicated by the meta_format
62161 * field.
62162 */
62163 uint32_t raweth_qp1_metadata;
62164 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_DE_VID_MASK UINT32_C(0xffff)
62165 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_DE_VID_SFT 0
62166 /* When meta_format=1, this value is the VLAN VID. */
62167 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_VID_MASK UINT32_C(0xfff)
62168 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_VID_SFT 0
62169 /* When meta_format=1, this value is the VLAN DE. */
62170 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_DE UINT32_C(0x1000)
62171 /* When meta_format=1, this value is the VLAN PRI. */
62172 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_MASK UINT32_C(0xe000)
62173 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_SFT 13
62174 /* When meta_format=1, this value is the VLAN TPID. */
62175 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_TPID_MASK UINT32_C(0xffff0000)
62176 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_TPID_SFT 16
62177 uint8_t cqe_type_toggle;
62178 /*
62179 * Indicate valid completion - written by the chip. Cumulus
62180 * toggle this bit each time it finished consuming all PBL
62181 * entries
62182 */
62183 #define CQ_RES_RAWETH_QP1_TOGGLE UINT32_C(0x1)
62184 /* This field defines the type of SQ WQE. */
62185 #define CQ_RES_RAWETH_QP1_CQE_TYPE_MASK UINT32_C(0x1e)
62186 #define CQ_RES_RAWETH_QP1_CQE_TYPE_SFT 1
62187 /*
62188 * Responder RawEth and QP1 Completion - This is used for RQ
62189 * completion for RawEth service and QP1 service QPs.
62190 */
62191 #define CQ_RES_RAWETH_QP1_CQE_TYPE_RES_RAWETH_QP1 (UINT32_C(0x3) << 1)
62192 #define CQ_RES_RAWETH_QP1_CQE_TYPE_LAST CQ_RES_RAWETH_QP1_CQE_TYPE_RES_RAWETH_QP1
62193 /* This field indicates the status for the CQE. */
62194 uint8_t status;
62195 /*
62196 * This indicates that the completion is without error.
62197 * All fields are valid.
62198 */
62199 #define CQ_RES_RAWETH_QP1_STATUS_OK UINT32_C(0x0)
62200 /*
62201 * This indicates that write access was not allowed for
62202 * at least one of the SGEs in the WQE.
62203 *
62204 * This is a fatal error. Only the srq_or_rq_wr_id is field
62205 * is valid.
62206 */
62207 #define CQ_RES_RAWETH_QP1_STATUS_LOCAL_ACCESS_ERROR UINT32_C(0x1)
62208 /*
62209 * This indicates that the packet was too long for the WQE
62210 * provided on the RQ.
62211 *
62212 * This is not a fatal error. All the fields are valid.
62213 */
62214 #define CQ_RES_RAWETH_QP1_STATUS_HW_LOCAL_LENGTH_ERR UINT32_C(0x2)
62215 /* LOCAL_PROTECTION_ERR is 3 */
62216 #define CQ_RES_RAWETH_QP1_STATUS_LOCAL_PROTECTION_ERR UINT32_C(0x3)
62217 /* LOCAL_QP_OPERATION_ERR is 4 */
62218 #define CQ_RES_RAWETH_QP1_STATUS_LOCAL_QP_OPERATION_ERR UINT32_C(0x4)
62219 /* MEMORY_MGT_OPERATION_ERR is 5 */
62220 #define CQ_RES_RAWETH_QP1_STATUS_MEMORY_MGT_OPERATION_ERR UINT32_C(0x5)
62221 /* WORK_REQUEST_FLUSHED_ERR is 7 */
62222 #define CQ_RES_RAWETH_QP1_STATUS_WORK_REQUEST_FLUSHED_ERR UINT32_C(0x7)
62223 /* HW_FLUSH_ERR is 8 */
62224 #define CQ_RES_RAWETH_QP1_STATUS_HW_FLUSH_ERR UINT32_C(0x8)
62225 #define CQ_RES_RAWETH_QP1_STATUS_LAST CQ_RES_RAWETH_QP1_STATUS_HW_FLUSH_ERR
62226 uint16_t flags;
62227 /*
62228 * This flag indicates that the completion is for a SRQ entry
62229 * rather than for an RQ entry.
62230 */
62231 #define CQ_RES_RAWETH_QP1_FLAGS_SRQ UINT32_C(0x1)
62232 /* CQE relates to RQ WQE. */
62233 #define CQ_RES_RAWETH_QP1_FLAGS_SRQ_RQ UINT32_C(0x0)
62234 /* CQE relates to SRQ WQE. */
62235 #define CQ_RES_RAWETH_QP1_FLAGS_SRQ_SRQ UINT32_C(0x1)
62236 #define CQ_RES_RAWETH_QP1_FLAGS_SRQ_LAST CQ_RES_RAWETH_QP1_FLAGS_SRQ_SRQ
62237 uint32_t raweth_qp1_payload_offset_srq_or_rq_wr_id;
62238 /*
62239 * Opaque value from RQ or SRQ WQE. Used by driver/lib to
62240 * reference the WQE in order to claim the received data
62241 * and reuse the WQE space
62242 */
62243 #define CQ_RES_RAWETH_QP1_SRQ_OR_RQ_WR_ID_MASK UINT32_C(0xfffff)
62244 #define CQ_RES_RAWETH_QP1_SRQ_OR_RQ_WR_ID_SFT 0
62245 /*
62246 * This value indicates the offset in bytes from the beginning of the packet
62247 * where the inner payload starts. This value is valid for TCP, UDP,
62248 * FCoE, and RoCE packets.
62249 *
62250 * A value of zero indicates an offset of 256 bytes.
62251 */
62252 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_PAYLOAD_OFFSET_MASK UINT32_C(0xff000000)
62253 #define CQ_RES_RAWETH_QP1_RAWETH_QP1_PAYLOAD_OFFSET_SFT 24
62254 } cq_res_raweth_qp1_t, *pcq_res_raweth_qp1_t;
62255
62256 /* Responder RawEth and QP1 CQE version 2 */
62257 /* cq_res_raweth_qp1_v2 (size:256b/32B) */
62258
62259 typedef struct cq_res_raweth_qp1_v2 {
62260 uint16_t length;
62261 /*
62262 * The length of the message's payload in bytes, stored in
62263 * the SGEs
62264 */
62265 #define CQ_RES_RAWETH_QP1_V2_LENGTH_MASK UINT32_C(0x3fff)
62266 #define CQ_RES_RAWETH_QP1_V2_LENGTH_SFT 0
62267 uint16_t raweth_qp1_flags;
62268 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_MASK UINT32_C(0x3ff)
62269 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_SFT 0
62270 /*
62271 * When this bit is '1', it indicates a packet that has an
62272 * error of some type. Type of error is indicated in
62273 * raweth_qp1_errors.
62274 */
62275 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ERROR UINT32_C(0x1)
62276 /*
62277 * This value indicates what the inner packet determined for the
62278 * packet was.
62279 */
62280 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_MASK UINT32_C(0x3c0)
62281 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_SFT 6
62282 /*
62283 * Not Known:
62284 * Indicates that the packet type was not known.
62285 */
62286 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_NOT_KNOWN (UINT32_C(0x0) << 6)
62287 /*
62288 * IP Packet:
62289 * Indicates that the packet was an IP packet, but further
62290 * classification was not possible.
62291 */
62292 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_IP (UINT32_C(0x1) << 6)
62293 /*
62294 * TCP Packet:
62295 * Indicates that the packet was IP and TCP.
62296 * This indicates that the raweth_qp1_payload_offset field is
62297 * valid.
62298 */
62299 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_TCP (UINT32_C(0x2) << 6)
62300 /*
62301 * UDP Packet:
62302 * Indicates that the packet was IP and UDP.
62303 * This indicates that the raweth_qp1_payload_offset field is
62304 * valid.
62305 */
62306 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_UDP (UINT32_C(0x3) << 6)
62307 /*
62308 * FCoE Packet:
62309 * Indicates that the packet was recognized as a FCoE.
62310 * This also indicates that the raweth_qp1_payload_offset field
62311 * is valid.
62312 */
62313 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_FCOE (UINT32_C(0x4) << 6)
62314 /*
62315 * RoCE Packet:
62316 * Indicates that the packet was recognized as a RoCE.
62317 * This also indicates that the raweth_qp1_payload_offset field
62318 * is valid.
62319 */
62320 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_ROCE (UINT32_C(0x5) << 6)
62321 /*
62322 * ICMP Packet:
62323 * Indicates that the packet was recognized as ICMP.
62324 * This indicates that the raweth_qp1_payload_offset field is
62325 * valid.
62326 */
62327 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_ICMP (UINT32_C(0x7) << 6)
62328 /*
62329 * PtP packet wo/timestamp:
62330 * Indicates that the packet was recognized as a PtP
62331 * packet.
62332 */
62333 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_PTP_WO_TIMESTAMP (UINT32_C(0x8) << 6)
62334 /*
62335 * PtP packet w/timestamp:
62336 * Indicates that the packet was recognized as a PtP
62337 * packet and that a timestamp was taken for the packet.
62338 */
62339 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP (UINT32_C(0x9) << 6)
62340 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_LAST CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP
62341 uint16_t raweth_qp1_errors;
62342 /*
62343 * This indicates that there was an error in the IP header
62344 * checksum.
62345 */
62346 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_IP_CS_ERROR UINT32_C(0x10)
62347 /*
62348 * This indicates that there was an error in the TCP, UDP
62349 * or ICMP checksum.
62350 */
62351 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_L4_CS_ERROR UINT32_C(0x20)
62352 /*
62353 * This indicates that there was an error in the tunnel
62354 * IP header checksum.
62355 */
62356 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_IP_CS_ERROR UINT32_C(0x40)
62357 /*
62358 * This indicates that there was an error in the tunnel
62359 * UDP checksum.
62360 */
62361 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_L4_CS_ERROR UINT32_C(0x80)
62362 /*
62363 * This indicates that there was a CRC error on either an FCoE
62364 * or RoCE packet. The itype indicates the packet type.
62365 */
62366 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_CRC_ERROR UINT32_C(0x100)
62367 /*
62368 * This indicates that there was an error in the tunnel
62369 * portion of the packet when this
62370 * field is non-zero.
62371 */
62372 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_MASK UINT32_C(0xe00)
62373 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_SFT 9
62374 /*
62375 * No additional error occurred on the tunnel portion
62376 * of the packet of the packet does not have a tunnel.
62377 */
62378 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_NO_ERROR (UINT32_C(0x0) << 9)
62379 /*
62380 * Indicates that IP header version does not match
62381 * expectation from L2 Ethertype for IPv4 and IPv6
62382 * in the tunnel header.
62383 */
62384 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION (UINT32_C(0x1) << 9)
62385 /*
62386 * Indicates that header length is out of range in the
62387 * tunnel header. Valid for
62388 * IPv4.
62389 */
62390 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN (UINT32_C(0x2) << 9)
62391 /*
62392 * Indicates that the physical packet is shorter than that
62393 * claimed by the PPPoE header length for a tunnel PPPoE
62394 * packet.
62395 */
62396 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR (UINT32_C(0x3) << 9)
62397 /*
62398 * Indicates that physical packet is shorter than that claimed
62399 * by the tunnel l3 header length. Valid for IPv4, or IPv6
62400 * tunnel packet packets.
62401 */
62402 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR (UINT32_C(0x4) << 9)
62403 /*
62404 * Indicates that the physical packet is shorter than that
62405 * claimed by the tunnel UDP header length for a tunnel
62406 * UDP packet that is not fragmented.
62407 */
62408 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR (UINT32_C(0x5) << 9)
62409 /*
62410 * indicates that the IPv4 TTL or IPv6 hop limit check
62411 * have failed (e.g. TTL = 0) in the tunnel header. Valid
62412 * for IPv4, and IPv6.
62413 */
62414 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL (UINT32_C(0x6) << 9)
62415 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_LAST CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL
62416 /*
62417 * This indicates that there was an error in the inner
62418 * portion of the packet when this
62419 * field is non-zero.
62420 */
62421 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_MASK UINT32_C(0xf000)
62422 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_SFT 12
62423 /*
62424 * No additional error occurred on the tunnel portion
62425 * of the packet of the packet does not have a tunnel.
62426 */
62427 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_NO_ERROR (UINT32_C(0x0) << 12)
62428 /*
62429 * Indicates that IP header version does not match
62430 * expectation from L2 Ethertype for IPv4 and IPv6 or that
62431 * option other than VFT was parsed on
62432 * FCoE packet.
62433 */
62434 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_VERSION (UINT32_C(0x1) << 12)
62435 /*
62436 * indicates that header length is out of range. Valid for
62437 * IPv4 and RoCE
62438 */
62439 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN (UINT32_C(0x2) << 12)
62440 /*
62441 * indicates that the IPv4 TTL or IPv6 hop limit check
62442 * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
62443 */
62444 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_TTL (UINT32_C(0x3) << 12)
62445 /*
62446 * Indicates that physical packet is shorter than that
62447 * claimed by the l3 header length. Valid for IPv4,
62448 * IPv6 packet or RoCE packets.
62449 */
62450 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_IP_TOTAL_ERROR (UINT32_C(0x4) << 12)
62451 /*
62452 * Indicates that the physical packet is shorter than that
62453 * claimed by the UDP header length for a UDP packet that is
62454 * not fragmented.
62455 */
62456 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR (UINT32_C(0x5) << 12)
62457 /*
62458 * Indicates that TCP header length > IP payload. Valid for
62459 * TCP packets only.
62460 */
62461 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN (UINT32_C(0x6) << 12)
62462 /* Indicates that TCP header length < 5. Valid for TCP. */
62463 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL (UINT32_C(0x7) << 12)
62464 /*
62465 * Indicates that TCP option headers result in a TCP header
62466 * size that does not match data offset in TCP header. Valid
62467 * for TCP.
62468 */
62469 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN (UINT32_C(0x8) << 12)
62470 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_LAST CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
62471 /* This is data from the CFA as indicated by the meta_format field. */
62472 uint16_t cfa_metadata0;
62473 /* When meta_format=1, this value is the VLAN VID. */
62474 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA0_VID_MASK UINT32_C(0xfff)
62475 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA0_VID_SFT 0
62476 /* When meta_format=1, this value is the VLAN DE. */
62477 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA0_DE UINT32_C(0x1000)
62478 /* When meta_format=1, this value is the VLAN PRI. */
62479 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA0_PRI_MASK UINT32_C(0xe000)
62480 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA0_PRI_SFT 13
62481 /*
62482 * This is an application level ID used to identify the
62483 * QP and its SQ and RQ.
62484 */
62485 uint64_t qp_handle;
62486 uint32_t raweth_qp1_flags2;
62487 /*
62488 * When this bit is '', the cs_ok field has the following
62489 * definition:- ip_cs_ok[2:0] = The number of header groups with a
62490 * valid IP checksum in the delivered packet, counted from the
62491 * outer-most header group to the inner-most header group, stopping
62492 * at the first error. - l4_cs_ok[5:3] = The number of header groups
62493 * with a valid L4 checksum in the delivered packet, counted from
62494 * the outer-most header group to the inner-most header group,
62495 * stopping at the first error. When this bit is '1', the cs_ok
62496 * field has the following definition: - hdr_cnt[2:0] = The number of
62497 * header groups that were parsed by the chip and passed in the
62498 * delivered packet. - ip_cs_all_ok[3] =This bit will be '1' if all
62499 * the parsed header groups with an IP checksum are valid.
62500 * - l4_cs_all_ok[4] = This bit will be '1' if all the parsed header
62501 * groups with an L4 checksum are valid.
62502 */
62503 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_CS_ALL_OK_MODE UINT32_C(0x8)
62504 /* This value indicates what format the metadata field is. */
62505 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_MASK UINT32_C(0xf0)
62506 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_SFT 4
62507 /* There is no metadata information. Values are zero. */
62508 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_NONE (UINT32_C(0x0) << 4)
62509 /*
62510 * The {metadata1, metadata0} fields contain the vtag
62511 * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
62512 * de, vid[11:0]} The metadata2 field contains the table scope
62513 * and action record pointer. - metadata2[25:0] contains the
62514 * action record pointer. - metadata2[31:26] contains the table
62515 * scope.
62516 */
62517 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_ACT_REC_PTR (UINT32_C(0x1) << 4)
62518 /*
62519 * The {metadata1, metadata0} fields contain the vtag
62520 * information:
62521 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
62522 * The metadata2 field contains the Tunnel ID
62523 * value, justified to LSB. i
62524 * - VXLAN = VNI[23:0] -> VXLAN Network ID
62525 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
62526 * - NVGRE = TNI[23:0] -> Tenant Network ID
62527 * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
62528 * - IPv4 = 0 (not populated)
62529 * - IPv6 = Flow Label[19:0]
62530 * - PPPoE = sessionID[15:0]
62531 * - MPLs = Outer label[19:0]
62532 * - UPAR = Selected[31:0] with bit mask
62533 */
62534 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_TUNNEL_ID (UINT32_C(0x2) << 4)
62535 /*
62536 * The {metadata1, metadata0} fields contain the vtag
62537 * information:
62538 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
62539 * The metadata2 field contains the 32b metadata from the prepended
62540 * header (chdr_data).
62541 */
62542 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_CHDR_DATA (UINT32_C(0x3) << 4)
62543 /*
62544 * The {metadata1, metadata0} fields contain the vtag
62545 * information:
62546 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
62547 * The metadata2 field contains the outer_l3_offset,
62548 * inner_l2_offset, inner_l3_offset, and inner_l4_size.
62549 * - metadata2[8:0] contains the outer_l3_offset.
62550 * - metadata2[17:9] contains the inner_l2_offset.
62551 * - metadata2[26:18] contains the inner_l3_offset.
62552 * - metadata2[31:27] contains the inner_l4_size.
62553 */
62554 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_HDR_OFFSET (UINT32_C(0x4) << 4)
62555 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_LAST CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_HDR_OFFSET
62556 /*
62557 * This field indicates the IP type for the inner-most IP header.
62558 * A value of '' indicates IPv4. A value of '1' indicates IPv6.
62559 * This value is only valid if itype indicates a packet
62560 * with an IP header.
62561 */
62562 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_IP_TYPE UINT32_C(0x100)
62563 /*
62564 * This indicates that the complete 1's complement checksum was
62565 * calculated for the packet.
62566 */
62567 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_CALC UINT32_C(0x200)
62568 /*
62569 * This field indicates the status of IP and L4 CS calculations done
62570 * by the chip. The format of this field is indicated by the
62571 * cs_all_ok_mode bit.
62572 */
62573 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_CS_OK_MASK UINT32_C(0xfc00)
62574 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_CS_OK_SFT 10
62575 /*
62576 * This value is the complete 1's complement checksum calculated from
62577 * the start of the outer L3 header to the end of the packet (not
62578 * including the ethernet crc). It is valid when the
62579 * 'complete_checksum_calc' flag is set.
62580 */
62581 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_MASK UINT32_C(0xffff0000)
62582 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_SFT 16
62583 /*
62584 * This is data from the CFA block as indicated by the meta_format
62585 * field.
62586 * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
62587 * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
62588 * act_rec_ptr[25:0]}
62589 * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
62590 * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
62591 * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
62592 * When vee_cmpl_mode is set in VNIC context, this is the upper 32b
62593 * of the host address from the first BD used to place the packet.
62594 */
62595 uint32_t cfa_metadata2;
62596 uint8_t cqe_type_toggle;
62597 /*
62598 * Indicate valid completion - written by the chip. Cumulus
62599 * toggle this bit each time it finished consuming all PBL
62600 * entries
62601 */
62602 #define CQ_RES_RAWETH_QP1_V2_TOGGLE UINT32_C(0x1)
62603 /* This field defines the type of SQ WQE. */
62604 #define CQ_RES_RAWETH_QP1_V2_CQE_TYPE_MASK UINT32_C(0x1e)
62605 #define CQ_RES_RAWETH_QP1_V2_CQE_TYPE_SFT 1
62606 /*
62607 * Responder RawEth and QP1 Completion - This is used for RQ
62608 * completion for RawEth service and QP1 service QPs.
62609 */
62610 #define CQ_RES_RAWETH_QP1_V2_CQE_TYPE_RES_RAWETH_QP1 (UINT32_C(0x3) << 1)
62611 #define CQ_RES_RAWETH_QP1_V2_CQE_TYPE_LAST CQ_RES_RAWETH_QP1_V2_CQE_TYPE_RES_RAWETH_QP1
62612 /* This field indicates the status for the CQE. */
62613 uint8_t status;
62614 /*
62615 * This indicates that the completion is without error.
62616 * All fields are valid.
62617 */
62618 #define CQ_RES_RAWETH_QP1_V2_STATUS_OK UINT32_C(0x0)
62619 /*
62620 * This indicates that write access was not allowed for
62621 * at least one of the SGEs in the WQE.
62622 *
62623 * This is a fatal error. Only the srq_or_rq_wr_id is field
62624 * is valid.
62625 */
62626 #define CQ_RES_RAWETH_QP1_V2_STATUS_LOCAL_ACCESS_ERROR UINT32_C(0x1)
62627 /*
62628 * This indicates that the packet was too long for the WQE
62629 * provided on the RQ.
62630 *
62631 * This is not a fatal error. All the fields are valid.
62632 */
62633 #define CQ_RES_RAWETH_QP1_V2_STATUS_HW_LOCAL_LENGTH_ERR UINT32_C(0x2)
62634 /* LOCAL_PROTECTION_ERR is 3 */
62635 #define CQ_RES_RAWETH_QP1_V2_STATUS_LOCAL_PROTECTION_ERR UINT32_C(0x3)
62636 /* LOCAL_QP_OPERATION_ERR is 4 */
62637 #define CQ_RES_RAWETH_QP1_V2_STATUS_LOCAL_QP_OPERATION_ERR UINT32_C(0x4)
62638 /* MEMORY_MGT_OPERATION_ERR is 5 */
62639 #define CQ_RES_RAWETH_QP1_V2_STATUS_MEMORY_MGT_OPERATION_ERR UINT32_C(0x5)
62640 /* WORK_REQUEST_FLUSHED_ERR is 7 */
62641 #define CQ_RES_RAWETH_QP1_V2_STATUS_WORK_REQUEST_FLUSHED_ERR UINT32_C(0x7)
62642 /* HW_FLUSH_ERR is 8 */
62643 #define CQ_RES_RAWETH_QP1_V2_STATUS_HW_FLUSH_ERR UINT32_C(0x8)
62644 #define CQ_RES_RAWETH_QP1_V2_STATUS_LAST CQ_RES_RAWETH_QP1_V2_STATUS_HW_FLUSH_ERR
62645 uint16_t flags;
62646 /*
62647 * This flag indicates that the completion is for a SRQ entry
62648 * rather than for an RQ entry.
62649 */
62650 #define CQ_RES_RAWETH_QP1_V2_FLAGS_SRQ UINT32_C(0x1)
62651 /* CQE relates to RQ WQE. */
62652 #define CQ_RES_RAWETH_QP1_V2_FLAGS_SRQ_RQ UINT32_C(0x0)
62653 /* CQE relates to SRQ WQE. */
62654 #define CQ_RES_RAWETH_QP1_V2_FLAGS_SRQ_SRQ UINT32_C(0x1)
62655 #define CQ_RES_RAWETH_QP1_V2_FLAGS_SRQ_LAST CQ_RES_RAWETH_QP1_V2_FLAGS_SRQ_SRQ
62656 uint32_t raweth_qp1_payload_offset_srq_or_rq_wr_id;
62657 /*
62658 * Opaque value from RQ or SRQ WQE. Used by driver/lib to
62659 * reference the WQE in order to claim the received data
62660 * and reuse the WQE space
62661 */
62662 #define CQ_RES_RAWETH_QP1_V2_SRQ_OR_RQ_WR_ID_MASK UINT32_C(0xfffff)
62663 #define CQ_RES_RAWETH_QP1_V2_SRQ_OR_RQ_WR_ID_SFT 0
62664 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_MASK UINT32_C(0xf00000)
62665 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_SFT 20
62666 /* When meta_format != 0, this value is the VLAN TPID_SEL. */
62667 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_MASK UINT32_C(0x700000)
62668 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_SFT 20
62669 /* 0x88a8 */
62670 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPID88A8 (UINT32_C(0x0) << 20)
62671 /* 0x8100 */
62672 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPID8100 (UINT32_C(0x1) << 20)
62673 /* 0x9100 */
62674 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPID9100 (UINT32_C(0x2) << 20)
62675 /* 0x9200 */
62676 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPID9200 (UINT32_C(0x3) << 20)
62677 /* 0x9300 */
62678 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPID9300 (UINT32_C(0x4) << 20)
62679 /* Value programmed in CFA VLANTPID register. */
62680 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPIDCFG (UINT32_C(0x5) << 20)
62681 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_LAST CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPIDCFG
62682 /* When meta_format != 0, this value is the VLAN valid. */
62683 #define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_VALID UINT32_C(0x800000)
62684 /*
62685 * This value indicates the offset in bytes from the beginning of
62686 * the packet where the inner payload starts. This value is valid
62687 * for TCP, UDP, FCoE, and RoCE packets.
62688 *
62689 * A value of zero indicates an offset of 256 bytes.
62690 */
62691 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_PAYLOAD_OFFSET_MASK UINT32_C(0xff000000)
62692 #define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_PAYLOAD_OFFSET_SFT 24
62693 } cq_res_raweth_qp1_v2_t, *pcq_res_raweth_qp1_v2_t;
62694
62695 /* Terminal CQE */
62696 /* cq_terminal (size:256b/32B) */
62697
62698 typedef struct cq_terminal {
62699 /*
62700 * This is an application level ID used to identify the
62701 * QP and its SQ and RQ.
62702 */
62703 uint64_t qp_handle;
62704 /*
62705 * Final SQ Consumer Index value. Any additional SQ WQEs will
62706 * have to be completed by the user provider.
62707 */
62708 uint16_t sq_cons_idx;
62709 /*
62710 * Final RQ Consumer Index value. Any additional RQ WQEs will
62711 * have to be completed by the user provider.
62712 */
62713 uint16_t rq_cons_idx;
62714 uint32_t reserved32_1;
62715 uint64_t reserved64_3;
62716 uint8_t cqe_type_toggle;
62717 /*
62718 * Indicate valid completion - written by the chip. Cumulus
62719 * toggle this bit each time it finished consuming all PBL
62720 * entries
62721 */
62722 #define CQ_TERMINAL_TOGGLE UINT32_C(0x1)
62723 /* This field defines the type of SQ WQE. */
62724 #define CQ_TERMINAL_CQE_TYPE_MASK UINT32_C(0x1e)
62725 #define CQ_TERMINAL_CQE_TYPE_SFT 1
62726 /*
62727 * Terminal completion - This is used to indicate that no
62728 * further completions will be made for this QP on this CQ.
62729 */
62730 #define CQ_TERMINAL_CQE_TYPE_TERMINAL (UINT32_C(0xe) << 1)
62731 #define CQ_TERMINAL_CQE_TYPE_LAST CQ_TERMINAL_CQE_TYPE_TERMINAL
62732 /* This field indicates the status for the CQE. */
62733 uint8_t status;
62734 /* OK is 0 */
62735 #define CQ_TERMINAL_STATUS_OK UINT32_C(0x0)
62736 #define CQ_TERMINAL_STATUS_LAST CQ_TERMINAL_STATUS_OK
62737 uint16_t reserved16;
62738 uint32_t reserved32_2;
62739 } cq_terminal_t, *pcq_terminal_t;
62740
62741 /* Cutoff CQE */
62742 /* cq_cutoff (size:256b/32B) */
62743
62744 typedef struct cq_cutoff {
62745 uint64_t reserved64_1;
62746 uint64_t reserved64_2;
62747 uint64_t reserved64_3;
62748 uint8_t cqe_type_toggle;
62749 /*
62750 * Indicate valid completion - written by the chip. Cumulus
62751 * toggle this bit each time it finished consuming all PBL
62752 * entries
62753 */
62754 #define CQ_CUTOFF_TOGGLE UINT32_C(0x1)
62755 /* This field defines the type of SQ WQE. */
62756 #define CQ_CUTOFF_CQE_TYPE_MASK UINT32_C(0x1e)
62757 #define CQ_CUTOFF_CQE_TYPE_SFT 1
62758 /* Cut off CQE; for CQ resize see CQ and SRQ Resize */
62759 #define CQ_CUTOFF_CQE_TYPE_CUT_OFF (UINT32_C(0xf) << 1)
62760 #define CQ_CUTOFF_CQE_TYPE_LAST CQ_CUTOFF_CQE_TYPE_CUT_OFF
62761 /* This field indicates the status for the CQE. */
62762 uint8_t status;
62763 /* OK is 0 */
62764 #define CQ_CUTOFF_STATUS_OK UINT32_C(0x0)
62765 #define CQ_CUTOFF_STATUS_LAST CQ_CUTOFF_STATUS_OK
62766 uint16_t reserved16;
62767 uint32_t reserved32;
62768 } cq_cutoff_t, *pcq_cutoff_t;
62769
62770 /* nq_base (size:128b/16B) */
62771
62772 typedef struct nq_base {
62773 uint16_t info10_type;
62774 /*
62775 * This field indicates the exact type of the completion.
62776 * By convention, the LSB identifies the length of the
62777 * record in 16B units. Even values indicate 16B
62778 * records. Odd values indicate 32B
62779 * records.
62780 */
62781 #define NQ_BASE_TYPE_MASK UINT32_C(0x3f)
62782 #define NQ_BASE_TYPE_SFT 0
62783 /* CQ Notification */
62784 #define NQ_BASE_TYPE_CQ_NOTIFICATION UINT32_C(0x30)
62785 /* SRQ Threshold Event */
62786 #define NQ_BASE_TYPE_SRQ_EVENT UINT32_C(0x32)
62787 /* DBQ Threshold Event */
62788 #define NQ_BASE_TYPE_DBQ_EVENT UINT32_C(0x34)
62789 /* QP Async Notification */
62790 #define NQ_BASE_TYPE_QP_EVENT UINT32_C(0x38)
62791 /* Function Async Notification */
62792 #define NQ_BASE_TYPE_FUNC_EVENT UINT32_C(0x3a)
62793 #define NQ_BASE_TYPE_LAST NQ_BASE_TYPE_FUNC_EVENT
62794 /* info10 is 10 b */
62795 #define NQ_BASE_INFO10_MASK UINT32_C(0xffc0)
62796 #define NQ_BASE_INFO10_SFT 6
62797 /* info16 is 16 b */
62798 uint16_t info16;
62799 /* info32 is 32 b */
62800 uint32_t info32;
62801 /* info32 is 32 b */
62802 uint64_t info63_v;
62803 /*
62804 * This value is written by the NIC such that it will be different
62805 * for each pass through the completion queue. The even passes
62806 * will write 1. The odd passes will write 0.
62807 */
62808 #define NQ_BASE_V UINT32_C(0x1)
62809 /* info63 is 63 b */
62810 #define NQ_BASE_INFO63_MASK UINT32_C(0xfffffffe)
62811 #define NQ_BASE_INFO63_SFT 1
62812 } nq_base_t, *pnq_base_t;
62813
62814 /* Completion Queue Notification */
62815 /* nq_cn (size:128b/16B) */
62816
62817 typedef struct nq_cn {
62818 uint16_t type;
62819 /*
62820 * This field indicates the exact type of the completion.
62821 * By convention, the LSB identifies the length of the
62822 * record in 16B units. Even values indicate 16B
62823 * records. Odd values indicate 32B
62824 * records.
62825 */
62826 #define NQ_CN_TYPE_MASK UINT32_C(0x3f)
62827 #define NQ_CN_TYPE_SFT 0
62828 /* CQ Notification */
62829 #define NQ_CN_TYPE_CQ_NOTIFICATION UINT32_C(0x30)
62830 #define NQ_CN_TYPE_LAST NQ_CN_TYPE_CQ_NOTIFICATION
62831 uint16_t reserved16;
62832 /*
62833 * This is an application level ID used to identify the
62834 * CQ. This field carries the lower 32b of the value.
62835 */
62836 uint32_t cq_handle_low;
62837 uint32_t v;
62838 /*
62839 * This value is written by the NIC such that it will be different
62840 * for each pass through the completion queue. The even passes
62841 * will write 1. The odd passes will write 0.
62842 */
62843 #define NQ_CN_V UINT32_C(0x1)
62844 /*
62845 * This is an application level ID used to identify the
62846 * CQ. This field carries the upper 32b of the value.
62847 */
62848 uint32_t cq_handle_high;
62849 } nq_cn_t, *pnq_cn_t;
62850
62851 /* SRQ Event Notification */
62852 /* nq_srq_event (size:128b/16B) */
62853
62854 typedef struct nq_srq_event {
62855 uint8_t type;
62856 /*
62857 * This field indicates the exact type of the completion.
62858 * By convention, the LSB identifies the length of the
62859 * record in 16B units. Even values indicate 16B
62860 * records. Odd values indicate 32B
62861 * records.
62862 */
62863 #define NQ_SRQ_EVENT_TYPE_MASK UINT32_C(0x3f)
62864 #define NQ_SRQ_EVENT_TYPE_SFT 0
62865 /* SRQ Threshold Event */
62866 #define NQ_SRQ_EVENT_TYPE_SRQ_EVENT UINT32_C(0x32)
62867 #define NQ_SRQ_EVENT_TYPE_LAST NQ_SRQ_EVENT_TYPE_SRQ_EVENT
62868 /*
62869 * This value define what type of async event has occurred
62870 * on the SRQ.
62871 */
62872 uint8_t event;
62873 /* The threshold event has occurred on the specified SRQ. */
62874 #define NQ_SRQ_EVENT_EVENT_SRQ_THRESHOLD_EVENT UINT32_C(0x1)
62875 #define NQ_SRQ_EVENT_EVENT_LAST NQ_SRQ_EVENT_EVENT_SRQ_THRESHOLD_EVENT
62876 uint16_t reserved16;
62877 /*
62878 * This is the SRQ handle value for the queue that has
62879 * reached it's event threshold. This field carries the
62880 * lower 32b of the value.
62881 */
62882 uint32_t srq_handle_low;
62883 uint32_t v;
62884 /*
62885 * This value is written by the NIC such that it will be different
62886 * for each pass through the completion queue. The even passes
62887 * will write 1. The odd passes will write 0.
62888 */
62889 #define NQ_SRQ_EVENT_V UINT32_C(0x1)
62890 /*
62891 * This is the SRQ handle value for the queue that has
62892 * reached it's event threshold. This field carries the
62893 * upper 32b of the value.
62894 */
62895 uint32_t srq_handle_high;
62896 } nq_srq_event_t, *pnq_srq_event_t;
62897
62898 /* DBQ Async Event Notification */
62899 /* nq_dbq_event (size:128b/16B) */
62900
62901 typedef struct nq_dbq_event {
62902 uint8_t type;
62903 /*
62904 * This field indicates the exact type of the completion.
62905 * By convention, the LSB identifies the length of the
62906 * record in 16B units. Even values indicate 16B
62907 * records. Odd values indicate 32B
62908 * records.
62909 */
62910 #define NQ_DBQ_EVENT_TYPE_MASK UINT32_C(0x3f)
62911 #define NQ_DBQ_EVENT_TYPE_SFT 0
62912 /* DBQ Threshold Event */
62913 #define NQ_DBQ_EVENT_TYPE_DBQ_EVENT UINT32_C(0x34)
62914 #define NQ_DBQ_EVENT_TYPE_LAST NQ_DBQ_EVENT_TYPE_DBQ_EVENT
62915 /* This value define what type of action the driver should take. */
62916 uint8_t event;
62917 /*
62918 * The driver should start writing dummy values to the
62919 * the doorbell in an attempt to consume all the PCIE
62920 * posted write resources and prevent doorbell overflow.
62921 */
62922 #define NQ_DBQ_EVENT_EVENT_DBQ_THRESHOLD_EVENT UINT32_C(0x1)
62923 #define NQ_DBQ_EVENT_EVENT_LAST NQ_DBQ_EVENT_EVENT_DBQ_THRESHOLD_EVENT
62924 uint16_t db_pfid;
62925 /*
62926 * This is the PFID of function that wrote the doorbell that
62927 * crossed the async event threshold.
62928 */
62929 #define NQ_DBQ_EVENT_DB_PFID_MASK UINT32_C(0xf)
62930 #define NQ_DBQ_EVENT_DB_PFID_SFT 0
62931 uint32_t db_dpi;
62932 /*
62933 * This is the DPI of the doorbell write that crossed
62934 * the async event threshold.
62935 */
62936 #define NQ_DBQ_EVENT_DB_DPI_MASK UINT32_C(0xfffff)
62937 #define NQ_DBQ_EVENT_DB_DPI_SFT 0
62938 uint32_t v;
62939 /*
62940 * This value is written by the NIC such that it will be different
62941 * for each pass through the completion queue. The even passes
62942 * will write 1. The odd passes will write 0.
62943 */
62944 #define NQ_DBQ_EVENT_V UINT32_C(0x1)
62945 uint32_t db_type_db_xid;
62946 /*
62947 * DB 'XID' field from doorbell that crossed the async event
62948 * threshold. This is a QPID, SID, or CID, depending on
62949 * the db_type field.
62950 */
62951 #define NQ_DBQ_EVENT_DB_XID_MASK UINT32_C(0xfffff)
62952 #define NQ_DBQ_EVENT_DB_XID_SFT 0
62953 /*
62954 * DB 'type' field from doorbell that crossed the async event
62955 * threshold.
62956 */
62957 #define NQ_DBQ_EVENT_DB_TYPE_MASK UINT32_C(0xf0000000)
62958 #define NQ_DBQ_EVENT_DB_TYPE_SFT 28
62959 } nq_dbq_event_t, *pnq_dbq_event_t;
62960
62961 /* Input Read Request Queue (IRRQ) Message */
62962 /* xrrq_irrq (size:256b/32B) */
62963
62964 typedef struct xrrq_irrq {
62965 uint16_t credits_type;
62966 /* Type indication */
62967 #define XRRQ_IRRQ_TYPE UINT32_C(0x1)
62968 /* RDMA Read */
62969 #define XRRQ_IRRQ_TYPE_READ_REQ UINT32_C(0x0)
62970 /* Atomic */
62971 #define XRRQ_IRRQ_TYPE_ATOMIC_REQ UINT32_C(0x1)
62972 #define XRRQ_IRRQ_TYPE_LAST XRRQ_IRRQ_TYPE_ATOMIC_REQ
62973 /*
62974 * The credit code calculated by Rx path when receiving the
62975 * request. It will be placed in the syndrome credit code with
62976 * the acks on first and last response.
62977 */
62978 #define XRRQ_IRRQ_CREDITS_MASK UINT32_C(0xf800)
62979 #define XRRQ_IRRQ_CREDITS_SFT 11
62980 uint16_t reserved16;
62981 uint32_t reserved32;
62982 uint32_t psn;
62983 /* The PSN of the outstanding incoming request */
62984 #define XRRQ_IRRQ_PSN_MASK UINT32_C(0xffffff)
62985 #define XRRQ_IRRQ_PSN_SFT 0
62986 uint32_t msn;
62987 /*
62988 * The value of QPC.pending_ack_msn after it is incremented as a
62989 * result of receiving the read/atomic request. IRRQ.msn-1 will be
62990 * placed in the MSN field of the first response and IRRQ.msn will
62991 * placed in the MSN field of the last or only response.
62992 */
62993 #define XRRQ_IRRQ_MSN_MASK UINT32_C(0xffffff)
62994 #define XRRQ_IRRQ_MSN_SFT 0
62995 /*
62996 * Virtual address on local host for RDMA READ
62997 *
62998 * In case of duplicate Atomic, the VA is not required to
62999 * be validated, only the PSN is, thus this field is used
63000 * to store the value returned in the Ack to the atomic
63001 * request, and if duplicate arrives, this value is used
63002 * again for resending the ack.
63003 */
63004 uint64_t va_or_atomic_result;
63005 /* The key to the MR/W in the request */
63006 uint32_t rdma_r_key;
63007 /* Length in bytes of the data requested. Length must be 8 if type is atomic. */
63008 uint32_t length;
63009 } xrrq_irrq_t, *pxrrq_irrq_t;
63010
63011 /* Output Read Request Queue (ORRQ) Message */
63012 /* xrrq_orrq (size:256b/32B) */
63013
63014 typedef struct xrrq_orrq {
63015 uint16_t num_sges_type;
63016 /* Type indication */
63017 #define XRRQ_ORRQ_TYPE UINT32_C(0x1)
63018 /* RDMA Read */
63019 #define XRRQ_ORRQ_TYPE_READ_REQ UINT32_C(0x0)
63020 /* Atomic */
63021 #define XRRQ_ORRQ_TYPE_ATOMIC_REQ UINT32_C(0x1)
63022 #define XRRQ_ORRQ_TYPE_LAST XRRQ_ORRQ_TYPE_ATOMIC_REQ
63023 /*
63024 * Up to 6 SGEs. This value is 1 if type is atomic as one
63025 * SGE is required to store Atomic response result field. 2
63026 * more bits allocated for future growth.
63027 *
63028 * Note that, if num_sges is 1 for an RDMA Read request, then
63029 * the first_sge_phy_or_sing_sge_va, single_sge_l_key, and
63030 * single_sge_size fields will be populated from the single
63031 * SGE.
63032 *
63033 * If num_sges is 2 or more for an RDMA Read request, then
63034 * the first_sge_phy_or_sing_sge_va field carries the
63035 * physical address in host memory where the first sge is
63036 * stored. The single_sge_l_key and single_sge_size fields
63037 * are unused in this case.
63038 *
63039 * A special case is a zero-length, zero-sge RDMA read request
63040 * WQE. In this situation, num_sges will be 1. However,
63041 * first_sge_phy_or_sing_sge_va, single_sge_l_key, and
63042 * single_sge_size will all be populated with zeros.
63043 */
63044 #define XRRQ_ORRQ_NUM_SGES_MASK UINT32_C(0xf800)
63045 #define XRRQ_ORRQ_NUM_SGES_SFT 11
63046 uint16_t reserved16;
63047 /* Length in bytes of the data requested. Length must be 8 if type is atomic. */
63048 uint32_t length;
63049 uint32_t psn;
63050 /* The PSN of the outstanding outgoing request */
63051 #define XRRQ_ORRQ_PSN_MASK UINT32_C(0xffffff)
63052 #define XRRQ_ORRQ_PSN_SFT 0
63053 uint32_t end_psn;
63054 /*
63055 * The expected last PSN on a response to this request where
63056 * an ack with response, rather than just response, should
63057 * arrive. If ack arrive with smaller PSN than end_psn then it
63058 * is considered a NAK.
63059 */
63060 #define XRRQ_ORRQ_END_PSN_MASK UINT32_C(0xffffff)
63061 #define XRRQ_ORRQ_END_PSN_SFT 0
63062 /*
63063 * If num_sges == 1 this is the va of that SGE. Otherwise,
63064 * physical address to the first SGE specified by the WQE.
63065 * Points to the first SGE in the Request's WQE in the SQ.
63066 * It is assumed that WQE does not cross page boundaries!
63067 * Driver is responsible to enforce that. SGEs are 16B
63068 * aligned 0b0000 lsb added to get 64 bit address.
63069 */
63070 uint64_t first_sge_phy_or_sing_sge_va;
63071 /* The L_Key of a single SGE if used */
63072 uint32_t single_sge_l_key;
63073 /* The size in bytes of the single SGE if used */
63074 uint32_t single_sge_size;
63075 } xrrq_orrq_t, *pxrrq_orrq_t;
63076
63077 /* Page Table Entry (PTE) */
63078 /* ptu_pte (size:64b/8B) */
63079
63080 typedef struct ptu_pte {
63081 uint64_t page_next_to_last_last_valid;
63082 /*
63083 * This field indicates if the PTE is valid. A value of ''
63084 * indicates that the page is not valid. A value of '1'
63085 * indicates that the page is valid. A reference to an
63086 * invalid page will return a PTU error.
63087 */
63088 #define PTU_PTE_VALID UINT32_C(0x1)
63089 /*
63090 * This field is used only for "ring" PBLs that are used for
63091 * SQ, RQ, SRQ, or CQ structures. For all other PBL structures,
63092 * this bit should be zero. When this bit is '1', it indicates
63093 * that the page pointed to by this PTE is the last page in the
63094 * ring. A prefetch for the ring should use the first PTE in
63095 * the PBL.
63096 */
63097 #define PTU_PTE_LAST UINT32_C(0x2)
63098 /*
63099 * This field is used only for "ring" PBLs that are used for
63100 * SQ, RQ, SRQ, or CQ structures. For all other PBL structures,
63101 * this bit should be zero. When this bit is '1', it indicates
63102 * that this is the next-to-last page of the PBL.
63103 */
63104 #define PTU_PTE_NEXT_TO_LAST UINT32_C(0x4)
63105 /* These bits should be programmed to zero. */
63106 #define PTU_PTE_UNUSED_MASK UINT32_C(0xff8)
63107 #define PTU_PTE_UNUSED_SFT 3
63108 /*
63109 * This is the upper bits of the physical page controlled by
63110 * this PTE. If the page is larger than 4KB, then the unused
63111 * lower bits of the page address should be zero.
63112 */
63113 #define PTU_PTE_PAGE_MASK UINT32_C(0xfffff000)
63114 #define PTU_PTE_PAGE_SFT 12
63115 } ptu_pte_t, *pptu_pte_t;
63116
63117 /* Page Directory Entry (PDE) */
63118 /* ptu_pde (size:64b/8B) */
63119
63120 typedef struct ptu_pde {
63121 uint64_t page_valid;
63122 /*
63123 * This field indicates if the PTE is valid. A value of ''
63124 * indicates that the page is not valid. A value of '1'
63125 * indicates that the page is valid. A reference to an
63126 * invalid page will return a PTU error.
63127 */
63128 #define PTU_PDE_VALID UINT32_C(0x1)
63129 /* These bits should be programmed to zero. */
63130 #define PTU_PDE_UNUSED_MASK UINT32_C(0xffe)
63131 #define PTU_PDE_UNUSED_SFT 1
63132 /*
63133 * This is the upper bits of the physical page controlled by
63134 * this PTE. If the page is larger than 4KB, then the unused
63135 * lower bits of the page address should be zero.
63136 */
63137 #define PTU_PDE_PAGE_MASK UINT32_C(0xfffff000)
63138 #define PTU_PDE_PAGE_SFT 12
63139 } ptu_pde_t, *pptu_pde_t;
63140
63141 /*
63142 * This is the 64b doorbell format. The host writes this message
63143 * format directly to byte offset 0 of the appropriate doorbell page.
63144 */
63145 /* dbc_dbc (size:64b/8B) */
63146
63147 typedef struct dbc_dbc {
63148 uint32_t index;
63149 /*
63150 * This value is the index being written.
63151 *
63152 * For SQ, RQ, and SRQ, this is the producer index and the unit is
63153 * 16B of queue space for L2 path and for the Engine path. For RoCE
63154 * path there is a legacy mode with 128B unit size and a variable
63155 * size WQE mode with 16B unit size of queue space. This mode is
63156 * configured in the QP.
63157 *
63158 * For CQ this is the consumer index and the unit is 32B of queue
63159 * space for the RoCE/Engine path and the CQ index unit is 16B of
63160 * queue space for the L2 path.
63161 *
63162 * For NQ this is the consumer index and the unit is always 16B of
63163 * queue space.
63164 *
63165 * The index size is 24b for L2 and engine paths and 16b for the
63166 * RoCE path. Unused bits should be written as zero.
63167 */
63168 #define DBC_DBC_INDEX_MASK UINT32_C(0xffffff)
63169 #define DBC_DBC_INDEX_SFT 0
63170 /*
63171 * The epoch bit provides a frame of reference for the queue index.
63172 * S/W will toggle this bit in the doorbell each time index range is
63173 * wrapped. This allows the receiving HW block to more efficiently
63174 * detect out-of-order doorbells and to ignore the older doorbells.
63175 * Out-of-order doorbells occur normally during dropped doorbell
63176 * recovery.
63177 */
63178 #define DBC_DBC_EPOCH UINT32_C(0x1000000)
63179 /*
63180 * The resize_toggle bit tells that the CQ cutoff is done.
63181 * Every time CQ is resized by CQ cutoff, this bit toggles when it
63182 * is done. If this bit toggles, HW can restart to use the resized
63183 * CQ.
63184 */
63185 #define DBC_DBC_RESIZE_TOGGLE UINT32_C(0x2000000)
63186 uint32_t type_path_xid;
63187 /*
63188 * This value identifies the resource that the doorbell is intended
63189 * to notify.
63190 *
63191 * For SQ and RQ, this is the QPID. For SRQ, this is the SID. For
63192 * CQ, this is the CID. For NQ, this is the NID.
63193 *
63194 * Bits [19:16] of this values must be zero for a SID value.
63195 */
63196 #define DBC_DBC_XID_MASK UINT32_C(0xfffff)
63197 #define DBC_DBC_XID_SFT 0
63198 /*
63199 * This value defines the intended doorbell path between RoCE and
63200 * L2.
63201 */
63202 #define DBC_DBC_PATH_MASK UINT32_C(0x3000000)
63203 #define DBC_DBC_PATH_SFT 24
63204 /* This is a RoCE doorbell message. */
63205 #define DBC_DBC_PATH_ROCE (UINT32_C(0x0) << 24)
63206 /* This is a L2 doorbell message. */
63207 #define DBC_DBC_PATH_L2 (UINT32_C(0x1) << 24)
63208 /* Engine path doorbell. */
63209 #define DBC_DBC_PATH_ENGINE (UINT32_C(0x2) << 24)
63210 #define DBC_DBC_PATH_LAST DBC_DBC_PATH_ENGINE
63211 /*
63212 * This indicates it is valid doorbell update. It should be set for
63213 * each doorbell written to the chip and set when doorbell message is
63214 * written to the backup doorbell location. The bit should be cleared
63215 * in the backup doorbell location at time zero to indicate that the
63216 * backup doorbell has not yet been written.
63217 */
63218 #define DBC_DBC_VALID UINT32_C(0x4000000)
63219 /*
63220 * When this bit is set to one, the chip will capture debug
63221 * information for the doorbell ring. This is intended to only be
63222 * used on SQ doorbell rings.
63223 */
63224 #define DBC_DBC_DEBUG_TRACE UINT32_C(0x8000000)
63225 /* This value identifies the type of doorbell being written. */
63226 #define DBC_DBC_TYPE_MASK UINT32_C(0xf0000000)
63227 #define DBC_DBC_TYPE_SFT 28
63228 /*
63229 * This is a SQ producer index update. It indicates one or more
63230 * new entries have been written to the SQ for the QPID indicated
63231 * on the xID field. This type is valid for L2, RoCE and Engine
63232 * path.
63233 */
63234 #define DBC_DBC_TYPE_SQ (UINT32_C(0x0) << 28)
63235 /*
63236 * This is a RQ producer index update. It indicates one or more
63237 * new entries have been written to the RQ for the QPID indicated
63238 * on the xID field. This type is valid for RoCE path.
63239 */
63240 #define DBC_DBC_TYPE_RQ (UINT32_C(0x1) << 28)
63241 /*
63242 * This is a SRQ producer index update. It indicates one or more
63243 * new entries have been written to the SRQ for the SID indicated
63244 * on the xID field. This type is valid for L2 and RoCE path.
63245 */
63246 #define DBC_DBC_TYPE_SRQ (UINT32_C(0x2) << 28)
63247 /*
63248 * This doorbell command arms the SRQ async event.
63249 * The xID field must identify the SID that is begin armed.
63250 * The index field is will set the arm threshold such that
63251 * a notification will be generated if less than that number
63252 * or SRQ entries are posted. This type is valid for RoCE path.
63253 */
63254 #define DBC_DBC_TYPE_SRQ_ARM (UINT32_C(0x3) << 28)
63255 /*
63256 * This is a CQ consumer index update. It indicates one or more
63257 * entries have been processed off the CQ indicated on the xID
63258 * field.This type is valid for L2, RoCE and Engine path.
63259 */
63260 #define DBC_DBC_TYPE_CQ (UINT32_C(0x4) << 28)
63261 /*
63262 * this is a CQ consumer index update that also arms the CQ for
63263 * solicited events. This type is valid for RoCE path.
63264 */
63265 #define DBC_DBC_TYPE_CQ_ARMSE (UINT32_C(0x5) << 28)
63266 /*
63267 * This is a CQ consumer index update that also arms the CQ
63268 * for any new CQE. This type is valid for L2, RoCE and Engine
63269 * path.
63270 */
63271 #define DBC_DBC_TYPE_CQ_ARMALL (UINT32_C(0x6) << 28)
63272 /*
63273 * This is a CQ arm enable message. This message must be sent
63274 * from the privileged driver before a new CQ_ARMSE or CQ_ARMALL
63275 * message will be accepted.
63276 *
63277 * This doorbell can only be sent from the privileged (first)
63278 * doorbell page of a function.
63279 */
63280 #define DBC_DBC_TYPE_CQ_ARMENA (UINT32_C(0x7) << 28)
63281 /*
63282 * This doorbell command enables the SRQ async event
63283 * to be armed. This message must be sent from the privileged
63284 * driver before a new SRQ_ARM message will be accepted.
63285 * The xID field must identify the SID that is begin enabled
63286 * for arm.
63287 *
63288 * This doorbell can only be sent from the privileged (first)
63289 * doorbell page of a function.
63290 */
63291 #define DBC_DBC_TYPE_SRQ_ARMENA (UINT32_C(0x8) << 28)
63292 /*
63293 * This doorbell command indicates that the cutoff CQE has
63294 * been processed and the driver is now processing completions
63295 * from the new CQ.
63296 *
63297 * The index field for this doorbell type must be zero.
63298 */
63299 #define DBC_DBC_TYPE_CQ_CUTOFF_ACK (UINT32_C(0x9) << 28)
63300 /*
63301 * This is a NQ consumer index update. It indicates one or more
63302 * entries have been processed off the NQ indicated on the xID
63303 * field. This type is valid for L2, RoCE and Engine path.
63304 */
63305 #define DBC_DBC_TYPE_NQ (UINT32_C(0xa) << 28)
63306 /*
63307 * This is a NQ consumer index update that also arms the NQ for
63308 * any new NQE. This type is valid for L2, RoCE and Engine path.
63309 */
63310 #define DBC_DBC_TYPE_NQ_ARM (UINT32_C(0xb) << 28)
63311 /*
63312 * This is a NQ consumer index update that also arms the NQ for
63313 * any new NQE. It is used for the legacy INT mask. This type
63314 * is valid for L2, RoCE and Engine path.
63315 */
63316 #define DBC_DBC_TYPE_NQ_MASK (UINT32_C(0xe) << 28)
63317 /*
63318 * This doorbell command is used during doorbell moderation
63319 * to consume system BW and help prevent doorbell FIFO
63320 * overflow.
63321 *
63322 * All other fields should be zero for NULL doorbell.
63323 * For doorbell recovery, NULL doorbell type in the Application
63324 * table indicates that it is the last QP entry for the function.
63325 * This type is valid for L2, RoCE and Engine path.
63326 */
63327 #define DBC_DBC_TYPE_NULL (UINT32_C(0xf) << 28)
63328 #define DBC_DBC_TYPE_LAST DBC_DBC_TYPE_NULL
63329 } dbc_dbc_t, *pdbc_dbc_t;
63330
63331 /*
63332 * This is the 32b doorbell format. The host writes this message
63333 * format directly to byte offset 8 of the appropriate doorbell page.
63334 */
63335 /* dbc_dbc32 (size:32b/4B) */
63336
63337 typedef struct dbc_dbc32 {
63338 uint32_t type_abs_incr_xid;
63339 /*
63340 * This value identifies the resource that the doorbell is intended
63341 * to notify.
63342 *
63343 * For SQ and RQ, this is the QPID. For SRQ, this is the SID. For
63344 * CQ, this is the CID.
63345 *
63346 * Bits [19:16] of this values must be zero for a SID value.
63347 */
63348 #define DBC_DBC32_XID_MASK UINT32_C(0xfffff)
63349 #define DBC_DBC32_XID_SFT 0
63350 /*
63351 * This value defines the intended doorbell path between RoCE and
63352 * L2.
63353 */
63354 #define DBC_DBC32_PATH_MASK UINT32_C(0xc00000)
63355 #define DBC_DBC32_PATH_SFT 22
63356 /* This is a RoCE doorbell message. */
63357 #define DBC_DBC32_PATH_ROCE (UINT32_C(0x0) << 22)
63358 /* This is a L2 doorbell message. */
63359 #define DBC_DBC32_PATH_L2 (UINT32_C(0x1) << 22)
63360 #define DBC_DBC32_PATH_LAST DBC_DBC32_PATH_L2
63361 /*
63362 * When abs=0, this value is the value to add to the appropriate
63363 * index value.
63364 *
63365 * When abs=1, this value is the new value for the index. Absolute
63366 * value is used when the queue is being wrapped. When abs=1,
63367 * the incr value follows the same rules as the index value
63368 * in the 64b doorbell.
63369 */
63370 #define DBC_DBC32_INCR_MASK UINT32_C(0xf000000)
63371 #define DBC_DBC32_INCR_SFT 24
63372 /* This value defines how the incr value will be interpreted. */
63373 #define DBC_DBC32_ABS UINT32_C(0x10000000)
63374 /* This value identifies the type of doorbell being written. */
63375 #define DBC_DBC32_TYPE_MASK UINT32_C(0xe0000000)
63376 #define DBC_DBC32_TYPE_SFT 29
63377 /*
63378 * This is a SQ producer index update. It indicates one or more
63379 * new entries have been written to the SQ for the QPID indicated
63380 * on the xID field.
63381 */
63382 #define DBC_DBC32_TYPE_SQ (UINT32_C(0x0) << 29)
63383 #define DBC_DBC32_TYPE_LAST DBC_DBC32_TYPE_SQ
63384 } dbc_dbc32_t, *pdbc_dbc32_t;
63385
63386 /*
63387 * This is the 64b Push Start doorbell format. The host writes this message
63388 * format directly to offset of each push associated WCB (write combine
63389 * buffer) within doorbell page. WCB#0 = offset 16, WCB#1 = offset 24,
63390 * WCB#2 = offset 32, ... The start doorbell is followed by write combining
63391 * data to the WCB and then that is followed by a end doorbell.
63392 */
63393 /* db_push_start (size:64b/8B) */
63394
63395 typedef struct db_push_start {
63396 uint64_t db;
63397 /*
63398 * This is the push index and should be the SQ slot index, aligned
63399 * to the start of the corresponding push WQE/packet in the Send
63400 * Queue.
63401 *
63402 * The index size is 16b for RoCE path and 24b for L2 and Engine
63403 * paths. Any unused bits should be written as zero.
63404 *
63405 * The index unit is 16B for L2 path. For RoCE there is a legacy
63406 * mode with 128B unit size and a variable size mode with 16B unit
63407 * size. For Engine mode, the unit size is 16B, where RQEs are
63408 * always 128B - so it always increments by eight 16B slots per
63409 * RQE.
63410 *
63411 * > This field is not used by the older versions of the chip, but
63412 * > is used in this and future revisions of the chip. In older
63413 * > versions of the chip, the driver is required to complete the
63414 * > push doorbell operation by following it with a regular doorbell
63415 * > which will be used to properly increment the producer index.
63416 * > This extra doorbell write is not needed on this and future
63417 * > versions of the chip.
63418 */
63419 #define DB_PUSH_START_DB_INDEX_MASK UINT32_C(0xffffff)
63420 #define DB_PUSH_START_DB_INDEX_SFT 0
63421 /*
63422 * This value is the PI index (lower 8bits) within 4K DPI
63423 * associated with push write. It is the doorbell page that
63424 * contains the WCB that will be used.
63425 */
63426 #define DB_PUSH_START_DB_PI_LO_MASK UINT32_C(0xff000000)
63427 #define DB_PUSH_START_DB_PI_LO_SFT 24
63428 /*
63429 * This value identifies the resource that the doorbell is intended
63430 * to notify.
63431 *
63432 * This is the QPID.
63433 */
63434 #define DB_PUSH_START_DB_XID_MASK UINT32_C(0xfffff00000000)L
63435 #define DB_PUSH_START_DB_XID_SFT 32
63436 /*
63437 * This value is the PI index (upper 4bits) within 4K DPI
63438 * associated with push write. It is the doorbell page that
63439 * contains the WCB that will be used.
63440 */
63441 #define DB_PUSH_START_DB_PI_HI_MASK UINT32_C(0xf0000000000000)L
63442 #define DB_PUSH_START_DB_PI_HI_SFT 52
63443 /* This value identifies the type of doorbell being written. */
63444 #define DB_PUSH_START_DB_TYPE_MASK UINT32_C(0xf000000000000000)L
63445 #define DB_PUSH_START_DB_TYPE_SFT 60
63446 /*
63447 * This is a SQ producer index update for Push. It indicates
63448 * one or more new entries have been written to the SQ for the
63449 * QPID indicated on the `xid` field.
63450 */
63451 #define DB_PUSH_START_DB_TYPE_PUSH_START (UINT32_C(0xc)L << 60)
63452 /*
63453 * This is a SQ producer index update for Push. It indicates
63454 * one or more new entries have been written to the SQ for the
63455 * QPID indicated on the `xid` field.
63456 */
63457 #define DB_PUSH_START_DB_TYPE_PUSH_END (UINT32_C(0xd)L << 60)
63458 #define DB_PUSH_START_DB_TYPE_LAST DB_PUSH_START_DB_TYPE_PUSH_END
63459 } db_push_start_t, *pdb_push_start_t;
63460
63461 /*
63462 * This is the 64b Push End doorbell format. The host writes this message
63463 * format directly to offset of each push associated WCB (write combine
63464 * buffer) within doorbell page. WCB#0 = offset 16, WCB#1 = offset 24,
63465 * WCB#2 = offset 32, ... The start doorbell is followed by write combining
63466 * data to the WCB and then that is followed by a end doorbell.
63467 */
63468 /* db_push_end (size:64b/8B) */
63469
63470 typedef struct db_push_end {
63471 uint64_t db;
63472 /*
63473 * This is the producer index and should be the queue index of the
63474 * last WQE written plus the length field contained in that WQE.
63475 * For example, if the length is 8 index units and the WQE was
63476 * written to the first location in the queue (zero), this index
63477 * should be written to 8. The index should point to the start of
63478 * the first location that has not been filled in with WQE data.
63479 *
63480 * For L2 and Engine SQ, the index unit is 16B. For RoCE there are
63481 * two modes. For Legacy fixed size RQE mode, the unit is 128B. For
63482 * variable size RQE mode, the unit is 16B.
63483 *
63484 * The index size is 24b for L2 and engine paths and 16b for the
63485 * RoCE path. Unused bits should be written as zero.
63486 *
63487 * > In past revisions of this chip, this field was the push index
63488 * > rather than the producer index. For this version of the chip
63489 * > and future versions of the chip, this field must be the
63490 * > producer index, as described above.
63491 * >
63492 * > Also, in past revisions of this chip, an additional
63493 * > doorbell write was needed to communicate the producer index.
63494 * > In this and future versions of the chip, this extra doorbell
63495 * > write is no longer needed.
63496 */
63497 #define DB_PUSH_END_DB_INDEX_MASK UINT32_C(0xffffff)
63498 #define DB_PUSH_END_DB_INDEX_SFT 0
63499 /*
63500 * This value is the PI index (lower 8bits) within 4K DPI
63501 * associated with push write. It is the doorbell page that
63502 * contains the WCB that will be used.
63503 */
63504 #define DB_PUSH_END_DB_PI_LO_MASK UINT32_C(0xff000000)
63505 #define DB_PUSH_END_DB_PI_LO_SFT 24
63506 /*
63507 * This value identifies the resource that the doorbell is intended
63508 * to notify.
63509 *
63510 * This is the QPID.
63511 */
63512 #define DB_PUSH_END_DB_XID_MASK UINT32_C(0xfffff00000000)L
63513 #define DB_PUSH_END_DB_XID_SFT 32
63514 /*
63515 * This value is the PI index (upper 4bits) within 4K DPI
63516 * associated with push write. It is the doorbell page that
63517 * contains the WCB that will be used.
63518 */
63519 #define DB_PUSH_END_DB_PI_HI_MASK UINT32_C(0xf0000000000000)L
63520 #define DB_PUSH_END_DB_PI_HI_SFT 52
63521 /*
63522 * This value defines the intended doorbell path between RoCE and
63523 * L2.
63524 */
63525 #define DB_PUSH_END_DB_PATH_MASK UINT32_C(0x300000000000000)L
63526 #define DB_PUSH_END_DB_PATH_SFT 56
63527 /* This is a RoCE doorbell message. */
63528 #define DB_PUSH_END_DB_PATH_ROCE (UINT32_C(0x0)L << 56)
63529 /* This is a L2 doorbell message. */
63530 #define DB_PUSH_END_DB_PATH_L2 (UINT32_C(0x1)L << 56)
63531 /* Engine path doorbell. */
63532 #define DB_PUSH_END_DB_PATH_ENGINE (UINT32_C(0x2)L << 56)
63533 #define DB_PUSH_END_DB_PATH_LAST DB_PUSH_END_DB_PATH_ENGINE
63534 /*
63535 * When this bit is set to one, the chip will capture debug
63536 * information for the doorbell ring. This is intended to only be
63537 * used on SQ doorbell rings.
63538 */
63539 #define DB_PUSH_END_DB_DEBUG_TRACE UINT32_C(0x800000000000000)L
63540 /* This value identifies the type of doorbell being written. */
63541 #define DB_PUSH_END_DB_TYPE_MASK UINT32_C(0xf000000000000000)L
63542 #define DB_PUSH_END_DB_TYPE_SFT 60
63543 /*
63544 * This is a SQ producer index update for Push. It indicates
63545 * one or more new entries have been written to the SQ for the
63546 * QPID indicated on the `xid` field.
63547 */
63548 #define DB_PUSH_END_DB_TYPE_PUSH_START (UINT32_C(0xc)L << 60)
63549 /*
63550 * This is a SQ producer index update for Push. It indicates
63551 * one or more new entries have been written to the SQ for the
63552 * QPID indicated on the `xid` field.
63553 */
63554 #define DB_PUSH_END_DB_TYPE_PUSH_END (UINT32_C(0xd)L << 60)
63555 #define DB_PUSH_END_DB_TYPE_LAST DB_PUSH_END_DB_TYPE_PUSH_END
63556 } db_push_end_t, *pdb_push_end_t;
63557
63558 /*
63559 * This is the Push information that is the second 8B of the Push
63560 * Doorbell.
63561 */
63562 /* db_push_info (size:64b/8B) */
63563
63564 typedef struct db_push_info {
63565 uint32_t push_size_push_index;
63566 /*
63567 * This value is the index for the push being started. For
63568 * example, if the push_size is 8 index units and the WQE was
63569 * written to the first location in the queue (zero), this
63570 * push_index should be written to 0. The push_index should point
63571 * to the start of the first location that the push is started.
63572 *
63573 * The push_index unit is 16B, except in RoCE legacy WQE mode, in
63574 * which case the unit is 128B.
63575 *
63576 * The push_index size is 24b for L2 and 16b for the RoCE path.
63577 * Unused bits should be written as zero.
63578 */
63579 #define DB_PUSH_INFO_PUSH_INDEX_MASK UINT32_C(0xffffff)
63580 #define DB_PUSH_INFO_PUSH_INDEX_SFT 0
63581 /*
63582 * This value defines the size of push. The unit is 8B. The value
63583 * 0 means 256B size of push. The push write is done in 8B units
63584 * by the SW.
63585 *
63586 * Note: For packet rate performance reasons, it is recommended
63587 * that SW aligns push requests with a granularity of 16B.
63588 */
63589 #define DB_PUSH_INFO_PUSH_SIZE_MASK UINT32_C(0x1f000000)
63590 #define DB_PUSH_INFO_PUSH_SIZE_SFT 24
63591 uint32_t reserved32;
63592 } db_push_info_t, *pdb_push_info_t;
63593
63594 /*
63595 * This is the "Absolute" 32b Doorbell format. The host writes this
63596 * message format directly to byte offset 0xC of the appropriate
63597 * doorbell page.
63598 *
63599 * Absolute doorbells are supported for only a limited number of
63600 * functions and for a limited number of xID values within each
63601 * function.
63602 *
63603 * Doorbell recovery can be supported for absolute 32b doorbells.
63604 */
63605 /* dbc_absolute_db_32 (size:32b/4B) */
63606
63607 typedef struct dbc_absolute_db_32 {
63608 uint32_t index;
63609 /*
63610 * This value is the index being written. For SQ, RQ, SRQ, this is
63611 * the producer index and should be the queue index of the last WQE
63612 * or BD written plus the length field contained in that WQE/BD.
63613 * For example, if the length is 8 index units and the WQE was
63614 * written to the first location in the queue (zero), this index
63615 * should be written to 8. The index should point to the start of
63616 * the first location that has not been filled in with WQE/BD data.
63617 *
63618 * For CQ, this is the consumer index and should be the starting
63619 * queue index of the last CQE processed plus the size of the last
63620 * processed CQE in index units. The index should point to the start
63621 * of the first CQE in the queue that has not been processed.
63622 *
63623 * For NQ, this is the consumer index and should be the starting
63624 * queue index of the last NQE processed plus the size of the last
63625 * processed NQE in index units. The index should point to the start
63626 * of the first NQE in the queue that has not been processed.
63627 *
63628 * For L2 and Engine SQ, the index unit is 16B. For RoCE there are
63629 * two modes. For Legacy fixed size RQE mode, the unit is 128B. For
63630 * variable size RQE mode, the unit is 16B. For RoCE and engine CQs,
63631 * the index unit is 32B. For L2 CQs, the index unit is 16B.
63632 *
63633 * For NQ this is the consumer index and the unit is always 16B of
63634 * queue space.
63635 *
63636 * The index size is 16b for all queue types. This limits the size
63637 * of some queues when absolute doorbells are in use. Unused bits
63638 * should be written as zero.
63639 */
63640 #define DBC_ABSOLUTE_DB_32_INDEX_MASK UINT32_C(0xffff)
63641 #define DBC_ABSOLUTE_DB_32_INDEX_SFT 0
63642 /*
63643 * The epoch bit provides a frame of reference for the queue index.
63644 * S/W will toggle this bit in the doorbell each time index range is
63645 * wrapped. This allows the receiving HW block to more efficiently
63646 * detect out-of-order doorbells and to ignore the older doorbells.
63647 * Out-of-order doorbells occur normally during dropped doorbell
63648 * recovery.
63649 */
63650 #define DBC_ABSOLUTE_DB_32_EPOCH UINT32_C(0x10000)
63651 /*
63652 * The resize_toggle bit tells that the CQ cutoff is done.
63653 * Every time CQ is resized by CQ cutoff, this bit toggles when it
63654 * is done. If this bit toggles, HW can restart to use the resized
63655 * CQ.
63656 */
63657 #define DBC_ABSOLUTE_DB_32_RESIZE_TOGGLE UINT32_C(0x20000)
63658 /*
63659 * This value identifies the resource that the doorbell is intended
63660 * to notify.
63661 *
63662 * This is a "modified" xID value. The DBR block will convert this
63663 * value into the full xID value by looking up the base xID for this
63664 * particular function and adding the mxID value to that base value.
63665 */
63666 #define DBC_ABSOLUTE_DB_32_MXID_MASK UINT32_C(0xfc0000)
63667 #define DBC_ABSOLUTE_DB_32_MXID_SFT 18
63668 /*
63669 * This value defines the intended doorbell path between RoCE and
63670 * L2.
63671 */
63672 #define DBC_ABSOLUTE_DB_32_PATH_MASK UINT32_C(0x3000000)
63673 #define DBC_ABSOLUTE_DB_32_PATH_SFT 24
63674 /* This is a RoCE doorbell message. */
63675 #define DBC_ABSOLUTE_DB_32_PATH_ROCE (UINT32_C(0x0) << 24)
63676 /* This is a L2 doorbell message. */
63677 #define DBC_ABSOLUTE_DB_32_PATH_L2 (UINT32_C(0x1) << 24)
63678 #define DBC_ABSOLUTE_DB_32_PATH_LAST DBC_ABSOLUTE_DB_32_PATH_L2
63679 /*
63680 * This indicates it is valid doorbell update. It should be set for
63681 * each doorbell written to the chip and set when doorbell message is
63682 * written to the backup doorbell location. The bit should be cleared
63683 * in the backup doorbell location at time zero to indicate that the
63684 * backup doorbell has not yet been written.
63685 */
63686 #define DBC_ABSOLUTE_DB_32_VALID UINT32_C(0x4000000)
63687 /*
63688 * When this bit is set to one, the chip will capture debug
63689 * information for the doorbell ring. This is intended to only be
63690 * used on SQ doorbell rings.
63691 */
63692 #define DBC_ABSOLUTE_DB_32_DEBUG_TRACE UINT32_C(0x8000000)
63693 /* This value identifies the type of doorbell being written. */
63694 #define DBC_ABSOLUTE_DB_32_TYPE_MASK UINT32_C(0xf0000000)
63695 #define DBC_ABSOLUTE_DB_32_TYPE_SFT 28
63696 /*
63697 * This is a SQ producer index update. It indicates one or more
63698 * new entries have been written to the SQ for the QPID indicated
63699 * on the xID field. This type is valid for L2, RoCE and Engine
63700 * path.
63701 */
63702 #define DBC_ABSOLUTE_DB_32_TYPE_SQ (UINT32_C(0x0) << 28)
63703 /*
63704 * This is a RQ producer index update. It indicates one or more
63705 * new entries have been written to the RQ for the QPID indicated
63706 * on the xID field. This type is valid for RoCE path.
63707 */
63708 #define DBC_ABSOLUTE_DB_32_TYPE_RQ (UINT32_C(0x1) << 28)
63709 /*
63710 * This is a SRQ producer index update. It indicates one or more
63711 * new entries have been written to the SRQ for the SID indicated
63712 * on the xID field. This type is valid for L2 and RoCE path.
63713 */
63714 #define DBC_ABSOLUTE_DB_32_TYPE_SRQ (UINT32_C(0x2) << 28)
63715 /*
63716 * This doorbell command arms the SRQ async event.
63717 * The xID field must identify the SID that is begin armed.
63718 * The index field is will set the arm threshold such that
63719 * a notification will be generated if less than that number
63720 * or SRQ entries are posted. This type is valid for RoCE path.
63721 */
63722 #define DBC_ABSOLUTE_DB_32_TYPE_SRQ_ARM (UINT32_C(0x3) << 28)
63723 /*
63724 * This is a CQ consumer index update. It indicates one or more
63725 * entries have been processed off the CQ indicated on the xID
63726 * field.This type is valid for L2, RoCE and Engine path.
63727 */
63728 #define DBC_ABSOLUTE_DB_32_TYPE_CQ (UINT32_C(0x4) << 28)
63729 /*
63730 * this is a CQ consumer index update that also arms the CQ for
63731 * solicited events. This type is valid for RoCE path.
63732 */
63733 #define DBC_ABSOLUTE_DB_32_TYPE_CQ_ARMSE (UINT32_C(0x5) << 28)
63734 /*
63735 * This is a CQ consumer index update that also arms the CQ
63736 * for any new CQE. This type is valid for L2, RoCE and Engine
63737 * path.
63738 */
63739 #define DBC_ABSOLUTE_DB_32_TYPE_CQ_ARMALL (UINT32_C(0x6) << 28)
63740 /*
63741 * This is a NQ consumer index update. It indicates one or more
63742 * entries have been processed off the NQ indicated on the xID
63743 * field. This type is valid for L2, RoCE and Engine path.
63744 */
63745 #define DBC_ABSOLUTE_DB_32_TYPE_NQ (UINT32_C(0xa) << 28)
63746 /*
63747 * This is a NQ consumer index update that also arms the NQ for
63748 * any new NQE. This type is valid for L2, RoCE and Engine path.
63749 */
63750 #define DBC_ABSOLUTE_DB_32_TYPE_NQ_ARM (UINT32_C(0xb) << 28)
63751 /*
63752 * This is a NQ consumer index update that also arms the NQ for
63753 * any new NQE. It is used for the legacy INT mask. This type
63754 * is valid for L2, RoCE and Engine path.
63755 */
63756 #define DBC_ABSOLUTE_DB_32_TYPE_NQ_MASK (UINT32_C(0xe) << 28)
63757 /*
63758 * This doorbell command is used during doorbell moderation
63759 * to consume system BW and help prevent doorbell FIFO
63760 * overflow.
63761 *
63762 * All other fields should be zero for NULL doorbell.
63763 * For doorbell recovery, NULL doorbell type in the Application
63764 * table indicates that it is the last QP entry for the function.
63765 * This type is valid for L2, RoCE and Engine path.
63766 */
63767 #define DBC_ABSOLUTE_DB_32_TYPE_NULL (UINT32_C(0xf) << 28)
63768 #define DBC_ABSOLUTE_DB_32_TYPE_LAST DBC_ABSOLUTE_DB_32_TYPE_NULL
63769 } dbc_absolute_db_32_t, *pdbc_absolute_db_32_t;
63770
63771 /*
63772 * This is the "Relative" 32b Doorbell format. The host writes this
63773 * message format directly to byte offset 8 of the appropriate doorbell
63774 * page.
63775 *
63776 * Doorbell recovery can not be supported for relative doorbells. So
63777 * relative doorbells are only safe to use when SOC is supporting the
63778 * context backing store in local DDR. If that is the case, it is safe
63779 * to turn off doorbell drops and use this type of doorbell.
63780 */
63781 /* dbc_relative_db_32 (size:32b/4B) */
63782
63783 typedef struct dbc_relative_db_32 {
63784 uint32_t xid;
63785 /*
63786 * This value identifies the resource that the doorbell is intended
63787 * to notify.
63788 *
63789 * For SQ, this is the QPID value.
63790 */
63791 #define DBC_RELATIVE_DB_32_XID_MASK UINT32_C(0xfffff)
63792 #define DBC_RELATIVE_DB_32_XID_SFT 0
63793 /*
63794 * This value defines the intended doorbell path between RoCE and
63795 * L2.
63796 */
63797 #define DBC_RELATIVE_DB_32_PATH_MASK UINT32_C(0xc00000)
63798 #define DBC_RELATIVE_DB_32_PATH_SFT 22
63799 /* This is a RoCE doorbell message. */
63800 #define DBC_RELATIVE_DB_32_PATH_ROCE (UINT32_C(0x0) << 22)
63801 /* This is a L2 doorbell message. */
63802 #define DBC_RELATIVE_DB_32_PATH_L2 (UINT32_C(0x1) << 22)
63803 #define DBC_RELATIVE_DB_32_PATH_LAST DBC_RELATIVE_DB_32_PATH_L2
63804 /*
63805 * This value is the value to add to the appropriate index value.
63806 *
63807 * The increment unit is 16B for L2 path. For RoCE there is a
63808 * legacy mode with 128B unit size and a variable size mode with
63809 * 32B unit size. For Engine mode, the unit size is always 128B.
63810 */
63811 #define DBC_RELATIVE_DB_32_INCR_MASK UINT32_C(0x1f000000)
63812 #define DBC_RELATIVE_DB_32_INCR_SFT 24
63813 /* This value identifies the type of doorbell being written. */
63814 #define DBC_RELATIVE_DB_32_TYPE_MASK UINT32_C(0xe0000000)
63815 #define DBC_RELATIVE_DB_32_TYPE_SFT 29
63816 /*
63817 * This is a SQ producer index update. It indicates one or more
63818 * new entries have been written to the SQ for the QPID indicated
63819 * on the xID field. This type is valid for L2, RoCE and Engine
63820 * path.
63821 */
63822 #define DBC_RELATIVE_DB_32_TYPE_SQ (UINT32_C(0x0) << 29)
63823 /*
63824 * This is a SRQ producer index update. It indicates one or more
63825 * new entries have been written to the SRQ for the SID indicated
63826 * on the xID field. This type is valid for L2 and RoCE path.
63827 */
63828 #define DBC_RELATIVE_DB_32_TYPE_SRQ (UINT32_C(0x1) << 29)
63829 /*
63830 * This is a CQ consumer index update. It indicates one or more
63831 * entries have been processed off the CQ indicated on the xID
63832 * field.This type is valid for L2, RoCE and Engine path.
63833 */
63834 #define DBC_RELATIVE_DB_32_TYPE_CQ (UINT32_C(0x2) << 29)
63835 /*
63836 * This is a CQ consumer index update that also arms the CQ
63837 * for any new CQE. This type is valid for L2, RoCE and Engine
63838 * path.
63839 */
63840 #define DBC_RELATIVE_DB_32_TYPE_CQ_ARMALL (UINT32_C(0x3) << 29)
63841 /*
63842 * This is a NQ consumer index update. It indicates one or more
63843 * entries have been processed off the NQ indicated on the xID
63844 * field. This type is valid for L2, RoCE and Engine path.
63845 */
63846 #define DBC_RELATIVE_DB_32_TYPE_NQ (UINT32_C(0x4) << 29)
63847 /*
63848 * This is a NQ consumer index update that also arms the NQ for
63849 * any new NQE. This type is valid for L2, RoCE and Engine path.
63850 */
63851 #define DBC_RELATIVE_DB_32_TYPE_NQ_ARM (UINT32_C(0x5) << 29)
63852 /*
63853 * This is a NQ consumer index update that also arms the NQ for
63854 * any new NQE. It is used for the legacy INT mask. This type
63855 * is valid for L2, RoCE and Engine path.
63856 */
63857 #define DBC_RELATIVE_DB_32_TYPE_NQ_MASK (UINT32_C(0x6) << 29)
63858 #define DBC_RELATIVE_DB_32_TYPE_LAST DBC_RELATIVE_DB_32_TYPE_NQ_MASK
63859 } dbc_relative_db_32_t, *pdbc_relative_db_32_t;
63860
63861 /*
63862 * The kernel memory structure is per-type (SQ, RQ, SRQ/SRQ_ARM and
63863 * CQ/CQ_ARMSE/CQ_ARMALL). Each kernel driver will support a table for
63864 * the doorbell recovery.
63865 */
63866 /* dbc_drk (size:128b/16B) */
63867
63868 typedef struct dbc_drk {
63869 uint32_t db_format_linked_last_valid;
63870 /*
63871 * This indicates it is valid entry. It should be set for each
63872 * doorbell written to the chip. The bit should be cleared at time
63873 * zero to indicate that it has not yet been written. The bit i
63874 * should be cleared when the function for the table is disabled.
63875 */
63876 #define DBC_DRK_VALID UINT32_C(0x1)
63877 /* This indicates it is last entry for the table. */
63878 #define DBC_DRK_LAST UINT32_C(0x2)
63879 /* This indicates it is entry for the next 4KB kernel memory pointer. */
63880 #define DBC_DRK_LINKED UINT32_C(0x4)
63881 /*
63882 * This field indicates if the doorbells in the table are 32b
63883 * absolute or 64b format.
63884 */
63885 #define DBC_DRK_DB_FORMAT UINT32_C(0x8)
63886 /* The doorbells are 64b format. */
63887 #define DBC_DRK_DB_FORMAT_B64 (UINT32_C(0x0) << 3)
63888 /*
63889 * The doorbells are in the absolute 32b format. The doorbell
63890 * is in the right-most half of the 64b space provided in the
63891 * application table entry.
63892 */
63893 #define DBC_DRK_DB_FORMAT_B32A (UINT32_C(0x1) << 3)
63894 #define DBC_DRK_DB_FORMAT_LAST DBC_DRK_DB_FORMAT_B32A
63895 uint32_t pi;
63896 /*
63897 * Page Index portion of DPI{VF_VALID,VFID,PI}. The pi needs to match
63898 * the value from the context DPI for the operation to be valid or the
63899 * pi must be zero, indicating a write from the privileged driver.
63900 *
63901 * pi in the kernel memory table is there for DBR to generate the DPI
63902 * message to the client.
63903 */
63904 #define DBC_DRK_PI_MASK UINT32_C(0xffff)
63905 #define DBC_DRK_PI_SFT 0
63906 /*
63907 * It is the application memory page(4KB) pointer when linked = 0.
63908 * It is the next kernel memory page(4KB) pointer when linked = 1.
63909 * The pointer doesn't have to be aligned to the page(4KB) but it
63910 * should be aligned to 128B boundary. This means that the bottom
63911 * 7b of the pointer must be zero.
63912 */
63913 uint64_t memptr;
63914 } dbc_drk_t, *pdbc_drk_t;
63915
63916 /*
63917 * This is a firmware status register that indicates the software status
63918 * exposed by the firmware to the host.
63919 *
63920 * > This register is not present in previous versions of this chip.
63921 */
63922 /* fw_status_reg (size:32b/4B) */
63923
63924 typedef struct fw_status_reg {
63925 uint32_t fw_status;
63926 /*
63927 * These bits indicate the status as being reported by the firmware.
63928 *
63929 * The value should be interpreted as follows:
63930 * A value below 0x8000 is an indication that the firmware is still in the
63931 * process of starting up and is not ready. The host driver should
63932 * continue waiting with a timeout for firmware status to be ready.
63933 * > 0x0000 to 0x00FF : SBL state information
63934 * > 0x0200 to 0x02FF : SBI state information
63935 * > 0x0400 to 0x04FF : SRT state information
63936 * > 0x0600 to 0x06FF : CRT/CHIMP state information
63937 * > 0x0800 to 0x0FFF : Reserved for future fw functionality
63938 *
63939 * A value of 0x8000 indicates firmware is ready and healthy. The host
63940 * driver can start initiating HWRM commands to the firmware.
63941 *
63942 * A value over 0x8000 is an indication that the firmware has detected
63943 * a fatal error, this error could be in one of the hardware block or
63944 * in a software module. The lower 8 bits indicate a block/module
63945 * specific error and the upper 8 bits identify the hardware block
63946 * or firmware module that was the source of the error.
63947 * > 0x81XX - 0xBFXX : 63 ASIC blocks
63948 * > 0xC0XX to 0xFEXX : 63 Firmware modules
63949 * > 0xFFXX : Reserved for future
63950 */
63951 #define FW_STATUS_REG_CODE_MASK UINT32_C(0xffff)
63952 #define FW_STATUS_REG_CODE_SFT 0
63953 /* Indicates firmware is ready. */
63954 #define FW_STATUS_REG_CODE_READY UINT32_C(0x8000)
63955 #define FW_STATUS_REG_CODE_LAST FW_STATUS_REG_CODE_READY
63956 /*
63957 * Image Degraded bit. If set indicates that one of the firmware
63958 * image is degraded.
63959 *
63960 * The firmware binary located on NVM has redundant copies to protect
63961 * against corruption. When one of the primary or secondary copy is
63962 * detected as corrupted, this bit will be set by the firmware either
63963 * as part of power on from the context of hwrm_fw_health_check.
63964 */
63965 #define FW_STATUS_REG_IMAGE_DEGRADED UINT32_C(0x10000)
63966 /*
63967 * Recoverable bit. If set indicates that the fatal error is
63968 * recoverable with a full reset.
63969 *
63970 * This bit should be used by host software and deployment models
63971 * that support error recovery by resetting the controller. A recovery
63972 * should be attempted from a fatal error condition only if this bit
63973 * is set. This bit is meaningful only when the code field is greater
63974 * than 0x8000 (32768 decimal).
63975 */
63976 #define FW_STATUS_REG_RECOVERABLE UINT32_C(0x20000)
63977 /*
63978 * Crash dump is in process. If set indicates that the firmware is
63979 * currently recording a crash dump.
63980 *
63981 * This bit provides a hint to the host driver if the firmware is
63982 * currently recording a crash dump. Host driers should avoid resetting
63983 * the controller when a crash dump is in progress if possible. This
63984 * bit is meaningful only when the code field is greater than
63985 * 0x8000 (32768 decimal).
63986 */
63987 #define FW_STATUS_REG_CRASHDUMP_ONGOING UINT32_C(0x40000)
63988 /*
63989 * Crash dump is available. If set indicates that a firmware crash dump
63990 * was recorded before and is now available.
63991 *
63992 * This bit provides indication to the host driver that the firmware has
63993 * completed a crash dump. This bit is meaningful only when the code
63994 * field is greater than 0x8000 (32768 decimal).
63995 */
63996 #define FW_STATUS_REG_CRASHDUMP_COMPLETE UINT32_C(0x80000)
63997 /*
63998 * This bit is used to indicate device state when it enters the shutdown mode
63999 * and stopped the communication with the host. The host should initiate the
64000 * reload of firmware image or initiate the reset to bring the device to the
64001 * normal operational state and re-establish the communication.
64002 *
64003 * This bit is meaningful only when the code field is greater than 0x8000
64004 * (32768 decimal).
64005 */
64006 #define FW_STATUS_REG_SHUTDOWN UINT32_C(0x100000)
64007 /*
64008 * This bit will be set to 1 by the FW when FW crashed without master
64009 * function.
64010 *
64011 * This bit is controller specific, not all products will support this bit.
64012 * This bit is valid only when the code field is greater than 0x8000
64013 * (32768 decimal).
64014 */
64015 #define FW_STATUS_REG_CRASHED_NO_MASTER UINT32_C(0x200000)
64016 /*
64017 * The firmware sets this bit to 1 when the firmware has taken an exception
64018 * and expects to initiate error recovery.
64019 *
64020 * This bit is valid only when the code field is greater than 0x8000
64021 * (32768 decimal).
64022 */
64023 #define FW_STATUS_REG_RECOVERING UINT32_C(0x400000)
64024 } fw_status_reg_t, *pfw_status_reg_t;
64025
64026 /*
64027 * This structure is fixed at the beginning of the ChiMP SRAM (GRC
64028 * offset: 0x31001F0). Host software is expected to read from this
64029 * location for a defined signature. If it exists, the software can
64030 * assume the presence of this structure and the validity of the
64031 * FW_STATUS location in the next field.
64032 */
64033 /* hcomm_status (size:64b/8B) */
64034
64035 typedef struct hcomm_status {
64036 uint32_t sig_ver;
64037 /*
64038 * This field defines the version of the structure. The latest
64039 * version value is 1.
64040 */
64041 #define HCOMM_STATUS_VER_MASK UINT32_C(0xff)
64042 #define HCOMM_STATUS_VER_SFT 0
64043 #define HCOMM_STATUS_VER_LATEST UINT32_C(0x1)
64044 #define HCOMM_STATUS_VER_LAST HCOMM_STATUS_VER_LATEST
64045 /*
64046 * This field is to store the signature value to indicate the
64047 * presence of the structure.
64048 */
64049 #define HCOMM_STATUS_SIGNATURE_MASK UINT32_C(0xffffff00)
64050 #define HCOMM_STATUS_SIGNATURE_SFT 8
64051 #define HCOMM_STATUS_SIGNATURE_VAL (UINT32_C(0x484353) << 8)
64052 #define HCOMM_STATUS_SIGNATURE_LAST HCOMM_STATUS_SIGNATURE_VAL
64053 uint32_t fw_status_loc;
64054 #define HCOMM_STATUS_TRUE_ADDR_SPACE_MASK UINT32_C(0x3)
64055 #define HCOMM_STATUS_TRUE_ADDR_SPACE_SFT 0
64056 /* PCIE configuration space */
64057 #define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_PCIE_CFG UINT32_C(0x0)
64058 /* GRC space */
64059 #define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_GRC UINT32_C(0x1)
64060 /* BAR0 space */
64061 #define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_BAR0 UINT32_C(0x2)
64062 /* BAR1 space */
64063 #define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_BAR1 UINT32_C(0x3)
64064 #define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_LAST HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_BAR1
64065 /*
64066 * This offset where the fw_status register is located. The value
64067 * is generally 4-byte aligned.
64068 */
64069 #define HCOMM_STATUS_TRUE_OFFSET_MASK UINT32_C(0xfffffffc)
64070 #define HCOMM_STATUS_TRUE_OFFSET_SFT 2
64071 } hcomm_status_t, *phcomm_status_t;
64072
64073 /* This is the GRC offset where the hcomm_status struct resides. */
64074 #define HCOMM_STATUS_STRUCT_LOC 0x31001F0UL
64075
64076 /****************
64077 * hwrm_oem_cmd *
64078 ****************/
64079
64080
64081 /* hwrm_oem_cmd_input (size:1024b/128B) */
64082
64083 typedef struct hwrm_oem_cmd_input {
64084 /* The HWRM command request type. */
64085 uint16_t req_type;
64086 /*
64087 * The completion ring to send the completion event on. This should
64088 * be the NQ ID returned from the `nq_alloc` HWRM command.
64089 */
64090 uint16_t cmpl_ring;
64091 /*
64092 * The sequence ID is used by the driver for tracking multiple
64093 * commands. This ID is treated as opaque data by the firmware and
64094 * the value is returned in the `hwrm_resp_hdr` upon completion.
64095 */
64096 uint16_t seq_id;
64097 /*
64098 * The target ID of the command:
64099 * * 0x0-0xFFF8 - The function ID
64100 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
64101 * * 0xFFFD - Reserved for user-space HWRM interface
64102 * * 0xFFFF - HWRM
64103 */
64104 uint16_t target_id;
64105 /*
64106 * A physical address pointer pointing to a host buffer that the
64107 * command's response data will be written. This can be either a host
64108 * physical address (HPA) or a guest physical address (GPA) and must
64109 * point to a physically contiguous block of memory.
64110 */
64111 uint64_t resp_addr;
64112 uint32_t IANA;
64113 uint32_t unused_0;
64114 /* This field contains the vendor specific command data. */
64115 uint32_t oem_data[26];
64116 } hwrm_oem_cmd_input_t, *phwrm_oem_cmd_input_t;
64117
64118 /* hwrm_oem_cmd_output (size:768b/96B) */
64119
64120 typedef struct hwrm_oem_cmd_output {
64121 /* The specific error status for the command. */
64122 uint16_t error_code;
64123 /* The HWRM command request type. */
64124 uint16_t req_type;
64125 /* The sequence ID from the original command. */
64126 uint16_t seq_id;
64127 /* The length of the response data in number of bytes. */
64128 uint16_t resp_len;
64129 uint32_t IANA;
64130 uint32_t unused_0;
64131 /* This field contains the vendor specific response data. */
64132 uint32_t oem_data[18];
64133 uint8_t unused_1[7];
64134 /*
64135 * This field is used in Output records to indicate that the output
64136 * is completely written to RAM. This field should be read as '1'
64137 * to indicate that the output has been completely written.
64138 * When writing a command completion or response to an internal processor,
64139 * the order of writes has to be such that this field is written last.
64140 */
64141 uint8_t valid;
64142 } hwrm_oem_cmd_output_t, *phwrm_oem_cmd_output_t;
64143
64144 /***********
64145 * hwrm_sv *
64146 ***********/
64147
64148
64149 /* hwrm_sv_input (size:1152b/144B) */
64150
64151 typedef struct hwrm_sv_input {
64152 /* The HWRM command request type. */
64153 uint16_t req_type;
64154 /*
64155 * The completion ring to send the completion event on. This should
64156 * be the NQ ID returned from the `nq_alloc` HWRM command.
64157 */
64158 uint16_t cmpl_ring;
64159 /*
64160 * The sequence ID is used by the driver for tracking multiple
64161 * commands. This ID is treated as opaque data by the firmware and
64162 * the value is returned in the `hwrm_resp_hdr` upon completion.
64163 */
64164 uint16_t seq_id;
64165 /*
64166 * The target ID of the command:
64167 * * 0x0-0xFFF8 - The function ID
64168 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
64169 * * 0xFFFD - Reserved for user-space HWRM interface
64170 * * 0xFFFF - HWRM
64171 */
64172 uint16_t target_id;
64173 /*
64174 * A physical address pointer pointing to a host buffer that the
64175 * command's response data will be written. This can be either a host
64176 * physical address (HPA) or a guest physical address (GPA) and must
64177 * point to a physically contiguous block of memory.
64178 */
64179 uint64_t resp_addr;
64180 uint32_t opaque[32];
64181 } hwrm_sv_input_t, *phwrm_sv_input_t;
64182
64183 /* hwrm_sv_output (size:1088b/136B) */
64184
64185 typedef struct hwrm_sv_output {
64186 /* The specific error status for the command. */
64187 uint16_t error_code;
64188 /* The HWRM command request type. */
64189 uint16_t req_type;
64190 /* The sequence ID from the original command. */
64191 uint16_t seq_id;
64192 /* The length of the response data in number of bytes. */
64193 uint16_t resp_len;
64194 uint32_t opaque[32];
64195 } hwrm_sv_output_t, *phwrm_sv_output_t;
64196
64197 #endif /* _HSI_STRUCT_DEF_EXTERNAL_H_ */
Cache object: 6cced0a6a44e61d75888e8abebbd04ef
|